2

The \homepage info is appearing in the title of moderncv. The code works fine in writeLatex, but not on MikTeX. The error is

missing \begin{document}

Please help.

Code:

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{casual}

\moderncvcolor{green} 

\usepackage[scale=0.75]{geometry} % Reduce document margins

\renewcommand*{\namefont}{\fontsize{24}{10}\mdseries\upshape}

\usepackage{verbatim}

\usepackage[T1]{fontenc}

\firstname{Parul} % Your first name
\familyname{Gupta} % Your last name

\address{Address Line 1}{Address Line 2}
%\mobile{(000) 111 1111}
%\phone{(000) 111 1112}
%\fax{(000) 111 1113}
\email{123xyz@gmail.com}

\homepage{http://gmail.com/}{www.gmail.com} % The first argument is the url for the clickable link, the second argument is the url displayed in the template - this allows special characters to be displayed such as the tilde in this example

%----------------------------------------------------------------------------------------

\begin{document}

\makecvtitle % Print the CV title
  • Is your MikTeX distribution up to date? The template you're using looks old. For example, I believe the most recent version of moderncv uses \name{Parul}{Gupta} instead of the two separate commands, \firstname and \familyname. – Adam Liter Aug 13 '13 at 18:23
  • I got the template here latextemplates.com/template/moderncv-cv-and-cover-letter – PGupta Aug 13 '13 at 18:42
  • Have updated MikTex but problem didn't get solved. Still getting the error message "missing \begin{document} – PGupta Aug 13 '13 at 18:43
2

\homepage only takes one argument. So, you should just write:

\homepage{www.gmail.com}

You may want to use the template from CTAN, which can be found here, as it is the most up to date template.

It seems that the template that you're opening from the LaTeX Templates website automatically opens all of the associated .sty files in either of the online editors (i.e., sharelatex and writelatex), and it seems that that version of moderncv is version 1.1. The most recent version on CTAN, however, is version 1.5.1.

It seems that at some point (in particular, in version 1.1), \homepage actually could take two arguments, which is why this works on writelatex for you (i.e., because opening the moderncv template via the LaTeX Templates website automatically opens and uses the version 1.1 .sty files). However, this use seems to have been deprecated in (at least) version 1.5.1, which is the version you will have locally on your machine if your TeX distribution is up to date, since it is the most recent version on CTAN.

This change is not documented in the moderncv changelog, however, so it's not clear in which version that use of \homepage was deprecated.

| improve this answer | |
  • @Parul No problem. I've added some information about why it was working on writelatex but not locally on your own machine. If you edit the document in both places, you will want to make sure that you're using the most up to date .sty files when you edit it on writelatex.com, otherwise you may run into problems when you compile it on writelatex.com. – Adam Liter Aug 13 '13 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.