BibTeX, biblatex and biberNatbib incompatible with Book documentclass??

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Tissie
Posts: 32
Joined: Wed Feb 18, 2009 9:40 pm

Natbib incompatible with Book documentclass??

Post by Tissie »

Dear All,

I am currently setting up a template for my thesis in the document class called Book.
Normally I have just worked with class article.

I also have a huge .bib library of all my references made and controlled by the open source software JabRef 2.5.

Now I have the problem that no matter what I try it texifies nicely, but there is no sign of any reference list. And there are only question marks within in-text citations, like this: [? ]

I have a main .tex file from which i INCLUDE the main chapters put in separate .tex files. The most important parts from the main .tex file is looking like this:

Code: Select all

\documentclass[12pt,fleqn]{book}
...
\usepackage[numbers,square,sort]{natbib}
...
\begin{document}
\include{Chapter1/Theory}

\bibliography{refs}
\bibliographystyle{ieeetr}

\end{document}
And then in the Theory.tex I write:

Code: Select all

Blablaba ~\cite{CITATIONinBibfile}.
As explained, this ends up with just a "Blablaba [? ]." And no reference list in the back of the book.

I appreciate any help and suggestions.

Thank you.

Best Regards,
Tissie

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

Natbib incompatible with Book documentclass??

Post by gmedina »

Hi,

just to make sure that everything in your system is working appropriately, do the following test:

1) Save the following file as test.tex

Code: Select all

\documentclass[12pt,fleqn]{book}
\usepackage[numbers,square,sort]{natbib}

\begin{document}
Some text and a cite: \cite{goossens93}...

and the following command will print all the bibitems: \nocite{*}...

\bibliographystyle{ieeetr}
\bibliography{biblio}

\end{document}
2) In the same folder, save the following file as biblio.bib:

Code: Select all

@book{goossens93,
	author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
	title = "The Latex Companion",
	year = "1993",
	publisher = "Addison-Wesley",
	address = "Reading, Massachusetts"

}

@book{knuth79,
	author = "Donald E. Knuth",
	title = "Tex and Metafont, New Directions in Typesetting",
	year = "1979",
	publisher = "American Mathematical Society and Digital Press",
	address = "Stanford"
}

@book{lamport94,
	author = "Leslie Lamport",
	title = "Latex: A Document Preparation System",
	year = "1994",
	edition = "Second",
	publisher = "Addison-Wesley",
	address = "Reading, Massachusetts"
}

@misc{patashnik88,
	author = "Oren Patashnik",
	title = "{B}ib{T}e{X}ing.  Documentation for General {B}ib{T}e{X} users",
	year = "1988",
	howpublished = "Electronic document accompanying BibTeX
distribution"
}

@techreport{rahtz89,
	author = "Sebastian Rahtz",
	title = "A Survey of {T}ex and graphics",
	year = "1989",
	institution = "Department of Electronics and Computer Science",
	address = "University of Southampton, UK",
	number = "CSTR 89-7"
}
Now, compile test.tex in the following way:

Code: Select all

pdflatex test
bibtex test
pdflatex test
pdflatex test
(your editor probably has some way to automate this compilation procedure).

Please report the outcome of this little test (did you get any warnings/errors or did you get the final pdf file with the bibliography?).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Tissie
Posts: 32
Joined: Wed Feb 18, 2009 9:40 pm

Natbib incompatible with Book documentclass??

Post by Tissie »

Please report the outcome of this little test (did you get any warnings/errors or did you get the final pdf file with the bibliography?).

I did NOT observe any warnings, and I DID get the bibliography in the final PDF.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Natbib incompatible with Book documentclass??

Post by gmedina »

Then, we'll need some more info. Can you please post here (as an attchment in the form of a zip file, for example) the file refs.bib and your .tex files so that we can take a look at them?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Tissie
Posts: 32
Joined: Wed Feb 18, 2009 9:40 pm

Re: Natbib incompatible with Book documentclass??

Post by Tissie »

I have made a copy and attached the documents in the zip-folder.

Please note that I have stripped all chapters but one, and only one reference is left in the .bib file.
Also note that this is a template I recieved from a colleague. He used \begin{thebibliography} and \bibitem commands for references which also works for me.. but i naturraly want to be able to use my huge .bib database.

I appreciate your help. If anything is missing from the zip-folder let me know.

Thank you
Attachments
Tissie_Thesis_TeXForum_for_help.rar
(66.86 KiB) Downloaded 343 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Natbib incompatible with Book documentclass??

Post by gmedina »

Hi,

I think I found the problem. But first, let me ask you a question: do you really need to use the file grthesis.sty? (it is an old style file which uses old LaTeX code and some obsolete packages, such as fancyheadings...)

In fact, this style file will produce an error precisely for using fancyheadings commands; open the file grthesis.sty and search for ths line:

Code: Select all

\setlength{\headrulewidth}{0.3pt}           % Default 0.4pt is too thick
and replace it with

Code: Select all

\renewcommand{\headrulewidth}{0.3pt}           % Default 0.4pt is too thick
Now, your example document should compile with no errors; at least, it did so on my system.

Some other comments:

1) Do not use the a4 package; to change the page layout, use the geometry package instead.
2) Do not use the subfigure obsolete package; use the subfig package instead.
3) Change the order of these two lines:

Code: Select all

\bibliography{refs}
\bibliographystyle{ieeetr}
to

Code: Select all

\bibliographystyle{ieeetr}
\bibliography{refs}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Tissie
Posts: 32
Joined: Wed Feb 18, 2009 9:40 pm

Re: Natbib incompatible with Book documentclass??

Post by Tissie »

Thank you, but unfortunately these changes have no effect at all.

I still DONT get any reference in either pdflatex or texify (DVI viewer).

It gives som warnings in the log file, please see the main.log attachment.
Attachments
Main.log
(8.94 KiB) Downloaded 367 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Natbib incompatible with Book documentclass??

Post by gmedina »

Hi,

I'am attaching the file test.zip containing: Main.tex, theory.tex, refs.bib and Main.pdf (so that you can see the result of compiling Main.tex).

Please copy Main.tex, theory.tex and refs.bib in a same folder and process Main.tex; do you get the same result as I did? If not, please post the log file obtained after compilation.
Attachments
test.zip
(88.08 KiB) Downloaded 331 times
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Tissie
Posts: 32
Joined: Wed Feb 18, 2009 9:40 pm

Re: Natbib incompatible with Book documentclass??

Post by Tissie »

Yes, I get the same. Cool, we're getting closer :)

But now the header line is short and looks weird compared to the original? Something has happened to margins?

Edit:::
I uploaded the new log file
Attachments
Main.log
(7.67 KiB) Downloaded 413 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Natbib incompatible with Book documentclass??

Post by gmedina »

Hi,

well it seems that in fact we're getting somewhere. Reading the log files you've attached I noticed that you are using MiKTeX2.7 and that there's some conflict with chapterbib (again originated from grthesis.sty). Try this:

1) Update your system to MiKTeX2.8.
2) Try processing the first complete example that you posted but deleting the line

Code: Select all

\usepackage{grthesis}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply