3

I am working on overleaf and I have an issue when using moderncv and greek using the babel package.

The following code shows the problem. I compile with pdfLaTeX. If I uncomment any of the mobile, fixed or fax lines the code does not compile. The error is the same as in this question, but the proposed solution does not work for me. If I uncomment the mobile, fixed or fax lines and also delete the T1 in fontenc, the code compiles and produces a correct PDF. The point is that I need the T1, because I have small parts of text in English throughout my CV and, most importantly, there is a bibliography section that should also appear in English. If I remove the T1, everything written in Latin characters appears in the corresponding Greek characters.

Any idea how to correct the problem?

\documentclass[10pt]{moderncv}

\moderncvtheme[orange]{classic}

\usepackage[greek,english]{babel}
\usepackage[LGR,T1]{fontenc}
\usepackage{alphabeta}

\firstname{Ιωάννης}
\familyname{Παπαδόπουλος}
\title{Η δουλειά μου}
\address{Η διεύθυνση μου}
%\phone[mobile]{0000000000}
%\phone[fixed]{5555555555}
%\phone[fax]{9999999999}
\email{[email protected]}

\begin{document}

\maketitle

\end{document}

1 Answer 1

1

moderncv.cls uses \roman{<counter>} for defining internal commands, but this fails when babel-greek is loaded, because it changes \roman to something not expandable.

Restore the standard definition.

\documentclass[10pt]{moderncv}
\moderncvtheme[orange]{classic}
\usepackage[greek,english]{babel}
\usepackage{alphabeta}

\makeatletter
\def\@roman#1{\romannumeral#1}
\makeatother

\firstname{Ιωάννης}
\familyname{Παπαδόπουλος}
\title{Η δουλειά μου}
\address{Η διεύθυνση μου}
\phone[mobile]{0000000000}
\phone[fixed]{5555555555}
\phone[fax]{9999999999}
\email{[email protected]}

\begin{document}

\maketitle

\end{document}

enter image description here

I suggest to use XeLaTeX or LuaLaTeX with fontsetup.

\documentclass[10pt]{moderncv}
\moderncvtheme[orange]{classic}
\usepackage{fontsetup}
\usepackage[greek,english]{babel}


\firstname{Ιωάννης}
\familyname{Παπαδόπουλος}
\title{Η δουλειά μου}
\address{Η διεύθυνση μου}
\phone[mobile]{0000000000}
\phone[fixed]{5555555555}
\phone[fax]{9999999999}
\email{[email protected]}

\begin{document}

\maketitle

\end{document}

enter image description here

1
  • Thank you for your help. Both solutions you proposed work! Commented Dec 8, 2023 at 8:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .