Graphics, Figures & Tablesmoderncv | Add a Photo to a CV

Information and discussion about graphics, figures & tables in LaTeX documents.
Pixer75
Posts: 13
Joined: Tue Mar 15, 2011 3:26 pm

moderncv | Add a Photo to a CV

Post by Pixer75 »

Hi there.

I am not exactly sure my question belongs to this topic, but I couldn't find anything more appropriate. I apologize in advance if my question is misplaced.

I am getting acquainted with the class moderncv. I found a template on the web which I am using. I would like to add my photograph to the file, but I get an error. I am quoting my file preamble followed by the mistake I get:

Code: Select all

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}              
\usepackage[utf8]{inputenc}                  
\usepackage[T1]{fontenc}
\usepackage[scale=0.8]{geometry}

\firstname{name}
\familyname{lastname}
\address{address}{postcode}    
\mobile{mobile}                   
\phone{landline}                     
\email{email}                     
\photo[64pt][0.4pt]{picture}
\begin{document}
The error message I get is "missing \begin{document}" and then the line starting with the \photo command. I have tried changing the photo format from .jpg to .pdf, to no avail. It doesn't seem to be recognizing the command. (btw, it doesn't recognize the command \homepage either, and both are supposed to work). Any clue?

Thank you,
Last edited by Pixer75 on Thu Nov 17, 2011 6:46 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

moderncv | Add a Photo to a CV

Post by localghost »

Please get used to always providing a minimal example which is compilable as is. Otherwise specific help is nearly impossible. Furthermore it can't do any harm to echo the exact error message or to attach the complete log file by upload to the forum server.


Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Pixer75
Posts: 13
Joined: Tue Mar 15, 2011 3:26 pm

moderncv | Add a Photo to a CV

Post by Pixer75 »

Sorry for not providing the minimal example. It is here:

Code: Select all

\documentclass[11pt,a4paper]{moderncv}

\moderncvtheme[blue]{classic}                  

\usepackage[utf8]{inputenc}                   
\usepackage[T1]{fontenc}
\usepackage[scale=0.8]{geometry}
\firstname{Name}
\familyname{Lastname}
\address{Address}{postcode}  
 \mobile{mobile}                    
\phone{landline}                      
\email{email}                      
\photo[64pt][0.4pt]{calvin}       

\begin{document}
\maketitle

\end{document}
Calvin is a picture (.jpg). As I mentioned in my first post, I have used several formats none of which works.

The error is:
.Try.tx:22 LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX companion for explanation.
Type H <return> for immediate help.
...
l.18 \photo[64pt][0.4pt]{calvin}
If I remove the line
\photo[64pt][0.4pt]{calvin}


the file compiles without problem.

Thank you.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

moderncv | Add a Photo to a CV

Post by localghost »

Add the \listfiles command as very first line to your example, start a run and attach the corresponding log file to your next post by upload to the forum server.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Pixer75
Posts: 13
Joined: Tue Mar 15, 2011 3:26 pm

Re: moderncv | Add a Photo to a CV

Post by Pixer75 »

I am attaching the .log file after having added the line \listfiles at the beginning of my example.

Thanks again.
Attachments
Try.log
(20 KiB) Downloaded 866 times
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

moderncv | Add a Photo to a CV

Post by mas »

Your example works fine if you replace the following line

Code: Select all

\photo[64pt][0.4pt]{calvin}
by

Code: Select all

\photo[64pt]{calvin}
Regards.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
Pixer75
Posts: 13
Joined: Tue Mar 15, 2011 3:26 pm

Re: moderncv | Add a Photo to a CV

Post by Pixer75 »

Indeed, it works.

Thank you!
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

moderncv | Add a Photo to a CV

Post by localghost »

Pixer75 wrote:I am attaching the .log file after having added the line \listfiles at the beginning of my example.

Thanks again.
The template you've found is for the current version 0.13.1 of the moderncv class. Your version is 0.7, thus you cannot compile this code. So just update your TeX system or try the proposed alternative.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Pixer75
Posts: 13
Joined: Tue Mar 15, 2011 3:26 pm

Re: moderncv | Add a Photo to a CV

Post by Pixer75 »

Although the previous answer provided a solution to my problem, I wanted to update the moderncv package. Upadating the TeX was not enough. I downloaded a new version (2006-2011) and (manually) replaced the old files with the new.

Although in the end I manage to generate my .pdf, there are some issues which can be seen in the log file I am ataching to this post


Thank you.
Attachments
Prueba.log
(33.6 KiB) Downloaded 589 times
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

moderncv | Add a Photo to a CV

Post by localghost »

Pixer75 wrote:[…] Although in the end I manage to generate my .pdf, there are some issues which can be seen in the log file I am ataching to this post. […]
There are no real issues except for some warnings. Can you elaborate what you mean?
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply