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

-- 
Angus

Reply via email to