[Tex/LaTex] Bibtex problem: It doesn’t always work

bibtexerrors

My BibTeX just does not work after a certain citation. After this citation, every one is a question mark.

@book{digital,
 author = {J.G.Proakis},
 title = {Digital Transmission},
 year = {2001},
 publisher = {McGraw-Hill},
}

And LaTeX also gives error messages.

*Command \c@lofdepth already defined.
 You requested the `dvips' driver but I think that(crop) the `pdftex' driver works better in the current(crop) context. You can force me to respect your decision(crop) by adding an exclamation point as in [dvips!].
 Font shape `T1/cmss/m/n' in size <40> not available(Font) size <35.83> substituted on input line 52. Font shape `T1/cmss/m/n' in size <40> not available(Font) size <35.83> substituted
 Citation `niklas' on page 9 undefined on input line 310. Citation `niklas' on page 9 undefined
 There were undefined citations.
 Size substitutions with differences(Font) up to 4.17pt have occurred.*

I am going crazy with those errors. When BibTeX does work, LaTeX compiles without those errors.

here is my code

\documentclass[11pt,twoside]{eitExjobb}
\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{graphpap}
\usepackage{subfigure}
\unitlength=1mm
\begin{document}
%%% Title page
\Title{A Test of \texttt{Exjobb.cls}}
\Author{Stefan Höst\\\texttt{stefan}}
\Date{\today}
\Advisor{Stefan Höst}
%%\Company{Company\\Address}
\MakeTitlePage
%%%%% Page numbering for front pages
\frontmatter
%%%%% Abstract
\chapter*{Abstract}


%% ToC
\tableofcontents
%\cleardoublepage
\listoffigures
\listoftables
\cleardoublepage
%%%%% Page numbering for the main thesis
\mainmatter
%%%%%

\chapter*{Introduction}

\cite{9999}
\cite{niklas}
\cite{Boyd:2004:CO:993483}
%%%%%%%%%%%%%%%%%%%



\bibliographystyle{unsrt}
\bibliography{reference}

\end{document}

In the code I cite three references. Only last one works.
My reference.bib is.

@ARTICLE{372015,
author={Zou, W.Y. and Yiyan Wu}, 
journal={Broadcasting, IEEE Transactions on}, title={COFDM: an overview}, 
year={1995}, 
month={mar}, 
volume={41}, 
number={1}, 
pages={1 -8}, 
keywords={8-VSB;ACATS;ATV channel model;Advisory Committee on Advanced Television Service;COFDM;Europe;FCC;OFDM;QAM;USA;channel coding;coded OFDM;development;digital audio broadcasting;digital modulation;digital television broadcasting;history;imperfect channel conditions;orthogonal frequency division multiplexing;performance;research;terrestrial HDTV broadcasting;channel coding;digital television;encoding;frequency division multiplexing;high definition television;quadrature amplitude modulation;reviews;television broadcasting;}, 
doi={10.1109/11.372015}, 
ISSN={0018-9316},}

@ARTICLE{54342, 
author={Bingham, J.A.C.}, 
journal={Communications Magazine, IEEE}, title={Multicarrier modulation for data transmission: an idea whose time has come}, 
year={1990}, 
month={may }, 
volume={28}, 
number={5}, 
pages={5 -14}, 
keywords={channel impairments;coding;data transmission;duplex operation;frequency division multiplexing;general switched telephone network;multicarrier modulation;undistorted channel;data communication systems;encoding;frequency division multiplexing;modulation;}, 
doi={10.1109/35.54342}, 
ISSN={0163-6804},}

@ARTICLE{713060, 
author={Merchan, S. and Armada, A.G. and Garcia, J.L.}, 
journal={Broadcasting, IEEE Transactions on}, title={OFDM performance in amplifier nonlinearity}, 
year={1998}, 
month={mar}, 
volume={44}, 
number={1}, 
pages={106 -114}, 
keywords={16QAM;ACTS project;BER degradation;Europe;OFDM performance;OFDM signals;QPSK;RACE project;Signal Processing Worksystem simulator;additive Gaussian noise;amplifier nonlinearity;amplitude clipping;amplitude limiting;bandwidth;bit error rate;digital TV broadcasting;impulsive noise;multipath effects;nonlinear distortion;optimized output power back off;orthogonal frequency division multiplexing;power amplifier efficiency;Gaussian noise;coding errors;digital television;error statistics;frequency division multiplexing;multipath channels;quadrature amplitude modulation;quadrature phase shift keying;radiofrequency amplifiers;television broadcasting;}, 
doi={10.1109/11.713060}, 
ISSN={0018-9316},}

Best Answer

The problem is not with the bib file. As mico says, there is a missing comma: if you looked at the log file you would see it reported. But that is not the problem.

The problem, I think, is that the custom class you are loading loads tocloft, and you load subfigure. As it happens there is a conflict, because both attempt to define the same counter. This is no problem normally, because tocloft checks if subfigure is being used: but not vice versa, and since your class loads tocloft first, it's going wrong. The solution, I think, will be to edit your class file to load subfigure before tocloft, and to load tocloft with the subfigure option.

The reason you were seeing question-marks instead of citations was that you were being put off by the error and only running latex once, so the citation marks hadn't resolved themselves. In fact if you pressed on despite the error (not a good idea) you would have got citations: the problem had nothing to do with your bibtex.

I hope it's not too harsh to say that this does demonstrate the importance of reading logs and posting MWEs.

Related Question