Latex标题恰好在页面首行,通过`\titlespacing`设置段前间距无效的原因

Latex标题恰好在页面首行,通过\titlespacing设置段前间距无效的原因

通常对于一个latex文档,在开头使用\geometry语句来完成页面布局的设置:页边距,页眉高度等。例如:

\RequirePackage[includeheadfoot]{geometry}
\geometry{
	top=2.5cm, bottom=2cm, left=2.5cm, right=2cm
	,headheight=13pt, headsep=0.1cm,
    footskip=0.51cm
}

上面的代码设置页边距为:上边距2.5cm,下边距2cm;左2.5cm,右边距2cm。headheight是页眉的高度,headsep是页眉底部距离第一行文本顶部的距离。

代码中几个几何属性的关系如下:
paperwidth = left + width + right paperheight = top + height + bottom \text{paperwidth = left + width + right}\\ \text{paperheight = top + height + bottom} paperwidth = left + width + rightpaperheight = top + height + bottom

设定includeheadfoot之后,又有:
height = textheight + headheight + headsep + footskip \text{height = textheight + headheight + headsep + footskip} height = textheight + headheight + headsep + footskip

题外话:如果没有设定includeheadfoot,则:
height = textheight \text{height = textheight} height = textheight

如上面代码所设,可知 textheight = height - headheight - headsep - footskip \text{textheight = height - headheight - headsep - footskip} textheight = height - headheight - headsep - footskip。这时,纸张大小是首先确定的,因此设定top,botoom后,height的值就确定了;设定left,right等属性后,width就确定了。

根据实际需要,用户可能通过\titlespacing来自定义\section等语句的几何属性,包括段前段后间距等。
然而,标题出现在页面第一行时,无论如何设置标题的段前间距,都无法让它远离页眉的底部,因为textheight是确定的,第一行文本顶端的位置也是固定的。

参考阅读:
latex 标题、段落及行距
What do headheight, headsep, etc. do in the vmargin package?

猜你喜欢

转载自blog.csdn.net/qq_42679415/article/details/131048512