The problem I'm facing is the following: I want to write two documents that share most of the content. One will be my master thesis, and the other a user manual for the application, which will contain a subset of the sections of the whole work.
For the thesis, I'm using a "book" document class. However, I want "article" for the latter. Therefore, I will be declaring "chapters - sections" in one while "sections - subsections" in the other.
I've come up with two solutions so far:
1. declare some commands for the chapter, sections, etc... that I can customize for both versions:
Code: Select all
\newcommand{\mychapter}{\chapter}
\newcommand{\mysection}{\section}
Code: Select all
\newcommand{\mychapter}{\section}
\newcommand{\mysection}{\subsection}
This way, every time I want to compile a PDF, I just comment out the ones that not apply.
2. use the package ifthen, so I can set a variable that says which mode we want to compile for (thesis or manual), and then generate chapter or section.
Now, the problem which these aproaches is that the TOC is not generated. Does anyone know how can I fix this?
(Note that I do *not* want to rewrite any text, that's why I'm having this headache.)