Did you know ... | Search Documentation: |
Pack mathml -- rj/1-review-3.txt |
This article presents a recent package for typesetting equations differently than the usual way offered by markup syntax in Markdown. Its main advantage is that it allows typesetting some mathematical R code directly. Usually, with R Markdown, it builds on Pandoc support for Math and requires writing Math syntax directly, not converting R code to Math directly. This is new and interesting for documents heavily relying on math expressions for the code and the typeset content. The article is rather technical, which can make it quite scoped to interested readers, but not to any R Journal readers. It explains the technical implementation and then demos the usage through simple examples and a long case study. It is unfortunate that code can't be reproduced directly from the paper examples without accessing the companion R file. Overall, despite being highly technical in its form, I believe the usage and advantage are clear. Readers will know if they could be interested in becoming users too. Especially for PDF publication.
Response: In the revision, it is now made explicit that the package needs either SWI-Prolog installed on the system or R package rswipl.
Response: In the revision, the technical implementation has been moved to the suggested place.
Response: Thank you for pointing this out, this has been corrected in the revised manuscript.
Response: This has been corrected in the revised manuscript.
> We can include the output in a RMarkdown document by specifying results = "asis" in the R code chunk of RMarkdown, as is done in all examples below. It is not really shown how, without probably looking at the article code source. It is assumed that the reader is a knowledgeable rmarkdown or knitr user. This can be made more clear if this is indeed the case.
Response: It is now made clear that the target audience has some basic knowledge of rmarkdown and knitr. Moreover, a code snippet with a R code chunk is presented in the introduction.
> The R function mathout() has been defined in the preamble of this article; it wraps a call to mathml() for HTML output and mathjax() for LaTeX output. Same here. The function `mathout()` is mentioned but not shown. We have to open the R source file to understand. This also assumes some form of expertise from the readers. This could be made more clear or point to more resources to help non-knowledgeable users understand. Overall, is it really worth adding those details without an example? This adds to the already-existing technical complexity. A reader could try reproducing the code by copying and pasting, but it won't work. (And I did try it.)
Response: mathout()
has been added to the list of functions of the package, so
that copy-pasting the examples now works.
Response: It is actually sufficient to have R package rswipl installed or SWI-Prolog on the system. To our knowledge, it is not possible to give alternative system requirements in a package. However, we improved the error message from R package rolog to explicitly remind the user what is to be done if Prolog is not found.
Response: The reviewer is correct, the reference is a bit far from the topic and has been removed.
``` r library(mathml) #> Le chargement a nécessité le package : rolog #> Warning in fun(libname, pkgname): swipl not found in the PATH. Please set #> SWI_HOME_DIR accordingly or install R package rswipl. #> Warning in rolog::consult(system.file("pl/mathml.pl", package = pkgname)): #> swipl not found in the PATH. Please set SWI_HOME_DIR accordingly or install R #> package rswipl. term <- quote(pbinom(k, N, p)) term #> pbinom(k, N, p) mathjax(term) #> Warning in rolog::once(call("r2mathjax", term, expression(X), flags), options = #> list(preproc = list(rolog::preproc, : swipl not found in the PATH. Please set #> SWI_HOME_DIR accordingly or install R package rswipl. #> Error in t$X: $ operator is invalid for atomic vectors ``` This is a bit unfortunate. Package improvement to make? Probably improving correct setup checks and error messages would be helpful. Adding more warnings about requirements to the article would be good. It seems package `rswipl` could be used to avoid installing Prolog, but I needed to search for this specifically from the error message shown. not a great user experience in my opinion, especially when discovering the MathML package while reading this article.
Response: The welcome message of the underlying package rolog has been revised to make it more informative and helpful in case of missing requirements, as well as the package DESCRIPTION and the readme on github.
mathout()
function not part of the package?
A reader will definitely want to try it while reading, and it would also make it easier to have this included.
Using this mathml in a R Markdown document will make sense if the function offered by the package handles the different formats.
Response: mathout()
has been added to the list of functions of the package, so
that copy-pasting the examples now works.
asis_output()
` and Custom Printing Method.
These should be used so that calling mathml(term)
in a chunk will work without knowing more about setting flags
Currently, results = "asis"
is needed, and mathml(term, flags = list(cat=TRUE))
needs to be used.
This can definitely be improved with a knit_print()
method.
Response: A knit_print method has been added, as suggested.