Skip to content

single quotes in strings, example block

6 messages · Duncan Murdoch, Adrian Dusa, Marc Schwartz

#
Dear R-devel,

In the example block of the documentation for a package, I need to use
a single quote in a string:

    foo <- "Don't know"

After building the package, it gets printed as:

    foo <- "Dont know"


I read the "Writing R Extensions" and "Parsing Rd files" from top to
bottom, but didn't find any solution.

Using \verb{} doesn't help, as:
Tag \verb is invalid in a \examples block

Neither \sQuote doesn't help, as:
'\s' is an unrecognized escape in character string starting ""Don\s"

I found the only macros which are interpreted within text are \var and
\link ... therefore I am stuck.

Any hint to other documentation I might read?
Thank you,
Adrian
#
On 31/07/2014, 4:27 AM, Adrian Du?a wrote:
I don't see this.  Can you give more details, i.e. R version, how you
printed it, etc.?

It may be that you're not using an ascii single quote character, your
editor has slipped in something else.

Duncan Murdoch
#
On Thu, Jul 31, 2014 at 12:55 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
It must be related to my computer, then... it appears in the PDF file
created after the R CMD check.
It helps a lot, now that I know it is a possible MacOS matter, I will
re-post this in the R-SIG-MAC

Just in case, here are the details:
_
platform       x86_64-apple-darwin13.1.0
arch           x86_64
os             darwin13.1.0
system         x86_64, darwin13.1.0
status         RC
major          3
minor          1.1
year           2014
month          07
day            08
svn rev        66100
language       R
version.string R version 3.1.1 RC (2014-07-08 r66100)
nickname       Sock it to Me

Thank you,
Adrian
#
On 31/07/2014, 6:40 AM, Adrian Du?a wrote:
Okay, now I see it in the PDF output of R CMD Rd2pdf on  MacOS.

This is an Inconsolata font issue.  If you look at the .tex file
(available with "R CMD Rd2pdf --no-clean") you'll see the quote there,
but LaTeX doesn't display it.

I don't remember what the fix is...

Duncan
#
On Thu, Jul 31, 2014 at 2:01 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
The good news is that CRAN built packages display the correct
version... it's only a local (hence not critical) issue.

Best wishes,
Adrian
#
On Jul 31, 2014, at 4:55 AM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:

            
I may not have had enough coffee yet this morning, but might this be related to the use of Fancy/Smart quotes?

If so and you are using a text editor that supports them, you may have to disable them when working with this kind of output.

Alternatively, or perhaps in addition, take a look at ?options and adjust 'useFancyQuotes' as may be required. I frequently have to set it to FALSE when using Sweave.

Regards,

Marc Schwartz