[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 24/53: [me]: Add nroff strings for super-, subscripts.
From: |
G. Branden Robinson |
Subject: |
[groff] 24/53: [me]: Add nroff strings for super-, subscripts. |
Date: |
Tue, 14 Dec 2021 01:21:53 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 3252715c3b8696c373b88de7dd35f84c43d6a39e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Dec 5 23:47:12 2021 +1100
[me]: Add nroff strings for super-, subscripts.
* tmac/e.tmac: Add nroff mode string definitions for 4.4BSD
compatibility.
- Define '{' and '}' (superscripting) strings as '[' and ']'.
- Define '<' and '>' (subscripting) strings as '\(la and '\(ra' if
available on the device, otherwise '<' and '>'.
* tmac/tests/e_footnote-marks-work.sh: Update expected output.
* doc/meref.me: Document it.
Fixes <https://savannah.gnu.org/bugs/index.php?61619>.
---
ChangeLog | 14 ++++++++++++++
doc/meref.me | 15 +++++++++++++--
tmac/e.tmac | 29 +++++++++++++++++++++++++++++
tmac/tests/e_footnote-marks-work.sh | 6 +++---
4 files changed, 59 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a1d6000..18cd721 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -71,6 +71,20 @@
2021-12-05 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * tmac/e.tmac: Add nroff mode string definitions for 4.4BSD
+ compatibility.
+ - Define '{' and '}' (superscripting) strings as '[' and ']'.
+ - Define '<' and '>' (subscripting) strings as '\(la and
+ '\(ra' if available on the device, otherwise '<' and '>'.
+
+ * tmac/tests/e_footnote-marks-work.sh: Update expected output.
+
+ * doc/meref.me: Document it.
+
+ Fixes <https://savannah.gnu.org/bugs/index.php?61619>.
+
+2021-12-05 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* doc/doc.am (doc/meintro_fr.ps): Add target rule (overriding
suffix rule) to generate this file using `-mfr` (load the French
localization macro file).
diff --git a/doc/meref.me b/doc/meref.me
index d2c9f43..0756c62 100644
--- a/doc/meref.me
+++ b/doc/meref.me
@@ -1850,12 +1850,16 @@ This string gives upward movement
and a change to a smaller point size.
Extra space is left above the line
to allow room for the superscript.
+In \*N mode,
+it produces a left square bracket.
.TL
.ST }
.DE
Unsuperscript.
Inverse to
.ST { .
+In \*N mode,
+it produces a right square bracket.
For example,
to produce a superscript
you might type
@@ -1863,19 +1867,26 @@ you might type
.ST { \c
.b 2 \c
.ST } ,
-which will produce
-.b x\*{2\*} .
+which will render as
+.b x\*{2\*}
+on typesetters and as
+.b x[2]
+on terminals.
.TL
.ST <
.DE
Subscript.
Extra space is left below the line
to allow for the subscript.
+In \*N mode,
+it produces a left angle bracket.
.TL
.ST >
.DE
Inverse to
.ST < .
+In \*N mode,
+it produces a right angle bracket.
.TL
.ST (dw
.DE
diff --git a/tmac/e.tmac b/tmac/e.tmac
index bbb0353..291049a 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1988,14 +1988,43 @@
.\" GNU pic sets this register to 1 to indicate that \x should not be
.\" used.
.@R 0x
+.\" Define strings for super- and subscripting. groff me does not
+.\" bother with half-line motions in nroff mode, since we have no output
+.\" driver (for that mode) that supports them; consequently we don't
+.\" emit \x escape sequences in that case either. If someone implements
+.\" a Model 37 or line printer emulator we can target, this decision
+.\" could be revisited.
+.ie t \
+\{\
.ds { \v'-0.4m'\x'\\n(0x=0*-0.2m'\s-3
.ds } \s+3\v'0.4m'
+.\}
+.el \
+\{\
+.ds { [\"
+.ds } ]\"
+.\}
.\" for compatibility with traditional -me
.\" (the first will work only in compatibility mode)
.ds [ \*{
.ds ] \*}
+.ds @< <\"
+.ds @> >\"
+.if \n(.g \
+\{\
+.do if c \(la .ds @< \(la\"
+.do if c \(ra .ds @> \(ra\"
+.\}
+.ie t \
+\{\
.ds < \v'0.4m'\x'\\n(0x=0*0.2m'\s-3
.ds > \s+3\v'-0.4m'
+.\}
+.el \
+\{\
+.ds < \*(@<
+.ds > \*(@>
+.\}
.ds - \(em
.\" Avoid warnings from groff -ww.
.@S |0
diff --git a/tmac/tests/e_footnote-marks-work.sh
b/tmac/tests/e_footnote-marks-work.sh
index 031c8e3..616fa9c 100755
--- a/tmac/tests/e_footnote-marks-work.sh
+++ b/tmac/tests/e_footnote-marks-work.sh
@@ -45,18 +45,18 @@ of quartz.\**
output=$(echo "$input" | "$groff" -Tascii -P-cbou -me)
echo "$output" \
- | grep -F 'Jackdaws* love my big1 sphinx** of quartz.2'
+ | grep -F 'Jackdaws* love my big[1] sphinx** of quartz.[2]'
echo "$output" \
| grep -F '* foo'
echo "$output" \
- | grep -F '1 bar'
+ | grep -F '[1] bar'
echo "$output" \
| grep -F '** baz'
echo "$output" \
- | grep -F '2 qux'
+ | grep -F '[2] qux'
# vim:set ai et sw=4 ts=4 tw=72:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 24/53: [me]: Add nroff strings for super-, subscripts.,
G. Branden Robinson <=