![自定义章节的标题格式](https://linux22.com/image/416948/%E8%87%AA%E5%AE%9A%E4%B9%89%E7%AB%A0%E8%8A%82%E7%9A%84%E6%A0%87%E9%A2%98%E6%A0%BC%E5%BC%8F.png)
以下代码用于在书籍环境中撰写论文时自定义章节和部分。我遇到的问题是我无法自定义章节和章节标题的字体大小。请问有人能提出解决方案吗
\makeatletter
\newcommand{\setappendix}{Appendix~\thechapter}
\newcommand{\setchapter}{Chapter~\thechapter~}
\titleformat{\chapter}[display]{\sffamily\bfseries\huge\color{black}}{}{0.5ex} %
{\ifnum\pdfstrcmp{\@currenvir}{appendices}=0
\setappendix
\else
\setchapter
\fi
\filleft \\%
\titlerule[1pt]
\vspace{1ex}%
#1\filleft\\
\vspace{1ex}%
\titlerule[3pt]}
\titleformat{name=\chapter,numberless}[display]{ \color{black}\sffamily\bfseries\huge}{}{0.5ex}%
{ \titlerule[1pt]
\vspace{1ex}%
#1\filleft
\addcontentsline{toc}{chapter}{#1}
\markboth{}{#1}\\
\vspace{1ex}%
\titlerule[3pt]}
\makeatother
\titlespacing*{\chapter}{0ex}{-10ex}{0ex}
\titleformat{\section}{\Large\bfseries}{}{0.0ex} %
{\sffamily\color{black} \thesection~#1 \filright}[\smallskip]
\titleformat{name = \section, numberless}{\Large\bfseries}{}{0.0pt}%
{\sffamily\color{black}#1\filright}[\smallskip]
\titleformat{\subsection}[hang]{\sffamily\Large}{}{0.5ex}%
{\color{black}\thesubsection~#1\filright}[\smallskip]
\titleformat{name = \subsection, numberless}[hang] {\sffamily\Large}{}{0.5ex}%
{\color{black}#1\filright}[\smallskip]