Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have defined a new numbering system for sections and subsections as shown below:

\renewcommand*\thesection{\arabic{section}.0}
\renewcommand*\thesubsection{\arabic{section}.\arabic{subsection}}

If I then try to add:

\renewcommand*\thesubsubsection{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}

This doesn't work and I can't understand why when it's exactly the same as the others!

Any help would be greatly appreciated!

share|improve this question
3  
You should mention what "doesn't work". And you should make a complete example – e.g. the document class certainly matters. –  Ulrike Fischer Aug 27 '12 at 7:25
    
Perhaps in your document class \thesubsubsection is not defined and so you can't use \renewcommand. Use \newcommand or \def instead. But to know for sure you need to at least provide the exact error message. –  canaaerus Aug 27 '12 at 7:45
4  
Use \setcounter{secnumdepth}{3}. –  Ulrike Fischer Aug 27 '12 at 8:42
1  
\setcounter{tocnumdepth}{3}. –  Ulrike Fischer Aug 27 '12 at 9:59
1  
Thanks again. I tried it out but it's actually \setcounter{tocdepth}{3} and not 'tocnumdepth'. –  user18056 Aug 27 '12 at 12:22

1 Answer 1

up vote 1 down vote accepted

Not an answer, just providing the MWE:

\documentclass{article}

\renewcommand*\thesection{\arabic{section}.0}
\renewcommand*\thesubsection{\arabic{section}.\arabic{subsection}}
\renewcommand*\thesubsubsection{%
  \arabic{section}.\arabic{subsection}.\arabic{subsubsection}%
}

\begin{document}
\tableofcontents
\section{Section A}
\section{Section B}
\subsection{Subsection A}
\subsection{Subsection B}
\subsubsection{Subsubsection A}
\subsubsection{Subsubsection B}
\end{document}

MWE

The only problem I can see is the narrow distance between the section number and the section title in the table of contents because of the added .0.

Refinement. From the comments it seems the default for counter secnumdepth is two, then the class is probably not article but report or book or similar.

New Example:

\documentclass{report}

\renewcommand*\thesection{\arabic{section}.0}
\renewcommand*\thesubsection{\arabic{section}.\arabic{subsection}}
\renewcommand*\thesubsubsection{%
  \arabic{section}.\arabic{subsection}.\arabic{subsubsection}%
}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\begin{document}
\tableofcontents
\chapter{Chapter X}
\section{Section A}
\section{Section B}
\subsection{Subsection A}
\subsection{Subsection B}
\subsubsection{Subsubsection A}
\subsubsection{Subsubsection B}
\end{document}

MWE2

share|improve this answer

Your Answer

 
discard

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.