BibTeX, biblatex and biberNatbib doesn`t include references

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
Eistee87
Posts: 3
Joined: Mon Jul 18, 2011 2:24 pm

Natbib doesn`t include references

Post by Eistee87 »

Hi,
I want to write my thesis with latex but the first section already causes problems with the references. I used RefWorks for my citation and exported the file to my computer (same folder as the main document). I also have a second file (Material&Methods) which I included via \include. I am using the natbib package and when I compile the document with Texniccenter I get the message "natbib warning: Citation Refworks:45 on page 2 undefined in input line 3. The references are cited with \citet
Here is the minimal code from my main file:

Code: Select all

\documentclass{report}
\usepackage{natbib}
\usepackage{textcomp}
%__________________________________
\begin{document}
\chapter{Chapter 1}
\include{Material&Methods}
\bibstyle{plainnat}
\bibliography{bib}
\end{document
using \nocite{}in the main file didn't show any reference in the output. Therefore I think it is something with the bibtex file.
However, the text from the file is included in the compiling process, it just leaves out the references.
I tried to find a solution on google but wasn't successful with it, so hope someone can help. Thanks.
Attachments
bib.bib
BibTex file
(28.75 KiB) Downloaded 386 times
Last edited by Eistee87 on Tue Jul 19, 2011 5:36 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Natbib doesn`t include references

Post by meho_r »

Three things for starters:

1. You shouldn't include external documents in your Minimal Working Example (MWE) – so, no \include command.

2. Never, ever use spaces and special characters in file names (i.e., Material&Methods should be MaterialAndMethods or Material_and_Methods or something similar).

3. To get bibliography displayed, you must run the sequence: latex — bibtex — latex — latex (of course, you'd probably use pdflatex instead of latex).

This code works nicely:

Code: Select all

\documentclass{report}

\usepackage{natbib}
\usepackage{textcomp}

\begin{document}

\chapter{Chapter 1}

Test \citet{RefWorks:38}.

\bibliographystyle{plainnat}
\bibliography{bib}

\end{document}
Eistee87
Posts: 3
Joined: Mon Jul 18, 2011 2:24 pm

Re: Natbib doesn`t include references

Post by Eistee87 »

Hi,

thanks for your quick response. The code that you provided works. However, if I use the \include command I get the error posted on top of the page. The file that should be included consists out of \section and \subsection commands only. Do i have to tell the compiler or TeXnicCenter to look for the references on the source file. It should do that automatically, shouldn't it? I attached the log file for you so you can take a look, I am clueless.

Thank you
Attachments
1Main.log
(8.78 KiB) Downloaded 375 times
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Natbib doesn`t include references

Post by meho_r »

I still cannot reproduce the problem. Check that there are no typos in citation commands in MaterialandMethods file. Also, don't forget the sequence: pdflatex — bibtex — pdflatex — pdflatex. I cannot tell if you should set anything specific in TeXnic Center, since I don't know how it works. But you can try another editor, just to make sure that the problem is not TC-related. E.g., you can try compiling your doc with TeXworks, or even running pdflatex and bibtex on your main .tex file from the Terminal/Command Prompt.

Here's an example with your .bib file and two external documents. Check if this works. If yes, then you have a problem somewhere in your document and without seeing it it may not be possible to determine where exactly the problem lies.
Attachments
NatbibTest.zip
(8.88 KiB) Downloaded 277 times
Eistee87
Posts: 3
Joined: Mon Jul 18, 2011 2:24 pm

Re: Natbib doesn`t include references

Post by Eistee87 »

Thank you. Problem solved. It was a typo I used \bibstyle instead of \bibliographystyle
Had it wrongly written down in my notes, but with the correct command it works well.
Post Reply