1

I am new to LaTex. I am trying to write a project report. Below is a minimal sample code from my Latex file. I have made it by copying and pasting the important stuff in a new tex file, but it does not get compiled. But these are all the packages that I have included before beginning the chapter:

%This is a very basic  BE PROJECT PRELIMINARY template.

%############################################# 
%#########Author :  PROJECT###########
%#########COMPUTER ENGINEERING############


\documentclass[oneside,a4paper,12pt]{report}
%\usepackage{showframe}
%\hoffset = 8.9436619718309859154929577464789pt
%\voffset = 13.028169014084507042253521126761pt

\fancypagestyle{plain}{%
    \fancyhf{}
    \fancyfoot[CE]{Pune Institute Of Computer Technology, Department of Computer Engineering 2016}
    \fancyfoot[RE]{\thepage}
}
\pagestyle{fancy}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
\footskip = 0.625in
\cfoot{}
\rfoot{}

\usepackage[]{hyperref}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri}

\usepackage{tabularx}

\usepackage[nottoc,notlot,notlof,numbib]{tocbibind}
\usepackage[titletoc]{appendix}
\usepackage{titletoc}
\renewcommand{\appendixname}{Annexure}
\renewcommand{\bibname}{References}

\setcounter{secnumdepth}{5}

\usepackage{float}
\usepackage{subcaption}
\usepackage{multirow}

\usepackage[ruled,vlined]{algorithm2e}

\begin{document}

\mainmatter



\titleformat{\chapter}[display]
{\fontsize{16}{15}\filcenter}
{\vspace*{\fill}
    \bfseries\LARGE\MakeUppercase{\chaptertitlename}~\thechapter}
{1pc}
{\bfseries\LARGE\MakeUppercase}
[\thispagestyle{empty}\vspace*{\fill}\newpage]

\setlength{\parindent}{11mm}
\chapter{Synopsis}

\section{Project Title}
Bla bla bla...

\section{ Project Option }
Internal project

\section{Internal Guide}
Bla bla bla..

\end{document}

As you can see, the section numbers are not getting generated. The chapter number is, however, getting autogenerated. What is that I am doing wrong here? Please feel free to ask for more information if you want. Thank you.

  • 1
    Welcome to TeX.SX! Please provide the code of a complete small document that shows the problem, starting with \documentclass and ending with \end{document}. Use the edit button left below your posting. The code that you have posted is ok: sections are numbered. Probably you load some package before \begin{document} that changes the default settings, but I can't tell since the information is missing. – gernot Oct 17 '16 at 17:25
  • 1
    The reson for the behaviour is most likely in the part that you did not show. As we don't want to read your whole document and you don't want to share your whole document, look at preparing a minimal example. That way, you can present just the obvious part and leave out all the unrelated stuff. – Johannes_B Oct 17 '16 at 17:49
  • 1
    @gernot I have added the packages that I have included and also the other things like \fancypagestyle. Please have a look – Pranjal Oct 17 '16 at 18:01
3

You are ignoring errors and warnings, your own example tells you what is wrong.

  1. report does not support \frontmatter, \mainmatter, and \backmatter, so this produces errors.
  2. You did not load fancyhdr, which is necesary for your fancy-commands.
  3. titleformat is a command from the titlesec package, without which it cannot work. If you include the package, everything looks fine, including the numbering.

Here is the fixes example (still with loads of unnecesary packages, I was not in the mood to clean it up):

%This is a very basic  BE PROJECT PRELIMINARY template.

%############################################# 
%#########Author :  PROJECT###########
%#########COMPUTER ENGINEERING############


\documentclass[oneside,a4paper,12pt]{report}
%\usepackage{showframe}
%\hoffset = 8.9436619718309859154929577464789pt
%\voffset = 13.028169014084507042253521126761pt

\usepackage{fancyhdr}
\fancypagestyle{plain}{%
    \fancyhf{}
    \fancyfoot[CE]{Pune Institute Of Computer Technology, Department of Computer Engineering 2016}
    \fancyfoot[RE]{\thepage}
}
\pagestyle{fancy}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
\footskip = 0.625in
\cfoot{}
\rfoot{}

\usepackage[]{hyperref}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri}

\usepackage{tabularx}

\usepackage[nottoc,notlot,notlof,numbib]{tocbibind}
\usepackage[titletoc]{appendix}
\usepackage{titletoc}
\renewcommand{\appendixname}{Annexure}
\renewcommand{\bibname}{References}
\usepackage{titlesec}

\setcounter{secnumdepth}{5}

\usepackage{float}
\usepackage{subcaption}
\usepackage{multirow}

\usepackage[ruled,vlined]{algorithm2e}

\begin{document}



\titleformat{\chapter}[display]
{\fontsize{16}{15}\filcenter}
{\vspace*{\fill}
    \bfseries\LARGE\MakeUppercase{\chaptertitlename}~\thechapter}
{1pc}
{\bfseries\LARGE\MakeUppercase}
[\thispagestyle{empty}\vspace*{\fill}\newpage]

\setlength{\parindent}{11mm}
\chapter{Synopsis}

\section{Project Title}
Bla bla bla...

\section{ Project Option }
Internal project

\section{Internal Guide}
Bla bla bla..

\end{document}

Note that you still get warnings, mainly from tikz, which you should also not ignore.

  • 1
    hyperref should be loaded last. At least this is what people say ... – gernot Oct 17 '16 at 18:26
  • 1
    @gernot Definitely so, with that choice of packages. – egreg Oct 17 '16 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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