在开始之前消除空格{逐条列出}

在 Latex 中,如何消除在逐项列出之前插入的空格?

\begin{itemize} % produces lots of vertical space
\item ...
\item ...
\end{itemize}
224385 次浏览

在分项之前尝试 \vspace{-5mm}

正确的 LaTeX 方法是使用一个包,它允许您指定所需的间距。有几个这样的包,这两个网页链接到他们的清单..。

\renewcommand{\@listI}{%
\leftmargin=25pt
\rightmargin=0pt
\labelsep=5pt
\labelwidth=20pt
\itemindent=0pt
\listparindent=0pt
\topsep=0pt plus 2pt minus 4pt
\partopsep=0pt plus 1pt minus 1pt
\parsep=0pt plus 1pt
\itemsep=\parsep}

I'm very happy with the 寄生虫包裹. Besides adding the option to eliminate the space it also adds other nice things like compact versions of the itemize, enumerate and describe environments.

解决这类问题的方法是重新定义相关的列表环境。enumitem包是我最喜欢的做这类事情的方式; 它有许多可以改变的选项和参数,可以针对所有列表,也可以针对每个列表单独使用。

Here's how to do (something like) what it is I think you want:

\usepackage{enumitem}
\setlist{nolistsep}

or

\usepackage{enumitem}
\setlist{nosep}
  • \begin{itemize}之前使用 \vspace{-\topsep}
  • \begin{itemize}之后使用 \setlength{\parskip}{0pt} \setlength{\itemsep}{0pt plus 1pt}
  • 对于列表后面的空格,在 \end{itemize}后面使用 \vspace{-\topsep}
\vspace{-\topsep}
\begin{itemize}
\setlength{\parskip}{0pt}
\setlength{\itemsep}{0pt plus 1pt}
\item ...
\item ...
\end{itemize}
\vspace{-\topsep}

实现这一点的最简单的方法是使用 enumitem包(https://ctan.org/pkg/enumitem),

enter image description here

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\noindent Here is some text and I want to make sure
there is no spacing the different items.
\begin{itemize}[noitemsep]
\item Item 1
\item Item 2
\item Item 3
\end{itemize}
\noindent Here is some text and I want to make sure
there is no spacing between this line and the item
list below it.
\begin{itemize}[noitemsep,topsep=0pt]
\item Item 1
\item Item 2
\item Item 3
\end{itemize}
\end{document}

此外,如果希望在列表之间全局使用此设置,可以使用

\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\setlist[itemize]{noitemsep, topsep=0pt}

However, note that this package does not work well with the beamer package which is used to make presentations in Latex.