[R-pkg-devel] [External] R package submission fails due to using LaTeX functions that have not been implemented for building pdfs (not due to mathjaxr)

Richard M. Heiberger rmh @end|ng |rom temp|e@edu
Fri Jun 25 16:52:32 CEST 2021


> 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?

follow it with
    \vspace*{1ex}
to back up one line.

Rich

> On Jun 25, 2021, at 07:51, Marc Scherstjanoi <marc.scherstjanoi using thuenen.de> wrote:
> 
> 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.viechtbauer using maastrichtuniversity.nl>
> An: "Marc Scherstjanoi" <marc.scherstjanoi using thuenen.de>
> CC: "Tiago Olivoto" <tiagoolivoto using gmail.com>, "Max Turgeon" <Max.Turgeon using umanitoba.ca>, r-package-devel using 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://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcran.r-project.org%2Fdoc%2Fmanuals%2Fr-release%2FR-exts.html%23Mathematics&data=04%7C01%7Crmh%40temple.edu%7C95de1b8bbf3c4528e1ed08d937cfaaf7%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637602187342118099%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kEmrK%2BB%2B9FfqGHu81LW%2BQ7iw0tFVLPCJ0Q2yVPCfvoQ%3D&reserved=0
> 
> 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.scherstjanoi using thuenen.de]
>> Sent: Sunday, 20 June, 2021 23:16
>> To: Viechtbauer, Wolfgang (SP)
>> Cc: Tiago Olivoto; Max Turgeon; r-package-devel using 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.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://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwviechtb%2Fmathjaxr%23issues&data=04%7C01%7Crmh%40temple.edu%7C95de1b8bbf3c4528e1ed08d937cfaaf7%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637602187342118099%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=W8hQkBa1PFkJkSHAOmSFW%2FN2y8IqssSZSTxZ%2BlD2n3g%3D&reserved=0
>> 
>> 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
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=04%7C01%7Crmh%40temple.edu%7C95de1b8bbf3c4528e1ed08d937cfaaf7%7C716e81efb52244738e3110bd02ccf6e5%7C0%7C0%7C637602187342118099%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=BodjLKEeB4Pdt5iM6O%2Fy%2B6OecFY78WqN3175N1gpnKw%3D&reserved=0



More information about the R-package-devel mailing list