Geometry margin causing tasks alignment issue
One should reset \@rightskip
. Imho the tasks package should do it. So make a bug report:
\documentclass[12pt]{article}
\usepackage{amsmath,geometry}
\usepackage{tasks}
\geometry{a4paper, margin=2cm}
\NewTasks[counter-format={tsk[a])}]{problems}[\item](4)
\begin{document}\raggedright
\begin{enumerate}
\item Prove the following:
\begingroup
\makeatletter
\@rightskip=0pt
\begin{problems}(4)
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\end{problems}
\endgroup
\end{enumerate}
\end{document}
Could a solution with \RaggedRight
from ragged2e
package be acceptable?
EDIT: Ulrike has already given the perfect answer but I'd like to add TeXnician's suggestion (\usepackage[none]{hyphenat}
) to my original answer:
\documentclass[12pt]{article}
\usepackage[none]{hyphenat}
\usepackage{amsmath,geometry,tasks}
\geometry{a4paper, margin=2cm}
\NewTasks[counter-format={tsk[a])}]{problems}[\item](4)
\usepackage{ragged2e}
\usepackage{mwe}
\begin{document}\RaggedRight
\blindtext
\begin{enumerate}
\item \blindtext Prove the following:
\begin{problems}(4)
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\end{problems}
\end{enumerate}
\blindtext
\end{document}
Moreover, as egreg suggested to me in chat, another simple solution could be justifying only the problems
environment:
\documentclass[12pt]{article}
\usepackage{amsmath,geometry,tasks}
\geometry{a4paper, margin=2cm}
\NewTasks[counter-format={tsk[a])}]{problems}[\item](4)
\usepackage{ragged2e}
\usepackage{mwe}
\begin{document}\raggedright
\blindtext
\begin{enumerate}
\item \blindtext Prove the following:
\begin{justify}
\begin{problems}(4)
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\item $x$
\end{problems}
\end{justify}
\end{enumerate}
\blindtext
\end{document}
The output is more or less the same as before: