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?

  • 2
    You want to remove "Part XX", but still keep the heading Practicals and CIRCULATION and HEART? What about the entries in the ToC? What other packages do you use that influence headings (like, perhaps, titlesec)? What about supplying a minimal working example (MWE)... pretty please? – Werner Feb 27 '14 at 21:06
  • Gonzalo's answer is exactly what I was looking for. I want to maintain those Practicals and Lectures -notifications in the table of contest. – Léo Léopold Hertz 준영 Feb 27 '14 at 23:04
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}    

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.