# Conditional compilation depending on the compiler (LuaLaTeX/PdfLaTeX)

I am using plantuml package, which requires LuaLaTeX, but it takes a lot of time to build every time all figures. For that reason I prefer to make a dry run (to get only the pure LaTeX outcom), but unfortunately the PdfLaTeX does not skip the code between \begin{plantum} and \end{plantuml} and as expected gives errors. To solve this I decided to put the plantuml code in condition like:-

    \ifsomeMagicVariable
code only for LuaLaTeX and not for PdfLaTeX
\fi


The question is how to pass (set to true) this variable from outside, i.e. from the LuaLaTeX's command line, or better if there is a way to recognize that the tex file is processed by LuaLaTeX (if there is some pre-defined macro)?

• You can use the ifluatex package and then \ifluatex ...\fi. – Ulrike Fischer May 3 at 12:20
• Alternatively, you can put \usepackage{comment}\excludecomment{plantuml} in your preamble (after \usepackage{plantuml}). Then the UML environments will be ignored (by all engines, so also by LuaLaTeX). This has the advantage that you don't need to add anything to the environments themselves, and the disadvantage that you manually need to remove the \excludecomment line when you want to compile the figures again. – Marijn May 3 at 13:32

\usepackage{ifluatex}

• The opening (\begin{plantuml}) and closing (\end{plantuml}) commands should appear on a line of their own. No starting spaces, nothing after it. – user10982983 May 7 at 8:06