我正在写论文,我想出了一种自定义的章节标题样式。它对有或没有明确编号的章节都很有用,但它无法将样式应用于目录和参考书目标题。
我在这里发现了类似的问题:将章节标题样式应用于目录/参考书目标题。但是,那里的解决方案似乎针对具体问题,我无法将其应用到我的情况。
以下是 MWE:
\documentclass[11pt, paper=a4, twoside, openright]{book}
\usepackage{geometry}
\geometry{a4paper,%
headheight=9pt,%
margin=2.5cm,%
bindingoffset=0.5cm,%
top=3cm,%
bottom=3cm}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=phys,%
biblabel=brackets,%
pageranges=false,%
maxbibnames=10,%
eprint=true,%
backend=biber]{biblatex}
\usepackage{xcolor}
\begin{filecontents}{jobname.bib}
@book{key,
author = {Author, A.},
year = {2001},
title = {Title},
publisher = {Publisher},
}
\end{filecontents}
\addbibresource{jobname.bib}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
\reset@font
\vspace*{8\p@}%
{\parindent \z@
\begin{flushright}
\reset@font \scshape \bfseries {\Huge {\color{blue}\thechapter}} \par
\end{flushright}
\begin{flushright}
\reset@font \uppercase{ \Huge \strut #1\strut \par }
\end{flushright}
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
\reset@font
\vspace*{8\p@}%
{\parindent \z@
\begin{flushright}
\reset@font \scshape \bfseries \Huge \vphantom{\thechapter} \par
\end{flushright}
\begin{flushright}
\reset@font \uppercase{\Huge \strut #1\strut\par}
\end{flushright}
\vskip 40\p@
}}
\makeatother
\begin{document}
\frontmatter
\chapter*{Abstract}
\clearpage
\tableofcontents
\mainmatter
\chapter{Introduction}
\cite{key}
\backmatter
\printbibliography
\addcontentsline{toc}{chapter}{Bibliography}
\end{document}
非常感谢您的帮助。