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.

In the following example - compiled with XeLaTeX - the spacing of \thinspacing/the value of mu (used by \,) is disturbed if \SI is used in the math before:

\documentclass{article}

\usepackage{unicode-math}
\usepackage{siunitx}

\begin{document}

$1\mskip20mu1$ $\Leftarrow$

$\SI{1}{1}$ 

$1\mskip20mu1$ $\Leftarrow$

$1\mskip20mu1$

$\SI{1}{1}$

$1\mskip20mu1$ $\Leftarrow$

$a\SI{1}{1}$

$1\mskip20mu1$ 


\end{document}

enter image description hereunicode-math

A similar effect can be seen if \SI is the first command:

\documentclass{article}

\usepackage{unicode-math}
\usepackage{siunitx}

\begin{document}

$a\SI{2}{2}1\mskip20mu1$

$\SI{2}{2}a1\mskip20mu1$

\end{document}

Observations

  • it doesn't happen with LuaLaTeX,
  • it doesn't happen with all fonts (unicode-mathCambria is not affected, but xits is),
  • one must use \SI in math and in math mode,
  • if only happens if \SI is the only thing in the math (which means that it is probably not a very problematic problem),
  • at the next math, the value is again correct.

Has someone an idea if it it a XeTeX, a siunitx or a fontspec/unicode-math math bug?


Minimising the example by 'one round' we can remove siunitx but not unicode-math

\documentclass{article}

\usepackage{unicode-math}

\begin{document}

$1\mskip20mu1$

\hbox{\everymath{\scriptscriptstyle} $a\,b$}

$1\mskip20mu1$

$1\mskip20mu1$

\end{document}

As you'll see, I've taken the 'core' of \text to put in just enough code to cause a failure.

share|improve this question
3  
It's 'not my fault': try $\text{$1\,1$}$ (which is internally used by siunitx) and you should see the same, although not with $\mbos{$1\,1$}$ –  Joseph Wright Feb 5 '14 at 10:17
3  
I was just going to remark that this is clearly a bug report. However, it is not, because the question is: Whose bug it is? (this comment should hopefully prevent anyone trying to close it as off-topic as a bug report) –  yo' Feb 5 '14 at 10:33
2  
@JosephWright It works if one load amsmath, but not if one load a renamed amsmath, so probably some of the "if package amsmath loaded" code of unicode-math is the problem. –  Ulrike Fischer Feb 5 '14 at 11:13
1  
I've not traced it all through, but with my latest test version I'm strongly suspecting a XeTeX bug. There's no macro code causing the failure, and I think the \scriptscriptsize size for a muskip is leaking from the \hbox when unicode-math activates Unicode math handling in XeTeX. (Release LuaTeX ha a muskip size bug which means that the cases will be different.) –  Joseph Wright Jan 26 at 8:01
1  
@LaRiFaRi: I answered my question and made a bug report at the xetex tracker. –  Ulrike Fischer Aug 5 at 12:52

1 Answer 1

After some more investigation I think the answer to the question "whose bug is it?" is that the problem is in xetex. Somehow the mu value of the scriptscriptsize font is leaking out.

I made a bug report in the xetex bug tracker with an example using neither unicode-math nor siunitx.

https://sourceforge.net/p/xetex/bugs/117/

share|improve this answer

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.