# Implementing marginfigure

sorry for the absolutely beginner question here.

I've been looking at the tufte-latex class, specifically the tufte sample book. It makes use of marginfigures, which I believe are provided by the sidenotes package.

As you can see in the book, there is a marginfigure implemented with the code:

\begin{marginfigure}
\includegraphics{file}
\caption{caption}
\end{marginfigure}


However, in my custom class file I use the sidenotes package using

\usepackage{sidenotes}


It should be noted that this works fine, I can use normal sidenotes without any problems.

However, when I go to put in a marginfigure using the code above I get the following error:

Environment marginfigure undefined.
\begin{document} ended by \end{marginfigure}


How can this be fixed so that my marginfigure implements properly. Sorry for the basic question, but I hadn't found any other fixes.

EDIT 1: Those are the only two errors I have.

All I do is import the package in my class file, then in the document I try to implement marginfigure, but receive the errors above.

Do I need to use any other packages alongside it?

EDIT 2:MWE

\documentclass{article}
\usepackage{sidenotes}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{marginfigure}
\includegraphics{marginfigure}
\end{marginfigure}
\end{document}

• According to the sidenotes package documentation, the marginfigure example you provided should work fine. The error you provided is usually preceded by other errors that are more indicative of the cause of the problem. Can you provide us a short document that demonstrates this error? – godbyk May 20 '13 at 0:46
• @godbyk I've just edited the question, but I don't think its what you really want. Sorry I'm new, but could you explain in more detail what you need? – akuritsu May 20 '13 at 1:16
• Please add minimal working example (MWE) starting with \documentclass{...} and ending with \end{document} which reproduces the error/s. In this way documentclass used by you will also be known to others. – texenthusiast May 20 '13 at 1:35
• It's hard to tell without a complete MWE... here's a place you can start, which contains the relevant code for marginfigure Margin floats and hyperlinks – cmhughes May 20 '13 at 2:52
• @akuritsu If you include \listfiles before \begin{document} and compile you can see the list of packages and its version used. If my guess is right your's would be sidenotes.sty 2011/11/29 v0.81 but your MWE compiles well with sidenotes.sty 2012/11/09 v0.92. Hence you may need an update to your TeX distribution ? or use latest version of sidenotes from ctan. Reason: marginfigure feature is added in sidenotes from v0.90 as seen in page 6 of Change History – texenthusiast May 20 '13 at 3:58

If you include \listfiles before \begin{document} and compile you can see the list of packages and its version shown below.
 *File List*

you might be using an old version of sidenotes.sty 2011/11/29 v0.81 which causes the error, because marginfigure feature is added in sidenotes from v0.90 as seen in page 6 of Change History. Hence your MWE compiles well with sidenotes.sty 2012/11/09 v0.92.