moderncv babel 英语、希腊语问题

moderncv babel 英语、希腊语问题

我在 moderncv 中使用 babel 在希腊语和英语之间切换语言,尽管它可以识别希腊语(在网站的帮助下添加了一些额外的代码行之后这里),当我尝试切换到英语时,出现错误。

例如,我尝试通过在代码中插入行 \selectlanguage{english} 来切换为英语以填写我的电子邮件,但出现以下错误:

在此处输入图片描述

代码中稍后几行会出现错误:

在此处输入图片描述

代码在这里:

   %% start of file `template.tex'.
%% Copyright 2006-2013 Xavier Danaux ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.


\documentclass[11pt,a4paper,sans]{moderncv}        % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')

\usepackage{xpatch}
\makeatletter
% provide an expandable version of \roman
\newcommand{\exproman}[1]{\romannumeral\csname c@#1\endcsname}
% patch the commands in moderncv that use \roman
\xpatchcmd{\endcvcolumns}{\roman}{\exproman}{}{}
\xpatchcmd{\endcvcolumns}{\roman}{\exproman}{}{}
\xpatchcmd{\endcvcolumns}{\roman}{\exproman}{}{}
\xpatchcmd{\cvcolumn}{\roman}{\exproman}{}{}
\xpatchcmd{\cvcolumn}{\roman}{\exproman}{}{}
\xpatchcmd{\cvcolumn}{\roman}{\exproman}{}{}
\xpatchcmd{\cvcolumn}{\roman}{\exproman}{}{}
\xpatchcmd{\cvcolumn}{\roman}{\exproman}{}{}
\xpatchcmd{\collectionadd}{\roman}{\exproman}{}{}
\xpatchcmd{\collectionadd}{\roman}{\exproman}{}{}
\makeatother

% modern themes
\moderncvstyle{banking}                            % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue}                                % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
%\renewcommand{\familydefault}{\sfdefault}         % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
%\nopagenumbers{}                                  % uncomment to suppress automatic page numbering for CVs longer than one page

% character encoding
\usepackage[utf8]{inputenc}                       % if you are not using xelatex ou lualatex, replace by the encoding you are using
\usepackage[english,greek]{babel}
%\usepackage{CJKutf8}                              % if you need to use CJK to typeset your resume in Chinese, Japanese or Korean

% adjust the page margins
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm}                % if you want to change the width of the column with the dates
%\setlength{\makecvtitlenamewidth}{10cm}           % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

\usepackage{import}

% personal data
\name{Sonoma}{'epithet}
\title{Biografik'o Shme'iwma}                               % optional, remove / comment the line if not wanted
\address{dress,tk}{}{}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\phone[mobile]{+30 756567565}           % optional, remove / comment the line if not wanted
\phone[fixed]{78678678686}                    % optional, remove / comment the line if not wanted
%\phone[fax]{+3~(456)~789~012}                      % optional, remove / comment the line if not wanted
\email{\selectlanguage{english}[email protected]}                              % optional, remove / comment the line if not wanted
\homepage{www.myname.webs.com}                         % optional, remove / comment the line if not wanted
%\extrainfo{additional information}                 % optional, remove / comment the line if not wanted
%\photo[64pt][0.4pt]{picture}                       % optional, remove / comment the line if not wanted; '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file
%\quote{Some quote}                                 % optional, remove / comment the line if not wanted

% to show numerical labels in the bibliography (default is to show no labels); only useful if you make citations in your resume
%\makeatletter
%\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
%\makeatother
%\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]}% CONSIDER REPLACING THE ABOVE BY THIS

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}
%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
%\begin{CJK*}{UTF8}{gbsn}                          % to typeset your resume in Chinese using CJK
%-----       resume       ---------------------------------------------------------
\makecvtitle

\small{Undergraduate electrical and electronic engineer completing the final year of a master's degree. Passionate about science, with strong technical, business, and interpersonal skills for working in a team and successfully completing a project.}



\end{document}


%% end of file `template.tex'.

有什么想法可以解决这个问题吗?

答案1

您不能将语言切换放在\email命令中,因为其参数用于链接。但您可以将其注入到链接前的符号中:

\documentclass[11pt,a4paper,sans]{moderncv} 
\usepackage[utf8]{inputenc}                 
\usepackage[english,greek]{babel}
\name{Sonoma}{'epithet}
\title{Biografik'o Shme'iwma} 
\address{dress,tk}{}{}% 
\email{[email protected]}                
\homepage{www.myname.webs.com}              
\moderncvstyle{banking}  
\usepackage{xpatch}
\xapptocmd\emailsymbol{\selectlanguage{english}}{}{}
\xapptocmd\homepagesymbol{\selectlanguage{english}}{}{}
\begin{document}
\makecvtitle
\end{document}

在此处输入图片描述

相关内容