我需要所有页面的顶部边距为 1 英寸。章节标题页占用的边距比我需要的要多。
这是我的 MWE:
\documentclass[a4paper,12pt]{report}
\usepackage[left=1.5in,right=1in,top=1in,bottom=1in,includefoot,heightrounded]{geometry}
\usepackage{lipsum}
\renewcommand{\baselinestretch}{1.3}
\usepackage[pagestyles]{titlesec}
\newpagestyle{mine}{%
\headrule
\sethead{\itshape\chaptername\thechapter}{}{\itshape\chaptertitle}
\setfoot{}{}{\thepage}}%
\renewpagestyle{plain}{%
\setfoot{}{}{\thepage}}%
\titleformat{\chapter}[display]{\normalfont\huge\bfseries\centering} {\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing{\chapter}{0pt}{0pt}{1cm}
\pagenumbering{roman}
\pagestyle{mine}
\begin{document}
\chapter*{Abstract}
\lipsum[2-4]
\chapter{Introduction}
\pagenumbering{arabic}
\setcounter{page}{1}
\lipsum[2-10]
\end{document}
请告诉我如何实现这一目标?
答案1
我只是将参数\titlespacing
改为。#3
-32pt
\documentclass[a4paper,12pt]{report}
\usepackage[showframe,left=1.5in,right=1in,top=1in,bottom=1in,includefoot,heightrounded]{geometry}
\usepackage{lipsum}
\renewcommand{\baselinestretch}{1.3}
\usepackage[pagestyles]{titlesec}
\newpagestyle{mine}{%
\headrule
\sethead{\itshape\chaptername\thechapter}{}{\itshape\chaptertitle}
\setfoot{}{}{\thepage}}%
\renewpagestyle{plain}{%
\setfoot{}{}{\thepage}}%
\titleformat{\chapter}[display]{\normalfont\huge\bfseries\centering} {\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing{\chapter}{0pt}{-32pt}{1cm}% <-- CHANGE DONE HERE!!
\pagenumbering{roman}
\pagestyle{mine}
\begin{document}
\chapter*{Abstract}
\lipsum[2-4]
\chapter{Introduction}
\pagenumbering{arabic}
\setcounter{page}{1}
\lipsum[2-10]
\end{document}