5

I'm trying to replicate this picture (without the airplane)

I googled online and found the package drawstack but I couldn't find any documentation on how to use it. The closest I got to a minimal example is this:

\documentclass{article}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{amsmath}
\setlength{\parindent}{0pt}
\usepackage{float}
\usepackage{drawstack}

\title{test}
\author{me}
\date{May 2019}

\begin{document}

\maketitle

\section*{intro}

\begin{drawstack}
  \cell{ticket (purchase)}
  \cell{baggage (check)}
  \cell{gates (load)}
  \cell{runway (takeoff)}
  \cell{airplane routing}
\end{drawstack}

\begin{drawstack}
  \cell{airplane routing}
\end{drawstack}

\begin{drawstack}
  \cell{airplane routing}
\end{drawstack}

\begin{drawstack}
  \cell{ticket (complain)}
  \cell{baggage (claim)}
  \cell{gates (unload)}
  \cell{runway (land)}
  \cell{airplane routing}
\end{drawstack}

\end{document}

Which results in the following:

enter image description here

The result is obviously very far from what I wished as they're stacked on top of each other, I couldn't find a way to change the green color, I couldn't find a way to draw the arrow nor be able to write words that stay in place as the example I'm trying to replicate. Even though the example given is built using drawstack package, I wouldn't mind a solution using TiKz.

6

TiKZ could be an alternative to drawstack.

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{matrix,positioning}
\usepackage{lmodern}
\usepackage{fontawesome5}


\begin{document}
\begin{tikzpicture}[
    level/.style={draw, minimum width=3cm, minimum height=8mm},
    stack/.style={matrix of nodes, nodes={level}, row sep=-\pgflinewidth},
    ]

    \matrix[stack, label={[font=\small, align=center, name=aux1]below:{departure\\ airport}},
    label={[font=\Large, name=p1]above:\faPlaneDeparture}] (stackleft){
        ticket (purchase) \\
        baggage (check) \\
        gates (load) \\
        runway (takeoff) \\
        airplane routing \\};

    \node[level, right= of stackleft-5-1] (ar1) {airplane routing};
    \node[level, right=of ar1] (ar2) {airplane routing};

    \matrix[stack, label={[font=\small, align=center, name=aux2]below:{arrival\\ airport}}, 
    label={[font=\Large, name=p2]above:\faPlaneArrival},
        right=of ar2, anchor=stackright-5-1.west ] (stackright){
        ticket (complain) \\
        baggage (claim) \\
        gates (unload) \\
        runway (land) \\
        airplane routing \\};

    \node[font=\Large] at (p1-|ar1) {\faPlane};
    \node[font=\Large] at (p1-|ar2) {\faPlane};

    \path (aux1)--node[align=center, font=\small]{intermediate air-traffic\\ control centers} (aux2);

    \draw[blue, very thick, ->] (stackleft.north west)--(stackleft.west|-aux1)--(aux1.south)--(aux2.south)--(stackright.east|-aux2)--(stackright.north east);
\end{tikzpicture}
\end{document}

enter image description here

  • What would I have to do in order to add another arrow going the exact opposite way that doesn't overlap with the already existent one? I added: \draw[red, very thick, <-] (stackleft.north west)--(stackleft.west|-aux1)--(aux1.south)--(aux2.south)--(stackright.east|-aux2)--(stackright.north east); but this places it on top of it. I would prefer it it would be placed a bit under it. – Does it matter May 5 at 14:40
  • 1
    @Doesitmatter Change last line to add two auxiliar coordinates and add the new line: \draw[blue, very thick, ->] (stackleft.north west)--(stackleft.west|-aux1) coordinate (aux5)--(aux1.south)--(aux2.south)--(stackright.east|-aux2) coordinate (aux6)--(stackright.north east); \draw[red, very thick, <-] ([xshift=-2mm]stackleft.north west)--([shift={(-2mm,-1mm)}]aux5)--([yshift=-2mm]aux1.south)--([yshift=-2mm]aux2.south)--([shift={(2mm,-1mm)}]aux6)--([xshift=2mm]stackright.north east); – Ignasi May 5 at 16:34
  • You're a legend! – Does it matter May 5 at 16:35
4

drawstack is poorly document package and consequently not very useful for your needs. better is to use pure tikz. with multi part node from the shapes.multipart library you can write:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                calc,
                positioning,
                shapes.multipart}

\begin{document}
    \begin{tikzpicture}[
node distance = 3mm and 4mm,
base/.style = {minimum width=32mm, node font=\sffamily, align=center},
VMPN/.style = {% Vertical Multi Part Node
    rectangle split, rectangle split parts=5,
    draw},
 box/.style = {base, draw}
                        ]
\node (n1)  [VMPN]
            {\nodepart{one}     purchase (complain)
             \nodepart{two}     baggage (claim)
             \nodepart{three}   gates (unload)
             \nodepart{four}    runway (land)
             \nodepart{five}    airplane routing
             };
\node (n2)  [box, right=of n1.five east]    {airplane routing};
\node (n3)  [box, right=of n2]              {airplane routing};
\node (n4)  [VMPN, above right=0mm and 4mm of n3.south east]
            {\nodepart{one}     purchase (complain)
             \nodepart{two}     baggage (claim)
             \nodepart{three}   gates (unload)
             \nodepart{four}    runway (land)
             \nodepart{five}    airplane routing
            };
\node [above=of $(n2.north)!0.5!(n3.north)$]
    {\includegraphics[width=32mm]{example-image-duck}};
%
\node (n11) [base, below=of n1] {departure airport};
\node (n12) [base, below=of $(n2.south)!0.5!(n3.south)$]
                                {intermediate air-trafic\\control centers};
\node (n131) [base, below=of n4] {arrival airport};
%
\draw[blue!50!black, ultra thick, rounded corners=4mm, -{Triangle[angle=60:3pt 3]}]
    ([xshift=-3mm] n1.north west) |- ([yshift=-3mm] n12.south) -|
    ([xshift= 3mm] n4.north east);
    \end{tikzpicture}
\end{document}

enter image description here

  • The duck makes it 1000 times better. I better make a duck stack. – Does it matter May 5 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.