[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #60228] [ms]: should support footnote marker brackets for nroff mod
From: |
G. Branden Robinson |
Subject: |
[bug #60228] [ms]: should support footnote marker brackets for nroff mode |
Date: |
Sat, 13 Mar 2021 22:10:52 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
URL:
<https://savannah.gnu.org/bugs/?60228>
Summary: [ms]: should support footnote marker brackets for
nroff mode
Project: GNU troff
Submitted by: gbranden
Submitted on: Sun 14 Mar 2021 03:10:50 AM UTC
Category: Macro - ms
Severity: 1 - Wish
Item Group: New feature
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
When Berkeley added support for automatically numbered footnotes to ms in
4.2BSD, they placed square brackets around the numbers in nroff mode as an
alternative to superscripting them.
groff ms does not do this, and the output is ugly.
Input:
$ cat footnote-markers.ms
.LP
This is my\** paragraph*.
.
.FS
numeric footnote
.FE
.
.FS
* symbolic footnote
.FE
groff Git HEAD output:
$ ./build/test-groff -Tutf8 -ms footnote-markers.ms | sed '/^$/d'
This is my1 paragraph*.
───────────
1 numeric footnote
* symbolic footnote
Heirloom Doctools (191015) ms output:
$ ./bin/nroff -ms footnote-markers.ms | sed '/^$/d'
This is my[1] paragraph*.
_________________________
[1] numeric footnote
[1] * symbolic footnote
March 14, 2021
For historical interest, here's V7 Unix ms output (via SIMH):
$ nroff -ms foot* | sed '/^$/d'
This is my paragraph*.
__________________________
numeric footnote
* symbolic footnote
September 23, 1988
The undefined string * was ignored. In V7, ms took no responsibility for
marking footnotes.
Here's Berkeley's implementation, extracted from 4.2BSD tmac.s.
. \" \** - numbered footnote
.ds * \\*([.\\n+*\\*(.]
.if \n(.V>19 .ds [. \f1[
.if \n(.V>19 .ds .] ]\fP
.if \n(.V<20 .ds [. \f1\s-2\v'-.4m'
.if \n(.V<20 .ds .] \v'.4m'\s+2\fP
The above is inadequate for groff's purposes. The footnote marker-bracketing
strings are conditioned on the number of basic units per vertical unit of
device output resolution, which seems to me to be a heuristic guess about
whether the device supports superscripting or not. I would be interested to
know why the conditionals weren't simply '.if n' and '.if t'.
For groff ms I suggest we can do exactly that.
Here's our implementation:
.ds * \E*[par@sup-start]\En+[fn*text-num]\E*[par@sup-end]
I propose indirecting these par@sup-{start,end} strings through
user-configuration footnote marker bracketing strings, named perhaps FMO and
FMC (yes, three letters since groff ms doesn't work in compatibility mode
anyway). The default would be to use square brackets as Berkeley ms does.
So something like this:
.ie n \{\
. ds FMO [
. ds FMC ]
.\}
.el \{\
. als FMO par@sup-start
. als FMC par@sup-end
.\}
.ds * \E*[FMO]\En+[fn*text-num]\E*[FMC]
Thoughts?
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60228>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #60228] [ms]: should support footnote marker brackets for nroff mode,
G. Branden Robinson <=