Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I keep my section numbering in Latex but just hide it?

Tags:

latex

I need something like this:

Chapter 1

Preliminaries

1.1 Banach Algebras

I tried this:

\chapter{}
\section*{Preliminaries}
\subsection{Banach Algebras}

The problem is: As soon as I hide the section number using \section*{Preliminaries}, it changes the numbering of the subsection to 0.1 Banach Algebras.

How do I hide the number of the section but keep the number ordering in my subsection?

like image 912
Chantel Burnard Avatar asked Oct 20 '10 13:10

Chantel Burnard


2 Answers

A quick fix without the hassles of renewing the section command is to use addtocounter.

Everytime you use the \section*{} command, right after that you can say \addtocounter{section}{1}

\chapter{}
\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

This will give you a result of,

Chapter 1
Preliminaries
1.1.1 Banach Algebras
Preliminaries
1.2.2 Banach Algebras

Essentially, it is just adding 1 to your section counter whenever you create a section so when the subsection checks the section counter, it has the updated counter.

And the advantage is that if you add another section now which needs to be numbered like,

\chapter{}
\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

\section{Preliminaries}

You will get the correct section number (i.e. 1.3)

Chapter 1
Preliminaries
1.1.1 Banach Algebras
Preliminaries
1.2.2 Banach Algebras
1.3 Preliminaries

The main drawback is that you will have to remember to add to the counter everytime you created a \section*{}

You can add \setcounter{subsection}{0} everytime you create one of those sections to reset the subsection counter... sorry I missed that one. Thanks for clarifying.

like image 121
nbz Avatar answered Oct 12 '22 09:10

nbz


So you just don't want to see the number displayed? Just use \renewcommand to renew the \section command, as thus:

\renewcommand{\thesection}{}
like image 26
Jonno_FTW Avatar answered Oct 12 '22 07:10

Jonno_FTW