I am trying to create my first book using book
-class. I have successfully included chapters and the reference pages of each chapter are shown flawlessly. However, for some reason my citations in the main text don't work – for example, instead Sims (2003), I get author ?. I have tried numerous things but can't figure out, why is this happening – would appreciate a lot, if someone could help.
Here is a piece of code that I find relevant:
The main thesis.tex
file that includes chapters:
\documentclass[a4paper,12pt]{book}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[numbers,sectionbib]{natbib}
\usepackage{chapterbib}
\usepackage[onehalfspacing]{setspace}
\usepackage{graphicx}
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{color}
\usepackage[utf8]{inputenc}
\usepackage{fullpage}
\usepackage{epigraph}
\usepackage{xr}
\setcounter{MaxMatrixCols}{10}
%\addtolength{\oddsidemargin}{-0.5in}
%\addtolength{\evensidemargin}{-0.5in}
%\addtolength{\textwidth}{1.0in}
%\addtolength{\topmargin}{-0.5in}
%\addtolength{\textheight}{1.0in}
\setlength{\epigraphwidth}{0.7\textwidth}
\usepackage[titletoc]{appendix}
%\bibliographystyle{plainnat}
\begin{document}
\frontmatter
%\pagenumbering{roman}
\tableofcontents
\mainmatter
%\pagenumbering{arabic}
\include{tex/chapter1}\newpage\cleardoublepage
%\input{tex/chapter2}\newpage\cleardoublepage
%\input{tex/chapter3}\newpage\cleardoublepage
%\input{tex/chapter4}\newpage\cleardoublepage
%\input{tex/chapter5}\newpage\cleardoublepage
\end{document}
Inside chapters I call references page by:
\renewcommand\bibname{{REFERENCES}}
\bibliographystyle{plainnat}
\bibliography{tex/references}
Inside chapter texts I cite in the following way:
\citet{Weibull2007}
While the corresponding entry in the bib file references looks like:
@ARTICLE{Weibull2007,
author = {Jorgen W. Weibull and Lars-Goran Mattsson and Mark Voorneveld},
title = {Better May be Worse: Some Monotonicity Results and Paradoxes in Discrete Choice Under Uncertainty},
journal = {Theory and Decision},
year = {2007},
volume = {63},
month = {September},
timestamp = {2016.06.26}
}
As an output of this citation I get: (author?) [54] study
More information on the chapter setups:
\chapter[Content title ]{}
\title{Title}
\begin{center}
\huge{Title}
\footnote{text}
\large{author\footnote{
text}}
\vspace*{2cm}
\end{center}
\begin{center}
\textmd{Abstract}
\end{center}
text
\newpage
\section{Introduction}
text. cite{author1} text.\citep{author2} text. \ref{Sec: Model1} text.
\section{Section two}
text. \citeauthor{author3}.
\section{Conclusion}
text
\renewcommand\bibname{{REFERENCES}}
\bibliographystyle{plainnat}
\bibliography{tex/Citation}
\begin{appendices}
\appendixpage
\noappendicestocpagenum
\addappheadtotoc
\section{one}
text
\section{two}
text
\end{appendices}
Does anybody see the problem? Any help would be much appreciated.
Best,
Mark
Best Answer
Since you're using the
natbib
citation management package, you should (a) use theplainnat
bibliography style instead of theplain
bibliography style and (b) load thenatbib
package with the optionnumbers
. That way, you can produce author-number style citation call-outs via\citet
and purely numeric-style citation call-outs via\citep
.Separately, since you're using the
chapterbib
package to create per-chapter bibliographies while employing section-level rather than chapter-level per-chapter bibliographies, you should (a) loadnatbib
with the optionsectionbib
(in addition to the optionnumbers
-- see above) and (b)\include
rather than\input
thechapterx.tex
files. (See page 4 of the user guide of thechapterbib
package.) Provide\bibliographystyle
instructions in eachchapterx.tex
file. After the initial LaTeX run, there will be separatechapterx.aux
files (in addition to the\jobname.aux
file.) Run BibTeX separately on each of the chapter aux files, by typingbibtex chapter1
,bibtex chapter2
, etc -- one per chapter. You may have to open a command window and run bibtex manually. Then, run LaTeX twice more to fully propagate all changes.TWo additional suggestions/observations:
As you're using the
book
document class, do use high-level commands such as\frontmatter
and\mainmatter
instead of low-level instructions such as\pagenumbering{roman}
and\pagenumbering{arabic}
.Do make sure that all information in your bib entries is correct and complete. E.g., in the Weibull2007 entry, two fields (
number
andpages
) were missing and the first names of two of the authors were missing diacritics.