tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: "Anthony J. Bentley" <anthony@cathet.us>
To: tech@mdocml.bsd.lv
Subject: Description of Bl ... -width
Date: Tue, 28 Oct 2014 21:40:36 -0600	[thread overview]
Message-ID: <13567.1414554036@cathet.us> (raw)

Hi,

I've spent a long time blindly typing ".Bl -tag -width Ds" without
understanding what it meant. In the back of my mind I just assumed Ds
triggered an indent of two characters, never noticing that the indent
in the result is obviously not two characters.

This is what mdoc(7) says about the -width argument to Bl:

     The -width and -offset arguments accept scaling widths as
     described in roff(7) or use the length of the given string.

In reality:

        /*
         * Calculate the real width of a list from the -width string,
         * which may contain a macro (with a known default width), a
         * literal string, or a scaling width.
         *
         * If the value to -width is a macro, then we re-write it to be
         * the macro's width as set in share/tmac/mdoc/doc-common.
         */

The macro part is documented in mdoc(7), but only under Bd's -offset:

           -offset width  Indent the display by the width, which may be one of
                          the following:
                          ...
                          A macro invocation, which selects a predefined width
                          associated with that macro.  The most popular is the
                          imaginary macro Ds, which resolves to 6n.
                          ...

It looks like Bl's -offset matches the manual and doesn't support
determining macro widths. So that leaves just Bl's -width that is
documented wrong. Here is an attempt to fix it--does this make sense?
But I'm not sure the paragraph flows very well now.

Index: mdoc.7
===================================================================
RCS file: /cvs/src/share/man/man7/mdoc.7,v
retrieving revision 1.120
diff -u -p -u -p -r1.120 mdoc.7
--- mdoc.7	12 Oct 2014 02:59:04 -0000	1.120
+++ mdoc.7	29 Oct 2014 03:27:35 -0000
@@ -940,6 +940,14 @@ and
 arguments accept scaling widths as described in
 .Xr roff 7
 or use the length of the given string.
+In addition, the argument to
+.Fl width
+may be a macro invocation, in which case a predefined width associated with
+that macro is chosen.
+The most popular is the imaginary macro
+.Ar \&Ds ,
+which resolves to the scaling width
+.Sy 6n .
 The
 .Fl offset
 is a global indentation for the whole list, affecting both item heads

--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

             reply	other threads:[~2014-10-29  3:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29  3:40 Anthony J. Bentley [this message]
2014-10-30 20:15 ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13567.1414554036@cathet.us \
    --to=anthony@cathet.us \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).