Figure in moderncv

Asked by Flo__

Hi,

I would like to add a Figure in my moderncv document. It appears that it's not possible, probably due to the definition of the moderncv class. However, I noticed that there is some packages to add caption in non-floating environment, like "caption" or "capt-of". Unfortunately, these packages seems to not work in the moderncv class (error "Package caption Error: No float type 'figure' defined \captionof{figure}{". The same code work if the classical article class is loaded.

best,

Question information

Language:
English Edit question
Status:
Answered
For:
moderncv Edit question
Assignee:
Xavier Danaux Edit question
Last query:
Last reply:
Revision history for this message
Xavier Danaux (xdanaux) said :
#1

Hi Flo,

The figure environment is simply not defined in moderncv. You can define it your self if you need it (\newenvironment).

FYI, the figure definition in the article class is roughly the following:
\makeatletter
\renewcommand \thefigure {\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure\nobreakspace\thefigure}
\newenvironment{figure}{\@float{figure}}{\end@float}
\makeatother

Kind regards,

Can you help with this problem?

Provide an answer of your own, or ask Flo__ for more information if necessary.

To post a message you must log in.