![KOMA-Script 脚本:如何为每个部分添加附录](https://linux22.com/image/293949/KOMA-Script%20%E8%84%9A%E6%9C%AC%EF%BC%9A%E5%A6%82%E4%BD%95%E4%B8%BA%E6%AF%8F%E4%B8%AA%E9%83%A8%E5%88%86%E6%B7%BB%E5%8A%A0%E9%99%84%E5%BD%95.png)
编辑(已解决)LaRiFaRi 的以下回答成功地让我在需要的地方引入了附录,但是它们在 minitoc 方面存在严重问题。第一个附录之后,下一章将失去其 minitoc。如果包含附录,则不会发生这种情况,但是\appendix
这会导致每个后续章节都成为附录(除非有已知的方法可以停止此命令?)。请问您能帮助修复两者之间的交互吗?原始 MWE 的更新版本包含在这篇文章的底部。
原始帖子
我把我的论文分成了几个部分,因为它们基于所用的不同方法。为了让文章更易读、更简洁,我想将每个部分中的某些常见信息移到附录中。
我如何插入仅显示在部分章节末尾而不是整个文档末尾的附录?
我知道我可以为此添加一个章节而不是附录,但附录更有意义。请参阅下面的 MWE,其中包含我的自定义章节标题样式,包括目录、部分和章节。
\documentclass[
bibliography=totoc,
headings=big,
captions=tableheading,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\usepackage{setspace}
\usepackage{lmodern}
\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections
\begin{document}
\dominitoc
\tableofcontents
\addtokomafont{chapterprefix}{\raggedleft}
\addtokomafont{chapter}{\fontsize{30}{38}\selectfont}
\addtokomafont{section}{\huge}
\addtokomafont{subsection}{\Large}
\addtokomafont{subsubsection}{\large}
\renewcommand*{\chapterformat}{%
\mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
\scalebox{4}{\color{gray}\thechapter}\enskip}}
\setcounter{chapter}{6}\setcounter{page}{199}
\newpage\setcounter{page}{212}
\part{Introduction}
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Summary of Achievements}
Text goes here
\subsection{Papers Submitted}
Text
\subsubsection{I want to go into the TOC}
Testing stuff out
\bibliographystyle{plain}
\bibliography{bibliography}
\end{document}
更新 MWE
\documentclass[
bibliography=totoc,
headings=big,
captions=tableheading,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage[toc]{appendix}
\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections
\begin{document}
\dominitoc
\tableofcontents
\addtokomafont{chapterprefix}{\raggedleft}
\addtokomafont{chapter}{\fontsize{30}{38}\selectfont}
\addtokomafont{section}{\huge}
\addtokomafont{subsection}{\Large}
\addtokomafont{subsubsection}{\large}
\renewcommand*{\chapterformat}{%
\mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
\scalebox{4}{\color{gray}\thechapter}\enskip}}
\setcounter{chapter}{6}\setcounter{page}{199}
\newpage\setcounter{page}{212}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}
%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Summary of Achievements}
Text goes here
\subsection{Papers Submitted}
Text
\subsubsection{I want to go into the TOC}
Testing stuff out
%%%%% APPENDIX
\begin{appendices}
\chapter{Some Appendix}
The contents...
\end{appendices}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}
%%%%%%%%%%%%%%%%%%%%
\chapter{The No MiniTOC Chapter}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Unfortunate Problems}
This chapter does not have a minitoc for some reason
\subsection{Still no minitoc}
Text
\subsubsection{I want to go into the TOC}
Testing stuff out
%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Summary of Achievements}
Text goes here
\subsection{Papers Submitted}
Text
\bibliographystyle{plain}
\bibliography{bibliography}
\end{document}
答案1
借助此包,appendix
您可以随时添加附录。使用此包并使用 KOMA 类之一时,minitoc
将以下内容写入.log
文件:
包 minitoc(hints) 信息:I0042
(minitoc(hints)) --- 附录包已加载。(minitoc(hints))参见 minitoc 包文档
(minitoc(hints))了解具体预防措施。
软件包 minitoc(hints) 信息:I0043
(minitoc(hints)) --- KOMAScript scrreprt 类已加载。
(minitoc(hints))参见 minitoc 包文档
(minitoc(hints))了解具体预防措施。
我看了minitoc 包文档并为您修改了代码。但您一定要阅读第 1.5.5、2.20 和 2.35 章,因为在添加 lof、lot、bib 等时,您会遇到其他几个问题。
% arara: pdflatex
\documentclass[
bibliography=totoc,
headings=big,
captions=tableheading,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage{appendix}
\let\oldappendices\appendices
\def\appendices{\oldappendices\addtocontents{toc}{\chapterend}} % <---------- set a chapter end mark after each appendix.
\usepackage{blindtext} % <---------- for demo.
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\begin{document}
\dominitoc
\tableofcontents
\addtokomafont{chapterprefix}{\raggedleft}
\addtokomafont{chapter}{\fontsize{30}{38}\selectfont}
\addtokomafont{section}{\huge}
\addtokomafont{subsection}{\Large}
\addtokomafont{subsubsection}{\large}
\renewcommand*{\chapterformat}{%
\mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%
\scalebox{4}{\color{gray}\thechapter}\enskip}}
\setcounter{chapter}{6}\setcounter{page}{199}
\newpage\setcounter{page}{212}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}
%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Summary of Achievements}
\blindtext
\subsection{Papers Submitted}
\blindtext
\subsubsection{I want to go into the TOC}
\blindtext
%%%%% APPENDIX
\begin{appendices}
\chapter{Some Appendix}
\blindtext
\end{appendices}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\part{Introduction}
%%%%%%%%%%%%%%%%%%%%
\chapter{The No MiniTOC Chapter}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Unfortunate Problems}
This chapter does not have a minitoc for some reason
\subsection{Still no minitoc}
\blindtext
\subsubsection{I want to go into the TOC}
\blindtext
%%%%%%%%%%%%%%%%%%%%
\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\minitoc
\section{Summary of Achievements}
\blindtext
\subsection{Papers Submitted}
\blindtext
\end{document}