groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/08: [ms]: Add \*<, \*> for subscripting.


From: G. Branden Robinson
Subject: [groff] 01/08: [ms]: Add \*<, \*> for subscripting.
Date: Sat, 31 Oct 2020 23:48:20 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit cc558e470c6e58e9c10292ce42d3a1efc833e31c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 31 21:29:49 2020 +1100

    [ms]: Add \*<, \*> for subscripting.
    
    * tmac/s.tmac: Implement \*< and \*> strings for subscripting.  groff ms
      has had (extension) strings for superscripting since 1991 at the
      latest, and the asymmetry possessed me of a madness.  Both pairs of
      string names follow similar usage in Eric Allman's "me" macros.
    
    * NEWS:
    * doc/groff.texi:
    * tmac/groff_ms.7.man: Document it.
---
 ChangeLog           | 12 ++++++++++++
 NEWS                |  4 ++++
 doc/groff.texi      |  5 +++++
 tmac/groff_ms.7.man |  8 ++++++++
 tmac/s.tmac         |  6 ++++++
 5 files changed, 35 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index afa68a5..a0b6b9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2020-10-31  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * tmac/s.tmac: Implement \*< and \*> strings for subscripting.
+       groff ms has had (extension) strings for superscripting since
+       1991 at the latest, and the asymmetry possessed me of a madness.
+       Both pairs of string names follow similar usage in Eric Allman's
+       "me" macros.
+
+       * NEWS:
+       * doc/groff.texi:
+       * tmac/groff_ms.7.man: Document it.
+
+2020-10-31  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/groff_mdoc.7.man (Predefined strings): Fix error; the
        \*[Lq] and \*[Rq] strings degrade to neutral double quotes (")
        on "nroff" devices (-Tascii and -Tlatin1), not "``" and "''".
diff --git a/NEWS b/NEWS
index d09bce0..35d7722 100644
--- a/NEWS
+++ b/NEWS
@@ -112,6 +112,10 @@ o The doc (mdoc) macro package now honors the HY register 
as the an
   furthermore recognizes but ignores the AD string (see above) for
   compatibility with an (man).
 
+o The s (ms) macro package has added strings, \*< and \*>, to perform
+  subscripting within a paragraph.  They work analogously to the \*{ and
+  \*} strings that have been present in groff ms since 1991 or earlier.
+
 o The s (ms) macro package no longer manipulates the warning level.  If
   you want all warnings on, use the ".warn" request with no arguments in
   your ms document or pass "-w w" to groff (see troff(1) or the groff
diff --git a/doc/groff.texi b/doc/groff.texi
index 3b28f65..6ff849a 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -3239,6 +3239,11 @@ Text enclosed with @code{\*@{} and @code{\*@}} is 
printed as a
 superscript.
 @endDefstr
 
+@DefstrList {<, ms}
+@DefstrListEndx {>, ms}
+Text enclosed with @code{\*<} and @code{\*>} is printed as a subscript.
+@endDefstr
+
 @c ---------------------------------------------------------------------
 
 @node Lists in ms, Indentation values in ms, Highlighting in ms, ms Body Text
diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index d7992d3..8b9967e 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -830,6 +830,7 @@ the normal point size
 .B PS
 register).
 .
+.
 .TP
 .BI \[rs]*{ text \[rs]*}
 Print the enclosed
@@ -837,6 +838,13 @@ Print the enclosed
 as a superscript.
 .
 .
+.TP
+.BI \[rs]*< text \[rs]*>
+Print the enclosed
+.I text
+as a subscript.
+.
+.
 .\" ====================================================================
 .SS Indents
 .\" ====================================================================
diff --git a/tmac/s.tmac b/tmac/s.tmac
index fafa93e..29a2d1b 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1508,10 +1508,16 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 \s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
 .ds par*ux-rg
 ..
+.\" superscript
 .ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
 .als { par@sup-start
 .ds par@sup-end \v'-.7m\s0+.9m'
 .als } par@sup-end
+.\" subscript
+.ds par@sub-start \v'+.3m\s'\En[.s]*7u/10u'-.1m'
+.als < par@sub-start
+.ds par@sub-end \v'+.1m\s0-.3m'
+.als > par@sub-end
 .\" footnote paragraphs
 .\" FF is the footnote format
 .nr FF 0



reply via email to

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