Taking the definition from the article
class, I get good results with
\begin{filecontents}{letter.bib}
@article{First,
author = "Other, A. N.",
title = "Some things {I} did",
journal = "J. Irreproducible Results",
year = "2011"
}
@article{Second,
author = "Aaa, S{\o}mebloke",
title = "Tigers",
journal = "Ann. Improbable Res.",
year = "2011"
}
\end{filecontents}
\documentclass{letter}
\makeatletter
\newenvironment{thebibliography}[1]
{\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\makeatother
\begin{document}
\begin{letter}{Some person}
\opening{Hello}
Some text \cite{First}, more text \cite{Second}.
\bibliographystyle{unsrt}
\bibliography{letter}
\end{letter}
\end{document}
I've used the unsrt
style here, as plain
would put the references in alphabetical rather than citation order. I've also modified the definition of thebiliography
a little, removing the section-related stuff as this does not really seem relevant to a letter. (I also took out the code related to the openbib
option for the article
class, again as it does not seem relevant.)
The second edit to the question asks about natbib
. For me, this works if I load natbib
after defining thebiliography
and if I make \bibsection
'safe':
\begin{filecontents}{letter.bib}
@article{First,
author = "Other, A. N.",
title = "Some things {I} did",
journal = "J. Irreproducible Results",
year = "2011"
}
@article{Second,
author = "Aaa, S{\o}mebloke",
title = "Tigers",
journal = "Ann. Improbable Res.",
year = "2011"
}
\end{filecontents}
\documentclass{letter}
\makeatletter
\newenvironment{thebibliography}[1]
{\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\makeatother
\usepackage[numbers]{natbib}
\let\bibsection\relax
\begin{document}
\begin{letter}{Some person}
\opening{Hello}
Some text \cite{First}, more text \cite{Second}.
\bibliographystyle{unsrtnat}
\bibliography{letter}
\end{letter}
\end{document}
The easiest approach here, without mucking around with page dimension modifications, is to insert a vertical re-adjustment using \vspace*{<len>}
where <len>
is some negative value. For example, in the following MWE, I've used \vspace*{-10\baselineskip}
to vertically "back up" 10 lines:
\documentclass{letter}
\usepackage{showframe}% http://ctan.org/pkg/showframe
\begin{document}
\thispagestyle{empty}
\signature{Nathan S. Lachenmyer}
\longindentation=0pt
\let\raggedleft\raggedright
\begin{letter}{%
Senior Staff Recruiter \\
XYZ Corporation \\
Rt. 56 \\
Anytown, New Jersey 05867}
\vspace*{-10\baselineskip}% Correct for vertical displacement
%This is my header
\centerline{\huge \bf \sc Nathan S. Lachenmyer} \par
%\begin{center}
%\line(1,0){450}
%\end{center}
\hrulefill
%letter begins here
\opening{Dear Person:}
Letter goes here
\closing{Sincerely Yours,}
\end{letter}
\end{document}
I've added the showframe
package to highlight the page/type block dimensions setup using the letter
document class. If you wish to change these to occupy more of the page real estate, use the geometry
package.
Ps. Instead of using \line
with some fixed measurement to draw a horizontal line, use \hrulefill
, which will fill across the entire text block without causing overful \hbox
warnings.
Best Answer
You can use the
\patchcmd
command from theetoolbox
package to patch the\opening
command:or you can patch it manually by including the following in your preamble:
Both yield the same output: