Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of zeros in the section numbering in LATEX report document class?

So I'm writing a report using Latex and the document class I am using is report: \documentclass[a4paper]{report}

But for some reason the section numbering is written so that it is preceded with "0.", for example it looks like:

0.1 Introduction

0.2 Theory

0.3 Experimental Method

and so on.

Can somebody help me get rid of those zeros so that it appears how it is supposed to be?

like image 703
Statsar Avatar asked Nov 16 '14 13:11

Statsar


People also ask

How do you remove numbers from a section in LaTeX?

If you'd prefer your sections, subsection, and so forth to be displayed without numbers on the left side of the title, you simply add a * symbol to the command. (Note that section headings created this way will not be listed in the table of contents \tableofcontents.)

How do I change the section numbering style in LaTeX?

LaTeX lets you change the appearance of the sectional units. As a simple example, you can change the section numbering to upper-case letters with \renewcommand\thesection{\Alph{section}} in the preamble (see \alph \Alph \arabic \roman \Roman \fnsymbol : Printing counters).

How do you make a section 0 in LaTeX?

Use \section*{Preface} \addcontentsline{toc}{section}{Preface} . If you really want a 0 section, add this to the preamble: \setcounter{section}{-1} ; otherwise, do as Harish has suggested.

How do you number a section in LaTeX?

So, a specific chapter or section number can be specified by manipulating the value inside this counter. The value in these counters can be set by using the \setcounter command. The same technique can be used with section and subsection numbering to set specific numbers.


1 Answers

report assumes you'll be using \chapters as your main sectional unit. As such, all sectional units are marked "relative" to the \chapter counter. Specifically, \section counters are set using \thechapter.\arabic{section}. Either use

\documentclass[a4paper]{article}

to remove any reference of \chapters, or add

\renewcommand{\thesection}{\arabic{section}}

to your document preamble.

The former would have greater impact on the actual output, as the setting of a \title and possibly the layout may be different. The latter would just remove the \chapter counter from being printed with every \section (and lower-level section unit).

like image 60
Werner Avatar answered Sep 29 '22 16:09

Werner