我似乎无法将 moderncv 的示例模板的一部分呈现在我现有的简历中

我似乎无法将 moderncv 的示例模板的一部分呈现在我现有的简历中

我是 LaTeX 的初学者,一直在努力学习,主要是改编我在网上找到的片段。我正在尝试使用该 moderncv软件包为简历创建一封求职信。在信件示例中,John Doe 地址是右对齐的,带有电话号码和电子邮件地址的图标。在我的信件中,我根本看不到我的地址。我没有在示例模板中看到这个右对齐块被触发渲染的位置。有没有人有这方面的经验,可以提示我应该去哪里找?

我正在将这封求职信改编成一份已有的文档,其中包含我的 moderncv 风格简历。我不确定这是否相关?我\maketitle在简历本身中执行,并在求职信中使用,\makelettertitle如示例所示。

我正在查看的模板可以在这里找到:Sharelatex.com moderncv 经典求职信

\documentclass[10pt,letterpaper]{moderncv}

\moderncvtheme[red]{casual}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)

\usepackage[utf8]{inputenc}                   % replace by the encoding you are using
\usepackage[scale=0.8]{geometry}
\firstname{Jane}
\familyname{Doe}
\title{Title Here}               % optional, remove the line if not wanted
\address{City}{State}    % optional, remove the line if not wanted
\mobile{(123) 456 7890}                    % optional, remove the line if not wanted
\email{[email protected]}                      % optional, remove the line if not wanted
\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\makeatother

\usepackage{multibib}
\usepackage{framed}

\renewcommand*{\cventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
%   \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}% I changed this line (with comma) ...
    \ifthenelse{\equal{#4}{}}{}{ {\slshape#4}}% ... into this one (without comma).
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%
    \strut%
    \ifx&#7&%
      \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}
%%%
\begin{document}
\name{Jane}{Doe}
\address{Street Address}{City, ST}{12345}
\email{[email protected]}
\recipient{Hiring Manager}{Place to Work\\Address To Work\\City State Zip}
\date{\today}
\opening{Dear Sir or Madam,}
\closing{Kind Regards,}
\enclosure[Atttached]{resume}

\makelettertitle

cover letter goes here

\makeletterclosing

\newpage
\maketitle
\section{Summary of Qualifications}
\begin{framed}
sanitized
\end{framed}
\begin{itemize}
\item sanitized
\item sanitized
\item sanitized
\end{itemize}

\section{Experience}
\cventry[2em]{2014-Present}{Nothin}{From Nothin}{Leaves, Nothin}{}{
\begin{itemize}%
\item Ya Gotta Have
\item Somethin
\item if ya wanna be with me
\end{itemize}
}
\newpage

\section{Education}
\cventry{1994-1998}{Gooblegorp High School}{Yourtown, ST}{}{}{General Diploma}

\section{Technical skills}
\cvitem[1em]{Software}{Microsoft Windows, Word, Excel, Outlook, PowerPoint, Google Apps, Adobe Acrobat}

\section{Certifications and Clearances}
\cventry{2014}{Certified}{National Red Cross}{}{}{
\begin{itemize}
\item CPR
\item AED lifesaving equipment
\item First Aid
\end{itemize}
}

\end{document}

答案1

这是样式设计casual,其中发件人详细信息不显示在顶部。如果您更改为,\moderncvtheme[red]{classic}您将在右侧看到发件人。您想坚持casual样式吗?那么您必须破解\makelettertitle。为此,请将以下内容添加到您的序言中。

\usepackage{xpatch}
\xpatchcmd{\makelettertitle}{\makeletterfooter}
   {%
   \makeletterfooter%
   \hfill%
  \begin{minipage}{.5\textwidth}%
    \raggedleft%
    \addressfont\textcolor{color2}{%
      {\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse%
      \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
        \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
        \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
      \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
        \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
      \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
      \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
      \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
    \end{minipage}\\[1em]
   }
   {}{}

完整代码:

\documentclass[10pt,letterpaper]{moderncv}

\moderncvtheme[red]{casual}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)

\usepackage[utf8]{inputenc}                   % replace by the encoding you are using
\usepackage[scale=0.8]{geometry}
\firstname{Jane}
\familyname{Doe}
\title{Title Here}               % optional, remove the line if not wanted
\address{City}{State}    % optional, remove the line if not wanted
\mobile{(123) 456 7890}                    % optional, remove the line if not wanted
\email{[email protected]}                      % optional, remove the line if not wanted
\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\makeatother

\usepackage{multibib}
\usepackage{framed}

\renewcommand*{\cventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
%   \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}% I changed this line (with comma) ...
    \ifthenelse{\equal{#4}{}}{}{ {\slshape#4}}% ... into this one (without comma).
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%
    \strut%
    \ifx&#7&%
      \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}
%%%

\usepackage{xpatch}
\xpatchcmd{\makelettertitle}{\makeletterfooter}
   {%
   \makeletterfooter%
   \hfill%
  \begin{minipage}{.5\textwidth}%
    \raggedleft%
    \addressfont\textcolor{color2}{%
      {\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse%
      \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
        \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
        \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
      \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
        \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
      \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
      \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
      \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
    \end{minipage}\\[1em]
   }
   {}{}
\begin{document}
\name{Jane}{Doe}
\address{Street Address}{City, ST}{12345}
\email{[email protected]}
\recipient{Hiring Manager}{Place to Work\\Address To Work\\City State Zip}
\date{\today}
\opening{Dear Sir or Madam,}
\closing{Kind Regards,}
\enclosure[Atttached]{resume}

\makelettertitle

cover letter goes here

\makeletterclosing

\newpage
\maketitle
\section{Summary of Qualifications}
\begin{framed}
sanitized
\end{framed}
\begin{itemize}
\item sanitized
\item sanitized
\item sanitized
\end{itemize}

\section{Experience}
\cventry[2em]{2014-Present}{Nothin}{From Nothin}{Leaves, Nothin}{}{
\begin{itemize}%
\item Ya Gotta Have
\item Somethin
\item if ya wanna be with me
\end{itemize}
}
\newpage

\section{Education}
\cventry{1994-1998}{Gooblegorp High School}{Yourtown, ST}{}{}{General Diploma}

\section{Technical skills}
\cvitem[1em]{Software}{Microsoft Windows, Word, Excel, Outlook, PowerPoint, Google Apps, Adobe Acrobat}

\section{Certifications and Clearances}
\cventry{2014}{Certified}{National Red Cross}{}{}{
\begin{itemize}
\item CPR
\item AED lifesaving equipment
\item First Aid
\end{itemize}
}

\end{document}

在此处输入图片描述

相关内容