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'm having a problem with printing the bibliography at end of a book. The main .tex file is

\documentclass[a4paper,12pt]{book}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{url}
\usepackage[algoruled,vlined]{algorithm2e}
\usepackage{graphicx,subfigure}
\usepackage{booktabs}
\usepackage[usenames,dvipsnames]{color}

\usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption}

% fancy headers and footers
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.1pt} % for upper line
\renewcommand{\footrulewidth}{0.1pt} % for lower line
 \fancyhead[LE,RO]{\itshape \nouppercase \rightmark}\fancyhead[LO,RE]           {\itshape \nouppercase \leftmark}
\fancyfoot[C]{\thepage}

 \usepackage[semicolon]{natbib}

\usepackage{fancybox}

\usepackage{xcolor}
\usepackage{framed}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\newenvironment{myfancybox}{%
\def\FrameCommand{\fboxsep=\FrameSep \fcolorbox{black}}%
\color{black}\MakeFramed {\FrameRestore}}%
{\endMakeFramed}


\usepackage{rotating}


\usepackage{sectsty}
\allsectionsfont{\itshape}

\setlength{\headheight}{15pt}

\parskip1ex
\begin{document}

\include{forTest}
\bibliographystyle{plainnat}
\bibliography{refs}
\end{document}

In a document forTest.tex put

\chapter{abs}
\label{ch:grid}

\section{asdf }
As stated in \citep{ads}.

and the content of the refs.bib file that is in the same folder as the other files:

@inproceedings{ads,
author = "adfsdf, k.",
title = "adf",
booktitle = "sdaf",
series = "adsf",
pages = "19",
publisher = "sda",
year = 2008
}

After I hit pdflatex, citation adf is undefined. Note that the bib file is very large, and I should not adapt that file. I wonder if there is some other way to include it.

share|improve this question
4  
have you run bibtex? you need pdflatex bibtex pdflatex to sort out all the references –  David Carlisle Jun 11 '12 at 14:48
    
Many thanks. Note that by pdflatex only I managed to do some shorter documents, but that's different story, I guess. –  boy Jun 11 '12 at 14:55
add comment

1 Answer

On the first run of latex you would always expect cross references to be undefined.

If using bibtex you need to run (pdf)latex once (to write the list of needed citations to the aux file) then you need to run bibtex (to generate the bbl file that contains the LaTeX code for the bibliography) Then you need to run (pdf)latex twice more to resolve all the cross references to the generated bibliography.

share|improve this answer
    
Yes, thanks. Now it works perfectly. I still have some questions related to referencing, but that will not be posted here. –  boy Jun 11 '12 at 15:04
add comment

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.