答案1
手动设置,不太方便,通过存储章节号并在稍后恢复。
(在此示例中,应增加目录中的章节号宽度,例如使用\addtolength{\cftchapnumwidth}{5pt}
来自tocloft
包)
\documentclass{book}
\newcounter{subchapterusage}
\makeatletter
\let\latex@@thechapter\thechapter
\@addtoreset{chapter}{subchapterusage}% Reset the chapter counter if subchapterusage is stepped
\newcommand{\PrepareForSubchapterUsage}{%
\xdef\chapvalue{\the\numexpr\number\value{chapter}+1}
\stepcounter{subchapterusage}%
\renewcommand{\thechapter}{\chapvalue.\latex@@thechapter}
}
\newcommand{\RestoreToChapterUsage}{%
\setcounter{chapter}{\chapvalue}
\renewcommand{\thechapter}{\latex@@thechapter}
}
\makeatother
\usepackage{hyperref}
\begin{document}
\tableofcontents
\chapter{Foo}
\chapter{Foobar}
\PrepareForSubchapterUsage
\chapter{Intermediate Chapter with Strange Counting}
\section{Foo section}
\chapter{Another intermediate Chapter with Strange Counting}
\chapter{Yet another intermediate Chapter with Strange Counting}
\RestoreToChapterUsage
\chapter{Foo continued}
\end{document}