For programming in C, it is quite common to switch between creating debug- and release-versions by passing a command line argument to the compiler.
I would like to have something similar for pdflatex. Optimally, there would be conditional parts within the source LaTeX file depending on some variable, and then the switching between the versions can be done by somehow setting this variable at the command-line invocation of pdflatex.
Is it possible to achieve something like this? What's the easiest / cleanest way?
pdflatex '\def\zz{yes}\input' mainfile– David Carlisle Apr 19 '15 at 11:18\newboolean{variable}, which needs the packageifthen. Is is also possible to assign such a variable a value from the command line? – azimut Apr 19 '15 at 12:22'\def\zz{yes}\input'does. Alternatively, you could write a small bash script for example who finds the value of the variable in thetexfile and compile accordingly. – anderstood Apr 19 '15 at 12:33arara, maybe? There is-draftmodebut I don't think it is what you want. – cfr Apr 19 '15 at 12:43arara. – cfr Apr 19 '15 at 12:46\usepackage{ifthen}and\newboolean{var}. If I compile this with'pdflatex \def\var{yes}\input'(orpdflatex '\def\var{true}\input', thenvarseems still to be set tofalse. – azimut Apr 19 '15 at 12:56