bug-groff
[Top][All Lists]
Advanced

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

[bug #62825] Incorrect section number using \*($n in a header


From: anonymous
Subject: [bug #62825] Incorrect section number using \*($n in a header
Date: Thu, 28 Jul 2022 18:22:27 -0400 (EDT)

Follow-up Comment #5, bug #62825 (project groff):

[comment #4 comment #4:]
> Consider a page where the top half wraps up section 1.4, then section 2.1
begins, and has a paragraph or two on the lower half of the page.  Here you
want your page header to indicate section 1.4, since that's the section in
effect when the page begins, but the above-described system would put section
2.1 in the header.

Hmm, every book I've ever seen with section numbers/titles in the header uses
the info for the last section on the page. So in your scenario they would use
2.1, not 1.4, in the header. I think this is pretty much the standard
convention in publishing, including for FSF publications. Do you have any
examples of books that don't do that?

[comment #4 comment #4:]
> Your situation is an edge case, where a page break happens to coincide with
a section change.  In this case, -me does not look ahead to see that the very
first thing to happen is the beginning of a new section, so it prints what
looks like an incorrect section number in the header.  But technically, this
_is_ the section that was in effect when the page began, and it is only over
the course of the page that it changed.

Many books have sections that start on a new page, so I'm not sure it's such
an edge case. Those books with the section number or title in the header show
the new section info in the header when the section starts the page.

For example, two of the famous books typeset in troff (the K&R C book and
Stevens' _APUE_ book) do just that. I'm now curious how they did it! In fact,
in K&R (2nd ed) there are examples of a new section starting a page (p.139), a
single section starting in the middle of a page (p.13), and a page with two
new sections in the page (p.41). In all cases the header shows the last
section number on that page. _APUE_ does it similarly, though with section
titles instead of numbers. Same for every book I've ever seen.

Since K&R and Stevens were able to get the correct section info in their
headers, the old troff must have had a way of doing it. They used the ms
macros. I've verified that in groff an ms version of my me example has the
same problem. This is tempting me to boot up my ancient Sun SPARCstation LX
running Solaris 2.6, to see if its proprietary version of troff has the same
issue.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62825>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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