# Make \section behave like \part for the toc

I want to make my table of contents as if I'm using \parts and \sections throughout my document, as in the following picture:

It's neat and easy to read. However I don't like the way it looks throughout my document; it makes it look rather messy and space consuming as in the following picture: .

I prefer using \section and \subsection throughout my document, in my opinion it looks much nicer, as in this picture:

How do I make my table of contents behave as if I have used \part and \section throughout my document, whilst having used only \section and \subsection, respectively, throughout?

That is, how can I make my ToC behave as in the first picture, and make my document look like the 3rd picture?

• can you add a MWE please ? what class are you using? – touhami Apr 8 '18 at 19:55

How do I make my table of contents behave as if I have used \part and \section throughout my document, whilst having used only \section and \subsection, respectively, throughout?

\makeatletter
\let\l@subsection\l@section
\let\l@section\l@part
\makeatother


Which results in this:

\documentclass{amsart}
\usepackage{lipsum}
\makeatletter
\let\l@subsection\l@section
\let\l@section\l@part
\makeatother
\begin{document}
\tableofcontents
\section{Looks like part}
\lipsum[1]
\subsection{Looks like section}
\lipsum[2]
\end{document}


The output (mind that I might not have the same formatting options or document class as you do):

Edit: Messed up the order. Fixed now!

• Thanks, this had the intended effect. I forgot to add the document class I'm using, which is amsart. – Eliot Robinson Apr 8 '18 at 21:03
• Updated the answer accordingly. – Andreas Storvik Strauman Apr 8 '18 at 21:04