I have a large document which currently is comprised of a variety of .tex
files.
The mainfile.tex
looks something like:
%lots of total formatting stuff
\include{Body/chapter1}
\include{Body/chapter2}
%\include{Body/chapter3}
%\include{Body/chapter4}
%etc
However, this means each of the components (ie chapter1, chapter2, etc) are not valid code.
I want to be able to view an individual file and compile while viewing it (ex. chapter1.tex
) within TeXmaker. I am fine if this compiles mainfile.tex
As I understand, I need to either combine everything into one file or do either:
- tell TeXmaker to let me set a "always compile this file even if not viewing it" option somewhere - so things like F1, etc work, and always reference the
mainfile.tex
or
- move all my formatting initialization, etc, to a file which I can include at the front of each individual component (and include some sort of header guard in this? I have no idea if this concept is feasible or even makes sense in LaTeX) so the same overall formatting is ALWAYS included at the beginning of a document regardless as to the order they are included.
I would strongly prefer the second option if possible but I am unsure how to do this.
\includeonly{..}
? With this you can select which\include
-d files get really included. If you put your front (ToC, etc.) and back-matter (appendix etc.) also in own file and\include
them you can compile things chapters. See e.g. Keep chapter number of chapters inserted with \include for details. – Martin Scharrer♦ Jan 18 '13 at 20:53