bugGNU roff - Bugs: bug #61276, [mdoc] Ql macro in troff mode...

 
 

bug #61276: [mdoc] Ql macro in troff mode sometimes does not put text in single quotes

Submitter:  None
Submitted:  Mon 04 Oct 2021 11:27:28 AM UTC
   
 
Category:  Macro mdoc Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Rejected
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 30 Mar 2023 02:52:50 PM UTC, comment #6: 

We never heard back from the submitter and it's been over a year.

mdoc is working as documented, as Deri noted in comment #1, and multiple alternatives are available if document authors want more control over the output.

Possibly the issue is that the submitter is a consumer of mdoc pages and laments the appearance of troff mode output when a document uses `Ql`.

In that event I suggest editing the "mdoc.local" file to replace the `Ql` macro implementation with an alias to the desired macro's behavior.


$ git di
diff --git a/tmac/mdoc.local b/tmac/mdoc.local
index 94688aba0..6ffcea940 100644
--- a/tmac/mdoc.local
+++ b/tmac/mdoc.local
@@ -7,6 +7,8 @@
 .\" test remaps the font to roman ("R") on nroff (terminal) devices. You
 .\" might prefer to remap it to bold ("B") instead.
 .\" .if n .ftr CW R
+.rm Ql
+.als Ql Sq
 .\"
 .\" Local Variables:
 .\" mode: nroff


One could also write a `Ql` macro from scratch, as an advanced exercise.

N.B., mandoc(1) does not support this and might never.

Dropping "[PATCH]" annotation because I'm rejecting the patch.


G. Branden Robinson <gbranden>
Group administrator
Sun 31 Oct 2021 06:29:15 PM UTC, comment #5: 

I'm rather lucky, I don't need a costume to scare the kids!

Deri James <deri>
Group Member
Sun 31 Oct 2021 08:02:24 AM UTC, comment #4: 

comment #3:

> comment #2:
> > comment #1 by Dave.
>
> I'm glad my Deri James Halloween costume is so effective, but he and I aren't actually the same person.


Thanks for clearing the evidence of my brain fog, Dave.

My own mental lapses (q.v. bug #61314) are like asset price movements as described by Brad DeLong: "not normally distributed, no how, no way".

G. Branden Robinson <gbranden>
Group administrator
Sun 31 Oct 2021 07:04:24 AM UTC, comment #3: 

comment #2:

> comment #1 by Dave.


I'm glad my Deri James Halloween costume is so effective, but he and I aren't actually the same person.

Dave <barx>
Group Member
Thu 28 Oct 2021 05:33:33 AM UTC, comment #2: 

Putting in Need Info state because we need the submitter's feedback regarding comment #1 by Dave.

I propose that this ticket be closed in 30 days if we don't hear back.

(FWIW, I might support parallelizing nroff and troff mode treatment of .Ql arguments; I'm not all that thrilled with inline use of Courier roman by the mdoc package, and wouldn't mind seeing the back of it.  For now I'm on the fence, but the new MF string in man(7) might push me in my quest for rendering-option parity.)

G. Branden Robinson <gbranden>
Group administrator
Mon 25 Oct 2021 11:54:32 PM UTC, comment #1: 

The groff_mdoc man page says:-


.Ql

 The quoted literal macro behaves differently in troff and nroff mode. If formatted with nroff(,)
a quoted literal is always quoted. If formatted with troff, an item is only quoted if the width of
the item is less than three constant width characters. This is to make short strings more visible
where the font change to literal (constant width) is less noticeable.

The default width is 16n.


Which is what the example illustrates. If this is changed the documentation would need to change.

Deri James <deri>
Group Member
Mon 04 Oct 2021 11:27:28 AM UTC, original submission:  

A simple test case:

.Dd May 1, 2021
.Dt FOO 1
.Os
.Sh DESCRIPTION
.Ql f ,
.Ql fo ,
.Ql foo ,
.Ql foo bar

mandoc (1.14.5/6) renders it as:

 ‘f’, ‘fo’, ‘foo’, ‘foo bar’

groff-devel/1.22.4 nroff also renders it as:

 ‘f’, ‘fo’, ‘foo’, ‘foo bar’

but groff-ditroff/PDF renders it like:

  ‘f’, ‘fo’, foo, foo bar

I've attached a patch that simply deletes this code-path in mdoc/doc-ditroff, and the resultant output is as expected. I'm unsure if this is due to some limitation in groff, but as someone who uses switches between mandoc (for linting) and groff (for pretty pdfs), it can get slightly annoying (but only slightly ;)).

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #52019:  groff.patch added by None (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by deri (Posted a comment)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-30 gbranden StatusNeed Info Rejected
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Summary[PATCH] .Ql macro in troff-mode does not put text in single quotes [mdoc] Ql macro in troff mode sometimes does not put text in single quotes
    2021-10-31 barx Carbon-CopyRemoved 93119 -
    2021-10-28 gbranden StatusNone Need Info
    2021-10-04 barx Carbon-CopyRemoved 93119 -
    2021-10-04 barx Summary.Ql macro in troff-mode does not put text in single quotes [PATCH] .Ql macro in troff-mode does not put text in single quotes
    2021-10-04 None Attached File- Added groff.patch, #52019

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code