答案1
enumitem
带有和的版本TikZ
,应用overlay
和remember picture
,绘制圆形节点和连接器到它们。
然而,它不适用于分页的列表。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{enumitem}
\newcounter{itemdot}
\DeclareRobustCommand{\dottedlinked}{%
\begin{tikzpicture}[remember picture,overlay]
\node[draw,anchor=base,inner sep=0pt,outer sep=0pt,circle,cyan] (itemdot\number\value{itemdot}) {\phantom{\textbullet}};
\ifnum0<\value{itemdot}
\draw[cyan,line width=0.5pt] (itemdot\number\value{itemdot}) -- (itemdot\the\numexpr\value{itemdot}-1);
\fi
\stepcounter{itemdot}
\end{tikzpicture}%
}
\makeatletter
\g@addto@macro{\itemize}{\setcounter{itemdot}{0}} % reset the itemdot counter for a new itemize environment
\makeatother
\setlist[itemize,1]{label={\dottedlinked}}
\begin{document}
\begin{itemize}
\item foo
\item foobar
\item foobar foobar
\end{itemize}
\begin{itemize}
\item foo
\item foobar
\item foobar foobar
\end{itemize}
\end{document}
编辑——使用新列表
\documentclass{article}
\usepackage{blindtext}
\usepackage{tikz}
\usepackage{enumitem}
\newcounter{itemdot}
\DeclareRobustCommand{\dottedlinked}{%
\begin{tikzpicture}[remember picture,overlay]
\node[draw,anchor=base,inner sep=0pt,outer sep=0pt,circle,cyan,line width=1pt,yshift=0.1ex] (itemdot\number\value{itemdot}) {\phantom{\textbullet}};
\ifnum0<\value{itemdot}
\draw[cyan,line width=1pt,] (itemdot\number\value{itemdot}) -- (itemdot\the\numexpr\value{itemdot}-1);
\fi
\stepcounter{itemdot}%
\end{tikzpicture}%
}
\makeatletter
\g@addto@macro{\itemize}{\setcounter{itemdot}{0}} % reset the itemdot counter for a new itemize environment
\makeatother
\newlist{itemcon}{itemize}{1}
\setlist[itemcon,1]{label={\dottedlinked}}
\begin{document}
\begin{itemcon}
\item foo
\item foobar
\blindtext
\item foobar foobar
\item foobar foobar
\item foobar foobar
\blindtext[2]
\item Foo
\end{itemcon}
\begin{itemize}
\item foo
\item foobar
\blindtext
\item foobar foobar
\end{itemize}
\end{document}