roxygen2 & markdown & math

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

roxygen2 & markdown & math

Sigbert Klinke
Hi,

I like to make my package documentation with markdown which is supported
since roxygen2 6.0.0 . I used a math expression like $t_n \appox N(0,1)$
which leads in the package check to "unknown macro '\approx'".

I guess I get the warning because math is not supported in markdown. Are
there any plans to support something like $...$ or $$...$$? Or there are
general problems?

Best Sigbert

--
https://hu.berlin/sk
https://hu.berlin/mmstat
https://hu.berlin/mmstat-int
https://hu.berlin/mmstat-ar

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: roxygen2 & markdown & math

Viechtbauer, Wolfgang (SP)
Dear Sigbert,

The mathjaxr package provides this:

https://cran.r-project.org/package=mathjaxr
https://github.com/wviechtb/mathjaxr

Best,
Wolfgang

>-----Original Message-----
>From: R-help [mailto:[hidden email]] On Behalf Of Sigbert
>Klinke
>Sent: Tuesday, 12 January, 2021 9:14
>To: [hidden email]
>Subject: [R] roxygen2 & markdown & math
>
>Hi,
>
>I like to make my package documentation with markdown which is supported
>since roxygen2 6.0.0 . I used a math expression like $t_n \appox N(0,1)$
>which leads in the package check to "unknown macro '\approx'".
>
>I guess I get the warning because math is not supported in markdown. Are
>there any plans to support something like $...$ or $$...$$? Or there are
>general problems?
>
>Best Sigbert
>
>--
>https://hu.berlin/sk
>https://hu.berlin/mmstat
>https://hu.berlin/mmstat-int
>https://hu.berlin/mmstat-ar

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: roxygen2 & markdown & math

Sigbert Klinke
Hi,

thanks a lot, but maybe I was to vague.

I do not want to replace \eqn{...} and \deqn{...} by \mjseqn{...} and
\mjsdeqn{...}. I would like to use $...$ and $$...$$ as in Rmarkdown to
get something better readable.

Best Sigbert

Am 12.01.21 um 10:41 schrieb Viechtbauer, Wolfgang (SP):

> Dear Sigbert,
>
> The mathjaxr package provides this:
>
> https://cran.r-project.org/package=mathjaxr
> https://github.com/wviechtb/mathjaxr
>
> Best,
> Wolfgang
>
>> -----Original Message-----
>> From: R-help [mailto:[hidden email]] On Behalf Of Sigbert
>> Klinke
>> Sent: Tuesday, 12 January, 2021 9:14
>> To: [hidden email]
>> Subject: [R] roxygen2 & markdown & math
>>
>> Hi,
>>
>> I like to make my package documentation with markdown which is supported
>> since roxygen2 6.0.0 . I used a math expression like $t_n \appox N(0,1)$
>> which leads in the package check to "unknown macro '\approx'".
>>
>> I guess I get the warning because math is not supported in markdown. Are
>> there any plans to support something like $...$ or $$...$$? Or there are
>> general problems?
>>
>> Best Sigbert
>>
>> --
>> https://hu.berlin/sk
>> https://hu.berlin/mmstat
>> https://hu.berlin/mmstat-int
>> https://hu.berlin/mmstat-ar


--
https://hu.berlin/sk
https://hu.berlin/mmstat
https://hu.berlin/mmstat-int
https://hu.berlin/mmstat-ar

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: roxygen2 & markdown & math

Jeff Newmiller
a) This discussion is on the wrong mailing list. Please go to R-package-devel if you want to continue this discussion.

b) You can do whatever you want in your vignettes, but R doc files are designed to work with multiple output devices, including text-only terminals, so syntax specific to certain environments is not allowed. If you want to contribute improvements to R doc capabilities, I am sure patches will be considered as long as you adhere to the existing multi-platform constraints.

On January 12, 2021 10:12:51 AM PST, Sigbert Klinke <[hidden email]> wrote:

