如何生成以下图表(请参阅本文档第 4 页https://arxiv.org/pdf/2011.13661.pdf)。
请注意,红色文本实际上是可点击的链接。此外,理想情况下,我希望解决方案尽可能与位置无关(即,如果有的话,也不要太多硬编码坐标)。
答案1
作为起点:
\documentclass[margin=3.141592mm]{standalone}
\usepackage{newtxtext}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
chains,
positioning}
\begin{document}
\begin{tikzpicture}[
node distance = 4mm and 8mm,
start chain = going below,
arr/.style = {{Straight Barb[scale=0.8]}-, rounded corners=1ex, semithick},
N/.style = {draw, rounded corners, thick, fill=#1,
text width=8em, align=center, inner ysep=2ex},
N/.default = white,
every edge/.style = {draw, arr}
]
\begin{scope}[nodes={on chain,join=by arr}]
\node[N=red!30] {Theorem 1}; % Theorem \ref{t:1}
\node[N=orange!30] {Lemma 1};
\node (n11) [N=orange!30] {Lemma 2};
\end{scope}
%
\node (n21) [N=blue!30, right=of n11] {Lemma 4};
\node (n22) [N=blue!30, above=of n21] {Lemma 3};
\node (n23) [N=blue!30, below=of n21] {Lemma 5};
%
\node (n31) [N, right=of n23] {Lemma 6};
\node (n32) [N, above=of n31] {Lemma 7};
\node (n33) [N, below=of n31] {Lemma 8};
%
\node (n41) [N, right=of n32] {Lemma 10};
\node (n42) [N, above=of n41] {Lemma 9};
\node (n43) [N, below=of n41] {Lemma 11};
% connections
\draw[arr] (n11)-- (n21);
\draw[arr] ([yshift=+1ex] n11.east) -- ++ (0.4,0) |- (n22);
\draw[arr] ([yshift=-1ex] n11.east) -- ++ (0.4,0) |- (n23);
%
\draw[arr] (n23)-- (n31);
\draw[arr] ([yshift=+1ex] n23.east) -- ++ (0.4,0) |- (n32.west);
\draw[arr] ([yshift=-1ex] n23.east) -- ++ (0.4,0) |- (n33.west);
%
\draw[arr] (n32)-- (n41);
\draw[arr] ([yshift=+1ex] n32.east) -- ++ (0.4,0) |- (n42.west);
\draw[arr] ([yshift=-1ex] n32.east) -- ++ (0.4,0) |- (n43.west);
;
\end{tikzpicture}
\end{document}