0 votes

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.

PTXprint by (366 points)

1 Answer

0 votes
So what does one do to fix this? Obviously neither of the two examples are what anyone would want. I am curious.
by (181 points)
I don't follow. In gridded text there is nothing to fix. This is how it works. I'm assuming that the 'obviously' here means you think there is some way for people to get their cake and eat it. I.e. to have exactly the space above that they asked for but somehow for the main body text to remain on the grid. The only 'solution' to ensure you get exactly the spacing you want is to go off grid. But then you lose the grid. So you either have the problem above or no grid. Neither is necessarily right or wrong, they are just different.
What you should probably do, having decided on the font size of your heading and the linespacing of the body, and recognising that there's going to be an integer number of lines gap to fill, is set the space *below* to something sane. E.g. half or a third of a line might make a good start, so that the heading is nicely centred in the gap.
Although, as I was taught, one can never have too little space under a sub heading. But at this point it becomes a question of art and design and good typesetting.
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Accept the one whose faith is weak, without quarreling over disputable matters.
Romans 14:1
2,626 questions
5,363 answers
5,041 comments
1,420 users