On Thu, 2004-12-02 at 17:57, Angus Leeming wrote: > Jean-Marc Lasgouttes wrote: > > Martin> And then how to build on this? > > > > I do not have much time to look at it now, but the idea is that you > > should use sed to keep only the languages, and then do something like > > > > echo "s/@chk_languages@/${languages}/g" >>chkconfig.sed > > > > Then if you add the text @chk_languages@ in some text in > > LaTeXConfig.lyx.in, it will be replaced by the list of available > > languages. > > # Grab the list of languages avaliable to LaTeX > # by parsing the LaTeX log file, chklatex.log. > LANGUAGES=`sed -n '/hyphenation patterns/{ > :loop > /loaded\.$/!{ > $!{ > N > s/\n// > tloop > } > } > /loaded\.$/p > }' chklatex.log` > > # Add a line to chkconfig.sed so that the placeholder in > # LaTeXConfig.lyx.in will be replaced by the list of available > # languages. > test "${LANGUAGES}" != "" && \ > echo "s/@chk_languages@/${LANGUAGES}/g" >> chkconfig.sed
Done! Works as such :-) see attached. What next? - Martin
Index: configure.m4 =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v retrieving revision 1.85 diff -u -w -r1.85 configure.m4 --- configure.m4 15 Nov 2004 19:13:25 -0000 1.85 +++ configure.m4 2 Dec 2004 16:26:45 -0000 @@ -219,6 +219,19 @@ LATEX= ac_result="not useable" fi +# Grab the list of languages avaliable to LaTeX by parsing the LaTeX log file, chklatex.log. +LANGUAGES=`sed -n '/hyphenation patterns/{ +:loop +/loaded\.$/!{ +$!{ +N +s/\n// +s/^.*for\ // +tloop +} +} +/loaded\.$/p +}' chklatex.log` rm -f chklatex.ltx chklatex.log])dnl dnl # Search LaTeX2e @@ -523,6 +536,11 @@ echo "creating doc/LaTeXConfig.lyx" echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed +# Add a line to chkconfig.sed so that the placeholder in +# LaTeXConfig.lyx.in will be replaced by the list of available +# languages. +test "${LANGUAGES}" != "" && \ + echo "s/@chk_languages@/${LANGUAGES}/g" >> chkconfig.sed sed -f chkconfig.sed "${srcdir}"/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx echo "creating $outfile" Index: doc/LaTeXConfig.lyx.in =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/doc/LaTeXConfig.lyx.in,v retrieving revision 1.40 diff -u -w -r1.40 LaTeXConfig.lyx.in --- doc/LaTeXConfig.lyx.in 4 Nov 2004 15:42:38 -0000 1.40 +++ doc/LaTeXConfig.lyx.in 2 Dec 2004 16:26:46 -0000 @@ -1,5 +1,7 @@ #LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/ -\lyxformat 232 +\lyxformat 237 +\begin_document +\begin_header \textclass article \language english \inputencoding default @@ -7,14 +9,12 @@ \graphics dvips \paperfontsize 0 \spacing single -\papersize Default -\paperpackage a4 -\use_geometry 0 +\papersize default +\paperpackage none +\use_geometry false \use_amsmath 0 -\use_natbib 0 -\use_numerical_citations 0 -\use_jurabib 0 -\use_bibtopic 0 +\cite_engine basic +\use_bibtopic false \paperorientation portrait \secnumdepth 2 \tocdepth 3 @@ -25,9 +25,11 @@ \papercolumns 1 \papersides 1 \paperpagestyle plain -\tracking_changes 0 +\tracking_changes false \end_header +\begin_body + \begin_layout Title Inventory of your LaTeX configuration @@ -2105,6 +2107,18 @@ if you want to use non-English quotes. \end_layout +\begin_deeper +\begin_layout Subsubsection* + +Languages for which hyphenation patterns are loaded: +\end_layout + +\begin_layout Standard + [EMAIL PROTECTED]@ +\end_layout + +\end_deeper \begin_layout Subsection color @@ -2720,4 +2734,5 @@ is needed by LyX to be able to output url's corrently. \end_layout +\end_body \end_document
signature.asc
Description: This is a digitally signed message part