From owner-sc22wg5@dkuug.dk  Thu Sep  4 18:59:02 2003
Received: (from majordom@localhost)
	by dkuug.dk (8.12.8p1/8.9.2) id h84Gx2ao017764
	for sc22wg5-domo; Thu, 4 Sep 2003 18:59:02 +0200 (CEST)
	(envelope-from owner-sc22wg5@dkuug.dk)
X-Authentication-Warning: ptah.dkuug.dk: majordom set sender to owner-sc22wg5@dkuug.dk using -f
Received: from mailhub.dfrc.nasa.gov (mailhub.dfrc.nasa.gov [130.134.81.12])
	by dkuug.dk (8.12.8p1/8.9.2) with ESMTP id h84GvdCp017750
	for <sc22wg5@dkuug.dk>; Thu, 4 Sep 2003 18:58:58 +0200 (CEST)
	(envelope-from maine@altair.dfrc.nasa.gov)
Received: from mail.dfrc.nasa.gov by mailhub.dfrc.nasa.gov with ESMTP for sc22wg5@dkuug.dk; Thu, 4 Sep 2003 09:54:34 -0700
Received: from altair.dfrc.nasa.gov ([130.134.20.211])
          by mail.dfrc.nasa.gov (Post.Office MTA v3.5.3 release 223
          ID# 0-71686U2500L200S0V35) with ESMTP id gov
          for <sc22wg5@dkuug.dk>; Thu, 4 Sep 2003 09:57:40 -0700
Received: by altair.dfrc.nasa.gov (Postfix, from userid 201)
	id CFF8935760; Thu,  4 Sep 2003 09:57:38 -0700 (PDT)
From: Richard Maine <Richard.Maine@nasa.gov>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <16215.28418.740485.280288@altair.dfrc.nasa.gov>
Date: Thu, 4 Sep 2003 09:57:38 -0700
To: sc22wg5@dkuug.dk
Subject: paragraph numbering
X-Mailer: VM 7.07 under 21.4 (patch 12) "Portable Code" XEmacs Lucid
Sender: owner-sc22wg5@dkuug.dk
Precedence: bulk

There has been some discussion (partly off-list) about the possibility
of putting paragraph numbers in the FCD (and the published standard).
Apparently we cannot put line numbers in the actual standard, but
paragraph numbers are acceptable.  (We knew before that line
numbers were at best questionable, so the 007 is done in a way
that makes it trivial to turn them all off).

I do classify this as a purely typographical issue, albeit a fairly
large one just because of its global nature.  I'd like to get some
feedback from WG5 as a whole on the question of adding paragraph
numbers.  We don't appear to have a choice about the line numbers, so
that's not the part I am asking fro feedback about.  The question is
whether to add paragraph numbers of have nothing.

I've experimented a little with paragraph numbering, both with some
suggestions of Van's and with some things I found by googling.  My
conclusions follow.

1. I don't think we are going to find a viable way to automate it all
   so that we can just turn on an option and have the whole document
   line-numbered.  Lots of issues there.

However

2. It is fairly easy to do manually, using only minor tweaking of
   macros that we already have.

The paragraph numbers are over in the margin, just like where the
line numbers are now.  They are numbered starting at 1 within
each subsection.  See the 1999 C standard for an example.  Ours
would look very similar to that.

I am willing to consider doing this manually.  I would like some early
feedback from WG5 on whether we want to pursue this so that I can
start early on doing it instead of waiting until the end of the month.
I don't need a commitment - I can make sure to do the work in a copy,
but I'd like to get a sense of leaning.  If we want to do this at all,
I think it would be good to do it in the FCD so as to have a chance to
actually see and tweak the result before committing the actual
standard to it.

What this requires that I do is

1. Minor tweaking of the j3.cls macros.  Almost works with no tweaking
   at all; the stuff to support this is already in there...except that
   the twosided option breaks the paragraph numbers on half the pages;
   that's an easy fix.

2. Manually add \parn before every paragraph that we want numbered.
   Per Van's suggestion, I'd probably put this on a separate line
   in the LaTeX source (making it simple to do subsequent automated
   things with...including such things as deleting those lines if
   later desired).

Capabilities and implications

1. Having to manually mark which paragraphs will be numbered is
   a bit of up-front work.  It does, however, give us a lot of
   human flexibility.  Within the limitations discussed below, it
   is easy for us to specify exactly what counts as a paragraph to
   be numbered and what doesn't.  We won't end up fighting with
   problems like "it wants to call this sentence fragment a paragraph;
   how can we override that?"

   Oh, and one piece of this flexibility might be appreciated
   during maintenance work.  We can keep para numbers in sync
   with the published standard, even if we add or delete paras
   during maintenance.  We could just make added paras non-numbered,
   and we can manually increment the para number to skip the
   number of any deleted paras.

2. Will not work inside of notes.  No way.  Not even close.  Maybe
   some other way of doing it, but not this one.  Of course, we don't
   have anything for line numbering in notes right now.

3. Doesn't trivially work in things like numbered lists either.
   We'll be able to number the lead-in phrase above the list,
   basically tagging the whole list as a single paragraph.  We
   can't paragraph-number the individual list items.  Not
   sure whether I could fix that with sufficient work or not.  I'm
   inclined not to try at this point, just accepting that list items
   won't have separate paragraph numbers.  This seems ok to me, as
   they usually do have item numbers (which we already use to
   reference some of them, even in normative text).

   Worst case for lists is probably where a list item has multiple
   paragraphs within the item.  I think it might actually work to
   give paragraph numbers to all paragraphs *other* than the first
   one in an item, but I didn't try as I think it would stand out as
   strange anyway.

   This applies to other list-like environments as well (for examlpe,
   cases like in the result value of ASSOCIATED in c13).

3. I didn't even try tables.  I wouldn't know where to start, and I
   doubt it would be able to do anything useful.

4. Slightly to my surprise, it does appear to work on the bnf
   (when I give a para number to each bnf rule and to each constraint).

5. Probably would have to make a few style decisions about what to
   number and what not to.  Many cases are obvious, but there are
   a handful that one could argue either way (anyway, I can).  Can
   work details of those later.

6. Oh yes, and like the line numbers, it is easy to turn them off
   globally.  A single line can effectively turn them all off
   without necessarily having to delete the \parn lines.

Obviously, the whole paragraph numbering thing doesn't tie things
down as closely as line numbers, but if it can actually be in the
published standard, be the same regardless of page formatting
changes and translation, and keep unchanged during maintenance,
those do seem like significant benefits to balance out the loss
of precision relative to line numbers.

(Van thinks it might be possible to do both para numbers and line
numbers for internal drafts if we wanted to, but I haven't tried that.
I personally think that if we are going to add the para numbers, then
we should use them even for our internal work, having only one system
instead of two.)

-- 
Richard Maine                |  Good judgment comes from experience;
Richard.Maine@nasa.gov       |  experience comes from bad judgment.
                             |        -- Mark Twain
