Convert MathML to LaTeX











up vote
1
down vote

favorite












Here is an example:



Input:



<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi mathcolor="#FF0000">y</mi>
<mo mathcolor="#00FF00">−</mo>
<msub>
<mi mathcolor="#0000FF">y</mi>
<mn mathcolor="#FFFF00">0</mn>
</msub>
<mo mathcolor="#FF00FF">=</mo>
<mo mathcolor="#00FFFF">±</mo>
<mfrac mathcolor="#800000">
<mi mathcolor="#008000">a</mi>
<mi mathcolor="#000080">b</mi>
</mfrac>
<mo mathcolor="#808000">(</mo>
<mi mathcolor="#800080">x</mi>
<mo mathcolor="#008080">−</mo>
<msub>
<mi mathcolor="#808080">x</mi>
<mn mathcolor="#400000">0</mn>
</msub>
<mo mathcolor="#004000">)</mo>
</math>


Output:



{color[rgb]{1.0, 0.0, 0.0}y}
{color[rgb]{0.0, 1.0, 0.0}-}
{color[rgb]{0.0, 0.0, 1.0}y}_{color[rgb]{1.0, 1.0, 0.0}0}
{color[rgb]{1.0, 0.0, 1.0}=}
{color[rgb]{0.0, 1.0, 1.0}pm}
{color[rgb]{0.5, 0.0, 0.0}frac{color[rgb]{0.0, 0.5, 0.0}a}{color[rgb]{0.0, 0.0, 0.5}b}}
{color[rgb]{0.5, 0.5, 0.0}(}
{color[rgb]{0.5, 0.0, 0.5}x}
{color[rgb]{0.0, 0.5, 0.5}-}
{color[rgb]{0.5, 0.5, 0.5}x}_{color[rgb]{0.25, 0.0, 0.0}0}
{color[rgb]{0.0, 0.25, 0.0})}


