I am using Tikz for the first time and I am having trouble coming up with a diagram I am required to draw
I have found a code and attempted to modify it to make it resemble as much as the top diagram as possible (down to thickness of the lines), but whenever I do something it seems to create an error message. I can't even move the plus sign to the right of the line.
I am not aware of the capability of Tikz, if this diagram is not possible using Tikz please let me know and I will use my current non-Tikz method to draw which takes me about 30 seconds. Unfortunately it does not have the flexibility to be changed on the fly (and more importantly the Latex font I need for the diagram).
\tikzstyle{block} = [draw, fill=white, rectangle,
minimum height=3em, minimum width=6em]
\tikzstyle{sum} = [draw, fill=white, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]
\begin{figure}[ht]
\centering
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node [input, name=input] {};
\node [sum, right of=input] (sum) {};
\node [block, right of=sum] (Ablock) {A};
\node [block, right of=Ablock, node distance=4cm] (Bblock) {B};
\draw [->] (Ablock) -- node[name=b] {$b_1$} (Bblock);
\node [output, right of=Bblock] (output) {};
\node [block, below of=b] (Cblock) {C};
\draw [->] (sum) -- node {$a_1$} (Ablock);
\draw [->] (Bblock) -- node [name=c] {$c_1$}(output);
\draw [->] (c) |- (Cblock);
\draw [->] (Cblock) -| node[pos=0.99] {$+$}
node [near end] {$$} (sum);
\end{tikzpicture}
\end{figure}
I would appreciate if anyone could help me with creating the above diagram.
Best Answer
See, if the following solution is acceptable to you:
Note: Above MWE is rather complex and sophisticated, however it is also modular with predefined styles collected in common
\tikzset
. By this a uniform image looks and relatively simple image design is achieved.Predefined styles are:
sum
for summation node in picture. Plus inside can simply be customized by changing of thickness (set is tovery thick
) of inner lines and their lengths (determined withshorten <>=1mm
). For drawing lines for sign plus apath picture bounding box
is used, in shorter writing it is defined with a new commandppbb
.dot
is intended for marking lines connection points.element
is style for main nodes in diagram. In it is byappend after command
prepared possibility to write labels inside itsubelement
is named a label, which is positioned inside anelement
node. It is used to write Greek letters in above right corners ofelement
node.Connection lines between nodes are labeled with help of TikZ library
quotes
. Additional inputs to some of nodes are drawn inscope
which withtransform canvas
moves them to right position.Addendum: Presence of the node
sum
in the scheme is not very logical. Inmy opinion it is surplus and should be replaced with simple coordinate. MWE (without preamble, which is the same as above) in this case it is:and picture is:
Edit: Now is considered wish expressed in your comment. For lines is added to
\tikzset
is added style forevery path
where is defined that lines are slightly thicker and each have arrow on the right side. Also are defined smaller font size insubelement
and improved appearance ofdot
. This changes are considered onbly in second image (withoutsum
).