I'm using moderncv and I want to add a caption to an inserted graphic. I'm currently using this code
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{fixed_button_settings.png}
\captionof{figure}{Some figure}
\end{minipage}
and this is the result
For further notice, this line of code
\captionof{figure}{Some figure}
results in an error: Package caption Error: No float type 'figure' defined.
I have added this in the main.tex preamble
\usepackage{float}
\usepackage{caption}
What should I do to make the caption appear as: "Figur 1: Some figure"? ("Figur" is not a typo, it's Swedish.)
Best Answer
Your problem is that class
moderncv
has no floating environmentfigure
implemented. So you have two possibilities:figure
into an own local new classmymoderncv.cls
orfigure
and make it by your own. You can useminipage
, and write the heading by your own, because in a cv you need no list of figures, I guess?A solution for point 2 could be (I used the image from package
mwe
, that must be installed, but must not be loaded):with the result: