如何将章节标题设置在页面的中心?

如何将章节标题设置在页面的中心?

我想只在页面的中心设置(第 1 章简介)和(第 2 章保护继电器),我尝试使用\vspace*{}\vfill不幸的是它不起作用,我的代码是:

\documentclass{report}

\usepackage{sectsty}
\chapterfont{\huge\sc\centering}
\chaptertitlefont{\centering}
\begin{document}

\chapter*{List of Abbreviations}
test
\newpage
\chapter*{List of Tables}
test test test test test test test test test test test test test test test test test test test test test test test test
\newpage
\chapter{Introduction}
\newpage
test test test test test test test test test test test test test test test test test test test test test test test test
\chapter{Protective Relays}
\newpage
test test test test test test test test test test test test test test test test test test test test test test test test
\end{document} 

在此处输入图片描述

答案1

我把(第 1 章简介)和(第 2 章保护继电器)放在了页面的中央。之后您必须使用\textsc而不是\sc。我希望我解决了您的问题。

在此处输入图片描述

\documentclass{report}
\usepackage{sectsty}
\usepackage[pagestyles]{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\sc\centering}{\vspace{5cm}\centering\chaptertitlename \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}
{0pt}{50pt}{10pt}



\begin{document}

\chapter*{List of Abbreviations}
test
\newpage


\chapter*{List of Tables}
test test test test test test test test test test test test test test test test test test test test test test test test
\newpage
\chapter{Introduction}
\newpage
test test test test test test test test test test test test test test test test test test test test test test test test
\chapter{Protective Relays}
\newpage
test test test test test test test test test test test test test test test test test test test test test test test test
\end{document} 

答案2

这是一个解决方案titlesec

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}

\usepackage{titlesec}

\begin{document}

\chapter*{List of Abbreviations}
test

\chapter*{List of Tables}

test test test test test test test test test test test test test test test test test test test test test test test test

\titleclass{\chapter}{page}
\titleformat{\chapter}[display]{\filcenter\bfseries\Huge}{\huge\textsc{\chaptername} \thechapter}{20pt}{}%[\break]%[\vfill]
\titlespacing{\chapter}{0pt}{6ex plus 1fill}{10ex plus 1fill}

\chapter{Introduction}

test test test test test test test test test test test test test test test test test test test test test test test test

\chapter{Protective Relays}

test test test test test test test test test test test test test test test test test test test test test test test test

\end{document}     \documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}

\usepackage{titlesec}

\begin{document}

\chapter*{List of Abbreviations}
test

\chapter*{List of Tables}

test test test test test test test test test test test test test test test test test test test test test test test test

\titleclass{\chapter}{page}
\titleformat{\chapter}[display]{\filcenter\bfseries\Huge}{\huge\textsc{\chaptername} \thechapter}{20pt}{}%[\break]%[\vfill]
\titlespacing{\chapter}{0pt}{6ex plus 1fill}{10ex plus 1fill}

\chapter{Introduction}

test test test test test test test test test test test test test test test test test test test test test test test test

\chapter{Protective Relays}

test test test test test test test test test test test test test test test test test test test test test test test test

\end{document} 

在此处输入图片描述

相关内容