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 am having trouble with generating references. For some citations instead of authors names the file generates question marks. I tried the suggested found in this forum and already I am aware for the "compile - double compile" process but no progress.

Can someone help me?

Here is parts of my code

\documentclass[a4paper]{article}
\usepackage[hmargin=2.5cm,vmargin=1cm]{geometry}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage[pdftex]{graphicx}
\usepackage{xcolor}
\usepackage{setspace}
\setstretch{2} 
\usepackage[utf8]{inputenc}
\usepackage{booktabs} 
\usepackage{textcomp}
\usepackage{float}

\usepackage[round]{natbib}
\usepackage[hidelinks,colorlinks,urlcolor=blue, linkcolor=blue, citecolor=blue]{hyperref}
\begin{document}
\section{Introduction}
For a survey see \citet{Perotti2008} who...
A leading example is \citet{Papageorgiou2012} who

\newpage 

\bibliographystyle{plainnat}
\bibliography{references}
\end{document}

The bibliography file contains the following entries

@TECHREPORT{ Perotti2008,
title = {In Search of the Transmission Mechanism of Fiscal Policy},
author = {Hill, Scott and Wootters, William K.}
booktitle = {NBER Macroeconomics Annual 2007",}
volume = {22},
publisher = {National Bureau of Economic Research}
year = {1997},
}

@ARTICLE{Papageorgiou2012,
  author = {Papageorgiou Dimitris},
  title = {Fiscal Policy Reforms in General Equilibrium: The case of Greece},
  journal = {Journal of Macroecnomics},
  year = {2012},
  volume = {34},
  pages = {504-522},
  owner = {Minamar},
  timestamp = {2012.08.03}
}
share|improve this question
3  
Your entries are faulty, commas are missing after some fields and in booktitle there is a single quote and the comma is inside the braces. –  Ulrike Fischer Aug 22 '12 at 10:40

1 Answer 1

up vote 5 down vote accepted

As Ulrike said in her comment, you have some errors in your bib file.

A little explanation: Each entry of your bib file has to be build like this:

@literature{key,
  name  = {value(s)},
  name1 = {value(s)},
  ...
  namen = {value(s)}
}

literature can be book, article etc., key is the citation key, name stands for the name of a field entry like author, title etc. and value(s) represent the values of the field entry, the name of the author, the book title etc. Each line has to be ended with an comma (outside the }), exept the last one, there you can write a comma or not. Writing not a comma causes often errors when you add a new line.

So your corrected part of the bib file with a little bit pretty printing should look like you can see in the updated MWE.

Update:

The following MWE runs on my system without any error or warning:

\RequirePackage{filecontents}           % allows overwriting of file
\begin{filecontents*}{\jobname.bib}
@TECHREPORT{Perotti2008,
  title       = {In Search of the Transmission Mechanism of Fiscal Policy},
  author      = {Hill, Scott and Wootters, {William K.}},
  booktitle   = {NBER Macroeconomics Annual 2007},
  volume      = {22},
  publisher   = {National Bureau of Economic Research},
  institution = {National Bureau of Economic Research??????},
  year        = {1997},
}

@ARTICLE{Papageorgiou2012,
  author    = {Papageorgiou, Dimitris},
  title     = {Fiscal Policy Reforms in General Equilibrium: The case of Greece},
  journal   = {Journal of Macroecnomics},
  year      = {2012},
  volume    = {34},
  pages     = {504--522},
  owner     = {Minamar},
  timestamp = {2012.08.03},
}
@ARTICLE{Edenber1999,
  author  = {Edenberg, Wendy and Martin Eichenbaum and DM Fischer},
  title   = {Understanding the Effects of Shocks to Government Purchases},
  journal = {Review of Economic Dynamics},
  year    = {1999},
  pages   = {166--206},
  owner   = {Minamar},
  timestamp = {2012.03.03}
}

@UNPUBLISHED{Leeper2008,
  author = {Leeper, E. M. and Walker, {T. B.} and S.-C S.Yang},
  title  = {Fiscal foresight: Analytics and econometrics},
  month  = {May},
  year   = {2008},
  owner  = {Minamar},
  timestamp = {2012.08.05}
}
\end{filecontents*}

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc} 

\usepackage[round]{natbib}
\usepackage{hyperref}

\begin{document}
\section{Introduction}
For a survey see \citet{Perotti2008} who~\dots
A leading example is \citet{Papageorgiou2012} who~\dots
%\nocite{*}   % all entrys in bibliography to test the bib file

\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}

Use this example to test your bib entrys. Just copy one of your entry into the MWE and run it again (remeber: three times).

Update 2:

I added two corrected entrys of your bibliography in the MWE. The article entry Edenber1999 has a lot of problems in the author field. I tryed to correct it. Please check by your own. The entry Leeper2008 shows another problem: write authors either "Name, Firstname" or "Firstname Name". Don't mix it. Better include the complete firstnames of the authors. Have a look on Author Yang (blank missing: S. Yang?). Do not use \& instead of and.

share|improve this answer
    
I indeed noticed those faulty entries. I made the changes but still i am having trouble seeing my references on the text. I provided these two references, because while the second it shows up the first does not. I really have trouble. I checked the syntax all the time, compiled the files numerous times but still no progress. I am still receiving the "citations undefined" without understanding what is the problem. –  user17880 Aug 22 '12 at 18:32
    
Have a look at the blg file which contains the log for the bibtex run. Check each error and warning and correct your bib file. Then rerun your tex document. –  Kurt Aug 22 '12 at 18:49
1  
I added a MWE to my answer to help you. Have you found the warnings in the blgfile? –  Kurt Aug 22 '12 at 19:48
    
thanks Kurt. Your MWE worked when i run it. But not when i am trying to run my whole original document. The blg file says there are there are some undefined citations. "Package natbib Warning: Citation `Perotti2008' on page 3 undefined on input line" –  user17880 Aug 22 '12 at 20:51
    
Well, how to edit your question and add the first part of this blg file? Or make a zip file of log file, blg file and your bib file and post an link here so that we can see what happens. If you not want to do this you must be more specific: which entry gives the first warning, which warning and show us the bib file from the start till the entry with the error. –  Kurt Aug 22 '12 at 21:00

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.