\documentclass[a4paper,oneside,11pt]{book}
\usepackage[left=4 cm,right=3cm,top=4cm,bottom=3cm]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{titlesec}
\usepackage{tocloft}
% code for List of Appendices
\newcommand{\listappendicesname}{List of Appendices}
\newlistof{appendix}{app}{\listappendicesname}
% new command for appendix sections
\newcommand{\appsection}[1]{\section{#1}%
\addcontentsline{app}{appendix}{Appendix \protect\numberline{\thesection}#1}\par}
\titleformat{\chapter}
[display]
{\center\bfseries}
{\large\MakeUppercase{\chaptertitlename} \thechapter}{1pt}{\large}
\titlespacing{\chapter}{0cm}{-1.2cm}{0.7cm}
\titleformat{\section}
[hang]
{\bfseries}
{\bfseries\thesection}{1ex}{\bfseries}
\usepackage{tocbasic}
\DeclareTOCStyleEntry[
linefill=\bfseries\TOCLineLeaderFill,
beforeskip=2pt,
entrynumberformat=\chapterprefixintoc,
dynnumwidth
]{tocline}{chapter}
\newcommand*\chapterprefixintoc[1]
{\MakeUppercase{\chaptername}~#1\enskip}
\begin{document}
\frontmatter
\tableofcontents
\newpage
% print list of appendices and add title to the ToC
\listofappendix \addcontentsline{toc}{chapter}{\listappendicesname}
\mainmatter
\chapter{ABC}
\section{First}
\lipsum[1-2]
\section{Second}
\lipsum[3-4]
\chapter*{APPENDIX}
\setcounter{section}{0}
\renewcommand{\thesection}{\arabic{section}}
\titleformat{\section}
{\normalfont\Large\bfseries}{Appendix~\thesection.}{1em}{}
%%%%% \addcontentsline{toc}{chapter}{APPENDICES} % don't add to ToC
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}} % No sections in ToC
\appsection{First Appendix}
\lipsum[4-4]
\appsection{Second Appendix}
\lipsum[3-3]
\end{document}
我想将章节标题“目录”和“附录列表”移至中心。我还想将章节标题“目录”和“附录列表”的字体大小减小到与“第 1 章”相同的大小。
怎么做?