Last modified: 2014-05-26 17:19:53 UTC
We need a new datatype to store mathematical formulas. This should be done using mathml and be based on the string datatype.
Although mathml sounds good I fear the browser support [1] is too bad to use the native browser implementation. My suggestion is to make use of the Math extension [2] and store the formulars in TEX format. The formulars then would be rendered on item pages like they get rendered on wiki pages, too. I don't know how hard it is to use the extension but imo it is preferable over the use of mathml. [1] http://caniuse.com/mathml [2] https://www.mediawiki.org/wiki/Extension:Math
I thought that extension uses mathml? Either way we should store it in a way that can easily be re-used on the client. Daniel: What's your take on this?
This is tricky... MathML is by far easier to re-use by third parties, and in general a saner format for storing formula. But we don't have any facilities for rendering it server side for clients that don't support it well enough. For TeX syntax, we have a tried-and-true rendering backend that can render to PNG and MathML (and perhaps SVG in the future). This would make it a lot easier to implement formula display, but we would be stuck with TeX for the internal representation. With regards to editing, there is another trade-off: TeX formula are a lot easier to edit by hand, but MathML is easier to handle by third party editors. Ideally, we would be able to convert between MathML and TeX on the fly. For simple things, that should work fine, but...
Ok, I think a conversion between MathML and TeX would be great but not high priority at the moment. However there might be existing TeX to MathML converters. Now you must decide which format to use.
I was wondering too, if either MathML or TEX could store the item information instead of just the symbols. The symbols could be stored in another property and used just for display: If we take the formula E = mc², then the formula could also look like this: E = mc² {{Q|11379}} = {{Q|11423}} * ({{Q|2111}})² So instead of symbols we would really link to the objects or concepts that are behind the symbols. The letter e is ambigeous, but we could link to either 'variable' or 'Euler Number'. Same thing for chemical formulas. 'Fe' could stand for 'variable' * 'variable' or 'iron (element)'. Even more of the formula would be captured if the subscripts and superscripts would be distinguished between for example: superscript 2 could mean 'exponent' (x² = x squared) or 'electric charge' (Fe² = Iron ion charged 2 times positive). Maybe this type of datatype doesn't exist yet, but it would be really powerful in my opinion.