<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
How can I add a bibliography to a letter?  I have tried both scrlttr2 and letter document classes.  I used this example and got this error from the scrlttr2 version and similar from the letter version:
<div><br>
</div>
<div>
<div>%!TEX TS-program = pdflatexmk</div>
<div><br>
</div>
<div>\documentclass[fontsize=12pt, paper=letter]{scrlttr2}</div>
<div>\usepackage[longnamesfirst]{natbib} </div>
<div><br>
</div>
<div>% Dont forget to read the KOMA-Script documentation, scrguien.pdf</div>
<div><br>
</div>
<div>\setkomavar{fromname}{} % your name</div>
<div>\setkomavar{fromaddress}{Address \\ of \\ Sender}</div>
<div><br>
</div>
<div>\setkomavar{signature}{} % printed after the \closing</div>
<div>\renewcommand{\raggedsignature}{\raggedright} % make the signature ragged right</div>
<div><br>
</div>
<div>\setkomavar{subject}{} % subject of the letter</div>
<div><br>
</div>
<div>\begin{document}</div>
<div>\bibliographystyle{apalike}</div>
<div>\begin{letter}{Name and \\ Address \\ of \\ Recipient}</div>
<div><br>
</div>
<div>\opening{}  % eg. Hello</div>
<div><br>
</div>
<div>some stuff</div>
<div><br>
</div>
<div>\closing{} %eg. Regards</div>
<div><br>
</div>
<div>\bibliography{unified}</div>
<div>\end{letter}</div>
<div><br>
</div>
<div>\end{document}</div>
</div>
<div><br>
</div>
<div>....</div>
<div><br>
</div>
<div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">)) (/usr/local/texlive/2014/texmf-dist/tex/latex/koma-script/DIN.lco)</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">(/usr/local/texlive/2014/texmf-dist/tex/latex/natbib/natbib.sty</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo; min-height: 14px;">
<br>
</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">/usr/local/texlive/2014/texmf-dist/tex/latex/natbib/natbib.sty:1063: LaTeX Erro</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">r: Environment thebibliography undefined.</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo; min-height: 14px;">
<br>
</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">See the LaTeX manual or LaTeX Companion for explanation.</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">Type  H <return>  for immediate help.</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;"> ...                                              </div>
<p style="margin: 0px; font-size: 12px; font-family: Menlo; min-height: 14px;">                                                  <br class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">l.1063 \renewenvironment{thebibliography}</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">                                         [1]{%</div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">? </div>
<div style="margin: 0px; font-size: 12px; font-family: Menlo;">Process aborted</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Sam</div>
</body>
</html>