1

I am new to LaTex and following a tutorial to create a bibliography. I have created a .tex file which shows one citation and I have also created a .bib file. In both cases, the citation key is the same. I compile my LaTex file and the .pdf shows '[?]' instead of my citation. I am also missing a .blg file.

Can someone tell me what's wrong?

I am using Texworks (version 0.62, 2007-2017, 64-bit) downloaded from MikeTex (version 2.9).

From reading other posts, I have tried the following but with no success: - Adding and removing .bib in \bibliography{reftest} - Creating a new folder and starting from the beginning. - Followed instructions from: Question mark or bold citation key instead of citation number

Tex file Bib file PDF output

Any advice you can give would be appreciated!

Thanks!

Kevin
  • 13
  • 1
  • 3
  • 3
    you need to run pdflatex, bibtex, pdflatex – StrongBad Nov 30 '17 at 18:44
  • 3
    Welcome! Please do not paste code as images, but only as a code block. Every question should include a minimal working example (MWE) that can be copied and compiled. – Matthias Nov 30 '17 at 18:50

2 Answers2

2

There are several problems.

Firstly, the \bibliography command should appear in the body of your document at the point you want the reference list to be printed. In other words it needs to be place between \begin{document} and \end{document}, not in the preamble before \begin{document}.

Secondly, the citation key needs to match the key of the entry in the bibliography file, including the case. In your bibliography file the key is Birdetal2001, so you need to call \cite{Birdetal2001}, not \cite{birdetal2001}.

With these two changes you should get a correctly compiling document.

Sample output

\documentclass{article}

\bibliographystyle{plain}

\begin{document}

Test 1 test 2 test 3 \cite{Birdetal2001}.

\bibliography{reftest}

\end{document}

and reftest.bib:

@Article{
Birdetal2001,
author = {Bird},
title = {Hunting},
journal = {Ecology},
volume = 50,
pages = {9-19},
year = {2001} }

Note that it is sufficient to write

\bibliography{reftest}

instead of \bibliography{reftest.bib}.

Andrew Swann
  • 95,762
  • Thanks Andrew! This solved my problem and my references are working perfectly now. The inclusion of the correct code was really useful. – Kevin Nov 30 '17 at 22:05
0

How to run LaTeX file to print Bibliography?

Step 1: Run pdflatex filename.tex

Step 2: Run bibtex filename.aux

Step 3: Run again pdflatex filename.tex

LSpice
  • 1,448
Biki Teron
  • 3,275