0
votes

I am trying to get my document parts to show up as:

A. Narrative % \part{Narrative}

  1. Intro %\section{Intro}

main text...

B. Appendix % \part{Appendix}

  1. Derivations % \section{Derivations}

appendix text...

I have seen others use:

\renewcommand{\thepart}{\Alph{part}} 

However this is not working for me for some reason. My parts are showing up as:

Part A

Narrative

  1. Intro

main text...

Part B

Appendix

  1. Derivations

appendix text...

Any ideas anyone?

2
What \documentclass are you using? Do you have \chapters and other \sections in your document?Werner
using {article}. No chapters, just \part, \section, \subsection. Couldn't get the answer below to do exactly what I wantedJohn
So you'd also be okay with using \sections? That's probably the easiest way to get what you want.Werner
I appoligize, my question was not worded properly earlier, I have gone back and edited it so hopefully it is clearer what I am trying to achieve. I am using section under the broader part heading, but the in the doc and toc, the parts are not rendering as A. ...., B. .... ect... Hopefully that makes sense?John

2 Answers

0
votes

Your idea is right, but you also redefine the titleformat.

From the following link:

\usepackage{titlesec}

\renewcommand{\thepart}{\Alph{part}}
\makeatletter
\titleformat{\part}[display]
{\Huge\scshape\filright}
{\thepart~\partname}
{20pt}
{\thispagestyle{plain}}
\makeatother
0
votes

The minimal example below updates \part to set its numbering differently. More specifically, it removes the \partname - Part - prefix and keeps the title on the same line. Fonts are also updated to set the part using \LARGE\bfseries in both \part and \part*. All of the above updates are done using etoolbox's \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>} macro that performs a <search>-and-<replace> within <cmd>.

enter image description here

\documentclass{article}

\usepackage{lipsum,etoolbox}

\renewcommand{\thepart}{\Alph{part}}
\makeatletter
% Change part display; also uniform size of \LARGE\bfseries
\patchcmd{\@part}% <cmd>
  {\Large\bfseries \partname\nobreakspace\thepart \par\nobreak}% <search>
  {\LARGE\bfseries \thepart.\quad}% <replace>
  {}{}% <success><failure>
\patchcmd{\@part}{\huge}{\LARGE}{}{}
\patchcmd{\@spart}{\huge}{\LARGE}{}{}

\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\quad}
% \@addtoreset{section}{part} % Reset section counter with every part
\makeatother

\begin{document}

\part{Narrative}
\section{Intro}
\lipsum[1]

\part{Appendix}
\section{Derivations}
\lipsum[2]

\end{document}

If you wish to have the \section numbers reset with every new \part, uncomment the line referencing that in the preamble.