
ich erstelle gerade ein Flussdiagramm wie das untenstehende. Aber ich habe keine Ahnung, wie ich das ganze Diagramm in der Mitte der Seite anordnen kann. (nicht oben auf der Seite) Außerdem: irgendwelche Ideen, wie ich den mittleren Pfeil wie in der Grafik unten erstellen und wie ich die Formulierungen unter dem unteren Pfeil hinzufügen kann. (Dafür sind die Formulierungen zu zahlreich) Vielen Dank, ich bin für alle hilfreichen Ideen dankbar.
\documentclass{article}
%-----------------------------------------------
\usepackage{pdflscape}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{eurosym}
%\usepackage{rotating}
\usepackage{adjustbox}
%\usepackage[pdftex]{graphics}
\usepackage[a4paper,margin=0mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, calc, chains, quotes, chains, positioning, shapes.geometric}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=4cm, minimum height=1cm,text centered, text width=4cm, draw=black]
\tikzstyle{process} = [rectangle, rounded corners, minimum width=4cm, minimum height=1cm, text centered, text width=4cm, draw=black]
\tikzstyle{process2} = [rectangle, rounded corners, minimum width=4cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=orange!0]
\tikzstyle{process3} = [rectangle, rounded corners, minimum width=4cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=orange!0]
\tikzstyle{process4} = [rectangle, rounded corners, minimum width=4cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=orange!0]
\tikzstyle{process5} = [rectangle, rounded corners, minimum width=4cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=orange!0]
\tikzstyle{arrow} = [thick,->,>=stealth]
\tikzstyle{line}=[draw, very thick, color=black!75, -latex']
\tikzstyle{empty}=[]
%-----------------------------------------------
\begin{document}
\begin{landscape}
\begin{figure}[htb]
\centering
\begin{adjustbox}{width=29.5cm, height=\textheight, keepaspectratio}
\begin{tikzpicture}[node distance=2cm][scale=0.01,anchor=center]
\node (start) [startstop] {\footnotesize Employed Income \\ $<$ 59 400 \euro};
\node (pro2) [process, below = 10mm of start]{\footnotesize Employed Income \\ $>$ 59 400 \euro};
\node (pro1) [process2, below = 1mm of pro2]{\footnotesize Self-Employed};
\node (pro3) [process3, below = 1mm of pro1]{\footnotesize Civil Servants};
\node (pro4) [process4, right = 4cm of start]{\footnotesize SHI};
\node (pro5) [process5, right = 4cm of pro1]{\footnotesize PHI};
\draw [arrow] (start) -- node[anchor=south]{mandatory}(pro4);
\draw [arrow,dashed] (pro3.east) -- (pro5.west);
\end{tikzpicture}
\end{adjustbox}
\end{figure}
\end{landscape}
\end{document}
Antwort1
Ihre Tabelle weist viele Probleme auf:
für tikzpicture
:
- für Stile von Bildelementen wird veraltet verwendet
tikzstyle
. Stattdessen sollten Sie verwendentizset
(siehe mwe unten) - Stile sind nicht einheitlich. Die Formen aller Knoten sind gleich
- definierte Füllfarbe ist seltsam:
fill= orange!0
? das ist dasselbe wiefill=white
... - warum verkleinern Sie das Bild zuerst und vergrößern es dann um
adjustbox
? Es ist viel, viel besser, das Bild in natürlicher Größe zu zeichnen. - Schriftgröße neuerdings wie folgt definieren: „{\footnotesize Text im Knoten}“. Dies führt zu falschen Zeilenabständen in mehrzeiligen Texten.
- wenn du
minimum width
gleich definiersttext width
,minimum width
ist das überflüssig. Es macht Sinn, wenn es größer ist als die Textbreite plus zweiinner xsep
für Bildzentrierung auf der Seite:
- Lassen Sie einfach die Positionsoption der Figur weg
daneben gibt es noch weitere Unklarheiten, zum Beispiel, warum die Seitenränder auf Null gesetzt werden, wenn das Bild nicht so groß ist usw.
ich schlage folgende Überarbeitung Ihres Codes vor:
\documentclass{article}
%-----------------------------------------------
\usepackage{pdflscape}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{eurosym}
%\usepackage{rotating}
\usepackage{adjustbox}
%\usepackage[pdftex]{graphics}
\usepackage[a4paper,margin=0mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
calc, chains,
positioning,
quotes,
shapes.geometric}
\tikzset{
> = Stealth,
box/.style = {rectangle, rounded corners,
draw=#1, fill=#1!30, thick,
text width=4cm, minimum height=1cm, align=center},
lin/.style = {draw=gray, very thick},
every edge quotes/.append style = {font=\footnotesize, align=left}
}
%-----------------------------------------------
\begin{document}
\begin{landscape}
\begin{figure}
\centering
\begin{tikzpicture}[%transform shape, scale=2, % use in case
% when you like to enlarge image
node distance = 2mm and 44 mm
]
\begin{scope}[box/.default = olive]
\node (n1) [box] {Employed Income \\ $<$ 59 400 \euro};
\node (n2) [box, below=6mm of n1] {Employed Income \\ $>$ 59 400 \euro};
\node (n3) [box, below=of n2] {Self-Employed};
\node (n4) [box, below=of n3] {Civil Servants};
%
\node (n5) [box, right=of n1] {SHI};
\node (n6) [box, right=of n3] {PHI};
\end{scope}
%
\draw [lin,->] (n1) to ["mandatory"] (n5);
%
\draw [lin] (n2.east) -- ++ (0.5,0) |- (n3) coordinate[pos=0.25] (aux);
\draw [lin,->] (aux) to ["choice"] ++ (1.2,0) to (n5.south west);
\draw [lin,->] (aux) ++ (1.2,0) to (n6);
%
\draw [lin,->,dashed] (n4.east) to ["Additional insurance\\
(most healt care costs\\
for civil servants are\\
\dots" ',pos=0.2] (n6);
\end{tikzpicture}
\end{figure}
\end{landscape}
\end{document}
Überprüfen Sie, ob das Ergebnis Ihrem Wunschergebnis nahe kommt: