13

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
    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
    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
    Aug 8, 2018 at 10:05
  • 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
    Jul 16, 2021 at 17:22

2 Answers 2

11

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
    Aug 8, 2018 at 9:44
  • How does one do curved arrows with latex-latex? 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
    Apr 29, 2021 at 7:28
18

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.