我对普通章节使用了花哨的章节标题,但我希望附录中的章节看起来有所不同
\documentclass{report}
\usepackage{titletoc}
\usepackage{tocloft}
\usepackage[pagestyles, outermarks, newparttoc]{titlesec}
\usepackage[title]{appendix}
\makeatletter
\titleformat{\chapter}[frame]
{\normalfont}{\filright\enspace \@chapapp~\thechapter\enspace}
{20pt}{\Huge\bfseries\filcenter}%20pt the small line that close the box
\titlespacing*{\chapter}
{0pt}{-35pt}{0pt}
\makeatother
\begin{document}
\chapter{Appedix testing}
\begin{appendices}
\chapter{Appendix A}
\section{subappendix}
\chapter{Appendix B}
\end{appendices}
\end{document}
答案1
titleformat
只需在文档中想要更改的位置进行更改即可:
\documentclass{report}
\usepackage[pagestyles, outermarks, newparttoc]{titlesec}
\usepackage[title]{appendix}
\makeatletter
\titleformat{\chapter}[frame]
{\normalfont}{\filright\enspace \@chapapp~\thechapter\enspace}
{20pt}{\Huge\bfseries\filcenter}
\titlespacing*{\chapter}
{0pt}{-35pt}{0pt}
\makeatother
\begin{document}
\chapter{Appendix testing}
\begin{appendices}
\makeatletter
\titleformat{\chapter}{\Large\bfseries}{\@chapapp~\thechapter:}{.5em}{}
\makeatother
\chapter{Theory}
\section{subappendix}
\chapter{Appendix B}
\end{appendices}
\end{document}