Is there anyway I can make it look like the letterstyle? I am just
going through this to add a subject line, so if there's a simpler way
it would be equally good.
It sounds like what you really want is to be able to add a subject line to the standard letter
class, and that you really do not want to use scrlttr2
. If that is the case you can just modify the letter
class \opening
macro. I use the etoolbox
\patchcmd
, but I am sure there are other ways. The key part is
\makeatletter
\newcommand{\subject}[1]{\def\@subject{#1}}
\patchcmd{\opening}{#1\par\nobreak}{\ifundef{\@subject}{}{\textbf{\@subject}\par\vspace{2\parskip}}#1\par\nobreak}{}{}
\makeatother
You would then specify the subject with \subject
, just like you specify \name
. A full MWE is
\documentclass{letter}
\usepackage{etoolbox}
\makeatletter
\newcommand{\subject}[1]{\def\@subject{#1}}
\patchcmd{\opening}{#1\par\nobreak}{\ifundef{\@subject}{}{\@subject\par\vspace{2\parskip}}#1\par\nobreak}{}{}
\makeatother
\name{My name}
\signature{My signature}
\address{My road\\My city}
\location{My location}
\telephone{my telephone}
\subject{My subject}
\begin{document}
\begin{letter}{To name\\To road\\To city}
\opening{Dear \toname}
Hello World
\end{letter}
\end{document}
Sometimes you may have to cheat a little...
Below I set the date as part of the address, leaving the date
empty:
\documentclass{scrlttr2}
%\usepackage{fontspec} % Allows font customization
%\usepackage{marvosym} % Allows the use of symbols
\usepackage[english]{babel} % Required to compile in Windows
\usepackage{graphicx}
\setlength\parindent{0pt} % Removes all indentation from paragraphs
%\defaultfontfeatures{Mapping=tex-text}
%\setmainfont {Adobe Garamond Pro} % Main document font
%\setsansfont {Cambria} % Used in the from address line above the to address
\renewcommand{\normalsize}{\fontsize{11.5}{12}\selectfont} % Sets the font size and leading
%\setkomavar{date}{\flushleft\vspace{-\baselineskip}\today\par}
\setkomavar{date}{\vspace*{-\baselineskip}}
%-------------------------------------------------------------------------------------- --
% HEADER SECTION
%----------------------------------------------------------------------------------------
\setkomavar{firsthead}{
\centering
{%\addfontfeature{LetterSpace=20.0}
\fontsize{36}{36}\selectfont\scshape Peter Maguire}\\[5mm]
\fontsize{21}{21}\selectfont\scshape My Job \\ My Institution } % Your current job title
\begin{document}
%----------------------------------------------------------------------------------------
% COVER LETTER CONTENTS
%-------------------------------------------------------------------------------------- --
\begin{letter}{ % Address of the company you are applying to
\today \par \vspace*{2\baselineskip}
Biotech Company \\
123 Street Street \\
Washington, CA 12345
}
\opening{Biotech Company HR Manager,}
\begin{sloppypar}
Main section here \\
\end{sloppypar}
Sincerely, \\
Peter Maguire
%-------------------------------------------------------------------------------------- --
\end{letter}
\end{document}
Best Answer
First of all, i have to say that i do not recommend using the templated linked in the question. It uses obsolete options and does really weird stuff most of the time.
The
firsthead
is set within aparbox
, so the same rules and mechanisms as in every other LaTeX document apply.I cleaned the code up a little bit: