moderncv,休闲风格,如何在标题中放置联系信息

moderncv,休闲风格,如何在标题中放置联系信息

我正在使用moderncv休闲风格的包来写信。个人资料写在页面底部。有没有办法把它们放到页眉中?

以下是 MWE:

\documentclass[10pt,a4paper,sans]{moderncv} 
\moderncvstyle{casual}  
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\usepackage[latin1,ansinew]{inputenc}
\usepackage[ngerman]{babel} 


\firstname{Max}
\familyname{Mustermann}
\address{Musterstraße}{Musterstadt}    
\mobile{ABCDEF}                      
\email{ABCDEF}


\opening{Dear Sir or Madam, } 
\closing{Yours Sincerely, }

\recipient{Erika Mustermann}{Musterstadt}

\begin{document}
\selectlanguage{ngerman}
\date{Musterstadt, den \today}
\makelettertitle
Text
\makeletterclosing
\end{document}

答案1

您可以修补\makeletterfooter宏以将页脚的内容放置在页眉中。由于moderncv用途fancyhdr它就像替换一样简单\fancyfoot\fancyhead以及一些标题高度调整):

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\makeletterfooter}{\fancyfoot}{\fancyhead}{}{}
\setlength{\headheight}{36pt}

这是一个显示输出的完整最小示例:

在此处输入图片描述

\documentclass[10pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\makeletterfooter}{\fancyfoot}{\fancyhead}{}{}
\setlength{\headheight}{36pt}


\firstname{Max}
\familyname{Mustermann}
\address{Musterstraße}{Musterstadt}
\mobile{ABCDEF}
\email{ABCDEF}


\opening{Dear Sir or Madam,}
\closing{Yours Sincerely,}

\recipient{Erika Mustermann}{Musterstadt}

\begin{document}
\selectlanguage{ngerman}
\date{Musterstadt, den \today}
\makelettertitle
Text
\makeletterclosing
\end{document}

相关内容