2

A project I'm working on requires the use of a somewhat unusual character, m̊. Unlike, say, the "a with ring," as in Swedish, a pre-combined form of this letter does not exist in Unicode, it can only be created via the use of combining characters. However, getting this to work with LuaLaTeX has been an exercise in frustration.

For reference, here is an example of code which causes the problem:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\begin{document}

\r{m}abcdefgh

\end{document}

When I try to compile this code with LuaLaTeX I get the following error:

("C:/Program Files (x86)/MiKTeX 2.9/tex/generic/oberdiek/ifluatex.sty"))))
("C:/Program Files (x86)/MiKTeX 2.9/tex/generic/oberdiek/pdftexcmds.sty"
("C:/Program Files (x86)/MiKTeX 2.9/tex/generic/oberdiek/ifpdf.sty")
("C:/Program Files (x86)/MiKTeX 2.9/tex/generic/oberdiek/luatex-loader.sty"
(C:/Program Files (x86)/MiKTeX 2.9/scripts/oberdiek/oberdiek.luatex.lua))))error: ...KTeX 2.9/tex/luatex/luaotfload/fontloader-2016-04-27.lua:13071: attempt to index local 'i' (a nil value)
.
l.9

Now, a few things to note. For one thing, if I leave the main font as the default, the problem doesn't exist: m̊ shows up fine with Latin Modern. Well, I say fine, the placement of the ring is off, and looks bad. Furthermore, Latin Modern is missing some other characters I need for my project, so that's not really an option. Now, this might have caused me to conclude that the font, Charis SIL, is to blame, but in fact compiling this exact same code with XeLaTeX works fine, and produces the expected output:

enter image description here

What I have deduced is that the problem is somehow related to kerning, or something of that sort. The reason why is that it looks like the problem only occurs after the amount of characters in a the paragraph (or box? I'm not sure of the proper terminology) exceeds a certain amount. For example, the following compiles just fine:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\begin{document}

\r{m}abcdefg

\end{document}

As you can see, the only difference here is that I have removed the final h. Adding support to this hypothesis is the fact that the following also works as well:

\r{m}abcdefg

Lorem Ipsum

Anyhow, I'm utterly a loss of what to do. Unfortunately, switching to XeTeX is not an option for this project.

  • 1
    Works fine for me in a current miktex. My fontloader is newer: fontloader-2016-05-04.lua. – Ulrike Fischer Jun 9 '16 at 15:46
3

It should work using \r or just using

enter image description here

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\begin{document}

\r{m}abcdefgh

m̊abcdefgh

\end{document}

(Using luatex from texlive 2016)

  • It looks like the problem ended up being outdated fontloader – Kevin Keith Jun 9 '16 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.