1

I came across the question "Ligatures for fi, fl, ffl do not work for Times New Roman (XeLaTeX)," and it had two solutions; but neither works completely for LuaTex. The first is Xetex/XeLaTex specific, and the second, while being more complicated than necessary, essentially means you can e.g. add Ligatures=Discretionary to a FontSpec statement, and if you have a Win10 Times New Roman, it'll work. Here's the code preview from a very simple example that works in Xetex, but not LuaTex:

% Preview source code

%% LyX 2.3.6.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage{fontspec}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\setmainfont[Ligatures=Discretionary]{Times New Roman}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\begin{document}
fi fj fl ff ffi ffj ffl Th “the” tt - – —
\end{document}

This has a variety of ligatures useful in modern US English, and some of them work (although I haven't seen a "tt" ligature supported, usually). The first ones starting with "F" don't. The goal is to get them to show up in LuaTex as ligatures, without messing up any of the other ones, and without having to change the underlying font file.

(It should be straightforward to create a Lyx doc from this, or to run this in other Tex environments.)

Edits:

  1. This fails with Times New Roman 7.0, and Lyx 2020.
  2. This succeeds with the updated Lyx 2021! I guess Marcel Krüger is adverse to the points for having provided the answer. I see lots of answers to questions as only comments. I don't understand it, but I'm not complaining.
  3. Answer accepted and upvoted.

Note: Evidently, what Lyx calls "LuaTex" is in fact "LuaLatex", since e.g. it recognizes \DocumentClass{}. That explains why my documents would error out in TeXworks on LuaTex, but not LuaLaTeX. That's rather confusing of Lyx, IMHO.

6
  • I can't reproduce this. For me, LuaLaTeX applies all expected ligatures in this document. (Tested with Times New Roman 7.00) Jun 24 at 14:12
  • This is for Luatex, not LuaLatex; or is there a difference? Lyx has only the LuaTex choice.
    – CodeLurker
    Jun 24 at 19:32
  • LuaLaTeX is LuaTeX with LaTeX and \documentclass/\begin{document}/\end{document} are LaTeX commands. So if uses the LuaTeX engines, it is LuaLaTeX. tl,dr: No, in this case LuaTeX means LuaLaTeX. Jun 24 at 19:59
  • 1
    I can reproduce this with TeX Live 2020 on Overleaf, but not with TeX Live 2021 locally. So I would recommend updating. The underlying issue seems to be fixed with current versions. Jun 24 at 20:05
  • Depending on @CodeLurker's response, I propose that either (1) Marcel posts a simple answer that it works on TeX Live 2021 but not on TeX Live 2020, or that the title be edited to specify "on TeX Live 2020" (or whichever version CodeLurker is using) if the hope is to find a temporary workaround.
    – scottkosty
    Jun 24 at 20:07
2

LuaLaTeX's font shaping support is under constant development and bugs are often found and fixed. Therefore it is always recommended to use the newest possible version of LuaLaTeX, especially when issues arise since older versions still have bugs fixed in current releases.

While this doesn't work on TeX Live 2020, the issue no longer occurs with current TeX Live 2021 installations, therefore the best way to solve it is to update and use the new release.

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.