From 9de98f64c68971b6c394480b50b4fb64c7bdfa0c Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 9 Mar 2022 14:56:03 +0100 Subject: [PATCH] Add the possibility to add a subject line in the letter This is the suggestion given by Matthias Baur on launchpad https://answers.launchpad.net/moderncv/+question/222784 in comment 12 Closes #113 I included small layout tweaks in the different moderncvhead variants. --- moderncv.cls | 1 + moderncvheadi.sty | 4 +++- moderncvheadii.sty | 4 +++- moderncvheadiii.sty | 4 +++- moderncvheadiv.sty | 2 ++ moderncvheadv.sty | 6 ++++-- moderncvheadvi.sty | 4 +++- template.tex | 1 + 8 files changed, 20 insertions(+), 6 deletions(-) diff --git a/moderncv.cls b/moderncv.cls index aa93433..5297874 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -716,6 +716,7 @@ % elements \newcommand*{\recipient}[2]{\def\@recipientname{#1}\def\@recipientaddress{#2}} \renewcommand*{\date}[1]{\def\@date{#1}}\date{\today} +\newcommand*{\subject}[1]{\def\@subject{#1}} \newcommand*{\opening}[1]{\def\@opening{#1}} \newcommand*{\closing}[1]{\def\@closing{#1}} \newcommand*{\enclosure}[2][]{% diff --git a/moderncvheadi.sty b/moderncvheadi.sty index 087cf77..3c8e979 100644 --- a/moderncvheadi.sty +++ b/moderncvheadi.sty @@ -161,7 +161,7 @@ \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi% - \end{minipage}\\[1em] + \end{minipage}\\[2em] % recipient block \begin{minipage}[t]{.5\textwidth} \raggedright% @@ -173,6 +173,8 @@ \hfill% US style % \\[1em]% UK style \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + % optional subject + \ifthenelse{\isundefined{\@subject}}{}{{\bfseries\@subject\\[2em]}} % opening \raggedright% \@opening\\[1.5em]% diff --git a/moderncvheadii.sty b/moderncvheadii.sty index b699242..67ff3ba 100644 --- a/moderncvheadii.sty +++ b/moderncvheadii.sty @@ -189,7 +189,9 @@ % date \hfill% US style % \\[1em]% UK style - \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + \@date\\[3em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + % optional subject + \ifthenelse{\isundefined{\@subject}}{}{{\bfseries\@subject\\[3em]}} % opening \raggedright% \@opening\\[1.5em]% diff --git a/moderncvheadiii.sty b/moderncvheadiii.sty index e4dbafd..e1a02cf 100644 --- a/moderncvheadiii.sty +++ b/moderncvheadiii.sty @@ -145,7 +145,9 @@ % date \hfill% US style % \\[1em]% UK style - \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + \@date\\[3em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + % optional subject + \ifthenelse{\isundefined{\@subject}}{}{{\bfseries\@subject\\[3em]}} % opening \raggedright% \@opening\\[1.5em]% diff --git a/moderncvheadiv.sty b/moderncvheadiv.sty index 9b59dac..cfb0fd0 100644 --- a/moderncvheadiv.sty +++ b/moderncvheadiv.sty @@ -143,6 +143,8 @@ \@recipientaddress}\\[1em]% % date \@date\\[2em]% + % optional subject + \ifthenelse{\isundefined{\@subject}}{}{{\bfseries\@subject\\[2em]}} % opening \@opening\\[1.5em]% % sender contact info diff --git a/moderncvheadv.sty b/moderncvheadv.sty index c4d4084..3afd757 100644 --- a/moderncvheadv.sty +++ b/moderncvheadv.sty @@ -148,7 +148,7 @@ \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi% - \end{minipage}\\[1em] + \end{minipage}\\[2em] % recipient block \begin{minipage}[t]{.5\textwidth} \raggedright% @@ -159,7 +159,9 @@ % date \hfill% US style % \\[1em]% UK style - \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + \@date\\[3em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + % optional subject + \ifthenelse{\isundefined{\@subject}}{}{{\bfseries\@subject\\[2em]}} % opening \raggedright% \@opening\\[1.5em]% diff --git a/moderncvheadvi.sty b/moderncvheadvi.sty index 8595901..abda829 100644 --- a/moderncvheadvi.sty +++ b/moderncvheadvi.sty @@ -154,7 +154,9 @@ % date \hfill% US style % \\[1em]% UK style - \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + \@date\\[3em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + % optional subject + \ifthenelse{\isundefined{\@subject}}{}{{\bfseries\@subject\\[3em]}} % opening \raggedright% \@opening\\[1.5em]% diff --git a/template.tex b/template.tex index 8c4b88e..4b4cf03 100644 --- a/template.tex +++ b/template.tex @@ -239,6 +239,7 @@ Detailed achievements: % recipient data \recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city} \date{January 01, 1984} +\subject{Job application} \opening{Dear Sir or Madam,} \closing{Yours faithfully,} \enclosure[Attached]{curriculum vit\ae{}} % use an optional argument to use a string other than "Enclosure", or redefine \enclname