As discussed on this forum latex-community: How to include Subject to letter, I'd like to add an extra field "Subject: " to moderncv letter template.
\bigskip
\textbf{Subject: \@subject}
\bigskip\noindent
the new \makeletterhead
command will be something like this:
\renewcommand*{\makeletterhead}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputeletterlengths%
% sender block
\makehead%
\par%
% recipient block
\begin{minipage}[t]{.5\textwidth}
\raggedright%
\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress%
\end{minipage}
% date
\hfill% US style
% \\[1em]% UK style
\@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
%_______________________
\bigskip
\textbf{Subject: \@subject}
\bigskip\noindent
%_______________________
% opening
\raggedright%
\@opening\\[1.5em]%
% ensure no extra spacing after \makelettertitle due to a possible blank line
% \ignorespacesafterend% not working
\hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}
Not to forget that the parameter \@subject
should be retrieved somewhere.
EDIT
The question is how to add a "Subject" field in a way that when the command \makelettertitle
is executed the subject text will be placed before the openning statement.
\noindent
after the\bigskip
) – David Carlisle Sep 5 '16 at 9:19\@subject
is not defined yet) when copy pasting this code to overridemakeletterhead
definition.You can't use
\spacefactor' in internal vertical mode. There's no line here to end....` – Cfun Sep 5 '16 at 9:21\makeatletter
or put the code in a package" that applies to any command with@
in its name, unrelated to moderncv. you just want\newcommand\subject[1]{\def\@subject{#1}}
to be defined somewhere that@
is a letter or don't use@
use\Xsubject
or any other internal name that is a valid command name. – David Carlisle Sep 5 '16 at 9:26\makeatletter
and\makeatother
:)\newcommand\subject[1]{\def\@subject{#1}}
was helpful as well you can post an answer or i will. – Cfun Sep 5 '16 at 9:34