我需要在页面顶部和章节标题之间留出 3 厘米的间隙。以下是 MWE:
\documentclass[a4paper, 12pt, oneside]{report}
\usepackage[utf8]{inputenc}
\usepackage[margin=3cm, bindingoffset=1cm, tmargin=3cm,
bottom=3.5cm, left= 3.2cm, right=3.7cm]{geometry}
\linespread{1.5}
\usepackage{setspace}
\usepackage{float}
\usepackage[italian]{babel}
\usepackage[backend=biber, sorting=none, style=nature]{biblatex}
\usepackage[Lenny]{fncychap}
\addbibresource{uni.bib}
\usepackage{float}
\usepackage{csquotes}
\usepackage{etoolbox}
\usepackage{subcaption}
\usepackage{graphicx}
%\usepackage{subfig}
\usepackage{indentfirst}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{titletoc}
\titleformat{\chapter}[display]{\normalfont\huge\bfseries}{}{10pt}{\Huge ##}
\titlespacing*{\chapter}{0pt}{3pt}{7pt}
\makeatletter
\patchcmd{\Introduzione}{\chapheadtopskip}{\vspace*{30\p@}}{\vspace* {25\p@}}{}{}
\patchcmd{\Introduzione}{\chapheadbelowskip}{\vspace*{7\p@}}{\vspace*
{25\p@}}{}{}
\makeatother
\pagestyle{fancy}
\fancyhf{}
\pagestyle{plain}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{caption}
\hypersetup{hidelinks}
\addbibresource{uni.bib}
\urlstyle{same}
\newenvironment{dedica}
{\clearpage % we want a new page
\thispagestyle{empty}% no header and footer
\vspace*{\stretch{1}}% some space at the top
\itshape % the text is in italics
\raggedleft % flush to the right margin
}
{\par % end the paragraph
\vspace{\stretch{3}} % space at bottom is three times that at the top
\clearpage % finish off the page
}
答案1
titlespace*
这是在 中定义的代码titlesec
。此包足以格式化章节。第二个参数中的负空间将取决于文档设置。
\documentclass[a4paper, 12pt, oneside]{report}
\usepackage{titlesec}
\usepackage[
bindingoffset = 1cm,
top = 3cm,
bottom = 3.5cm,
left = 3.2cm,
right = 3.7cm,
]{geometry}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-25pt}{40pt}
\usepackage{showframe}
\renewcommand*\ShowFrameLinethickness{0.2pt}
\renewcommand*\ShowFrameColor{\color{blue}}
\begin{document}
\chapter{Test}
Sample text.
\end{document}