因此,我有此章节名称,其标准名称为:
Chapter 1
Chapter 2
Chapter 3
但我想要一个完全不同的章节名称,可以称为:Category
并且它将与其他章节名称共存,而不会发生任何改变,如下所示:
Chapter 1
Chapter 2
Chapter 3+4
Category
Chapter 9
这是我的代码和尝试:
%% 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}
答案1
我不确定我是否理解正确,但使用\chapter*{Category}
可能就能解决它?
%% 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}