LaTeX 排版（1）：列表
LaTex
![](/data/attachment/album/202102/13/094113uummla4aezne9c1e.png)


本系列基于前文《[在 Fedora 上用 LaTex 和 TeXstudio 排版你的文档](https://fedoramagazine.org/typeset-latex-texstudio-fedora)》和《[LaTeX 基础](https://fedoramagazine.org/fedora-classroom-latex-101-beginners)》，本文即系列的第一部分，是关于 LaTeX 列表的。


### 列表类型


LaTeX 中的列表是封闭的环境，列表中的每个项目可以取一行文字到一个完整的段落。在 LaTeX 中有三种列表类型：


* `itemize`：<ruby> 无序列表 <rt>  unordered list </rt></ruby>/<ruby> 项目符号列表 <rt>  bullet list </rt></ruby>
* `enumerate`：<ruby> 有序列表 <rt>  ordered list </rt></ruby>
* `description`：<ruby> 描述列表 <rt>  descriptive list </rt></ruby>


### 创建列表


要创建一个列表，需要在每个项目前加上控制序列 `\item`，并在项目清单前后分别加上控制序列 `\begin{<类型>}` 和 `\end`{<类型>}`（将其中的`<类型>` 替换为将要使用的列表类型），如下例：


#### itemize（无序列表）



```
\begin{itemize}
    \item Fedora
    \item Fedora Spin
    \item Fedora Silverblue
\end{itemize}

```

![](/data/attachment/album/202102/13/094113xqvrgyxts7zcuuao.png)


#### enumerate（有序列表）



```
\begin{enumerate}
    \item Fedora CoreOS
    \item Fedora Silverblue
    \item Fedora Spin
\end{enumerate}

```

![](/data/attachment/album/202102/13/094113j6eiizvxqi7vx55i.png)


#### description（描述列表）



```
\begin{description}
    \item[Fedora 6] Code name Zod
    \item[Fedora 8] Code name Werewolf
\end{description}

```

![](/data/attachment/album/202102/13/094114tbvgll9qxl2l6wtq.png)


### 列表项目间距


可以通过在导言区加入 `\usepackage{enumitem}` 来自定义默认的间距，宏包 `enumitem` 启用了选项 `noitemsep` 和控制序列 `\itemsep`，可以在列表中使用它们，如下例所示：


#### 使用选项 noitemsep


将选项 `noitemsep` 封闭在方括号内，并同下文所示放在控制序列 `\begin` 之后，该选项将移除默认的间距。



```
\begin{itemize}[noitemsep]
    \item Fedora
    \item Fedora Spin
    \item Fedora Silverblue
\end{itemize}

```

![](/data/attachment/album/202102/13/094114kxmsrxpsh966pmoc.png)


#### 使用控制序列 \itemsep


控制序列 `\itemsep` 必须以一个数字作为后缀，用以表示列表项目之间应该有多少空间。



```
\begin{itemize} \itemsep0.75pt
    \item Fedora Silverblue
    \item Fedora CoreOS
\end{itemize}

```

![](/data/attachment/album/202102/13/094114utcbhhnwcseese0e.png)


### 嵌套列表


LaTeX 最多最多支持四层嵌套列表，如下例：


#### 嵌套无序列表



```
\begin{itemize}[noitemsep]
    \item Fedora Versions
    \begin{itemize}
        \item Fedora 8
        \item Fedora 9
        \begin{itemize}
            \item Werewolf
            \item Sulphur
            \begin{itemize}
                \item 2007-05-31
                \item 2008-05-13
            \end{itemize}
        \end{itemize}
    \end{itemize}
    \item Fedora Spin
    \item Fedora Silverblue
\end{itemize}

```

![](/data/attachment/album/202102/13/094115bkx7bn83x3axxz78.png)


#### 嵌套有序列表



```
\begin{enumerate}[noitemsep]
    \item Fedora Versions
    \begin{enumerate}
        \item Fedora 8
        \item Fedora 9
        \begin{enumerate}
            \item Werewolf
            \item Sulphur
            \begin{enumerate}
                \item 2007-05-31
                \item 2008-05-13
            \end{enumerate}
        \end{enumerate}
    \end{enumerate}
    \item Fedora Spin
    \item Fedora Silverblue
\end{enumerate}

```

![](/data/attachment/album/202102/13/094115lue3rr36xx1flzg4.png)


### 每种列表类型的列表样式名称




| **enumerate（有序列表）** | **itemize（无序列表）** |
| --- | --- |
| `\alph*` （小写字母） | `$\bullet$` （●） |
| `\Alph*` （大写字母） | `$\cdot$` （•） |
| `\arabic*` （阿拉伯数字） | `$\diamond$` （◇） |
| `\roman*` （小写罗马数字） | `$\ast$` （✲） |
| `\Roman*` （大写罗马数字） | `$\circ$` （○） |
|  | `$-$` （－） |


### 按嵌套深度划分的默认样式




| **嵌套深度** | **enumerate（有序列表）** | **itemize（无序列表）** |
| --- | --- | --- |
| 1 | 阿拉伯数字 | （●） |
| 2 | 小写字母 | （－） |
| 3 | 小写罗马数字 | （✲） |
| 4 | 大写字母 | （•） |


### 设置列表样式


下面的例子列举了无序列表的不同样式。



```
% 无序列表样式
\begin{itemize}
    \item[$\ast$] Asterisk
    \item[$\diamond$] Diamond
    \item[$\circ$] Circle
    \item[$\cdot$] Period
    \item[$\bullet$] Bullet (default)
    \item[--] Dash
    \item[$-$] Another dash
\end{itemize}

```

![](/data/attachment/album/202102/13/094115x3qy2hdym3cacxhd.png)


有三种设置列表样式的方式，下面将按照优先级从高到低的顺序分别举例。


#### 方式一：为各项目单独设置


将需要的样式名称封闭在方括号内，并放在控制序列 `\item` 之后，如下例：



```
% 方式一
\begin{itemize}
    \item[$\ast$] Asterisk
    \item[$\diamond$] Diamond
    \item[$\circ$] Circle
    \item[$\cdot$] period
    \item[$\bullet$] Bullet (default)
    \item[--] Dash
    \item[$-$] Another dash
\end{itemize}

```

#### 方式二：为整个列表设置


将需要的样式名称以 `label=` 前缀并封闭在方括号内，放在控制序列 `\begin` 之后，如下例：



```
% 方式二
\begin{enumerate}[label=\Alph*.]
    \item Fedora 32
    \item Fedora 31
    \item Fedora 30
\end{enumerate}

```

#### 方式三：为整个文档设置


该方式将改变整个文档的默认样式。使用 `\renewcommand` 来设置项目标签的值，下例分别为四个嵌套深度的项目标签设置了不同的样式。



```
% 方式三
\renewcommand{\labelitemi}{$\ast$}
\renewcommand{\labelitemii}{$\diamond$}
\renewcommand{\labelitemiii}{$\bullet$}
\renewcommand{\labelitemiv}{$-$}

```

### 总结


LaTeX 支持三种列表，而每种列表的风格和间距都是可以自定义的。在以后的文章中，我们将解释更多的 LaTeX 元素。


关于 LaTeX 列表的延伸阅读可以在这里找到：[LaTeX List Structures](https://en.wikibooks.org/wiki/LaTeX/List_Structures)




---


via: <https://fedoramagazine.org/latex-typesetting-part-1/>


作者：[Earl Ramirez](https://fedoramagazine.org/author/earlramirez/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[rakino](https://github.com/rakino) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
This series builds on the previous articles: [Typeset your docs with LaTex and TeXstudio on Fedora](https://fedoramagazine.org/typeset-latex-texstudio-fedora) and [LaTeX 101 for beginners](https://fedoramagazine.org/fedora-classroom-latex-101-beginners). This first part of the series is about LaTeX lists.

## Types of lists

LaTeX lists are enclosed environments, and each item in the list can take a line of text to a full paragraph. There are three types of lists available in LaTeX. They are:

**Itemized**: unordered or bullet**Enumerated**: ordered**Description**: descriptive

## Creating lists

To create a list, prefix each list item with the \*item* command. Precede and follow the list of items with the \*begin*{<type>} and \*end*{<type>} commands respectively where <type> is substituted with the type of the list as illustrated in the following examples.

### Itemized list

\begin{itemize} \item Fedora \item Fedora Spin \item Fedora Silverblue \end{itemize}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-1.png)

### Enumerated list

\begin{enumerate} \item Fedora CoreOS \item Fedora Silverblue \item Fedora Spin \end{enumerate}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-2.png)

### Descriptive list

\begin{description} \item[Fedora 6] Code name Zod \item[Fedora 8] Code name Werewolf \end{description}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-3.png)

## Spacing list items

The default spacing can be customized by adding \*usepackage{enumitem}* to the preamble. The *enumitem* package enables the *noitemsep* option and the \*itemsep* command which you can use on your lists as illustrated below.

### Using the noitemsep option

Enclose the *noitemsep* option in square brackets and place it on the \*begin* command as shown below. This option removes the default spacing.

\begin{itemize}[noitemsep] \item Fedora \item Fedora Spin \item Fedora Silverblue \end{itemize}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-4.png)

### Using the \itemsep command

The \*itemsep* command must be suffixed with a number to indicate how much space there should be between the list items.

\begin{itemize} \itemsep0.75pt \item Fedora Silverblue \item Fedora CoreOS \end{itemize}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-5.png)

## Nesting lists

LaTeX supports nested lists up to four levels deep as illustrated below.

### Nested itemized lists

\begin{itemize}[noitemsep] \item Fedora Versions \begin{itemize} \item Fedora 8 \item Fedora 9 \begin{itemize} \item Werewolf \item Sulphur \begin{itemize} \item 2007-05-31 \item 2008-05-13 \end{itemize} \end{itemize} \end{itemize} \item Fedora Spin \item Fedora Silverblue \end{itemize}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-7.png)

### Nested enumerated lists

\begin{enumerate}[noitemsep] \item Fedora Versions \begin{enumerate} \item Fedora 8 \item Fedora 9 \begin{enumerate} \item Werewolf \item Sulphur \begin{enumerate} \item 2007-05-31 \item 2008-05-13 \end{enumerate} \end{enumerate} \end{enumerate} \item Fedora Spin \item Fedora Silverblue \end{enumerate}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-8.png)

## List style names for each list type

Enumerated | Itemized |

\alph* | $\bullet$ |

\Alph* | $\cdot$ |

\arabic* | $\diamond$ |

\roman* | $\ast$ |

\Roman* | $\circ$ |

$-$ |


## Default style by list depth

Level | Enumerated | Itemized |

1 | Number | Bullet |

2 | Lowercase alphabet | Dash |

3 | Roman numerals | Asterisk |

4 | Uppercase alphabet | Period |


## Setting list styles

The below example illustrates each of the different itemiszed list styles.

% Itemize style \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond \item[$\circ$] Circle \item[$\cdot$] Period \item[$\bullet$] Bullet (default) \item[--] Dash \item[$-$] Another dash \end{itemize}

![](https://fedoramagazine.org/wp-content/uploads/2020/06/image-9.png)

There are three methods of setting list styles. They are illustrated below. These methods are listed by priority; highest priority first. A higher priority will override a lower priority if more than one is defined for a list item.

### List styling method 1 – per item

Enclose the name of the desired style in square brackets and place it on the \*item* command as demonstrated below.

% First method \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond \item[$\circ$] Circle \item[$\cdot$] period \item[$\bullet$] Bullet (default) \item[--] Dash \item[$-$] Another dash \end{itemize}

### List styling method 2 – on the list

Prefix the name of the desired style with *label=*. Place the parameter, including the *label=* prefix, in square brackets on the \*begin* command as demonstrated below.

% Second method \begin{enumerate}[label=\Alph*.] \item Fedora 32 \item Fedora 31 \item Fedora 30 \end{enumerate}

### List styling method 3 – on the document

This method changes the default style for the entire document. Use the \*renewcommand* to set the values for the labelitems. There is a different labelitem for each of the four label depths as demonstrated below.

% Third method \renewcommand{\labelitemi}{$\ast$} \renewcommand{\labelitemii}{$\diamond$} \renewcommand{\labelitemiii}{$\bullet$} \renewcommand{\labelitemiv}{$-$}

## Summary

LaTeX supports three types of lists. The style and spacing of each of the list types can be customized. More LaTeX elements will be explained in future posts.

Additional reading about LaTeX lists can be found here: [LaTeX List Structures](https://en.wikibooks.org/wiki/LaTeX/List_Structures)

## kd

Helpful, thanks

## Earl Ramirez

Glad that is was helpful

## Jorge Dominguez

Thanks for the tips, I’m starting out with LaTeX, so this was indeed helpful

## Earl Ramirez

LaTeX is great, I first starting using LaTeX after I saw the article “Typeset your docs with LaTex and TeXstudio on Fedora.”

## Julio Gonzalez

Love it!

I use vim+latex and I find it very fun, cause you merged the vim power with LaTeX style.

## James Aker

Great Scott! It’s back to future. I remember doing college assignments using LaTeX. Anymore I use Emacs+LaTex to create PDF’s on my fedora workstation.

Thanks for the article

## ddd

why deleting my post?

???

## Stephen Snow

I can’t seem to find a previous post from you. Would you mind commenting again?

## Leslie Satenstein

Gee, It seems to make asciidoc a dog of a format program, when compared to Latex.

Why do we need both? is there a way to merge the two format languages?

## Earl Ramirez

I believe that asciidoc does support LaTeX backend, but I have never used it or asciidoc.