tasks
tasks copied to clipboard
An other enviroment in tasks messes with spaces
Having an environment like align*
or even your own blank in a separate line of the task, the next task moves away an additional line.
\documentclass{article}
\usepackage{amsmath}
\usepackage{xsim}
\usepackage{tasks}
\begin{document}
\begin{tasks}
\task normal Space after that
\task HUGE gap after \begin{align*}
3
\end{align*}
\task works fine with blank in line \blank{a}
\task filler
\task messes with blank in separate line
\blank{line}
\task filler
\end{tasks}
\end{document}
Turning the debug mode on I don't see anything unexpected to be honest:
\documentclass{article}
\usepackage{amsmath}
\usepackage{xsim}
\usepackage{tasks}
\settasks{debug}
\begin{document}
\begin{tasks}
\task normal Space after that
\task HUGE gap after
\begin{align*}
3
\end{align*}
\task works fine with blank in line \blank{a}
\task filler
\task messes with blank in separate line
\blank{line}
\task filler
\end{tasks}
\end{document}
Maybe you want to adapt the spacing around display math? See here for example: https://tex.stackexchange.com/q/69662/
@cgnieder to me it looks as if there is an extra empty line after the display containing the "3". You can prove that to yourself simply by doing \newpage repeat the task env and add "a line of text" after the \end{align*}. Then nothing changes from page 1 to 2 only that text appears in the place instead of the empty line
@FrankMittelbach I must admit that I haven't looked closely, yet...
always easier to look at it from the outside :-) Clemens
The issue seems to be the strut in
\vcoffin_set:Nnn \l__tasks_tmpa_coffin
{ \l__tasks_item_width_dim }
{ \__tasks_setup: #2 {#3} \mode_if_horizontal:T { \strut } }
For the time being I suggest the following usage: if the display math is the last object in an item add a \par
at the end to be sure to leave the horizontal mode. And in the example the starred \blank*{line}
seems to be the better choice:
\documentclass{article}
\usepackage{amsmath}
\usepackage{xsim}
\usepackage{tasks}
\settasks{debug}
\begin{document}
\begin{tasks}
\task normal Space after that
\task HUGE gap after
\begin{align*}
3
\end{align*}\par
\task works fine with blank in line \blank{a}
\task filler
\task messes with blank in separate line
\blank*{line}
\task filler
\end{tasks}
\end{document}