我正在使用文档类book
来撰写论文,我想在创建目录时更改字体大小和对齐方式。
下面是我的代码
\documentclass[12pt,oneside]{book}
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\newpage
\chapter{INTRODUCTION}\vspace{0.5cm}
\end{document}
我想按照下图进行对齐:
根据代码我得到的对齐如下:
编辑:谢谢,这很有帮助。根据评论,我使用了 fncychap 包,它起作用了,但我面临另一个问题。标题填充在页眉中,我只想要页码。我阅读了包和文档,但没有找到任何资源来修复它。我尝试了 fancyhdr 包,但仍然无法摆脱页眉中的标题。请帮忙。
答案1
使用该fncychap
软件包,您可以:
\documentclass[12pt,oneside]{book}
\usepackage{fncychap}
\ChNameUpperCase
\ChTitleUpperCase % also for "Table of content" etc.
\ChNameVar{\normalsize\mdseries\centering}
\ChNumVar{\normalsize\mdseries}
\ChTitleVar{\normalsize\mdseries\centering}
% following is inspired by pages 8-9 of the manual of the fncychap package
% Adding of \vspace{-3cm} to move up the word "CHAPTER" and his number
\makeatletter
\renewcommand{\DOCH}{%
\vspace{-3cm}\CNV\FmN{\@chapapp}\space \CNoV\thechapter\par\nobreak
\vskip 10\p@}
\renewcommand{\DOTI}[1]{%
\CTV\FmTi{#1}\par\nobreak \vskip 10\p@}
\renewcommand{\DOTIS}[1]{%
\CTV\FmTi{#1}\par\nobreak \vskip 10\p@}
\makeatother
\usepackage{lipsum}
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\newpage
\chapter{INTRODUCTION}
%\vspace{0.5cm}
\lipsum
\end{document}
编辑
为了回答编辑的问题(删除页眉中的章节标题)和评论(以与章节相同的样式自定义章节和小节),您可以在序言中添加以下内容:
\usepackage{fancyhdr} % to customize the header
\pagestyle{fancy} % uses the `fancy`style
\fancyhf{} % wipe the default settings
\fancyhead[R]{\thepage} % page number on the right side
\renewcommand\headrule{} % no line between the head and the body
\setlength{\headheight}{14.5pt} % to remove a warning
% to customize \section and \subsection
% Lengths might be adapted
% The number in the second argument of `\@startsection` is the level of the sectionning command (1 of section, 2 for subsection, 3 for subsubsection, ...)
% As we would center the sectionning title, keep the 3rd argument to 0pt
% 4th and 5th argument are vertical rubber length (before and after the sectionning title)
% This layout is not optimal (for exemple, no visual difference between chapter title and subsection title, they uses the same font size)
\makeatletter
\renewcommand\section{\@startsection{section}{1}{0pt}{12pt plus 3pt minus 2pt}{10pt plus 2pt minus 1pt}{\normalfont\centering}}
\renewcommand\subsection{\@startsection{subsection}{2}{0pt}{10pt plus 3pt minus 2pt}{10pt plus 2pt minus 1pt}{\normalfont\centering}}
\makeatother
结果:
对于标题: