我尝试过这个在先前的问题中找到的例子:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\usepackage{etoolbox}
\makeatletter
\newcommand*{\homepageA}[1]{\def\@homepageA{#1}}
\newcommand*{\homepageB}[1]{\def\@homepageB{#1}}
\patchcmd{\maketitle}%
{\ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}}%
{\ifthenelse{\isundefined{\@homepageA}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepageA}}}%
\ifthenelse{\isundefined{\@homepageB}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepageB}}} }%
{}{}%
\makeatother
\firstname{John}
\familyname{Doe}
\address{aa}{bb}
\homepage{em1}
\homepageA{emA}
\homepageB{emB}
%-----------------------------------------------------------------------------
\begin{document}
\maketitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
% arguments 3 to 6 can be left empty
\end{document}
它没有给出错误,但是没有出现新的电子邮件地址。为什么?
答案1
主题casual
moderncv
将电子邮件地址设置在页脚中(作为 的一部分\makecvfooter
),而不是标题中(在\maketitle
或\makecvtitle
)。我已更新电子工具箱`补丁程序以更正以下页脚中的添加内容:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\usepackage{etoolbox}
\makeatletter
\newcommand*{\homepageA}[1]{\def\@homepageA{#1}}
\newcommand*{\homepageB}[1]{\def\@homepageB{#1}}
\patchcmd{\makecvfooter}% <cmd>
{\ifthenelse{\isundefined{\@homepage}}{}{\addtofooter{\homepagesymbol\httplink{\@homepage}}}}% <search>
{\ifthenelse{\isundefined{\@homepageA}}{}{\addtofooter{\homepagesymbol\httplink{\@homepageA}}}% <replace>
\ifthenelse{\isundefined{\@homepageB}}{}{\addtofooter{\homepagesymbol\httplink{\@homepageB}}}}%
{}{}% <success><failure>
\makeatother
\firstname{John}
\familyname{Doe}
\address{aa}{bb}
%\homepage{em1} Not needed
\homepageA{emA}
\homepageB{emB}
%-----------------------------------------------------------------------------
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description} % arguments 3 to 6 can be left empty
\end{document}