GeneralCustomize Compiler

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
woltan
Posts: 19
Joined: Mon Mar 09, 2009 2:08 pm

Customize Compiler

Post by woltan »

Hi folks,
I was wondering if there is a way to customize which part of my tex files should be compiled. Something anologe to C++:

#ifdef FOO
compile this
#else
then compile this
#endif

Thx in advance for any hint or help!
cherio Woltan

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: Customize Compiler

Post by kaiserkarl13 »

Please check out the ifthen package. This may help you do what you wish to do.
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Customize Compiler

Post by josephwright »

For longer sections, look at the comment package.
Joseph Wright
woltan
Posts: 19
Joined: Mon Mar 09, 2009 2:08 pm

Re: Customize Compiler

Post by woltan »

Heyas,
first of all, thx for the suggestions. I think especially the comment package should fit my needs. However, I was hoping that there are some Enviroment Varibles that the compiler can access in order to compile different versions of the document. With the comment package I would always have to set the comment sections by hand each time I compile a version of the document.

Maybe there still is a way to kick the compiler in order to get different versions of the document.
cherio and thx again for the hints!
Woltan
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Customize Compiler

Post by phi »

You can hand over anything to the document by calling the compiler with a command sequence instead of an input file name:

Code: Select all

pdflatex '\newcommand*{\mysetting}{myvalue}\input{file.tex}'
Post Reply