Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 ;)

share|improve this question
1  
Remove the figure environment. You'll probably have to use \captionof from the caption package. –  qubyte Feb 29 '12 at 11:36
    
the "click ..." doesn't really seem like a caption to me, just item text. if you treat it that way, then also removing the figure environment should give you exactly what you want. –  barbara beeton Feb 29 '12 at 13:45

3 Answers 3

up vote 12 down vote accepted

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

share|improve this answer
    
Brilliant - this does exactly what I need - thank you so much for such a speedy answer! –  GodEater Feb 29 '12 at 12:05
    
Would it still be possible to use a caption? The little text under the \medskip works as a caption if you use \centered. But if caption is used you get the good old "caption outside float" error. –  timss Sep 16 '13 at 20:29
    
@timss I don't think this kind of pictures needs a caption. If you really want it, use \begin{minipage}[t]{<dimen>}...\end{minipage} around the adjusted \includegraphics and add \captionof{figure}{...} (requires either the package caption or capt-of). –  egreg Sep 16 '13 at 20:32
    
@egreg I'm new to LaTeX and thought that maybe a \caption{} was preferred as it's usually the standard for adding a caption to a figure of a table. In my case I want my figure to be centered and it works just fine using your example, so in that case there's no need to use a caption? If so when should I use a caption? –  timss Sep 16 '13 at 22:42
    
@timss This is only my opinion: any picture that has to stay where we want it (as opposed to the figure environment that places it where it's typographically better) doesn't need a caption, because it's simply part of the text. –  egreg Sep 16 '13 at 22:43

Here is a minimal example to show one way to do this. Using the caption package allows you to attach captions to non-floating environments. You can also use the capt-of package for equivalent results.

\documentclass{article}
\usepackage{caption}
\usepackage[demo]{graphicx}

\begin{document}

\begin{itemize}
    \item hello
    \item \parbox{\linewidth}{\centering
        \includegraphics[width=2in, height=1in]{}\\
        \captionof{figure}{Some caption stuff.}
    }
    \item goodbye
\end{itemize}

\end{document}

enter image description here

However, from your image it seems that you're not interested in labelling your captions. If this is the case, then you must use the caption package rather than capt-of, as caption provides the \captionof* command, which removes the label.

share|improve this answer
    
I'll have a play with this approach as well - thanks for the quick answer! –  GodEater Feb 29 '12 at 12:06
    
No problem. I just noticed that I used itemize here instead of enumerate. It'll still work though. :) –  qubyte Feb 29 '12 at 12:10

Depending on how committed you are to the idea of an enumerated list, you might try some alternatives. Here's one using the tufte-handout class, which allows a lot of space for readers to write notes in the margins. The custom \screenshot command may help when you have lots of images you want to keep consistent:

enter image description here

\documentclass{tufte-handout}
\usepackage{graphicx}

...

\newcommand{\button}[1]{\emph{#1}}
\newcommand{\screenshot}[2]{
\begin{figure}
\includegraphics[scale=0.25]{#1}
\caption{#2 \label{fig:#1}}
\end{figure}
}

....

Click the Windows \button{Start} button in the bottom left corner of your screen, then
click the \button{All Programs} menu.
Click the \button{Windows Live Movie Maker} shortcut near the top of the
\button{All Programs} menu (above any program folders).
See Figure~\ref{fig:start-menu} for an example.
\screenshot{start-menu}{Windows Start Menu}
share|improve this answer
    
This is an interesting approach - but I don't think it'll work well with the size of the screenshots I've got to include. The MSVC++ one I used in the example is bar far the smallest one I have, most of the rest of them are quite a bit larger. –  GodEater Mar 1 '12 at 10:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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