# Mixing tasks and graphicx packages

I'm trying to setup what you can see in the following image, essentially an image side by side with a tasks environment. The image could be inside or outside the tasks environment, I don't care as long as it works.

(I edited this image with MSPaint)

I've been using tasks throughout my document and I would prefer not to change this package.

In this next code I'm posting a few of my attempts to replicate my target, they've all failed in one way or another as it's explained in the code.

\documentclass[letterpaper,12pt]{book}

\usepackage[margin=1.1in]{geometry}
\setlength{\parindent}{0pt}

%\usepackage{lipsum}

\usepackage{graphicx}

\usepackage{multicol}

\begin{document}

%Doesn't work, looks almost right but images are not shown the preferred way. Code is a bit dirty too.
\task[] $P=(0,2)$
\task*(2)[] \task*(2)[] $a:\, y=x$
\task*(2)[] \task*(2)[] $b:\, y=x+2$
\task*(2)[] \task*(2)[] $c:\, y=-x+2$
\task[] $P=(0,2)$
\task*(2)[] \task*(2)[] $a:\, y=x$
\task*(2)[] \task*(2)[] $b:\, y=x+2$
\task*(2)[] \task*(2)[] $c:\, y=-x+2$

\newpage

%Doesn't work, numbers should go on the left, it also means each example needs its own tasks and a multicols environment.
\begin{multicols}{2}
\includegraphics[width=\linewidth]{dummy}
\columnbreak
\task[] $P=(0,2)$
\task![] $a:\, y=x$
\task![] $b:\, y=x+2$
\task![] $c:\, y=-x+2$
\end{multicols}

\begin{multicols}{2}
\includegraphics[width=\linewidth]{dummy}
\columnbreak
\task[] $P=(0,2)$
\task![] $a:\, y=x$
\task![] $b:\, y=x+2$
\task![] $c:\, y=-x+2$
\end{multicols}

\newpage

%Doesn't work, taskes piled at the top instead of aligning with their corresponding image. Also, numbers should go on the left.
\begin{multicols}{2}
\includegraphics[width=\linewidth]{dummy}
\includegraphics[width=\linewidth]{dummy}
\columnbreak
\task[] $P=(0,2)$
\task![] $a:\, y=x$
\task![] $b:\, y=x+2$
\task![] $c:\, y=-x+2$
\task[] $P=(0,2)$
\task![] $a:\, y=x$
\task![] $b:\, y=x+2$
\task![] $c:\, y=-x+2$
\end{multicols}

\end{document}


How can I get my intended result?

Using tasks when you don't want the list to be numbered horizontally is not really the best option, but anyway. Starting from your first example:

• Use \usepackage[export]{adjustbox} and then add valign=t to the \includegraphics options in order to get the enumeration label aligned with the top-left corner of the figure. Note that adjustbox already loads graphicx.

• For the second column use just one \task command and align the equations in other easier way, e.g. with the aligned environment (requires the amsmath package)

MWE:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\task[] \begin{aligned}[t] &{\rm Equations}\\ & a:\, y=x\\ &b:\, y=x+2\\ &c:\, y=-x+2 \end{aligned}

\task[] $P=(0,2)$

\end{document}


As I said, using tasks for this is overkilling. With an enumerate environment and some \hfill to ensure equal spacing between columns would suffice:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{enumerate}
\item \includegraphics[width=0.5\linewidth,valign=t]{example-image-a}
\hfill
\begin{aligned}[t] &{\rm Equations}\\ & a:\, y=x\\ &b:\, y=x+2\\ &c:\, y=-x+2 \end{aligned}
\hfill
$P=(0,2)$
\hfill

\item \ldots
\end{enumerate}
\end{document}