bugGNU roff - Bugs: bug #64231, [eqn] use italic face for...

 
 

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

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Mon 22 May 2023 04:33:44 AM UTC
   
 
Category:  Preprocessor eqn Severity:  1 - Wish
Item Group:  Feature change Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 11 Jan 2024 05:40:24 AM UTC, comment #2: 

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.


G. Branden Robinson <gbranden>
Group administrator
Mon 22 May 2023 04:54:44 AM UTC, comment #1: 

This is dependent on bug #64232.

Once that's done, this is straightforward:

Assign lowercase Greek letters (spelled out, as is eqn's practice) the spacing type "letter" instead of "ordinary".

G. Branden Robinson <gbranden>
Group administrator
Mon 22 May 2023 04:33:44 AM UTC, original submission:  

The dvi, html, pdf, and ps output drivers all set Greek lowercase Greek letters in italics.

We should do the same for nroff mode, given the known equation context.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-11 gbranden DependenciesRemoved dependency to bugs #64232 -
    2023-08-10 gbranden StatusPostponed None
        Dependencies- Depends on bugs #64232
    2023-05-22 gbranden StatusNone Postponed

    Back to the top

    Powered by Savane 3.14-8eb0.
    Corresponding source code