Double arrow with text

1,302 views
Skip to first unread message

drorata

unread,
Oct 25, 2009, 6:22:23 AM10/25/09
to LaTeX Users Group
I want to produce a double arrow (i.e. an arrow with heads on both
sides) with text on top of the arrow. So far I managed either to have
a right-arrow with the auto-adjusting length, or double-arrow with
fixed length regardless of the text's length...

Any ideas?

Werner Grundlingh

unread,
Oct 27, 2009, 2:54:41 PM10/27/09
to LaTeX Users Group
The mathtools package, available online via CTAN from:
http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=mathtools
has what is called "extensible arrows". For example, you would
probably be interested in
\xleftrightarrow[<sub>]{<sup>}
See p 11 of the package documentation, also available from the above
link.

Werner

drorata

unread,
Oct 28, 2009, 4:38:04 AM10/28/09
to LaTeX Users Group
Thanks a lot! This is what I was looking for!

There is only one problem though - the typesetting of the arrow is not
100% smooth, and when using the \xLeftrightarrow it looks even worse.
But this is, at least for now, good enough.

Thanks again,
Dror

Werner Grundlingh

unread,
Oct 28, 2009, 10:33:04 PM10/28/09
to LaTeX Users Group
On Oct 28, 1:38 am, drorata <dror...@gmail.com> wrote:
> Thanks a lot! This is what I was looking for!
>
> There is only one problem though - the typesetting of the arrow is not
> 100% smooth, and when using the \xLeftrightarrow it looks even worse.
> But this is, at least for now, good enough.
>
> Thanks again,
> Dror

Hi Dror,

It may just be the rendering in your PDF/PS viewer. The minimal
example below compiles fine, and produces the output
xleftrightarrow.pdf in the Files section of this forum:

\documentclass{article}
\usepackage{mathtools} \pagestyle{empty}
\begin{document}
This is a test to see whether $\xleftrightarrow{\text{this is long
text}}$ looks okay.

Even this $\xleftrightarrow[\text{this is also very long text}]{}$
looks fine.

And, finally, another test on $\xleftrightarrow[\text{some text}]{\text
{some longer text above}}$.
\end{document}

Werner

drorata

unread,
Oct 29, 2009, 4:55:19 AM10/29/09
to LaTeX Users Group
Yep, looks pretty good! I don't know what is the reason in my case...
I'm using the package with in the beamer framework, maybe this causes
the problem? I've tried to open the .pdf with both evince and acrobat-
reader, and in both the arrow is not smooth. When it is a double
arrow, it looks even worse.

in any case, the solution so far is good enough!

Thanks a lot,
Dror

Werner Grundlingh

unread,
Oct 31, 2009, 10:23:33 PM10/31/09
to LaTeX Users Group
On Oct 29, 12:55 am, drorata <dror...@gmail.com> wrote:
> Yep, looks pretty good! I don't know what is the reason in my case...
> I'm using the package with in the beamer framework, maybe this causes
> the problem? I've tried to open the .pdf with both evince and acrobat-
> reader, and in both the arrow is not smooth. When it is a double
> arrow, it looks even worse.
>
> in any case, the solution so far is good enough!
>
> Thanks a lot,
> Dror

Here's another option you could try, using the extpfeil package. It is
also available online via CTAN from:
http://tug.ctan.org/pkg/extpfeil
I have never used it, but perhaps the rendering may be better in your
context.

Werner
Reply all
Reply to author
Forward
0 new messages