我使用 fncychap 来获得漂亮的章节样式,但问题是所选样式应用于 ToC、LoF、LoT 和参考书目,而我希望它们采用默认样式。有没有办法为 fncychap 包设置例外?
谢谢
答案1
\documentclass{report}
\usepackage{etoolbox}
\makeatletter
\newcommand\FncychapCopyCmds[2]{%
\csletcs{appendix#1}{appendix#2}%
\csletcs{@makechapterhead#1} {@makechapterhead#2}%
\csletcs{@schapter#1} {@schapter#2}%
\csletcs{@makeschapterhead#1}{@makeschapterhead#2}%
}
\newcommand\FncychapStyleOn {\FncychapCopyCmds{}{@fncy}}
\newcommand\FncychapStyleOff{\FncychapCopyCmds{}{@orig}}
\makeatother
\FncychapCopyCmds{@orig}{}
\usepackage[Sonny]{fncychap}
\FncychapCopyCmds{@fncy}{}
\begin{document}
\FncychapStyleOff % deactivate fncychap style
\tableofcontents
\FncychapStyleOn % activate fncychap style
\chapter{title}
\chapter{title}
\appendix
\FncychapStyleOff % deactivate again
\chapter{title}
\end{document}