4

I'm getting a small extra space between two superscripts in separate math objects.

MVE:

\documentclass{article}
\begin{document}
zz$\mbox{zz}^{\mbox{a,a,}}$$^{\mbox{a,a}}$
\end{document}

enter image description here

There's no extra space between math texts zz and zz (marked as red 1), but there is a small one between superscripts mboxes (marked as red 2). How can I get rid of that space?

  • Would it be possible to construct it as zz$\mbox{zz}^{\mbox{a,a,}\mbox{a,a}}$ orzz$\mbox{zz}^{{\mbox{a,a,}}{\mbox{a,a}}}$, or are the separate $...$ math groupings provided by some external program? – Steven B. Segletes Jan 12 '15 at 13:59
  • Just to know: why are you splitting it into 2 boxes? – Sigur Jan 12 '15 at 14:02
  • 3
    It's not normal to use \mbox in a superscript (it prevents the contents being script size) – David Carlisle Jan 12 '15 at 14:04
8

enter image description here

It's \scriptspace

\documentclass{article}
\begin{document}
\showoutput


zz$\mbox{zz}^{\mbox{a,a,}}$$^{\mbox{a,a}}$

\scriptspace=0pt
zz$\mbox{zz}^{\mbox{a,a,}}$$^{\mbox{a,a}}$
\end{document}
  • 1
    The \scriptspace isn't shown by \showoutput, it's just added to the width of the box containing the superscript. Rules 18b, 18c and 18d in Appendix G. – egreg Jan 12 '15 at 14:08
  • @egreg yes true I'd just added \showoutput as more or less the first thing I always do to a supplied MWE before running it locally:-) – David Carlisle Jan 12 '15 at 14:14
  • Finally!! I couldn't find it. I was looking all the tracing output and didn't understand what is this space. – Linuxss Jan 12 '15 at 14:22
5

Each ^{...} adds a small horizontal space after the superscript; the width is controlled by the \scriptspace parameter, having a default value of 0.5pt.

Example:

\documentclass{article}
\begin{document}

zz$\mbox{zz}^{\mbox{a,a,}}$$^{\mbox{a,a,}}$X

\scriptspace=0pt
zz$\mbox{zz}^{\mbox{a,a,}}$$^{\mbox{a,a,}}$X

\scriptspace=5pt
zz$\mbox{zz}^{\mbox{a,a,}}$$^{\mbox{a,a,}}$X

\end{document}

enter image description here

See Rules 18b, 18c and 18d in Appendix G of the TeXbook.

How to cope with this depends on your real intentions, which are far from clear.

  • @Linuxss Modules 757, 758 and 759 in tex.web. See also section 23.2.1 in TeX by Topic. – egreg Jan 12 '15 at 14:31

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.