From romain at r-enthusiasts.com  Fri Apr  2 13:13:18 2010
From: romain at r-enthusiasts.com (Romain Francois)
Date: Fri, 02 Apr 2010 13:13:18 +0200
Subject: [Rd] inject html code into Rd file
In-Reply-To: <4BB5CFD7.9000702@stats.uwo.ca>
References: <4BB5C439.9090505@r-enthusiasts.com>
	<4BB5CFD7.9000702@stats.uwo.ca>
Message-ID: <4BB5D14E.2070102@r-enthusiasts.com>

Le 02/04/10 13:07, Duncan Murdoch a ?crit :
> 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

yes, I saw that in WRE, I should have been more specific.


what if instead of a trivial string like "<b>hello</b>" the text is to 
be computed by some function. For example:

print( xtable( iris), type = "html" )

Romain

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/OIXN : raster images and RImageJ
|- http://tr.im/OcQe : Rcpp 0.7.7
`- http://tr.im/O1wO : highlight 0.1-5



[Rd] inject html code into Rd file
Romain Francois