1

I'd like to draw an arrow with corners in TikZ, which looks the following (should have the same width everywhere):

enter image description here

I am aware of this solution, but it makes the whole arrow colored because of the thick line width instead of having a white arrow with a colored border around it.

MWE for drawing an arrow without a corner:

\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\usepackage{tikz} \usetikzlibrary{calc, shapes.arrows}

\begin{document}

\begin{tikzpicture}

\node (arrow) at (0,0) {};
\node [single arrow, draw, minimum height=1cm, single arrow head extend=0.2cm, minimum width=0.5cm] at (arrow) {text};

\end{tikzpicture}

\end{document}

enter image description here

Isi
  • 197

2 Answers2

2

You can try with Paul Gaborit's styles and some trial and error adjustments:

\documentclass[margin=5mm]{standalone}
\usepackage{tikz} 
\usetikzlibrary{arrows.meta}

\tikzset{ double -latex/.style args={#1 colored by #2 and #3}{
-latex,line width=#1,#2, postaction={draw,-latex,#3,line width=(#1)/2,shorten <=(#1)/4,shorten >=4.5*(#1)/4}, }, }

\begin{document}

\begin{tikzpicture} \draw[double -latex=8mm colored by black and white] (0,0)|-++(-5,-1)|- node[pos=0.65]{Text} ++(4,-2); \end{tikzpicture}

\end{document}

enter image description here

Ignasi
  • 136,588
  • Thanks! I was able to modify the arrow to have the same thin line width as the single arrow shape (sorry, this was probably not clear from my question). How can I modify the arrow tip such that it looks like the one in the single arrow? – Isi Oct 20 '22 at 07:54
  • 1
    Try with Triangle instead of latex arrow tip – Ignasi Oct 20 '22 at 08:22
1

Using the Ignasi's suggestions and some trial and error, I came finally up with this solution, to have the arrow being very similar to single arrow:

\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\usepackage{tikz} \usetikzlibrary{calc, shapes.arrows}

% for arrow around corner \usetikzlibrary{arrows.meta} \tikzset{ double -latex/.style args={#1 colored by #2 and #3}{
-{Triangle[length=0.5cm,width=0.92cm]},line width=#1,#2, postaction={draw,-{Triangle[length=0.46cm,width=0.84cm]},#3,line width=(#1)-2*0.2mm, shorten <=0.2mm, shorten >=0.22mm)}, }, }

\begin{document}

\begin{tikzpicture}

    \node (arrow) at (0,0) {};
    \draw[double -latex=5mm colored by black and white] (arrow) -- ++ (1,0) |- (-3, -1) |- node[pos=0.8]{text} ++ (2,-2);
    \node [single arrow, draw, minimum height=1cm, single arrow head extend=0.2cm, minimum width=0.5cm] at (-1.75,-4) {text};

\end{tikzpicture}

\end{document}

enter image description here

Isi
  • 197