Latex conditional compilation

It’s a long time I’m looking for a way to conditional-compiling my Beamer presentation in order to decide on the fly if I want to print an handout version of the presentation.

Inside the .tex file you have to write

\ifdefined\HANDOUT
  \setbeameroption{show notes} %un-comment to see the notes
  \usepackage{pgfpages}
  \pgfpagesuselayout{8 on 1}[a4paper]%, landscape]
\fi

where the pgfpages package is used to print 8 slide per page.
Before this if you want you can put \newcommand*{\HANDOUT}{}% to decide in the source if you want the handout version or not…
… or you can decide it via command line:

pdflatex -jobname=handout.pdf  "\def\HANDOUT{}\input{sourcefile.tex}"
Tags// , ,
More Reading
Newer// Git references
comments powered by Disqus