[Tex/LaTex] What’s the best way to include graphics in an enumerated list

graphicslists

I'm currently putting together an installation document for some software at work, and I decided that now was as good a time as any to try to ditch the endless frustration that is Microsoft Word, and try and do it using TeX/XeLaTeX.

I'm trying to keep the same feel of previous documents that my team has produced for similar installations, and this means the document is going to be largely composed sections which are basic "1) Do this", "2) now do this" sections. Not terribly enthralling, but it's sort of the standard. The standard also calls for lots of frequent screen shots of the installer, which I've been trying to include directly into an enumerate list, which is how I approached the "1), 2)" format described above.

The problem with LaTeX's usual approach to including figures means that they can end up some way away from the text which is referencing them. This might be fine in an academic paper, but it might be a bridge too far for my colleagues – so I've been trying to include the graphics directly into the list. My results thus far are not perfect.

Here's a snippet of the XeLaTeX:

\begin{enumerate}
    \item Navigate to ``d:\textbackslash boringwindowspath''
    \item Run Setupee.exe
    \begin{figure}[h]
        \item 
            \caption*{Click ``Yes'' to install MS Visual C++ 2008 redistributables.}                
            \adjustbox{scale=0.6,valign=t,center=10cm}{
                \includegraphics{./Images/screenshot01.png}
        }
    \end{figure}
\end{enumerate}

This produces something like this :
Sample PDF output

As you can see, the 3rd item is shoved a ways out to the left, and I can't work out why. I've scaled the image itself so it doesn't take up the whole page width – so what's going on here?

Or is my whole approach wrong, and there's some dead easy way to do what I'm trying to achieve?

Answers gratefully received 😉

Best Answer

I'd use a minipage:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{adjustbox}
\begin{document}
\begin{enumerate}
    \item Navigate to ``\texttt{d:\textbackslash boringwindowspath}''
    \item Run \texttt{Setupee.exe}
    \item \begin{minipage}[t]{\linewidth}
          \raggedright
          \adjustbox{valign=t}{%
            \includegraphics[width=.8\linewidth]{./Images/screenshot01.png}%
          }

          \medskip
          Click ``Yes'' to install MS Visual C++ 2008 redistributables.
    \end{minipage}
\end{enumerate}
\end{document}

enter image description here

Related Question