[Tex/LaTex] Bibliography menu of TeXmaker

bibliographiesexamplestexmaker

I am using TeXmaker on windows 7 (if this matters).

I would like to know how to add bibliography (under the title, References) to a letter.

(I created this letter using the default template available.)

I saw in one of the questions here the following snippet, but it fails for me.

% Some Preamble that comes with the default letter Template
\begin{document}
\begin{letter}{--To whom is it written--} 
Some Text is here.
\printbibliography 
\end{letter}
\end{document}

%Bibfile
@Article{,
author = {•},
title = {•},
journal = {•},
year = {•},
OPTkey = {•},
OPTvolume = {•},
OPTnumber = {•},
OPTpages = {•},
OPTmonth = {•},
OPTnote = {•},
OPTannote = {•}
}

I have two other doubts as well:

  • Is the keyword that I'll use to cite this reference written

    1. in place of • in OPTkey={•} (in which case, I am wondering how is that OPTional?) or
    2. preceding the , that is on the first line?
  • When I press clean, all those OPTional fields for which I have entered some value also disappear. Is this the normal behaviour and in which case, will they show up on my reference?

I'd like thank you for your patience in reading this question and writing up an answer.

(P.S.: I am sorry if I packed in a lot to my question. And, as I'm a newbie here, I welcome any suggestions about the style of the question. )

Best Answer

Here's a step-by-step example of how to create a document with a bibliography using TeXMaker.

Create a bib file

Using the Bibliography menu, enter your bibliography entries. Save these as (Here I've chosen the name mybibfile.bib).

Here is a sample screen shot:

bibfile view

The first element of any bib file entry is the citekey. This must be unique for each entry in the file. I use keys based on the authors and the year of publication, but this scheme is up to you.

The "optional" fields in the entry are fields that basically won't cause any errors if they are missing. Many of them are required for proper bibliographic referencing, though, for example, the volume and pages are almost always required. You should put as much information as you have in a .bib entry.

Create a LaTeX document

Next, create a LaTeX document which uses \cite commands that refer to the citekeys in your .bib file.

The letter document class is not designed to support a bibliography, so I would suggest using the article class instead. Here's a simple example:

screen shot of file

The code of the document can be found here:

\documentclass[12pt]{article} % using article instead of letter class
\usepackage{natbib} % for the bibliography
\usepackage{parskip} % blank lines to separate paragraphs (common for letters, but not required)
\usepackage[small]{titlesec} % make section heading small
\begin{document}
\thispagestyle{empty}

\today

Dr. Joe Smith\\
Department of Linguistics\\
Somewhere in the World

Dear Dr. Smith:

The first analysis of the \textit{that}-trace effect as a filter was given by \cite{chomsky-lasnik1977}.

I look forward to hearing your comments.

Sincerely\\
Me
\bibliographystyle{apalike} % this is one type of author-year style
\bibliography{mybibfile} % this prints the bibliography section based on the \cite commands
\end{document}

Now you need to run pdflatex on this document, then bibtex, then pdflatex two more times. The final result should be:

enter image description here

Related Question