summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2021-04-21 04:28:52 +1000
committerG. Branden Robinson <g.branden.robinson@gmail.com>2021-04-21 05:28:57 +1000
commitfd15f9f61f199f51559195546e3abcc827023331 (patch)
tree0d3edfae41a79b8955d69b44196b6760cbd0d329
parentfea5e653f57041422f743d13d66bb57ff758d8f3 (diff)
downloadgroff-git-fd15f9f61f199f51559195546e3abcc827023331.tar.gz
tmac/s.tmac: Make FAM string work more sensibly.
* tmac/s.tmac: Make the FAM string work more sensibly; it now applies to headers, footers, and footnotes only if set before the first call of a sectioning, paragraphing, or (non-date) document description macro. (PT, BT): Set the font family to that saved for titles. (fn*do-FS): Set the font family to that saved for footnotes. (par@init): Copy the document font family to independent strings for titles and footnotes. (par@reset): If in a footnote environment, set the font family to that saved for footnotes; otherwise use \*[FAM]. * tmac/groff_ms.7.man (Differences from troff ms/Text settings): Describe placement-dependent effect of FAM string setting. * doc/groff.texi (Highlighting in ms): * doc/ms.ms (Highlighting): As above, and suggest different occasions in which ".ds FAM C" and "CW" are convenient. Fixes <https://savannah.gnu.org/bugs/?60422>.
-rw-r--r--ChangeLog22
-rw-r--r--doc/groff.texi17
-rw-r--r--doc/ms.ms52
-rw-r--r--tmac/groff_ms.7.man15
-rw-r--r--tmac/s.tmac8
5 files changed, 92 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 86be3373f..ce6085b97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2021-04-21 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * tmac/s.tmac: Make the FAM string work more sensibly; it now
+ applies to headers, footers, and footnotes only if set
+ before the first call of a sectioning, paragraphing, or
+ {non-date} document description macro.
+ (PT, BT): Set the font family to that saved for titles.
+ (fn*do-FS): Set the font family to that saved for footnotes.
+ (par@init): Copy the document font family to independent strings
+ for titles and footnotes.
+ (par@reset): If in a footnote environment, set the font family
+ to that saved for footnotes; otherwise use \*[FAM].
+
+ * tmac/groff_ms.7.man (Differences from troff ms/Text settings):
+ Describe placement-dependent effect of FAM string setting.
+
+ * doc/groff.texi (Highlighting in ms):
+ * doc/ms.ms (Highlighting): As above, and suggest different
+ occasions in which ".ds FAM C" and "CW" are convenient.
+
+ Fixes <https://savannah.gnu.org/bugs/?60422>.
+
2021-04-19 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (source, source_quietly,
diff --git a/doc/groff.texi b/doc/groff.texi
index d8f5552ab..99255686a 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -3241,11 +3241,6 @@ Sets its first argument in a @code{constant-width} (monospaced)
roman typeface. It operates similarly to the @code{B}@tie{}macro
otherwise. This is a Version@tie{}10 Research Unix extension.
@c possibly V9, but definitely not Berkeley
-
-In @code{groff} @file{ms} you might prefer to change the font family to
-Courier, which is monospaced, by setting the @code{FAM} string to
-@samp{C}. You can then use all four style macros above, returning to
-the default family (Times) with @samp{.ds FAM T}.
@endDefmac
@Defmac {BX, [@Var{txt}], ms}
@@ -3289,6 +3284,18 @@ superscript.
Text enclosed with @code{\*<} and @code{\*>} is printed as a subscript.
@endDefstr
+Rather than calling the @code{CW} macro, in @code{groff} @file{ms} you
+might prefer to change the font family to Courier---a monospaced
+typeface---by setting the @code{FAM} string to @samp{C}. You can then
+use all four style macros above, returning to the default family (Times)
+with @samp{.ds FAM T}. If you set @code{FAM} before the first call of a
+sectioning, paragraphing, or (non-date) document description macro, it
+also applies to headers, footers, and footnotes (as well as the body
+text). A change to @code{FAM} takes effect at the next paragraph, so
+@code{CW} remains useful to ``inline'' a change to the font family,
+similarly to the practice of this document in noting syntactical
+elements of @file{ms} and @code{groff}.
+
@c ---------------------------------------------------------------------
@node Lists in ms, Indented regions in ms, Highlighting in ms, ms Body Text
diff --git a/doc/ms.ms b/doc/ms.ms
index d5518c371..0bbcf5f13 100644
--- a/doc/ms.ms
+++ b/doc/ms.ms
@@ -1207,20 +1207,6 @@ macro otherwise.
.
This is a Version\~10 Research Unix extension.
.\" possibly V9, but definitely not Berkeley
-.
-.
-.sp \n[PD]u
-In
-.I "groff ms"
-you might prefer to change the font family to Courier\[em]a monospaced
-typeface\[em]by setting
-.CW \[rs]*[FAM]
-to
-.CW C \[rq]. \[lq]
-.
-You can then use all four style macros above,
-returning to the default family (Times) with
-.CW ".ds FAM T" \[rq]. \[lq]
T}
_
\&.BX [txt] T{
@@ -1294,6 +1280,44 @@ T}
.TE
.
.
+.PP
+Rather than calling the
+.CW CW
+macro,
+in
+.I "groff ms"
+you might prefer to change the font family to Courier\[em]a monospaced
+typeface\[em]by setting
+.CW \[rs]*[FAM]
+to
+.CW C \[rq]. \[lq]
+.
+You can then use all four style macros above,
+returning to the default family (Times) with
+.CW ".ds FAM T" \[rq]. \[lq]
+.
+If you set
+.CW \[rs]*[FAM]
+before the first call of a sectioning,
+paragraphing,
+or (non-date) document description macro,
+it also applies to headers,
+footers,
+and footnotes
+(as well as the body text).
+.
+A change to
+.CW \[rs]*[FAM]
+takes effect at the next paragraph,
+so
+.CW .CW
+remains useful to \[lq]inline\[rq] a change to the font family,
+as used in this document to note syntactical elements of
+.I ms
+and
+.I groff .
+.
+.
.NH 2
Lists
.XS
diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index 4ca40e011..71d9b3c62 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -1694,10 +1694,21 @@ respectively, in
.
The
.B FAM
-string sets the default font family.
+string sets the font family for body text.
.
If this string is undefined at initialization,
-it is set to Times.
+it is set to
+.RB \[lq] T \[rq]
+(Times).
+.
+Setting
+.B \[rs]*[FAM]
+before the first call of a sectioning,
+paragraphing,
+or (non-date) document description macro also applies it to headers,
+footers,
+and footnotes
+(as well as the body text).
.
.
.LP
diff --git a/tmac/s.tmac b/tmac/s.tmac
index f00fecdd2..e9c1b3d67 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -501,6 +501,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.af % 0
.nr pg*page-number-in-decimal \\n%
.af % \\*[pg*saved-page-number-format]
+.fam \\*[pg@titles-font-family]
.ie \\n[pg*page-number-in-decimal]=1 .if \\n[pg*P1] .tl \\*[pg*OH]
.el \{\
. ie o .tl \\*[pg*OH]
@@ -508,6 +509,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.\}
..
.de BT
+.fam \\*[pg@titles-font-family]
.ie o .tl \\*[pg*OF]
.el .tl \\*[pg*EF]
..
@@ -713,6 +715,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.par@reset-env
.fn*start-div
.par@reset
+.fam \\*[fn@font-family]
.ie \\n[.$] .FP \\$@
.el .@LP
..
@@ -1156,6 +1159,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.if !rFPD .nr FPD \\n[PD]/2
.ev
.if !dFAM .ds FAM \\n[.fam]
+.ds pg@titles-font-family \\*[FAM]
+.ds fn@font-family \\*[FAM]
.nr par*adj \\n[.j]
.par*env-init
.ev h
@@ -1210,7 +1215,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.\}
.in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
.ft 1
-.fam \\*[FAM]
+.ie '\\n[.ev]'fn' .fam \\*[fn@font-family]
+.el .fam \\*[FAM]
.ie (\\n[\\n[.ev]:PS] >= 1000) \
. ps (\\n[\\n[.ev]:PS]z / 1000u)
.el \