alt text

Wie kann ich erreichen, dass die Pfeilspitze nicht durchgehend gezeichnet wird.

Ziel: Solche Pfeile erstellen:

alt text

BTW: Es muss nicht die Pfeilspitze Latex sein, bloß bei Triangle[] erzeugte es unschöne Proportionen.

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\documentclass[a4paper, landscape]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
%\usetikzlibrary{shapes.arrows}
\pagestyle{empty}
\begin{document}
\def\m{2pt}
\begin{tikzpicture}[
overlay, transform shape, remember picture, shift={(current page.center)},
%
Pfeil/.style={
line width=\m, double distance=1.5*\m,
arrows = {-Latex[length=0pt 3 0, fill=white]},
line cap=rect,
}
]
\def\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[] (A) rectangle (C);
\draw [Pfeil] (A) -- (C);
\end{tikzpicture}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

gefragt 02 Jul '18, 19:22

cis's gravatar image

cis
9.5k95460491
Akzeptiert-Rate: 29%

bearbeitet 03 Jul '18, 01:17

Da vermutlich eher die zweitere Alternative, weil sich draw besser zwischen Koordinaten eignet. Mmmh, mal verstehen, was er da gemacht hat.

(02 Jul '18, 20:24) cis

Im von @saputello verlinkten Beispiel geht es durch Nachzeichnen der Pfeile mit der InnerWhite-Option.

Ganzes Beispiel:

alt text

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\documentclass[a4paper, landscape]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
%\usetikzlibrary{shapes.arrows}
\pagestyle{empty}
\begin{document}
\def\L{8 cm}
\def\m{2mm}
\begin{tikzpicture}[
overlay, transform shape, remember picture, shift={(current page.center)},
%
every node/.style={
draw, circle, fill=black,
font=\sffamily\bfseries\Huge,
text=white,
outer sep=2*\m,
},
Pfeil/.style={
line width=0.5\m,
double distance=1.5*\m,
arrows = {-Latex[length=0pt 3 0, fill=white]},
line cap=rect,
%shorten >=5mm,
},
InnerWhite/.style={white,
line width=0.15*\m,
shorten >= 11.3/2*\m,
double distance=1.2*\m,
}
]
\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);
\coordinate[label=M] (M) at (-\L,0);
\coordinate[label=N] (N) at (\L,0);
% Rechteck
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Permanenter link

beantwortet 02 Jul '18, 20:48

cis's gravatar image

cis
9.5k95460491
Akzeptiert-Rate: 29%

bearbeitet 02 Jul '18, 21:00

Hier ist noch eine Alternative von https://tex.stackexchange.com/a/432143/121799.

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\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
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

alt text

Eine andere Möglichkeit ist, shapes.arrows zu verwenden, siehe den Kommentar von cis und 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.

Öffne in Overleaf
Code, hier editierbar zum Übersetzen:
\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);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

alt text

Permanenter link

beantwortet 02 Jul '18, 22:35

Community's gravatar image

Community
21
Akzeptiert-Rate: 56%

bearbeitet 03 Jul '18, 05:09

Gel%C3%B6scht's gravatar image

Gelöscht
(ausgesetzt)

Das Ergebnis sieht gut aus, aber scheint mir reichlich kompliziert umgesetzt. Ich dachte anfangs, man könne ggf. den single aurrow (ein node-Pfeil, kein Pfad-Pfeil!) aus \usetikzlibrary{shapes.arrows} (nicht ~.meta) verwenden, etwa mit path picture. Aber das klappte irgendwie nicht. Wäre ggf. die einfachste Lösung.

(03 Jul '18, 00:33) cis

@cis Über kompliziert oder nicht möchte ich hier nicht streiten, aber das mit den shapes geht natürlich schon, siehe https://tex.stackexchange.com/a/432147/121799. Der Grund warum ich das nicht 100% mag, ist dass man damit keine gekrümmten Pfeile hinkriegt. (Aber meine Lösung geht auch schief, wenn die Pfeile stark gekrümmt sind...)

(03 Jul '18, 02:46) Community
Deine Antwort
[Vorschau ausblenden]

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Frage-Themen:

×731
×6

gestellte Frage: 02 Jul '18, 19:22

Frage wurde gesehen: 8,818 Mal

zuletzt geändert: 03 Jul '18, 05:09

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×