Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2
Zweite Möglichkeit addiert

03 Jul '18, 05:09

Gel%C3%B6scht's gravatar image

Gelöscht
(ausgesetzt)

Hier ist noch eine Alternative von [https://tex.stackexchange.com/a/432143/121799](https://tex.stackexchange.com/a/432143/121799). \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations,decorations.text} % decorations.text just 4 fun \pgfkeys{/tikz/.cd, outlined arrow width/.store in=\OutlinedArrowWidth, outlined arrow width=10pt, outlined arrow step/.store in=\OutlinedArrowStep, outlined arrow step=1pt, outlined arrow length/.store in=\OutlinedArrowLength, outlined arrow length=5pt, } \pgfdeclaredecoration{outlined arrow}{initial} {% initial arrow butt \state{initial}[width=\OutlinedArrowStep,next state=cont] { \pgfmoveto{\pgfpoint{\OutlinedArrowStep}{\OutlinedArrowWidth/2}} \pgfpathlineto{\pgfpoint{0.3\pgflinewidth}{\OutlinedArrowWidth/2}} \pgfpathlineto{\pgfpoint{0.3\pgflinewidth}{-\OutlinedArrowWidth/2}} \pgfpathlineto{\pgfpoint{1pt}{-\OutlinedArrowWidth/2}} \pgfcoordinate{lastup}{\pgfpoint{1pt}{\OutlinedArrowWidth/2}} \pgfcoordinate{lastdown}{\pgfpoint{1pt}{-\OutlinedArrowWidth/2}} \xdef\marmotarrowstart{0} } \state{cont}[width=\OutlinedArrowStep]{ \ifdim\pgfdecoratedremainingdistance>\OutlinedArrowLength% continue the outlined path \pgfmoveto{\pgfpointanchor{lastup}{center}} \pgfpathlineto{\pgfpoint{\OutlinedArrowStep}{\OutlinedArrowWidth/2}} \pgfcoordinate{lastup}{\pgfpoint{\OutlinedArrowStep}{\OutlinedArrowWidth/2}} \pgfmoveto{\pgfpointanchor{lastdown}{center}} \pgfpathlineto{\pgfpoint{\OutlinedArrowStep}{-\OutlinedArrowWidth/2}} \pgfcoordinate{lastdown}{\pgfpoint{\OutlinedArrowStep}{-\OutlinedArrowWidth/2}} \else \ifnum\marmotarrowstart=0% draw the arrow head \pgfmoveto{\pgfpointadd{\pgfpointanchor{lastup}{center}}{\pgfpoint{-0.5\pgflinewidth}{0}}} \pgflineto{\pgfpoint{-0.5\pgflinewidth}{\OutlinedArrowWidth}} \pgflineto{\pgfpointadd{\pgfpointdecoratedpathlast}{\pgfpoint{-0.5\pgflinewidth}{0}}} \pgflineto{\pgfpoint{-0.5\pgflinewidth}{-\OutlinedArrowWidth}} \pgflineto{\pgfpointadd{\pgfpointanchor{lastdown}{center}}{\pgfpoint{-0.5\pgflinewidth}{0}}} \xdef\marmotarrowstart{1} \else \fi \fi% } \state{final}[width=5pt] { % perhaps unnecessary but doesn't hurt either \pgfmoveto{\pgfpointdecoratedpathlast} } } \begin{document} \begin{tikzpicture}[decoration=outlined arrow,font=\sffamily] \pgfmathsetmacro{\L}{2} \coordinate[label=A] (A) at (-\L,-\L); \coordinate[label=B] (B) at (\L,-\L); \coordinate[label=C] (C) at (\L,\L); \coordinate[label=D] (D) at (-\L,\L); \draw[decorate,blue,opacity=0.5] (A) to (C); \begin{scope}[xshift=5cm] \coordinate[label=A] (A) at (-\L,-\L); \coordinate[label=B] (B) at (\L,-\L); \coordinate[label=C] (C) at (\L,\L); \coordinate[label=D] (D) at (-\L,\L); \draw[decorate,outlined arrow length=15pt] (A.east) to[out=0,in=-180] (C.west); \fill[decoration={text along path, text={~here is some text inside an arrow}, raise=-2.5pt},decorate] (A.east) to[out=0,in=-180] (C.west); \end{scope} \end{tikzpicture} \end{document} [![alt text][1]][1] text][1]][2] Eine andere Möglichkeit ist, shapes.arrows zu verwenden, siehe den Kommentar von cis und [https://tex.stackexchange.com/a/432147/121799](https://tex.stackexchange.com/a/432147/121799). Pro: etwas kürzer und einfacher zu modifizieren, z.B. Füllen der Pfeile. Contra: keine gekrümmten Pfeile. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc,shapes.arrows} \pgfkeys{/tikz/.cd, fat arrow width/.store in=\FatArrowWidth, fat arrow width=2pt, } \newcommand\importantstuff[3][]{ % https://tex.stackexchange.com/a/40855/121799 \node[black!15!white,scale=2] at ([xshift=0.5mm,yshift=-0.5mm]#2) {\sffamily\textbf{#3}}; \node[#1,scale=2] (#3) at (#2) {\sffamily\textbf{#3}}; } \begin{document} \begin{tikzpicture}[ fat arrow/.style={ every to/.style={ to path={ let \p1 = ($(\tikztotarget)-(\tikztostart)$), \n1 = {veclen(\x1,\y1)}, \n2 = {mod(scalar(atan2(\y1,\x1))+360, 360)} % calculate angle in range [0,360) in -- (\tikztotarget) node[draw, inner xsep=0pt,inner ysep=\FatArrowWidth, % use inner ysep to set width minimum height={\n1-\pgflinewidth}, single arrow, single arrow head extend=1.5mm, rotate=\n2, % not shape border rotate, because that for some reason didn't work anchor=tip,#1 ] {} \tikztonodes} }}] \importantstuff[yellow]{60:2}{1} \importantstuff[yellow]{240:2}{2} \importantstuff[yellow]{300:2}{3} \importantstuff[yellow]{120:2}{4} \importantstuff[yellow]{180:2}{6} \importantstuff[yellow]{0:2}{7} \path[fat arrow={fill=white}] (127:1.7) to (293:1.5); \path[fat arrow={fill=white}] (307:1.7) to (113:1.5); \path[fat arrow={fill=white}] (233:1.7) to (67:1.5); \path[fat arrow={fill=white}] (53:1.7) to (247:1.5); \path[fat arrow={fill=white}] (7:1.7) to (173:1.5); \path[fat arrow={fill=white}] (187:1.7) to (-7:1.5); \importantstuff[yellow]{0:0}{5} \end{tikzpicture} \end{document} [![alt text][3]][3] [1]: https://texwelt.de/wissen/upfiles/Screen_Shot_2018-07-02_at_1.12.11_PM.pnghttps://texwelt.de/wissen/upfiles/Screen_Shot_2018-07-02_at_1.12.11_PM.png [2]: https://texwelt.de/wissen/upfiles/Screen_Shot_2018-07-02_at_1.12.11_PM.png [3]: https://texwelt.de/wissen/upfiles/Screen_Shot_2018-07-02_at_7.44.53_PM.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

02 Jul '18, 22:35

Gel%C3%B6scht's gravatar image

Gelöscht
(ausgesetzt)

Hier ist noch eine Alternative von [https://tex.stackexchange.com/a/432143/121799](https://tex.stackexchange.com/a/432143/121799). \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations,decorations.text} % decorations.text just 4 fun \pgfkeys{/tikz/.cd, outlined arrow width/.store in=\OutlinedArrowWidth, outlined arrow width=10pt, outlined arrow step/.store in=\OutlinedArrowStep, outlined arrow step=1pt, outlined arrow length/.store in=\OutlinedArrowLength, outlined arrow length=5pt, } \pgfdeclaredecoration{outlined arrow}{initial} {% initial arrow butt \state{initial}[width=\OutlinedArrowStep,next state=cont] { \pgfmoveto{\pgfpoint{\OutlinedArrowStep}{\OutlinedArrowWidth/2}} \pgfpathlineto{\pgfpoint{0.3\pgflinewidth}{\OutlinedArrowWidth/2}} \pgfpathlineto{\pgfpoint{0.3\pgflinewidth}{-\OutlinedArrowWidth/2}} \pgfpathlineto{\pgfpoint{1pt}{-\OutlinedArrowWidth/2}} \pgfcoordinate{lastup}{\pgfpoint{1pt}{\OutlinedArrowWidth/2}} \pgfcoordinate{lastdown}{\pgfpoint{1pt}{-\OutlinedArrowWidth/2}} \xdef\marmotarrowstart{0} } \state{cont}[width=\OutlinedArrowStep]{ \ifdim\pgfdecoratedremainingdistance>\OutlinedArrowLength% continue the outlined path \pgfmoveto{\pgfpointanchor{lastup}{center}} \pgfpathlineto{\pgfpoint{\OutlinedArrowStep}{\OutlinedArrowWidth/2}} \pgfcoordinate{lastup}{\pgfpoint{\OutlinedArrowStep}{\OutlinedArrowWidth/2}} \pgfmoveto{\pgfpointanchor{lastdown}{center}} \pgfpathlineto{\pgfpoint{\OutlinedArrowStep}{-\OutlinedArrowWidth/2}} \pgfcoordinate{lastdown}{\pgfpoint{\OutlinedArrowStep}{-\OutlinedArrowWidth/2}} \else \ifnum\marmotarrowstart=0% draw the arrow head \pgfmoveto{\pgfpointadd{\pgfpointanchor{lastup}{center}}{\pgfpoint{-0.5\pgflinewidth}{0}}} \pgflineto{\pgfpoint{-0.5\pgflinewidth}{\OutlinedArrowWidth}} \pgflineto{\pgfpointadd{\pgfpointdecoratedpathlast}{\pgfpoint{-0.5\pgflinewidth}{0}}} \pgflineto{\pgfpoint{-0.5\pgflinewidth}{-\OutlinedArrowWidth}} \pgflineto{\pgfpointadd{\pgfpointanchor{lastdown}{center}}{\pgfpoint{-0.5\pgflinewidth}{0}}} \xdef\marmotarrowstart{1} \else \fi \fi% } \state{final}[width=5pt] { % perhaps unnecessary but doesn't hurt either \pgfmoveto{\pgfpointdecoratedpathlast} } } \begin{document} \begin{tikzpicture}[decoration=outlined arrow,font=\sffamily] \pgfmathsetmacro{\L}{2} \coordinate[label=A] (A) at (-\L,-\L); \coordinate[label=B] (B) at (\L,-\L); \coordinate[label=C] (C) at (\L,\L); \coordinate[label=D] (D) at (-\L,\L); \draw[decorate,blue,opacity=0.5] (A) to (C); \begin{scope}[xshift=5cm] \coordinate[label=A] (A) at (-\L,-\L); \coordinate[label=B] (B) at (\L,-\L); \coordinate[label=C] (C) at (\L,\L); \coordinate[label=D] (D) at (-\L,\L); \draw[decorate,outlined arrow length=15pt] (A.east) to[out=0,in=-180] (C.west); \fill[decoration={text along path, text={~here is some text inside an arrow}, raise=-2.5pt},decorate] (A.east) to[out=0,in=-180] (C.west); \end{scope} \end{tikzpicture} \end{document} [![alt text][1]][1] [1]: https://texwelt.de/wissen/upfiles/Screen_Shot_2018-07-02_at_1.12.11_PM.png

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×