I am trying to export different pictures as PDFs. I have followed the answer here to give a condition on a figure. It works with a single picture/condition, but I need to combine multiple conditions.
mwe.tex
:
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{external}
\usepackage{pgfplots}
\tikzexternalize
\begin{document}
\ifdefined\varOne
\makeatletter
\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error
-interaction=batchmode -jobname "\image" "\string\def\string\varOne{}\texsource"}}
\makeatother
I want to include varOne
\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis} []
\end{axis}
\end{tikzpicture}
\end{figure}
\fi
\ifdefined\varTwo
\makeatletter
\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error
-interaction=batchmode -jobname "\image" "\string\def\string\varTwo{}\texsource"}}
\makeatother
I want to include varTwo with value \varTwo
\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis} []
\end{axis}
\end{tikzpicture}
\end{figure}
\fi
\end{document}
I can currently decide which figure to extract with:
pdflatex -shell-escape "\def\varOne{}\input{mwe}"
or
pdflatex -shell-escape "\def\varTwo{2}\input{mwe}"
But I want to be able to handle combinations of multiple conditions e.g.
pdflatex -shell-escape "\def\varOne{}\def\varTwo{2}\input{mwe}"
Fails. In this case I would expect to generate both figures.