I have a document where I would like to "promote" all sections to chapters, all subsections to sections, etc. That should affect not only the table of contents, but the documents as a whole.
For example:
\section{Title A}
\subsection{Title B}
\subsubsection{Title C}
Should actually be treated as if the document was like this:
\chapter{Title A}
\section{Title B}
\subsection{Title C}
I searched in this website how to do it, but most of the answers seem to focus on the table of contents. I tried to do it myself by adding the following to my document:
\renewcommand{\section}[1]{\chapter{#1}}
\renewcommand{\subsection}[1]{\section{#1}}
\renewcommand{\subsubsection}[1]{\subsection{#1}}
However what I get with that is that everything becomes a chapter, as if it is applied recursively. So the result is as if the document was like this:
\chapter{Title A}
\chapter{Title B}
\chapter{Title C}
Does anyone have an idea of how I can get what I need with minimal changes to the original tex files (possibly none, since it is a huge document with many sections)?
Thank you!
coseoul
\subsection
is redefined to\section
, but all\sections
are also redefined to\chapter
. That is why you experience the behaviour.\renewcommand
s in that specific order, hoping that all sections would be changed to chapters in the first sweep, than all subsections to sections, etc without overlap. But thanks.