I have the following example code. Code for the setting file (settings) is as follows;

% Included by MAIN.TEX
% Defines the settings for the CAMP report document

\renewcommand{\sectfont}{\normalfont \bfseries}        % Schriftart der Kopfzeile

% manipulate footer
\ifoot[\footertext]{\footertext} % \footertext set in INFO.TEX

%% allow sophisticated control structures

% use Times New Roman as default font

%use as default arial font


%% parskip: used for spaces between paragraphs, no indentation

% enable special PostScript fonts

% make thumbnails

%to use the subfigures


%Page Dimension


%% use colors

%% make fancy math
\usepackage{yhmath} % fr die adots
%% k text as preliminary

%% create an index

% for the program environment

%% load german babel package for german abstract

% use german characters as well
\usepackage[latin1]{inputenc}       % allow Latin1 characters

% use initals dropped caps - doesn't work with PDF

%      Graphics and Hyperlinks

%% check for pdfTeX
 %% use PostScript graphics
 %% allow rotations
 %% mark pages as draft copies
 %% use hypertex version of hyperref
\else %% reduce output size \pdfcompresslevel=9
 %% declare pdfinfo
 %\pdfinfo {
 %  /Title (my title)
 %  /Creator (pdfLaTeX)
 %  /Author (my name)
 %  /Subject (my subject    )
 %  /Keywords (my keywords)
 %% use pdf or jpg graphics

 %% Load float package, for enabling floating extensions


 %% allow rotations
 %% use pdftex version of hyperref
% anchorcolor=red,urlcolor=red,bookmarks=true,%
% bookmarksopen=true,bookmarksopenlevel=0,plainpages=false%
% bookmarksnumbered=true,hyperindex=false,pdfstartview=%
% ]{hyperref}

% Spacing reduce
% \titlespacing{\section}{0pt}{2ex}{-1ex}
%   \titlespacing{\subsubsection}{0pt}{0.5ex}{-0.5ex}

%    \titleformat{\chapter}[display]
%   {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}



Code for the main file (main.tex) as as follows:

 % The main file for CAMP reports
 % Don't put any content in here.
 % Don't even include content files by using \input or \inlcude.
 % Put your content to TEXT.TEX or include it there using \input.
 % Uses:
 %      SETTINGS.TEX    contains the settings for this document
 %      COMMANDS.TEX    contains commands which can be used while writing
 %      INFO.TEX            contains the author, title and so on for the cover
 %      COVER.TEX           formats the front cover of the document
 %      ABSTRACT.TEX    contains the abstract to be included (if needed)
 %      TEXT.TEX            contains the actual content of the document
 %      BIB.BIB             containt the BibTeX entries for the document

%% Draft document mode


% KOMA-Optionen:
%  bibtotoc: include bibliography in table of contents
%  idxtotoc: include index in table of contents
%  headsepline: use horizontalline under heading
%  BCOR: binding correcion (Bindungskorrektur) (e.g.: BCOR5mm)
%  DIV: Number of sheet sections (used for layout) (e.g.: DIV12)

% include title and author information for the cover

% include settings

% include commands



    %line Spacing

           % no indentation
            \parindent 0pt



        % ---------------------------------------------------------------------------
        % ---------------------------------------------------------------------------
       % \doublespacing
           %paragraph spacing
             \parskip 1.5ex
        % ---------------------------------------------------------------------------
        % Appendix
        % ---------------------------------------------------------------------------
    %   \addcontentsline{toc}{part}{Appendix}
    %   \appendix %---------------------------------------



Code for the first chapter (chapter 1) is as follows:

 According to survey research conducted by Wang\cite{chisholm2005compack} around 1.7MB of data is being generated every day around the world. This survey report expresses the importance of text mining and sentiment analysis in our daily life.

\section{My heading}
text under my heading. 

Code for the bib file (myrefs.bib) is as follows:

  title={COMPACK: a program for identifying crystal structure similarity using distances},
  author={Chisholm, James Alexander and Motherwell, Sam},
  journal={Journal of applied crystallography},
  publisher={International Union of Crystallography}

When, I run the code I found following error:

! Missing number, treated as zero. } l.5 \section{My heading}

After removing \section{My heading}, I found the following error.

! Missing number, treated as zero. } l.1 \begin{thebibliography}{}

After removing the \bibliography{reference/myrefs}, The code works well. Whaty should I do ? Can anybody tell me?

  • 2
    unrelated but are you sure you want this ? \usepackage[latin1]{inputenc} % allow Latin1 characters Most editors will save in UTF-8 not latin1 these days (and certainly if you copy the text back of this website it will be in UTF-8) in which case you need to delete this line. Jan 8, 2021 at 20:06
  • 2
    also this test will not work as intended \ifx\pdftexversion\undefined as it will be true in latex and pdflatex in modern systems (any system for the last 15 years or so) Jan 8, 2021 at 20:08
  • Hi abdul, welcome to TeX Stack Exchange! If I try to work with the code you've provided, I get a bunch of different error messages about missing files. If you could, please try to minimize your code here to a minimal working example (MWE) that shows the errors you're trying to solve. Right now, any would-be helpers will get different error messages than you do, since we're missing a lot of unrelated files. If you can minimize the code to only that which is essential to show the errors, it will help us to help you. Jan 8, 2021 at 20:49

1 Answer 1


The Koma-script classes, among them scrbook, are incompatible with the titlesec package. The following document consists of lines of your document.

\section{My heading}

results in

! Missing number, treated as zero.
<to be read again> 
l.4 \section{My heading}

I suggest to remove the line \usepackage[compact]{titlesec} in settings.tex.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .