2

How I can use todonotes package to insert figure in the margin? I want 3 parameters:

  1. The name of the figure,
  2. the width of the figure,
  3. the caption (perhaps with \tiny or \footnote fonts).
1

2 Answers 2

2

As far I now, there are not an easy method to include a figure in a to do note, but there are at least two easy alternatives: the tufte-handout class and/or a \marginpar with the aid of the caption package. A minimal working example (if you have also an image with the filename gravatar.png):

\documentclass[justified]{tufte-handout}
\usepackage{lipsum} % for dummy text
\usepackage{graphicx}
\usepackage{caption}

\begin{document}
\begin{marginfigure}
\centering
\includegraphics[width=\textwidth]{gravatar.png}
\caption{A tufte margin figure}
\label{One}
\end{marginfigure}

See figure \ref{One} at margin. \lipsum[1] 

\lipsum[2] 

\marginpar{
\centering
\includegraphics[width=.45\textwidth]{gravatar.png}
\captionof{figure}{\label{Two}A marginpar figure. 
Note that text width is in another scale here.}
}

\lipsum[3] 
\end{document}
1
  • Thanks. I like the second solution (\marginpar): she works almost fine with book class. Any solution with the todonotes package? Jan 21, 2013 at 4:27
1

Apparently, all you need to do is protect the \includegraphics macro. The following MWE works for me.

\documentclass{article}
\usepackage{todonotes}
\newcommand{\todoFig}[3]{
  \todo[noline]{
    \protect\includegraphics[width=#2]{#1}\\
    \tiny #3
  }
}
\begin{document}
\todoFig{image.png}{1cm}{Small caption}
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .