TeX - LaTeX Asked on February 22, 2021
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
usepackage{scrpage2}
pagestyle{scrheadings}
ifoot[footertext]{footertext} % footertext set in INFO.TEX
%setkomafont{pagehead}{normalfontrmfamily}
setkomafont{pagenumber}{normalfontrmfamily}
%% allow sophisticated control structures
usepackage{ifthen}
% use Times New Roman as default font
usepackage{times}
%usepackage{palatino}
%usepackage{mathptmx}
%use as default arial font
usepackage{helvet}
renewcommand{familydefault}{sfdefault}
%% parskip: used for spaces between paragraphs, no indentation
%usepackage{parskip}
% enable special PostScript fonts
usepackage{pifont}
% make thumbnails
usepackage{thumbpdf}
%to use the subfigures
%usepackage{subfigure}
%usepackage{subcaption}
%usepackage{subfigure}
usepackage{colortbl}
%Page Dimension
usepackage[left=1.5in,right=1in,top=1in,bottom=1in]{geometry}
%usepackage{setspace}doublespacing
usepackage{setspace}
usepackage{multirow}
%% use colors
usepackage{color}
%% make fancy math
%usepackage{amsmath}
usepackage[
intlimits,
sumlimits
]{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{textcomp}
usepackage{yhmath} % fr die adots
%% k text as preliminary
%usepackage[draft,german,scrtime]{prelim2e}
%% create an index
usepackage{makeidx}
% for the program environment
usepackage{float}
%% load german babel package for german abstract
%usepackage[german,american]{babel}
usepackage[german,english]{babel}
selectlanguage{english}
usepackage{ellipsis}
usepackage{microtype}
usepackage{soul}
usepackage{booktabs}
usepackage{tabularx}
usepackage{longtable}
usepackage{multirow}
% use german characters as well
usepackage[latin1]{inputenc} % allow Latin1 characters
% use initals dropped caps - doesn't work with PDF
%usepackage{dropping}
%usepackage[dvips]{dropping}
%usepackage{styles/shortoverview}
%----------------------------------------------------
% Graphics and Hyperlinks
%----------------------------------------------------
%% check for pdfTeX
ifxpdftexversionundefined
%% use PostScript graphics
usepackage[dvips]{graphicx}
usepackage[sc]{mathpazo}
usepackage{listings}
usepackage[american]{circuitikz}
DeclareGraphicsExtensions{.eps,.epsi}
graphicspath{{figures/}{figures/review}}
usepackage{siunitx}
%% allow rotations
usepackage{rotating}
%% mark pages as draft copies
%usepackage[english,all,light]{draftcopy}
%% use hypertex version of hyperref
usepackage[hypertex,hyperindex=false,colorlinks=false]{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
usepackage[pdftex]{graphicx}
DeclareGraphicsExtensions{.jpg,.JPG,.png,.pdf,.eps}
graphicspath{{figures/}}
%% Load float package, for enabling floating extensions
usepackage{float}
usepackage{amssymb,
amsfonts}
%% allow rotations
usepackage{rotating}
%% use pdftex version of hyperref
usepackage[pdftex,colorlinks=true,linkcolor=black,citecolor=black,%
anchorcolor=black,urlcolor=black,bookmarks=true,%
bookmarksopen=true,bookmarksopenlevel=0,plainpages=false%
bookmarksnumbered=true,hyperindex=false,pdfstartview=%
]{hyperref}
%
%usepackage[pdftex,colorlinks=false,linkcolor=red,citecolor=red,%
% anchorcolor=red,urlcolor=red,bookmarks=true,%
% bookmarksopen=true,bookmarksopenlevel=0,plainpages=false%
% bookmarksnumbered=true,hyperindex=false,pdfstartview=%
% ]{hyperref}
fi
% Spacing reduce
usepackage[compact]{titlesec}
% titlespacing{section}{0pt}{2ex}{-1ex}
%titlespacing{subsection}{0pt}{0ex}{-1ex}
% titlespacing{subsubsection}{0pt}{0.5ex}{-0.5ex}
%%
% titleformat{chapter}[display]
% {normalfonthugebfseries}{chaptertitlename thechapter}{20pt}{Huge}
%titlespacing{chapter}{0pt}{*4}{*1.5}
usepackage{apacite}
bibliographystyle{apacite}
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
documentclass[12pt,a4paper,bibtotoc,idxtotoc,headsepline,footsepline,footexclude,BCOR12mm,DIV13,openany]{scrbook}
%documentclass[11pt,a4paper,bibtotoc,idxtotoc,headsepline,footsepline,footexclude,BCOR20mm,DIV10]{scrbook}
% 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
input{components/info}
% include settings
input{components/settings}
% include commands
input{components/commands}
makeglossary
%linespread{1.25}
begin{document}
frontmatter
input{components/titlepage}
%line Spacing
onehalfspacing
% no indentation
parindent 0pt
input{components/disclaimer}
input{components/acknowledgements}
input{components/abstract}
linespread{1.25}
tableofcontents
listoffigures
listoftables
%input{components/outline}
mainmatter
% ---------------------------------------------------------------------------
%
%Introduction
%
% ---------------------------------------------------------------------------
% doublespacing
%paragraph spacing
parskip 1.5ex
linespread{1.5}
input{chapters/chapter1}
input{chapters/chapter2}
input{chapters/chapter3}
input{chapters/chapter4}
input{chapters/chapter5}
% ---------------------------------------------------------------------------
%
% Appendix
%
% ---------------------------------------------------------------------------
%part*{Appendix}
% addcontentsline{toc}{part}{Appendix}
% appendix %---------------------------------------
%input{chapters/oneAppendix}
clearemptydoublepage
linespread{1.25}
%bibliography{reference/myrefs}
end{document}
Code for the first chapter (chapter 1) is as follows:
chapter{Introduction}
label{chapter1:Introduction}
According to survey research conducted by Wangcite{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:
@article{chisholm2005compack,
title={COMPACK: a program for identifying crystal structure similarity using distances},
author={Chisholm, James Alexander and Motherwell, Sam},
journal={Journal of applied crystallography},
volume={38},
number={1},
pages={228--231},
year={2005},
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?
The Koma-script classes, among them scrbook
, are incompatible with the titlesec
package. The following document consists of lines of your document.
documentclass{scrbook}
usepackage[compact]{titlesec}
begin{document}
section{My heading}
end{document}
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
.
Answered by gernot on February 22, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP