0

I am having trouble inserting chapters into my document. When I use:

\chapter{My Chapter}

the pdf simply displays 'My Chapter' in normal font, with no "Chapter 1" etc etc.

My document is set out as :

\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{setspace}
\onehalfspacing
\usepackage[english]{babel}
\usepackage{grffile}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage[options]{algorithm2e}
\usepackage{filecontents}% http://ctan.org/pkg/filecontents
\usepackage{listings}% http://ctan.org/pkg/listings
\usepackage{hyperref}
\pagenumbering{arabic}
\newcounter{qcounter}
\let\centering\relax
\usepackage{color, colortbl}
\definecolor{name}{system}{definition}
\definecolor{Gray}{gray}{0.9}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{tikz}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{csquotes}
\usepackage{fancybox}
\MakeOuterQuote{"}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amsthm, amssymb}
\begin{document}

\chapter{My Chapter}

\end{document} 

what am I doing wrong?

  • 1
    The article document class does not define \chapter... – Werner Mar 03 '14 at 20:18
  • 1
    Migrate the document at least to the report class. Since you seem to miss such basics, I recommend to read some introductory material like the »Dickimaw LaTeX Books«. – Thorsten Donig Mar 03 '14 at 20:20
  • TeX would have stopped with an error message saying that \chapter is not defined: You should not ignore the error messages! any pdf that may result after an error is essentially arbitrary as the recovery from errors is designed to get TeX into a stable state to process more input, not designed to produce any particular output. – David Carlisle Mar 03 '14 at 20:27
  • don't do \let\centering\relax redefining core latex features can have wide ranging effects, whatever the intended change is here there must be a safer way to do it. – David Carlisle Mar 03 '14 at 20:30

0 Answers0