# Horizontal enumitem, with images?

I'd like to make a horizontal list with 4 items, each being a picture of square side and roughly 0.4\linewidth wide. I tried to use inline enumitem, but the image keep going to next rows instead of the same row. I have code looking like this:

\documentclass{article}
\usepackage[inline]{enumitem}
\begin{document}
\begin{enumitem*}
\item \includegraphics[width=0.4\textwidth]{img1}
\item \includegraphics[width=0.4\textwidth]{img2}
\item \includegraphics[width=0.4\textwidth]{img3}
\item \includegraphics[width=0.4\textwidth]{img4}
\end{enumitem*}
\end{document}

• What does 4 x 0.4\linewidth give you (plus the enumerations)? Does that exceed the current \linewidth?
– Werner
Jan 6 '18 at 16:46
• I think you'd better use a package likesubcaption (subfigure environment) or floatrow (subfloatrow environment). Or even the tasks environment: the figures would be aligned in columns. Jan 6 '18 at 16:52
• I hope your real code is better. The name of the environment is enumerate* not enumitem*. Also you are not loading graphicx. Jan 6 '18 at 16:53
• I'd like the images to float automatically, so 4 0.4\textwidth would order the images in 2 rows of 2 each. Jan 6 '18 at 17:28

It's not clear what you really want to achieve, a numbered list of figures, four subfigures with captions, or just four horizontal images. But, the sum of widths exceeds a whole \textwidth, so you need to reduce it and there is no environment named enumitem*, choose enumerate or itemize* instead.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[inline]{enumitem}
\begin{document}
\begin{itemize*}[label={}]
\item \includegraphics[width=0.22\textwidth]{img1}
\item \includegraphics[width=0.22\textwidth]{img2}
\item \includegraphics[width=0.22\textwidth]{img3}
\item \includegraphics[width=0.22\textwidth]{img4}
\end{itemize*}
\end{document}