2

I redefined the \div command so that it's U+2215 aka ∕, but for some reason when I use it as a superscript the spacing between this symbol and its numbers is really tight (works fine in displaymode or otherwise). Below is what I created:

\documentclass[11pt]{article}
\usepackage{unicode-math}
\setmathfont{XITS Math}    
% I personally use MinionMath-Regular.otf but XITS Math 
% also shows this property, to a lesser degree
\newcommand{\olddiv}{\mathbin{÷}}
\AtBeginDocument{\renewcommand*\div{\ensuremath{\mathbin{∕}}}}

\begin{document}
$a^{1\div2}$ $1\div2$ 
\end{document}

This is the outcome (with XITS Math):

enter image description here

It may not seem that horrible, but taking a look at what happens with MinionMath-Regular you can see why I'm concerned:

enter image description here

Theoretically I could just put in spaces, as in 1/ \div/ 2, but that doesn't look great and I think there should be an easier, more permanent way to accomplish good spacing. I'd appreciate any advice with this!

  • 1
    \mathbin does not add spaces in scriptsyle and it seems / has no sidebearings at all in that font, so if tex doesn't add space it touches teh adjacent characters.... – David Carlisle Nov 26 '14 at 19:38
  • you could use \renewcommand*\div{\mathbin{\mskip1mu∕\mskip1mu}} or whatever looks good. (You don't want \ensuremath really: math commands should be just math). – David Carlisle Nov 26 '14 at 19:44
  • @DavidCarlisle the \mskip1mu also affects the displaystyle / regular mode spacing of \div, but I want that spacing to remain the same; it's only when it's in superscript that I have a problem. I would ideally like the same spacing (proportionally) for superscript as inline / displaystyle / etc. – airatin Nov 26 '14 at 20:50
5

You can use

\renewcommand*\div{\mathbin{\mskip1mu\nonscript\mskip-1mu%
                            ∕%
                            \mskip1mu\nonscript\mskip-1mu}}

or some value other than 1mu the skip is always added but in non-script (ie text and display) styles add the negative amount to cancel it out.

  • This is a really clever answer, thank you! :) – airatin Nov 27 '14 at 0:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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