4

I'm using the tasks package to build a set of math tests. Some of the problems need to be in one column, and some of them need to be in multiple columns, so I'm using separate tasks environments. However, every time I end one tasks environment and start a new one, I end up with some extra vertical whitespace that I don't want. Case in point:

\documentclass{article}
\usepackage{tasks}

\NewTasks[
counter-format={tsk[1].}, 
label-format=\bfseries,
label-width=0.25in,
label-align=right,
label-offset=0.1in,
item-indent=0.35in, 
after-item-skip=10pt, 
resume=true
]{problems}[\prob]

\begin{document}
  \begin{problems}
    \prob Single-column problem 1
    \prob Problem 2
  \end{problems}
  \begin{problems}(2)
    \prob Double-column problems
    \prob Problem 4
  \end{problems}
\end{document}

example image - unwanted vertical whitespace

Where is this whitespace coming from? And what's the best way to get rid of it? Should I set after-skip to a negative value? How much? I'm using ShareLaTeX, by the way, if that makes a difference.

9
  • 1
    Please, make your code compilable. The preamble is missing.
    – Sigur
    Jan 13, 2015 at 18:10
  • Not all but the minimal ones so we can copy and paste your code to test it.
    – Sigur
    Jan 13, 2015 at 18:14
  • 2
    There is an extra 6pt plus 2pt minus 4pt between the lists (seen via using \showoutput), which you can remove by inserting \vspace{-6pt plus 4pt minus 2pt} between the lists. But perhaps there's a better, automated way of doing this.
    – Werner
    Jan 13, 2015 at 19:02
  • 2
    You can use a single problems environment with two-column layout and use \prob! for items spanning both columns, as in: \begin{problems}(2) \prob! Single-column problem 1 \prob! Problem 2 \prob Double-column problems \prob Problem 4 \end{problems} Jan 13, 2015 at 19:07
  • 1
    @JosephMontanaro: Add it to your document (wherever) and check the .log file. It will include all the pages that are shipped out from wherever you place \showoutput in a nested/boxed fashion. You can interpret the \glue that is inserted, the characters and from which font... all nifty, garbled stuff.
    – Werner
    Jan 13, 2015 at 19:54

1 Answer 1

2

This is no longer a problem in the up to date version of tasks:

\documentclass{article}
\usepackage{tasks}[2022-01-08]

\NewTasksEnvironment[
  label = \arabic*. , 
  label-format = \bfseries ,
  label-width = 0.25in ,
  label-align = right ,
  label-offset = 0.1in ,
  item-indent = 0.35in , 
  after-item-skip = \topsep, 
  resume=true
]{problems}[\prob]

\begin{document}

\begin{problems}
  \prob Single-column problem 1
  \prob Problem 2
\end{problems}
\begin{problems}(2)
  \prob Double-column problems
  \prob Problem 4
\end{problems}

Or:
\begin{problems}(2)
  \prob* Single-column problem 1
  \prob* Problem 2
  \prob Double-column problems
  \prob Problem 4
\end{problems}

\end{document}

enter image description here

You must log in to answer this question.

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