2

I want to replicate the output in this question, but I've been unable to use the suggested patch in my moderncv cover letter. In particular, why don't \setlength{\parindent}{2em} and \setlength{\parskip}{0em} work?

In more detail, I want no space in between paragraphs but the start of each paragraph to be indented. I have reproduced an example of my code below.

Any advice would be much appreciated!

%% start of file `template.tex'.
%% Copyright 2006-2013 Xavier Danaux (xdanaux@gmail.com).

% ============================================
% document setup
% ============================================
\documentclass[11pt,letterpaper,sans]{moderncv}
% font size:'10pt', '11pt' and '12pt'
% paper size: 'a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape'
% font family: 'sans' and 'roman'

% --------------------------------------------
% general packages
% --------------------------------------------
\usepackage{enumitem}
\usepackage{indentfirst}

% --------------------------------------------
% style
% --------------------------------------------
\moderncvstyle{banking}
% style options: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue}
% color options: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\moderncvhead{1}
% header style

%\renewcommand{\familydefault}{\sfdefault}
% to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
\nopagenumbers{}
% uncomment to suppress automatic page numbering for CVs longer than one page

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% indententation
\makeatletter
\patchcmd{\makelettertitle}% <cmd>
  {\raggedright \@opening}% <search>
  {\parindent=11pt % or what you think best
   \parskip=0pt plus 0.1pt % remove the blank lines between paragraphs
   \@opening}% <replace>
  {}{}% <success><failure>
% patch \makeletterclosing to have the closing flush left
\patchcmd{\makeletterclosing}
  {\@closing}
  {\vspace{1.em}\noindent\@closing}% the same vertical space as at the start
  {}{}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% --------------------------------------------
% character encoding 
% --------------------------------------------
\usepackage[utf8]{inputenc}                    % if you are not using xelatex ou lualatex, replace by the encoding you are using
%\usepackage{CJKutf8}
% if you need to use CJK to typeset your resume in Chinese, Japanese or Korean

% --------------------------------------------
% margins
% --------------------------------------------
\usepackage
[   
    scale=0.75,
    top=1.25cm,
    bottom=1.25cm,
    left=1.5cm,
    right=2cm
]
{geometry}
% \setlength{\hintscolumnwidth}{3cm}
% if you want to change the width of the column with the dates
% \setlength{\makecvtitlenamewidth}{10cm}
% for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

% ============================================
% personal details
% ============================================
\usepackage{import}
% personal data
\name{\textbf{\textcolor[rgb]{0.22,0.45,0.70}{John}}}{\textbf{\textcolor[rgb]{0.22,0.45,0.70}{Doe}}}
% \title{Curriculum Vitae}
% optional, remove / comment the line if not wanted

% --------------------------------------------
% address
% --------------------------------------------
% \address{Street}{City}{ZIP}
% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty

% --------------------------------------------
% contact
% --------------------------------------------
% \vspace{-7mm}
\vspace{2mm}
\phone[fixed]{12345678}
% optional, remove / comment the line if not wanted
% \phone[mobile]{01234 123456}
% optional, remove / comment the line if not wanted
%\phone[fax]{+3~(456)~789~012}
% optional, remove / comment the line if not wanted
\email{jdoe@gmail.com}
% optional, remove / comment the line if not wanted
\homepage{https://github.com/johndoe}
% optional, remove / comment the line if not wanted
%\extrainfo{additional information}                 % optional, remove / comment the line if not wanted

% ============================================
% cover letter content
% ============================================

% ++++++++++++++++++++++++++++++++++++++++++++
% begin
% ++++++++++++++++++++++++++++++++++++++++++++
\begin{document}

\clearpage
% ++++++++++++++++++++++++++++++++++++++++++++
% recipient data
% ++++++++++++++++++++++++++++++++++++++++++++
\recipient{\textcolor[rgb]{0.22,0.45,0.70}{Company}}{Street \\ City ZIP}
\date{April 10, 2018}

% ++++++++++++++++++++++++++++++++++++++++++++
% opening & closing
% ++++++++++++++++++++++++++++++++++++++++++++
\opening{To Whom It May Concern:}
\closing{Sincerely,}
\enclosure[Attached]{curriculum vit\ae{}} % use an optional argument to use a string other than "Enclosure", or redefine \enclname

% ++++++++++++++++++++++++++++++++++++++++++++
% content
% ++++++++++++++++++++++++++++++++++++++++++++
\makelettertitle

I want to indent this paragraph.

And this one. And any subsequent paragraph. And I want no space in between paragraphs.
\makeletterclosing

%\clearpage\end{CJK*}                              % if you are typesetting your resume in Chinese using CJK; the \clearpage is required for fancyhdr to work correctly with CJK, though it kills the page numbering by making \lastpage undefined
\end{document}


%% end of file `template.tex'.
3

With moderncv version 2.0.0 (current) you have to patch \makeletterhead:

