如何在章节之间插入补充部分?

如何在章节之间插入补充部分?

我正在使用书籍类,每 5 章(共 20 章)后我想要一个评论部分(所以总共 4 个评论部分)。此评论部分应与目录中的章节一样突出(相同的缩进、字体粗细和大小等),但它不应影响章节编号 - 它应该有自己的编号,如“评论 1”,并且它应该在目录中显示为“评论 1”。我该如何实现这一点?

   \documentclass{book}

   \begin{document}
   \tableofcontents
   \chapter{Chapt. 1}
   \chapter{Chapt. 2}
   \chapter{Chapt. 3}
   \chapter{Chapt. 4}
   \chapter{Chapt. 5}
   \chapter{Review 1} % this should be a review "section" b/w chapters 5 and 6
   \chapter{Chapt. 6}
   \chapter{Chapt. 7}
   \chapter{Chapt. 8}
   \chapter{Chapt. 9}
   \chapter{Chapt. 10}
   \chapter{Review 2} % this should be a review "section" b/w chapters 10 and 11
   \chapter{Chapt. 11}
   \chapter{Chapt. 12}
   \chapter{Chapt. 13}
   \chapter{Chapt. 14}
   \chapter{Chapt. 15}
   \chapter{Review 3} % this should be a review "section" b/w chapters 15 and 16
   \chapter{Chapt. 16}
   \chapter{Chapt. 17}
   \chapter{Chapt. 18}
   \chapter{Chapt. 19}
   \chapter{Chapt. 20}
   \chapter{Review 4} % this should be a review "section" after chapter 20

   \end{document}

答案1

在每个“回顾”章节前使用\setcounter{chapter}{0}命令,然后重置计数器。也可\addcontentsline{toc}{chapter}{Review x}用于目录。

  \documentclass{book}

   \begin{document}
   \tableofcontents
   \chapter{Chapt. 1}
   \chapter{Chapt. 2}
   \chapter{Chapt. 3}
   \chapter{Chapt. 4}
   \chapter{Chapt. 5}
   \setcounter{chapter}{0}
   \chapter*{Review 1} % this should be a review "section" b/w chapters 5 and 6
   \addcontentsline{toc}{chapter}{Review 1}
   \setcounter{chapter}{5}
   \chapter{Chapt. 6}
   \chapter{Chapt. 7}
   \chapter{Chapt. 8}
   \chapter{Chapt. 9}
   \chapter{Chapt. 10}
   \setcounter{chapter}{0}
   \chapter*{Review 2} % this should be a review "section" b/w chapters 10 and 11
   \addcontentsline{toc}{chapter}{Review 2}
   \setcounter{chapter}{10}
   \chapter{Chapt. 11}
   \chapter{Chapt. 12}
   \chapter{Chapt. 13}
   \chapter{Chapt. 14}
   \chapter{Chapt. 15}
    \setcounter{chapter}{0}
   \chapter*{Review 3} % this should be a review "section" b/w chapters 15 and 16
   \addcontentsline{toc}{chapter}{Review 3}
   \setcounter{chapter}{15}
   \chapter{Chapt. 16}
   \chapter{Chapt. 17}
   \chapter{Chapt. 18}
   \chapter{Chapt. 19}
   \chapter{Chapt. 20}
       \setcounter{chapter}{0}
   \chapter*{Review 4} % this should be a review "section" b/w chapters 10 and 11
   \addcontentsline{toc}{chapter}{Review 4}
 % \setcounter{chapter}{15}

   \end{document}

相关内容