Following is the code that was posted for my question How to show path gains in block diagrams drawn in tikz environment?
It is giving me the desired output. But my problem is that I don't understand the set of statements in the preamble. I want to understand how each of them is used so that I can define my own tikzset for my future works. Can someone help me in understanding these. I will be grateful.
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings, positioning}
\newcommand\ppbb{path picture bounding box}
\tikzset{
shorten <>/.style = {shorten >=#1, shorten <=#1},
dot/.style = {circle, fill=black,
inner sep=0mm, outer sep=0mm, minimum size=1mm,
node contents={}},
gain/.style = {decoration={markings, mark= at position 0.5
with {\arrow[ultra thick]{stealth};
\node[above] {#1};}
},
postaction={decorate}},
sum/.style = {circle, draw=black, fill=white, minimum size=6mm,
path picture={\draw[very thick,shorten <>=1mm,-]
(\ppbb.north) edge (\ppbb.south)
(\ppbb.west) -- (\ppbb.east);
},% end of node contents
node contents={}},
delay/.style = {draw=black, fill=white, minimum size=12mm,
node contents={D}},
}
\begin{document}
\begin{frame}
\frametitle{MWE}
\begin{center}
\begin{tikzpicture}[
node distance = 1 cm and 2cm
]
\node (b1) {$x[n]$};
\node (s1) [sum,right=of b1];
\node (s2) [dot,right=of s1];
\node (b3) [right=of s2] {$y[n]$};
\node (d1) [delay,below=of s2];
% lines
\draw [gain=$b$,->] (b1) -- (s1);
\draw [->] (s1) edge (b3)
(s2) -- (d1);
\draw [->] (d1.south) -- ++ (0,-1) coordinate (c1)
(c1 -| s1) -- (s1);
\draw [gain=$\alpha$] (c1) -- (c1 -| s1);
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
This MWE gives:
For above picture I didn't bother with line thickness. This you can easy change.