I create superscripts for indexes for notes manually with \raisebox
. What I don't like is that Latex changes the line spacing to fit a manual superscript into a line. For instance:
\documentclass{article}\usepackage{setspace}\begin{document}
\scriptsize
\parbox{3cm}{
\begin{spacing}{0.8}
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST {\tiny\raisebox{3pt}{b}}TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST\end{spacing}}
\ \ \ \ \ \ \ \ \
\parbox{3cm}{
\begin{spacing}{0.8}
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST\end{spacing}}
\end{document}
creates (without the black lines)
Left \parbox
with manual superscript (-> too much spacing in line before the superscript), right \parbox
without (-> equal spacing).
How can I get rid of the extra spacing in the left \parbox
. \raisebox
can be replaced if there is a better way. It is ok if the superscript overlaps with the text in the previous line.
Best Answer
You need to use the (first) optional argument of
\raisebox
to compensate. It allows you to tell LaTeX how high the raised box officially is. So setting it to 0pt would ignore its height. There is also a second optional argument which determines the depth. The dimensions\height
,\width
,\depth
and\totalheight
can be used in all three arguments and hold the original dimensions of the content.