Skip to main content
some explanation (this has been asked in chat)
Source Link
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}" 

And then you can checkwhich defines the value ofmacro ishandout\ishandout (and whether it's definedto be 1) inside fooand then reads foo.tex.tex And then, inside foo.tex, you can check whether \ishandout is defined:

\ifdefined\ishandout \documentclass[handout]{beamer} \else \documentclass{beamer} \fi 

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}" 

And then you can check the value of ishandout (and whether it's defined) inside foo.tex:

\ifdefined\ishandout \documentclass[handout]{beamer} \else \documentclass{beamer} \fi 

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 
added 125 characters in body
Source Link
Neil Olver
  • 5.2k
  • 5
  • 26
  • 18

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\param"\def\ishandout{1} \input{foo.tex}" 

And then you can check the value of paramishandout (and whether it's defined) inside foo.tex.:

\ifdefined\ishandout \documentclass[handout]{beamer} \else \documentclass{beamer} \fi 

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\param{1} \input{foo.tex}" 

And then you can check the value of param (and whether it's defined) inside foo.tex.

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}" 

And then you can check the value of ishandout (and whether it's defined) inside foo.tex:

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

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\param{1} \input{foo.tex}" 

And then you can check the value of param (and whether it's defined) inside foo.tex.