我正在使用报告文档类处理 LaTeX 文档(.tex 文件)。我有几章带有节标题,我想调整章节节的垂直间距,使章节出现在页面中央,而不影响图表列表和表格列表的格式。
主文本
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{fontenc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{placeins}
\usepackage{float}
\geometry{a4paper, margin=2.5cm}
%pour la mise en page des tableaux
\usepackage{array}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage[table,xcdraw]{xcolor}
\usepackage{longtable}
\usepackage{xltabular}
%% pour la numération des sous sou sections
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
%% pour la réference
\usepackage{ifthen}
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex]{hyperref}
\else
\usepackage{hyperref}
\usepackage{titlesec}
\usepackage{calc}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{0pt}{\Huge}
\titlespacing*{\chapter}{0pt}{\paperheight/3-\ht\strutbox}{2ex plus 1ex minus .2ex}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{0pt}{\vfill}
\fi
\usepackage{color}
\hypersetup{%
colorlinks=true,
linkcolor=black,
citecolor=black,
urlcolor=blue}
%%For page formatting
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\bfseries\nouppercase{\leftmark}}
\rfoot{\bfseries\thepage}
\setlength{\headheight}{14.5pt}
\let\headruleORIG\headrule
\renewcommand{\headrule}{\color{black} \headruleORIG}
\renewcommand{\headrulewidth}{1.0pt}
\usepackage{colortbl}
\arrayrulecolor{black}
\fancypagestyle{plain}{
\fancyhead{}
\fancyfoot[R]{\bfseries\thepage}
\renewcommand{\headrulewidth}{0pt}
}
\makeatletter
\def\@textbottom{\vskip \z@ \@plus 1pt}
\let\@texttop\relax
\makeatother
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else%
\hbox{}%
\thispagestyle{empty}%
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
\renewcommand{\contentsname}{Table de matière}
%%**************************************************************
\begin{document}
\pagenumbering{Roman}
\tableofcontents
\clearpage
\listoffigures
\clearpage
\listoftables
\clearpage
\pagenumbering{arabic}
\include{05-Introduction}
\include{06-Contexte général et étude préalable}
\include{07-Analyse et spécification des besoins}
\include{08-Release 1}
\include{09-Release 2}
\end{document}
06-一般背景和预习
\chapter{Contexte général et étude préalable}
\clearpage
我想增加章节部分之间的垂直间距,以便将其置于页面的中心,但我不想影响图表列表、表格列表、简介、目录。我该如何实现?任何帮助或建议都将不胜感激。谢谢!
答案1
目录、图表列表和表格列表使用\chapter*
,即,它们是未编号的章节。
您可以使用和 键为的编号titlesec
和未编号版本制作不同的格式。\chapter
numberless
\titleformat
\titlespacing
\titlespacing*{name=\chapter,numberless}{<increase left margin>}{<vertical space before chapter title>}{<separation between chapter title an text>}
% !TeX TS-program = pdflatex
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{fontenc}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{placeins}
\usepackage{float}
\geometry{a4paper, margin=2.5cm}
%
%
%%pour la mise en page des tableaux
\usepackage{array}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage[table,xcdraw]{xcolor}
\usepackage{longtable}
\usepackage{xltabular}
%
%%% pour la numération des sous sou sections
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\usepackage{calc}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{0pt}{\Huge}
\titlespacing*{\chapter}{0pt}{\paperheight/3-\ht\strutbox}{2ex plus 1ex minus .2ex}
\titlespacing*{name=\chapter,numberless}{0pt}{0pt}{40pt}% unnumberd chapters <<<<<<
\usepackage{color}
%%%For page formatting
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\bfseries\nouppercase{\leftmark}}
\rfoot{\bfseries\thepage}
\setlength{\headheight}{14.5pt}
\let\headruleORIG\headrule
\renewcommand{\headrule}{\color{black} \headruleORIG}
\renewcommand{\headrulewidth}{1.0pt}
\usepackage{colortbl}
\arrayrulecolor{black}
\fancypagestyle{plain}{
\fancyhead{}
\fancyfoot[R]{\bfseries\thepage}
\renewcommand{\headrulewidth}{0pt}
}
\makeatletter
\def\@textbottom{\vskip \z@ \@plus 1pt}
\let\@texttop\relax
\makeatother
%
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else%
\hbox{}%
\thispagestyle{empty}%
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
\renewcommand{\contentsname}{Table de matière}
%% pour la réference
\usepackage{ifthen}
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex]{hyperref} % last package
\else
\usepackage{hyperref}% last package
\fi
\hypersetup{%
colorlinks=true,
linkcolor=black,
citecolor=black,
urlcolor=blue}
%%**************************************************************
\begin{document}
\pagenumbering{Roman}
\tableofcontents
\clearpage
\listoffigures
\clearpage
\listoftables
\clearpage
\pagenumbering{arabic}
\chapter{Introduction}
\chapter{Contexte général et étude préalable}
\chapter{Analyse et spécification des besoins}
\chapter{Release 1}
\chapter{Release 2}
\end{document}