diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-11-03 08:12:08 -0500 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-11-04 22:15:14 -0500 |
commit | ca03a7b32c4f103660e665a74e0ddf52519c7a16 (patch) | |
tree | f83d2df1659f55753f876e25ff395073c960eed1 /tmac/mdoc | |
parent | a11a0772e6395e6aa5886c79e3c53de728d6264a (diff) | |
download | groff-git-ca03a7b32c4f103660e665a74e0ddf52519c7a16.tar.gz |
[mdoc]: Use correct typefaces in page footers.
* tmac/mdoc/doc-common (doc-header, doc-footer): Revise for clarity and
to use correct typefaces for titles.
(doc-header): Add new strings to ease title construction. `doc-xref`
stores the fully formatted page topic and section number, e.g.,
"troff(1)"; `doc-abbv` stores the its potentially abbreviated form
when it is too long to fit.
(doc-footer): Use `doc-xref` as above. Stop setting the `Os` and `Dd`
parameters in an unusual font (probably unnoticed all these years
because the font used to render them was (Times) roman).
I'm not positive that mdoc's page topic abbreviation process works as
well as groff man(7)'s.
Diffstat (limited to 'tmac/mdoc')
-rw-r--r-- | tmac/mdoc/doc-common | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common index 9462c1e37..4cc3cf319 100644 --- a/tmac/mdoc/doc-common +++ b/tmac/mdoc/doc-common @@ -1011,6 +1011,8 @@ .\" NS print page header .\" NS .\" NS local variables: +.\" NS doc-xref +.\" NS doc-abbv .\" NS doc-reg-dh .\" NS doc-reg-dh1 .\" NS doc-hs-len @@ -1018,27 +1020,32 @@ . .eo .de doc-header +. ds doc-xref \*[doc-page-topic-font]\*[doc-page-topic]\f[]\" +. as doc-xref \*[doc-page-section-font](\*[doc-section])\f[]\" +. ds doc-abbv \*[doc-page-topic]\" . ev doc-env-dh . doc-setup-page-layout . ie \n[cR] .pl +1v . el .sp .5i -. nr doc-reg-dh \w'\*[doc-page-topic-font]\*[doc-pageref]\f[]' -. nr doc-reg-dh1 \w'\*[doc-page-section-font]\*[doc-volume]\f[]' +. nr doc-reg-dh \w'\*[doc-page-topic-font]\*[doc-xref]\f[]' +. nr doc-reg-dh1 \w'\*[doc-volume]' . if (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\ . while (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\ -. length doc-hs-len-prev \*[doc-pageref] -. substring doc-pageref 0 -2 -. length doc-hs-len \*[doc-pageref] -. nr doc-reg-dh \w'\*[doc-page-topic-font]\*[doc-pageref]\|.\|.\|.\f[]' +. ds doc-xref \*[doc-page-topic-font]\*[doc-abbv]\f[]\" +. as doc-xref \*[doc-page-section-font](\*[doc-section])\f[]\" +. length doc-abbv-len-prev \*[doc-abbv] +. substring doc-abbv 0 -2 +. length doc-abbv-len \*[doc-abbv] +. nr doc-reg-dh \w'\*[doc-page-topic-font]\*[doc-abbv]\|.\|.\|.\f[]' . \" If header string didn't actually get shorter, stop trying. -. if (\n[doc-hs-len-prev] <= \n[doc-hs-len]) \ +. if (\n[doc-abbv-len-prev] <= \n[doc-abbv-len]) \ . break . \} -. rr doc-hs-len -. rr doc-hs-len-prev -. as doc-pageref "\|.\|.\|. +. rr doc-abbv-len +. rr doc-abbv-len-prev +. as doc-abbv \|.\|.\|. . \} -. tl '\*[doc-page-topic-font]\*[doc-pageref]\f[]'\*[doc-page-section-font]\*[doc-volume]\f[]'\*[doc-page-topic-font]\*[doc-pageref]\f[]' +. tl '\*[doc-xref]'\*[doc-volume]\f[]'\*[doc-xref]' . ie \n[cR] \{\ . pl +1v . sp 1v @@ -1046,6 +1053,8 @@ . el .sp |1i . ev . ns +. rm doc-xref +. rm doc-abbv .. .ec . @@ -1060,25 +1069,31 @@ . .\" NS doc-footer macro .\" NS print page footer +.\" +.\" NS local variables: +.\" NS doc-xref . .eo .de doc-footer +. ds doc-xref \*[doc-page-topic-font]\*[doc-page-topic]\f[]\" +. as doc-xref \*[doc-page-section-font](\*[doc-section])\f[]\" . ev doc-caption-enviroment . doc-setup-page-layout . ie \n[D] \{\ . ie e \ -. tl '%'\*[doc-page-section-font]\*[doc-date-string]\f[]'\*[doc-page-topic-font]\*[doc-operating-system]\f[]' +. tl '%'\*[doc-date-string]'\*[doc-operating-system]' . el \ -. tl '\*[doc-page-topic-font]\*[doc-operating-system]\f[]'\*[doc-page-section-font]\*[doc-date-string]\f[]'%' +. tl '\*[doc-operating-system]'\*[doc-date-string]'%' . \} . el \{\ . ie \n[cR] \ -. tl '\*[doc-page-topic-font]\*[doc-operating-system]\f[]'\*[doc-page-section-font]\*[doc-date-string]\f[]'\*[doc-pageref]' +. tl '\*[doc-operating-system]'\*[doc-date-string]'\*[doc-xref]' . el \ -. tl '\*[doc-page-topic-font]\*[doc-operating-system]\f[]'\*[doc-page-section-font]\*[doc-date-string]\f[]'%' +. tl '\*[doc-operating-system]'\*[doc-date-string]'%' . \} . if !\n[cR] .bp . ev +. rm doc-xref .. .ec . |