我希望章节标题1. chapter_name
对齐center
。我该怎么做?我在网上搜索了答案,但我只能得到单独的答案,而不能得到两个要求的综合答案。请帮忙,提前谢谢您...
答案1
使用book
或report
类,使用titlesec
包,这是一个例子:
\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[block]
{\normalfont\Huge\bfseries\filcenter}
{\thechapter.}
{10pt}
{\Huge}
\titleformat{name=\chapter,numberless}[block]
{\normalfont\Huge\bfseries\filcenter}
{}
{0pt}
{\Huge}
\titlespacing*{\chapter} {0pt}{20pt}{20pt} %% adjust these as you like
\titlespacing*{name=\chapter,numberless} {0pt}{20pt}{20pt} %% adjust these as you like
\begin{document}
\tableofcontents
\chapter{Introduction}
\end{document}
未编号章节
编号章节