[Tex/LaTex] Draw a flowchart with decision box with smartdiagram

smartdiagramtikz-pgf

There is a way to draw a flowchart with decision nodes, like this, using smartdiagram or something else?

enter image description here

Best Answer

In my opinion, I ought not answer this question. Caveat emptor.

For one thing, my answer is likely to be of little help unless you want precisely this with almost no changes, or you could actually do this yourself but just wanted somebody else to do your work for free. Only in the second case are you likely to be able to modify it to your needs without actually doing some work to figure out how things work, which you could have done anyhow.

For another different but related thing, my answer contains zero explanation because I simply have no idea what needs explaining or where you are starting from. That is, I have no idea what the obstacle is to your drawing this yourself. Since I cannot explain everything here and have no idea what needs explaining, I can't usefully explain anything at all.

I really answered this because I wanted to play with the graphs syntax without the graphsdrawing code, which depends on LuaTeX. If you know nothing about PGF/TikZ, this is not a good place to start. In that case, start with the positioning library without graphs or try the deprecated chains library if feeling especially adventurous.

\documentclass[border=10pt,multi,tikz,dvipsnames]{standalone}
\usetikzlibrary{shapes.geometric,arrows.meta,graphs,positioning}
\begin{document}
\begin{tikzpicture}
  [
    >=Stealth,
    thick,
    base/.style={draw=#1, thick, inner color=#1!60, outer color=#1!75},
    bb/.style={base=Cerulean, text height=.75em, text depth=.25em},
    gc/.style={base=ForestGreen, circle},
    rc/.style={base=WildStrawberry, circle},
    yd/.style={base=Periwinkle, diamond, align=center, aspect=1.75},
  ]
  \graph [grow right=20mm] {
   G/""[gc] -> Aardvarks[bb] -- L/""[coordinate] -!- Bananas[bb] -- R/""[coordinate] -!- Cabbages[bb] -> Babbage[bb] -> Enormity[bb] -> RC/"" [rc];
   L -> BB/"Blue\\Baguettes"[above=15mm of L, yd];
   R -> HH/"Hysterical\\Holograms"[below=-10mm of R, yd];
  };
  \foreach \i/\j\k/\l/\m/\n/\o in {BB/Aardvarks/Bananas/Superfluous/-40/Antiquities/-140,HH/Bananas/Cabbages/Expeditious/30/Ambiguities/150}
  {
    \draw [->] (\i) -| (\j) node [midway, anchor=\m] {\l};
    \draw [->] (\i) -| (\k) node [midway, anchor=\o] {\n};
  }
\end{tikzpicture}
\end{document}

cabbages and things