# subscript is set too low in math-mode with xits-math

I use unicode-math with xits-math as math font and asana-math for math double-struck symbols. I compile with lualatex, and my packages are from TeXlive 2011.

Now, when use asana-math mixed with xits, I have the following problem:

In math mode, if I type $\deg_s ϕ$ my output is

What I want is:

Here is a minimal working example

\documentclass{minimal}

\usepackage{unicode-math}

\setmathfont{xits-math.otf}
\setmathfont[range={\mathbb}]{Asana-Math.otf}

\begin{document}
$\deg_s \phi$
\end{document}


This problem also occurs when I use only asana-math as math font, so that's probably from where it comes. I need asana-math for its double-struck math characters which I prefer over xits-math's.

Is this a bug or is it supposed to be set so low? Can I fix this somehow? Is it unclean to mix fonts?

Edit: I now updated the question according to what I found out. Sorry for being so uninformative before, I underestimated the problem. : - ) (Thanks, Caramdir)

-
@Caramdir Me neither, at least not as simply as I thought. (This is a problem I encountered before, so I assumed it was something general) I guess I was too lazy there. I'll try to reproduce it. –  k.stm Nov 9 '12 at 20:14
I get that output with LuaLaTeX, but it's correct with XeLaTeX. –  egreg Nov 9 '12 at 20:48
@egreg Hm, I get an error with XeLaTeX: ! The font "xits" cannot be found. – must be TeXlive2011. –  k.stm Nov 9 '12 at 21:10
@K.Stm. I always use the "Postscript name", in this case "XITS Math". –  egreg Nov 9 '12 at 21:35
Try xits-math.otf. XeTeX needs the filename –  Loop Space Nov 10 '12 at 9:11

For some reason loading Asana Math changed the subscript shift drop parameter from 0.5pt to 2.22pt (probably the later value is derived from Asana Math).

You can see reset the value by setting \luatexUmathsubshiftdrop\textstyle=0.5pt, but it have to be called inside the formula, so you have to append it to the \everymath token:

\everymath=\expandafter{\the\everymath\luatexUmathsubshiftdrop\textstyle=0.5pt}


You probably want to the the same for display math:

\everydisplay=\expandafter{\the\everydisplay\luatexUmathsubshiftdrop\displaystyle=0.5pt}


To keep the things compatible with XeTeX, use \ifluatex.

\documentclass{minimal}

\usepackage{ifluatex}
\usepackage{unicode-math}

\setmathfont{xits-math.otf}
\setmathfont[range={\mathbb}]{Asana-Math.otf}

\ifluatex
\everymath=\expandafter{%
\the\everymath%
\luatexUmathsubshiftdrop\textstyle=0.5pt}
\everydisplay=\expandafter{%
\the\everydisplay%
\luatexUmathsubshiftdrop\displaystyle=0.5pt}
\fi

\begin{document}
$\deg_s \phi_s$
\end{document}
`
-
Many, many thanks! –  k.stm Nov 10 '12 at 21:02
@K.Stm.: You are welcomed. –  Khaled Hosny Nov 10 '12 at 21:29
A similar fix seems to be needed with Latin Modern Math. –  Andrew Swann Nov 11 '12 at 16:04