我正在使用\documentclass{book}
并且还重新定义了我的\chapter
和\part
标题样式。但是,这些样式不适用于内容页面的标题(“目录”一词)或参考书目页面(“参考书目”一词)。我如何修改它们的样式?我的意思是在相应页面顶部显示目录或参考书目一词的方式。对于使用 \chapter{}* 作为标题样式的任何部分也是如此。有什么想法吗?这是一个 MWE。请查看内容的标题“目录”或“致谢”一词。我希望它们具有与章节标题减去数字相同的样式!
\documentclass[draft]{book}
\usepackage[table]{xcolor}
\usepackage{epigraph}
\usepackage[explicit]{titlesec}
\usepackage{type1cm}
\setlength\epigraphwidth{.6\textwidth}
\titleformat{\chapter}[display]
{\normalfont\Large\rmfamily}
{\sffamily\flushright\fontsize{100}{0}\textbf{\textcolor{black!25}{\thechapter\vskip-10pt}}}{-10pt}
{\flushright\fontsize{25}{0}{#1}\vskip60pt}
\titlespacing*{\chapter}
{0pt}{-40pt}{0pt}
\titleformat{\part}[display]
{\normalfont\Large\rmfamily}
{\sffamily\flushright\fontsize{100}{0}\textbf{\textcolor{black!25}{\thepart\vskip-10pt}}}{-10pt}
{\flushright\fontsize{25}{0}{#1}\vskip60pt}
\titlespacing*{\part}
{0pt}{-40pt}{0pt}
\begin{document}
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
Let's acknowledge those who answer this question!
\tableofcontents
\cleardoublepage
\epigraphhead[450]{Fairy tales are more than true: not because they tell us that dragons exist, but because they tell us dragons can be beaten.\par\hfill\textsc{C.K. Chesterton}}
\part{A Test Part Title}
\chapter{A Test Chapter Title}
\end{document}
答案1
使用numberless
功能titlesec
。您不需要explicit
。此外,使用\flushright
是错误的,因为它会增加垂直间距。其他一些事情也已精简。
\documentclass[draft]{book}
\usepackage[pass,showframe]{geometry} % just for the example
\usepackage[table]{xcolor}
\usepackage{epigraph}
\usepackage{titlesec}
\usepackage{type1cm}
\setlength\epigraphwidth{.6\textwidth}
\titleformat{\chapter}[display]
{\normalfont\Large\rmfamily}
{\fontsize{100}{0}\sffamily\bfseries\raggedleft
\textcolor{black!25}{\thechapter}}
{0pt}
{\raggedleft\fontsize{25}{32}\normalfont}
\titleformat{name=\chapter,numberless}[display]
{\normalfont\Large\rmfamily}
{\fontsize{100}{0}\sffamily\bfseries\raggedleft\vphantom{1}}
{0pt}
{\raggedleft\fontsize{25}{32}\normalfont}
\titlespacing*{\chapter}{0pt}{-40pt}{60pt}
\titleformat{\part}[display]
{\normalfont\Large\rmfamily}
{\fontsize{100}{0}\sffamily\bfseries\raggedleft
\textcolor{black!25}{\thepart}}
{0pt}
{\raggedleft\fontsize{25}{32}\normalfont}
\titlespacing*{\part}{0pt}{-40pt}{0pt}
\begin{document}
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
Let's acknowledge those who answer this question!
\tableofcontents
\cleardoublepage
\epigraphhead[450]{Fairy tales are more than true: not because they tell us that dragons
exist, but because they tell us dragons can be beaten.\par\hfill\textsc{C.K. Chesterton}}
\part{A Test Part Title}
\chapter{A Test Chapter Title}
Text
\end{document}