48

It is not hard to change the default compilation engine in TeXstudio from PDFLaTeX to LuaLaTeX (or any other engine for that matter). But if I only want to use LuaLaTeX for a single document, it gets tedious to go into the menus and find the LuaLaTeX option all the time. And the command line approach is also more time-consuming.

Is there some clever way to tell TeXstudio to always compile this (and only this) document using LuaLaTeX?

Gaussler
  • 12,801

2 Answers2

73

Just insert the “magic comment”

% !TeX program = lualatex

at the beginning of your .tex file.

Franck Pastor
  • 18,756
  • 1
    And this works regardless of what editor I use? – Gaussler Apr 04 '15 at 08:43
  • 1
    It may work with some other editors, but not all. It doesn't work for my own preferred editor, for example: TeXShop (on Mac OS X). The magic comment for TeXShop would have been % !TEX TS-program = LuaLaTeX – Franck Pastor Apr 04 '15 at 08:47
  • 2
    To elaborate on my previous comment, the magic command syntax for TeXStudio seems to work also for TeXworks: http://www.texdev.net/2011/03/24/texworks-magic-comments/. I've just tried it with TeXmaker, unsuccessffuly. – Franck Pastor Apr 04 '15 at 08:56
  • @fpast TeXmaker doesn't appear to support the directives, see our LaTeX IDE list. – yo' Apr 04 '15 at 09:23
  • 3
    For more details what can configure with "magic comments" in TeXstudio see the manual: http://texstudio.sourceforge.net/manual/current/usermanual_en.html#SECTION_TEXCOM – Tim Hoffmann Apr 05 '15 at 16:04
  • @FranckPastor, why does it not work if I replace the line by % !TeX program = context? – Gaussler May 10 '15 at 15:30
  • @Gaussler Maybe Context is not yet taken into account by TeXStudio. It was not recognized by TeXStudio last year, by the way. See http://comments.gmane.org/gmane.comp.tex.context/87628 – Franck Pastor May 11 '15 at 07:56
0
  • You click on options
  • You go got "Build" side tab
  • And change "Default Compiler" to LuaLaTeX