Search code examples
xsltlatexpdflatexmathmlxelatex

Error while running latex with a tex file created using XSLTML 2.1.2


I am creating a PDF with equation in the below way

Mathml.xml > XSLTML 2.1.2 > pdflatex

that is I am having an xml file with mathml equations and I am creating a tex file out of it using XSLTML 2.1.2 (XSLT file) and which gives an output of a .tex file, the tex file will be used to create a PDF by compiling it as pdflatex *.tex

but while doing that, there is an error comes in

enter image description here

My mathml file :

<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="math equation" display="inline" altimg-width="389" altimg-height="57" altimg="../images/altmath_10486.png">
<mtable columnalign="left left">
    <mtr>
        <mtd>
            <mo>⤹</mo>
            <mo>+</mo>
            <mo>Σ</mo>
            <msub>
                <mi>M</mi>
                <mrow>
                    <mi>C</mi>
                </mrow>
            </msub>
            <mo>=</mo>
            <mn>0</mn>
            <mo>;</mo>
        </mtd>
        <mtd>
            <mo>−</mo>
            <msub>
                <mi>M</mi>
                <mrow>
                    <mi>C</mi>
                </mrow>
            </msub>
            <mo>−</mo>
            <mn mathvariant="normal">540</mn>
            <mspace width="0.33em"/>
            <mi mathvariant="normal">N</mi>
            <mo mathvariant="normal">(</mo>
            <mn mathvariant="normal">2</mn>
            <mspace width="0.33em"/>
            <mi mathvariant="normal">m</mi>
            <mo mathvariant="normal">)</mo>
            <mo mathvariant="normal">=</mo>
            <mn>0</mn>
        </mtd>
    </mtr>
    <mtr>
        <mtd/>
        <mtd>
            <msub>
                <mi>M</mi>
                <mrow>
                    <mi>C</mi>
                </mrow>
            </msub>
            <mo>=</mo>
            <mo>−</mo>
            <mn mathvariant="normal">1080</mn>
            <mspace width="0.33em"/>
            <mi mathvariant="normal">N</mi>
            <mo mathvariant="normal">⋅</mo>
            <mi mathvariant="normal">m</mi>
            <mspace width="35pt"/>
            <mi mathsize="normal" mathcolor="#ef3f3e" mathvariant="sans-serif-italic">Ans.</mi>
        </mtd>
    </mtr>
</mtable>

my Tex :

\documentclass[preview]{standalone}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}

\begin{document}
\fontsize{12}{14}\selectfont

\begin{equation*}
\begin{array}{ll}⤹+\Sigma {M}_{C}=0;& -{M}_{C}-\mathrm{540}\phantom{\rule{0.33em}{0ex}}\mathrm{N}\mathrm{\left(}\mathrm{2}\phantom{\rule{0.33em}{0ex}}\mathrm{m}\mathrm{\right)}\mathrm{=}0\\ & {M}_{C}=-\mathrm{1080}\phantom{\rule{0.33em}{0ex}}\mathrm{N}\mathrm{\cdot }\mathrm{m}\phantom{\rule{35pt}{0ex}}\textcolor[rgb]{0.9372549019607843,0.24705882352941178,0.24313725490196078}{\mathsf{Ans.}}\end{array}
\end{equation*}

\end{document}

I am new to MathML and Tex, so anyone suggest a solution for this

Thank you


Solution

  • Pandoc also reads MathML (you can just pretend it's an HTML file):

    pandoc -f html -t latex Mathml.xml
    

    If you have LaTeX installed, you can even get a PDF directly:

    pandoc -f html Mathml.xml -o output.pdf