What's the best way to write Mathematical Equa

2019-01-10 05:53发布

I am working on a Math related web page and am looking for a solution to writing Mathematical equations easily onto a web page. There are several solutions readily available to me at the moment:

  • Use LaTeX and publish them on my web page as images.
  • Use MathML

Both of these solutions aren't ideal and seem somewhat dated. Replacing what should be text with an image is never a good idea and MathML isn't compliant with all browsers/operating systems.

I'm hoping that there is a modern solution to using images or MathML, perhaps something utilising sIFR to display mathematical equations? After a bit of research I am still yet to find any real solution.

Please note that I am asking for a new way of publishing equations. I do not want images to be the output that is displayed on the web page and would rather have these equations rendered as textual data. MathML is the closest I've come, but it's still not ideal. I've wondered for a while whether a replacement tool like sIFR could be utilised to create equations in Flash. Anyone have any suggestions on this front?

EDIT: It's been a while since I last updated this post, but with HTML5 becoming adopted by browsers there is a new player in the game that introduces LaTeX and MathML back into the mix, MathJax!. MathJax are definitely the way to go!

Similar Question: Math equations on the web

12条回答
萌系小妹纸
2楼-- · 2019-01-10 06:39

iTex2Img is the best one what I've ever used. Here is a screenshot with an example.

enter image description here

查看更多
甜甜的少女心
3楼-- · 2019-01-10 06:40

You can write your latex directly in your HTML page and display it dynamically using this library :

http://www.codecogs.com/components/equationeditor/equationeditor.php

查看更多
Root(大扎)
4楼-- · 2019-01-10 06:40

It will depend on your primary purpose and audience.

MathML (MathML2) sounds like promising but it still have a lot of compatibility issues across browsers and MathML equation editors (or generator). Many complex equations will not be maintained or displayed same across different browsers. Many math editors, converters, generators say they support MathML. But the result is not the same although the output may look similar. And it is not easy/not possible to define many complex equations in MathML 2. If you just have some simple equations and if you can have your audience use a certain browsers, then this might be an option. If MathML3 is widely supported, then MathML might be the way to go.

If your math expressions are not interactive and don't have to be dynamically generated) and rather static on the page, PNG or JPG image might be a good option. The size of images are not that big in most cases and displaying tens of equations in a page is quite fast as most of us have high speed internet these days. Not much difference between PNG images vs. any script based rendering approaches as the script based equations are often a few KBs and as it takes time to render the images from the local computer after downloading all the scripts. also, there are many applications that support re-editing of the PNG or JPG based equation images. MathMagic (www.mathmagic.com) supports re-editable PNG (transparent PNG as well), GIF, JPG, BMP. MathType (www.dessci.com) supports re-editable GIF. MathMagic also reads MathType images.

If a vector based image format is required for both screen and high quality output such as printing, SVG might be the way to go. Also, PDF can be an option in some cases. Many Mac equation editors supports PDF format as it is a kind of (almost native) Mac OS X format. But only a few supports PDF on Windows. It looks the latest MathType Mac version supports PDF. MathMagic supports PDF on both Mac and Win. It looks MathMagic supports SVG as well.

If the equations are created by some limited writers, there are many options to combine to get the best results. Such as using the latest MS Word's built-in MathML/XML based equation editor, and then converting the pages to web. Or using a few 3rd party WYSIWYG equation editors (such as MathType or MathMagic) for fast writing and editing, and then saving the equations a MathML, LaTeX, or Wiki compliant equation format and using in with online equation rendering engines such as codecogs.com or MathJax.

If the contents should also be used for other formats, such as eBook/ePub, there should be other factors to consider including the quality of equations and the integration with the solution such as InDesign.

please correct me if anything incorrect.

查看更多
时光不老,我们不散
6楼-- · 2019-01-10 06:43

I've been using the LaTeX plugin for the Confluence wiki to write equations on the web (well, on the intranet). It displays an image in the web browser, but you can still see the LaTeX source if you edit the page.

I don't know what you're using to host the web site, but you could maybe use a similar approach: embed the LaTeX source in the page, and render it as an image for the web browser.

查看更多
Evening l夕情丶
7楼-- · 2019-01-10 06:44

I have been using borderless tables with merged cells in my website to display math equations. It works excellent for most equations. However, since the markup is usually a bit complex, it would be time consuming in case of hard core mathematics websites.

Here is the code:

<style type="text/css">
  table.math{font:17px georgia, times, serif;border-collapse:collapse;border:none;}
  td.a{text-align:center;}
  td.b{padding:0 2px;}
  td.c{border-top:1px solid #505050;border-left:1px solid #505050;border-bottom:1px solid #505050;}
  td.d{border-top:1px solid #505050;border-right:1px solid #505050;border-bottom:1px solid #505050;}
  td.e{text-align:center;border-top:1px solid #505050;}
</style>
<table class="math">
  <tr>
    <td class="a">1</td>
    <td class="b" rowspan="2">&times;</td>
    <td class="c" rowspan="2">&nbsp;</td>
    <td class="a">8</td>
    <td class="b" rowspan="2">+</td>
    <td class="a">1</td>
    <td class="d" rowspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td class="e">x + 2</td>
    <td class="e">x + 2</td>
    <td class="e">x &minus; 1</td>
  </tr>
</table>

Here is the output of the above code:

enter image description here

查看更多
登录 后发表回答