如何在正式信函 MWE 中自定义 \name 如下所示

如何在正式信函 MWE 中自定义 \name 如下所示
\name{FirstName}{LastName}
\address{1 Brookings Dr}{St. Louis, MO 63130}
\phone[mobile]{314-xxx-xxxx}                   
\email{[email protected]}             
                   



\begin{document}

% Insert Olin Logo
\begin{minipage}[t]{\textwidth}
\includegraphics[width=0.60\textwidth]{Olin_Logo.jpg}
\end{minipage}


\recipient{Dear Hiring Manager,}{}
\opening{\vspace*{-2em}}
\closing{Sincerely,}{\vspace*{-2em}}
\enclosure[Enclosures]{Résumé, Writing Sample, Transcript}   
\makelettertitle

% body of letter 

\vspace{0.5cm}

\makeletterclosing

\end{document}

在此处输入图片描述

强文本我想自定义 \name,以便在信件末尾的“真诚的我的名字”后面是同一行中的 Ph.D,但​​在地址上方的第一行中应该只有我的名字。

答案1

这是您可以使用的模板。

A

\documentclass[11pt,a4paper,roman]{moderncv}  
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm]{geometry}

\moderncvstyle{classic} 

\usepackage{kantlipsum} % dummy text

\name{FirstName}{LastName}
\address{1 Brookings Dr}{St. Louis, MO 63130}
\phone[mobile]{314-xxx-xxxx}                   
\email{[email protected]}  

           
%*****************************  added <<<<<<<<<<<<<<<<<<<<<<
\makeatletter
\renewcommand*{\makeletterclosing}{
    \@closing\\[3em]%
    {\bfseries \@firstname~\@lastname,~PhD}%
    \ifthenelse{\isundefined{\@enclosure}}{}{%
        \\%
        \vfill%
        {\color{color2}\itshape\enclname: \@enclosure}}}
\makeatother
%***********************************************


\begin{document}
    % Insert Olin Logo
    \begin{minipage}[t]{\textwidth}
        \includegraphics[width=0.60\textwidth, height=50pt]{example-grid-100x100pt}
    \end{minipage}
    
    \recipient{Dear Hiring Manager,}{}
    \opening{\vspace*{-2em}}
    \closing{Sincerely,}{\vspace*{-2em}}
    \enclosure[Enclosures]{Résumé, Writing Sample, Transcript}   

    \makelettertitle    
        
    % body of letter 
    
    \kant[1] % some text <<<<<<<<<<
    
    \vspace{0.5cm}
    
    \makeletterclosing
    
\end{document}

相关内容