TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been using \overset and \underset to stack text, e.g.:

    $\overset{\text{a}}{\text{b}}$ \\

The results seems better proportioned font size, line spacing, and baseline positioning than other solutions I have found for stacked text, however, recently, I found some incompatibilities between another package and amsmath.

  • How can I create an alternative to these commands which does not use math mode, but otherwise has identical font sizes and proportions (so that the output is visually the same)?

I found the source code for \overset and \underset in amsmath.dtx:



It seems to be using some code for \limits to define the stacking, however, I can't find anything in the rest of the source of the amsmath package showing how \limits works or how to use it without first specifying math mode.

share|improve this question
what's the package that conflicts with amsmath? – barbara beeton Jan 27 '12 at 14:24
up vote 5 down vote accepted

\limits is a TeX primitive used in the specification of super- and subscripts for math operators.

You could still use math mode, but just force the arguments to be typeset in text mode via some manipulation of the original \overset and \underset definitions:

\overset and \underset without AMSmath

\usepackage{amsmath}% http://ctan.org/pkg/amsmath

\mbox{}\phantom{Without}\llap{With} \verb|amsmath|: $\overset{\text{x}}{\text{a}}~\quad~\underset{\text{x}}{\text{a}}$

\renewcommand{\overset}[2]{\ensuremath{\mathop{\kern\z@\mbox{#2}}\limits^{\mbox{\scriptsize #1}}}}
\renewcommand{\underset}[2]{\ensuremath{\mathop{\kern\z@\mbox{#2}}\limits_{\mbox{\scriptsize #1}}}}

\mbox{}Without \verb|amsmath|: \overset{x}{a}~\quad~\underset{x}{a}


In the above minimal example, the redefinition of \overset and \underset style sets the two arguments in math mode, although it is not required to be specified explicitly. Additionally, since you're not interested in a math mode application, the binary relation spacing has been removed.

share|improve this answer
Is it possible to just use the array option like: \begin{array}{c} \text{x}\\text{a} \end{array} – azetina Jan 27 '12 at 17:00
@azetina: Yes, and you can specify an optional argument to array as well, using \begin{array}[t]{c} for \underset and \begin{array}[b]{c} for \overset. However, the spacing will be different since the over/under placements are not limits; something that has to be corrected for. – Werner Jan 27 '12 at 17:04

How to implement a \textunderset macro and its companion \textoverset depends on your real necessities. Here's one that tries keeping the main text and the subscript aligned with each other, while avoiding clashes between ascendents and discendents


Abc \textunderset{du}{axy} \textunderset{ud}{axy} def

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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