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

In the following example instead of \underbrace, I want to use something like \text bar\leftarrow j+1\rightarrow\textbar.


Is there any similar command?

share|improve this question
up vote 7 down vote accepted

You can use \underset from amsmath:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath
$(p_{1},p_{2}\ldots,p_{m-j},\underbrace{m,m,\dots,m}_{j+1})$ \par
$(p_{1},p_{2}\ldots,p_{m-j},\underset{\leftarrow\hfill j+1\hfill\rightarrow}{m,m,\dots,m})$ \par
$(p_{1},p_{2}\ldots,p_{m-j},\underset{\text{\textbar}\leftarrow\hfill j+1\hfill\rightarrow\text{\textbar}}{m,m,\dots,m})$
share|improve this answer

If you want to be able to get a bit fancier, there is always the tikz way. This \UnderArrow macro will auto adjust for the longer texts either above or as part of the text below, and also allows you to apply styling to the lines and arrows:

enter image description here



    \begin{tikzpicture}[baseline, inner sep=0pt]
        \node [anchor=base]  (A) {$#2$};
        \node [below] (B) at (A.south) {$#3$};
            \draw [thick, #1, -] ([xshift=-0.07em]A.south east) -- ++ (0,-2.0ex);
            \draw [thick, #1, -] ([xshift=+0.07em]A.south west) -- ++ (0,-2.0ex);
            \draw [-stealth, #1] (B.west) -- ([xshift=+0.07em]B.west -| A.south west);
            \draw [-stealth, #1] (B.east) -- ([xshift=-0.07em]B.east -| A.south east);



$(p_{1},p_{2}\ldots,p_{m-j},\UnderArrow[red, -latex]{m,n,o,p,\dots,q,r,s}{j+k+1})$
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.