[R-pkg-devel] MathJax for Rd files

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Thu May 14 11:27:02 CEST 2020


On 14/05/2020 3:30 a.m., Georgi Boshnakov wrote:
> The issue is not with Rstudio per se but that in devtools' development mode  help() is modified to show the Rd files in the source directory, as one would expect, but doesn't load the RdMacros. So, the issue appears when one is development mode.

Yes, the error appears to be in the pkgload::load_rd_macros() function 
here: 
https://github.com/r-lib/pkgload/blob/1b1adc39628671f2ea4256f0bebcdb76e1f89f45/R/dev-help.r#L47.

It doesn't look at the DESCRIPTION file to see if there's an RdMacros entry.

Duncan Murdoch

> 
> Rdpack::viewRd() can be of some help but it currently loads only the RdMacro's from its package.
> 
> Georgi Boshnakov
> 
> -----Original Message-----
> From: R-package-devel <r-package-devel-bounces using r-project.org> On Behalf Of Viechtbauer, Wolfgang (SP)
> Sent: 13 May 2020 17:14
> To: Helmut Schütz <helmut.schuetz using bebac.at>; tiagoolivoto using gmail.com; r-package-devel using r-project.org
> Subject: Re: [R-pkg-devel] MathJax for Rd files
> 
> Thanks for the info! Can confirm now that I tried this (I don't usually use RStudio). That's an RStudio issue then. My guess is that 'Preview' uses tools::Rd2HTML() and that indeed won't automatically understand macros coming from mathjaxr (or any add-on package for that matter). This would be an issue to raise with the RStudio folks then.
> 
> But once a package is installed, the equations are nicely rendered also in the RStudio help browser, so that part works.
> 
> Best,
> Wolfgang
> 
>> -----Original Message-----
>> From: Helmut Schütz [mailto:helmut.schuetz using bebac.at]
>> Sent: Wednesday, 13 May, 2020 17:01
>> To: Viechtbauer, Wolfgang (SP); tiagoolivoto using gmail.com;
>> r-package-devel using r- project.org
>> Subject: Re: [R-pkg-devel] MathJax for Rd files
>>
>> Hi Wolfgang,
>>
>> Viechtbauer, Wolfgang (SP) wrote on 2020-05-13 16:53:
>>> Seems like you are using roxygen2. I have little experience with
>>> that, as
>> all my Rd files are 'handcrafted' (plus 100% organic and biodegradable).
>>
>> As are mine. ;-)
>> In the HTML-preview of RStudio the LaTeX is indeed not parsed. I get it
>> only (in the HTML man-page and the PDF) if I build the package.
>>
>> Helmut
>>
>> --
>> Ing. Helmut Schütz
>> BEBAC – Consultancy Services for
>> Bioequivalence and Bioavailability Studies Neubaugasse 36/11
>> 1070 Vienna, Austria
>> E helmut.schuetz using bebac.at
>> W https://bebac.at/
>> F https://forum.bebac.at/
> ______________________________________________
> R-package-devel using r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>



More information about the R-package-devel mailing list