4

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?

9
  • Hmm you do know you're not allowed to install CambriaMath on linux.... May 13, 2014 at 14:00
  • @DavidCarlisle Well, yes, I guess that's what the license says, but I think my use case would fall under fair use - I'm just trying to see if I can get it to work! :-) But, IANAL, so if there are other reasons I'm not allowed to do this, I'd be happy to hear about them
    – darthbith
    May 13, 2014 at 14:07
  • All I know is that some authors of initial pages that described how to install the fonts on linux when it first came out got very scary letters from people who were lawyers. So while I wouldn't normally comment on licence issues, I think it's important that any answer here does at least warn later readers to be aware. May 13, 2014 at 14:13
  • 4
    This question appears to be off-topic because it is a bug report. The issue was fixed and an update should reach CTAN in the next couple days. May 18, 2014 at 20:07
  • 2
    Doing this solved the problem for me in Ubuntu 14.04 (tex.stackexchange.com/questions/204145/…) (1) cd .texmf-var/luatex-cache/generic/fonts/otf/ (2) rm * (3) cd (4) luaotfload-tool --update (5) sudo texhash
    – DaniCee
    Oct 3, 2014 at 20:28

0

Browse other questions tagged .