groff-commit
[Top][All Lists]
Advanced

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

[groff] 08/12: [me]: Parameterize super/subscript line ht adjust.


From: G. Branden Robinson
Subject: [groff] 08/12: [me]: Parameterize super/subscript line ht adjust.
Date: Thu, 16 Dec 2021 07:11:24 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 6eafd2084b9172fc132335fc6a22dc516d0d88b2
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Dec 16 18:37:45 2021 +1100

    [me]: Parameterize super/subscript line ht adjust.
    
    * tmac/e.tmac (initialization): Assign 0.2m to register `$x`.2m.
    
      ({, <}: Apply adjustment, multiplied by -1 for superscripts.
    
    * doc/meref.me.in:
    * tmac/groff_me.7.man: Document it.
    
    * NEWS: Add item.
    
    * doc/meintro.me.in:
    * doc/meintro_fr.me.in:
    * doc/meref.me.in: Forego extra line height for more attractive
      typesetting.
    
    Fixes <https://savannah.gnu.org/bugs/?61025>.  Thanks to Robert Goulding
    for the suggestion.
---
 ChangeLog            | 20 ++++++++++++++++++++
 NEWS                 |  6 ++++++
 doc/meintro.me.in    |  1 +
 doc/meintro_fr.me.in |  1 +
 doc/meref.me.in      | 13 +++++++++----
 tmac/e.tmac          | 13 +++++++------
 tmac/groff_me.7.man  |  1 +
 7 files changed, 45 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 550f6b9..d7f26e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2021-12-16  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       Parameterize line height adjustment when super/subscripting.
+
+       * tmac/e.tmac (initialization): Assign 0.2m to register `$x`.2m.
+       ({, <}: Apply adjustment, multiplied by -1 for superscripts.
+
+       * doc/meref.me.in:
+       * tmac/groff_me.7.man: Document it.
+
+       * NEWS: Add item.
+
+       * doc/meintro.me.in:
+       * doc/meintro_fr.me.in:
+       * doc/meref.me.in: Forego extra line height for more attractive
+       typesetting.
+
+       Fixes <https://savannah.gnu.org/bugs/?61025>.  Thanks to Robert
+       Goulding for the suggestion.
+
 2021-12-15  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/e.tmac ($c): Draw the footnote separator no wider than
diff --git a/NEWS b/NEWS
index a4a0b0c..3af1e78 100644
--- a/NEWS
+++ b/NEWS
@@ -224,6 +224,12 @@ o The doc (mdoc) macro package now honors the HY register 
as the an
   furthermore recognizes the `AD` string (see above) for compatibility
   with an (man), but at present ignores its value.
 
+o The e (me) macro package now has a register `$x` that eases the
+  configuration of space added to the line height above/below when
+  super/subscripting is used.  It defaults to 0.2m, the value used
+  literally in past definitions of the super/subscripting strings.
+  groff's own 'me' documents redefine it to zero.
+
 o The m (mm) macro package now requires a title to be declared when
   memorandum type 5 is used (".MT 5"), just as type 4 has since groff
   1.10 (November 1995).
diff --git a/doc/meintro.me.in b/doc/meintro.me.in
index 8dc267c..ef1493e 100644
--- a/doc/meintro.me.in
+++ b/doc/meintro.me.in
@@ -37,6 +37,7 @@
 .\"UC 7
 .ll 6.5i
 .lt 6.5i
+.nr $x 0
 .ds MO @VERSION@
 .nr si 3n
 .he 'Using \f(BIgroff\fP and \f(BI\-me\fP''%'
diff --git a/doc/meintro_fr.me.in b/doc/meintro_fr.me.in
index 8327a1c..5b95a14 100644
--- a/doc/meintro_fr.me.in
+++ b/doc/meintro_fr.me.in
@@ -39,6 +39,7 @@
 .\"UC 7
 .ll 6.5i
 .lt 6.5i
+.nr $x 0
 .ds MO @VERSION@
 .nr si 3n
 .he '\f(BIgroff\fP en option \f(BI\-me\fP''%'
diff --git a/doc/meref.me.in b/doc/meref.me.in
index a132cc9..44db64f 100644
--- a/doc/meref.me.in
+++ b/doc/meref.me.in
@@ -38,6 +38,7 @@
 .lt 6.5i
 .nr pp 10
 .nr fi 1n
+.nr $x 0
 .\"pn 0
 .ds MO @VERSION@
 .de TL                 \" *** title line
@@ -1837,8 +1838,10 @@ Delayed text number surrounded by square brackets:
 .DE
 Begin superscripting:
 move upward and reduce the type size.
-Extra space is left above the line
-to allow room for the superscript.
+The line height is increased above by
+.NR ($x
+[0.2m]
+to accommodate the superscript.
 In \*N mode,
 output a left square bracket.
 .TL
@@ -1866,8 +1869,9 @@ on terminals.
 .DE
 Begin subscripting:
 move downward and reduce the type size.
-Extra space is left below the line
-to allow for the subscript.
+The line height is increased below by
+.NR ($x
+to accommodate the subscript.
 In \*N mode,
 output a left angle bracket.
 .TL
@@ -2110,6 +2114,7 @@ and a square \(sq marks \*G extensions.
 \en($s R       column spacing (indentation)
 \&.$s  M\(dd   output footnote area separator
 \en($v R\(dd   vertical spacing of text (%)
+\en($x R\(dd   super/subscript line height increase
 \e%    F\(sc   control hyphenation
 \en%   R\(sc   current page number
 \e&    F\(sc   non-printing input break
diff --git a/tmac/e.tmac b/tmac/e.tmac
index 8a03b1c..3cc3fc6 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1971,6 +1971,7 @@
 .
 .nr $v \n(.v00+\n(.sp-1/\n(.sp \" vs as % of ps for .sz request
 .nr $V \n($v                   \" same for displays & footnotes
+.nr $x 0.2m                    \" super/subscript line height increase
 .nr hm 4v                      \" header margin
 .nr tm 7v                      \" top margin
 .nr bm 6v                      \" bottom margin
@@ -1992,22 +1993,22 @@
 .nr ss 12p                     \" section prespacing
 .nr si 0                       \" section indent
 .
+.@R 0x\" set by GNU pic to _disable_ \x in super/scripting
 .
 .\"            *** OTHER INITIALIZATION ***
 .
-.
-.\" 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.
+.\"
+.\" Adjust the line height with \x if the `0x` register is zero (a
+.\" pic(1) convention) by the amount in `$x` (a groff 1.23 extension).
 .ie t \
 \{\
-.ds { \v'-0.4m'\x'\\n(0x=0*-0.2m'\s-3
+.ds { \v'-0.4m'\x'\\n(0x=0*-1*\\n($xu'\s-3
 .ds } \s+3\v'0.4m'
 .\}
 .el \
@@ -2028,7 +2029,7 @@
 .\}
 .ie t \
 \{\
-.ds < \v'0.4m'\x'\\n(0x=0*0.2m'\s-3
+.ds < \v'0.4m'\x'\\n(0x=0*\\n($xu'\s-3
 .ds > \s+3\v'-0.4m'
 .\}
 .el \
diff --git a/tmac/groff_me.7.man b/tmac/groff_me.7.man
index 139df74..689f41a 100644
--- a/tmac/groff_me.7.man
+++ b/tmac/groff_me.7.man
@@ -334,6 +334,7 @@ $m  number of available columns
 $p     numbered paragraph number
 $s     column spacing (indentation)
 $v     vertical spacing of text (as percentage)
+$x     super/subscript line height increase
 bi     display (block) indentation
 bm     distance from text area to page bottom
 bs     display (block) pre/post space



reply via email to

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