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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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? :)

share|improve this question
Is your MWE definitely minimal? :) – cmhughes Nov 15 '12 at 2:44
Okay, I understand. Bad thing ... Get well soon. – Kurt Nov 15 '12 at 3:18
@drN when you look at the .aux file you can notice that there are not \bibstyle{...} and \bibdata{...} these are created by \bibliographystyle{...} and \bibliography{...}. This suggests that there there might be a premature \end{document} in the file mathfluid_3.tex. – Guido Nov 15 '12 at 4:34
Have you tried removing all auxiliary files and recompiling? If that also doesn't work, I'd try using \includeonly in combination with \include and temporarily leaving out file by file until (hopefully) the problem is solved. I suggest you remove all auxiliary files after a failure and before you start recompiling. If @Guido is right about the premature \end{document} you can chase it by putting an undefined command at different locations in your file. If compilation fails, it means the location must have been before LaTeX saw the \end{document}, otherwise it must have been after. – Marc van Dongen Nov 15 '12 at 7:13
Be careful: \begin{document} and \end{document} in an included file are definitely out of place. – egreg Nov 15 '12 at 16:48

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.

share|improve this answer

protected by Community Jan 11 '14 at 7:05

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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