When I run the following code it compiles as expected:
\documentclass[%
11pt
,a4paper
,sans
]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage[spanish, activeacute]{babel}
% Personal Data
\firstname{John}
\familyname{Doe}
\title{CV}
\address{city}{state}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{john@doe.com}
\homepage{www.johndoe.com}
\extrainfo{extrainfo}
\quote{somequote}
\begin{document}
\makecvtitle
\section{First section}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\cventry{Prueba}{Alimentación}{alimentaci'on}{}{}{}
\end{document}
Uncommenting \usepackage[spanish, activeacute]{babel}
generates the following error (pasting here only the first part):
! Missing \endcsname inserted. \protect l.22
\phone[mobile]{+1~(234)~567~890} The control sequence marked should not appear between \csname and \endcsname.
If I then comment out the \phone
lines (so babel
is still uncommented) it runs fine. Furthermore, using babel with another language (e.g. ngerman) and the \phone
lines, also works fine.
Can anybody tell me waht's going on? Why can't I have both babel spanish and \phone
uncommented?
I use moderncv 1.5.1, Texlive 2012.20120611-5 and Texmaker 3.4 on Linux Mint Debian edition.
Thanks.
Best Answer
The
babel
module for Spanish redefines\roman
to use small caps and in many placesmoderncv
uses\roman
for building indexed macros, basically by doingwhich won't work if
\roman
is redefined in that way.Solution: add the
es-lcroman
option when loadingbabel
:I'm not sure that
activeacute
is really necessary with UTF-8 input. I wouldn't use~
for the phone numbers: a normal space seems sufficient.A different strategy, if
es-scroman
is needed, is to patch all themoderncv
commands that use\roman
:A request for bug fix should be filed to the maintainer of
moderncv
. The macros involved are\endcvcolumns
which is defined by\newenvironment{cvcolumns}
, where the occurrences ofshould become
\cvcolumn
, where the occurrences ofshould become
\collectionadd
(inmoderncvcollection.sty
), where the occurrences ofshould become
A similar problem that shows when
\moderncvstyle{banking}
is used can be solved by addingThe style uses
~~~
instead of\quad
and, due to how the Spanish module ofbabel
treats~
, using this in the title breaks the compilation. I believe that\quad
or\hspace{...}
should be used anyway: leave sequences of spaces to word processors, LaTeX can do better.;-)