coding the arrow's path in flowchart
You only need to remove node "A-6" and draw arrow from A-3
to A-2
. I also took opportunity in rearrange loading tikz
libraries and a little bit simplified/ shortened code for image:
\documentclass[a4paper,11pt,twoside]{book}
\usepackage[a4paper,
margin=2.5cm]{geometry}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{greek}
\setromanfont{Minion Pro} %% Select your favorite font
\setotherlanguage{english}
\usepackage{tikz}
\usetikzlibrary{angles, arrows, arrows.meta,
calc, chains,
decorations.text, decorations.pathreplacing,
fadings, fit,
patterns, positioning,
quotes,
shapes, shadows.blur,
spy}
\begin{document}
\centering
\begin{tikzpicture}[
node distance = 8mm and 4mm,
start chain = A going below,
base/.style = {draw, minimum width=32mm, minimum height=8mm,
align=center, on chain=A, join=by -Stealth},
startstop/.style = {ultra thick,double,base, rectangle, rounded corners, fill=white},
process/.style = {ultra thick,base, rectangle, fill=white},
io/.style = {trapezium, trapezium stretches,
trapezium left angle=70, trapezium right angle=110,
base, ultra thick, fill=white},
decision/.style = {ultra thick,base, diamond, fill=white},
every edge quotes/.style = {auto=right}
]
\node [startstop] {Έναρξη}; % <-- A-1
\node [io] {Εισαγωγή};
\node [decision] {Ερώτηση};
\node [io] {Απάντηση};
\node [startstop] {Τέλος}; % <-- A-5
\coordinate[above left=of A-2.east] (aux);
\draw [arrows=-Stealth]
(A-3.east) to ["ναι"] ++ (1,0) |- (aux) -- (aux |- A-2.north);
\path (A-3) to ["όχι"] (A-4);
\end{tikzpicture}
\end{document}
Edit 1: compiled by XeLaTeX engine.
Edit 2: from all libraries in your MWE are actually used only the following:
\usetikzlibrary{arrows.meta,
chains,
positioning,
quotes,
shapes
}
I modified as little as possible your code by doing:
- I added the
every join/.style=-Stealth
option that automatically draws the arrows without having to rebuild the chain. I placed the node A-6 at the top right of the node A-2 without joining it to the chain, without tracing it and transforming it into a coordinate.
\node [on chain,coordinate, above right=3mm and 20 mm of A-2]{}; % <-- A-6
- Thus, I build an arrow for the loop because (A-6) is not joined to the chain.
\draw [arrows=-Stealth] (A-3) -| node[pos=.25,below]{Κάτι}(A-6)-| (A-2.30);
- I only place the label without drawing anything more since the arrows have already been built by the chain.
\path (A-3) --node[left]{όχι} (A-4);
\documentclass[a4paper,11pt,twoside]{book}
\usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage[utf8]{inputenc}
%\usepackage[greek]{babel}
% babel dont work for me, i took these 5 lines from the answer of Zarko
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{greek}
\setromanfont{Minion Pro} %% Select your favourite font
\setotherlanguage{english}
\usepackage{tikz}
% shapes
\usetikzlibrary{shapes}
%arrows
\usetikzlibrary{arrows,arrows.meta}
%decorations
\usetikzlibrary{decorations.text,decorations.pathreplacing,patterns,shadows.blur,fadings}
% miscellaneous
\usetikzlibrary{calc,quotes,positioning,fpu,angles,fit,spy,chains}
\begin{document}
\begin{tikzpicture}[
node distance = 8mm and 16mm,
start chain = A going below,
base/.style = {draw, minimum width=32mm, minimum height=8mm,
align=center, on chain=A,join},
startstop/.style = {ultra thick,double,base, rectangle, rounded corners, fill=white},
process/.style = {ultra thick,base, rectangle, fill=white},
io/.style = {ultra thick,base, trapezium,
trapezium left angle=70, trapezium right angle=110,
fill=white},
decision/.style = {ultra thick,base, diamond, fill=white},
every edge quotes/.style = {auto=right},
every join/.style=-Stealth]
]
\node [startstop] {Έναρξη}; % <-- A-1
\node [io] {Εισαγωγή}; %A-2
\node [decision] {Ερώτηση}; %Α-3
\node [io] {Απάντηση}; %A-4
\node [startstop] {Τέλος}; % <-- A-5
\node [on chain,coordinate, above right=3mm and 20 mm of A-2]{}; % <-- A-6
\draw [arrows=-Stealth]
(A-3) -| node[pos=.25,below]{Κάτι}(A-6)-| (A-2.30);
\draw (A-3) --node[left]{όχι} (A-4);
\end{tikzpicture}
\end{document}