我在网上搜索并找到了这个包拉架但我找不到任何关于如何使用它的文档。我找到的最接近的最小示例是:
\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}
结果如下:
结果显然与我的期望相差甚远,因为它们堆叠在一起,我找不到改变绿色的方法,找不到绘制箭头的方法,也无法像我试图复制的示例那样写出停留在原位的单词。尽管给出的示例是使用拉架包,我不会介意使用 TiKz 的解决方案。
答案1
TiKZ
可以作为 的替代品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}
答案2
drawstack
文档包很差,因此无法满足您的需求。更好的方法是使用纯tikz
。使用库中的多部分节点,shapes.multipart
您可以编写:
\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}