I use LaTeX on two machines, a Mac M1 laptop and an old desktop running Ubuntu 18.04.6. Yesterday I upgraded TeX Live on the Ubuntu machine to the 2023 version. I found that I had to change all references to the LibreBaskerville
font to Libre Baskerville
. I upgraded the Mac to MacTeX 2023 and found that now it can't find either LibreBaskerville
or Libre Baskerville
. (Both computers used this font without a hitch since the help I got on this question.) The error message on the Mac is:
! Package fontspec Error: The font "Libre Baskerville-Regular" cannot be
(fontspec) found.
The font appears to be available, because searching for Libre Baskerville on the Mac yields:
$ luaotfload-tool --find "Libre Baskerville" --fuzzy
luaotfload | resolve : Font "Libre Baskerville" found!
luaotfload | resolve : Resolved file name "/usr/local/texlive/2023/texmf-dist/fonts/truetype/impallari/librebaskerville/LibreBaskerville-Regular.ttf"
How can I get both computers to find the Libre Baskerville font?
Further details
The command that I run to typeset my .tex files is:
latexmk -xelatex
The LaTeX commands (in Dissertate.sty
) that cause the error are:
\defaultfontfeatures[Libre Baskerville]{
Extension=.ttf,
UprightFont = *-Regular,
ItalicFont = *-Italic,
BoldFont = *-Bold,
BoldItalicFont = *-BoldItalic,
SmallCapsFont = BaskervilleF-Regular.otf,
SmallCapsFeatures={Letters=SmallCaps,Scale=1.1},
Ligatures={Common,TeX}
}
\setmainfont{Libre Baskerville}
\newfontfamily\baskerville{Libre Baskerville}
The line number given for the error is that of the last line shown above.
The previous version of TeX Live on the Mac, from 2020, worked with the extension .otf
. Changing to .ttf
was necessary for version 2023 on Ubuntu. Both .otf
and .ttf
now fail on the Mac.
If I remove the space on the Mac, so that Libre Baskerville
is consistently LibreBaskerville
(the way that used to work on both computers), I get a slightly different error message:
! Package fontspec Error: The font "LibreBaskerville-BoldItalic" cannot be
(fontspec) found.
Best Answer
I found a fix, and it enables Tex Live 2023 to work with Libre Baskerville on both my Mac and and the Ubuntu machine, including mathspec, which requires XeTeX. It's very simple. First, the font name should stay
LibreBaskerville
(no space). Second, I had to change just two lines inDissertate.cls
, replacing the commented-out lines here:I figured this out by running this command:
shown to me by Davislor in this answer, and then inspecting the files in the directory where the Regular font was. The BoldItalic had the peculiar name shown above and the files were .otf, not .ttf.