[Tex/LaTex] Undefined control sequence Error with moderncv+Hebrew

babelerrorsmoderncvoptional arguments

I would like to use modernv to create a right-to-left CV document in Hebrew. I have downloaded and installed culmus-latex, and Hebrew+English LaTex documents compile without a problem.

I took template.tex, the moderncv boilerplate file, and added the Hebrew packages:

\usepackage[T1]{fontenc}
\usepackage[latin9,cp1255]{inputenc}

\usepackage{babel}
\usepackage{culmus}

And changed the documentclass from:

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

To:

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

I got the following error:

...
(/usr/share/texmf-texlive/tex/generic/babel/babel.def))
(/usr/share/texmf-texlive/tex/generic/babel/rlbabel.def
! Undefined control sequence.
<argument> \thesection 

l.174 }

? 
! Emergency stop.
<argument> \thesection 

l.174 }

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on template.log.

More info:

Addendum:

When the inputenc end babel lines are commented out:

%\usepackage[latin9,cp1255]{inputenc}
%\usepackage{babel}

The document compiles, with erroneous Hebrew encoding:

enter image description here

To conclude,

Uh, so, uh, anything you can do to, uh, to help, would be… very… helpful…

Best Answer

moderncv works best with unicode encoding for "exotic" characters, due to some internal hyperref setup.

Therefore, you should encode your file in utf8 and use

\usepackage[utf8]{inputenc}

if you are compiling with pdfLaTeX (or nothing if you are compiling with Xe- or LuaLaTeX) and remove the \inputencoding{latin9} and \inputencoding{cp1255} from your code.