groff-commit
[Top][All Lists]
Advanced

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

[groff] 26/33: [me]: Add `wa` and `wc` strings.


From: G. Branden Robinson
Subject: [groff] 26/33: [me]: Add `wa` and `wc` strings.
Date: Thu, 30 Dec 2021 00:46:49 -0500 (EST)

gbranden pushed a commit to branch temp-mail-fail
in repository groff.

commit c1895bcef4e47ebe8e5fab97838250ce85ca0c37
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Dec 26 02:31:29 2021 +1100

    [me]: Add `wa` and `wc` strings.
    
    * tmac/e.tmac: Ease localization and customization by exposing strings
      for "Chapter" and "Appendix" instead of hard-coding these words into
      the `$c` macro.
    
      (initialization): Define new `wa` and `wc` strings.  Separate these
      and existing localization strings from `y2` and `y4` initialization
      since the latter don't involve natural languages.
    
      ($c): Interpolate these strings in chapter and appendix headings and
      in calls to `$C` hook macro.  Set "Chapter" and "Appendix" in mixed
      case instead of full capitals, and set one adjustable nonbreaking word
      space `\~` between them and the chapter number instead of two
      unadjustable nonbreaking spaces.  (These changes do slightly alter the
      default output of the package when the `+c` macro is used.)
    
    * doc/meref.me.in (Predefined Strings):
    * tmac/groff_me.7.man (Strings): Document new strings.
    
    * doc/meintro.me.in (Parts of the Basic Paper): Update example
      to reflect mixed-case default string.
    
    Fixes <https://savannah.gnu.org/bugs/?61661>.
---
 ChangeLog           | 24 ++++++++++++++++++++++++
 doc/meintro.me.in   |  2 +-
 doc/meref.me.in     | 35 +++++++++++++++++++++++++----------
 tmac/e.tmac         | 20 ++++++++++++--------
 tmac/groff_me.7.man |  2 ++
 5 files changed, 64 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6885dcee..c2c51b75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2021-12-26  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/e.tmac: Ease localization and customization by exposing
