我正在尝试结合 multicols 和 enumerate 环境(或者,multicols 和 enumitem 包)。基本上,我想在 multicol 内部有 enumerate 时去掉顶部边距。通常的设置(如下所示)失败了。谢谢!
这是我的最小示例:
\documentclass{article}
\usepackage{enumitem}
\usepackage{multicol}
\begin{document}
I can get rid of the margin here:
\begin{enumerate}[topsep=0pt]
\item a
\item b
\end{enumerate}
\vspace{10pt}
but not here
\begin{multicols}{2}
\begin{enumerate}[topsep=0pt]
\item a
\item b
\end{enumerate}
\end{multicols}
\vspace{10pt}
and
\begin{multicols}{2}
[not even like so]
\begin{enumerate}[noitemsep,nolistsep,partopsep=-20pt,topsep=-20pt]
\item a
\item b
\end{enumerate}
\end{multicols}
\end{document}
输出如下:
答案1
您可以通过以下方式消除该问题\setlength\multicolsep{0pt}
:
代码:
\documentclass{article}
\usepackage{enumitem}
\usepackage{multicol}
\begin{document}
I can get rid of the margin here:
\begin{enumerate}[topsep=0pt]
\item a
\item b
\end{enumerate}
\vspace{10pt}
and also here
{\setlength\multicolsep{0pt}%
\begin{multicols}{2}
\begin{enumerate}[topsep=0pt]
\item a
\item b
\end{enumerate}
\end{multicols}}
\vspace{10pt}
and
{\setlength\multicolsep{0pt}%
\begin{multicols}{2}
[also like so]
\begin{enumerate}[noitemsep,nolistsep,partopsep=-20pt,topsep=-20pt]
\item a
\item b
\end{enumerate}
\end{multicols}}
\end{document}