TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

Is there a similar command to \overbrace{foo}^{bar} but instead of braces, an arrow pointing up/down?

EDIT: Here's a little demonstration of how I'd expect something like this to work:

alt text

And possible syntax would be \overarrow{a=b}^{\text{theorem X}}

share|improve this question
How would you place the arrow? The point of the overbrace is that its width adapts to the formula, while a vertical arrow is rather thin in the horizontal direction. Not much you can do about that. – Harald Hanche-Olsen Jan 11 '11 at 15:10
@Harald: see my edit. – daniel.jackson Jan 11 '11 at 15:18
Do you really want the arrow centered over "a=b"? That would become very strange if you do it over "i=m" since those letters definitely have different widths. Maybe it's better to put it just over the "=". – Hendrik Vogt Jan 11 '11 at 15:26
@Hendrik: yes, what you said makes more sense. – daniel.jackson Jan 11 '11 at 15:34
up vote 6 down vote accepted

Here is a generalized approach, providing \overarrow[<relation>][<arrow>]{<stuff>}. By default <relation> is = and <arrow> is \uparrow (both arguments are optional). A complement to this is provided by \underarrow[<relation>][<arrow>]{<stuff>} for typesetting underneath <operator> (<arrow> has the default <downarrow> in \underarrow).

enter image description here

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

\NewDocumentCommand{\overarrow}{O{=} O{\uparrow} m}{%
\NewDocumentCommand{\underarrow}{O{=} O{\downarrow} m}{%

  \alpha &\overarrow{Theorem X}\beta & \alpha &\underarrow{Theorem X}\beta  \\
  \alpha &\overarrow[\approx]{Theorem Y}\beta & \alpha &\underarrow[\approx]{Theorem Y}\beta \\
  \alpha &\overarrow[>][\downarrow]{Theorem Z}\beta & \alpha &\underarrow[>][\uparrow]{Theorem Z}\beta


One difference between this typesetting and that proposed by @Herbert is that \stackrel modifies the size of the upper component. Since \overarrow and \underarrow in this answer uses tabular to stack the items, no size adjustment is visible.

xparse provides the interface for mixing optional/mandatory arguments.

share|improve this answer
\def\overUnderArrow@i[#1]#2#3{% #1 under #2 over #3 main argument
  \overUnderArrow[TheoremX]{TheoremX}{\alpha = \beta}
  \overUnderArrow{TheoremX}{\alpha = \beta}
  \overUnderArrow[TheoremX]{}{\alpha = \beta}


enter image description here

The syntax is \overUnderArrow[below]{above}{main entry}. It is also possible to extend the definition for variable arrows direction.

share|improve this answer
is it possible to modify this to a down arrow and position everything beneath? also how can I add some padding around the arrow? it's too close sometimes i.imgur.com/N1MHu.png – daniel.jackson Dec 9 '11 at 19:23
how should I know what and how you extracted something from my solution ... – Herbert Dec 9 '11 at 19:25
I'm talking about your solution as it is shown here.. is it possible to alter it to do what I asked? – daniel.jackson Dec 9 '11 at 20:31
I added a command for a down arrow, see answer – Herbert Dec 9 '11 at 20:54

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.