8

How could I stack two symbols on top of each other, so that they would appear smaller, i.e. something like \begin{array}a\\b\end{array}, but would fit nicely in a single line with the rest? So for example, I want to write blah blah blah $S(\begin{array}a\\b\end{array})$ blah blah in one single line.

Thanks a lot!

Eric
  • 1,545

2 Answers2

6
\documentclass{article}
\usepackage{stackengine}
\parskip 1ex
\begin{document}

Default:% 3pt gap betwen glyphs
\(
c \stackanchor{$a$}{$b$} d
\)

Baselineskip gap:
\(
\def\stacktype{L}
c \stackanchor{$a$}{$b$} d
\)

Narrower vertical gap:
\(
c \stackanchor[1pt]{$a$}{$b$} d
\)

Bottom aligned:
\(
c \stackon{$a$}{$b$} d
\)

Top aligned:
\(
c \stackunder{$a$}{$b$} d
\)

Scriptsize:
\(
c \stackanchor{$\scriptstyle a$}{$\scriptstyle b$} d
\)

\end{document}

enter image description here

  • Thanks for this. For now I just need the smallmatrix command. But I have to keep this, as I might (with high likelihood) use this as well. – Eric Jul 10 '13 at 14:07
5

If it's only 2 symbols, there is a nice little, convenient hack:

$S(\smash{{}^a_b})$

Basically you create an empty group to attach the subscript and superscript to and then hack the height of the box containing them (practically reducing it to zero), so it won't interfere with the lines above or below.

This has the benefit of not requiring any package.

Use with caution! :)

Count Zero
  • 17,424
  • Thanks for the suggestion. However, upon comparing, I am more inclined to use smallmatrix as the natural spacing seems more suitable to what I am doing. =) – Eric Jul 10 '13 at 14:08