Hi Wolfgang,

thank you for this information.
I will try with \mjtdeqn and stick to the intended latex functions for building 
the pdf.
Moreover, we will bring up the more complicated equations in a vignette pdf.

One more question. If I use mjeqn at the beginning of a paragraph it 
automatically sets a line break afterwards.
Any idea what I can do to prevent this?

Best regards,
Marc

----- Ursprüngliche Mail -----
Von: "Viechtbauer, Wolfgang (SP)" <wolfgang.viechtba...@maastrichtuniversity.nl>
An: "Marc Scherstjanoi" <marc.scherstja...@thuenen.de>
CC: "Tiago Olivoto" <tiagooliv...@gmail.com>, "Max Turgeon" 
<max.turg...@umanitoba.ca>, r-package-devel@r-project.org
Gesendet: Montag, 21. Juni 2021 10:29:17
Betreff: RE: R package submission fails due to mathjaxr package

Hi Marc,

Thanks for the additional details. 

As far as I can tell, the problem has nothing to do with mathjaxr, but your use 
of LaTeX commands that are not supported in creating the pdf manual (which is 
not done by mathjaxr but R itself). See:

https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Mathematics

You can use AMS extensions for the HTML docs since those are supported by 
Mathjax, but not for the pdf manual.

So, for the pdf manual, you will have to write the equation without the use of 
AMS extensions (and indeed use \mjtdeqn).

Best,
Wolfgang

>-----Original Message-----
>From: Marc Scherstjanoi [mailto:marc.scherstja...@thuenen.de]
>Sent: Sunday, 20 June, 2021 23:16
>To: Viechtbauer, Wolfgang (SP)
>Cc: Tiago Olivoto; Max Turgeon; r-package-devel@r-project.org
>Subject: Re: R package submission fails due to mathjaxr package
>
>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.viechtba...@maastrichtuniversity.nl>
>An: "Marc Scherstjanoi" <marc.scherstja...@thuenen.de>, r-package-devel@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-boun...@r-project.org] On 
>>Behalf Of
>>Marc Scherstjanoi
>>Sent: Friday, 18 June, 2021 22:22
>>To: r-package-devel@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

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to