如何让章节标题位于\mainmatter
页面中央?\frontmatter
章节标题位于页面顶部。
\documentclass[a4paper,twoside,12pt]{book}
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{lipsum}
\titleformat{\chapter}[display]{\filcenter\bfseries\Huge}{\huge\textsc{\chaptername} \thechapter}{20pt}{}%[\break]%[\vfill]
\titlespacing{\chapter}{0pt}{6ex plus 1fill}{10ex plus 1fill}
\begin{document}
\frontmatter
\chapter{ABC}
\lipsum
\chapter{DEF}
\mainmatter
\chapter{GOOD}
\end{document}
答案1
更改\titleformat
之后\mainmatter
。
\documentclass[a4paper,twoside,12pt]{book}
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{lipsum}
\titleformat{\chapter}[display]{\filcenter\bfseries\Huge}{\huge\textsc{\chaptername} \thechapter}{20pt}{}%[\break]%[\vfill]
\titlespacing{\chapter}{0pt}{6ex plus 1fill}{10ex plus 1fill}
\begin{document}
\frontmatter
\chapter{ABC}
\lipsum
\chapter{DEF}
\mainmatter
\titleformat{\chapter}[display]{\filcenter\bfseries\Huge}%
{\vfil\huge\textsc{\chaptername} \thechapter}{20pt}%
{}[\vfill\mbox{}\newpage]
\chapter{GOOD}
\lipsum
\end{document}