>Hi,
>
>thanks a lot, but maybe I was to vague.
>
>I do not want to replace \eqn{...} and \deqn{...} by \mjseqn{...} and
>\mjsdeqn{...}. I would like to use $...$ and $$...$$ as in Rmarkdown to
>
>get something better readable.
>
>Best Sigbert
>
>Am 12.01.21 um 10:41 schrieb Viechtbauer, Wolfgang (SP):
>> Dear Sigbert,
>>
>> The mathjaxr package provides this:
>>
>> https://cran.r-project.org/package=mathjaxr
>> https://github.com/wviechtb/mathjaxr
>>
>> Best,
>> Wolfgang
>>
>>> -----Original Message-----
>>> From: R-help [mailto:[hidden email]] On Behalf Of
>Sigbert
>>> Klinke
>>> Sent: Tuesday, 12 January, 2021 9:14
>>> To: [hidden email]
>>> Subject: [R] roxygen2 & markdown & math
>>>
>>> Hi,
>>>
>>> I like to make my package documentation with markdown which is
>supported
>>> since roxygen2 6.0.0 . I used a math expression like $t_n \appox
>N(0,1)$
>>> which leads in the package check to "unknown macro '\approx'".
>>>
>>> I guess I get the warning because math is not supported in markdown.
>Are
>>> there any plans to support something like $...$ or $$...$$? Or there
>are
>>> general problems?
>>>
>>> Best Sigbert
>>>
>>> --
>>> https://hu.berlin/sk
>>> https://hu.berlin/mmstat
>>> https://hu.berlin/mmstat-int
>>> https://hu.berlin/mmstat-ar

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: roxygen2 & markdown & math

Duncan Murdoch-2
In reply to this post by Sigbert Klinke
On 12/01/2021 1:12 p.m., Sigbert Klinke wrote:
> Hi,
>
> thanks a lot, but maybe I was to vague.
>
> I do not want to replace \eqn{...} and \deqn{...} by \mjseqn{...} and
> \mjsdeqn{...}. I would like to use $...$ and $$...$$ as in Rmarkdown to
> get something better readable.

I think that's a question/suggestion that would have to go to the
roxygen2 team.  They're the ones who convert Markdown into the Rd input
format.  Presumably they could convert $...$ into the appropriate macro
using Mathjax or not, but I have no idea how difficult that would be.

Duncan Murdoch

>
> Best Sigbert
>
> Am 12.01.21 um 10:41 schrieb Viechtbauer, Wolfgang (SP):
>> Dear Sigbert,
>>
>> The mathjaxr package provides this:
>>
>> https://cran.r-project.org/package=mathjaxr
>> https://github.com/wviechtb/mathjaxr
>>
>> Best,
>> Wolfgang
>>
>>> -----Original Message-----
>>> From: R-help [mailto:[hidden email]] On Behalf Of Sigbert
>>> Klinke
>>> Sent: Tuesday, 12 January, 2021 9:14
>>> To: [hidden email]
>>> Subject: [R] roxygen2 & markdown & math
>>>
>>> Hi,
>>>
>>> I like to make my package documentation with markdown which is supported
>>> since roxygen2 6.0.0 . I used a math expression like $t_n \appox N(0,1)$
>>> which leads in the package check to "unknown macro '\approx'".
>>>
>>> I guess I get the warning because math is not supported in markdown. Are
>>> there any plans to support something like $...$ or $$...$$? Or there are
>>> general problems?
>>>
>>> Best Sigbert
>>>
>>> --
>>> https://hu.berlin/sk
>>> https://hu.berlin/mmstat
>>> https://hu.berlin/mmstat-int
>>> https://hu.berlin/mmstat-ar
>
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: roxygen2 & markdown & math

hadley wickham
On Tuesday, January 12, 2021, Duncan Murdoch <[hidden email]>
wrote:

> On 12/01/2021 1:12 p.m., Sigbert Klinke wrote:
>
>> Hi,
>>
>> thanks a lot, but maybe I was to vague.
>>
>> I do not want to replace \eqn{...} and \deqn{...} by \mjseqn{...} and
>> \mjsdeqn{...}. I would like to use $...$ and $$...$$ as in Rmarkdown to
>> get something better readable.
>>
>
> I think that's a question/suggestion that would have to go to the roxygen2
> team.  They're the ones who convert Markdown into the Rd input format.
> Presumably they could convert $...$ into the appropriate macro using
> Mathjax or not, but I have no idea how difficult that would be.
>

If I remember correctly, I think it would be relatively hard since roxygen2
uses commonmark, which doesn’t include math in its parse tree. It might be
possible to hack something together with regular expressions, but of course
that brings with it the risk of introducing new edge cases that don’t
behave as expected.

Hadley


--
http://hadley.nz

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.