7

Is it possible to export into 2 PDF Files at once? It should have the same text, but use 2 different style documents. For now I just rename the Style Documents all the time, but there must be an easier way right?

I am using a beamer class theme, but I need it one in a white background and one in a dark one. And it would be convenient to be able to export 2 pdfs at once with each style document.

I am using texlive-2015 on Kde Neon with Texmaker.

Severus15
  • 207

1 Answers1

6

With a little trick, you can pass information to your .tex file when compiling. So all you need is some makefile that compiles the following example with

 pdflatex -jobname=dark  filename
 pdflatex -jobname=light filename

This can be done from within texmaker with a magic comment.

Argh! Apparently texmaker, unlike it's sibling texstudio, does not understand magic comments :(

% !TeX program = pdflatex -jobname=dark % | pdflatex -jobname=light %

\documentclass{beamer}
\usepackage{xstring}

\IfEq{\jobname}{\detokenize{dark}}{
    \setbeamercolor{background canvas}{bg=blue!50!black}
}{%
    \setbeamercolor{background canvas}{bg=blue!50!white}
}%

\begin{document}

\begin{frame}
    bla
\end{frame}


\end{document}

enter image description here

DG'
  • 21,727