1

I'm working from a format that has been specified for me (there are certain requirements I must follow). I haven't been able to figure out how to get my section headings to look like this:

(level 1) Part 1

(level 2) 1.1

(level 3) 1.1.1

etc.

I'm currently using the following code to modify the level 1 section header:

\renewcommand\thesection{Part \arabic{section}}

However, when I use \subsection, it shows Part 2.1 when it needs to be just 2.1. All my \section headings needs to have "Part" in them, while all other subheadings should just have the section numbers.

Thanks for the help.

  • \usepackage{chngcntr} \counterwithin*{subsection}{section} should do the trick, at least for level 2. What would you like to have for level 3: 1 or 1.1? – Bernard Dec 16 '16 at 0:31
0

\thesubsection uses \thesection by default (class article and some other classes). Thus \thesubsection needs to be changed to use \arabic{section} instead:

\documentclass{article}

\renewcommand*{\thesection}{Part \arabic{section}}
\renewcommand*{\thesubsection}{\arabic{section}.\arabic{subsection}}

\begin{document}
\section{A section}
\subsection{A subsection}
\subsubsection{A subsubsection}
\end{document}

Result

  • Perfect, thank you! That seems so obvious now. – cwebber Dec 16 '16 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.