Suppose you have a style like this:
Style Test
LaTeXType command
LaTeXName whatever
InPreamble 1
Preamble
\newcommand\whatever[1]{#1}
EndPreamble
End
Then LyX gives you:
% LyX specific LaTeX commands.
\whatever{this is a test}
% Textclass specific LaTeX commands.
\newcommand\whatever[1]{#1}
Which will of course fail. Obviously, the problem is that we output the
"Preamble" code *after* we output the code from the paragraph itself.
This seems to me to count as a bug. To fix it, though, we'd obviously
have to output the code from the style AFTER the Preamble, which would
change the TeX export of lots of files. An alternative would be to
introduce a new tag that would basically mean: Output this before or
after the Preamble code. But I can't imagine why you'd want to do it
before the Preamble code.
Thoughts?
Richard