Using the current page command from this answer
\documentclass[tikz,border=4pt]{standalone}
\usepackage{bm}
\usetikzlibrary{fadings}
\begin{document}
\def\hori{3}
\def\vert{2}
\def\zColor{black!40!green}
\def\EkColor{yellow!40}
\begin{tikzpicture}
\path
(0,0) node (v) {$v$}
(v) ++ (\vert,0) node (+1) {$\oplus$}
(v) ++ (\vert,\vert) node (y1) {$y_1$}
(+1) ++ (\hori,0) node (+2) {$\oplus$}
(+1) ++ (\hori,\vert) node (y2) {$y_2$}
(+2) ++ (\hori,0) node (+3) {$\oplus$}
(+2) ++ (\hori,\vert) node (y3) {$y_3$}
(+3) ++ (0.75*\hori,0) node (+dots) {$~\cdots~$}
(+dots) ++ (0.75*\hori,0) node (+n) {$\oplus$}
(+dots) ++ (0.75*\hori,\vert) node (yn) {$y_n$}
(+n) ++ (\hori,0) node (z) {${\color{\zColor}\bm{z}}$};
\draw
(y1) edge [-stealth] (+1)
(y2) edge [-stealth] (+2)
(y3) edge [-stealth] (+3)
(yn) edge [-stealth] (+n);
\draw
(v) edge [-stealth] (+1)
(+1) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (+2)
(+2) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (+3)
(+3) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (+dots)
(+dots) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (+n)
(+n) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (z) ;
\end{tikzpicture}
\begin{tikzpicture}
\path
(0,0) node (v) {$v$}
(v) ++ (\vert,0) node (+1) {$\oplus$}
(v) ++ (\vert,\vert) node (y1) {$y_1$}
(+1) ++ (\hori,0) node (+2) {$\oplus$}
(+1) ++ (\hori,\vert) node (y2) {$y_2$}
(+2) ++ (\hori,0) node (+3) {$\oplus$}
(+2) ++ (\hori,\vert) node (y3) {$y_3$}
(+3) ++ (0.75*\hori,0) node (+dots) {$~\cdots~$}
(+dots) ++ (0.75*\hori,0) node (+n) {$\oplus$}
(+dots) ++ (0.75*\hori,\vert) node (yn) {$y_n$}
(+n) ++ (\hori,0) node (z) {${\color{\zColor}\bm{z}}$}
(+n) ++ (\hori,\vert) node (topr) {};
\draw
(y1) edge [-stealth] (+1)
(y2) edge [-stealth] (+2)
(y3) edge [-stealth] (+3)
(yn) edge [-stealth] (+n);
\draw
(v) edge [-stealth] (+1)
(+1) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} node [below] (botl) {\phantom{$E_k$}} (+2)
(+2) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (+3)
(+3) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (+dots)
(+dots) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (+n)
(+n) edge [-stealth] node [rectangle, draw=black, fill=\EkColor] {$E_k$} (z) ;
\fill[black, path fading=west] (current page.south west) rectangle (current page.north east);
\end{tikzpicture}
The first bit of code yields the correct image :
while the second piece of code doesn't :
Rather than shade the whole page,
- it shades the bottom half only,
- it doesn't shade what is at the very right
- and it changes the page size in the process.
How Would I do it properly, i.e. shade the correct region and not change the dimensions of the page ?



current bounding boxinstead ofcurrent page? – Torbjørn T. May 17 '18 at 21:05\newcommandand not\def, as the latter will overwrite existing macros without telling you. (\vertalready exists.) It might not break anything in this case, but if you're a bit careless with macronames one day, you might end of breaking your document. – Torbjørn T. May 17 '18 at 21:10