The following MWE will build correctly with XeLaTeX but not with LuaLaTeX.
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{TimesNewRomanPSMT}
\setmathfont{CambriaMath}
\begin{document}
Test text in Times
\textbf{Bold in Times}
$\mathrm{And this is in Cambria} i = \sin{\theta}$
\begin{equation}
\gamma = \sqrt{\rho R T}
\end{equation}
\end{document}
The error generated by LuaLaTeX is:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "CambriaMath" cannot be found.
...
l.5 \setmathfont{CambriaMath}
I'm using Ubuntu 12.04 with vanilla TeXLive 2013. I've copied the Times New Roman and Cambria Math fonts from my Windows machine and installed them in /usr/local/share/fonts
and run sudo fc-cache -fsv
to rebuild the cache. I've read through some of the questions about the font-not-found
errors (and there sure are a lot of them!) but I could not find any where XeLaTeX works and LuaLaTeX does not.
Other troubleshooting information:
1) Commenting out the \setmathfont
line (so that it builds) results in LuaLaTeX being unable to find the bold font shape for Times New Roman. If TimesNewRomanPSMT
is changed to timesnewroman
everything works.
2) The output from luaotfload-tool -i --find="Cambria Math"
is
luaotfload | resolve : Font "Cambria Math" found!
luaotfload | resolve : Resolved file name "/usr/local/share/fonts/truetype/myfonts/CAMBRIA.TTC", subfont nr. "1"
** 1 Cambria Math **************************************************************
familyname: Cambria Math
fontname: CambriaMath
fullname: Cambria Math
italicangle: 0
version: 5.96
weight: Book
3) luaotfload-names.lua.gz
(extracted to luaotfload-names.lua
) shows all of the installed Cambria font variants with fullpath
entries pointing to the correct directory
4) Everything "just works" on Windows
How can I get LuaLaTeX to find the Cambria Math font?