Articles of luatex

luacode and ExplSyntaxOn/Off

I’m trying to build some sort of an interface to a lua matrix module. I’ve navigated a few issues and arrived at something that I felt like I could probably modify to work. Anticipating the need for expl3 functions as some point I wrapped the macro in \ExplSyntaxOn and \ExplSyntaxOff expecting a total catcode disaster. […]

How can I list fonts available to LuaTeX in ConTeXt (TeX Live 2013)?

I’ve looked at How do I get a list of all available fonts for luaotfload?, but the answers don’t work for me in TeX Live 2013, at least not without LaTeX. This is because there they rely on the file otfl-names.lua under \luatex-cache\generic\names; but in my installations of TeX Live 2013 (ConTeXt scheme), the only […]

Precompiled header in Lualatex on Windows?

I am trying to typeset a longer document with lots of packages. Now it seems that pre-compiling the header can speed up the edit-compile-revise cycle quite a bit. I tried to follow the guideline from How to speed up pdflatex for a very large document on MacOS X? but it does not work on my […]

How to substitute one glyph sequence for another with OTF feature files in LuaTeX?

I am trying to do some sequence-for-sequence glyph replacement. As far as I can tell from the Adobe spec, the LHS and RHS of a “sub … by …” rule cannot both contain multiple glyphs; and in any case, luatex 0.70.2-2012091206 (from TeXLive 2012) segfaults if I try. Hence, I tried the following: languagesystem DFLT […]

How does XeLaTeX and LuaLaTeX extend the dvi format?

The structure of the DVI file format is documented by Donald Knuth in TEX: the Program, Addison-Wesley, 1986. Although PDF is the primary output format, LuaTeX can also output DVI files. Are these DVI files different from what is found in the original specification? XeTeX can output XDV files, which are an extension of the […]

siunitx 'detect-all' does not honor fontspec's math font in Beamer

Problem statement The \sisetup{detect-all} option of the siunitx package does not work for me as expected in a Beamer presentation, which I would like to typeset as follows: Text in Latin Modern Sans (sans serif) Math in TeX Gyre Pagella Math (serif) For reasons beyond this MWE, my setup requires lualatex and \usepackage{siunitx}. I would […]

Accessing pointers in LuaTeX

This code writes the subtype of disc nodes to the log file. \documentclass{minimal} \usepackage{fontspec} \directlua{ show_hyph = function(head) while head do if head.id == 0 or head.id == 1 then % hlist, vlist show_hyph(head.head) elseif head.id == 7 then % disc texio.write_nl(“Subtype ” .. head.subtype) end head = head.next end return true end luatexbase.add_to_callback(“post_linebreak_filter”,show_hyph,”show_hyph”) } […]

LuaLaTeX: Replace character “ß” in CMU fonts

The glyph for the character “ß” differs considerably between Latin Modern and the CMU fonts (CMU Serif, CMU Sans Serif etc., which use the same glyphs for ß as cm-super; see this answer): I much prefer Latin Modern’s version of ß, but I would like to use the CMU fonts because of their Unicode capabilities […]

\scantokens in LuaTeX

The eTeX \scantokens command appears to work differently in LuaTeX than it does in eTeX, pdfTeX and XeTeX. Compiling the following test file with any engine other than LuaTeX performs \show+, which shows the character +, but LuaTeX skips this statement entirely. \newlinechar=10 \catcode10=12 \endlinechar=13 \catcode13=5 \scantokens{^^J\show+} \bye This behaviour reminds me of how TeX […]

Incorrect digits font with newtxmath and Luatex/Xetex (since Texlive 2015)

I used to use Luatex and a combination of the packages fontspec and newtxmath to have everything set in Libertine. However, it does not work anymore since Texlive 2015: it compiles be the digits in math-mode are set in Computer modern and not Libertine. Here a minimal example: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[libertine]{newtxmath} \usepackage[no-math]{fontspec} \setmainfont{Linux Libertine O} […]