Menu

#1022 man: escape.apostrophe wrongly escapes quotation marks

output: manpages
closed-fixed
XSL (1066)
5
2010-09-29
2008-12-09
No

By escaping an apostrophe (single quotation mark) you create a right sngle quotation mark `, not an apostrophe '. IMO the only way to correctly replace an apostrophe (a plain ' also prints as a right single quotation mark accordingly to groff_char(7)) is to replace it with

\[aq]

The patch is attached.

The issue has been sbumitted to the Debian BTS:
http://bugs.debian.org/507673

Discussion

  • Daniel Leidert

    Daniel Leidert - 2008-12-09

    proposed patch

     
  • Michael(tm) Smith

    Do you know if this works as expected with AT&T troff (on Solaris or whatever)?

     
  • Michael(tm) Smith

    • assigned_to: nobody --> xmldoc
     
  • Michael(tm) Smith

    I just tested on a Solaris box, and \[aq] does not produce an apostrophe with the troff there. I think the two-letter bracketed escape syntax maybe doesn't work at all with AT&T troff or its non-groff descendants.

    So \[aq] is not a portable solution. There must be some way that's been used forever, since troff began, to represent an apostrophe -- some way other than \[aq]

     
  • Michael(tm) Smith

    Note that \(aq does not work as expected on Solaris either (it prints nothing).

    I also note that groff_char(7) does not say that \[aq] is an apostrophe -- it says it is a "quote single - apostrophe quote". But I guess that actually does mean a straight single apostrophe -- decimal 39. That is what we actually want, right?

    Anyway, I can't see that the groff docs provide any information on how to generate that in a portable way.

    Any ideas?

     
  • Daniel Leidert

    Daniel Leidert - 2009-02-09

    No idea sorry. But if you take a look at the source of groff_char I find:

    .\" groff
    .if \n(.g

    .\" non-groff
    .if !\n(.g

    Is this some kind of switch one can use? If yes, maybe this can be useful too for the other TROFF vs. GROFF issues/differences you were working on.

     
  • Daniel Leidert

    Daniel Leidert - 2009-02-09

    Seems so:

    `\n[.g]'
    Always 1. Macros should use this to determine whether they are
    running under GNU `troff'.

     
  • Michael(tm) Smith

    I e-mailed the groff list to try to get some help with this. As far as I can see, \(aq should work as expected with the troff on OpenSolaris/SunOS. But it doesn't actually seem to.

    Even if there is some alternative way that I can use to represent apostrophe on non-groff systems, the \n(.g conditional request thing is not going to help -- because I would need to do the condtional switching inline. That's one of the biggest deficiences in groff -- it has caused me problems in the past as well.

     
  • Anders Kaseorg

    Anders Kaseorg - 2009-07-09

    According to <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458157>:

    “With groff, what you want is \(aq. Unfortunately, that's groff-specific
    and won't work with, for example, Solaris man.

    Pod::Man adds:

    .ie \n(.g .ds Aq \(aq
    .el .ds Aq '

    to the preamble of the man page and then uses \*(Aq as the escape for
    apostrophes in the man page.”

    Is this a sufficiently portable solution? I’ve tested it on GNU and Solaris.

     
  • Mauritz Jeanson

    Mauritz Jeanson - 2010-08-14

    A fix for this issue has been added to the current codebase.
    Please test the fix with the latest snapshot from:

    http://docbook.sourceforge.net/snapshots/

     
  • Mauritz Jeanson

    Mauritz Jeanson - 2010-08-14

    Thanks for the patch.

     
  • Mauritz Jeanson

    Mauritz Jeanson - 2010-08-14
    • status: open --> pending-fixed
     
  • SourceForge Robot

    • status: pending-fixed --> closed-fixed
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
MongoDB Logo MongoDB