bug-groff
[Top][All Lists]
Advanced

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

[bug #64231] [eqn] use italic face for lowercase Greek letters in nroff


From: G. Branden Robinson
Subject: [bug #64231] [eqn] use italic face for lowercase Greek letters in nroff mode
Date: Thu, 11 Jan 2024 00:40:24 -0500 (EST)

Follow-up Comment #2, bug#64231 (group groff):

Bug #64232 turned out to be invalid; what I wanted was already the case.

This matter was explored more deeply by Tadziu and me in a thread on the
_groff_ list.

https://lists.gnu.org/archive/html/groff/2024-01/msg00019.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00032.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00040.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00041.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00048.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00050.html

The most pertinent part for this ticket is likely the following.


...[N]othing in eqn documents its sensitivity to the font mounting
order when determining the typefaces to be used.  In fact that
sensitivity overrides explicit configuration!

Source:
$ cat ATTIC/to-slant-or-not-to-slant.roff
.\" "letter" means "slanted" in GNU eqn
.\" This is actually redundant with the default configuration.
.EQ
chartype "letter" \[*a]\[*b]\[*g]\[*d]\[*e]\[*z]
chartype "letter" \[*y]\[*h]\[*i]\[*k]\[*l]\[*m]
chartype "letter" \[*n]\[*c]\[*o]\[*p]\[*r]\[*s]
chartype "letter" \[*t]\[*u]\[*f]\[*x]\[*q]\[*w]
.EN
.fp 5 S
.fp 6 SS
\(*A\(*a \(-> upright lowercase alpha
.br
.EQ
sin ( 2 theta ) ~ = ~ 2 ~ sin theta cos theta
.EN
.sp
.fp 5 SS
.fp 6 S
\(*A\(*a \(-> slanted lowercase alpha
.br
.EQ
sin ( 2 theta ) ~ = ~ 2 ~ sin theta cos theta
.EN

Rendering:
[see attached image]

> Example:
> 
>   .fp 5 S
>   .fp 6 SS
>   \(*A\(*a --> upright lowercase alpha.
>   .fp 5 SS
>   .fp 6 S
>   \(*A\(*a --> slanted lowercase alpha.

This is fine, but it's raw *roff, not eqn input.  I am concerned with
eqn output, and nothing I propose would break your exhibit above.

At 2024-01-10T02:10:12+0100, Tadziu Hoffmann wrote:
> > I never knew this.  Where is the reference please?
> > I would like to mention this in my new EQN manual.
> 
> The Troff User's Manual (section 2, "Font and Character Size
> Control") says:
> 
>   The troff character set is defined by a description file
>   specific to each output device.  There are normally several
>   regular fonts and one or more special fonts.
> 
>   Troff begins execution by reading information for a set of
>   defaults fonts, said to be mounted; conventionally, the first
>   four are Times Roman (R), Times Italic (I), Times Bold (B),
>   and Times Bold Italic (BI), and the last is a Special font (S)
>   containing miscellaneous characters.  The set of fonts and
>   positions is determined by the device description file.
> 
>   It is not necessary to change to the Special font;
>   characters on that font are automatically handled as if
>   they were physically part of the current font.  The Special
>   font may actually be several fonts; the name S is reserved
>   and is generally used for one of these.  All special fonts
>   must be mounted after regular fonts.
> 
> However, it does not explicitly say that the special fonts
> are searched in mount-position order.  (I think it is a
> reasonable assumption, but I may be biased.)
> 
> The groff Info file (section 5.17.4, "Using Symbols") is more
> specific:
> 
>   Here are the exact rules how 'gtroff' searches a given symbol:
> 
>    [... current font and explicit declarations using
>      .char and .fspecial ...]
> 
>    * As a last resort, consult all fonts loaded up to now for
>      special fonts and check them, starting with the lowest
>      font number.  [...]
> 
> Since both S and SS contain lowercase Greek characters, placing
> SS before S will result in gtroff picking the slanted alpha for
> \(*a, whereas placing S before SS with pick the upright alpha.
> (Unless of course the current font also contains a \(*a character,
> in which case this will be used, or any other font declared
> as special and containing \(*a is mounted before S and SS.)

I don't propose to change any of this.  It seems to work well and can be
apprehended by users.

...

[3] This in turn means that the definitions of the eqn Greek-letter-name
    macros will _have_ to come out of the lexer and be put in
    eqn-device-specific startup logic--in eqnrc, say--so that the code
    can be appropriately conditionalized.  Only the "ps" device has
    (though, soon, "pdf" will have) a font called "SS" by default.

    So I envision something like this in eqnrc:

ifdef utf8 ! define Alpha \*(A !
ifdef utf8 ! define ALPHA \*(A !
ifdef utf8 ! define alpha \fI\*(a\fP !

ifdef ps|pdf ! define Alpha \*(A !
ifdef ps|pdf ! define ALPHA \*(A !
ifdef ps|pdf ! define alpha \f(SS\*(a\fP !

   ...and so on for the other 23 Greek letters.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64231>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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