2

I am a beginner at LaTeX and have been plodding along mostly by adapting snippets I find online. I'm trying to build a cover letter for a CV using the moderncv package. In the letter example, the John Doe address is right-justified with icons for the phone numbers and e-mail address. On my letter, I do not get my address at all. I don't see in the example template where this right-justified block is tirggered to render. Does anyone have experience with this who could hint where I should look?

I am adapting this cover letter into an already existing document that contains my moderncv-styled resume. I'm not sure if that may be relevant? I execute \maketitle in the resume itself, and I'm using \makelettertitle in the cover letter as the example shows.

The template I am looking at is available here: Sharelatex.com moderncv classic cover letter

\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}
2
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – cfr
    Mar 25, 2015 at 0:12
  • thanks @cfr, I pasted in the entirety of the formatting with personal data sanitized. Let me know if this is what you're expecting to see (I notice it did not auto render the tex for me, did I make a mistake?) Mar 25, 2015 at 0:26

1 Answer 1

2

It is the design of casual style where sender details don't appear at top. If you change to \moderncvtheme[red]{classic} you will get the sender on right side. Do you want to stick to casual style? Then you have to hack \makelettertitle. For that add the following to your preamble.

\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]
   }
   {}{}

Full code:

\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}

enter image description here

1
  • Magnificent! I opted to keep the casual format and use the xpatch code you provided. It works exactly as I would hope it would! Thank you so much! Mar 25, 2015 at 0:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .