0

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}
  • 3
    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
  • 1
    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. – Bernard Jan 6 '18 at 16:52
  • 1
    I hope your real code is better. The name of the environment is enumerate* not enumitem*. Also you are not loading graphicx. – Ulrike Fischer 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. – user2341726 Jan 6 '18 at 17:28
1

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.