Let me state my "problem" first. When using PdfLateX my .tex file compiles rather swiftly and all is fine. I use TeXStudio and make use of the PDF preview feature. Since my LaTeX fu isn't the strongest, I compile quite often (to see if I broke something recently; and yes I make use of a version control system as well).

Now using PdfLaTeX we're talking about 3 to 3.5 seconds for it to compile.

Recently I added \usepackage{fontawesome} which apparently requires XeLaTex or LuaLaTex. Trying out the two options only LuaLaTeX was left, as the other one errored out.

I use the fontawesome package to get a symbol for external links onto each \href for which I define my own command, though (see below).

Now what I noticed once I switched to LuaLaTeX was that it takes considerably longer to compile the document: 10 seconds.

So my thought process was the following: if I could detect the presence of LuaLaTeX, I could conditionally include the parts that are "offending" to PdfLaTeX.

Is it possible to do that, i.e. distinguish between PdfLaTeX and LuaLaTeX?

Without fontawesome

% ... a bunch of packages, including hyperref
% define \linkclr
% ... actual document

With fontawesome

% ... a bunch of packages
% ... more packages, including hyperref
% define \linkclr
% ... actual document

Yes, I realize that this "complaint" about speed is laughable with respect to the speeds from some years ago. But if not for the speed, please consider answering it to satisfy my curiosity.

  • 1
    Independently of your question, you’re not necessarily doing yourself a favour by switching engines for the sake of a single symbol. May 27, 2015 at 10:31
  • @ArthurReutenauer: care to explain? I guess I don't know enough to even appreciate your comment. Any pointers to documentation? I always thought of LuaTeX as more or less a preprocessor. May 27, 2015 at 10:33
  • It’s not. It’s a completely different TeX engine (incidently based, amongst others, on pdfTeX). It’s not meant to be fully compatible and if you have longish documents, you should probably check carefully that the output of LuaTeX is satisfactory to you before switching. May 27, 2015 at 10:36
  • @ArthurReutenauer: thanks for the clarification. Then I guess I need to read a little more about how they all differ. May 27, 2015 at 10:39

2 Answers 2


Use the ifluatex package.

  • wow, that's a swift response. Thanks. So that package also works without LuaTeX then? Let me just try and get back here :) May 27, 2015 at 10:29
  • 1
    Well, obviously it works with all engines. What would be the point of a package to detect engines if it only worked with some of them? May 27, 2015 at 10:30
  • 2
    @ArthurReutenauer: yeah, in my life I have learned that common sense isn't so common after all, so I decided to ask. Tested it also and it works. May 27, 2015 at 10:32

If you want to differentiate between PDF-, Xe- and Lua(La)TeX, you might want consider the iftex package which provides the commands \ifPDFTeX, \ifXeTeX and \ifLuaTeX.

You must log in to answer this question.

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