使用任务包创建的列表中项目内的行距

使用任务包创建的列表中项目内的行距

这是关于使用tasks包的。我正在寻找一个选项(比如下面 MWE 中的注释行)来调整项目(项目task)内行之间的间距。我在文档中找不到这样的选项。有没有办法减少 MWE 中任务 a) 或任务 b) 中的行间距?

补充问题:有没有办法减少段落之间的间距(以任务c)为例)?

\documentclass{article}
\usepackage{tasks}

\def\sample{This is some sample text we will use to create a somewhat longer text spanning more than a line.}
%\settasks{interline-space = 1em} % "interline-space" doesn't exist

\begin{document}
    \begin{tasks}
        \task line 1\\ line 2
        \task \sample\ \sample \\ \sample
        \task \sample\par\sample
    \end{tasks}
\end{document}

答案1

这是你想要的东西吗?

\documentclass{article}
\usepackage{tasks}
\usepackage{setspace}
\def\sample{This is some sample text we will use to create a somewhat longer text spanning more than a line.}
%\settasks{interline-space = 1em} % "interline-space" doesn't exist
\usepackage{etoolbox}
\AtBeginEnvironment{tasks}{\setstretch{.6}}

\begin{document}
    \begin{tasks}
        \task line 1\\ line 2
        \task \sample\ \sample \\ \sample
        \task \sample\par\sample
    \end{tasks}
This is some sample text we will use to create a somewhat longer text spanning more than a line. This is some sample text we will use to create a somewhat longer text spanning more than a line. This is some sample text we will use to create a somewhat longer text spanning more than a line.

\end{document} 

在此处输入图片描述

相关内容