如何在清單中的項目符號中新增垂直線?

如何在清單中的項目符號中新增垂直線?

我正在將文件從 InDesign 遷移到 Latex,但似乎無法弄清楚這部分。標題說明了一切。我附上了一張圖片以防萬一。

我考慮製作一個表格,其中每個單元格都包含一個逐項,然後將項目符號水平偏移到表格的邊框上,但找不到任何水平偏移項目符號(而不是文字)的內容。

項目符號列表

答案1

編輯提供rbitemize環境。在此環境中,將給出一個單選按鈕,上面和下面有規則,並帶有指定行數的\item可選參數(如果大於 1)。\item\item

我將內部巨集命名為\rb,參考我的「單選按鈕」程式碼如何排版單選按鈕?

在環境中,\item被重新定義為自動呼叫內部\rb巨集。宏\rb基本上就是一個堆疊。堆疊的核心(又稱錨點)是一個\bullet嵌入在縮放後的\circ.這給了單選按鈕。但單選按鈕上方和下方堆疊的是規則。按鈕上方的長度規則是固定的,而按鈕下方的規則長度則受到修訂後的可選參數的影響\item

\documentclass[12pt]{article}
\usepackage[usestackEOL]{stackengine}
\usepackage{graphicx}
\newcommand\rb[1]{\raisebox{-1.5pt}{%
  \stackunder[-2pt]{%
    \stackon[0pt]{%
      \stackinset{c}{}{c}{.35pt}{$\bullet$}{\scalebox{2}{$\circ$}}%
    }{%
      \smash{\rule{1pt}{2.1ex}}\kern.5pt}%
  }{%
    \smash{\rule[\dimexpr-#1\baselineskip+1.8ex\relax]{1pt}{%
      \dimexpr#1\baselineskip-1.8ex\relax}}\kern.5pt}%
  }%
}
\let\svitem\item
\def\rbsetup{\renewcommand\item[1][1]{\svitem[\rb{##1}]}}
\newenvironment{rbitemize}{\itemize\rbsetup}{\enditemize}
\begin{document}
\noindent Here is my itemize:
\begin{rbitemize}
\item foo
\item[2] bar continuing for an extra line to check if I can extend the 
  vertical bar downward, albeit manually
\item baz
\end{rbitemize}
Done with itemize
\end{document}

在此輸入影像描述

答案2

僅使用“標準”LaTeX 位元的簡單答案。這不是很靈活,特別是它假設您的專案都是單行,但它可能會讓您走上更強大的道路。

\documentclass{article}
\newcommand\db{\mbox{\enspace\textbullet\hspace*{-2.8pt}\rule[-6pt]{0.4pt}{16pt}}}
\newenvironment{linked}{\begin{list}{}{%
  \renewcommand{\makelabel}{\db}
  \setlength{\itemsep}{-1pt}
  \setlength{\parsep}{0pt}
}}{\end{list}}
\begin{document}

However, a service-oriented paradigm is further compounded when taking into account
the evolution of specifications over a given time period.  
\begin{linked}
\item Small things in this list
\item Not very long or it will look awful.
\item OK?
\end{linked}
Conversely, any associated supporting element recognizes other systems' importance
and the necessity for possible bidirectional logical relationship approaches.  

\end{document}

在此輸入影像描述

乳膠伴侶是此類定制不可或缺的參考。特別請參閱第 3 章中的「清單結構」部分。

相關內容