[R-pkg-devel] R package submission fails due to mathjaxr package

Marc Scherstjanoi m@rc@@cher@tj@no| @end|ng |rom thuenen@de
Sun Jun 20 23:16:10 CEST 2021


Hi Wolfgang, Tiago and Max

thank you for your reply. Let me first apologize. "due to mathjaxr" sounds a bit harsh after the second reading.
I am very thankful for this nice package. It works really well for all of the equations I have, and the HTML it creates is just nice.
The only problem is the PDF and I also found out that the align function (amsmath latex package) is the actual error source. Furthermore, "\cr" is also giving an error message.

For example, having 

\mjdeqn{\begin{align} A_e(t) &= \left(A^T \cdot xi(t) \right)^T \cr &= A \cdot diag(xi(t)) \end{align}}{Ae(t) = (A^T * xi(t))^T = A * diag(xi(t))} 

in the \details section of the .Rd file leads to

"LaTeX errors:
! LaTeX Error: Environment align undefined."

when building with "R CMD build /home/.../package"

but passes with "R CMD build /home/.../package --no-manual".

The aim of the align command is to set several equations in certain horizontal positions (mostly oriented on the "="s, indicated by the "&"s) one below the other. 
I read about the possibility to use \mjtdeqn instead of \mjdeqn to specify LaTeX commands for the PDF and HTML pages differently.
However, if the pdf necessarily needs to be created when submitting the package, it would be better to have the equations aligned there as well.
For readability it would be a plus as I don't just have a couple of equations and equation systems.

We are using the following setup:
Added "mathjaxr" to Imports and RdMacros fields of the DESCRIPTION file.
Added import(mathjaxr) to the NAMESPACE file.
Added "\loadmathjax" to the \description section.

I would be grateful for any idea how to convince the pdfTeX of the align command or a similar solution.

Marc




----- Ursprüngliche Mail -----
Von: "Viechtbauer, Wolfgang (SP)" <wolfgang.viechtbauer using maastrichtuniversity.nl>
An: "Marc Scherstjanoi" <marc.scherstjanoi using thuenen.de>, r-package-devel using r-project.org
Gesendet: Sonntag, 20. Juni 2021 11:08:56
Betreff: RE: R package submission fails due to mathjaxr package

Hi Marc,

mathjaxr maintainer here. Can you provide a minimal reproducible example illustrating the problem? If this is another case where the LaTeX command for Mathjax does not work directly for creating the pdf (or vice-versa), then I would like to document this (and a possible workaround) as was done here:

https://github.com/wviechtb/mathjaxr#issues

Best,
Wolfgang

>-----Original Message-----
>From: R-package-devel [mailto:r-package-devel-bounces using r-project.org] On Behalf Of
>Marc Scherstjanoi
>Sent: Friday, 18 June, 2021 22:22
>To: r-package-devel using r-project.org
>Subject: [R-pkg-devel] R package submission fails due to mathjaxr package
>
>Hi,
>
>I am about to sumbmit an R package.
>
>It passed the
>"R CMD check /package... --as-cran --no-manual"
>but not the
>"R CMD check /package... --as-cran".
>
>Our way of presenting mathematical equations by using the mathjaxr package seems
>to be not supported.
>As a result, building pdf fails automatically.
>
>We have already been aware of that and would like to submit the
>package manual pdf separately.
>
>How can this be done?
>Can our submission work without the rd to pdf process?
>Or is there a way to include the mathjaxr style for the texing?
>
>Thank you in advance,
>
>Marc



More information about the R-package-devel mailing list