As you can see, I need mathcolor attribute to be translated also. I have found online demo that does this (http://www.wiris.com/editor/demo/en/developers), but I need to run this on many, many examples. Any suggestions how I can do this? I need it to run on windows. Thanks.










share|improve this question









New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Related (duplicates?) I want to convert MathML to LaTeX and Rendering MathML in LaTeX?.
    – Alan Munn
    yesterday















up vote
1
down vote

favorite












Here is an example:



Input:



<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi mathcolor="#FF0000">y</mi>
<mo mathcolor="#00FF00">−</mo>
<msub>
<mi mathcolor="#0000FF">y</mi>
<mn mathcolor="#FFFF00">0</mn>
</msub>
<mo mathcolor="#FF00FF">=</mo>
<mo mathcolor="#00FFFF">±</mo>
<mfrac mathcolor="#800000">
<mi mathcolor="#008000">a</mi>
<mi mathcolor="#000080">b</mi>
</mfrac>
<mo mathcolor="#808000">(</mo>
<mi mathcolor="#800080">x</mi>
<mo mathcolor="#008080">−</mo>
<msub>
<mi mathcolor="#808080">x</mi>
<mn mathcolor="#400000">0</mn>
</msub>
<mo mathcolor="#004000">)</mo>
</math>


Output:



{color[rgb]{1.0, 0.0, 0.0}y}
{color[rgb]{0.0, 1.0, 0.0}-}
{color[rgb]{0.0, 0.0, 1.0}y}_{color[rgb]{1.0, 1.0, 0.0}0}
{color[rgb]{1.0, 0.0, 1.0}=}
{color[rgb]{0.0, 1.0, 1.0}pm}
{color[rgb]{0.5, 0.0, 0.0}frac{color[rgb]{0.0, 0.5, 0.0}a}{color[rgb]{0.0, 0.0, 0.5}b}}
{color[rgb]{0.5, 0.5, 0.0}(}
{color[rgb]{0.5, 0.0, 0.5}x}
{color[rgb]{0.0, 0.5, 0.5}-}
{color[rgb]{0.5, 0.5, 0.5}x}_{color[rgb]{0.25, 0.0, 0.0}0}
{color[rgb]{0.0, 0.25, 0.0})}


As you can see, I need mathcolor attribute to be translated also. I have found online demo that does this (http://www.wiris.com/editor/demo/en/developers), but I need to run this on many, many examples. Any suggestions how I can do this? I need it to run on windows. Thanks.










share|improve this question









New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Related (duplicates?) I want to convert MathML to LaTeX and Rendering MathML in LaTeX?.
    – Alan Munn
    yesterday













up vote
1
down vote

favorite









up vote
1
down vote

favorite











Here is an example:



Input:



<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi mathcolor="#FF0000">y</mi>
<mo mathcolor="#00FF00">−</mo>
<msub>
<mi mathcolor="#0000FF">y</mi>
<mn mathcolor="#FFFF00">0</mn>
</msub>
<mo mathcolor="#FF00FF">=</mo>
<mo mathcolor="#00FFFF">±</mo>
<mfrac mathcolor="#800000">
<mi mathcolor="#008000">a</mi>
<mi mathcolor="#000080">b</mi>
</mfrac>
<mo mathcolor="#808000">(</mo>
<mi mathcolor="#800080">x</mi>
<mo mathcolor="#008080">−</mo>
<msub>
<mi mathcolor="#808080">x</mi>
<mn mathcolor="#400000">0</mn>
</msub>
<mo mathcolor="#004000">)</mo>
</math>


Output:



{color[rgb]{1.0, 0.0, 0.0}y}
{color[rgb]{0.0, 1.0, 0.0}-}
{color[rgb]{0.0, 0.0, 1.0}y}_{color[rgb]{1.0, 1.0, 0.0}0}
{color[rgb]{1.0, 0.0, 1.0}=}
{color[rgb]{0.0, 1.0, 1.0}pm}
{color[rgb]{0.5, 0.0, 0.0}frac{color[rgb]{0.0, 0.5, 0.0}a}{color[rgb]{0.0, 0.0, 0.5}b}}
{color[rgb]{0.5, 0.5, 0.0}(}
{color[rgb]{0.5, 0.0, 0.5}x}
{color[rgb]{0.0, 0.5, 0.5}-}
{color[rgb]{0.5, 0.5, 0.5}x}_{color[rgb]{0.25, 0.0, 0.0}0}
{color[rgb]{0.0, 0.25, 0.0})}


As you can see, I need mathcolor attribute to be translated also. I have found online demo that does this (http://www.wiris.com/editor/demo/en/developers), but I need to run this on many, many examples. Any suggestions how I can do this? I need it to run on windows. Thanks.










share|improve this question









New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Here is an example:



Input:



<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi mathcolor="#FF0000">y</mi>
<mo mathcolor="#00FF00">−</mo>
<msub>
<mi mathcolor="#0000FF">y</mi>
<mn mathcolor="#FFFF00">0</mn>
</msub>
<mo mathcolor="#FF00FF">=</mo>
<mo mathcolor="#00FFFF">±</mo>
<mfrac mathcolor="#800000">
<mi mathcolor="#008000">a</mi>
<mi mathcolor="#000080">b</mi>
</mfrac>
<mo mathcolor="#808000">(</mo>
<mi mathcolor="#800080">x</mi>
<mo mathcolor="#008080">−</mo>
<msub>
<mi mathcolor="#808080">x</mi>
<mn mathcolor="#400000">0</mn>
</msub>
<mo mathcolor="#004000">)</mo>
</math>


Output:



{color[rgb]{1.0, 0.0, 0.0}y}
{color[rgb]{0.0, 1.0, 0.0}-}
{color[rgb]{0.0, 0.0, 1.0}y}_{color[rgb]{1.0, 1.0, 0.0}0}
{color[rgb]{1.0, 0.0, 1.0}=}
{color[rgb]{0.0, 1.0, 1.0}pm}
{color[rgb]{0.5, 0.0, 0.0}frac{color[rgb]{0.0, 0.5, 0.0}a}{color[rgb]{0.0, 0.0, 0.5}b}}
{color[rgb]{0.5, 0.5, 0.0}(}
{color[rgb]{0.5, 0.0, 0.5}x}
{color[rgb]{0.0, 0.5, 0.5}-}
{color[rgb]{0.5, 0.5, 0.5}x}_{color[rgb]{0.25, 0.0, 0.0}0}
{color[rgb]{0.0, 0.25, 0.0})}


As you can see, I need mathcolor attribute to be translated also. I have found online demo that does this (http://www.wiris.com/editor/demo/en/developers), but I need to run this on many, many examples. Any suggestions how I can do this? I need it to run on windows. Thanks.







conversion mathml






share|improve this question









New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday









siracusa

4,43911127




4,43911127






New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









trckojr

61




61




New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Related (duplicates?) I want to convert MathML to LaTeX and Rendering MathML in LaTeX?.
    – Alan Munn
    yesterday


















  • Related (duplicates?) I want to convert MathML to LaTeX and Rendering MathML in LaTeX?.
    – Alan Munn
    yesterday
















Related (duplicates?) I want to convert MathML to LaTeX and Rendering MathML in LaTeX?.
– Alan Munn
yesterday




Related (duplicates?) I want to convert MathML to LaTeX and Rendering MathML in LaTeX?.
– Alan Munn
yesterday










1 Answer
1






active

oldest

votes

















up vote
0
down vote













In the end, this solved my problem: https://stackoverflow.com/questions/27196826/convert-mathml-to-latex



Most stylesheets that I found would ignore the mathcolorattribute. This one solved it for me https://sourceforge.net/projects/xsltml/.



And since I've never before worked with stylesheets, I am writing this in case someone needs help with usage. Most languages have some support for xsl. For instance, in C#, this is the usage:



XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load("mmltex.xsl"); //this is the stylesheet
myXslTrans.Transform("myMMLfile.mml", "outputTeXfile.tex");


And that is about it. It works great.






share|improve this answer








New contributor




trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    trckojr is a new contributor. Be nice, and check out our Code of Conduct.










     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460998%2fconvert-mathml-to-latex%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    In the end, this solved my problem: https://stackoverflow.com/questions/27196826/convert-mathml-to-latex



    Most stylesheets that I found would ignore the mathcolorattribute. This one solved it for me https://sourceforge.net/projects/xsltml/.



    And since I've never before worked with stylesheets, I am writing this in case someone needs help with usage. Most languages have some support for xsl. For instance, in C#, this is the usage:



    XslCompiledTransform myXslTrans = new XslCompiledTransform();
    myXslTrans.Load("mmltex.xsl"); //this is the stylesheet
    myXslTrans.Transform("myMMLfile.mml", "outputTeXfile.tex");


    And that is about it. It works great.






    share|improve this answer








    New contributor




    trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote













      In the end, this solved my problem: https://stackoverflow.com/questions/27196826/convert-mathml-to-latex



      Most stylesheets that I found would ignore the mathcolorattribute. This one solved it for me https://sourceforge.net/projects/xsltml/.



      And since I've never before worked with stylesheets, I am writing this in case someone needs help with usage. Most languages have some support for xsl. For instance, in C#, this is the usage:



      XslCompiledTransform myXslTrans = new XslCompiledTransform();
      myXslTrans.Load("mmltex.xsl"); //this is the stylesheet
      myXslTrans.Transform("myMMLfile.mml", "outputTeXfile.tex");


      And that is about it. It works great.






      share|improve this answer








      New contributor




      trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        up vote
        0
        down vote










        up vote
        0
        down vote









        In the end, this solved my problem: https://stackoverflow.com/questions/27196826/convert-mathml-to-latex



        Most stylesheets that I found would ignore the mathcolorattribute. This one solved it for me https://sourceforge.net/projects/xsltml/.



        And since I've never before worked with stylesheets, I am writing this in case someone needs help with usage. Most languages have some support for xsl. For instance, in C#, this is the usage:



        XslCompiledTransform myXslTrans = new XslCompiledTransform();
        myXslTrans.Load("mmltex.xsl"); //this is the stylesheet
        myXslTrans.Transform("myMMLfile.mml", "outputTeXfile.tex");


        And that is about it. It works great.






        share|improve this answer








        New contributor




        trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        In the end, this solved my problem: https://stackoverflow.com/questions/27196826/convert-mathml-to-latex



        Most stylesheets that I found would ignore the mathcolorattribute. This one solved it for me https://sourceforge.net/projects/xsltml/.



        And since I've never before worked with stylesheets, I am writing this in case someone needs help with usage. Most languages have some support for xsl. For instance, in C#, this is the usage:



        XslCompiledTransform myXslTrans = new XslCompiledTransform();
        myXslTrans.Load("mmltex.xsl"); //this is the stylesheet
        myXslTrans.Transform("myMMLfile.mml", "outputTeXfile.tex");


        And that is about it. It works great.







        share|improve this answer








        New contributor




        trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 10 hours ago









        trckojr

        61




        61




        New contributor




        trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        trckojr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






















            trckojr is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            trckojr is a new contributor. Be nice, and check out our Code of Conduct.













            trckojr is a new contributor. Be nice, and check out our Code of Conduct.












            trckojr is a new contributor. Be nice, and check out our Code of Conduct.















             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460998%2fconvert-mathml-to-latex%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Futebolista

            Lallio

            Jornalista