86
   \documentclass[11pt,a4paper]{article}
    \usepackage[T1]{fontenc}
    \usepackage{lipsum}
    \usepackage{tocloft}
    \begin{document}

    \tableofcontents
    \thispagestyle{empty}    
    \newpage

    \section{Preface} %want section number to be 0
    \thispagestyle{empty}    
    \pagenumbering{roman}
    \lipsum[1-3]
    \newpage

    \section{Start From Here}
    \lipsum[1-5]

    \section{And So On...}
    \lipsum[1-5]
    \end{document}

How do I get section numbering to start at 0?

Edit: I know I can do \section*{Preface}, but that removes it from the ToC, which isn't what I want.

8
  • 6
    Use \section*{Preface} \addcontentsline{toc}{section}{Preface}.
    – user11232
    Apr 8, 2013 at 2:34
  • 15
    If you really want a 0 section, add this to the preamble: \setcounter{section}{-1}; otherwise, do as Harish has suggested. Apr 8, 2013 at 2:37
  • @GonzaloMedina I have \thispagestyle{empty} because I want to clear out the header and footer, but I want to include a roman numeral on the preface. Is this possible? Apr 8, 2013 at 2:43
  • @AlanH sure; please give me some minutes. Apr 8, 2013 at 2:44
  • @AlanH Your wish with the pagenumbering is a separate question …
    – Speravir
    Apr 8, 2013 at 2:48

1 Answer 1

112

Just insert \setcounter{section}{-1} in the preamble.

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tocloft}
\setcounter{section}{-1}

\begin{document}
\tableofcontents
\newpage
\thispagestyle{empty}
\section{Preface} %want section number to be 0
\lipsum[1-3]
\newpage
\section{Start From Here}
\lipsum[1-5]
\section{And So On...}
\lipsum[1-5]
\end{document}
4
  • 5
    Why do I need to set the counter to -1, rather than 0?
    – user27182
    Oct 7, 2014 at 15:16
  • 9
    The default is 0. Each chapter increments the number and is labelled with the incremented number. So -1 produces 0 as the first label. Mar 14, 2015 at 23:39
  • 1
    this does not seem to work in the book documentclass. Jan 18, 2021 at 19:57
  • I learned this: Make sure you set the conter AFTER the \chapter command if you are doing everything with \input. Jan 18, 2021 at 20:07

You must log in to answer this question.

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