2

The following TikZ code is for the preparation of flowchart.

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{shapes,shadows,arrows}
\usepackage{lscape}
\begin{document}
\tikzstyle{decision} = [diamond, draw, fill=blue!50]
\tikzstyle{line} = [draw, -stealth, thick]
\tikzstyle{block} = [draw, rectangle, fill=red!25, text width=12em, text centered, minimum height=14mm, node distance=10em]
\begin{center}
\begin{tikzpicture}
\node [block] (start) {Vacuum Drying of LiCl-KCl Eutectic+H$_2$O Mixtures};
\node [block, left of=start, xshift=-5em] (process1) {Vacuum Drying of LiCl-KCl Eutectic};
\node [block, above of=start, yshift=0.1em] (user) {Purification of LiCl-KCl Eutectic};
\node [block, right of=start, xshift=5em] (process2) {Redox Behaviour of H$_2$O in LiCl-KCl Eutectic Melt};
\node [block, below of=start, yshift=0.1em] (process5) {Pre-Electrolysis of LiCl-KCl Eutectic + H$_2$O Melts};
\node [block, below of=process1, yshift=0.1em] (process4) {Pre-Electrolysis of LiCl-KCl Eutectic Melts};
\node [block, below of=process4, yshift=0.1em] (process6) {Demonstration of Vacuum Drying in 2 kg};
\node [block, below of=process6, yshift=0.1em] (process7) {Scale Up};
\path [line] (user) -- (start);
\path [line] (user) -| node[yshift=0.1em, xshift=-5em] {} (process1);
\path [line] (user) -| node[yshift=0.1em, xshift=5em] {} (process2);
\path [line] (process1) -- (process4);
\path [line] (start) -- (process5);
\path [line] (process2) -- (start);
\path [line] (process4) -- (process6);
\path [line] (process6) -- (process7);
\path [line] (process1) -- (start);
\path [line] (process4) -- (process5);
\path [line] (process5.south) -- (process6.east);
\path [line] (process2.south) -- (process5.east);
\end{tikzpicture}
\end{center}
\end{document}

The flowchart looks fine but for the two arrows drawn using the last two commands

\path [line] (process5.south) -- (process6.east);
\path [line] (process2.south) -- (process5.east);

I wish to have the blocks connected by vertical \& horizontal lines similar to the commands

\path [line] (user) -| node[yshift=0.1em, xshift=-5em] {} (process1);
\path [line] (user) -| node[yshift=0.1em, xshift=5em] {} (process2);

I tried various options but the arrows get masked/overlapped with the blocks. Is there any alternate solution? Thanks,

1
  • 2
    \path [line] (process5.south) |- (process6.east); instead of \path [line] (process5.south) -| (process6.east); looks good.
    – user31034
    Apr 18, 2019 at 15:32

1 Answer 1

1

like this?

enter image description here

for connection lined i partly consider @ferahfeza comment. the code of the your flowchart i suggest to reorganize as follows:

  • draw it in three branches: middle, left and right
  • nodes in branches link in chain
  • for nodes connections inside chains use join macro
  • for suspend of connection between branches use code suspend join (its definitions can be found in many similar answers)
  • for writing chem formulas i use the mhchem packages

the mwe which consider aforementioned is:

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains,
                shapes, shadows}
\makeatletter
\tikzset{suspend join/.code={\def\tikz@after@path{}}}
\makeatother
\usepackage[version=4]{mhchem}

\begin{document}
    \begin{center}
\begin{tikzpicture}[
node distance = 8mm and 4mm,
  start chain = going below,
 block/.style = {draw, fill=red!25, text width=12em, minimum height=14mm,
                 font=\linespread{0.84}\selectfont, align=center,
                 on chain, join=by line},
  line/.style = {-Stealth, semithick}
                    ]
    \begin{scope}[every node/.style = {block}]
 % midle branch
\node   (user)      {Purification of \ce{LiCl-KCl} Eutectic};
\node   (start)     {Vacuum Drying of \ce{LiCl-KCl} Eutectic + \ce{H2O} Mixtures};
\node   (process5)  {Pre-Electrolysis of \ce{LiCl}-\ce{KCl} Eutectic + \ce{H2O}  Melts};
% left branch
\node   (process1)  [left=of start, suspend join]
                    {Vacuum Drying of \ce{LiCl-KCl} Eutectic};
\node   (process4)  {Pre-Electrolysis of \ce{LiCl}-\ce{KCl} Eutectic Melts};
\node   (process6)  {Demonstration of Vacuum Drying in 2 kg};
\node   (process7)  {Scale Up};
% right branch
\node   (process2)  [right=of start, suspend join]
                    {Redox Behaviour of \ce{H2O} in LiCl-KCl Eutectic Melt};
    \end{scope}
% connection not considered by join macro
\draw[line] (user) -| (process1);
\draw[line] (user) -| (process2);
%
\draw[line] (process5) |- (process6);
\draw[line] (process2) |- (process5);
\end{tikzpicture}
\end{center}
\end{document}

note: use \tikstyle for defining of nodes style is obsolete, it is replaced by \tikzset. since in your flowchart is used only block from all defined styles, i consider only it and redefined it as option of tikzpicture.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .