Skip to content
Prev 206409 / 398503 Next

HTML translation problem in R-2.10.1

On 01/15/2010 12:13 AM, Duncan Murdoch wrote:
Thanks for the tip. You're talking my language now.

The problem is indeed with the \samp{} markup tag, as this is translated 
to define a <span> class "samp" that is supposed to change the font to 
"monospace" between the tags (it doesn't). I tried changing this to 
defining a style (not recommended, but...) and that didn't work, either. 
Fooled around with the R.css file, explicitly defining fontfamily as 
"Courier" doesn't work. None of the other classes defined as a font 
change to "monospace" work. <span> itself doesn't appear consider any 
text within it as literal, as manually entering the link within the 
<span> tags in the HTML page creates a valid link. As far as I can 
determine, the writeLink function doesn't get called for links within a 
\samp{} as there are no error messages but the link doesn't get written 
to the HTML file. My suspicion at the moment is that by the time the 
action reaches line 227 in Rd2HTML, the "\link" string is no longer 
there to recognize.

I can fix the problem by reverting to using \code{} _except_ where that 
markup includes a link. This gives the font change, but of course prints 
everything within the resulting <pre> tags literally. However, that 
produces an HTML page that looks okay and has the requested links. I 
suspect that this will not be a welcome fix, as I can still recall 
changing all the \code{} to \samp{} in my Rd files.

I wouldn't mind an opinion on a preferred direction before trying to 
find where the processing of \samp{} is going wrong.

Jim