A. Scottedward Hodel wrote:
On Apr 19, 2008, at 8:33 PM, rgheck wrote:
A. Scottedward Hodel wrote:
I am trying to write a textbook layout file (current version is
attached) that will let me set a "switch" in the preamble of my LyX
file so that I can easily generate both a teacher's version (with
solutions) and a student version (without homework solutions).
What I've attempted to do is to put the command
\def\notestype{teacher}
in the Document -> Settings -> LaTeX preamble
window of LyX. However, this seems to be loaded after the layout
preamble is set. Is there a way for me to have at least a part of
the layout preamble processed /after/ the Documents -> Settings
preamble? If I can do this, then I will be able to work within LyX
rather than LaTeX, which I would like to do.
At present, no, you can't do that, but I'm not sure why you really
need to do so. Can't you just do something like this:
\ifequal\notestype....
in the environments (or commands) themselves? Then it doesn't matter
what gets loaded first. (If this isn't clear, post your layout, and
we can work on it together. All of us!!)
The other possibility is to use branches, which are designed for
precisely this sort of use.
rh
Thanks. I've tried a number of \ifthenelse environment definitions in
the LaTeX version, including the use of xcomment, but so far nothing
that works "cleanly." My current workaround (temporary) is to just
edit the layout and then reconfigure LyX when I want to change
version. Since I won't be changing edition that often, that's fine
for me, but not really appropriate for general use. I think I may be
able to isolate the "offending" commands to fall in the LyX preamble
by themselves, but I'll work on that later.
Another possibility is just a nearly identical layout, and then you can
switch between them on the fly.
In 1.6.x, you can probably do this more naturally using a "module".
rh