[mdoc]: Improve support for Mt macro.

* tmac/doc.tmac (Mt): Give macro a real implementation instead of
  wrapping `Pa`.  Among other benefits, this means that it recognizes a
  `doc-Mt-font` string for styling of the argument, instead of using the
  styling applied to `Pa`.

* tmac/mdoc/doc-ditroff (doc-Mt-font):
* tmac/mdoc/doc-nroff (doc-Mt-font): Define new strings.  Set email
  addresses in italics by default.

* NEWS: Report change in font styling.
This commit is contained in:
G. Branden Robinson 2024-01-28 17:03:46 -06:00
parent 983853cf23
commit 736100ba34
5 changed files with 46 additions and 1 deletions

View File

@ -1,3 +1,16 @@
2024-01-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/doc.tmac (Mt): Give macro a real implementation instead
of wrapping `Pa`. Among other benefits, this means that it
recognizes a `doc-Mt-font` string for styling of the argument,
instead of using the styling applied to `Pa`.
* tmac/mdoc/doc-ditroff (doc-Mt-font):
* tmac/mdoc/doc-nroff (doc-Mt-font): Define new strings. Set
email addresses in italics by default.
* NEWS: Report change in font styling.
2024-01-28 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/an.tmac:

5
NEWS
View File

@ -143,6 +143,11 @@ o The an (man) and doc (mdoc) macro packages now use slightly different
rendering disabled (by default, it is enabled), the page footer now
sets 1 line higher than before.
o The doc (mdoc) macro package's `Mt` macro now sets its argument in
roman, not italics (or whatever the string `doc-Pa-font` was
configured to use). A new string, `doc-Mt-font`, for use in
"mdoc.local" files and similar, supports configuration of this face.
o The new macro file "koi8-r.tmac" supports the KOI8-R character
encoding, which supports the new Russian locale for groff.

View File

@ -6808,6 +6808,15 @@
.
.\" NS Mt user macro
.\" NS mailto (for conversion to HTML)
.\" NS
.\" NS modifies:
.\" NS doc-arg-ptr
.\" NS doc-curr-font
.\" NS doc-macro-name
.\" NS
.\" NS local variables:
.\" NS doc-lasttext-Mt
.\" NS doc-target-Mt
.
.eo
.de Mt
@ -6829,7 +6838,23 @@
. return
. \}
.
. Pa \$@
. \" The argument is the email address.
. nr doc-arg-ptr +1
. ds doc-target-Mt "\*[doc-arg\n[doc-arg-ptr]]
. nr doc-arg-ptr +1
.
. \" Format the link target.
. nr doc-curr-font \n[.f]
. nop \*[doc-Mt-font]\*[doc-target-Mt]\c
. nop \f[\n[doc-curr-font]]\c
.
. \" Format trailing arguments, like punctuation, if any.
. ie (\n[doc-arg-ptr] <= \n[doc-arg-count]) \
. doc-print-recursive
. el \{\
. nop \&
. doc-reset-args
. \}
..
.ec
.

View File

@ -68,6 +68,7 @@
.ds doc-Li-font \f[CR]
.ds doc-Lk-font \f[R]\"
.ds doc-Me-font \f[B]
.ds doc-Mt-font \f[R]
.ds doc-Nm-font \f[CB]
.ds doc-No-font \f[R]
.ds doc-Pa-font \f[I]

View File

@ -60,6 +60,7 @@
.ds doc-Li-font \f[B]
.ds doc-Lk-font \f[R]\"
.ds doc-Me-font \f[B]
.ds doc-Mt-font \f[R]
.ds doc-Nm-font \f[B]
.ds doc-No-font \f[R]
.ds doc-Pa-font \f[I]