[Tex/LaTex] Possible incompatibility between tufte-latex classes, footnotes and LuaLaTeX

footnotesluatextufte

I think I came across an incompatibility between LuaLaTeX and tufte-handout or tufte-book class. The document should also contain footnotes.

Here is a MWE:

\documentclass{tufte-handout} % Or tufte-book

\usepackage{fontspec}
 \defaultfontfeatures{Mapping=tex-text}
 \setmainfont{Lin Libertine O} % Or maybe any other font...

\begin{document}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.\footnote{Lorem ipsum!}
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.\footnote{Dolor si amet}

\end{document}

I'm using LuaTeX, Version beta-0.70.1-2011062107 (rev 4277), the one which came with TeXLive 2011.

MWE above compiles perfectly under XeLaTeX or under LuaLaTeX provided there are no footnotes; it also compiles without errors under both systems using the standard article class.

However introducing footnotes and tufte classes produces errors. The relevant part of the log files is:

luaotfload | Updating the font names database:
luaotfload | Scanning TEXMF fonts...
luaotfload | Scanning OS fonts...
luaotfload | Font names database saved: %s 
: /Volumes/Users/michael/Library/texlive/2011basic/texmf-var/luatex-cache/generic/names/otfl-names.lua
luaotfload | define font: font with name pplr9t is not found
luaotfload | define font: unknown font pplr9t, loading aborted
! Font \OT1/pplx/m/n/10=pplr9t at 10pt not loadable: metric data not found or bad.
<to be read again> 
               relax 
l.10 ...olore magna aliqua.\footnote{Lorem ipsum!}
                                                   Ut enim ad
? 
luaotfload | define font: font with name pplr9t is not found
luaotfload | define font: unknown font pplr9t, loading aborted
! Font \OT1/pplx/m/n/7.6=pplr9t at 7.60001pt not loadable: metric data not found or bad.
<to be read again> 
                   relax 
l.10 ...olore magna aliqua.\footnote{Lorem ipsum!}
                                                   Ut enim ad
? X

(Of course the final X is me aborting compilation)

This may has to do with the class rather than LuaLaTeX but i wonder if I'm missing a setting (perhaps in fontspec?) or there is some option clash. Or possibly a bug.

Best Answer

tufte-common.def contains the code:

% If we're NOT using XeLaTeX and the `nofonts' class option was NOT provided,
% we should load the Palatino, Helvetica, and Bera Mono fonts (if they are
% installed.)

\ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}}{%
  \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{}
  \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{}
  \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{}
  \RequirePackage[T1]{fontenc}
  \RequirePackage{textcomp}
}{}

This means that tufte doesn't know about lualatex and so loads mathpazo etc. So using the nofonts option as suggested by egreg is imho the right way to go.

But your error suggests that the mathpazo fonts are not completly installed. They are actually not used by your example but the fontnote triggers the math mode and so lualatex tries to load them. Probably you would get errors with pdflatex and this example too:

\documentclass{article} % Or tufte-book
\usepackage[osf,sc]{mathpazo}
\begin{document}
  abc\footnote{Lorem ipsum!}
\end{document}
Related Question