這裡有一個標題,上方間距設為 0.04 行,看起來很醜:
現在讓我們看看如果把上方間距增加到 0.05 行會發生什麼事:

這樣好多了。但顯然它並沒有真正聽從我的指示,只是稍微增加一點標題上方的間距。
問題在於,當在基線網格(baseline grid)上進行排版時,確保正文行保持在網格上是很重要的。因此 TeX 的做法是允許標題(包括 \r,事實上任何 text type 為 section 的內容)偏離網格,然後它將所有相鄰的 section 類型段落打包成一個「標題框」(headings box),接著計算需要在該框上方增加多少額外空間,才能使框後的下一行重新回到網格上。這就是為什麼上方間距設定(或任何設定)可能會導致標題上方突然多出一行空間。而且為了更聰明地處理,它還會計算在欄位頂部(那裡忽略上方間距)的標題上方需要多少空間,以確保其後的第一行文字位於網格上。
所以,並不是我們無法控制標題及其間距,而是標題框的高度會對齊到整數倍的網格行數。
歡迎回應這個問題,以便我們能幫助大家更好地理解這一點,並感覺更有掌控力。
Here's a heading with 0.04 lines space above and it's pretty ugly:
And now let's see what happens if we increase the space above to 0.05 lines:

That's better. But it's clearly not really listening to my instruction to just increase the space above by a little bit.
The problem is that when typesetting on a baseline grid, it is important that the main body text lines stay on the grid. So what TeX does is to allow the headings (including \r, in fact anything of text type section) to go off grid, but it then bundles all the adjacent paragraphs of type section into a 'headings box', then it calculates how much extra space it needs to put above the box so that the next line after the box is back on the grid. This is why the space above setting (or any setting) can cause there to suddenly be an extra line of space above the heading. And just to be really clever it also works out how much space needs to go above the headings at the top of the column where the space above is ignored, to get the first text line after to be on the grid.
So it's not that we don't have control over headings and their spacing but that heading boxes snap up to an integral number of grid lines in height.
Feel free to respond to the question so that we can help people understand this better and feel more in control.
機器翻譯自 English