9

I would like to replace a part number by an abbreviation. For exemple, concerning the part algebra of the following MWE, I would like that the first chapter be called ALG.1 instead of I.1 (and the same for all the chapters in the considered part).

The abbreviation ALG could be ideally an optional argument of the \part command.

MWE :

\documentclass[oneside]{scrbook}

%reset chapter for each part
\makeatletter
\@addtoreset{chapter}{part}
\makeatother
\renewcommand{\thechapter}{\thepart\arabic{chapter}}


\begin{document}

\part{Algebra} %\part[ALG]{Algebra} ?
\chapter{Chap 1}

\part{Analysis}
\chapter{Chap 1}

\part{Geometry}
\chapter{Chap 1}


\end{document}
9

The MWE in the question already contains a redefinition of \thechapter. This can be customized further by replacing the part counter \thepart with a new macro that contains the required abbreviation.

To set this using an optional argument to \part the old definition of \part can be stored in another macro such as \oldpart, and then \part can be redefined to accept an optional argument, store that in a macro, and then call the \oldpart macro which will process the default argument, similar to Optional arguments in \def. The default value of the optional argument is \thepart, to allow parts without a label to be numbered with the roman part number.

When a Table of Contents is printed the chapter labels do not fit the default width, this can be addressed using \RedeclareSectionCommand.

MWE:

\documentclass[oneside]{scrbook}
\RedeclareSectionCommand[
  tocnumwidth=1.5cm
]{chapter}

\let\oldpart\part
\renewcommand\part[1][\thepart]{\def\partacr{#1}\oldpart}
%reset chapter for each part
\makeatletter
\@addtoreset{chapter}{part}
\makeatother
\renewcommand{\thechapter}{\partacr.\arabic{chapter}}


\begin{document}

\tableofcontents

\part[ALG]{Algebra}
\chapter{Chap 1}
\chapter{Chap 2}

\part{Geometry}
\chapter{Chap 1}
\chapter{Chap 2}

\end{document}

Result:

enter image description here

|improve this answer|||||
6

Like this?

\documentclass[oneside]{scrbook}

%reset chapter for each part
\makeatletter
\@addtoreset{chapter}{part}
\makeatother

\newcommand{\prt}[2]{\part{#2}
\renewcommand{\thechapter}{#1\arabic{chapter}}}

\usepackage{tocloft}
\renewcommand\cftchapnumwidth{1.2cm} %<-- For tableofcontents 

\begin{document}
\tableofcontents
\prt{ALG}{Algebra} %\part[ALG]{Algebra} ?
\chapter{Chap 1}

\prt{ANA}{Analysis}
\chapter{Chap 1}

\prt{GEO}{Geometry}
\chapter{Chap 1}


\end{document}

enter image description here

|improve this answer|||||
6

Here is a simple solution, with an \acropart command to be used just after the \part command:

\documentclass[oneside]{scrbook}

\counterwithin*{chapter}{part}
\makeatletter
\DeclareRobustCommand\acropart[1]{\gdef\@acropart{#1}}
\renewcommand{\thechapter}{\@acropart.~\arabic{chapter}}
\makeatother

\makeatother

\begin{document}

\part{Algebra} %\part[ALG]{Algebra} ?
\acropart{ALG}
\chapter{Chapter the first}
\chapter{Chapter the second}

\part{Analysis}
\acropart{ANAL}
\chapter{Chapter the first}

\part{Geometry}
\acropart{GEOM}
\chapter{Chapter the first}

\end{document} 

enter image description here

|improve this answer|||||

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.