GeneralMaster file and #ifdef

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pohorc
Posts: 1
Joined: Thu Feb 11, 2010 2:16 pm

Master file and #ifdef

Post by pohorc »

Hello!

I'm preparing latex project containing few content tex files and a master file.

I'm looking for the solution how to compile, build project from the master file or from the content file itself...
From the master file i have, for example:

Code: Select all

    main.tex
    abstract.tex
    Ch1.tex
    Ch2.tex
with

Code: Select all

\documentclass{report}
\begin{document}
\input{abstract.tex}
\input{Ch1.tex}
\input{Ch2.tex}
\end{document}
And now, in the content file (Chx.tex) I would need something like that:

Code: Select all


#ifndef MASTER_FILE
\documentclass{report}
\begin{document}
#endif
....
....
...
#ifndef MASTER_FILE
\end{document}
#else
\endinput
#endif
I already excluded \ifthenelse and \iftoggle, because they are not suitable for the job...

Any ideas how to achieve that?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply