I want it to look like this in the end:

enter image description here

At the moment the rectangles in the back still got the text and idk how to make them the right size without having the text in them.

    %draft, % Mit % kommentieren, um Bilder sichtbar zu machen und Links zu aktivieren
\usetikzlibrary{shapes.geometric, arrows}

    \tikzset{rectangle node/.style={draw, minimum size=1cm}}
    \node[rectangle node] (scl) at (0,0) {SCL Contract};
    \node[rectangle node, right of=scl, node distance = 5cm] (ptg){PlainTextGen};
    \node[rectangle node,right of=ptg, node distance = 5cm, align=right] (sol) {Solidity Code \\.sol};
    \node[rectangle node,below of=sol, node distance = 2cm, align=right, on top of=solLib1] (solLib) {Solidity Libraries \\.sol};
    \node[rectangle,draw, align=right,on top of=solLib2] (solLib1) at (10.1,-1.9) {Solidity Libraries \\.sol};
    \node[rectangle,draw, align=right] (solLib2) at (10.2,-1.8) {Solidity Libraries \\.sol};
    \draw [->] (scl) -- (ptg);
    \draw [->] (ptg) -- (sol);
    \draw [->] (sol) -- (solLib);
\caption{Code Generation Prozess}

2 Answers 2


Like this?

enter image description here

In your case is simple with use double copy shadow from shadows TikZ library.

Off-topic: for positioning of nodes I would use positioning library and its sintay ...=of <node nameY>, which define distance between nodes borders:


node distance = 4mm and 8mm,
     N/.style = {draw, fill=white, minimum size=1cm, align=right},
   dcs/.style = {double copy shadow, shadow xshift=2pt, shadow yshift=-2pt},
every edge/.append style = {draw, semithick, -Stealth}
\node[N] (scl)  {SCL Contract};
\node[N, right=of scl]  (ptg)       {PlainTextGen};
\node[N, right=of ptg]  (sol)       {Solidity Code \\.sol};
\node[N, below=of sol, 
      dcs]              (solLib)    {Solidity Libraries \\.sol};
\draw   (scl) edge (ptg)
        (ptg) edge (sol)
        (sol) edge (solLib);

Maybe a little overkill.

Here is a method to draw on the back layer, with fit library to calculate the size, and insert two rectangles at the bottom. (Credit to this answer that enables the drawing on the bottom stack.)

\usetikzlibrary{shapes.geometric, arrows, positioning, fit, backgrounds}

% https://tex.stackexchange.com/a/562606/234654
% similar to env "pgfonlayer", but the latest contents are typeset on
% lowest bottom (on reversed order)


  {\expandafter\box\csname pgf@layerbox@#1\endcsname\begingroup}

  {\endgroup\expandafter\box\csname pgf@layerbox@\pgfonlayer@name\endcsname}

  on background layer reversed/.style={%
    execute at begin scope={%
      \tikzset{every on background layer/.try,#1}%
    execute at end scope={\endpgfonlayerreversed}

  % patch \path variants to auto insert "\scoped[on lowest layer]"
  % currently \node, \pic, \coordinate, and \matrix are patched


  \let\tikz@signal@path=\tikz@signal@path% for detection at begin of matrix cell
    {\scoped[on background layer reversed] \path #1}}%
  \scoped[on background layer reversed] \path<#2> #1}%

    \tikzset{rectangle node/.style={draw, minimum size=1cm}}

    \node[rectangle node, align=right] (sol) {Solidity Libraries \\.sol};

    \node[rectangle node, align=right,below=8mm of sol, fill=white] (solLib) {Supported Libraries \\.sol};

        \node [rectangle node, fit=(solLib), inner sep=0, xshift=1mm, yshift=1mm, fill=white] {};
        \node [rectangle node, fit=(solLib), inner sep=0, xshift=2mm, yshift=2mm] {};

    \draw [->] (sol) -- (solLib);
\caption{Code Generation Prozess}


  • Maybe a little overkill. Well, maybe ;)
    – SebGlav
    Jan 31 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .