groff
[Top][All Lists]
Advanced

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

Re: Zero Width Space


From: Ingo Schwarze
Subject: Re: Zero Width Space
Date: Sun, 5 Jun 2022 19:09:53 +0200

Hi Alejandro,

Alejandro Colomar wrote on Sun, Jun 05, 2022 at 05:07:41PM +0200:
> On 6/5/22 14:31, Ingo Schwarze wrote:
>> Richard Morse write:

>>> - “no-op escape”

>> But this one, or a variation thereof, might perhaps sever the knot.
>> It avoids both the very misleading terminology "input break"
>> and the confusion with the Unicode "ZERO WIDTH SPACE", and it
>> very accurately describes what this escape sequence does: nothing.
>> It is usually not inserted for some effect it might have but
>> merely to prevent an adjacent punctuation character from being
>> the first character on an input line, the last character before
>> an input ASCII space or tab character, or the last character on
>> an input line.  Even when used to disable kerning (which i would
>> expect to be rare, in particular compared to the other use cases),
>> thinking along the lines of "let's have a no-op instead of kerning"
>> or "let's insert a no-op because there will be no kerning between
>> the adjacent characters and a no-op" would make sense to me.

> Let me comment on this one as a non-expert groff user here.
> "no-op escape" makes a lot of sense in cases like
> 
>      \&. This line contains a leading '.'
> 
> Because it does literally nothing, and prevents having . as the first 
> thing.  If this were the only place it can be used, I'd say this name is 
> perfect, and better than "non-printing input break" (NPIB).
> 
> BUT, it doesn't make any sense to me here:
> 
>      .B foo\&
>      bar
> 
> If that were a no-op, I wouldn't write it (why would I write something 
> that does nothing???).

In fact, it does *not* do anything in this particular situation either.

At least with man(7),

  .TH TEST 1
  .B foo\&
  bar

does exactly the same as:

  .TH TEST 1
  .B foo
  bar

Specifically, it prints "foo" in bold followed by a space
and "bar" in Roman font.  I tested that with both groff and mandoc.

> What I want here is something that really has an 
> operation: join input lines.

To do that, you would have to say

  .TH TEST 1
  .B foo\
  bar

which prints "foobar" in bold.  Or are you thinking about

  .TH TEST 1
  .IB italic bold\c
  roman

which prints the tree words in three different fonts, with no
intervening whitespace on the output side?

On a tangent, i just noticed that

  .TH TEST 1
  .B foo\c
  bar

prints "bar" in Roman font with mandoc(1), which seems correct to me,
whereas it appears to print "bar" in bold with groff-current
compiled from git, which seems strange to me, just as if i had
written

  .TH TEST 1
  .B foo\c
  .B bar

Which one is correct output, Roman bar or bold bar?

[...]
> How about "non-breaking escape"

That's much too broad since most escape sequences are non-breaking.

> or "non-printing escape" (not necessarily in that order of preference)?

That's also too broad for my taste; here are a few more escape
sequences that are non-printing and non-breaking unless i'm
missing something: \{ \} \F \f \H \k \M \m \R \S \s \z
The difference between \& and the others is that \& is a no-op
whereas the others all have some side effect.

Yours,
  Ingo



reply via email to

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