> > a "margin" measures an extent of whitespace (or "negative space"), > > whereas the `sp` request positions the _text baseline_,
The first is correct and the second incorrect for [g]troff. In troff (and nroff), if you say .sp |0 then this does not mean "put the baseline at the top of the page" but rather "leave zero space above the text", and correspondingly .sp |50p means "leave 50 pt of space above the text", as you would expect for margins. Thus, troff's model somewhat follows the concepts of metal typesetting. Of course, troff simplifies this a bit, in the first case by putting the baseline at 1 vee below the top of the page, and in the second case at 50 pt + 1 vee. Groff enables you to follow the metal typesetting model more closely, by allowing you to split the baseline distance into ".vs" and ".pvs". Thus, to have a baseline spacing of 20 pt, with 14 pt above the baseline and 6 pt below the baseline, say .vs 14 .pvs 6 as demonstrated in the attached example.
.\" .\" ---------------------------------------------------------------- .gcolor green .vs 0 .sp |0 \D'p 400p 0 0 50p -400p 0' .sp |70p \D'l 400p' .sp |90p \D'l 400p' .br .ps 18 .vs 20 .gcolor red .sp |50p The quick brown fox .br jumps over the lazy dog. .br .in 200p .gcolor blue .vs 14 .pvs 6 .sp |50p The quick brown fox .br jumps over the lazy dog. .br
margin.pdf
Description: Adobe PDF document