
agora estou criando um fluxograma como o abaixo. Mas não tenho ideia de como ajustar o gráfico inteiro no meio da página. (não no topo da página) Além disso, alguma ideia sobre como criar a seta do meio como no gráfico abaixo e como adicionar o texto abaixo da seta inferior. (o texto é demais para isso) Muito obrigado, agradeço para todas as ideias úteis.
\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}
Responder1
sua mesa tem muitos problemas:
para tikzpicture
:
- para estilos de elementos de imagem é usado obsoleto
tikzstyle
. em vez disso, você deve usartizset
(veja mwe abaixo) - estilos não são consistentes. todas as formas dos nós são iguais
- a cor de preenchimento definida é estranha:
fill= orange!0
? isso é o mesmo quefill=white
... - por que primeiro você reduz a imagem e depois amplia
adjustbox
? muito, muito melhor é desenhar uma imagem em tamanho natural. - tamanho da fonte mais recente, defina como você faz: {\footnotesize text in the node}`. isso leva a espaços de linha errados em texto de várias linhas.
- se você definir
minimum width
igual atext width
, entãominimum width
é supérfluo. faz sentido, se for maior que a largura do texto mais doisinner xsep
para centro de imagem na página:
- apenas omita a opção de posição da figura
além disso, há coisas mais obscuras. por exemplo, por que as bordas da página estão definidas como zero se a imagem não for tão grande, etc.
sugiro a seguinte revisão do seu código:
\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}
veja se o resultado está próximo do que você gostaria de obter: