BibTeX, biblatex and biberbibliography in different chapter

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

bibliography in different chapter

Post by snowfrog »

Hi all,

I am writing a thesis and I want all chapters to be in different directories, but all linked via the \include statement. All is well except with the bibliography, for which I keep on having the following error message
This is BibTeX, Version 0.99c (Web2C 7.5.4)
The top-level auxiliary file: MWE1.aux
The style file: apalike.bst
A level-1 auxiliary file: SITES/MWE.aux
Database file #1: MWE1.bib
Warning--I didn't find a database entry for "Cosby94"
(There was 1 warning)
I've attached the mwe, the file MWE1.tex and MWE1.bib being in 1 directory and MWE.tex being in another. I'm guessing it is obvious when one knows bibtex pretty well...which I don't!
ps: I'd only like one bibliography section for the whole thesis (i.e. not at the end of each chapter)

Code: Select all

%MWE1.tex
\documentclass{article}
\usepackage[round]{natbib}

\begin{document}

\bibliographystyle{apalike} % style of bibliography

\include{SITES/MWE}
\bibliography{MWE1}

\end{document}

Code: Select all

%MWE.tex
This is what I am citing \cite{Cosby94}

Code: Select all

%MWE1.bib
@article{Cosby84,
       author = "Cosby, B. J. and  G. M. Hornberger and R. B. Clapp and T. R. Ginn.",
       title = "A Statistical Exploration of the Relationships of Soil-Moisture Characteristics to the Physical-Properties of Soils",
       journal = "Water Resources Research",
       volume = "20",
       pages = "682-690",
       year = "1984" }

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

bibliography in different chapter

Post by gmedina »

Hi,

you are citing using Cosby94, but the citation key in the .bib file is Cosby84.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

bibliography in different chapter

Post by snowfrog »

Thanks gmedina, it was a bit of a silly MWE... :oops: :oops:

I did have the problem with the chapters in my thesis with references that I knew are right, but your answer made me understand that in principle I was doing things right therefore it had to be was another stupid mistake (i.e. not a mistake with the date itself but something like this). And I found it...

When I edited my chapters so that they are just files called from a main program rather being stand-alone programs (i.e. with a preamble, \begin{document} etc...), I forgot to remove the \end {document} at the end of them so the main program thought the end was in the document called by \include. Using the previous MWE I had something like

Code: Select all

%MWE.tex
This is what I am citing \cite{Cosby94}
\end{document}
Newbie mistake but I thought I'd say just in case somebody else is as careless as I am...
Post Reply