7 ms·
UnicodeMath – A Nearly Plain-Text Encoding of Mathematics (2016) [pdf]
- thrwia22 8y agodat c++ function on page 36 tho.. omg
- enriquto 8y agoIt is much more readable than the version using full-length words for variables.
- thrwia22 8y agoi totally agree, but living in the world of mostly ascii-limited code this looks exotic, weird and refreshing. and cool
- enriquto 8y ago> living in the world of mostly ascii-limited code this looks exotic this is is not the world where everybody lives. I live mostly in the world of math books, where all variables are single letters (which is the main difference here, and not the use of unicode). I tend to find code written by non-mathematicians ridiculous and unreadable. Instead of E = m * c^2 they seem to prefer bullshit like thing->Energy = thing->Mass() * np.math.pow(lib.constants.speedOfLightInVacuum,2)
- dagw 8y ago> E = m * c^2 The problem then occurs when you work in a multidisciplinary group and 'everybody' wants to use 'p' or 'c' or whatever mean the the super obvious thing it means in their field and you have to remember what each letter means in 6 different fields and the 'p' in function f means something completely different from the 'p' in function g.
- enriquto 8y ago> the 'p' in function f means something completely different from the 'p' in function g. And that's OK. The 'x' in mathematics means completely different things depending on the equation. That's what comments are for, to explain the meaning of the local variables on each function. // E: energy of the thing // m: mass of the thing // c: constant representing the speed of light in vacuum E = m * c^2 I cannot read multiple-letter variables without unconsciously interpreting them as the product of several single-letter variables. It requires a lot of conscious effort that obscures my understanding of the code.
- _carl_jung 8y agoI suppose you have the same problem when reading this comment too.
- enriquto 8y agono, I do not mistake regular text with mathematical formulas. My problem is that I read code as if it was mathematical formulas.
- OskarS 8y agoSome part of that is bad namespace handling, remove the namespaces and it already looks better: thing->Energy = thing->Mass() * pow(speedOfLightInVacuum, 2) And you can obviously clean it up further by using variables and just write auto mass = thing->Mass(); auto c = speedOfLightInVacuum; thing->Energy = mass * pow(c, 2); // or thing->Energy = mass * c * c; // or thing->Energy = mass * c**2; (for languages that support it) The issue is that in "E = m c^2", it's obvious from context what everything refers to. In programming languages, that's not necessarily the case. You can have "thing", but also "other_thing" and "array_of_things". And all those things can have many different properties. And those things can be either objects, or pointers to objects. You're not wrong: it's a definite flaw of many programming styles (and programmers!) that they're "too wordy". But it's also true that mathematics can get by with a bit of ambiguity that humans can handle that computers can't.
- OskarS 8y agoFrom the very little work I've done in Mathematica (which was years ago, and I'm not anywhere close to a "real" mathematician), the mathematical formatting was one of the great perks.
- shellac 8y agoYou might be interested in the Fortress language (RIP), whose input allowed, and was canonical rendered using, mathematical notation. So, for example, xˆy could be written as x superscript y. SUM[i<-1:n, j<-1:p, prime j] a[i] xˆj was more elegant as a big sigma with the ranges at the bottom, etc. http://www.ccs.neu.edu/home/samth/fortress-spec.pdf http://www.ccs.neu.edu/home/samth/fortress-spec.pdf
- deleted 8y ago[deleted]
- lifthrasiir 8y agoOne of the best (or worst, depending on your preference) aspect of Fortress syntax was that it allows juxtaposition as a multiplication operator. Therefore `(n+1)/(n+2)(n+3)` is, as expected, same as `(n+1)/((n+2)*(n+3))`. The exact "reassociation" procedure for juxtapositions is type-dependent, so that `sin(x)(x)` is `sin(x)` multiplied by `(x)` even though both `sin` and the first `(x)` is followed by other expressions.
- jcelerier 8y agoreally ? it's much more painful for me
- grenoire 8y agoThis is actually the method used by MS Word as far as I know, or a reduced dialect of it. It's a mix of convenient and inconvenient, can't make my mind up about it. All I know is that LaTEX is much, much easier to manage than this jumbled mess...
- jcagalawan 8y agoIt's the same one as implemented in MS Word (and PowerPoint, OneNote), this standard was written by an engineer who is on the Math in Office team and maintains a blog [1]. It's the best WYSIWYG equation editor I've used so far. LaTeX has its place, but it's hard to convince non-coders to use it and I'm glad it has the editor. I stumbled into this specification trying to format a constrained optimization problem and found the equation array format to be fairly straightforward similar to the bmatrix environment in LaTeX and thought it was neat that Unicode could represent so much math. [1] https://blogs.msdn.microsoft.com/murrays/ https://blogs.msdn.microsoft.com/murrays/
- ygra 8y agoIt should also be noted that Murray Sargent didn't just do whatever he thought of. He has done at least one math layout engine before, consulted with Donald Knuth regarding TeX and some choices that were made back then and a lot of the differences between this and TeX have a fairly sensible reason. For me, I'm able to use both LaTeX and this, but the main points that make this more convenient to me is that it relies less on characters that are present in awkward locations in many keyboard layouts (such as {}) and the equivalent formula is often much shorter due to somewhat more advanced tokenizing (of course, specific to math input, as the format doesn't have the same constraints as a general-purpose programming and markup language), e.g. x^12 works for x to the power of 12 instead of resulting in x^1 2.
- robinhouston 8y agoThe author of this paper, Murray Sargent, has a blog at https://blogs.msdn.microsoft.com/murrays/ https://blogs.msdn.microsoft.com/murrays/
- enriquto 8y ago
- YeGoblynQueenne 8y agoWhat I would like is a set of characters and a font that I could use to enter immediately readable math formulae into my text editor, so that I can take quick notes at a conference, or whenever. I can already do it, to some extent, for instance, this is the summation equation from page 5 in the pdf above: ₙ ⎛n⎞ (a + b)ⁿ = ∑ ⎜ ⎟ aᵏbⁿ⁻ᵏ ᵏ⁼⁰ ⎝k⎠ But, the scale is off (the summation is too small) and the characters are a mix of sub- and super-scripts and modifiers (in other cases, diacriticals), and multiple characters in the case of the long parentheses. I have to go hunting each of those characters down every time I want to use them, because I'm never sure exactly what characters are available. And even when I do, I still have to look them up most of the time, because of course I can't remember the unicode number for Modifier Letter Small k off the top of my head every time I need it (although by now I've learned the ones for super/subscript i and n by heart, mostly) Worse, there is basically only one free monospaced font that will display all of those characters (DejaVu Sans Mono) and even that doesn't cover all the symbols I might want to use. For instance, I use the "entails" symbol a lot and that renders as a ⊨ in DejaVu Sans Mono, so I have to put it togehter with what I got: |= or \= for the negative. Each of the methods discussed in the pdf above (as far as I've read in it, which is not too far) are far from ideal. They're all markups, so they all require at least some mental rendering. Why can't I have a script that lets me write each special symbol as one character, or at worse, a few of them like for the large parens, above? ____________________ Edit: And you'll need to set your broswer's font to a monospaced font to see the equation above properly :/
- ygra 8y ago> They're all markups, so they all require at least some mental rendering. Unicode maintains the position that plain text is unsuitable for this sort of thing and markup languages are preferred. That's also why there are no "formatting" modifiers except in cases where the result actually has different semantics that are important to distinguish (cf. RTL and LTR override). Overall I'd say Unicode does a fairly good job keeping too weirdness out of the standard. Emoji are obviously a much-contended addition, albeit one that already had a history of existence and widespread use in plain-text. And while you find all symbols needed for math rendering in Unicode, some of the weirder ones sometimes came from older character encodings and their existence does not mean that full math markup should be part of Unicode.
- userbinator 8y agoI thought the format of the document looked familiar... and then saw "Microsoft Corporation". I've seen a lot of other documents from them with the same formatting, and it always feels a bit weird to me --- something looks a bit off about the (body) font.
- ygra 8y agoCambria. Personally I don't like it much, although I don't hate it as much as Computer Modern or Times. The main reason here is most likely that Cambria is also Microsoft's primary math typeface and having the body text and math use the same typeface is IMHO preferable. Constantia pairs fairly well with Cambria as well, though.
- cedex12 8y ago> I don't hate it as much as Computer Modern or Times. What (latex compatible) fonts do you like/recommend then? In my opinion, it's kind of sad to see how strongly Computer Modern dominates the font choices in latex (and more generally the latex monoculture).
- ygra 8y agoWell, this is personal preference and aesthetics, so I'm not sure others would have to follow. Palatino is nice, though and has a package where it's also the math font (mathpazo). That was as far as I got with fonts for plain old LaTeX. Otherwise I'm currently using XeLaTeX (if I use LaTeX at all), so I'm not limited to compatible fonts and anything that's OpenType works.
- rijoja 8y agoShameless plug I am working on something related. System with nice keybindings which feels sort of allright after 5-10 minutes. The idea is to combine an efficient onscreen structure with key presses typed by the left hand. So press q,w,e, etcetera to select. Currently I'm looking at MathML and Tex support, would anyone who uses Math daily be interested in UTF-8 support? My instinct tells me that this UTF solution seems like a nightmare. https://htmlpreview.github.io/?https://github.com/richard-jansson/roosevelt/blob/master/index.html https://htmlpreview.github.io/?https://github.com/richard-ja... https://github.com/richard-jansson/roosevelt/ https://github.com/richard-jansson/roosevelt/ It's possible to input into the os, leave a comment of you're interested.
- ygra 8y agoIf this is merely an input method then MathML is pretty much all you probably need as it can be pasted into or consumed by most applications handling math, including Word. Plus TeX for, well, TeX. This format is mostly geared towards input as well, in that you have defined automatic replacements as well as a format that can be typed easily and be built up to rendered math during typing. If you have your own completely different input method you wouldn't gain much from this.
- nerdponx 8y agoSome previous discussion here: https://news.ycombinator.com/item?id=14687936 https://news.ycombinator.com/item?id=14687936 (Full disclosure: it's my thread)
- occamrazor 8y ago2016? I’m fairly sure I read this (or something very similar) around 2012.