Document Classesmodencv | No 'figure' Enviroment available

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
mathfeel
Posts: 11
Joined: Fri Jun 13, 2008 1:17 pm

modencv | No 'figure' Enviroment available

Post by mathfeel »

I try to insert a figure to a moderncv document using:

Code: Select all

\usepackage{graphics}
...
\begin{figure}[tb]
...
\end{figure}
and got this error:

Code: Select all

! LaTeX Error: Environment figure undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.142 \begin{figure}
                    [htb]
I thought figure is defined in graphicx, but I guessed wrong. Anyone know how to use figure in this and caption in this class?
Last edited by mathfeel on Sat Aug 20, 2011 3:21 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

modencv | No 'figure' Enviroment available

Post by sommerfee »

mathfeel wrote:I thought figure is defined in graphicx
No, it is defined in the document class.
Anyone know how to use figure in this and caption in this class?
You can try loading the float or caption package, and define it for yourself using \newfloat resp. \DeclareCaptionType. (No idea if this actually works.) But I doubt that it's a good idea having floating environments in a CV...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

modencv | No 'figure' Enviroment available

Post by Stefan Kottwitz »

Since I guess you don't need floating, I recommend using the command \captionof of the caption package for getting captions, for example:

Code: Select all

\usepackage[margin=10pt,font=small,labelfont=bf]{caption}
...
\begin{minipage}{.5\linewidth}
  \centering
  \includegraphics{filename}
  \captionof{figure}{your caption}
\end{minipage}
Stefan
LaTeX.org admin
mathfeel
Posts: 11
Joined: Fri Jun 13, 2008 1:17 pm

Re: modencv | No 'figure' Enviroment available

Post by mathfeel »

Thanks! Guys.
Post Reply