From murdoch at stats.uwo.ca  Fri Apr  2 13:07:03 2010
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Fri, 02 Apr 2010 07:07:03 -0400
Subject: [Rd] inject html code into Rd file
In-Reply-To: <4BB5C439.9090505@r-enthusiasts.com>
References: <4BB5C439.9090505@r-enthusiasts.com>
Message-ID: <4BB5CFD7.9000702@stats.uwo.ca>

On 02/04/2010 6:17 AM, Romain Francois wrote:
> Hello,
> 
> I'm trying to inject html code into an Rd file. For example :
> 
> \name{test}
> \alias{test}
> \title{test}
> \description{
> \if{html}{
> \Sexpr[stage=render,results=text,echo=FALSE]{
> 	"<b>hello</b>"
> }
> }
> }
> 
> when this file is rendered, instead of having "hello" in bold, I get 
> <b>hello</b>, i.e. characters < and > are replaced with html entities : 
> &lt; and &gt;
> 
> Is there a way to turn this off ?

Yes, if you wrap it in \out{}.  The example in the manual is

\if{latex}{\out{\alpha}}\ifelse{html}{\out{&alpha;}}{alpha}

Duncan Murdoch



[Rd] inject html code into Rd file
Duncan Murdoch