Hi all, My Layout file, derived from the Book doc class, has the following code:
======================================== \ifx\stevelitt\undefined \else \renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\slshape\chaptername{} \thechapter: #1}}{}} %\renewcommand{\sectionmark}[1]{\markright{\MakeUppercase{\slshape\thesection : #1}}} \renewcommand{\sectionmark}[1]{\markright{Steve Stiffler}} \fancyhf{} \fancyhf[OLH]{\rightmark} \fancyhf[ERH]{\leftmark} \fancyhf[ORH,ELH]{\thepage} \fi ======================================== Ideally, what I'd like to do is set (or not set) command \stevelitt in the LyX Document Preamble, but that doesn't work --- define it or not, the layout code acts as if it's not defined. I suspect the reason is that LyX places the code from the layout file earlier in the resultant LaTeX file than the LyX document preamble, so \stevelitt is always undefined *when the conditionally compiled code is encountered*. My ideal solution to this conditional compilation would be to simply define a variable within the LyX file and have that work. I haven't been able to do that. Uglier solutions, which I haven't tried yet, would be to modify the layout with AWK just before the compilation, or run the LaTeX command like: latex "\edef\stevelitt{$1}\input{myfile.latex}" Something I *haven't* been able to get to work is to put the conditional code inside a command and just call the command from the LyX LaTeX preamble. The conditional code gets arguments like #1 very confused when it's placed inside a command. I could put the code that will be conditionally compiled inside the LyX LaTeX document preamble, but that would be sloppy. Does anyone know a good way to trigger conditional compilation from within the LyX file itself? Thanks, SteveT Steve Litt * http://www.troubleshooters.com/ Troubleshooting Training * Human Performance