[Tex/LaTex] Bibliography not compiling


I have a latex file for my dissertation wherein I include several chapters. Everthing (\ref, figures) compiles file except my bibliography.
Scouring the internet does me no help as this seems to be full of deadends. The error message from bibtex that I get is:

 bibtex Thesis_Final_ps_11142012a.aux 
This is BibTeX, Version 0.99c (TeX Live 2009/Debian)
The top-level auxiliary file: Thesis_Final_ps_11142012a.aux
A level-1 auxiliary file: Applications.aux
A level-1 auxiliary file: LiteratureReview.aux
A level-1 auxiliary file: Microgravity.aux
A level-1 auxiliary file: modified-evolution-equation-11_08_2012.aux
A level-1 auxiliary file: ConstitutiveRelationship_05_17_2012a.aux
A level-1 auxiliary file: MaximizingWavenumber_11082012.aux
A level-1 auxiliary file: Validation_ps.aux
A level-1 auxiliary file: Results_1.aux
A level-1 auxiliary file: Contributions.aux
A level-1 auxiliary file: mathfluid_3.aux
I found no \bibdata command---while reading file Thesis_Final_ps_11142012a.aux
I found no \bibstyle command---while reading file Thesis_Final_ps_11142012a.aux
(There were 2 error messages)

My latex file is:


%Stuff like names that I don't want to reveal on this forum

%% Bibliography


%% eof

My preamble (MTU_Thesis_Style21) has:

% --------
\usepackage{lscape}         % allows for landscape tables and figures
\usepackage{paralist}       % enancements to list environment
\usepackage{array}          % enhancements to array and tabular environments
\usepackage{longtable}      % multipage tables
\usepackage{setspace}       % easy single or doublespacing
\usepackage{listings}       % for listing computer code such as matlab
\usepackage[bw]{mcode}      % for matlab code with listings package
\usepackage[square,comma,sort&compress]{natbib} % enhances bibtex citations
% \usepackage{biblatex}
\usepackage{setspace}       % \singlespacing, \onehalfspacing, \doublespacing, ...


I can't seem to figure out whats going wrong.
When I try to bibtex my aux file without all these \include statements, things are fine!!!!

Why are most of my citations missing from my aux file? :( I am beginning to hate latex with a passion.

Aux file:

\global \let \oldcontentsline\contentsline
\gdef \contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global \let \oldnewlabel\newlabel
\gdef \newlabel#1#2{\newlabelxx{#1}#2}
\gdef \newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\let \contentsline\oldcontentsline
\let \newlabel\oldnewlabel}
\global \let \hyper@last\relax 

\@writefile{toc}{\contentsline {chapter}{\hbox to\@tempdima {\hfil }Table of Contents}{iii}{chapter*.1}}
\@writefile{toc}{\contentsline {chapter}{\hbox to\@tempdima {\hfil }List of Figures}{xiii}{chapter*.2}}
\@writefile{toc}{\contentsline {chapter}{\hbox to\@tempdima {\hfil }List of Tables}{xiv}{chapter*.3}}

Causative of the error message

The error messages that bibtex gave me were as a result of two of the .tex files that I included using \include


%% eof

The above mathfluid.tex that I used in one of the \include called on another tex file via \input{format_mathplots_3}. This format_math_plots.tex was again, erroneously included in the main file. Somehow (I don't know why) bibtex didn't like that althoug this file didn't have any citations. It might be as a result of conflicting aux files but I am clueless about it.

Would anyone care to offer an explanation for this? :)

Best Answer

The BibTeX log reports that the aux files does not contain \bibstyle and \bibdata. These two instructions are written in the aux file by the commands \bibliographystyle and \bibliography. The two commands are present in the main file. This suggests that one of the included files contains \end{document}. In this case, the \end{document} appears in mathfluid_3.tex (or as the edit indicates in one of the files embedded in it). \end{document}, typically, instructs the TeX compilers to terminates the compilation, and everything appering after it is ignored.

Related Question