# Draw block diagram based on schemabloc or blox package

Related to this question Drawing a closed loop diagram with Tikz with multiple inputs. I am trying to draw that diagram based essentially on schemabloc package (french macros names and docs), I don't think the package itself is enough flexible to allow some adjustments. I would love to see that package improved.

Can some one draw it using that based on that package?

PS: I just noticed there is a similar package in english blox.

What I am missing:

• Top right corner symbols (alpha, beta...)
• Links that are linked to only one bloc, the other end is an entry (like b2, c and d2), and probably a need to adjust the links b1, d1 because they are centered.
• The last segment from the link or path from D to A isn't straight and doesn't have an arrow.

here is my MWE:

\documentclass[preview,border=10pt]{standalone}
\usepackage{schemabloc}
\usetikzlibrary{calc,positioning, quotes}
\tikzset{node distance= 5cm}

\begin{document}

\begin{tikzpicture}
\sbEntree{E}

\sbBloc{A}{A}{E}
\sbBloc{B}{B}{A}
\sbRelier[$b_1$]{A}{B}

\sbSortie{S}{B}

\sbRelier[$c_1$]{B}{S}
\sbDecaleNoeudy[5]{S}{U}
\sbBlocr{C}{C}{U}
\sbRelieryx{B-S}{C}
\sbBlocr{D}{D}{C}
\sbRelier[$d_1$]{C}{D}

%\sbRelierxy{D}{E}
\draw [-] (D) -| node[name=D-E,near end,right] {} (E) ;
\draw (D) -| (E.south) node[below right] {};
\draw (E.south) -> (A) node {};

%\sbRelierxy{D-E}{A} %doesn't work
\end{tikzpicture}

\end{document}


Output:

Edit

Based on @crf's answer I improved the code but still not complete you may need to read comments:

\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{schemabloc}
\usetikzlibrary{quotes,arrows.meta}
\tikzset{%
node distance=5cm,
>=Stealth,
every edge quotes/.append style={midway, below},
}
\begin{document}
\begin{tikzpicture}
\sbEntree{E}
\sbBloc{A}{A}{E}
\sbBloc{B}{B}{A}
\sbRelier[$b_1$]{A}{B}
\sbSortie{S}{B}

%\sbRelier[$c_1$]{B}{S}  %replaced with it tikz definition from doc, line below
\draw [sbStyleLien,auto] (B) -- node[name=B-S] {$c_1$} (S);  %add bullet ?

\sbDecaleNoeudy[5]{S}{U}
\sbBlocr{C}{C}{U}
\sbRelieryx{B-S}{C}
\sbBlocr{D}{D}{C}

%  \sbRelier[$d_1$]{C}{D} replace with it tikz definition from doc, line below:
\draw [sbStyleLien,auto] (C) -- node[name=C-D,above] {$d_1$} (D); %added the option "above"

\draw [-] (D) -| (E) ;
\draw (D) -| (E.south);
\draw [->] (E.south) |- (A);
\foreach \i/\j in {A/\alpha,B/\beta,C/\gamma,D/\omega} \node [anchor=north east, font=\scriptsize] at (\i.north east) {$\j$};
\draw  ([xshift=2.5mm,yshift=2.5mm]A.south east) coordinate (p1) edge ["$b_2$", ->] (B.west |- p1);
\draw  ([xshift=-1.5mm,yshift=2.5mm] C.south west) coordinate (p2) edge ["$d_2$", ->] (D.east |- p2);
\draw  ([xshift=-1.5mm,yshift=-2.5mm] C.east) coordinate (p3) edge ["$c$", ->] (C.west |- p3);
\end{tikzpicture}
\end{document}


Output

Just to provide a basis for solving this. Since I don't read French, I've not tried to figure out the correct style of arrow etc. Just substitute appropriately for Stealth and drop arrows.meta if you don't need it.

\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{schemabloc}
\usetikzlibrary{quotes,arrows.meta}
\tikzset{%
node distance=5cm,
>=Stealth,
every edge quotes/.append style={midway, below},
}
\begin{document}
\begin{tikzpicture}
\sbEntree{E}
\sbBloc{A}{A}{E}
\sbBloc{B}{B}{A}
\sbRelier[$b_1$]{A}{B}
\sbSortie{S}{B}
\sbRelier[$c_1$]{B}{S}
\sbDecaleNoeudy[5]{S}{U}
\sbBlocr{C}{C}{U}
\sbRelieryx{B-S}{C}
\sbBlocr{D}{D}{C}
\sbRelier[$d_1$]{C}{D}
\draw [-] (D) -| (E) ;
\draw (D) -| (E.south);
\draw [->] (E.south) |- (A);
\foreach \i/\j in {A/\alpha,B/\beta,C/\gamma,D/\omega} \node [anchor=north east, font=\scriptsize] at (\i.north east) {$\j$};
\draw  ([xshift=2.5mm,yshift=2.5mm]A.south east) coordinate (p1) edge ["$b_2$", ->] (B.west |- p1);
\end{tikzpicture}
\end{document}


# EDIT

Here's a version with a couple more examples and tips from the deprecated arrows library to match schemabloc's.

\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{schemabloc}
\usetikzlibrary{quotes}
\tikzset{%
node distance=5cm,
every edge quotes/.append style={midway, below},
}
\begin{document}
\begin{tikzpicture}
\sbEntree{E}
\sbBloc{A}{A}{E}
\sbBloc{B}{B}{A}
\sbRelier[$b_1$]{A}{B}
\sbSortie{S}{B}
\sbRelier[$c_1$]{B}{S}
\sbDecaleNoeudy[5]{S}{U}
\sbBlocr{C}{C}{U}
\sbRelieryx{B-S}{C}
\sbBlocr{D}{D}{C}
\sbRelier[$d_1$]{C}{D}
\draw (D) -| (E.south);
\draw [sbStyleLien] (E.south) |- (A);
\foreach \i/\j in {A/\alpha,B/\beta,C/\gamma,D/\omega} \node [anchor=north east, font=\scriptsize] at (\i.north east) {$\j$};
\draw  ([xshift=2.5mm,yshift=2.5mm]A.south east) coordinate (p1) edge ["$b_2$", sbStyleLien] (B.west |- p1);
\draw ([xshift=-2.5mm,yshift=.5mm]C.south west) coordinate (p2) edge ["$d_2$",sbStyleLien] (D.east |- p2);
\draw ([xshift=5mm,yshift=2.5mm]C.south east) coordinate (p3) edge [sbStyleLien] node [pos=0, anchor=west] {$c_2$} (C.east |- p3);
\end{tikzpicture}
\end{document}


• After read you answer i tried something similiar to get d2 but it seems I am doing it wrong \draw ([xshift=0mm,yshift=2.5mm]C.south west) coordinate (p2) edge ["$d_2$", ->] (D.east |- p2); sure the label d1 should goes on above the arrow. not bad but still b2 come beside the arrow and not under same for d2. – SAM Jul 10 '16 at 23:37
• Does my example give you my output? – cfr Jul 10 '16 at 23:44
• yes of course..without d2 and with b2 above the arrow instead of being beside it, without c too, in addition to label a. – SAM Jul 10 '16 at 23:45
• I don't know why the label would come out beside. (Don't you want it there anyway? I put it under because that's where there seemed to be room, but your image in the question has it beside.) – cfr Jul 10 '16 at 23:48
• maybe you're right under is better, actually i took that example as a challenge to train myself with that package syntax not more and not less so i am open to changes on the example itself. because i noticed that schemabloc is limited, as it's named it is supposed to guarantee the drawing of any schema bloc diagram and offrering some flexibility options. – SAM Jul 10 '16 at 23:49