简体   繁体   English

如何从jqmath格式的文本制作svg?

[英]how to make a svg from jqmath formatted text?

I discovered jqmath library that works very well. 我发现jqmath库效果很好。 but now I have a problem: if I have a formatted text like: 但是现在我有一个问题:如果我有一个像这样的格式化文本:

<fmath alttext="√^{2}{4}+{1}/{3}" class="fm-inline">
  <mrow>
    <mrow mtagname="mroot">
      <span class="fm-root fm-inline" style="vertical-align: 0.85em;">
        <mn>2</mn>
      </span>
      <mo class="fm-radic">√</mo>
      <span style="vertical-align: 0.086em;">
        <span class="fm-vert fm-radicand" style="border-top-width: 0.072em;">
          <mn>4</mn>
        </span>
      </span>
    </mrow>
      <mo class="fm-infix">+</mo>
      <span mtagname="mfrac" style="vertical-align: 0em;">
        <span class="fm-vert fm-frac">
          <table>
            <tbody>
              <tr>
                <td class="fm-num-frac fm-inline">
                  <mn>1</mn>
                </td>
              </tr>
              <tr>
                <td class="fm-den-frac fm-inline">
                  <mn>3</mn>
                </td>
              </tr>
            </tbody>
          </table>
        </span>
      </span>
    </mrow>
  </fmath>

can I get or create a SVG file from this. 我可以从中获取或创建SVG文件。

thanks for help. 感谢帮助。

What you have here is MathML (not SVG surely). 您在这里拥有的是MathML(当然不是SVG)。 jqMath can generate MathML, but not convert it to smth else. jqMath可以生成MathML,但不能将其转换为其他。

If you want to generate SVG from LaTeX, then you should look at MathSVG . 如果要从LaTeX生成SVG,则应查看MathSVG

If you really want to generate SVG from MathML, you probably have to stack a couple of things. 如果您真的想从MathML生成SVG,则可能需要堆叠两件事。 These can be of interest: MathML to LaTeX and then LaTeX to SVG using MathSVG; 这些可能很有趣:使用MathSVG将MathML转换为LaTeX ,然后将LaTeX转换为SVG; another similar question ; 另一个类似的问题 ; a tool that's not a web tool but converts MathML to SVG directly . 不是网络工具,而是将MathML直接转换为SVG的工具

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM