求职信缩进

求职信缩进

我想复制输出问题,但我一直无法在我的 moderncv 求职信中使用建议的补丁。具体来说,为什么不\setlength{\parindent}{2em}工作\setlength{\parskip}{0em}

更详细地说,我希望段落之间没有空格,但每个段落的开头都缩进。我在下面重现了我的代码示例。

任何建议都将非常感谢!

%% start of file `template.tex'.
%% Copyright 2006-2013 Xavier Danaux ([email protected]).

% ============================================
% 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{[email protected]}
% 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'.

答案1

使用moderncv版本 2.0.0(当前版本)你必须修补\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

在此处输入图片描述

代码:

%% start of file `template.tex'.
%% Copyright 2006-2013 Xavier Danaux ([email protected]).

% ============================================
% 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{[email protected]}
% 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}

相关内容