1

I want to change Conzalo's command little (How to reset a section counter) by removing the representation of Part [number] in the document:

\usepackage{xpatch}
\makeatletter
\@addtoreset{section}{part}
\xpatchcmd{\@part}{\normalfont}{\normalfont\centering}{}{}
\xpatchcmd{\@part}{\Large}{\LARGE}{}{}
\renewcommand
% \partname{Topic}
\makeatother

I use the part command for Lectures, Practicals, Master Topics. My table of contents

enter image description here

and my document

enter image description here

I do not really understand the command because disabling these two lines do nothing:

% \xpatchcmd{\@part}{\normalfont}{\normalfont\centering}{}{}
% \xpatchcmd{\@part}{\Large}{\LARGE}{}{}

I want to remove the representation of Part and number.

How can you remove the representation of the Part headings every time you use part?

1 Answers1

3

I'm not sure if this is what you want:

\documentclass{article}

\makeatletter
  \def\@part[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}%
    \fi
    \addcontentsline{toc}{part}{#1}%
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \LARGE \bfseries #2%
     \markboth{}{}\par}%
    \nobreak
    \vskip 3ex
    \@afterheading}
\@addtoreset{section}{part}    
\makeatother

\begin{document}
\tableofcontents

\part{Practicals}
\section{Section I}
content
\subsection{Subsection I} 
content

\part{CIRCULATION and HEART}
\section{Section I}
content
\subsection{Subsection I} 
content

\end{document}

enter image description here

If the section counter shouldn't reset at each part, delete the line

\@addtoreset{section}{part}    
Gonzalo Medina
  • 505,128