Skip to main content
3 of 3
some explanation (this has been asked in chat)
Caramdir
  • 92.3k
  • 27
  • 264
  • 297

Here's a hacky way, probably this is the wrong way :).

Instead of passing a filename, you can pass a sequence of commands. So in particular, you could do something like

pdflatex "\def\ishandout{1} \input{foo.tex}" 

which defines the macro \ishandout (to be 1) and then reads foo.tex. And then, inside foo.tex, you can check whether \ishandout is defined:

\ifdefined\ishandout \documentclass[handout]{beamer} \else \documentclass{beamer} \fi 
Neil Olver
  • 5.2k
  • 5
  • 26
  • 18