On 12.06.05, Richard Brown wrote:
> What I'd like to be able to do is write all the elements for each
> exercise at the same time in the same file, defining them as "students
> book", "teachers book" "CD stuff" as I go, so that everything is
> checkable as I write it, and is co-ordinated.
The ifthen latex package is your friend here.
In the LaTeX preamble (Format>Document>Latex Preamble) insert
\usepackage{ifthen}
% create toggles
\newboolean{students} % print students parts? TRUE|FALSE
\newboolean{teachers} % print teachers parts? TRUE|FALSE
\newboolean{CDscript} % print CDscript parts? TRUE|FALSE
% print everything by default
\setboolean{students}{true}
\setboolean{teachers}{true}
\setboolean{CDscript}{true}
and in the document, include the relevant parts with ERT boxes
(red latex text press Ctrl-l to get it) containing
\ifthenelse{\boolean{students}}{}{
and
}
.
> Then, when I come to print
> it, to have the software automatically understand where the elements go,
> and print it to the right file so that I end up with 4 files: the
> master, the students book, the teachers book and the CD script. All
> properly cross-reefernced.
There are 2 options: You change in the preamble or in an ERT box at the
top of your document e.g.
\setboolean{students}{false}
\setboolean{CDscript}{false}
to get the teachers script. (And change and print again for all other
versions.)
Or you create wrappers for all versions that contain the "right" preamble
and include the main content (Insert>File>LyX-Document). In this case,
the inserted file should not contain the setup code in the preamble, as
this would override the wrapper setting.
G�nter
--
G.Milde web.de