I am trying to typeset a document with combining diacritics in utf8 in math mode. I use LuaLaTex, which supports those in text mode. The following example illustrates the original issue:
Code: Select all
\documentclass{minimal}
\usepackage{unicode-math}
\setmathfont{XITS Math}
\begin{document}
$v⃗$
\end{document}
Then I tried the following:
Code: Select all
\documentclass{minimal}
\usepackage{unicode-math}
\setmathfont{XITS Math}
{
\catcode`\_=11\relax
\catcode`\:=11\relax
\gdef\SetMathCode#1#2{\um_set_mathcode:nnn{#1}{#2}\um_symfont_tl}
}
\SetMathCode{"20D7}\mathaccent
\begin{document}
$v⃗$
\end{document}
\Umathcode
. In this manner, I change the math family of the arrow to the previously loaded XITS font. The mapping of the diacritics (possibly some of the other characters) are not set up automatically by unicode-math, so it turns out I have to do it manually.Now the arrow is typeset to the right of the accented "v" (as in the attachment.) You can probably guess that I wish it was typeset above the "v". The
\vec
macro and \Umathaccent
can (and do) do this, but I am trying to make the formulas plain-text readable if possible. (And to this end I also use the Emacs quail system for input.)I could try and make the codes for the accents and the other diacritics active, but they would have to precede the codes for the main glyphs, which would cause incorrect display in utf8 aware editors (since this is the opposite order of the one in the standard.)
Could you please advice?
My LuaTeX version is beta-0.70.2, TeX Live 2012, LaTeX2e <2011/06/27>
XITS font is version 1.105.
Thanks in advance