我试图在整个页面上设置三行来区分这种时间线。我还想在顶部放置标签。这是我目前所做的:
\documentclass[tikz, border=10pt]{standalone}
\usetikzlibrary{shapes.geometric,arrows}
\tikzset{
arrow/.style = {thick, dashed, gray,->,>=stealth },
connect/.style = {thick, dashed, gray},
coursetitle/.style = {minimum width=3cm, minimum height=1cm},
label/.style = {text width=2cm}
}
\begin{document}
\begin{tikzpicture}[node distance=2cm,]
%a
\node[label](1) at (0,0){\textbf{A}};
\node[coursetitle](p1.1) at (5,0.5){a327};
\node[coursetitle](p1.2) at (5,-0.5){a338};
\node[coursetitle](p2.1) at (8,0){a325};
\node[coursetitle](p3.2) at (16,0){a331};
\draw[connect] (1.1,0)--(3.05,0)(3.05,0)--(3.6,0.5)(3.05,0)--(3.6,-0.5)(5.8,0.5)--(6.2,0.5)(5.8,-0.5)--(6.2,-0.5)(6.2,-0.5)--(6.75,0)(6.2,0.5)--(6.75,0);
\draw[arrow] (3.7,0.5)--(4.15,0.5);
\draw[arrow] (3.7,-0.5)--(4.15,-0.5);
\draw[arrow] (6.75,0)--(7.2,0);
\draw[arrow] (8.85,0)--(15.2,0);
%b
\node[label](2) at (0,-7){\textbf{B}};
\node[coursetitle](m1.1) at (5,-7){b212};
\node[coursetitle](m2.1) at (8,-7.5){b161};
\node[coursetitle](m2.2) at (8,-6.5){b251};
\node[coursetitle](m3.1) at (13,-7){b311};
\node[coursetitle](m3.2) at (13,-7.75){b317};
\node[coursetitle](m3.3) at (13,-6.25){b353};
\node[coursetitle](m4.1) at (16,-7){b309};
\node[coursetitle](m4.2) at (16,-7.75){b318};
\node[coursetitle](m4.3) at (16,-6.25){b324};
\draw[connect] (5.8,-7)--(6.1,-7)(6.5,-7.5)--(6.1,-7)(6.5,-6.5)--(6.1,-7);
\draw[arrow] (1.5,-7)--(4,-7);
\draw[arrow] (6.5,-6.5)--(7.05,-6.5);
\draw[arrow] (6.5,-7.5)--(7.05,-7.5);
\draw[connect](8.9,-6.5)--(9.3,-6.5)(8.9,-7.5)--(9.3,-7.5)(9.3,-7.5)--(9.85,-7)(9.3,-6.5)--(9.85,-7);
\draw[arrow] (11.7,-6.25)--(12.15,-6.25);
\draw[arrow] (11.7,-7)--(12.15,-7);
\draw[arrow] (11.7,-7.75)--(12.15,-7.75);
\draw[arrow] (14.7,-6.25)--(15.15,-6.25);
\draw[arrow] (14.7,-7)--(15.15,-7);
\draw[arrow] (14.7,-7.75)--(15.15,-7.75);
\draw[connect] (13.85,-6.25)--(14.3,-6.25)(13.85,-7.75)--(14.3,-7.75)(13.85,-7)--(14.3,-7);
\draw[connect] (14.3,-6.25)--(14.5,-7)(14.3,-7.75)--(14.5,-7)(14.3,-7)--(14.5,-7)(14.7,-7.75)--(14.5,-7)(14.7,-7)--(14.5,-7)(14.7,-6.25)--(14.5,-7);
\draw[connect] (9.85,-7)--(11.15,-7)(11.15,-7)--(11.7,-6.25)(11.15,-7)--(11.7,-7)(11.15,-7)--(11.7,-7.75);
%c
\node[label](3) at (0,-14){\textbf{C}};
\node[coursetitle](c1.1) at (5,-14){c206};
\node[coursetitle](c2.1) at (8,-14){c203};
\node[coursetitle](c3.1.1) at (13,-14){c303};
\draw[arrow] (1,-14)--(4,-14);
\draw[arrow] (6,-14)--(7,-14);
\draw[arrow] (9,-14)--(12,-14);
%line
\coordinate (A) at (current page.north);
\coordinate (B) at (current page.south);
\draw[red, dashed,thick]%, cap=round]
(A) -- (B);
\end{tikzpicture}
\end{document}
此外,我几乎可以肯定地说,我这样做的方式既乏味又尴尬。我对 TikZ 非常陌生。非常感谢您的建议!