16

To draw a LaTeX arrow I use the following code:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{arrows, arrows.meta}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\draw [ultra thick, green!40!black, -latex'] (-.72,4.) -- +(-90:1.4);
\end{tikzpicture}
\end{frame}
\end{document}

Which gives me the left arrow. To make it a double headed arrow, I use a node to fake the second head, which gives me the right double headed arrow.

\begin{tikzpicture}[scale=.9, transform shape]
\draw [ultra thick, green, -latex'] (-.72,4.) node [minimum size=.8cm, xshift=0cm, yshift=-.26cm, path picture={\draw [ultra thick, green, solid, -latex'] (0,0) -- +(90:.4cm);}]{} -- +(-90:1.4);
\end{tikzpicture}

Enter image description here

Is there a way to make a true LaTeX double headed arrow without the use of the node to fake the second head?

4
  • 2
    Why don't you use latex'-latex' ?
    – BambOo
    Commented Aug 8, 2018 at 9:05
  • Thank you. I tried -latex' -latex' which gave me an error, I did not know that I have to omit the first -
    – Hany
    Commented Aug 8, 2018 at 9:09
  • 2
    - in arrows definitions represents the arrow line, while < or >, or whatever style, define the kind of tip and position: <-> two sided arrow, -> from left to right, <- from right to left.
    – Ignasi
    Commented Aug 8, 2018 at 10:05
  • 1
    I came here via Google, but was having problems applying these suggestions. But @Ignasi 's comment I think shows the simplest way: \draw [<->] (-1/3,2/3) -- (-1/3,4/3); I found it on page 41-42 (section 2.17) of the PGF manual (ctan.mirrors.hoobly.com/graphics/pgf/base/doc/pgfmanual.pdf) that @BambOo mentioned.
    – Izek H
    Commented Jul 16, 2021 at 17:22

2 Answers 2

12

To provide a complete answer :

You can use the latex'-latex' style definition.

More documentation is available on arrows definition at section 16.2 page 182 of the pgf manual.

3
  • Thank you very much for your answer. I will read this section thoroughly.
    – Hany
    Commented Aug 8, 2018 at 9:44
  • How does one do curved arrows with latex-latex? Commented Apr 29, 2021 at 4:14
  • @user3236841 I you have another question, please create a new post, otherwise you may receive little attention. In the meantime, have a look at tex.stackexchange.com/questions/508135/…. Where multiple bent arrows are shown (one of my own questions, maybe not the best example).
    – BambOo
    Commented Apr 29, 2021 at 7:28
24

I hope this helps:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{arrows, arrows.meta}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{tikzpicture}[scale=.9, transform shape]
\draw[>=triangle 45, <->] (0,0) -- (2,0);
\end{tikzpicture}
\end{frame}
\end{document}

which shall give you

enter image description here

Extra

You could choose to play probably play with \draw[>=style options, <->, color options] (0,0) -- (2,0);

enter image description here

You must log in to answer this question.

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