On Monday 25 May 2009 10:40:43 am Oscar Lopez wrote:
> Dear all
>
> I have been able to reproduce the problem. Attached there is a minimal
> lyx file together with a minimal preamble (foo.tex) which reproduces the
> problem.
>
> * if the lyx preamble consists of \input{foo.tex} it does not work and
> the aforementioned error appears. If I enclose \input{foo.tex} between
> \makeatletter and \makeatother then it works, which really puzzles me.
>
> *if the content of the preamble foo.tex is directly included in the lyx
> preamble
> everything work like expected.
>
> I am completely shocked about such behaviour.
:-) You'd be a little less shocked if you worked with macros in C :-)
> I am not sure what is
> going on and I'd appreciate somebody could comment about this.
You have a command in foo.tex that can't be nested further. I think they're
called "fragile commands", although we're getting past my LaTeX expertise at
this point. You already found the solution -- surround with
makeatletter/makeatother.
What surprises me is that it's dependent on LyX version. If the LyX file is
called bar.lyx, I'd like to see you do the following:
lyx-1.5.4 -e latex bar.lyx
mv bar.tex bar-1.5.4.tex
lyx-1.6.2 -e latex bar.lyx
mv bar.tex bar-1.6.2.tex
diff bar-1.5.4.tex bar-1.6.2.tex
Then run latex on both tex files and see if one errors out while the other
doesn't. Exploit the differences.
HTH
SteveT
Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt