Text FormattingCustom Numbering for Sections and Subsections

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
jwubbel
Posts: 2
Joined: Tue Dec 13, 2011 7:40 pm

Custom Numbering for Sections and Subsections

Post by jwubbel »

I would like to know if it is possible to configure Latex to give me the following section and subsection numbering. So far, I have not been able to figure out if the following is possible:

Code: Select all

1.01  RELATED DOCUMENTS
      .1 Drawings and general provisions.....
1.02  DESCRIPTION OF WORK
      .1 This section includes......
         .1 Expansion and contraction of joints.....
         .2 Joints in pavement and concrete....
      .2 The following requirements are....
         .1
         .2
         .3
1.03
Any advice or examples would be appreciated. Thx.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Custom Numbering for Sections and Subsections

Post by Stefan Kottwitz »

Hi,

welcome to the board!

The question is not very clear if you use also chapters, and if the leading 1 means the chapter number. If that is so, you could use for customizing the numbering in this way:

Code: Select all

\renewcommand*{\thesection}{\thechapter.\ifnum\value{section}<10 0\fi\arabic{section}}
\renewcommand*{\thesubsection}{.\arabic{subsection}}
\renewcommand*{\thesubsubsection}{.\arabic{subsubsection}}
If necessary customize these counters for numbering depth and the depth of the table of contents:

Code: Select all

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
Stefan
LaTeX.org admin
jwubbel
Posts: 2
Joined: Tue Dec 13, 2011 7:40 pm

Re: Custom Numbering for Sections and Subsections

Post by jwubbel »

Stefan, thank you so much for the quick response. That works very good. I am not using chapter so consequently, it starts at 0.01. Although, on some of the longer documents, there will be Part I, Part II, etc. My preamble is
\documentclass[12pt,a4paper]{article}
I will take what you suggest and play around with it to learn more thoroughly on configuring this format. Thanks again. John
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Custom Numbering for Sections and Subsections

Post by Stefan Kottwitz »

No problem to start at a deeper level, with article:

Code: Select all

\renewcommand*{\thesubsection}{\thesection.\ifnum\value{subsection}<10 0\fi\arabic{subsection}}
\renewcommand*{\thesubsubsection}{.\arabic{subsubsection}}
\renewcommand*{\theparagraph}{.\arabic{paragraph}}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
Stefan
LaTeX.org admin
Post Reply