我在 moderncv 中使用 babel 以便在默认语言希腊语的情况下在希腊语和英语之间切换,但我遇到了社交信息(例如电子邮件、网页)的问题,我无法用英语添加它们。
例如我添加代码:
\homepage{www.example.gr}
我得到的是pdf:
因此一位用户建议我在代码中添加这几行(这样就解决了这个问题)
\xapptocmd\emailsymbol{\selectlanguage{english}}{}{}
\xapptocmd\homepagesymbol{\selectlanguage{english}}{}{}
但现在我遇到了与链接符号相同的问题,我添加了以下代码:
\social[linkedin]{gr.linkedin.com/in/test}
我得到了这个:
我在这里发布我的代码的第一行:
%% 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,roman]{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}
\usepackage{lastpage}
\cfoot{\thepage\ / \pageref{LastPage}}
\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}
\usepackage[T1]{fontenc}
\usepackage{kmath,kerkis}
% 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{test}{test}
%\title{Biografik'o Shme'iwma} % optional, remove / comment the line if not wanted
\address{dress, city, postal}{}{}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\phone[mobile]{(+30) 325245345} % optional, remove / comment the line if not wanted
%\phone[fixed]{(+30) 2352352} % optional, remove / comment the line if not wanted
%\phone[fax]{+3~(456)~789~012} % optional, remove / comment the line if not wanted
\xapptocmd\emailsymbol{\selectlanguage{english}}{}{}
\xapptocmd\homepagesymbol{\selectlanguage{english}}{}{}
\email{[email protected]} % optional, remove / comment the line if not wanted
\homepage{http://gr.linkedin.com/in/test} % optional, remove / comment the line if not wanted
%\extrainfo{additional information} % optional, remove / comment the line if not wanted
\social[linkedin]{gr.linkedin.com/in/test}
%\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
答案1
只需将以下行添加到您的代码中(最好放在\xapptocmd
您已有的行之后):
\xapptocmd\linkedinsocialsymbol{\selectlanguage{english}}{}{}
那么你的 linkedin 地址将是英文的。
只是为了添加其他内容的情况,这些是可能出现的其他已定义符号(从中复制moderncv.cls
):
\newcommand*{\addresssymbol} {}
\newcommand*{\mobilephonesymbol} {}
\newcommand*{\fixedphonesymbol} {}
\newcommand*{\faxphonesymbol} {}
\newcommand*{\emailsymbol} {}
\newcommand*{\homepagesymbol} {}
\newcommand*{\linkedinsocialsymbol}{}
\newcommand*{\twittersocialsymbol} {}
\newcommand*{\githubsocialsymbol} {}
按照命令\newcommand*
你会发现几个名字。
梅威瑟:
\documentclass[11pt,a4paper,roman]{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}
\usepackage{lastpage}
\cfoot{\thepage\ / \pageref{LastPage}}
\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}
\moderncvcolor{blue}
% character encoding
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{kmath,kerkis}
\usepackage[english,greek]{babel}
\usepackage[scale=0.75]{geometry}
% personal data
\name{test}{test}
%\title{Biografik'o Shme'iwma} % optional, remove / comment the line if not wanted
\address{dress, city, postal}{}{}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\phone[mobile]{(+30) 325245345} % optional, remove / comment the line if not wanted
\xapptocmd\emailsymbol{\selectlanguage{english}}{}{}
\xapptocmd\homepagesymbol{\selectlanguage{english}}{}{}
\xapptocmd\linkedinsocialsymbol{\selectlanguage{english}}{}{}
\email{[email protected]}
\social[linkedin]{gr.linkedin.com/in/test}
\begin{document}
\makecvtitle
\end{document}
结果: