如何绘制连接列表中两个项目的箭头?

如何绘制连接列表中两个项目的箭头?

我知道你可以使用这个包蒂克兹戴上牙套

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,decorations.pathreplacing,calc}
\begin{document}
\MyText[2em]{start1}{end1}{Technological cascade}
\newcommand\MyText[4][0pt]{%
\begin{tikzpicture}[overlay, remember picture]
\draw [decoration={brace},decorate,thick]
( $ ({pic cs:#3}|-{pic cs:#2}) + (#1,1.3ex) $ ) --  
node[anchor=west,xshift=5pt,text width=5cm] {#4} 
( $ (pic cs:#3) + (#1,0) $ );
\end{tikzpicture}%
}
\begin{itemize}
\item Processing \tikzmark{start1}
\item Embedding in paraffin blocks
\item Microtomy
\item Staining
\item Microscopy \tikzmark{end1}
\end{itemize}
\end{document}

但是,我有一个箭头回来,像负面连接:

如何在列表中制作这样的箭头?

在此处输入图片描述

您还可以提出其他方式来表达和形象化列表中的内容的效果。

答案1

您可以应用相同的原理,\tikzmark放置一些标记,然后绘制连接标记的箭头:

\documentclass{article}
\usepackage{tikz}
\usepackage{xparse}
\usetikzlibrary{tikzmark,decorations.pathreplacing,calc,decorations.markings}

\definecolor{colori}{RGB}{166,35,41}
\definecolor{colorii}{RGB}{248,219,162}

\NewDocumentCommand\MyArrow{O{0pt}mmmO{out=150,in=210}}
{%
\begin{tikzpicture}[overlay, remember picture]
  \draw [->,thick,line width=4pt,#4]
    ( $ ({pic cs:#3}|-{pic cs:#2}) + (-#1,1.3ex) $ ) to[#5]  
    ( $ (pic cs:#3) + (-#1,0) $ );
\end{tikzpicture}%
}

\begin{document}

\MyArrow[2em]{start1}{end1}{colorii,line width=6pt}
\MyArrow[1em]{start2}{end1}{colori}[out=120,in=250,looseness=1.2]

\begin{itemize}
\item\tikzmark{end1}Processing 
\item Embedding in paraffin blocks
\item Microtomy
\item\tikzmark{start2}Staining
\item\tikzmark{start1}Microscopy 
\end{itemize}

\end{document}

在此处输入图片描述

语法为\MyArrow

\MyArrow[<length>]{<mark1>}{<mark2>}{<options1>}[<options2>]

其中<length>控制箭头末端的水平移动(默认值0pt:),<mark1><mark2>是将用于绘制箭头的标记,<options1>是要传递给\draw命令的 TikZ 选项,<options2>是要传递给to用于绘制箭头的路径的 TikZ 选项(默认值out=150,in=210:)。

另一个例子:

\documentclass{article}
\usepackage{tikz}
\usepackage{xparse}
\usetikzlibrary{tikzmark,decorations.pathreplacing,calc,decorations.markings}

\definecolor{colori}{RGB}{166,35,41}
\definecolor{colorii}{RGB}{248,219,162}

\NewDocumentCommand\MyArrow{O{0pt}mmmO{out=150,in=210}}
{%
\begin{tikzpicture}[overlay, remember picture]
  \draw [->,thick,line width=4pt,#4]
    ( $ ({pic cs:#3}|-{pic cs:#2}) + (-#1,1.3ex) $ ) to[#5]  
    ( $ (pic cs:#3) + (-#1,0) $ );
\end{tikzpicture}%
}

\begin{document}

\MyArrow[0.8em]{start1}{end1}{colorii,line width=3pt}[out=90,in=-90]
\MyArrow[1.8em]{start2}{end1}{colori}[out=120,in=250]

\begin{itemize}
\item\tikzmark{end1}Processing 
\item\tikzmark{start1}Embedding in paraffin blocks
\item Microtomy
\item\tikzmark{start2}Staining
\item Microscopy 
\end{itemize}

\end{document}

在此处输入图片描述

相关内容