From marc_schwartz at me.com  Thu Jul 31 13:23:00 2014
From: marc_schwartz at me.com (Marc Schwartz)
Date: Thu, 31 Jul 2014 06:23:00 -0500
Subject: [Rd] single quotes in strings, example block
In-Reply-To: <53DA1293.6020506@gmail.com>
References: <CAJ=0CtB9Wmkf+38CdAsgn3xFeD6Do8yPNCDup6s7jnXrJ73Rcg@mail.gmail.com>
	<53DA1293.6020506@gmail.com>
Message-ID: <0AB136BA-3590-499D-8F73-BC66CF447025@me.com>


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

> On 31/07/2014, 4:27 AM, Adrian Du?a wrote:
>> 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 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
> 
>> 
>> 
>> 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
>> 


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



[Rd] single quotes in strings, example block
Marc Schwartz