Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

subscript too low

What I want is:

subscript okay

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)

share|improve this question
    
@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
1  
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
3  
Try xits-math.otf. XeTeX needs the filename –  Andrew Stacey Nov 10 '12 at 9:11
show 1 more comment

1 Answer

up vote 6 down vote accepted

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}
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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