# How to make all figures float on the outer margins of two-side document?

I want to make a double-sided problem booklet that contains several questions. Each question has a distinct number and may have zero or more figures. Each figure has a caption and floats on the outer margin. The following figure illustrates what I want to have.

Is there a document class or package to do this out of the box? If the answer is NO, then how to create such a problem booklet?

-
Marginpar can be a "floating object" with some packages/customizasiont. I can't look into that now as I have to leave, but this is a consideration. –  yo' Apr 24 '12 at 14:09
tufte class! –  Harish Kumar Apr 24 '12 at 14:38

As tohecz mentions in his comment, you can use \marginpar for your purpose; using \captionof (from the caption or capt-of packages) you can provide the captions.

\documentclass[twoside]{article}
\usepackage[outermargin=2cm,innermargin=5cm,marginparwidth=3cm,marginparsep=20pt]{geometry}
\usepackage[demo]{graphicx}
\usepackage{marginnote}
\usepackage{caption}
\usepackage{lipsum}

\newcommand\MarginFig[4][width=\marginparwidth]{%
\marginpar{\includegraphics[#1]{#2}
\captionof{figure}{#3}
\label{#4}}
}

\reversemarginpar

\begin{document}
%\layout
text\MarginFig{name1}{description for figure one}{fig:test1} \lipsum[1-2]\MarginFig{name2}{description for figure one}{fig:test2}
\lipsum[1]\MarginFig[height=7cm,width=\marginparwidth]{name3}{description for figure three}{fig:test3}\lipsum[1-3]
text\MarginFig[height=7cm,width=\marginparwidth]{name4}{description for figure four}{fig:test4} \lipsum[1]\MarginFig{name5}{description for figure five}{fig:test5}\lipsum[2]\MarginFig{name6}{description for figure six}{fig:test6}\lipsum[1-3]

\end{document}


In the code above I used the \reversemarginpar command and the geometry package to customize the page layout in order to obtain the result shown in the original question (images in the left margin for odd-numbered pages and images in the right margin for even-numbered pages). Those settings are, of course, optional.

-
I think I don't need \reversemarginpar to meet the requirements in the question, i.e., all figures float on the outer margin. –  kiss my armpit Apr 24 '12 at 15:55
@Moderator: OK; I wasn't sure if you needed it or not since your image suggested using the leftmargin for odd pages and the rightmargin for even pages. –  Gonzalo Medina Apr 24 '12 at 15:57
Sorry, is marginnote` necessary in this case? –  kiss my armpit Sep 27 '13 at 6:20