Thanks Ingar for the further explanations!

So the problem is most probably that subfig also uses \AtBeginocument{}, so my own \AtBeginDocument does not work... The second solution, using the code in ERT, is not possible in my case, since it is a whole package. I will then try Richard's solution (creating specific layout to prevent Lyx to put this code at bottom of preamble), which seemed to be more complicated though.

Thanks a lot!

Matthieu



Le 22. 02. 11 12:15, Ingar Pareliussen a écrit :
Hi

The \AtBeginDocument seems indeed to be what I am looking for! But what
is its expected behavior? I still see in both the Lyx-latex sources and
exported .tex the command \AtBeginDocument before the babel/subfig
lines...
\AtBeginDocument is a LaTeX command and should ensure that the command is 
executed
just before \begin{document} even if it is placed before the LyX internal 
command.
The caveat is that some packages also use the command (natbib is one example) 
and
then the last \AtBeginDocument  is placed closes to \begin{document}...

However, if this happens you have to try my other suggestion (the ERT box) or 
export
to LaTeX and change the code and run LaTeX manually.


hth,
Ingar Pareliussen


Reply via email to