According to a recent article in "Die TeXnische Komödie", this should be the way to get Latin Modern Math to work with lualatex and the latest TeXLive 2011:
\documentclass[professionalfonts]{beamer}
\usepackage[english]{babel}
\usepackage{iftex}
\ifPDFTeX
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\else
\ifLuaTeX
\usepackage{luatextra}
\defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\fi
\fi
\newcommand{\ip}[2]{(#1, #2)}
\begin{document}
\begin{frame}{Speaker's Name}{About Our Next Speaker}
\LaTeX\ is good at typesetting mathematical formulas
like
\( x-3y + z = 7 \)
or
\( a_{1} > x^{2n} + y^{2n} > x' \)
or
\( \ip{A}{B} = \sum_{i} a_{i} b_{i} \).
\end{frame}
\end{document}
It works (at least according to pdffonts
), but unicode-math
complains:
* unicode-math warning: "disable-beamer"
*
* Disabling beamer's math setup.
* Please load beamer with the [professionalfonts] class option.
And this message is repeated a dozen times:
* fontspec warning: "icu-feature-not-exist-in-font"
*
* OpenType feature 'Numbers=OldStyle' (+onum) not available
* for font 'LatinModernMath',
* with script 'Math', and language 'Default'.
What's wrong with my setup?
EDIT:
The fontspec warnings go away if one removes the Numbers=OldStyle
from the \defaultfontfeatures
.
EDIT2:
I removed the ifxetex
package and changed the \ifluatex
to \ifLuaTeX
.
\defaultfontfeatures
line makes no sense, you neither need (or want) TeX quote ligatures nor old style numbers in math mode.luatextra
, it is a low-level package that is for other packages to load, you don't need to load it in your document.professionalfonts
option. Actually the class option isprofessionalfont
and is now obsolete. The manual is also slightly confusing on this issue since on p19 it refers to a class option whereas on p193 to a font theme. Also,unicode-math
s warning adds to the confusion by getting the class option wrong. Finally, please do not swear, not even in abbreviations.luatexbase
).