LaTeX equations in html import not rendering

Conversion from HTML does not seem to be prioritized, thus I am not sure that it would be implemented in any near future. The current workaround is to open the HTML (in Firefox), then save it again as an HTML where mathematical formulae are converted into MathML, and then import it into TeXmacs, as described in LaTeX equations in html import not rendering

As per your workaround suggestion, I tried this in chrom as well as firefox. Below is the screenshot of what I got in firefox:

It can be clearly seen that not only equations have become inline from display format. There are also double appearance of the same equations everywhere, first one being a bit clumsy, the second one being correct.

Thanks and regards,

Dr. A.K. Singh

There seems something wrong in your setup. Could you please offer your TeXmacs version and Firefox version? I am using MathJax v3 in https://www.mathjax.org/#gettingstarted mentioned above, obtaining

The result of importing to TeXmacs
<TeXmacs|2.1.2>

<style|browser>

<\body>
  <label|header><label|content><section*|<label|_introduction>Introduction>

  In a oneway classification, the typical analysis of variance model for the
  value <strong|<em|Y<rsub|ij>>> of the <em|j<rsup|th>> observation in the
  <em|i<rsup|th>> class is given by,

  <label|eq:lin-model>Basic linear model

  <equation*|Y<rsub|ij>=\<mu\><rsub|i>+e<rsub|ij>>

  where the <math|\<mu\><rsub|i>> in the basic linear model at
  <hlink|Equation (1)|#eq:lin-model>, represent the population means of the
  <strong|<em|classes>> and the <math|e<rsub|ij>> are the <math|j<rsup|th>>
  residuals for the <math|i<rsup|th>> class. But suppose that on each unit we
  have also measured another variable latexmah:[X_{ij}] that is linearly
  related to <math|Y<rsub|ij>>. It is natural to set up the model,

  <label|lin-model-X>Basic covariance model with linear regression of
  <strong|Y> on covariate <strong|X>

  <equation*|Y<rsub|ij>=\<mu\><rsub|i>+\<beta\><around*|(|X<rsub|ij>-<wide|X|\<wide-bar\>>|)>+\<epsilon\><rsub|ij>>

  <label|lin-model-X-alpha>Basic covariance model in CRD with linear
  regression of <strong|Y> on covariate <strong|X>

  <equation*|Y<rsub|ij>=\<mu\>+\<alpha\><rsub|i>+\<beta\><around*|(|X<rsub|ij>-<wide|X|\<wide-bar\>>|)>+\<epsilon\><rsub|ij>>

  where, <math|\<alpha\><rsub|i>=\<mu\><rsub|i>-\<mu\>> and <math|\<beta\>>
  is the regression coefficient of <strong|<em|Y>> on <strong|<em|X>>. The
  <hlink|Equation (2)|#lin-model-X> is a typical <strong|<em|model for the
  analysis of covariance after removing the general means <math|\<mu\>> from
  group means <math|\<mu\><rsub|i>>>> and the <hlink|Equation
  (3)|#lin-model-X-alpha> is a typical <strong|<em|model for the analysis of
  covariance in CRD>>.

  <label|footer><label|footer-text>Last updated 2023-08-07 14:32:39 +0530

  normal

  <label|cmdline_iframe>
</body>

<initial|<\collection>
</collection>>

<\references>
  <\collection>
    <associate|_introduction|<tuple|?|?>>
    <associate|auto-1|<tuple|?|?>>
    <associate|cmdline_iframe|<tuple|?|?>>
    <associate|content|<tuple|?|?>>
    <associate|eq:lin-model|<tuple|?|?>>
    <associate|footer|<tuple|?|?>>
    <associate|footer-text|<tuple|?|?>>
    <associate|header|<tuple|?|?>>
    <associate|lin-model-X|<tuple|?|?>>
    <associate|lin-model-X-alpha|<tuple|?|?>>
  </collection>
</references>

<\auxiliary>
  <\collection>
    <\associate|toc>
      <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|Introduction>
      <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
      <no-break><pageref|auto-1><vspace|0.5fn>
    </associate>
  </collection>
</auxiliary>

I am using TeXmacs version 2.1.2, and of Firefox version 116.0.2 (64-bit). But, as suggested in the link provided by you, i.e by adding the mathjax 3 snippet in my html source code page, the import after save as process was failure in Chorme (latest) but successful in firefox. However, even after successful import from firefox save as, the equations have become left aligned in TeXmacs, whereas they were centrally aligned originally. By the way, I had added the mathjax 3 snippet just after start of beginning html tag in the file source.The snapshot is given below: What went wrong, I do not know.

I get what you get both with Firefox and with Chrome (for me Chrome works), which is different from what @jeroen gets. Perhaps @jeroen can post somewhere his “saved” version of your file so that I can check it against mine.

I get something similar to what @jeroen got, under Firefox ESR 102.12.0. I have already pasted the tm file that I got. Here is the HTML: https://pastebin.com/Aiwk103J

I think that the difference is that you are using TeXmacs 2.1.2 to import and I am using 2.1.1
@akhileshsingh.igkv, in case you are using 2.1.1 and want to use 2.1.2 for improving the html import, you need to get advice on the forum on how to find it :wink:

Indeed, it might be a bug which exists in 2.1.1. It might also exist in the 2.1.2 release. I am on svn14119, obtained from pjoyez’s repo. It does not offer Windows builds, unfortunately.

I am already using TeXmacs 2.1.2, and I submitted above the screenshot based on this version only. I don’t think I have any option than waiting for the improvement brought by the developers, despite they have other priorities.

Thanks and regards,

Dr. A. K. Singh

The same seems to me too.

I guess that it is improved by this commit, and seemingly this commit is already merged in the latest Mogan. Did you test it under Mogan?

Once I had tried and had obtained similar results. But, at what stage, I don’t remember and therefore didn’t report. I will retry it again, and will submit the results.

You have to test in Mogan importing the HTML saved by Firefox, which contains MathML. This does not seem to be what you tested before.

I do not know how to ensure firefox contains MathML. But, with the snippet of Mathejax 3, as per the link provided by you and subsequently after putting them into the HTML document page, then saved as HTML again, and then imported into Mogan 1.1.4 gives me the following snapshot::

This also has similar problem as reported by me.

With regards,

Dr. A.K. Singh

It is probably because you are using Mogan v1.1.5 or lower, which are based on TeXmacs lower than 2.1.1. This should be solved by using v1.2.0, not yet released but beta, in https://github.com/XmacsLabs/mogan/releases/tag/v1.2.0-beta2 say.

I downloaded Mogan Editor 1.1.4, whose about and help stated that it is based on TeXmacs 2.1.2. As you said, I hope that it will be solved in Mogan 1.2.0.

Thanks and regards,

Dr. A. K. Singh

I looked at the code tree of v1.1.5, and these commits are not merged in v1.1.5. They are merged in Mogan v1.2.0, and I tested it on a Windows machine, confirming that it works. Thus exporting from Firefox and then importing from Mogan is a workaround.

I downloaded Mogan 1.2.0 beta2, the latest pre-release version and installed the same. But, it is simply unresponsive to html file import, of course after saving as process in Firefox. Doesn’t do anything.

Once the regular Mogan 1.2.0 is released, I will re-test it.

Could you please try to import the HTML file (which was exported from Firefox, thus directly import it from Mogan) https://pastebin.com/Aiwk103J

I hope that other Mogan users could try doing to see whether this is reproducible.