bugGNU roff - Bugs: bug #64216, [eqn]...

 
 

bug #64216: [eqn] "{thick,thin}_space" parameters affect full- and half-width spaces ~ and ^

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Fri 19 May 2023 12:24:13 AM UTC
   
 
Category:  Preprocessor eqn Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 10 Jul 2023 08:35:01 AM UTC, comment #5: 


commit b545d4f6f53ab71abf2ffd600a6980c6a581fe78
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri May 19 00:52:28 2023 -0500

    [eqn]: Fix Savannah #64216.

    [eqn]: Implement tunable "half_space" and "full_space" parameters.  They
    default to the same widths as "thin_space" and "thick_space",
    respectively, but control the widths of the '^' and '~' input tokens.

    * src/preproc/eqn/box.cpp: Add globals `half_space`, `full_space`.

      (struct S): Recognize "half_space" and "full_space" as parameters to
      the "set" primitive, and map them to the globals.

      (half_space_box::output): Format the half space width.

      (full_space_box::output): Format the full space width.

      (full_space_box::output, thick_space_box::output): Drop workaround for
      Firefox 1.5 MathML bug (November 2005).  Emit "&ThickSpace;" entity
      instead of "&ensp;".

    * src/preproc/eqn/eqn.1.man (Customization): Document feature.

    * NEWS: Add item.

    Fixes <https://savannah.gnu.org/bugs/?64216>.  Thanks to Doug McIlroy
    for the report and Damian McGuckin for the discussion.


G. Branden Robinson <gbranden>
Group administrator
Mon 22 May 2023 07:54:11 AM UTC, comment #4: 
G. Branden Robinson <gbranden>
Group administrator
Sat 20 May 2023 12:11:35 AM UTC, comment #3: 

Doug followed up to the bug-groff mailing list.

> 1. Tell what the default settings for each character type are.


Yes.  That's necessary even if we eventually get bug #62692 fixed.

> 2. Cite Texbook for historical background, but not as a source for
> further information. Groff documentation should be complete in itself.


Agreed.  We're getting closer to this.  At the moment I can identify only our eqn(1) and pic(1) man pages as lacking this property.  (refer(1) seems to be complete, but could sorely use a tutorial paper.)

G. Branden Robinson <gbranden>
Group administrator
Fri 19 May 2023 06:34:46 AM UTC, comment #2: 

Oh, and here's the source for the demo (attached).

(file #54764)

G. Branden Robinson <gbranden>
Group administrator
Fri 19 May 2023 06:33:24 AM UTC, comment #1: 

I have something that seems to work.

See attachment for a demonstration.


commit 0de158139482d7a93b1884a6c4212aaa9234b4de
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu May 18 23:48:40 2023 -0500

    [eqn]: Trivially refactor.

    Rename "space_box" class to "full_space_box" for clarity and to prepare
    for adding distinct thin and thick space box classes.

    * src/preproc/eqn/box.cpp (space_box::space_box, space_box::output,
      space_box::debug_print):
    * src/preproc/eqn/box.h (class space_box): Rename these...

    * src/preproc/eqn/box.cpp (full_space_box::full_space_box,
      full_space_box::output, full_space_box::debug_print):
    * src/preproc/eqn/box.h (class full_space_box): ...to these.

    * src/preproc/eqn/eqn.ypp (simple): Construct item using new type name.

    Also update editor aid comments; drop old style Emacs file-local
    variable setting.

commit d182d7b719f714a162a63d9844077b7baf44cbd5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri May 19 00:20:15 2023 -0500

    src/preproc/eqn/box.cpp: Trivially refactor.

    Relocate code to put class member functions in lexicographic order, to
    prepare for addition of two more classes.

commit ed3204001640fe499f6c2427da7311f60da42913
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri May 19 00:27:34 2023 -0500

    [eqn]: Add `thick_space` and `thin_space` classes.

    * src/preproc/eqn/box.cpp:
    * src/preproc/eqn/box.h: Do it.

    At present they are copy-and-paste jobs of `half_space` and
    `full_space`.  But watch this space...

commit aaa908f78be53ca69e0fa3502bfee7d23f5436a2
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri May 19 00:52:28 2023 -0500

    [eqn]: Fix Savannah #64216.

    [eqn]: Implement tunable "half_space" and "full_space" parameters.  They
    default to the same widths as "thin_space" and "thick_space",
    respectively, but control the widths of the '^' and '~' input tokens.

    * src/preproc/eqn/box.cpp: Add globals `half_space`, `full_space`.

      (struct S): Recognize "half_space" and "full_space" as parameters to
      the "set" primitive, and map them to the globals.

      (half_space_box::output): Format the half space width.

      (full_space_box::output): Format the full space width.

      (full_space_box::output, thick_space_box::output): Drop workaround for
      Firefox 1.5 MathML bug (November 2005).  Emit "&ThickSpace;" entity
      instead of "&ensp;".

    * src/preproc/eqn/eqn.1.man (Customization): Document feature.

    * NEWS: Add item.

    Fixes <https://savannah.gnu.org/bugs/?64216>.  Thanks to Doug McIlroy
    for the report and Damian McGuckin for the discussion.


(file #54763)

G. Branden Robinson <gbranden>
Group administrator
Fri 19 May 2023 12:24:13 AM UTC, original submission:  

Doug McIlroy reported to the mailing list:

> man eqn says
>          set thin_space n
> causes n/100 em space to be "automatically inserted after punctuation
> characters", which are vaguely defined as "characters such as ',' "
>
> I used thin_space 0 to take away automatic space after . in formulas.
> To my surprise it also took away intentional spaces represented by ^.
>
> The loss of ^ threw away a lot of carefully crafted spaces, and even
> threw away spaces in some sporadic cases where I wanted to override
> thin_space 0.
>
> Another parameter, thick_space, has the same effect on ~.
>
> Apparently thin_space serves double duty--to control automatic spacing
> and to set the width of ^.
>
> This coupling of function strikes me as a bug. One thinks of ^ and ~
> as groff keywords, not characters. And even if they are characters,
> they represent white space placed deliberately, not "automatically
> inserted".


Doug's assessment makes sense to Damian McGuckin and to me (see follow-ups on the list).

Perhaps add new "full_width_space" and "half_width_space" parameters.

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:
   

Attached Files
file #54764:  eqn-tunable-space-demo.groff added by gbranden (972B - application/octet-stream)
file #54763:  eqn-tunable-space-demo.ps added by gbranden (9KiB - application/postscript)

 

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

    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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-07-10 gbranden StatusReady for Merge Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2023-05-22 gbranden StatusIn Progress Ready for Merge
    2023-05-19 gbranden Attached File- Added eqn-tunable-space-demo.groff, #54764
    2023-05-19 gbranden Attached File- Added eqn-tunable-space-demo.ps, #54763
    2023-05-19 gbranden StatusNone In Progress
        Assigned toNone gbranden
    2023-05-19 gbranden Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code