[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #64206] [mm] indexing system paginates badly
From: |
G. Branden Robinson |
Subject: |
[bug #64206] [mm] indexing system paginates badly |
Date: |
Wed, 17 May 2023 05:02:59 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?64206>
Summary: [mm] indexing system paginates badly
Group: GNU roff
Submitter: gbranden
Submitted: Wed 17 May 2023 09:02:57 AM UTC
Category: Macro mm
Severity: 3 - Normal
Item Group: Incorrect behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 17 May 2023 09:02:57 AM UTC By: G. Branden Robinson <gbranden>
Affects groff 1.22.4.
$ cat EXPERIMENTS/use-index.mm
.INITI N myindex
.P
This is my document.
.IND "first item"
.IND "item, first"
.bp
.P
Here is some more stuff.
.IND "second item"
.IND "item, second"
This concludes our regularly scheduled programming.
.INDP
$ mmroff -Tascii EXPERIMENTS/use-index.mm | cat -s
- 1 -
This is my document.
- 2 -
Here is some more stuff. This concludes our regularly
- 3 -
scheduled programming.
- 4 -
INDEX
first item 1
item, first 1
item, second 2
second item 2
- 5 -
I see two problems here.
A. The page is being broken before the index without flushing the pending
output line first. This smells like a missing `br` request to me.
B. The page is being broken after the index even if there is no further
content.
One can apparently redefine `TYIND` to get around the first problem. It would
be better to use `TXIND` for this purpose, and if it is not defined, call `SK`
(or something similar) as the fallback for `TYIND` currently does.
.de INDP
.ie \\n[Ref] .tm .\\\\" Index: \\*[ind*file]
.el \{\
. if !\\n[Cp] .pg@next-page
. \" print INDEX
. \" execute user-defined macros
. if d TXIND .TXIND
. ie d TYIND .TYIND
. el \{\
. SK
. ce
\\*[Index]
. SP 3
. 2C
. nf
. \}
' so \\*[ind*file]
. ie d TZIND .TZIND
. el \{\
. fi
. 1C
. \}
.\}
.rm ind*file
..
It's a shame the default operation wastes a page at the end of the document in
(what I assume is) the common case of having no material in the document after
the index. (I assume not _everybody_ sticks on a colophon or whatever.)
Possibly `INDP` could take a pair of arguments controlling whether the page is
broken before and after, respectively. It would of course pass these
arguments to the appropriate hook macros.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64206>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #64206] [mm] indexing system paginates badly,
G. Branden Robinson <=