[luatex] luatex misalignment of certain diacritics in certain LaTeX environments

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Nov 23 09:38:35 CET 2012


On Tue, Nov 20, 2012 at 1:31 AM, Benjamin Slade wrote:
> I've noticed that certain diacritics---including over-dots, under-rings,
> but not acute accents or macrons---are misaligned by the luatex engine
> when they occur in tabular or hbox environments (and also in the
> linguistics example/glossing packages linguex and expex). When compiled
> with xetex, these misalignments do not occur.
>
>  Is this a known issue?

See http://tracker.luatex.org/view.php?id=651.

LaTeX code for font handling in LuaTeX was derived from ConTeXt, so I
wouldn't be surprised to see the same problem there. On top of that
the maintainer left, so the code hasn't been updated in a while.

First of all, I remember being told that I had to use
    \definefontfeature[default][default][mode=node,mark=yes,mkmk=yes]
if I wanted the accents to be positioned properly in the first place.
Provided that the font has that feature in the first place. The
features mark and mkmk should be enabled by default in LuaLaTeX
(MarkToMark and MarkToBase), but I'm not sure how to switch to a
"node" mode in case that implementation of that part is the same as in
ConTeXt.

But even after that, there was a bug that mispositioned accents inside
\hbox as you can see on the tracker. That problem was fixed in
ConTeXt, but I still need to compare the output of your latex file
with ConTeXt.

A quick ConTeXt variant to test (the same structure that I had
problems with a year and a half ago) would be the following:

\definefontfeature[default][default][mode=node,mark=yes,mkmk=yes]
\definefontsynonym[a][file:LinLibertine_R.otf][features=default]

\starttext
\definedfont[a]a\hbox to 1cm{}\hbox to 5cm{mr̥taṁ āsyàṁ̇}a
\stoptext

Does that come out OK for you? (LuaTeX and XeTeX output look the same
to me, but I don't know what to expect.)

Mojca

>  I include a (fairly)
> minimal illustrative example below. (Compare alignment of over-dot and
> under-ring in source and in luatex vs xetex outputs.)
>
> +----------begin example----------------+
>
> %%% Local Variables:
> %%% TeX-engine: luatex
> %%% End:
>
> \documentclass{article}[12pt]
>
> \usepackage{fontspec}
>
> \setmainfont{Linux Libertine}
> \setsansfont[Scale=MatchLowercase]{Linux Biolinum}
> \setmonofont{linlibertinem}
>
> \usepackage{expex}
> \usepackage{linguex}
>
> \begin{document}
>
> \noindent \underline{Not misaligned in normal environment}\footnote{Except something funny is happening w/ the mono/typewriter text, but perhaps that's a font-specific issue}\\
>
> āsyàṁ mádhunā mr̥taṁ
>
> \textit{āsyàṁ mádhunā mr̥taṁ}
>
> \textbf{āsyàṁ mádhunā mr̥taṁ}
>
> \textsc{āsyàṁ mádhunā mr̥taṁ}
>
> \textsf{āsyàṁ mádhunā mr̥taṁ}
>
> \texttt{āsyàṁ̇ mádhunā mr̥taṁ}\\
>
>
> \underline{linguex:}\\
> \exg. āsyàṁ̇ mádhunā mr̥taṁ\\
>  mouth.\textsc{neu.nom.sg} honey.\textsc{instr} dead.\textsc{neu.nom.sg}\\
> \trans ``the mouth, killed with honey''
>
> \noindent \underline{Misaligned in Tabular:}\\
> \begin{tabular}{lll}
>   misaligned & mr̥taṁ & āsyàṁ̇ \\
> \end{tabular}
> \vspace{12pt}
>
> \noindent \underline{Misaligned in hbox:}\\
> \hbox{mr̥taṁ āsyàṁ̇}
>
>
> % \underline{expex:}\\
> % \ex
> % \begingl
> % \gla āsyàṁ mádhunā mr̥taṁ//
> % \glb mouth.\textsc{neu.nom.sg} honey.\textsc{instr} dead.\textsc{neu.nom.sg}//
> % \glft ``the mouth, killed with honey''//
> % \endgl
> % \xe
>
> \end{document}
>
> +----------end example-----------------+



More information about the luatex mailing list