5 ms·
UnicodeMath: a nearly plain-text encoding of mathematics, v3.1 (2016) [pdf]
- jxy 9y agoAre there any programs that can render unicode maths correctly? Looks like we don't need MathML anymore.
- whyever 9y agoSymPy has Unicode output, you can try it here: live.sympy.org Note how "Symbol('alpha')" and "Symbol('x_a')" get converted to unicode. There are limitations though, "Symbol('x_b')" does not work, because the is no underscore "b". You can also try fancier things like "Eq(Symbol('gamma'), 1/sqrt(1 - Symbol('v')2))". (Make sure to enable unicode output, the default is latex.)
- yorwba 9y agoInterestingly, Unicode has subscript versions of most of the Latin alphabet: ₐbcdₑfgₕᵢⱼₖlₘₙₒₚqᵣₛₜᵤᵥwₓyz. I wonder why they don't complete the set.
- ygra 9y agoBecause Unicode is not about completing arbitrary sets people would like to see. It's about encoding characters either having appeared in other encodings (to allow legacy encodings to be easily convertible to Unicode), or characters that are in actual use. The existing subscript and superscript characters were never intended to provide a full Latin alphabet (which subset, anyway?). Some are used in IPA, some are used in other contexts or scripts, but in general nothing actually requires all Latin letters. There's also some Greek, some Cyrillic, a few Hanzi, and a bunch of characters that are not used in any script. Which set would you like to »complete« again and to what end? If it's just about having something that looks the part, then markup is preferred over plain text. The existing set serves a number of purposes but none of them are lacking more characters. Usually there has to be a fairly convincing need for encoding more characters and »I'd like to be able to write some text completely in subscript or superscript« doesn't tend to be a convincing argument.
- zokier 9y agoI'm pretty sure that all ASCII alphanumeric characters have been widely used in at least subscript format in science, engineering and maths. Probably wouldn't be too difficult to find use of most, if not all, greek letters used as subscripts too in STEM literature So I'd say subscript characters definitely fall into category "characters that are in actual use".
- ygra 9y agoBut math is exactly one that needs a higher-level format than plain text, as is evident by things like TeX or, well, the paper being discussed here. I'd argue that there are few scientists who actually write in plain text without any higher-level markup.
- whyever 9y agoFunnily enough, the symbol for the newly announced particle cannot be written down with Unicode.
- WorldMaker 9y agoBased on the introduction it sounds like Microsoft Office applications can render it, at least. The next question is what does browser support look like? It's not a feature currently tracked on http://caniuse.com http://caniuse.com.
- sp332 9y agoThis took a little digging, but it does work in Word. In the Insert tab, click "Equation" at the far right, then "Equation" again at the bottom of the list. Paste the UnicodeMath into the box that appears and then click "Professional" on the left side of the ribbon.
- doomrobo 9y agoI think one would still be better off writing their plain text math in LaTeX. Firstly, it can be rendered into a more legible format by a myriad of online and offline tools. Secondly, from experience, it seems that people who are around math often enough are generally capable of parsing snippets of LaTeX just fine. I'd argue that the example on page 7 of the PDF W_δ₁ρ₁σ₂^3β = U_δ₁ρ₁^3β+1/8π^2 ∫_α₁^α₂dα'₂ [(U_δ₁ρ₁^2β-α'₂U_ρ₁σ₂^1β)/U_ρ₁σ₂^0β] is illegible in both UnicodeMath and LaTeX. Furthermore, typing that out was a huge pain in the ass, even being comfortable with that region of Vim digraphs. I typed it out in LaTeX using the rendered output as a reference and found it was faster, and it compiled on the first try. I really don't think this format is worth it.
- ygra 9y agoYou do realize that typing such things generally assumes to include a way of replacing text sequences by characters? Instead of typing W_δ₁ρ₁σ₂ you can just as well write W_(\delta_1 \rho_1 \sigma_2), which brings it much closer to LaTeX again, if that's your thing. I find the Unicode version much easier to read, though, especially since it contains little markup beyond the actual characters appearing in the equation. And just to add a counterpoint to your experience here, I found this format to be much easier to type than LaTeX with fewer errors, even going as far as typing along on the fly in some math lectures in uni. There might just be a lot of bias what someone is used to and comfortable with.
- doomrobo 9y agoFair enough. Although I'm curious what text editors would support non-trivial text replacement like \delta_1. For example, Vim abbreviations apply on word boundaries (things followed by space or punctuation). So to make \delta_n work you'd have to have a separate abbreviation for each digit n. Then do this for every single thing that can be subscripted. To be fair, though, this works fine and seems pretty usable :ab _1 <BS>₁ This does a backspace before the replacement, so it transforms `foo _1.` into `foo₁.`
- ygra 9y agoThe subscript replacements are not really needed, I was more talking about turning \delta into δ. Word itself doesn't replace the subscripts and I found the sub-/superscript characters more a nuisance to work with (as they bind stronger than _/^ I think). But having characters that exist in Unicode appear as themselves instead of things like \delta or, worse, \mathbb N, imho really helps legibility already.
- ivanbakel 9y agoThis would be a lot more digestable if it didn't harp on about how much better it is than Tex math. I'd prefer a spec that stood its ground and pushed its own merits.
- ygra 9y agoI'd bet the kneejerk reaction to any math notation would be »Why would anyone use this when we have TeX?« (heck, it happened here despite the comparisons). Comparing to the status quo or prior art is hardly out of place, I'd say. The author certainly didn't invent this without looking at other math notation approaches first, and even met with Knuth.
- kutkloon7 9y agoIf such a spec was released before LaTeX was released, it might have stood a chance. Now everyone is used to LaTeX, no-one will switch, because there is simply too little benefit. While I appreciate the effort that has gone into it, and I can definitely see the merit in some cases, there are some awkward unicode characters that you need to use; very inconvenient.
- z1mm32m4n 9y agoProbably some people are wondering why they might consider β simpler than \beta in a plain text environment. Many editors have shortcuts for entering a wide range of Unicode characters. For example with Vim digraphs[1], you can type β <C-k>b*. Then you get the benefit of reading the actual character, not the LaTeX command. [1] :help digraph