Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've spend hours already trying to get natbib running. Im using Texmaker on Windows XP and just cannot find the problem:

  • I made sure the link to the .bib file is correct
  • I changed the bibliography style to a "natbib" compatible one
  • I'm compiling document, bibtex, document, document

So is there maybe any problem with my code?

\documentclass[12pt,oneside,a4paper]{article}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1.15ex plus 0.4ex minus 0.2ex}
\usepackage{graphicx}
\graphicspath{{./figures/}}
\usepackage{hyperref}
\usepackage{float}
\usepackage{microtype}
\usepackage[doublespacing]{setspace}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[left=4cm, right=2cm, top=1cm, bottom=1cm, includeheadfoot]{geometry}
\usepackage{natbib}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\rfoot{\thepage}

\begin{document}
\section{Introduction}
For 2011, OECD reports...  \citet{oecd11}

\bibliographystyle{plainnat}
\bibliography{ba-thesis.bib}
\end{document}
share|improve this question
1  
Welcome to TeX.SX. You shouldn't use the .bib extension in the argument to \bibliography. Write \bibliography{ba-thesis} –  egreg Mar 24 '12 at 0:01
    
Checked, the problem remains. Nevertheless, thanks @egreg –  Skywalker187 Mar 24 '12 at 0:04
    
Welcome to TeX.SE! A quick comment: I've removed the "thanks" line from your question; in this group, we tend not to thank people with words for comments and answer they may provide. Upvoting their answers and accepting the best answer you get is the best way of expressing your gratitude. Two quick observations on your code: First, there's no need to include ".bib" in the argument of the \bibliography command. Second, did you remember to run bibtex following a latex run, followed by two more latex runs? –  Mico Mar 24 '12 at 0:04
add comment

1 Answer

up vote 2 down vote accepted

Your file runs pproperly with me if:

remove .bib extension from the bibliography file

and RUN:

pdflatex

bibtex

pdflatex

pdflatex

in this sequence.

enter image description here

If it is not working for you, you may check the log file generated by bibtex. (Have you defined the bibtex key oecd11 in your bibtex entry?) You may also post your bibtex entry along with MWE.

PS. Since you did not provide the .bib file, I used another one.

share|improve this answer
    
Im 110% sure I had tried that before (removing the .bib extension). But anyway, it is working now! –  Skywalker187 Mar 24 '12 at 1:57
    
@Skywalker187, I do not quite understand. Any way I happy that it is working now for you. –  Harish Kumar Mar 24 '12 at 1:59
    
By the way, this forum seems like a great place to be. –  Skywalker187 Mar 24 '12 at 1:59
    
@Skywalker187, True. People here are friendly and helpful. –  Harish Kumar Mar 24 '12 at 2:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.