4

This question already has an answer here:

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?

marked as duplicate by egreg, Werner, Claudio Fiandrino, Andrew Swann, Martin Schröder Jun 24 '13 at 15:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Welcome to TeX.SX! If you say \usepackage{fixltx2e}, you have available \textsubscript: some\textsubscript{thing} – egreg Jun 24 '13 at 13:49
  • 1
    Related/duplicate: How to typeset subscript in usual text mode? – Werner Jun 24 '13 at 13:51
  • 3
    Your use of \mysubscript is incorrect. Try some\mysubscript{thing}. – Werner Jun 24 '13 at 13:52
  • Welcome to TeX.SX! You can have a look on our our starter page to familiarize yourself further with our format. – Claudio Fiandrino Jun 24 '13 at 13:53
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.