2

I have problems when compiling my code. Latex tells me it is the piece of code shown below. The bibtex file seems to have the correct format (I exported it from Mendeley) but LaTeX gives me a warning and tells me that there is an undefined citation (Bakshi2003). Any idea on how to change this? (I followed an example where it seemed to work).

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage[british,UKenglish,USenglish,english,american]{babel}
\usepackage[utf8]{inputenc} 
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{url}
\usepackage{amsmath}
\usepackage{amsfonts,graphicx,amsmath,amssymb,hyperref,color}
\usepackage[all]{xy}
\usepackage{setspace}
\usepackage{natbib}
\usepackage{blindtext}
%\usepackage{cite}
\onehalfspacing
%\input xy
%\xyoption{all}
\makeindex
\frenchspacing
\sloppy
\usepackage{times}
\usepackage{tikz}
%\usetikzlibrary{arrows,automata}
\usepackage{mathrsfs}
\numberwithin{equation}{section}
\title{Option Implied Distributions}
\author{Nis Mathias Schulte Matzen}



\begin{document}
%\maketitle
%\publishdate{\toda}
%\makeauthor
\begin{titlepage}
\begin{center}
    \vspace*{1cm}

    \Huge
    \textbf{Option Implied Distributions}

    \vspace{0.5cm}
    \LARGE
    A study of risk neutral return distributions

    \vspace{1.5cm}

    \textbf{Nis Mathias Schulte Matzen}

    \vfill

    A thesis presented for the degree of\\
    Master in Economics (Cand.polit)

    \vspace{0.8cm}

    %\includegraphics[width=0.4\textwidth]{university}

    \Large
    Department of Economics\\
    University of Copenhagen\\
    Denmark\\
    \date{}

\end{center}
\end{titlepage}
\begin{abstract}
Abstract here...
\end{abstract}
\newpage
\tableofcontents
\newpage
\subsection{Introduction}% a
Here is yada yada \cite{Bakshi2003} yada.

\bibliographystyle{plain}
\bibliography{Thesis.bib}
\end{document} 

The Thesis.bib file looks like this:

@article{Bakshi2003, 
author = {Bakshi, G.}, doi = {10.1093/rfs/hhg002}, 
file = {:C$\backslash$:/Users/Mathias/Dropbox/Speciale/Delta-hedgedgains 
and the negative   market volatility risk premium.pdf:pdf}, issn = {14657368},  
journal = {Review of Financial Studies}, month = apr, number = {2}, pages = {527--
566}, title = {{Delta-Hedged Gains and the Negative Market Volatility Risk
Premium}}, url = {rfs.oupjournals.org/cgi/doi/10.1093/rfs/hhg002}, volume = {16},
year = {2003} }
  • 1
    Are you sure the bibliography path is correct? C:Users/Mathias/Dropbox/Thesis 2014/Thesis.bib does look a bit fishy to me, for one, there is normally no file extension in \bibliography{...}; save the .bib file in the same folder and try \bibliography{Thesis}. – moewe Mar 19 '14 at 14:36
  • Thanks for the answer. I cannot make it Work - it still produces the same warnings/errors but I guess it's okay to just write thesis and save it the same place as the other... Do i need to use other packages than \usepackage{cite} – Mathias Mar 19 '14 at 15:05
  • No, that should not be required. You can use any of LaTeX's cite packages (there is also natbib for example). – moewe Mar 19 '14 at 15:15
  • I just included some more code - if you can spot anything that could produce the errors, that would be really cool :) – Mathias Mar 19 '14 at 15:29
  • You load graphicx twice; also you seem to load a lot of packages you do not need in the MWE, of course that will be different in the actual document you write, but try to load as few additional packages as possible. hyperref should normally be loaded last. You do not have to load amsfonts if you load amssymb, since the latter loads the former internally. – moewe Mar 19 '14 at 15:40
1

Example works just fine after I do this substitution

\bibliography{Thesis.bib} -> \bibliography{Thesis}

and use pdflatex, bibtex, pdflatex, pdflatex

BTW: a much simpler MWE:

\begin{filecontents*}{Thesis.bib}
@article{Bakshi2003, 
  author = {Bakshi, G.}, 
doi = {10.1093/rfs/hhg002}, 
file =
{:C$\backslash$:/Users/Mathias/Dropbox/Speciale/Delta-hedgedgains and
  the negative market volatility risk premium.pdf:pdf}, 
issn = {14657368}, journal = {Review of Financial Studies}, month =
apr, number = {2}, 
pages = {527--566}, title = {{Delta-Hedged Gains and the Negative
    Market Volatility Risk Premium}}, 
url = {rfs.oupjournals.org/cgi/doi/10.1093/rfs/hhg002}, volume = {16}, year = {2003} }
\end{filecontents*}
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc} 
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{url}
\begin{document}
Here is yada yada \cite{Bakshi2003} yada.

\bibliographystyle{plain}
\bibliography{Thesis}
\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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