groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Differences in `ne` and `bp` line-breaking behavior


From: Tadziu Hoffmann
Subject: Re: Differences in `ne` and `bp` line-breaking behavior
Date: Sat, 7 Dec 2024 04:01:52 +0100
User-agent: Mutt/1.11.4 (2019-03-13)

> `sp` has a noteworthy limitation.
> 
>   .sp dist  [...]
>             dist is ignored inside a diversion.

This is not true.  (See below.)

> Check the final sentence.  `ne` inherits this limitation.  In
> a diversion, you can ask `ne` for tons of space, but you'll
> only get 1v at a time.  Even if you invoke it more than once.

.sp works inside a diversion exactly like it works in the
top-level diversion.  Take a look at the attached example.
There is precisely 10v between "foo" and "bar".  However, .sp
will not space beyond a trap, so "trap sprung" occurs with
15v above it.  You can replace the ".sp 100v" with ".ne 100v"
and the result will be exactly the same.

> .tm ALMOST DONE (.d=\n[.d]u)
> .ne
> .tm JUST A BIT MORE (.d=\n[.d]u)
> .ne
> .tm I KEEP MASHING THIS THING BUT NOTHING HAPPENS (.d=\n[.d]u)

I'm not sure what you are trying to show here.  .ne means
"I need this much space".  If that space is available,
nothing happens.  If you invoke it a second time with the
same argument and without having output something in the
meantime, that space is still available, so again nothing
happens.  The effect of .ne is not cumulative.


>  .sp dist  Break and move the next text baseline down by dist
>            [...];
>            in all cases, one line height (vee) is added to dist.

Thinking in terms of the positions of baselines may be
tempting because that's how Postscript and PDF work,
but I don't think it's the best mental model for troff.
Interpreting the behavior of .sp as in metal typesetting
seems more appropriate.  That is, ".sp dist" means "leave
this much space *between* the last line and the next".


Attachment: diversiontrap.ro
Description: Text document

Attachment: diversiontrap.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]