我正在使用 Texmaker 更新我的简历,但我遇到了 \extrainfo 问题。我正在使用 moderncv documentclass 和 moderncvstyle {classic}。我希望 extrainfo 出现在我的简历中,但不出现在我的求职信中。Latex 模板代码如下:
\documentclass[11pt,a4paper,sans]{moderncv}
\pagestyle{fancy}
\usepackage{moderntimeline}
\moderncvstyle{classic}
\moderncvcolor{green}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\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}
\extrainfo{additional information}
\photo[64pt][0.4pt]{picture}
\quote{Some quote}
\begin{document}
\makecvtitle
然后代码继续执行简历的部分和子部分,直到到达求职信部分
\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure[Attached]{curriculum vit\ae{}}
\makelettertitle
\makeletterclosing
\end{document}
我的简历和求职信内容如下:
求职信中出现相同的“附加信息”:
现在我想将这些附加信息保留在我的简历中,但想将其从求职信中删除。有什么帮助吗?
答案1
您无需进行修补\makelettertitle
,只需将“附加信息”宏(\@extrainfo
)设置为\relax
:
\makeatletter
\let\@extrainfo\relax% Remove \@extrainfo
\makeatother
\makelettertitle
答案2
添加
\patchcmd\makelettertitle{\makenewline\@extrainfo}{}{}{}
后
\moderncvstyle{classic}
更详细地说,这样做的目的是\makelettertitle
通过moderncvstyleclassic.sty
删除对以下内容的调用进行编辑\@extrainfo
:
\renewcommand*{\makelettertitle}{%
[...]
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}} %% patchcmd edits this line removing the \@extrainfo command that is responsible for inserting the "additional information" inside the letter title
[...]
该etoolbox
包(允许您使用patchcmd
)已经加载,moderncv
因此您只需使用它。
答案3
看来最简单的方法就是\extrainfo{}
在命令前添加一个空字符\makelettertitle
。这样就可以覆盖之前的信息。
\documentclass[11pt,a4paper,sans]{moderncv}
\pagestyle{fancy}
\usepackage{moderntimeline}
\moderncvstyle{classic}
\moderncvcolor{green}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\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}
\extrainfo{additional information}
%\photo[64pt][0.4pt]{picture}
\quote{Some quote}
\begin{document}
\makecvtitle
\clearpage
\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure[Attached]{curriculum vit\ae{}}
\extrainfo{} % <== that's the magic
\makelettertitle
\makeletterclosing
\end{document}