3

How does one change the distance between the text label and an arrow (for example), by default the labels are way too high and way too low, it looks better if they are flush with the arrow (they seem to interfere less with the rows above and below for that matter).

I found a partial solution, where I can bring the labels a little bit closer to the arrow shaft, but that was it, I cannot bring them closer.

enter image description here

\documentclass{article}
\usepackage{extarrows}

\begin{document}
$\xlongleftrightarrow[\quad \text{\scriptsize{below}} \quad]{\text{\scriptsize{above}}}$ \quad
$\xlongleftrightarrow[\quad \raisebox{+3.5ex}{\text{\scriptsize{below}}} \quad]{\raisebox{-2.5ex}{\text{\scriptsize{above}}}}$ \quad 
$\xlongleftrightarrow[\quad below \quad]{above}$
\end{document}

Also, how can one change the size of the label font in a more elegant way (if there is one)?

4
  • You are using the size settings wrong (use {\scriptsize above} instead of \scriptsize{above}) and you need to include the amsmath package to use \text.
    – masu
    Commented Oct 26, 2013 at 17:32
  • For the main task here, one might try to use TikZ.
    – masu
    Commented Oct 26, 2013 at 17:35
  • I am using \usepackage{mathtools} (which includes amsmath). This can only be done with TikZ? I do not know how to use TikZ yet... Thank you!
    – Diegis
    Commented Oct 26, 2013 at 18:23
  • \usepackage{mathtools} - include it in your minimal working example (MWE) next time ;) . I'm almost sure it can be done some other ways, I just wanted to noted that it can be done (using TikZ - but it is maybe an overshoot).
    – masu
    Commented Oct 26, 2013 at 18:27

1 Answer 1

3

Change the -2pt and -0.5pt of the example to fit your needs:

MWE

\documentclass{article}
\usepackage{stackengine}
\usepackage{extarrows}
\begin{document}
$\stackunder[-2pt]{$\stackunder[-0.5pt]{aaa}{
$\overleftrightarrow{
\qquad\qquad % or any other spacer   
}$
}$}{below}$
\end{document}
4
  • It does not seem to solve my problem, labels in all three seem to be at the same distance from the arrow shaft.
    – Diegis
    Commented Oct 26, 2013 at 18:25
  • @Diegis, please see the updated answer
    – Fran
    Commented Oct 26, 2013 at 20:00
  • I do not have the "stackengine" package on my system, how does one get it? Is this a standard package, more or less?
    – Diegis
    Commented Oct 28, 2013 at 18:00
  • Got the package, compiled your example successfully, but there is still a problem: now the whole thing is lowered, the "aaa" is level with the text row, the arrow is slightly under the level of an underscore, and the "below" is actually on the next row. I need the arrow to stay in the middle of the text row, but this is OK, I fixed it like this: "text \raisebox{+0.8ex}{$\stackunder[-2pt]{$\stackunder[-0.5pt]{aaa}{$\overleftrightarrow{\qquad\qquad }$ }$}{below}$} text\\" -- thank you for your response, it's really useful to me!
    – Diegis
    Commented Oct 28, 2013 at 18:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .