2

This is about using the tasks package. I was looking for an option (like in the commented line in the MWE below) to tweak the spacing between the lines inside an item (a task item). I couldn't find such an option in the documentation. Is there a way to decrease the space between the lines in task a) or task b) in the MWE?

Complementary question: is there a way to reduce the space between paragraphs (task c) as an example)?

\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 Answer 1

1

Is is something like that you want?

\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} 

enter image description here

4
  • This solution affects the space between paragraphs [SBP] as well, which is good in most applications but I need to control this space separately (hence the complementary Q). Currently I need to make the paragraph line spacing [PLS] smaller but the SBP needs to remain unaffected. In the near future I will have to make SBP same as PLS. Maybe there's a way to tweak the spaces independently? Thanks for the answer and for the {tasks} tag [Is 'etoolbox' doing anything here?]
    – alwaysask
    Commented Oct 17, 2014 at 23:47
  • @alwaysask: Well, I don't know what it is you call SBP and PLS. Standard LaTeX defines only \baselineskip and parskip. You always can change the value of parskip each time you need it… As for the etoolbox package, it defines AtBeginEnvironment, which I use to make \setstretch local to the environment.
    – Bernard
    Commented Oct 18, 2014 at 1:22
  • It's not that I call something SBP/PLS. Those are local (i.e. my_comment_wide) acronyms defined by the 3 words before the 1st occurrence of those abbreviations. As for etoolbox, the above MWE builds without the explicit inclusion of the package, that's why I asked - never mind though. Setting parskip globally (which doesn't do well in my case anyway) or with \AtBeginEnvironment has no effect in tasks environment. Can you provide an MWE please?
    – alwaysask
    Commented Oct 18, 2014 at 6:25
  • @alwaysask: I had tested a number of possibilities. The only one that worked was to define a \mypar command as ` \newcommand\mypar[1][4ex{\setlength\parskip{4ex}\par}` (the extravagant 4ex value is just for testing, and use \mypar instead of \par. Perhaps one could use etoolbox to patch the definition of \par inside the tasks environment. Not tested, though.
    – Bernard
    Commented Oct 18, 2014 at 9:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .