Does anyone know how to make a list with the dots linked by a line, like in the picture below?
Asked
Active
Viewed 1,203 times
3
-
I would suggest doing the entire thing with TikZ, or perhaps replacing \textbullet with \tikzmark. – John Kormylo May 06 '17 at 14:00
-
Related: https://tex.stackexchange.com/a/239992/117534 – Troy May 06 '17 at 14:01
1 Answers
5
A version with enumitem and TikZ, applying overlay and remember picture, drawing circle nodes and connectors to them.
It won't work for lists that break over pages, however.
\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}
Edit -- with a new list
\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}
-
-
Wow, super nice, thanks! However what should I do if I want to mantain also the standard dot list? – fma May 06 '17 at 18:06
-
@Francesco: I've added another version, defining a special
itemconlist type (i.e. itemize connected). – May 06 '17 at 18:09 -
@ChristianHupfer thanks again! Is there any counterindication is using your solution in a different class w.r.t. article? I am trying to use it in the altacv class but at the level of the first
\itemI get this kind of error: `./main.tex:116: Missing number, treated as zero.\enit@cv@itemdot` Do you have any idea of what may be causing this? – fma May 06 '17 at 18:41 -
-
@ChristianHupfer I have tried both with a nested list and without a nested list and I get the same result. Could I show you the source code somewhere? – fma May 06 '17 at 18:50
-
@Francesco: You could send it via the contact form on my website (the link is on my profile page here), but I don't have the
altacvclass at all – May 06 '17 at 18:57 -

