Skip to main content
9 votes

LaTeX to MathML conversion: tools, limitations, and approaches?

LaTeXML provides several tools for converting TeX into XML/HTML/MathML. One of those tools is latexmlmath. For example, on a command line, the input: latexmlmath '\mathbf{F}_{2}=k \frac{q_{1} q_{2} ...
Teepeemm's user avatar
  • 6,983
9 votes

LaTeX to MathML conversion: tools, limitations, and approaches?

I'm surprised no one mentioned pandoc, which is a perfectly suitable tool to convert LaTeX to html documents. Using the following markdown file (that uses a LaTeX syntax): % Pandoc math demos $a^2 + ...
Clément's user avatar
  • 5,651
9 votes
Accepted

Scaling delimiters in MathJax

As David Carlisle said, this is a bug in TeX4ht. <mo> elements around parentheses should have set the stretchy="false" attribute. I will fix that in TeX4ht sources. Until this fix is ...
michal.h21's user avatar
  • 51.2k
7 votes
Accepted

how can I get bold symbols using \boldsymbol and tex4ht with MathML output?

Most straightforward way to get the bold symbols is to redefine \boldsymbols command to include tags which you want. Put this command to your .cfg file: \renewcommand\boldsymbol[1]{\HCode{<mi ...
michal.h21's user avatar
  • 51.2k
5 votes

LaTeX to MathML conversion: tools, limitations, and approaches?

tex4ht can be used to export LaTeX to MathML. Its advantage is that it supports custom commands, either from the user and from non standard packages, out of the box. It can also convert the whole ...
michal.h21's user avatar
  • 51.2k
4 votes
Accepted

htlatex: tweaking the MathML output for numbers with more than one digit

Edit 2: The updated LuaXML library is on CTAN and in TL, so it is no longer necessary to update it manually. I also added mechanism for filters that modify the DOM to make4ht. Basic DOM filters can ...
michal.h21's user avatar
  • 51.2k
4 votes
Accepted

how to programmatically convert mathml or LaTeX formulas in spoken words?

Currently mathjax speech rules are probably the most advanced thing here, you could access them via a headless browser but see https://docs.mathjax.org/en/latest/basic/a11y-extensions.html Or more ...
David Carlisle's user avatar
3 votes

TeX4ht: can we prevent italic capital greek letters in mathml or mathml,mathjax output

You can try this .cfg file: \Preamble{xhtml} \begin{document} \def\temp#1#2{\def#1{\PauseMathClass{\HCode{<mi mathvariant="normal">}\special{t4ht@+\string&{35}x#2{59}}x\HCode{</...
michal.h21's user avatar
  • 51.2k
3 votes
Accepted

Latex -> html with mathematical equations for accessibility to generate MathML

I thought I fixed fences not so long ago, when I removed most of instances of the deprecated element in the MathML configuration. should be used instead. What I missed is that the whole expression ...
michal.h21's user avatar
  • 51.2k
3 votes
Accepted

Some symbols load (display) issue when converting MathML to LaTeX

\circ is a centred circle for degree you want ^{\circ} and you want\approx for U+2248. In general these days it might be easier to use pmml-new but with a TeX setup using luatex or xetex and unicode-...
David Carlisle's user avatar
3 votes
Accepted

Why using {newtxtext,newtxmath} packages breaks MathML generation in tex4ht?

The issue is that there are missing mapping files between newtx fonts and Unicode. Such mapping file, with .htf extension must exist for every font which should be supported by tex4ht. These mappings ...
michal.h21's user avatar
  • 51.2k
3 votes
Accepted

How to write LaTeX in browsers (in other words HTML)?

Looking at https://artofproblemsolving.com/texer The site has several mechinsms, mathjax for embedding math-only math expresssions in a web page but also a full rendering of arbitrary latex to pdf, ...
David Carlisle's user avatar
2 votes

What LaTeX math markup can pandoc translate into MathML?

The conversion takes place in the function writeMathML in the source file src/Text/TeXMath/Writers/MathML.hs of the texmath module that is used by pandoc. If you want to know precisely how this ...
Henri Menke's user avatar
2 votes
Accepted

siunitx package use with tex4ht and generation of invalid mathml for units

It seems that this issue was fixed in the meantime, the result looks like this: The MathML code seems OK too: <!-- l. 4 --><p class='noindent'><!-- l. 4 --><math display='inline' ...
michal.h21's user avatar
  • 51.2k
2 votes

converting Mathml to LaTeX in python programming

I'm a bit late to the party, but you might want to consider using ConTeXt for MathML input as it is supported out-of-the-box. \usemodule[mathml] \starttext \xmlprocessdata{}{ <math xmlns="http://...
Henri Menke's user avatar
2 votes

converting Mathml to LaTeX in python programming

You can try doing it like mathconverter does: import os from lxml import etree def mathml2latex_yarosh(equation): """ MathML to LaTeX conversion with XSLT from Vasil Yaroshevich """ ...
Bula's user avatar
  • 121
2 votes

LaTeX to MathML conversion: tools, limitations, and approaches?

Your options are many, many indeed! There are literally dozens of programs to convert LaTeX to HTML and HTML+MathML, most of them with command line interfaces and some of them with GUI. In fact the ...
Paulo Ney's user avatar
  • 2,450
2 votes
Accepted

\displaystyle and \limit commands don't seem to work when rendering to mathml

In general, it is hard to support switching commands such as \itshape, \large or \displaystyle in tex4ht. tex4ht just cannot know where it should close the affected content in a reliable way. The font ...
michal.h21's user avatar
  • 51.2k
2 votes

how to programmatically convert mathml or LaTeX formulas in spoken words?

Take a look at MathCAT, a Rust library for converting MathML to speech strings. Demo: https://nsoiffer.github.io/MathCATDemo/
Stack Overflown's user avatar
2 votes

Latex -> html with mathematical equations for accessibility to generate MathML

One option is to write Rmarkdown as an .Rmd file and compile in RStudio to an HTML file. The Rmarkdown workflow is: Downstream of the .Rmd file, all the processing happens automatically in RStudio. ...
Ross's user avatar
  • 5,676
2 votes
Accepted

Are there any packages to import bibxml into (la)tex?

There are the Bibxmlutils utilities that include bibxmlto which can generate a .bib file. It looks like these are distributed as source only for most platforms, although there are Slackware and ...
Don Hosek's user avatar
  • 14.1k
2 votes
Accepted

Converting MathML to LaTeX: Use of \mathop and msub tag

It's all so long ago.... But Firstly you need to correct the namespace declaration in your source, or nothing matches at all <math xmlns="http://www.w3.org/1998/Math/MathML"> Then, ...
David Carlisle's user avatar
2 votes
Accepted

tex4ebook: math symbols in footnote labels

The tex4ebook (or more generally the tex4ht) configuration file for the endnotes package specifies the endnote numbers in math mode. This used to be the case for the normal LaTeX definitions for ...
Marijn's user avatar
  • 38.6k
2 votes

Problem with boldmath followed by super or subscript in tex4ebook

TeX4ht unfortunately cannot support sub- and superscripts without proper grouping. Only thing you can try is to pre-process your input file and add grouping. For example, using the following Lua file: ...
michal.h21's user avatar
  • 51.2k
2 votes

Issue with mhchem and fractions in make4ht and mathml

The problem is that there is no MathML support for Mhchem at the moment, so you get this wrong rendering as a result. I will try to fix it, but until it is done, you can try the following ...
michal.h21's user avatar
  • 51.2k
2 votes
Accepted

Bad output with make4ht array and mathml

This is a bug in make4ht. It automatically cleans some common issues in the MathML code produced by TeX4ht. One of them is spurious empty last rows in array. In this case, the code incorrectly thinks ...
michal.h21's user avatar
  • 51.2k
2 votes
Accepted

make4ht \boxed rendering wrong when using MathML

You can see that something went wrong from this warning message during the compilation: [WARNING] domfilter: /home/mint/texmf/scripts/lua/LuaXML/luaxml-mod-xml.lua:175: Unbalanced Tag (/mrow) [char=...
michal.h21's user avatar
  • 51.2k
1 vote

MathML as well need LaTeX coding in tex4ht

There are several possible approaches how to achieve this: configure TeX4ht to catch all math content and typeset it twice - once using MathML, second time as a verbatim text. parse MathML content ...
michal.h21's user avatar
  • 51.2k
1 vote

Latex -> html with mathematical equations for accessibility to generate MathML

According to https://dlmf.nist.gov/LaTeXML/manual/usage/usage.single.html#SS0.SSS0.P5, you can pass the option --javascript=LaTeXML-maybeMathJax.js to latexmlpost and it will call the appropriate ...
Teepeemm's user avatar
  • 6,983
1 vote

ltablex hack in LatexML?

One thing to remind is to make the need known to the latexml developers (hi!) and request support at the LaTeXML issue tracker, so that we know there is interest for ltablex. If you think latexml can ...
Deyan's user avatar
  • 126

Only top scored, non community-wiki answers of a minimum length are eligible