1

I am currently writing a cover letter within the class moderncv, using the banking style. I redefined the "color1" and I want to change the color of the bold part in the address line to "color1" now. However, if I call \color{color1}in \recipientin front of the text, the entire recipient field moves down slightly, so that the recipient and the date are not longer aligned. How can I fix this?

Please notice that I manipulated \opening in order to get a subject line.

Here you can find a MWE:

\documentclass[11pt,a4paper,sans]{moderncv}       
\moderncvstyle{banking}                            
\moderncvcolor{blue}                            
\usepackage[scale=0.75]{geometry}
\usepackage[english]{babel}
\name{Peter}{Example} 
\makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
\usepackage{etoolbox}% Text justification
\makeatletter
\patchcmd{\makeletterhead}% <cmd>
  {\raggedright \@opening}% <search>
  {\@opening}% <replace>
  {}{}% <success><failure>
\makeatother
\definecolor{color1}{RGB}{1,98,161} 
\begin{document}
\recipient{\color{color1}Just a litte text}{Some more text\\example street
\\example city}
\date{\today}
\opening{\textbf{\color{color1}This is a subject line}\\[0.5cm]Dear Mr. Example,}
\closing{Yours faithfully,}
\makelettertitle
Just some random text. \\\\
\makeletterclosing
\end{document}

Thanks in advance!

1 Answer 1

0

Using \textcolor instead of \color seems to give proper alignment:

\documentclass[11pt,a4paper,sans]{moderncv}       
\moderncvstyle{banking}                            
\moderncvcolor{blue}                            
\usepackage[scale=0.75]{geometry}
\usepackage[english]{babel}
\name{Peter}{Example} 
\makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
\usepackage{etoolbox}% Blocksatz
\makeatletter
\patchcmd{\makeletterhead}% <cmd>
  {\raggedright \@opening}% <search>
  {\@opening}% <replace>
  {}{}% <success><failure>
\makeatother
\definecolor{color1}{RGB}{1,98,161} 
\begin{document}
\recipient{\textcolor{color1}{Just a litte text}}{Some more text\\example street
\\example city}
\date{\today}
\opening{\textbf{\color{color1}This is a subject line}\\[0.5cm]Dear Mr. Example,}
\closing{Yours faithfully,}
\makelettertitle
Just some random text. \\\\
\makeletterclosing
\end{document}

enter image description here

0

You must log in to answer this question.

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