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?

3
  • 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? Commented Jan 12, 2015 at 13:59
  • Just to know: why are you splitting it into 2 boxes?
    – Sigur
    Commented Jan 12, 2015 at 14:02
  • 3
    It's not normal to use \mbox in a superscript (it prevents the contents being script size) Commented Jan 12, 2015 at 14:04

2 Answers 2

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}
3
  • 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
    Commented Jan 12, 2015 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:-) Commented Jan 12, 2015 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
    Commented Jan 12, 2015 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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .