khaledhosny/luaotfload — Issue #42: Accented characters in Cambria and math.
Author: zhoraster
Created: 2012-01-14 13:19:51+00:00
State: open

Initially I've asked a different question, but digging up I've found a true reason.

The problem occurs when an accented character in Cambria is used with maths in another font in the same paragraph. Here is the minimal example:

```latex
\documentclass{minimal}
\usepackage{fontspec}
\setmainfont{Cambria}
\begin{document}
й $xy$
\end{document}
```

The compilation stops and the error is following:

error: ...s/MiKTeX 2.9
/tex/luatex/luaotfload/otfl-node-inj.lua:225: attempt to index local 'tm' (a nil
value)
.
\newpage ...k \@nobreakfalse \everypar {}\fi \par
\vfil \penalty -\@M
l.6 \end{document}

When they are in different paragraphs e.g. the document body is

```latex
\begin{document}
й

$xy$
\end{document}
```

then there is no problem. Also there is no problem as well if I use the same math font e.g. with

```latex
\usepackage{unicode-math}
\setmathfont{Cambria Math}
```

But still the compilation stops if I use a symbol from a different font (e.g. \Box from amssymb).