如何仅更改列表内的行间距?

如何仅更改列表内的行间距?

如果我执行以下操作:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{enumitem}
\setstretch{2}
\setlist[itemize]{topsep=.1em,itemsep=.1em,parsep=0em,partopsep=0em}
\setlist*[itemize]{first=\setstretch{1}}    % This undesirably affects the spacing before the list

\begin{document}

\def\text{test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph}

\text

\begin{itemize}
\item one
\item two
\item three
\end{itemize}

\text

\end{document}

然后我得到:

列表和前一段落之间的间距不好

但这不是我想要的。我想保持列表前的间距不变,但只更改列表行之间的间距。有什么方法可以自动为所有 itemize/enumerate 列表实现这一点,而不管其周围文本的行间距如何?

答案1

一种方法是简单地调整改变的基线:

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{enumitem}
\setstretch{2}
\setlist[itemize]{topsep=.1em,itemsep=.1em,parsep=0em,partopsep=0em}
\setlist*[itemize]{first=\vspace{\baselineskip}\setstretch{1}\vspace{-\baselineskip}}    % This undesirably affects the spacing before the list

\begin{document}

\def\text{test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph}

\text

\begin{itemize}
\item one
\item two
\item three
\end{itemize}

\text

\end{document}

答案2

这样怎么样,使用beforeafter键?

    \documentclass{article}
    \usepackage[T1]{fontenc}
    \usepackage{setspace}
    \usepackage{enumitem}
    \setstretch{2}
    \setlist[itemize]{topsep=.1em, itemsep=.1em,parsep=0em, partopsep=0em}
    \setlist[itemize]{before=\begin{singlespace}, after=\end{singlespace}}

    \begin{document}

    \def\text{test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph}

    \text

    \begin{itemize}
    \item one\text
    \item two
    \item three
    \end{itemize}

    \text

    \end{document} 

在此处输入图片描述

答案3

在一位评论者提出建议后\singlespacing,我查看了它的定义,我认为以下内容在所有情况下都有效:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\usepackage{enumitem}
\setstretch{2}
\setlist[itemize,enumerate]{topsep=.1em,itemsep=.1em,parsep=0em,partopsep=0em}
\setlist*[itemize,enumerate]{first=\vskip\baselineskip\setstretch{1.1}\vspace{-\baselineskip}}

\begin{document}

\def\text{test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph test paragraph}

\text

\begin{itemize}
\item one
\item two
\item three
    \begin{enumerate}
    \item a
    \item b
    \end{enumerate}
\item four
\end{itemize}

\text

\end{document}

1.1显然可以任意改变。它产生:

列表前的适当间距

相关内容