Figure 1.3: Some LATEX editors being configured to use LuaLATEX






Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document
Formatting Information — An introduction to typesetting with LATEX
Before you go any further there are two configurations you MUST check. As you may have seen in the list in the Preface above, there isn’t just one flavour of LATEX; and there are also some different bibliographic processors.






In this book I recommend that you use LuaLATEX unless you have a compelling reason not to. In my view the ability to handle natively-installed system fonts as well as Unicode characters and create a PDF direct while retaining the flexibility of the LATEX package system sets it well above the other processors (I’m not going to be dealing with Lua’s scripting or ConTEXt’s typographical abilities here).
XƎLATEX, which I previously recommended, is no longer being developed, which is why LuaLATEX is the processor of choice. With one or two small changes, all your existing LATEX documents will continue to work. See the examples of how to set LuaLATEX as your processor in Figure 1.3 above, and the list of processors at the list in the Preface above for more details.
There are still a few reasons some users stay with XƎLATEX, pdfLATEX, or even the original LATEX. These include:
a few packages (now a very small number) which positively require a processor which creates an old-style DVI file;
some specific packages still rely on raw Postscript features which need DVI-to-Postscript conversion first, before the PS output can be converted to PDF; and some DVI-to-Postscript converters cannot handle the eXtended DVi (XDV) format produced by XƎLATEX;
some old publishing toolchains which depend on pdflatex or even DVI files;
some old (and some very new) editors do not yet make it possible to select LuaLATEX as the processor.
To set LuaLATEX as your processor, look for a or menu
If your documents don’t use bibliographic references, this will not be a concern for you, and you can skip this section.
Your bibliographic processor is a program which extracts the references needed from your bibliographic database, sorts them into order, and uses the format you specify to typeset them. The recommended processor is biber (you should avoid the old-style bibtex program unless you have special reasons for using it).
The setting is made in your editor in a similar way to setting the LATEX processor.
What’s the difference? The old bibtex processor and its .bst style files have known problems with Unicode multibyte (accented and non-Latin) characters, and are no longer being developed (they use a special language not used anywhere else). The biblatex package and the biber program, like LuaLATEX, deal natively with Unicode multibyte characters and are actively being supported and developed, and all of biblatex is written in LATEX code for accessibility. We will be dealing with this choice in more detail in § 5.3.2.1 below.
Open your LATEX editor or online LATEX service and set the processor to be LuaLATEX.
In most cases this is a configuration setting in the menus or drop-downs (see Figure 1.3 above for examples).
Repeat the process to set your BIBTEX processor to be biber
Add the magic comments to the top of your file (§ 1.3.3 below)
Many editors now support the TEX ‘magic comments’ which silently tell an editor or IDE what processors to use. This is done by adding a few lines to the top of your document before anything else. The lines look like comments (percent at the start of the line) but contain a directive starting with !TEX or !BIB:
% !TEX root = mybook.tex % !TEX encoding = UTF-8 % !TEX program = lualatex % !TEX spellcheck = en_IE % !BIB program = biber % !Mode:: "TeX:UK:UTF-8"
The TEX root line says what this file name is. Put the name of your file there;
The TEX encoding line says what encoding your file uses. This should always be UTF–8; if you have included or imported files from elsewhere, make sure they are also UTF–8;
The TEX program line says what TEX engine to use;
The TEX spellcheck line says what country (two lowercase letters) and language (two uppercase letters) should be used for spell checking;
The BIB program line says what bibliographic processor to use;
The Mode:: is a special case, recognised only by the WinEDT editor. For documentation, refer to the WinEDT web site
Most editors support these: the list in Table 1.3 below comes from https://tex.stackexchange.com/a/84687/36296 in the section Editors that understand % ! TEX directives.
| Editor | Comments | ||||
| TEXShop | ✅ | ✅ | ✅ | ✅ | |
| TEXStudio | ✅ | ✅ | ✅ | ✅ | |
| Textmate | ❓ | ✅ | ✅ | ❓ | |
| TEXWorks | ✅ | ✅ | ✅ | ✅ | |
| SublimeText | ❌ | ✅ | ✅ | ✅ | via LATEX-Tools |
| Atom | ❌ | ✅ | ✅ | ❌ | via Atom-LATEX |
| Vim | ❌ | ✅ | ✅ | ❌ | via vimtex |
| Overleaf | ❓ | ✅ | ✅ | ❓ |
Note that in Emacs you can instead edit your ~/.emacs configuration file and add these lines:
(setq latex-run-command "lualatex") (setq bibtex-dialect 'biblatex) (setq tex-bibtex-command "biber")
Save the file and type M-x eval-buffer RET to implement it for this session (in future sessions it will be automatic).