![moderncv 中 Font Awesome 的最新版本存在问题](https://linux22.com/image/315679/moderncv%20%E4%B8%AD%20Font%20Awesome%20%E7%9A%84%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%E5%AD%98%E5%9C%A8%E9%97%AE%E9%A2%98.png)
更新fontawesome
包后,我无法编译我的 moderncv-document。
无需 即可工作\moderncvicons{awesome}
。
% !TeX TS-program = xelatex
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\name{John}{Doe}
\title{Resum\`e title}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\moderncvicons{awesome}
\begin{document}
\makecvtitle
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}}
\end{document}
答案1
下面恢复了 XeLaTeX 下缺失\faLinkedInSign
和\faCircleBlank
必需的内容(取自修订版 29485的moderncv
):
% !TeX TS-program = xelatex
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\name{John}{Doe}
\title{Resum\'e title}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\moderncvicons{awesome}
%\renewcommand*{\addresssymbol} {}
\renewcommand*{\mobilephonesymbol} {{\Large\faMobilePhone}~~}
\renewcommand*{\fixedphonesymbol} {\faPhone~~}
\renewcommand*{\faxphonesymbol} {\faPrint~~} % alternative: \faFileAlt
\renewcommand*{\emailsymbol} {\faEnvelope~~} % alternative: \faInbox
\renewcommand*{\homepagesymbol} {\faGlobe~~} % alternative: \faHome
\renewcommand*{\linkedinsocialsymbol}{\faLinkedinSign~~} % alternative: \faLinkedin
\renewcommand*{\twittersocialsymbol} {\faTwitter~~}
\renewcommand*{\githubsocialsymbol} {\faGithub~~}
\def\faLinkedinSign{{\FA\symbol{"F08C}}}
\def\faCircleBlank{{\FA\symbol{"F10C}}}
\DeclareRobustCommand{\FA}{%
\fontencoding{EU1}\fontfamily{FontAwesome(0)}\fontsize{5}{5}\selectfont}
\begin{document}
\makecvtitle
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}}
\end{document}
另外,我在符号后面添加了一些空格,以便它们看起来不那么接近墓碑信息。
强制\fontsize{5}{5}
使用FontAwesome字体(通过\FA
)似乎是合适的。
答案2
看着moderncv 的 147 版修订版,我使用 TeXLive 2015 中包含的 moderncv 1.5.1 版本进行以下解决方法:\def\faCircleBlank{{\faCircleO}}
。确保将其直接放在 之后\documentclass
、 之前\moderncvstyle
或类似位置!
另一个解决方案是更新到 moderncv 2.0.0 版本。
答案3
有两个错误:1) 即如所示多出的“}”;2) 需要包含在 \cventry 部分中的部分;3) 缺少 fontspec 包。此处的代码可以正确编译。
% !TeX TS-program = xelatex
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\usepackage{fontawesome}
\usepackage{fontspec}
\moderncvicons{awesome}
\name{John}{Doe}
\title{R\'{e}sum\'{e} title}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\begin{document}
\makecvtitle
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:}%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}
\end{document}