4

I was wondering if anyone know make a command for raisebox subscript? This question asks how to make the subscript part...here I want to make the command shorter by having a macro do the work rather than having to type out the whole command each time.

some\raisebox{-.4ex}{\scriptsize thing}

comes out as

something

I thought something like

\newcommand{\mysubscript}[1]{\raisebox{-.4ex}{\scriptsize #1}}

would work, but unfortunately it only prints the first letter of the argument

some\mysubscript[thing]{}

something

Any thoughts?

aghaynes
  • 103

1 Answers1

6

This can also be done with the stackengine package as follows. The optional argument specifies the depth below baseline you want to move the subscript. I default it to .5ex. Note that the "L" \stacktype denotes the stack as "long" wherein the length specified is the distance from the original baseline to the understacked baseline. If the \stacktype were denoted as "S" (short), the length would denote the gap from the original baseline to the top of the understacked object.

\documentclass{article}
\usepackage{stackengine}
\newcommand\tss[2][.5ex]{%
  \def\stacktype{L}%
  \belowbaseline[#1]{\scriptsize#2}%
}
\begin{document}
some\tss{thing} and some\tss[1ex]{thing} else
\end{document}

enter image description here