I'm running into a problem when using cleveref to refer to marginfigures in memoir. The following code illustrates the problem (apologies for the somewhat long preamble, but I need the space in the margin to illustrate the problem):

%%% formatting
\setstocksize{29.7cm}{21.0cm} % A4 stock
\settrimmedsize{27.94cm}{21.0cm}{*} % 27.94cm = 11in
%%% clever referencing (should be loaded last)
  a^2 + b^2 = c^2
\Cref{eq:pyth} is known as Pythagoras' theorem. 
This should be a reference to figure 1, but it comes out as 
  x^2 + y^2 = r^2
  \left(\frac{x}{a}\right)^2 + \left(\frac{y}{b}\right)^2 = 1
\Cref{eq:circ} describes a circle, \cref{eq:ell} an ellipse. 
This should be a reference to figure 2, but it comes out as 

When you run this, the references to the figures turn out as references to the equations. Do I need to tell cleveref about the marginfigure environment in some way (I could not find anything in the newest manual) or is the marginfigure not supported yet by cleveref?

1 Answer 1


The problem is simply that you have the \label before the \caption. Put the \label last of the two, and it works fine. See e.g., Where to put the \label on a figure environment?

  • Thanks for putting me straight. This was an oversight on my part. I've been using memoir with sidecaption for so long that I completely forgot about that when I tried marginfigure. (In memoir's sidecaption environment, the label is specified as an optional argument.) Nov 26, 2011 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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