discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc/nroff small spacing difference for .Bd -offset 0
@ 2012-10-16 18:05 Nicolas Joly
  2012-11-16 22:56 ` Ingo Schwarze
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Joly @ 2012-10-16 18:05 UTC (permalink / raw)
  To: discuss


Hi,

Still checking the NetBSD man pages i noticed a minor difference for
display blocks with an `-offset 0' argument.

nroff displays it as if there wasn't an offset argument, but mandoc do
adds an extra leading space.

njoly@lanfeust [tmp/mandoc]> cat sample.1
.Dd October 16,2012
.Dt SAMPLE 1
.Os
.Sh NAME
.Nm sample
.Nd sample description
.Sh DESCRIPTION
.Bd -literal
Bd no offset
.Ed
.Bd -literal -offset 0
Bd offset 0
.Ed

njoly@lanfeust [tmp/mandoc]> nroff -mandoc sample.1 | grep Bd
     Bd no offset
     Bd offset 0

njoly@lanfeust [tmp/mandoc]> mandoc sample.1 | grep Bd
     Bd no offset
      Bd offset 0

Not a big deal as removing the offending offset argument will produce
a consistent output with both formatters, but wanted to report it
anyway.

Thanks.

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mandoc/nroff small spacing difference for .Bd -offset 0
  2012-10-16 18:05 mandoc/nroff small spacing difference for .Bd -offset 0 Nicolas Joly
@ 2012-11-16 22:56 ` Ingo Schwarze
  2012-11-19 13:37   ` Nicolas Joly
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Schwarze @ 2012-11-16 22:56 UTC (permalink / raw)
  To: Nicolas Joly; +Cc: discuss

Hi Nicolas,

Nicolas Joly wrote on Tue, Oct 16, 2012 at 08:05:03PM +0200:

> Still checking the NetBSD man pages i noticed a minor difference for
> display blocks with an `-offset 0' argument.

That's sloppy.  The -offset argument is supposed to take a scaling
width argument, not a bare number.

When the unit is omitted from scaling width numbers, according to
my understanding, what unit is assumed depends on the context,
and i have no idea what the default unit for .Bd -offset is
supposed to be.

According to my testing, here is what groff does:

 -offset followed by a single digit (-offset 0 ... -offset 9)
  is handled as -offset 0n

 -offset followed by multiple digits (-offset 10 ... -offset 9999 ...)
  uses the string length of the number,
  e.g. -offset 123 is the same as -offset 3n

That doesn't make a lot of sense to me.
I'm not thrilled by the idea of spending my time to make mandoc
(bug-?)compatible with groff in this respect.

Or can anybody provide a better explanation of what -offset 123
is supposed to mean?

Somewhat confused,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mandoc/nroff small spacing difference for .Bd -offset 0
  2012-11-16 22:56 ` Ingo Schwarze
@ 2012-11-19 13:37   ` Nicolas Joly
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Joly @ 2012-11-19 13:37 UTC (permalink / raw)
  To: discuss; +Cc: Nicolas Joly

On Fri, Nov 16, 2012 at 11:56:30PM +0100, Ingo Schwarze wrote:
> Hi Nicolas,

Hi Ingo,

> Nicolas Joly wrote on Tue, Oct 16, 2012 at 08:05:03PM +0200:
> 
> > Still checking the NetBSD man pages i noticed a minor difference for
> > display blocks with an `-offset 0' argument.
> 
> That's sloppy.  The -offset argument is supposed to take a scaling
> width argument, not a bare number.
> 
> When the unit is omitted from scaling width numbers, according to
> my understanding, what unit is assumed depends on the context,
> and i have no idea what the default unit for .Bd -offset is
> supposed to be.
> 
> According to my testing, here is what groff does:
> 
>  -offset followed by a single digit (-offset 0 ... -offset 9)
>   is handled as -offset 0n
> 
>  -offset followed by multiple digits (-offset 10 ... -offset 9999 ...)
>   uses the string length of the number,
>   e.g. -offset 123 is the same as -offset 3n
> 
> That doesn't make a lot of sense to me.
> I'm not thrilled by the idea of spending my time to make mandoc
> (bug-?)compatible with groff in this respect.

Fine with me. This just needs to be documented somewhere ...

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-19 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-16 18:05 mandoc/nroff small spacing difference for .Bd -offset 0 Nicolas Joly
2012-11-16 22:56 ` Ingo Schwarze
2012-11-19 13:37   ` Nicolas Joly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).