TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this document in the article documentclass. Everything is divided into sections and subsections. Now I'd like to have an example in my chapter two, that is also divided into sections. So I have my normal document and in the second section there is an example of some code where the section numbering starts again from 1... Not sure if I can make myself clear enough but here is some pseudocode;

     \section{Here starts the example counter with 1}
     \section{New section in the example}
share|improve this question
\subsection and in the preamble \renewcommand*\thesubsection{\arabic{subsection}} will do? – Count Zero Nov 22 '12 at 14:37
Take a look at this question: Deeper levels of (sub)sections – mkota Nov 22 '12 at 14:38
Yeah okay... But the sections already have subsections of their own... – Pieterjan Nov 22 '12 at 14:46
up vote 2 down vote accepted

I'm not sure if I understand your question. Is this what you require?


\section{Section 1}
\section{Section 2}


\section{Here starts the example counter with 1}
    \subsection{Subsection 1}
\section{New section in the example}
    \subsection{Subsection 2}


\section{Section 3}

share|improve this answer
Yes! That's exactly it :) Thank you Jay! – Pieterjan Nov 22 '12 at 15:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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