+       strings for "Chapter" and "Appendix" instead of hard-coding
+       these words into the `$c` macro.
+       (initialization): Define new `wa` and `wc` strings.  Separate
+       these and existing localization strings from `y2` and `y4`
+       initialization since the latter don't involve natural languages.
+       ($c): Interpolate these strings in chapter and appendix headings
+       and in calls to `$C` hook macro.  Set "Chapter" and "Appendix"
+       in mixed case instead of full capitals, and set one
+       adjustable nonbreaking word space `\~` between them and the
+       chapter number instead of two unadjustable nonbreaking spaces.
+       {These changes do slightly alter the default output of the
+       package when the `+c` macro is used.}
+
+       * doc/meref.me.in (Predefined Strings):
+       * tmac/groff_me.7.man (Strings): Document new strings.
+
+       * doc/meintro.me.in (Parts of the Basic Paper): Update example
+       to reflect mixed-case default string.
+
+       Fixes <https://savannah.gnu.org/bugs/?61661>.
+
 2021-12-25  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/e.tmac (@p): Deactivate right alignment (the effect of
diff --git a/doc/meintro.me.in b/doc/meintro.me.in
index 10af45a8..a71b1a49 100644
--- a/doc/meintro.me.in
+++ b/doc/meintro.me.in
@@ -1588,7 +1588,7 @@ which will produce,
 on a new page,
 the lines
 .(b C
-CHAPTER 5
+Chapter 5
 CONCLUSIONS
 .)b
 with appropriate spacing for a thesis.
diff --git a/doc/meref.me.in b/doc/meref.me.in
index 6d6ff3ee..55eacfb6 100644
--- a/doc/meref.me.in
+++ b/doc/meref.me.in
@@ -1762,14 +1762,18 @@ call
 .DE
 Format a chapter heading
 centered in boldface.
-Output
-.q \fBCHAPTER\fP
+Output the text in
+.ST (wc
+[\c
+.b Chapter ]
 if the segment type is
 .b C
 or
 .b RC,
-or
-.q \fBAPPENDIX\fP
+or the text in
+.ST (wa
+[\c
+.b Appendix ]
 if the segment type is
 .b A
 or
@@ -1790,12 +1794,7 @@ If the segment type is any of
 or
 .b RA ,
 call
-.b $C
-(with the word
-.q Chapter
-or
-.q Appendix
-in mixed case).
+.b $C .
 .TL
 .b .$C
 .i K
@@ -1906,6 +1905,20 @@ and
 (year of the century).
 Assign the registers to set the date;
 the default is the date of formatting by \*T.
+.TL
+.ST (wa
+.DE
+The term the
+.b .$c
+macro uses for
+.q appendix .
+.TL
+.ST (wc
+.DE
+The term the
+.b .$c
+macro uses for
+.q chapter .
 .sh 1 "Special Characters"
 .pp
 For modern documents,
@@ -2308,6 +2321,8 @@ and a square \(sq marks \*G extensions.
 \&.ul  M\(sc   underline output lines
 \ev\(aq\fI\,d\/\fP\(aq F\(sc   move distance \fId\fP vertically
 \ew\(aq\fI\,S\/\fP\(aq F\(sc   interpolate formatted width of \fIS\fP
+\e*(wa S\(sq   term for \(lqappendix\(rq used by \fB.$c\fP
+\e*(wc S\(sq   term for \(lqchapter\(rq used by \fB.$c\fP
 \&.xl  M       set line length (current environment)
 \&.xp  M       output index
 \en(xs R       index entry prespace
diff --git a/tmac/e.tmac b/tmac/e.tmac
index c24f1efd..2ed16488 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1921,8 +1921,8 @@
 .ce 1000
 .if \\n(_M<3 \
 .      nr ch +1
-.ie \\n(_M=1 CHAPTER\ \ \\n(ch
-.el .if \\n(_M=2 APPENDIX\ \ \\n(ch
+.ie \\n(_M=1 \\*(wc\~\\n(ch
+.el .if \\n(_M=2 \\*(wa\~\\n(ch
 .if \w"\\$1" .sp 3-\\n(.L
 .if \w"\\$1" \\$1
 .if (\\n(_M<3):(\w"\\$1") \
@@ -1931,9 +1931,9 @@
 .ft
 .sz
 .ie \\n(_M=1 \
-.      $C Chapter \\n(ch "\\$1"
+.      $C "\\*(wc" \\n(ch "\\$1"
 .el .if \\n(_M=2 \
-.      $C Appendix \\n(ch "\\$1"
+.      $C "\\*(wa" \\n(ch "\\$1"
 ..
 .
 .de tp                 \" *** title page
@@ -1944,7 +1944,14 @@
 .pn \\n%
 ..
 .
-.\"            *** DATES ***
+.\" Work around troff `yr` register's y2k problem.
+.nr y2 \n(yr%100
+.af y2 00
+.nr y4 \n(yr+1900
+.
+.\"            *** LOCALIZATION ***
+.ds wa Appendix\"
+.ds wc Chapter\"
 .if \n(mo=1 .ds mo January
 .if \n(mo=2 .ds mo February
 .if \n(mo=3 .ds mo March
@@ -1964,9 +1971,6 @@
 .if \n(dw=5 .ds dw Thursday
 .if \n(dw=6 .ds dw Friday
 .if \n(dw=7 .ds dw Saturday
-.nr y2 \n(yr%100
-.af y2 00
-.nr y4 \n(yr+1900
 .ds td \*(mo \n(dy, \n(y4
 .
 .
diff --git a/tmac/groff_me.7.man b/tmac/groff_me.7.man
index 66fbe81a..19788b93 100644
--- a/tmac/groff_me.7.man
+++ b/tmac/groff_me.7.man
@@ -393,6 +393,8 @@ lq  left double quotation mark
 mo     month name
 rq     right double quotation mark
 td     date
+wa     term for \(lqappendix\(rq used by \fB.$c*
+wc     term for \(lqchapter\(rq used by \fB.$c*
 {      begin superscripting
 }      end superscripting
 .TE



reply via email to

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