groff
[Top][All Lists]
Advanced

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

Re: Re: Changing header/footer font in mm


From: Jan Eden
Subject: Re: Re: Changing header/footer font in mm
Date: Fri, 19 Apr 2024 04:13:11 +0200

Hi Branden,

On 2024-04-18 14:47, G. Branden Robinson wrote:

> Hi Jan,
> 
> At 2024-04-18T07:11:44+0200, Jan Eden wrote:
> > there is probably a really simple solution to this,
> 
> Not exactly.  At the time the mm(7) macro package was developed by the
> Unix Support Group (possibly an anachronistic name selection on my
> part), the notion of a "font family" was not represented in the *roff
> language.
> 
> > but I cannot find it in the docs. When selecting a default font in a
> > mm document like this –
> > 
> > .nr N 1
> > .fam H
> > .
> > .TL
> > Title
> > .AU "Author"
> > .MT 4
> > .
> > .H 1 "First Heading"
> > .P
> > Some text.
> > 
> > – all text is set in Helvetica, except for the header/footer (Times
> > New Roman). Why is that,
> 
> As Damian indicated, it is because headers and footers ("titles") use a
> dedicated "environment", a *roff term for a bundle of typesetting
> parameters and state that usually only macro package authors mess with.
> When you create an environment in *roff, it copies its parameters not
> from the current environment's configuration, but from the _formatter's
> default state_.  That means you get the Times family and roman style by
> default.  You can change these, but you have to remember to do so.
> 
> GNU troff also supports an `evc` request for copying environments.
> 
> > and how can I change the header/footer font to match the rest of the
> > document?
> 
> This looks hard to do portably.  Even if you left out all groff language
> extensions, there is the problem of font repertoire varying by output
> device, and AT&T troff imposing little structure on the names of
> available fonts.  (Granted, it probably took the de facto
> standardization of PostScript to bring make such an objective feasible.)
> 
> But if you don't care about rendering your mm document with DWB 3.3
> troff, here are a few approaches.
> 
> 1.  If the _layout_ of the headers and footers is fine, and you desire
>     only to change the font they use, that is easily done with the mm
>     macros `PH` and `PF`.  For example:
> 
> .PH "'\F[P]Smith'page %'April 2024'"
> .PF "'\F[P]draft'\n[year]-\n[mo]-\n[dy]'groff \n[.x].\n[.y].\n[.Y]'"
> .H 1 Introduction
> Sed ut perspiciatis, unde omnis iste natus error sit voluptatem
> accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab
> illo inventore veritatis et quasi architecto beatae vitae dicta sunt,
> explicabo.
> 
> In the foregoing, I lazily neglected resetting the family back to its
> previous value (with `\F[]`) because in this context it simply isn't
> necessary.

Thank you – this is what I had expected as a last resort if my
assumption of a simple solution had proven false.

But Thomas' earlier suggestion to just move the font family to the first
position (.fp 1 HR) is what I was looking for, even though the solution
might not be portable and the behavior of fp with respect to the
different environments is "odd", according to Damian.

In any case, I am very grateful for the detailed explanation (extending
to headers/footers for recto/verso pages) which will come in handy when
a more complex configuration is needed.

- Jan

Attachment: signature.asc
Description: PGP signature


reply via email to

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