I have been trying to draw a big flowchart inside my article. I have managed to draw most of it but got stuck in some places.
First, I can't draw the arrow marked in red in the image. I tried to use anchor east, west, but failed.
Second, in a previous question similar to this, I was advised that the code I used here is for TikZ 2.0 and the new TikZ 3.0 has syntax = of
. When I used this syntax the whole flow chart grew large in size and went out of page. What am I doing wrong? In general, how can I adjust the size of a big flowchart inside my article? (I was trying \linewidth
, but it didn't work.)
Lastly, I have a doubt: The arrow marked 1 in the pic, how to make it perpendicular? The arrow marked 2 looks tilted, how to make it straight?
The code I used:
\documentclass{article}
\usepackage{tikz}
\usepackage{listings}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{positioning}
\tikzstyle{io} = [trapezium, trapezium left angle=80, trapezium right angle=100, minimum width=2.5cm, minimum height=1.5cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1.5cm, text centered, draw=black, fill=orange!50]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{document}
\begin{figure*}[h!] %{\linewidth}
%\centering
\begin{tikzpicture}
\node (A)[io,align=center]{A};
\node (B)[process, right of = A,xshift=3cm, align=center]{B};
\node (C)[io,right of = B,xshift=3cm, align=center]{C \\Ready};
\node (D)[process,right of = C,xshift=3cm, align=center]{Do Calculations};
\node (E)[process,below of = A,yshift=-1.5cm, align=center]{E};
\node (F)[io,below of = E,xshift=-1cm,yshift=-1.5cm, align=center]{F};
\node (G)[io,right of = F,xshift=2cm]{G};
\node(Addition)[process, below of = F,yshift=-1.5cm, align=center]{$F + \sum_{i=1}^{5} G $};
\node (OP)[io,below of = Addition, yshift = -1.5cm, align=center]{OP};
\node (H)[io,below of = D,yshift=-1.5cm, align=center]{H};
\node(I)[process, below of = H,yshift=-1.5cm, align=center]{Calculate $I$};
\node(J)[process, below of = I,yshift=-1.5cm, align=center]{Jjjj};
\node(K)[process, below of = J,yshift=-1.5cm, align=center]{Final calc};
\node(L)[process,right of = G,xshift=3.5cm, align=center]{Apply K function\\to get G};
\node(New G)[io,below of = L,yshift=-1.7cm, xshift=-1cm, align=center]{New G};
\draw [arrow] (A) -- (B);
\draw [arrow] (B) -- (C);
\draw [arrow] (C) -- (D);
\draw [arrow] (D) -- (H);
\draw [arrow] (H) -- (I);
\draw [arrow] (I) -- (J);
\draw [arrow] (J) -- (K);
%\draw [arrow] (K)node[anchor=west] -|- node[anchor=east](L);
\draw [arrow] (G) -- (L);
\draw [arrow] (L) -- (New G);
\draw [arrow] (New G) -- (Addition);
\draw [arrow] (Addition) -- (OP);
\draw [arrow] (F) -- (Addition);
\draw [arrow] (E) -- (F);
\draw [arrow] (E) -- (G);
\draw [arrow] (A) -- (E);
\end{tikzpicture}
\end{figure*}
\end{document}
positioning
syntax, which you really should, you can pick a smallernode distance
, e.g.node distance=2em and 1.5em
. And remove all the manual shifts.