Re: [Rd] \dQuote{} in \code{} not processed

From: Prof Brian Ripley <>
Date: Thu 01 Dec 2005 - 07:14:35 GMT

On Wed, 30 Nov 2005, Gavin Simpson wrote:

> Just wondering if this is the expected behaviour.

Yes. The only command processed inside \code is \link (plus support for \example and \usage which go through the same processing).

> I was wanting to produce quoted text within \code{}, without manually
> entering the '"'. \dQuote{} seems advisable after reading the Writing R
> Extensions manual, so I tried \code{\dQuote{mytext}} expecting it to
> produce "mytext" in monospace font (with ' ' round it in the R help
> files) but it appears that \dQuote{mytext} is not processed within \code
> {} as \dQuote{mytext} is printed literally in the produced
> documentation.
> Is this intended? I didn't see any statements suggesting \code{} could
> not include other markup, and \code{\link{}} works...

Hmm, \dQuote is described in a section called

         Marking text

   The following logical markup commands are available for emphasizing or    quoting text.

and \code is described as

   Indicate text that is a literal example of a piece of a program, e.g., a    fragment of @R{} code or the name of an @R{} object, using    @code{typewriter} font if possible.

Is `literal example' not warning enough? I'll add an explicit statement, but this is the first time I have seen any indication that anyone thought otherwise.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Thu Dec 01 18:19:26 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:34 GMT