3

I thought I managed to solve this by tweaking the 'after-item-skip', 'after-skip' &Co settings of the tasks package but I ran into some unexpected issues with page breaks when the number of tasks gets higher. Given I had to use some negative values, I think I didn't do it right.

Can anybody help with the proper way to solve the problem in the MWE below? I.e suggesting the right way to set the spacings (and the indentation of list items if it's not much to ask) only in 'Part 1' of the code so that the output will be more or less as the output of 'Part 2'. The spacing between the last 3 lines is fine, I just put those lines to make sure the solution doesn't break that.

\documentclass[12pt]{report}
\usepackage{exsheets}

\usepackage{tasks}

\usepackage{parskip}


\SetupExSheets{headings = empty}


\begin{document}


Part 1

\begin{question}OOOOOOOOOOOOOOOO\\OOOOOOOOOOOOOOOO

\begin{tasks}
   \task OOOOOOOOOOOOO
   \task OOOOOOOOOOOOO
\end{tasks}
\settasks{resume = true}
\begin{tasks}
 \task OOOOOOOOOOOOO
 \task OOOOOOOOOOOOO
\end{tasks}

\end{question}
\begin{question}
    OOOOOOOOOOOOOOOO\\
    OOOOOOOOOOOOOOOO
\end{question}
OOOOOOOOOOOOOOOO

=================

Part 2

\par I need to make the above text \\
to look [exactly] like this:\\
OOOOOOOOOOOOOOOO\\OOOOOOOOOOOOOOOO\\
a) OOOOOOOOOOOOO\\
b) OOOOOOOOOOOOO\\
c) OOOOOOOOOOOOO\\
d) OOOOOOOOOOOOO
\par OOOOOOOOOOOOOOOO\\OOOOOOOOOOOOOOOO
\par OOOOOOOOOOOOOOOO
\end{document}
5
  • I need to set the spacings in Part 1 only (i.e. no alterations to the Part 2). I'd really appreciate an MWE (no output) so there's no misunderstanding from my part. Thanks
    – alwaysask
    Commented Oct 20, 2014 at 8:40
  • It doesn't work.
    – alwaysask
    Commented Oct 20, 2014 at 8:51
  • Even if it did, the spacing between the 2 tasks environments (where \settasks{resume = true} comes in) was unaffected (and it's not as it should be). I need 2 (or more) tasks environments one after the other as I need to change the number of columns within the question environment (from 4 to 3 to 2 for example)
    – alwaysask
    Commented Oct 20, 2014 at 9:22
  • Can you post an example of that so that I can try it? In my trials, I could manage the spacing.
    – user11232
    Commented Oct 20, 2014 at 9:25
  • An example is right in the MWE I posted in the question. Please include your code in it and post the entire modified MWE so anyone can run it and see that the 2 Parts are identical (except the indentation of \tasks maybe).
    – alwaysask
    Commented Oct 20, 2014 at 9:35

1 Answer 1

4

Something like this?

\documentclass{article}
\usepackage{exsheets}
\SetupExSheets{headings = empty}
\usepackage{parskip}

\settasks{
  % the next two should be set to the same value so labels are aligned to the
  % left
  label-width = 1em ,
  item-indent = 1em ,
  before-skip = -\parskip , % undo paragraph skip
  after-skip = -\parskip , % undo paragraph skip
  after-item-skip = -\parskip % undo paragraph skip
}

\begin{document}

Part 1

\begin{question}OOOOOOOOOOOOOOOO\\OOOOOOOOOOOOOOOO
\begin{tasks}
   \task OOOOOOOOOOOOO
   \task OOOOOOOOOOOOO
\end{tasks}
\vspace{\parskip}
\begin{tasks}[resume]
 \task OOOOOOOOOOOOO
 \task OOOOOOOOOOOOO
\end{tasks}
\end{question}
\begin{question}
    OOOOOOOOOOOOOOOO\\
    OOOOOOOOOOOOOOOO
\end{question}
OOOOOOOOOOOOOOOO

Part 2

I need to make the above text \\
to look [exactly] like this:\\
OOOOOOOOOOOOOOOO\\OOOOOOOOOOOOOOOO\\
a) OOOOOOOOOOOOO\\
b) OOOOOOOOOOOOO\\
c) OOOOOOOOOOOOO\\
d) OOOOOOOOOOOOO
\par OOOOOOOOOOOOOOOO\\OOOOOOOOOOOOOOOO
\par OOOOOOOOOOOOOOOO
\end{document}

enter image description here

4
  • Beat me to it by one minute. :-(
    – 1010011010
    Commented Oct 20, 2014 at 10:19
  • @cgnieder Now that's looking great! I'm sure this is the way to do it (never thought to use/reverse \parskip) - it looks right and coming from the package author... I'll have to test this in my complicated and over_nested code and see what happens (I suspect it will be ok). One note though (same thing in my code) - when the task reaches "m", the m character being too wide for the space (I presume), I get a log error "bad box" ... "Overfull \hbox (x pt) in paragraph".
    – alwaysask
    Commented Oct 20, 2014 at 10:46
  • Well, you can always increase the label width
    – cgnieder
    Commented Oct 20, 2014 at 11:03
  • @cgnieder I tried the other day, no joy. Tried label alignment, no good result. I will have to try again though, please don't mind it for now. Back to Q. I tried your settings in my code (where all the tasks are math inline equations and where "Part 2" is another question environment). Didn't work as expected (perhaps I have another parskip mod somewhere - I need to check) but I removed the after-skip tweak and everything fell into place very nice. The big clue in your answer was to reverse the parskip. Now the pagebrakes work as they should. Thank you!
    – alwaysask
    Commented Oct 20, 2014 at 11:28

You must log in to answer this question.

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