% indententation
\makeatletter
\patchcmd{\makeletterhead}% <cmd>
  {\raggedright \@opening}% <search>
  {\parindent=11pt % or what you think best
   \parskip=0pt plus 0.1pt % remove the blank lines between paragraphs
   \@opening}% <replace>
  {}{\PatchFailed}% <success><failure>
% patch \makeletterclosing to have the closing flush left
\patchcmd{\makeletterclosing}
  {\@closing}
  {\vspace{1.em}\noindent\@closing}% the same vertical space as at the start
  {}{\patchfailed}
\makeatother

enter image description here

Code:

%% start of file `template.tex'.
%% Copyright 2006-2013 Xavier Danaux (xdanaux@gmail.com).

% ============================================
% document setup
% ============================================
\documentclass[11pt,letterpaper,sans]{moderncv}
% font size:'10pt', '11pt' and '12pt'
% paper size: 'a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape'
% font family: 'sans' and 'roman'
\usepackage{lipsum}% only for dummy text
% --------------------------------------------
% general packages
% --------------------------------------------
\usepackage{enumitem}
\usepackage{indentfirst}

% --------------------------------------------
% style
% --------------------------------------------
\moderncvstyle{banking}
% style options: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue}
% color options: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\moderncvhead{1}
% header style

%\renewcommand{\familydefault}{\sfdefault}
% to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
\nopagenumbers{}
% uncomment to suppress automatic page numbering for CVs longer than one page

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% indententation
\makeatletter
\patchcmd{\makeletterhead}% <cmd>
  {\raggedright \@opening}% <search>
  {\parindent=11pt % or what you think best
   \parskip=0pt plus 0.1pt % remove the blank lines between paragraphs
   \@opening}% <replace>
  {}{\PatchFailed}% <success><failure>
% patch \makeletterclosing to have the closing flush left
\patchcmd{\makeletterclosing}
  {\@closing}
  {\vspace{1.em}\noindent\@closing}% the same vertical space as at the start
  {}{\patchfailed}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% --------------------------------------------
% character encoding 
% --------------------------------------------
\usepackage[utf8]{inputenc}                    % if you are not using xelatex ou lualatex, replace by the encoding you are using
%\usepackage{CJKutf8}
% if you need to use CJK to typeset your resume in Chinese, Japanese or Korean

% --------------------------------------------
% margins
% --------------------------------------------
\usepackage
[   
    scale=0.75,
    top=1.25cm,
    bottom=1.25cm,
    left=1.5cm,
    right=2cm
]
{geometry}
% \setlength{\hintscolumnwidth}{3cm}
% if you want to change the width of the column with the dates
% \setlength{\makecvtitlenamewidth}{10cm}
% for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

% ============================================
% personal details
% ============================================
\usepackage{import}
% personal data
\name{\textbf{\textcolor[rgb]{0.22,0.45,0.70}{John}}}{\textbf{\textcolor[rgb]{0.22,0.45,0.70}{Doe}}}
% \title{Curriculum Vitae}
% optional, remove / comment the line if not wanted

% --------------------------------------------
% address
% --------------------------------------------
% \address{Street}{City}{ZIP}
% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty

% --------------------------------------------
% contact
% --------------------------------------------
% \vspace{-7mm}
\vspace{2mm}
\phone[fixed]{12345678}
% optional, remove / comment the line if not wanted
% \phone[mobile]{01234 123456}
% optional, remove / comment the line if not wanted
%\phone[fax]{+3~(456)~789~012}
% optional, remove / comment the line if not wanted
\email{jdoe@gmail.com}
% optional, remove / comment the line if not wanted
\homepage{https://github.com/johndoe}
% optional, remove / comment the line if not wanted
%\extrainfo{additional information}                 % optional, remove / comment the line if not wanted

% ============================================
% cover letter content
% ============================================
% ++++++++++++++++++++++++++++++++++++++++++++
% begin
% ++++++++++++++++++++++++++++++++++++++++++++
\begin{document}

\clearpage
% ++++++++++++++++++++++++++++++++++++++++++++
% recipient data
% ++++++++++++++++++++++++++++++++++++++++++++
\recipient{\textcolor[rgb]{0.22,0.45,0.70}{Company}}{Street \\ City ZIP}
\date{April 10, 2018}

% ++++++++++++++++++++++++++++++++++++++++++++
% opening & closing
% ++++++++++++++++++++++++++++++++++++++++++++
\opening{To Whom It May Concern:}
\closing{Sincerely,}
\enclosure[Attached]{curriculum vit\ae{}} % use an optional argument to use a string other than "Enclosure", or redefine \enclname

% ++++++++++++++++++++++++++++++++++++++++++++
% content
% ++++++++++++++++++++++++++++++++++++++++++++
\makelettertitle

I want to indent this paragraph.

And this one. And any subsequent paragraph. And I want no space in between paragraphs.

\lipsum[1-3]
\makeletterclosing

%\clearpage\end{CJK*}                              % if you are typesetting your resume in Chinese using CJK; the \clearpage is required for fancyhdr to work correctly with CJK, though it kills the page numbering by making \lastpage undefined
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.