带有垂直线和闭合循环的项目符号列表

带有垂直线和闭合循环的项目符号列表

我想要一个带有垂直线的项目符号列表,如本主题中所示:

带垂直线的项目符号列表

...但在第一个元素和最后一个元素之间有一个额外的连接,如下图所示:

在此处输入图片描述

有任何想法吗?

答案1

不完全是你想要的,但接近,得到pstricks

    \documentclass[svgnames]{article}
    \usepackage{enumitem}
    \usepackage{pst-node, pst-arrow}

    \begin{document}

    \psset{linecolor=DarkGray, ArrowInside=->, ArrowInsidePos=0.60} %\noindent
    \dotnode(0,0.4ex){A}\qquad Step1\bigskip

    \dotnode(0,0.4ex){B}\qquad Step2.\bigskip

    \dotnode(0,0.4ex){C}\qquad Step3. Return to step 1.
    \ncline{A}{B}\ncline{B}{C}
    \ncbar[angle=180]{->}{C}{A}

    \end{document} 

在此处输入图片描述

答案2

这是一个基于的解决方案问题中接受的解决方案你链接了。

重要的:

  • 只有完全在一页上的列表才有效。
  • 目前仍然必须手动指定箭头位置。
\documentclass{article}
\usepackage{tikz,tikzpagenodes}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.markings}% ADDED
\usepackage{refcount}

\newcounter{mylist} % new counter for amount of lists
\newcounter{mycnt}[mylist] % create new item counter
\newcounter{mytmp}[mylist] % tmp counter needed for checking before/after current item

% ADDED postaction and decoration
\newcommand{\drawoptionsconn}{ gray, shorten <= .5mm, shorten >= .5mm, thick, postaction={decorate}, decoration={markings,mark=at position 0.7 with {\arrow{Stealth}}}}
\newcommand{\drawoptionsshort}{gray, shorten <= .5mm, shorten >= -1mm, thick, postaction={decorate}, decoration={markings,mark=at position 0.7 with {\arrow{Stealth}}}}

\newcommand{\myitem}{% Modified `\item` to update counter and save nodes
  \stepcounter{mycnt}%
  \item[\linkedlist{%
    i\alph{mylist}\arabic{mycnt}}]%
  \label{item-\alph{mylist}\arabic{mycnt}}%
  \ifnum\value{mycnt}>1%
    \ifnum\getpagerefnumber{item-\alph{mylist}\arabic{mytmp}}<\getpagerefnumber{item-\alph{mylist}\arabic{mycnt}}%
      \begin{tikzpicture}[remember picture,overlay]%
        \expandafter\draw\expandafter[\drawoptionsshort] (i\alph{mylist}\arabic{mycnt}) --
          ++(0,3mm) --
          (i\alph{mylist}\arabic{mycnt} |- current page text area.north);% draw short line
      \end{tikzpicture}%
    \else%
      \begin{tikzpicture}[remember picture,overlay]%
        \expandafter\draw\expandafter[\drawoptionsconn] (i\alph{mylist}\arabic{mytmp}) -- (i\alph{mylist}\arabic{mycnt});% draw the connecting lines
      \end{tikzpicture}%
    \fi%
  \fi%
  \addtocounter{mytmp}{2}%
  \IfRefUndefinedExpandable{item-\alph{mylist}\arabic{mytmp}}{}{% defined
    \ifnum\getpagerefnumber{item-\alph{mylist}\arabic{mytmp}}>\getpagerefnumber{item-\alph{mylist}\arabic{mycnt}}%
      \begin{tikzpicture}[remember picture,overlay]%
      \expandafter\draw\expandafter[\drawoptionsshort] (i\alph{mylist}\arabic{mycnt}) --
        ++(0,-3mm) --
        (i\alph{mylist}\arabic{mycnt} |- current page text area.south);% draw short line
      \end{tikzpicture}%
    \fi%
  }%
  \addtocounter{mytmp}{-1}%
}

\newcommand{\linkedlist}[1]{
  \raisebox{0pt}[0pt][0pt]{\begin{tikzpicture}[remember picture]%
  \node (#1) [gray,circle,fill,inner sep=1.5pt]{};
  \end{tikzpicture}}%
}

\newenvironment{myitemize}{%
% Create new `myitemize` environment to keep track of the counters
  \stepcounter{mylist}% increment list counter
  \begin{itemize}
}{\end{itemize}%
  }

% ADDED
\newcommand\additionalConnection[1]{
    \begin{tikzpicture}[remember picture,overlay]%
        \draw[gray, shorten <= .5mm, shorten >= .5mm, thick, postaction={decorate}, decoration={markings,mark=at position #1 with {\arrow{Stealth}}}]
            (i\alph{mylist}\arabic{mycnt}.west)
            -- ++(-.25,0)
            |- (i\alph{mylist}1.west);
    \end{tikzpicture}

}

\begin{document}
\noindent
First bullet list:
\begin{myitemize}
  \myitem Step 1.
  \myitem Step 2. Return to step 1.
\end{myitemize}
\additionalConnection{.6}% with mark/arrow position

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\noindent
Second bullet list:
\begin{myitemize}
  \myitem Step 1.
  \myitem Step 2.
  \myitem Step 3. Return to step 1.
\end{myitemize}
\additionalConnection{.57}% with mark/arrow position

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\noindent
Third bullet list:
\begin{myitemize}
  \myitem Step 1.
  \myitem Step 2.
  \myitem Step 3.
  \myitem Step 4. Return to step 1.
\end{myitemize}
\additionalConnection{.55}% with mark/arrow position
\end{document}

带有连接项目符号的项目符号列表。闭环。

相关内容