3

I want to align the double arrow shape in the tikz package with an arc, like this one:

\documentclass[landscape]{article}
\usepackage[a2paper]{geometry}
\usepackage{tikz}
\usetikzlibrary{fadings,shapes.arrows,shadows,arrows,positioning,shapes}
\pagenumbering{gobble}

\begin{document}
\begin{tikzpicture}[scale=2,node distance=1cm, auto,baseline=-.5ex]

\node (dummy) at (-5,-8) {}; 

\begin{scope}[remember picture,overlay,shift={(dummy.center)}]
\draw (8.75,4.75) arc (440:160:7.5); % I'm trying to align my double arrow shape with this arc.
\end{scope}

\end{tikzpicture}
\end{document}

By popular demand - a picture: picture

Preferrably I want the arrow tips to be unaffected by the bending of the shape. This would probably require a different shape than double arrow, though.

1010011010
  • 6,357
  • 1
    Could you please describe it a little more? If you could add a drawing by hand, it would be great, because there is no double arrow, it is difficult to imagine what you are trying to achive. – Malipivo Apr 12 '14 at 13:28
  • 1
    One tip: http://tex.stackexchange.com/questions/153922/how-to-draw-shape-as-curved-arrows-with-text-with-tikz – Malipivo Apr 12 '14 at 16:30

1 Answers1

1

Workaround (version 1)

I have only a workaround for you. I draw two arrows on each other, the arrowheads are shifted, so I manually move them slightly back. The first arrowhead's position is controlled by an extra point, the second arrowhead's position is controlled by an angle and a distance. Please try it if it fits your needs.

%! *latex mal-doublearrow.tex
\documentclass[landscape]{article}
\usepackage[a2paper]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows}
%\usetikzlibrary{fadings,shadows,arrows,positioning,shapes}
\pagenumbering{gobble}
\begin{document}
\tikzset{mal/.style={<->, >=stealth, 
double arrow, line width=8mm,
 draw=black, double arrow head extend=1.5cm, double arrow head indent=1.25cm}}
\begin{tikzpicture}%[scale=2,node distance=1cm, auto,baseline=-.5ex]
\node (dummy) at (-5,15) {}; 
\begin{scope}[remember picture,overlay,at={(dummy)}]
\def\malpath{(7,5)-- (8.75,4.75) arc (440:160:7.5)--+(65:2)}
\draw[mal] \malpath; % I'm trying to align my double arrow shape with this arc.
\def\malpath{(7.2,5)--(8.75,4.75) arc (440:160:7.5)--+(65:1.8)}
\draw[mal, line width=6mm, draw=yellow] \malpath;
\end{scope}
\end{tikzpicture}
\end{document}

mwe


Edit (version 2)

%! *latex mal-doublearrow.tex
\documentclass[landscape]{article}
\usepackage[a2paper]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes}
\pagenumbering{gobble}
\begin{document}
\tikzset{mal/.style={<->, >={Stealth[length=40mm,sep=-5mm]},
 double distance=6mm, line width=5mm,
 draw=black, double=yellow}}
\begin{tikzpicture}
\begin{scope}
\draw[mal](6.5,5)--(8.75,4.75) arc (440:160:7.5)--+(70:2);
\end{scope}
\end{tikzpicture}
\end{document}

mwe

Malipivo
  • 13,287
  • Does this workaround offer any options to color the arrow similarly to the regular "flat" double arrow? My next step is to make the shape gradually fade in color, with say: [left color=blue,right color=green,middle color=cyan] – 1010011010 Apr 12 '14 at 16:53
  • It would require some more experiments. I am using line width, it can be changed, the yellow can be changed to white as well as to a shading object (untested). Your turn. :-) – Malipivo Apr 12 '14 at 16:59
  • I think I have an idea about using tikzfading and the draw={fading} command. Thank you for your insight. – 1010011010 Apr 12 '14 at 17:12
  • You can redefine mal style or copy its content directly to the \nodes. I think that I have made some mistake anyway as double arrow head * parameters seem not to work. Yes, I am, you asked for it (in drawing). I believe there is some double line width parameter and that second arrow won't be needed. – Malipivo Apr 12 '14 at 17:15
  • Oh, double distance=4mm, double=yellow it is... It looks there is more work in it. – Malipivo Apr 12 '14 at 17:19
  • I polished the first version, but no, shading is not working if we would like to change the yellow color, it is filling the inner part of a circle. – Malipivo Apr 12 '14 at 17:41
  • Is there no way for the parser to "scan" the current objects drawn in the PDF and then assign them to a node? That way we could circumvent the necessity of this fade-type color functionality within PGF/tikz, as I believe tikz may not offer it. – 1010011010 Apr 12 '14 at 17:47
  • That tikzfading library sounds like a good idea, otherwise we try to mix up \node and \draw commands. – Malipivo Apr 12 '14 at 17:51
  • One more tip (a nonlinear transformation): http://tex.stackexchange.com/questions/166860/how-to-bend-a-tikz-node/167109 – Malipivo Apr 12 '14 at 20:53
  • I've already seen that one. The problem is that my picture is huge and these nonlinear transformations are impractical to use because everything scales (which was also a remark by the poster of the answer). I honestly don't see a way my specific idea can be implemented: I If I try to use this last answer, I'm working for hours on getting the right set of coordinates for my bezier. I can't get it right at such enormous distances. II If I use your answer and transform the mal into a node, I get similar problematic results. I'm starting to think that tikz simply can't do this. – 1010011010 Apr 12 '14 at 23:01
  • You could draw the contour all by yourself. I have done that once using to and several ins and outs. – Malipivo Apr 13 '14 at 06:05
  • I will try to find my old code for that arrow drawn from a scratch. I am not promising a thing, but I will try. – Malipivo Apr 13 '14 at 10:23
  • Try it, it might be it, but it is hard to guess. – Malipivo Apr 13 '14 at 10:29
  • Whoever might find it useful, this thread has the intended functionality MINUS the ability to place the object on a particular place in the picture. – 1010011010 Apr 13 '14 at 15:51