LaTeX forum ⇒ Document Classes\documentclass{moderncv}

Information and discussion about specific document classes and how to create your own document classes.
peaches2165
Posts: 25
Joined: Wed Oct 22, 2008 5:03 pm

\documentclass{moderncv}

Postby peaches2165 » Wed May 21, 2014 5:23 pm

Hi,

I am trying to run \documentclass{moderncv}
I am having some trouble with {moderncv}

My template is

  1. \documentclass[11pt,letterpaper,oneside,sans]{moderncv}
  2. %{{{1\let\fax\undefined%To avoid marvosym error
  3. \begin{document}
  4. \usepackage{marvosym}
  5. \usepackage[normalem]{ulem}
  6. \usepackage{amsfonts,amsmath,eqparbox,multicol,enumerate,calc,paralist}
  7. \usepackage[initials,nobysame]{amsrefs}% Load after hyperref
  8. \hbadness=10000
  9.  
  10. % and some other commands ...
  11.  
  12. \usepackage[margin=1.5cm]{geometry}
  13. \AtBeginDocument{\setlength{\maketitlenamewidth}{6cm}}
  14.  
  15. \AtBeginDocument{\setlength{\maketitlenamewidth}{6cm}}


I know next to nothing about the {moderncv} package and I am getting the error

  1. \RequirePackage{moderncvstyle#1}}


How does one fix this?

Any help will be appreciated.

Thanks,
Peaches
Last edited by cgnieder on Sun Jun 22, 2014 1:15 pm, edited 1 time in total.
Reason: added code markup

Tags:

alainremillard
Posts: 45
Joined: Fri Mar 16, 2012 8:22 pm

Postby alainremillard » Wed May 21, 2014 6:09 pm

Just to start with a few pointers, first use the "code" button when including some code. It will be a lot easier to read. And please include an compilable Infominimal working example instead of bit of code.

Second, all \includepackage{} should be before the \begin{document}.

You can find a moderncv template at http://www.latextemplates.com/template/moderncv-cv-and-cover-letter

If it doesn't help you, please post a compilable example, we'll see what we can do.

regards
alain rémillard

peaches2165
Posts: 25
Joined: Wed Oct 22, 2008 5:03 pm

Postby peaches2165 » Fri May 23, 2014 3:23 pm

Hi,

I am still having trouble with my file. I have listed my code below and hope I did it properly this time. I'm not sure if I am missing any additional files. I am using Ubuntu 10.04. Any help will be greatly appreciated.
This is my first time using {moderncv}.

This is the error message I receive:

  1. This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
  2. entering extended mode
  3. (./filename.tex
  4. LaTeX2e <2009/09/24>
  5. Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
  6. yphenation, loaded.
  7. (./moderncv.cls
  8. Document Class: moderncv 2013/04/29 v1.5.1 modern curriculum vitae and letter d
  9. ocument class
  10. (/usr/share/texmf-texlive/tex/latex/base/size11.clo)
  11.  
  12. ! LaTeX Error: Missing \begin{document}.
  13.  
  14. See the LaTeX manual or LaTeX Companion for explanation.
  15. Type H <return> for immediate help.
  16. ...
  17.  
  18. l.73 p
  19. ackages relying on it) defining the macro too)
  20.  
  21.  


  1. \documentclass[11pt,a4paper,sans]{moderncv}
  2. \moderncvstyle{casual}
  3. \moderncvcolor{blue}
  4. %\renewcommand{\familydefault}{\sfdefault}
  5. %\nopagenumbers{}
  6. % adjust the page margins
  7. \usepackage[scale=0.75]{geometry}
  8.  
  9.  
  10. \firstname{John}
  11. \familyname{Smith}
  12. \title{Professor}
  13. \address{University}{Department of \\
  14. \\city, state, zip}
  15. % for classic style
  16. \ifforweb\else
  17. \phone{}
  18. \email{smith@}
  19. %\include{package}{}
  20. \begin{document}
  21.  
  22. \makecvtitle
  23. %\nopagenumbers{}
  24. % uncomment to suppress automatic page numbering for CVs longer than one page
  25.  
  26.  
  27. %-------------------------------------------------------------------------------
  28. % content
  29. %------------------------------------------------------------------------------
  30. %\newlength{\descindent}
  31. %\setlength{\descindent}{2em} % Default indent for description lists.
  32. Change using \settowidth if needed
  33. %\newcommand{\descitem}[1]{\par\raggedright\hangindent=\descinden
  34. %t\hangafter=1\makebox[\descindent]{\emph{#1}\hfill}\ignorespaces}
  35.  
  36. \newcommand{\descitem}[1]{\par\raggedright\hangindent=\eqboxwidth{descindent}
  37. \hangafter=1\eqparbox{descindent}{\raggedright\hspace{2ex}\textrm{\textbullet}
  38. \hspace{.5ex}
  39. \emph{#1}\rule{2ex}{0pt}}\ignorespaces}
  40.  
  41. \newcommand{\talk}[3]{\cvitem[0.05em]{#1}{#2, \emph{#3.}} }
  42. %\newcommand{\talk}[4][\relax]{\cvitem[0.05em]{#2~\rlap{#1}
  43. %\phantom{Dec}}{#3, \emph{#4.}} }
  44.  
  45. \raggedbottom%}}}1
  46.  
  47.  
  48. %{{{1 Colors, title, etc.
  49. \definecolor{titlecolor}{gray}{0.05}
  50. \definecolor{addresscolor}{gray}{0.05}
  51. \definecolor{sectionrectanglecolor}{gray}{0.85}
  52. \definecolor{sectiontitlecolor}{gray}{0.0}
  53. \definecolor{subsectioncolor}{gray}{0.0}


  1. %\begin{document}
  2. %\begin{center}
  3. % {\bf CURRICULUM VITAE OF John Smith}
  4. %\end{center}
  5.  
  6. Short Statement
  7. Blah blah blah
  8.  
  9.  
  10. %%%%%%%%%%%%%%%%%%%%%%%
  11. %%%%%%%%%%%%%%%%%%%%%
  12.  
  13. \section{EDUCATION:}
  14. \cventry{1973}{High school studies}\\
  15. \cventry{July 1980}{MS}{University}\\
  16. \cventry{August 1985}{Doctor of Philosophy}{Unin}
  17.  
  18.  
  19.  
  20. \section{ LANGUAGES SPOKEN FLUENTLY:}
  21. \cventry{ English, French}
  22.  
  23. \section{HONOURS AND AWARDS:}
  24.  
  25. \cventry{Fullbright Fellowship}
  26.  
  27.  
  28. \section{POSITIONS:}
  29.  
  30. \cventry{1980--81: Teaching Assistant University of }\\
  31. \cventry{1981--85: Teaching Assistant at the University of }\\
  32. \cventry{1985--86: Professor in the University }\\
Last edited by cgnieder on Sun Jun 22, 2014 1:18 pm, edited 2 times in total.
Reason: added code markup

StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am

Postby StarValkyrie » Sat May 24, 2014 2:32 am

In the preamble section, above the "content" section, cut the lines for \begin{document} and \makecvtitle and paste them after the content section, then try to compile again.
Last edited by cgnieder on Sun Jun 22, 2014 1:19 pm, edited 1 time in total.
Reason: added inline code markup

alainremillard
Posts: 45
Joined: Fri Mar 16, 2012 8:22 pm

Postby alainremillard » Wed May 28, 2014 8:33 pm

I took the liberty to modify your code, here is a compilable example.

  1. \documentclass[11pt,a4paper,sans]{moderncv}
  2. \moderncvstyle{casual}
  3. \moderncvcolor{blue}
  4.  
  5. % adjust the page margins
  6. \usepackage[scale=0.75]{geometry}
  7.  
  8.  
  9. \firstname{John}
  10. \familyname{Smith}
  11. \title{Professor}
  12. \address{University}{Department of city, state, zip}
  13. \phone{}
  14. \email{smith@}
  15.  
  16.  
  17. %{{{1 Colors, title, etc.
  18. \definecolor{titlecolor}{gray}{0.05}
  19. \definecolor{addresscolor}{gray}{0.05}
  20. \definecolor{sectionrectanglecolor}{gray}{0.85}
  21. \definecolor{sectiontitlecolor}{gray}{0.0}
  22. \definecolor{subsectioncolor}{gray}{0.0}
  23.  
  24.  
  25.  
  26. \begin{document}
  27.  
  28. \makecvtitle
  29.  
  30. \section{EDUCATION:}
  31. \cventry{1973}{High school studies}{}{}{}{}
  32. \cventry{July 1980}{MS}{University}{}{}{}
  33. \cventry{August 1985}{Doctor of Philosophy}{Unin}{}{}{}
  34.  
  35.  
  36.  
  37. \section{ LANGUAGES SPOKEN FLUENTLY:}
  38. \cvlanguage{ English, French}{}{}
  39.  
  40. \section{HONOURS AND AWARDS:}
  41.  
  42. \cventry{}{Fullbright Fellowship}{}{}{}{}
  43.  
  44.  
  45. \section{POSITIONS:}
  46.  
  47. \cventry{1980--81}{Teaching Assistant}{University of }{}{}{}
  48. \cventry{1981--85}{Teaching Assistant}{University of }{}{}{}
  49. \cventry{1985--86}{Professor}{University }{}{}{}
  50.  
  51. \end{document}

Sadly there is no documentation for the package moderncv, but here a few things I notice about your code

First the newline \\ had to be remove in the address.
Second, \cventry take 6 arguemnts. Arguments 3 to 6 can be left empty, but the braces are needed.
  1. \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

Finaly, there is other commands, the list is not complete
  1. \cvitem{supervisors}{Supervisors}
  2. \cvitemwithcomment{Language 1}{Skill level}{Comment}
  3. \cvlanguage{french}{written and spoken}{}

Have a look at template.tex from
http://www.ctan.org/tex-archive/macros/latex/contrib/moderncv/examples
This is a complete example that show a lot of options.

I hope it help

Alain Rémillard

peaches2165
Posts: 25
Joined: Wed Oct 22, 2008 5:03 pm

Postby peaches2165 » Thu May 29, 2014 10:15 pm

Hi,

Thanks for the help! I've been working on the CV again. I'm able to compile but with some errors printing at the beginning. I'll wait until I have everything coded before I ask about this.

I now have two coding questions.

First the address is printing at the bottom of each page as a footnote. I don't know where to look to fix this.

Also I have over 100 pubs that need converted and unfortunately they are not coded in bibtex format. They are currently coded by begin{enumerate} with \items written by hand. Is there a quick way to convert this and do I keep using the \cventry to convert.

Thanks,

User avatar
Johannes_B
Site Moderator
Posts: 4100
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri May 30, 2014 9:00 am

I never used moderncv myself, and i really would like to help, but thinking about a problem without really knowing it is hard.

Please try to prepare a minimal working example, meaning code that just represents a minimal amount of code to reproduce the problem.

Concerning your publications: Often you can download the bibliographic information from the publishers homepage. Those can be saved in a proper database (textfile with the ending bib) and processed using biblatex and biber.
But if the entries are ok in the way they are put down now, i don't see a reason to change it.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

alainremillard
Posts: 45
Joined: Fri Mar 16, 2012 8:22 pm

Postby alainremillard » Fri May 30, 2014 5:00 pm

peaches2165 wrote:First the address is printing at the bottom of each page as a footnote. I don't know where to look to fix this.


To change this you have to change the \moderncvstyle{} at the beginning. Your is set to casual, there is also classic, banking and oldstyle. Those where found on ctan, but I don't know if there is other.

Regards
Alain Rémillard

peaches2165
Posts: 25
Joined: Wed Oct 22, 2008 5:03 pm

Postby peaches2165 » Wed Jun 18, 2014 8:33 pm

Thank you so much for your help with this. I have finally finished updating the CV.


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 1 guest