babel spanish causes “Missing \endcsname…” error

Bug #1243455 reported by Roberto E Ferrer Pirela on 2013-10-22
This bug affects 4 people
Affects Status Importance Assigned to Milestone

Bug Description

This error was reported at

Summary: The use of \usepackage[spanish, activeacute]{babel} along with \phone generates the following error:

! Missing \endcsname inserted. \protect l.22 \phone[mobile]{+1~(234)~567~890} The control sequence marked should not appear between \csname and \endcsname.

One tex.stackexchange user noted:

The babel module for Spanish redefines \roman to use small caps and in many places moderncv uses \roman for building indexed macros, basically by doing

\csname xyz\roman{counter}\endcsname

which won't work if \roman is redefined in that way.

The macros involved are

    1. \endcvcolumns which is defined by \newenvironment{cvcolumns}, where the occurrences of


    should become


    2. \cvcolumn, where the occurrences of


    should become


    3. \collectionadd (in moderncvcollection.sty), where the occurrences of


    should become

    \romannumeral\csname c@collection@#2@count\endcsname

Francisco Lopes (oblita) wrote :

I'm also suffering the issue with babel greek... I've applied the stackexchange command patches.

Hernan (hgsolari) wrote :

There is a conflict with "babel" and moderncv which goes beyond this problem. It does not show with
but it shows in different forms with, for example

In the following example the error reads:
! Missing \endcsname inserted.
<to be read again>
l.47 \end{document}

but longer examples may produce the error before reaching the end.

\documentclass[11pt,a4paper,sans]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper, legalpaper, executivepaper or landscape; font families: sans or roman

\moderncvstyle{casual} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'

\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage[utf8]{inputenc} % para ver bien acentos --> ingreso para caracteres de teclado


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

\familyname{de los Palotes}

\title{Curriculum Vitae}


\makecvtitle % Print the CV title

\section{Datos Personales}
\cvitem{Apellido}{de los Palotes}

\subsection{Cargos actuales}

Hernan (hgsolari) wrote :

Here is a workaround.The only thing we need from Babel is the hyphenation.
In the previous example we can substitute the call to babel by
es-lcroman fix a problem of font substitution described in the original post
es-noquoting allows you to use "quote me" instead of the quoting in spanish ``quote me''
the last option (english) will be the default

Now, after \begin{document} write \begin{otherlanguage}{spanish}
and close it with \end{otherlanguage}
typeset your CV

Off course, in case you want a mixed language CV you can set each part to one of the declared options in the call to Babel.

I am attaching a replacement for the spanish example. I had to apply this trick twice since in one piece did not work.

Hernan (hgsolari) wrote :

OK, the solution is: load [spanish]{babel} with options
\usepackage[spanish,es-noquoting,es-noshorthands]{babel} % load spanish avoiding interference with moderncv

you can find the options in

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers