According to the fontspec
package's user manual (2017/03/31 v2.6a, Section 5.1, p. 12)
Fonts known to LuaTEX [...] may be loaded by their standard names as you'd speak them out loud, such as Times New Roman or Adobe Garamond. [...]
The simplest example might be something like
\setmainfont{Cambria}[...]
[...] The 'font name' can be found in various ways, such as by looking in the name listed in a application likeFont Book
on Mac OS X.
My operating system is Mac OS X. The following screenshot shows the Times New Roman font in in my Font Book
application.
The following screenshot shows the Avenir
font name in my Font Book
application.
The following LaTeX document sets the main font of the document to Times New Roman
.
\documentclass{report}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\begin{document}
Hello, world!
\end{document}
Processing this document with the LuaLaTeX format (i.e. with the LuaLaTeX "engine") results in the following pdf, as expected:
However, replacing 'Times New Roman' with 'Avenir' and reprocessing the document with the LuaLaTeX format results in no pdf, and the following error message:
ERROR: table index is nil.
--- TeX said ---
\scan_stop:
l.3 \setmainfont{Avenir}--- HELP ---
From the .log file...The lua interpreter ran into a problem, so the remainder of this lua chunk will be ignored.
What's the problem? Why doesn't the Avenir example work whereas the Times New Roman one does?
Operating System: macOS Sierra Version 10.12.5
MacTex distribution: MacTeX-2017
LuaTeX: Version 1.0.4
\setmainfont{Avenir light}