From ripley at stats.ox.ac.uk  Thu Dec  1 08:14:35 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 1 Dec 2005 07:14:35 +0000 (GMT)
Subject: [Rd] \dQuote{} in \code{} not processed
In-Reply-To: <1133368877.9803.63.camel@gsimpson.geog.ucl.ac.uk>
References: <1133368877.9803.63.camel@gsimpson.geog.ucl.ac.uk>
Message-ID: <Pine.LNX.4.61.0512010703540.17563@gannet.stats>

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,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] \dQuote{} in \code{} not processed
Prof Brian Ripley