1

So I have this chapter name for which I have as standard:

Chapter 1
Chapter 2
Chapter 3

But I want to have a completely different chapter name which would be called: Category

And it would be co-existing with the other chapter names without changing anything like here:

Chapter 1
Chapter 2 
Chapter 3+4
Category
Chapter 9

Here's my code and attempt:

%% document class and packages
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\usepackage{fancyhdr}

%% titlesec
\titleformat{\chapter}[hang]
    {\normalfont\huge\bfseries}
    {\chaptertitlename\ \thechapter: }
    {0em}
    {\centering} 
\titlespacing*{\chapter}{0pt}{-40pt}{20pt}
\titlelabel{\thetitle.\quad}
\titleformat{\subsubsection}[runin]
  {\normalfont\large\bfseries}{\thesubsubsection}{1em}{}

%% Attempt to make a command
\newcommand\categorychapter{\setchapter{Chủ đề:}}
%% Default chapter settings
\AtBeginDocument{\renewcommand{\chaptername}{Bài}}
\linespread{1.05}
\raggedbottom

\begin{document}

\chapter{First Chapter}

\chapter{Second Chapter}

%% Double numbered chapter
\label{single}
\let\oldchapter\thechapter
\def\thechapter{\arabic{chapter}\texttt{+}\the\numexpr\value{chapter}+1\relax}
\chapter{Chapter three plus four}

%% Chapter returning to normal numbering after skipping a number
\label{double}
\let\thechapter\oldchapter
\refstepcounter{chapter}
\refstepcounter{chapter}
\chapter{Chapter six}

%% Regular chapter without any alterations
\chapter{Chapter seven}

%% Attempt at a special chapter
\categorychapter{Category Chapter}
%% Radically different chapter numbering 
\setcounter{chapter}{11}
\chapter{Chapter twelve}
4
  • 1
    Unless titlesec redefines it, \chaptername is Chapter. Anyway, what you really need is \renewcommand{\chapapp}{Category} or \newcommand{\categoryname}{Category} and \let\chapapp=\categoryname. \chapapp is used for both \chaptername and \appendixname. Commented Nov 29, 2021 at 21:20
  • Well the \atbegindocument overrides the normal formatting with the title Bài Commented Dec 2, 2021 at 4:23
  • I find find using titlesec to be far more complicated than not using titlesec. I can show you how to do it that way, but not the other. Commented Dec 2, 2021 at 13:48
  • So you will do it but without using titlesec right? also see my edit for cleaner code. Commented Dec 3, 2021 at 3:01

1 Answer 1

2
+100

I'm not sure if I understand you correctly, but using \chapter*{Category} might just solve it?

%% document class and packages
\documentclass{report}

\begin{document}

\chapter{First Chapter}

\chapter{Second Chapter}

%% Double numbered chapter
\label{single}
\let\oldchapter\thechapter
\def\thechapter{\arabic{chapter}\texttt{+}\the\numexpr\value{chapter}+1\relax}
\chapter{Chapter three plus four}

%% Chapter returning to normal numbering after skipping a number
\label{double}
\let\thechapter\oldchapter
\refstepcounter{chapter}
\refstepcounter{chapter}
\chapter{Chapter six}

%% Regular chapter without any alterations
\chapter{Chapter seven}

%% Attempt at a special chapter
\chapter*{Category Chapter}
%% Radically different chapter numbering 
\setcounter{chapter}{11}
\chapter{Chapter twelve}
\end{document}
2
  • 1
    Thank you so much! Commented Dec 3, 2021 at 11:51
  • NB: This also works when you want to have the same, but then for sections, subsections and subsubsections. So, \section*{bla}, \subsection*{bla}, \subsubsection*{bla}
    – seaver
    Commented Dec 3, 2021 at 12:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .