2

Is there a possibility that with compiling my latex document all the time two PDFs are created (a oneside and twoside version). So in my case only the first line would be different for the two versions:

\documentclass[11pt, a4paper, oneside]{scrreprt}
\documentclass[11pt, a4paper, twoside]{scrreprt}
4
  • Probably with arara or latexmk combined with one of these answers you can automatically compile your document twice, one for oneside and another for twoside.
    – Ignasi
    Mar 22, 2016 at 8:56
  • Printing on a Möbius strip?
    – Bernard
    Mar 22, 2016 at 9:52
  • 1
    don't use \documentclass in your .tex file and compile with pdflatex --jobname one \documentclass[11pt, a4paper, oneside]{scrreprt}\input{myfilename} & pdflatex --jobname two \documentclass[11pt, a4paper, twoside]{scrreprt}\input{myfilename}
    – touhami
    Mar 22, 2016 at 13:05
  • @Bernard For printing on a Möbius strip you only need \documentclass[11pt, a4paper, oneside]{scrreprt} ;) Mar 22, 2016 at 16:44

1 Answer 1

1

If it's easier for you, you can also alter your .tex source file within a batch script during compilation. For example, here is an example using a DOS script.

Given a sample.tex file:

\begin{document}
\thispagestyle{empty}
Hello
\end{document}

The following batch file will create two different tex files and process them to give the shown output.

echo \documentclass[10pt]{article} > temp10.tex
type sample.tex >> temp10.tex
pdflatex temp10.tex

echo \documentclass[12pt]{article} > temp12.tex
type sample.tex >> temp12.tex
pdflatex temp12.tex

enter image description here

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .