David Soukal wrote:
Hello guys,
I'm sorry to bother you with something that's must have been answered
many times, but I can't find a quick answer in the documentation.
I've just discovered the beauty of multipart documents. But I almost
instantly ran into problems. What happens is the following. I have a
big document (thesis :)) with a lot of math-macro commands defined at
the very beginning. After my recent casual browsing through the
documentation I rediscovered that I can have my long document split
into parts.
Happily, I divideded my thesis into files: each chapter now has its
own file. The problem is how to share the macros defined originally
once at the top of the long document. I created one more file
containing only the macros and then I "inputted" it into each of the
files with the individual chapters.
The chapters compile fine, however, the master won't compile because
of multiple definition of the same macros.
So, I'm looking for conditional compilation... something from C header
files..
Or is there something more elegant that I'm not seeing?
Depends - are these plain latex macros, or "lyx macros" ?
For latex macros this is trivial. Define them in the preamble! That
works well, because in the multi-document include case, only the
preamble from the master document is used. So the chapter document's
preamble is only used when the chapter document is compiled alone.
Nothing gets doubly defined - this always works.
If you meant -"lyx macros" - then I don't know. Few people use them.
Helge Hafting