是否可以从 n2 绘制一条跨越 blah 文本的线并 \blinditemize 而不对长度进行硬编码?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{blindtext}
\usepackage{tabularx}
\usetikzlibrary{positioning}
\begin{document}
\begin{minipage}[t]{0.70\textwidth}
\tikzset{every picture/.append style={remember picture},
fluffy/.style={fill opacity=0.1,circle,fill,inner sep=3pt,outer sep=1mm}}
\blindtext
\noindent\begin{tabularx}{\linewidth}{@{} l @{~} |X| @{}}
\cline{2-2}
\begin{tikzpicture}[baseline=(l1.base)]
\node[fluffy,label={[name=l1]left:n1-label}] at (0,0) (n1) {};
\end{tikzpicture}
& \textcolor{red}{title1} \\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
&
Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\blinditemize
\\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
\begin{tikzpicture}[baseline=(l2.base)]
\node[fluffy,label={[name=l2]left:n2-label}] at (0,0) (n2) {};
\end{tikzpicture}
& title2 \\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
&
Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\blinditemize
\\
\cline{2-2}
\end{tabularx}
\begin{tikzpicture}[overlay]
\draw (n1) -- (n2);
\draw ([yshift=-0.05cm]n2.south) -- ([yshift=-3cm]n2.south);
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.30\textwidth}
\end{minipage}
\end{document}
答案1
看起来像是一份工作tikzmark
。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{blindtext}
\usepackage{tabularx}
\usetikzlibrary{positioning,tikzmark}
\begin{document}
\begin{minipage}[t]{0.70\textwidth}
\tikzset{every picture/.append style={remember picture},
fluffy/.style={fill opacity=0.1,circle,fill,inner sep=3pt,outer sep=1mm}}
\blindtext
\noindent\begin{tabularx}{\linewidth}{@{} l @{~} |X| @{}}
\cline{2-2}
\begin{tikzpicture}[baseline=(l1.base)]
\node[fluffy,label={[name=l1]left:n1-label}] at (0,0) (n1) {};
\end{tikzpicture}
& \textcolor{red}{title1} \\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
&
Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\blinditemize
\\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
\begin{tikzpicture}[baseline=(l2.base)]
\node[fluffy,label={[name=l2]left:n2-label}] at (0,0) (n2) {};
\end{tikzpicture}
& title2 \\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
&
Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\blinditemize\tikzmarknode{aux}{$\vphantom{x_y}$}
\\
\cline{2-2}
\end{tabularx}
\begin{tikzpicture}[overlay]
\draw (n1) -- (n2);
\draw ([yshift=-0.05cm]n2.south) -- (n2.south|- aux.south);
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.30\textwidth}
\end{minipage}
\end{document}
附录一个版本用\tikzmark
代替\tikzmarknode
,其中应该与旧版本的 一起工作tikzmark
。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{blindtext}
\usepackage{tabularx}
\usetikzlibrary{positioning,tikzmark}
\begin{document}
\begin{minipage}[t]{0.70\textwidth}
\tikzset{every picture/.append style={remember picture},
fluffy/.style={fill opacity=0.1,circle,fill,inner sep=3pt,outer sep=1mm}}
\blindtext
\noindent\begin{tabularx}{\linewidth}{@{} l @{~} |X| @{}}
\cline{2-2}
\begin{tikzpicture}[baseline=(l1.base)]
\node[fluffy,label={[name=l1]left:n1-label}] at (0,0) (n1) {};
\end{tikzpicture}
& \textcolor{red}{title1} \\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
&
Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\blinditemize
\\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
\begin{tikzpicture}[baseline=(l2.base)]
\node[fluffy,label={[name=l2]left:n2-label}] at (0,0) (n2) {};
\end{tikzpicture}
& title2 \\
\cline{2-2}
\multicolumn{1}{c}{~} & \multicolumn{1}{c}{~} \\
\cline{2-2}
&
Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
\blinditemize\tikzmark{aux}
\\
\cline{2-2}
\end{tabularx}
\begin{tikzpicture}[overlay]
\draw (n1) -- (n2);
\coordinate (aux2) at ([yshift=-1mm]pic cs:aux);
\draw ([yshift=-0.05cm]n2.south) -- (n2.south|- aux2.south);
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.30\textwidth}
\end{minipage}
\end{document}