1

MacTeX / TeXlive 2021 on macOS 10.15.7

I'm trying without luck to use Times New Roman via the fontspec package.

I've read that:

fc-list : family | sort

will produce a list of system fonts that I should be able to use via XeLaTeX and fontspec. This list includes Times New Roman.

This minimum test document fails


\documentclass{article}

\usepackage{fontspec}

\setmainfont{Times New Roman}

\begin{document}

Hello world.

\end{document}

with the following log:


This is XeTeX, Version 3.141592653-2.6-0.999993 (TeX Live 2021) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./fontspecTest.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
(|extractbb --version)))
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse-2020-10-
01.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse-generic.
tex)))
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
No file fontspecTest.aux.
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/ts1cmr.fd) [1]
(./fontspecTest.aux)
xdvipdfmx:fatal: Cannot proceed without the font: /Users/<user>/Library/Fonts/Times New Roman

No output PDF file written.
 )
Error 256 (driver return code) generating output;
file fontspecTest.pdf may not be valid.
SyncTeX written on fontspecTest.synctex.gz.
Transcript written on fontspecTest.log.

I've searched on-line and read that I should edit .../texlive/YYYY/texmf.cnf to include the font search path. I've done so, creating a file containing this, saved as /usr/local/texlive/2021/texmf.cnf:


% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFHOME = ~/Library/texmf
TEXMFVAR = ~/Library/texlive/2021/texmf-var
TEXMFCONFIG = ~/Library/texlive/2021/texmf-config

OSFONTDIR = System/Library/Fonts:System/Library/Fonts/Supplemental:~/Library/Fonts

However, even after running texhash,

kpsewhich --expand-path '$OSFONTDIR'

results in:

/Users/<user>/Library/Fonts

The command:

fc-list : family

obviously searches places outside the directories specified OSFONTDIR and equally obviously my changes to texmf.cnf have had no effect.

I'd appreciate advice on how to set the appropriate search path.

16
  • I've double-checked and yes, the test document does produce that log with the load of fontenc.sty.
    – Robert L
    Commented Nov 6, 2023 at 6:48
  • echo $OSFONTDIR produces null output.
    – Robert L
    Commented Nov 6, 2023 at 6:49
  • The instruction to set OSFONTDIR came from: tex.stackexchange.com/questions/461396/…
    – Robert L
    Commented Nov 6, 2023 at 6:50
  • I have in the past made various odd tweaks to my TeXLive configuration, but I stopped that long ago and I've never tweaked any of the standard distribution files, just done local configuration modifications. Any suggestions on where I might look for what's calling fontenc.sty? Thanks.
    – Robert L
    Commented Nov 6, 2023 at 6:56
  • Xetex seems to find the font but then xdvipdfmx fails. Does the document compiles with lualatex? Does the user name contain something that could confuse xdvipdfmx? Commented Nov 6, 2023 at 7:12

0

You must log in to answer this question.

Browse other questions tagged .