bugGNU roff - Bugs: bug #63116, [eqn] sup and sub render...

 
 

bug #63116: [eqn] sup and sub render adversarially in nroff mode

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 27 Sep 2022 07:32:17 PM UTC
   
 
Category:  Preprocessor eqn Severity:  3 - Normal
Item Group:  Rendering/Cosmetics Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 27 Sep 2022 07:32:17 PM UTC, original submission:  

Initially reported on 12 June as Debian bug #1012709.

Consider the following, adapted from a BSD cksum(1) man page page in mdoc(7).


$ cat EXPERIMENTS/crc-polynomial.ms
.EQ
delim %%
.EN
.LP
The CRC polynomial is
% x sup 32 + x sup 26 + x sup 23 + x sup 22 + x sup 16 + x sup 12 + x sup 11 + x sup 10 + x sup 8 + x sup 7 + x sup 5 + x sup 4 + x sup 2 + x + 1 %.
$ groff -T utf8 -b -ww -e -ms EXPERIMENTS/crc-polynomial.ms | cat -s

The              CRC              polynomial              is
x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1.


The reporter, наб, rightly observes that this is all but unintelligible except to those already pretty familiar with CRC polynomials.

It is true that we don't advertise much capability for our terminal-mode eqn(1) output.

At the same time, mandoc(1) can do better, it seems.

So could we.

We could define alternative primitives for "sup" and "sub" in nroff mode that unambiguously distinguish the super- and subscripts.

Here's a proposal.  It doesn't work as-is because the grammar of eqn primitives and macro calls differ.  But it should get the idea across.


.EQ
ndefine sub ' roman { _< } $1 roman > '
ndefine sup ' roman { "^(" } $1 roman ) '
delim $$
.EN
.LP
$ roman H sub 2 roman O $
.LP
$ x sup 2 $


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)
  • -email is unavailable- added by gbranden (original reporter)
  •  

    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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-27 gbranden Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code