# Layout problem when mixing tasks and enumitem

There seems to be a layout issue when attempting to incorporate a tasks environment directly within an enumerate environment, when no text is specified between the \item (enumerate) and the beginning of the tasks.

Is there a way to circumvent this issue without having to resort to the use of \text{} and a negative \vspace*?

Notice that the same thing happens without the use of the enumitem package. The tasks documentation states that one cannot nest two (or more) tasks environments, which is why I'm nesting a tasks within an enumerate.

MWE:

\documentclass[letterpaper, 11pt]{article}

\usepackage{amsmath}
\usepackage{enumitem}

\begin{document}

\def\sample{Boring and meaningless text that is long enough to show layout issues.}

\begin{enumerate}
\item Test A
\item % No text here, before the tasks. CAUSES LAYOUT ISSUE!!!
\task Subtest B-1 \; $$\leftarrow$$ \; \textbf{PROBLEM HERE!!!}
\item Test C
\begin{tasks}(2)%  %% Use two columns instead of the default 3 defined above, for no reason
\end{enumerate}

\end{document}


Output:

# EDIT - 2015-05-30

The reason why the negative \vspace isn't a practical idea is because when the layout is such that the problematic \item sits at the bottom of the page, it generates an abnormal page break.

Illustration:

\documentclass[letterpaper, 11pt]{article}

\usepackage{amsmath}
%\usepackage{enumitem}

\begin{document}

\def\sample{Boring and meaningless text that is long enough to show layout issues.}

\begin{enumerate}
\item Test A
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \sample
\item \mbox{}\par\vspace{\dimexpr-\baselineskip-\parsep-\itemsep-\partopsep}% No text here, before the tasks. CAUSES LAYOUT ISSUE!!!
\task Subtest B-1 \; $$\leftarrow$$ \; \textbf{PROBLEM HERE!!!}
\item Test C
\begin{tasks}(2)%  %% Use two columns instead of the default 3 defined above, for no reason
\end{enumerate}

\end{document}


Output:

Just correct the space vertically after inserting a blank entry:

\documentclass{article}

\begin{document}

\def\sample{Boring and meaningless text that is long enough to show layout issues.}

\begin{enumerate}
\item Test A
\item \mbox{} \par\vspace{\dimexpr-\baselineskip-\parsep-\itemsep-\partopsep}
\item Test C
\begin{tasks}(2)%  %% Use two columns instead of the default 3 defined above, for no reason

• thanks for your answer. Please see my updated question above related to the use of the negative \vspace. Any ideas to circumvent this problem? – feculededentier May 30 '15 at 15:39
• For the moment, using \mbox{}\par\vspace{\dimexpr-\baselineskip-\parsep-\itemsep-\partopsep-0.1mm} (notice the extra -0.1mm) seems to resolve the abnormal page break without any obvious consequences. It is, of course, a less than optimal temporary hack... – feculededentier May 31 '15 at 0:35