0

\documentclass[12pt,a4paper]{report} is my document class.

Chapters’ are usually numbered 1, 2, 3, …

Subsections’ numbers are, thus, usually 1.1, 1.2, 2.1, 2.2, 2.3, …

Following this pattern, subsubsections’ numbers are usually 1.1.1, 1.1.2, …


Now, I have the following problem: There is a chapter with only one subsection. Therefore, I do not want it to be numbered and just wrote:

\subsection*{Title}
\addcontentsline{toc}{subsection}{Title}

Let’s say this is within chapter 2. If I now use \subsection{Step 1}, this subsection will be numbered as 2.0.1. But I do not want it to be numbered that way nor to be numbered as 2.1. I would prefer it to be numbered as 1, 2, …

How can I do that?


Edit: My full code:

\documentclass[12pt,a4paper]{report}
\usepackage[british]{babel}
\usepackage[T3,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\DisableLigatures[f]{encoding = T1}
\microtypecontext{spacing=nonfrench}
\usepackage{geometry}
\geometry{
    left=2cm,
    right=2cm,
    top=2cm,
    bottom=2cm,
    bindingoffset=0mm
}
\addto\captionsbritish{% Replace "english" with the language you use
    \renewcommand{\contentsname}%
    {Table of contents}%
}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\begin{document}
    \begin{titlepage}
        \vspace*{2cm}
        \centering
        {\scshape\LARGE Titlepage \par}
    \end{titlepage}

    \cleardoublepage
    \pagenumbering{Roman}
    \tableofcontents

    \cleardoublepage
    \pagenumbering{arabic}
    \chapter{One}
    This is chapter one.
    \section{One dot one}
    This is the first section of chapter one.
    \subsection{One dot one dot one}
    This is the first subsection of chapter one.
    \subsection{One dot one dot two}
    This is the second subsection of chapter one.
    \subsubsection{One dot one dot two dot one}
    This is the first subsection of 1.2.
    \subsubsection{One dot one dot two dot two}
    This is the second subsection of 1.2.
    \section{One dot two}
    This is the second section of chapter one.
    \chapter{Two}
    This is chapter two.
    \section{Two dot one}
    This is the first section of chapter two.
    \subsection*{Subsection of chapter two}
    \addcontentsline{toc}{subsection}{Subsection of chapter two}
    This is the only subsection of chapter two. It, thus, does not have any numbering. But it contains two subsections which I do not want to be numbered in the way as described above.
    \subsubsection{Step 1}
    This is the first subsection (= subsubsection) of “Subsection of chapter two”.
    \subsubsection{Step 2}
    This is the second subsection (= subsubsection) of “Subsection of chapter two”.
    \section{Two dot two}
    This is the second section of chapter two.
\end{document}

Note that I am also using

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

Now, I also see another aesthetical problem, but I do not necessarily need this to be solved. The Subsection of chapter two is left aligned with Two dot one in the table of contents. Maybe it would be better to indent the Subsection of chapter two a bit so that it is aligned with the beginning of the number of the subsubsections.

2
  • 2
    Can you make a minimal working example (MWE)? Commented Jan 5, 2018 at 12:29
  • 1
    If you have only one subsection in a chapter it is no subsection then (It can't be the subsection 2 as well then, according to your numbering scheme)! It may be a section itself or just place it inline. Otherwise use \begingroup\refstepcounter{subsection}\renewcommand{\thesubsection}{\arabic{subsection}}\subsection*{Title}\addcontentsline{toc}{subsection}{Title}}\endgroup
    – user31729
    Commented Jan 5, 2018 at 12:32

2 Answers 2

1

I don't recommend such a numbering scheme at all, especially omitting the chapter number will confuse readers.

\begingroup
\refstepcounter{subsection}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\subsection*{Subsection of chapter two}
\addcontentsline{toc}{subsection}{Subsection of chapter two}
This is the only subsection of chapter two. It, thus, does not have any numbering. But it contains two subsections which I do not want to be numbered in the way as described above.
\subsubsection{Step 1}
This is the first subsection (= subsubsection) of “Subsection of chapter two”.
\subsubsection{Step 2}
This is the second subsection (= subsubsection) of “Subsection of chapter two”.
\endgroup

-- this will change \thesubsection inside a TeX group, i.e. as long it is needed here, including the two subsubsections.

\documentclass[12pt,a4paper]{report}
\usepackage[british]{babel}
\usepackage[T3,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\DisableLigatures[f]{encoding = T1}
\microtypecontext{spacing=nonfrench}
\usepackage{geometry}
\geometry{
    left=2cm,
    right=2cm,
    top=2cm,
    bottom=2cm,
    bindingoffset=0mm
}
\addto\captionsbritish{% Replace "english" with the language you use
    \renewcommand{\contentsname}%
    {Table of contents}%
}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\begin{document}
    \begin{titlepage}
        \vspace*{2cm}
        \centering
        {\scshape\LARGE Titlepage \par}
    \end{titlepage}

    \cleardoublepage
    \pagenumbering{Roman}
    \tableofcontents

    \cleardoublepage
    \pagenumbering{arabic}
    \chapter{One}
    This is chapter one.
    \section{One dot one}
    This is the first section of chapter one.
    \subsection{One dot one dot one}
    This is the first subsection of chapter one.
    \subsection{One dot one dot two}
    This is the second subsection of chapter one.
    \subsubsection{One dot one dot two dot one}
    This is the first subsection of 1.2.
    \subsubsection{One dot one dot two dot two}
    This is the second subsection of 1.2.
    \section{One dot two}
    This is the second section of chapter one.
    \chapter{Two}
    This is chapter two.
    \section{Two dot one}
    This is the first section of chapter two.
    \begingroup
    \refstepcounter{subsection}
    \renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
    \subsection*{Subsection of chapter two}
    \addcontentsline{toc}{subsection}{Subsection of chapter two}
    This is the only subsection of chapter two. It, thus, does not have any numbering. But it contains two subsections which I do not want to be numbered in the way as described above.
    \subsubsection{Step 1}
    This is the first subsection (= subsubsection) of “Subsection of chapter two”.
    \subsubsection{Step 2}
    This is the second subsection (= subsubsection) of “Subsection of chapter two”.
    \endgroup
    \section{Two dot two}
    This is the second section of chapter two.
\end{document}
1

I'm not sure what a “single subsubsection” is supposed to be: you can subdivide something in two or more parts.

If you insist, here is a possibility.

\documentclass[12pt,a4paper]{report}
\usepackage[british]{babel}
\usepackage[T3,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\DisableLigatures[f]{encoding = T1}
\microtypecontext{spacing=nonfrench}
\usepackage{geometry}
\geometry{
    left=2cm,
    right=2cm,
    top=2cm,
    bottom=2cm,
    bindingoffset=0mm
}
\addto\captionsbritish{% Replace "english" with the language you use
    \renewcommand{\contentsname}%
    {Table of contents}%
}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\begin{document}
    \begin{titlepage}
        \vspace*{2cm}
        \centering
        {\scshape\LARGE Titlepage \par}
    \end{titlepage}

    \cleardoublepage
    \pagenumbering{Roman}
    \tableofcontents

    \cleardoublepage
    \pagenumbering{arabic}
    \chapter{One}
    This is chapter one.
    \section{One dot one}
    This is the first section of chapter one.
    \subsection{One dot one dot one}
    This is the first subsection of chapter one.
    \subsection{One dot one dot two}
    This is the second subsection of chapter one.
    \subsubsection{One dot one dot two dot one}
    This is the first subsection of 1.2.
    \subsubsection{One dot one dot two dot two}
    This is the second subsection of 1.2.
    \section{One dot two}
    This is the second section of chapter one.
    \chapter{Two}
    This is chapter two.
    \section{Two dot one}
    This is the first section of chapter two.
    \subsection*{Subsection of chapter two}
    \addcontentsline{toc}{subsection}{Subsection of chapter two}
    This is the only subsection of chapter two. It, thus, does not have any numbering. But it contains two subsections which I do not want to be numbered in the way as described above.
    \subsubsection{Step 1}
    This is the first subsection (= subsubsection) of “Subsection of chapter two”.
    \subsubsection{Step 2}
    This is the second subsection (= subsubsection) of “Subsection of chapter two”.
    \section{Two dot two}
    This is the second section of chapter two.
\end{document}

Bear in mind that labels to the special subsubsections should be inside the title:

\specialsubsubsection{Step 1\label{step1}}

You must log in to answer this question.

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