groff-commit
[Top][All Lists]
Advanced

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

[groff] 11/21: tmac/papersize.tmac: Improve integration w/ mm(7).


From: G. Branden Robinson
Subject: [groff] 11/21: tmac/papersize.tmac: Improve integration w/ mm(7).
Date: Fri, 18 Nov 2022 13:47:52 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 23ffa46c8c951fec1d23dfe4b0dbbbe1299fa5d2
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Nov 17 15:09:39 2022 -0600

    tmac/papersize.tmac: Improve integration w/ mm(7).
    
    * tmac/papersize.tmac: Improve integration with mm(7) macro package.  If
      a paper format has been selected, set `W` register to new line length
      (if not already set on command line).  Similarly, set `O` register to
      1 inch for the symmetric horizontal margins otherwise assumed by this
      macro file.  This means that "groff -mm" and "groff -dpaper=letter
      -mm" are _not_ synonymous (when groff is configured to use U.S. letter
      as the default paper format), because groff mm(7) uses a page offset
      of 0.963 inches on typesetters for compatibility with DWB mm.
    
    * NEWS: Add item.
    
    See discussion in <https://lists.gnu.org/archive/html/groff/2022-11/\
    msg00081.html> and (some) follow-ups.
---
 ChangeLog           | 16 ++++++++++++++++
 NEWS                | 10 ++++++++++
 tmac/papersize.tmac | 10 +++++++---
 3 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2d5fe68ba..b365a70b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2022-11-17  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/papersize.tmac: Improve integration with mm(7) macro
+       package.  If a paper format has been selected, set `W` register
+       to new line length (if not already set on command line).
+       Similarly, set `O` register to 1 inch for the symmetric
+       horizontal margins otherwise assumed by this macro file.  This
+       means that "groff -mm" and "groff -dpaper=letter -mm" are _not_
+       synonymous (when groff is configured to use U.S. letter as the
+       default paper format), because groff mm(7) uses a page offset of
+       0.963 inches on typesetters for compatibility with DWB mm.
+       * NEWS: Add item.
+
+       See discussion in <https://lists.gnu.org/archive/html/\
+       groff/2022-11/msg00081.html> and (some) follow-ups.
+
 2022-11-16  Deri James  <deri@chuzzlewit.myzen.co.uk>
 
        * src/devices/gropdf/gropdf.pl: If the argument to the paper
diff --git a/NEWS b/NEWS
index 0c1e1f079..599bcff7a 100644
--- a/NEWS
+++ b/NEWS
@@ -360,6 +360,16 @@ o The e (me) and s (ms) macro packages now offer a `PF` 
macro,
   supporting the pic(1) preprocessor's "flyback" feature.  Thanks to
   Dave Kemper.
 
+o The m (mm) macro package now adapts to the paper format selected when
+  the macro file "papersize.tmac" is used (by specifying the groff "-d
+  paper" command-line option).  A consequence is that "groff -mm" and
+  "groff -d paper=letter -mm" are _not_ synonymous (when groff is
+  configured to use U.S. letter as the default paper format), because
+  groff mm(7) uses a page offset of 0.963 inches on typesetters for
+  compatibility with DWB mm.  If the `W` or `O` registers are also set
+  on the command line, the line length and page offset, respectively,
+  are not overridden.
+
 o The m (mm) macro package now recognizes a `V` register to set the
   vertical spacing for the document.  Like the existing `S`, it must be
   set from the command line.  Further, both registers are interpreted
diff --git a/tmac/papersize.tmac b/tmac/papersize.tmac
index c40473404..6d5ad14c2 100644
--- a/tmac/papersize.tmac
+++ b/tmac/papersize.tmac
@@ -1,6 +1,4 @@
-.\" papersize.tmac
-.\"
-.\" Set up groff for various paper sizes.
+.\" Set up GNU troff for various paper sizes.
 .\"
 .\" Usage:
 .\"
@@ -150,6 +148,12 @@
 .      nr LL \n[.l]u  \" for ms, mdoc, man
 .    if !r #R_MARGIN \
 .      nr R_MARGIN 1i \" for mom
+.    \" for mm
+.    if !r W \{\
+.      nr W \n[.l]u
+.      if !r O \
+.        nr O 1i
+.    \}
 .  \}
 .\}
 .



reply via email to

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