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:-

    code only for LuaLaTeX and not for PdfLaTeX

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)?

  • 3
    You can use the ifluatex package and then \ifluatex ...\fi. – Ulrike Fischer May 3 at 12:20
  • 1
    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

Based on the comments above, I'd suggest a combination of both:

  • 2
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.