
UnicodeMath – A Nearly Plain-Text Encoding of Mathematics (2016) [pdf] - jcagalawan
https://www.unicode.org/notes/tn28/UTN28-PlainTextMath-v3.1.pdf
======
grenoire
This 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
It'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
It 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.

------
YeGoblynQueenne
What 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
> 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.

~~~
mrmyers
Eh, I do still wish super/subscript characters in unicode were a bit more
thorough. Several times a day I randomly remember the fact that every
lowercase letter in the English alphabet except q has a unicode superscript
character, and every single time it ruins my day.

~~~
YeGoblynQueenne
My problem is still with the fonts- I can't find one that even has all of
(i,j,k,x,y,m,n,p,q,r) as both super- and sub-scripts. I end up either using
capitals or just sucking it up and writing X_i^r or something.

------
rijoja
Shameless 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-
ja...](https://htmlpreview.github.io/?https://github.com/richard-
jansson/roosevelt/blob/master/index.html)

[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
If 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.

------
userbinator
I 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
Cambria. 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
> 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
Well, 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.

------
nerdponx
Some previous discussion here:
[https://news.ycombinator.com/item?id=14687936](https://news.ycombinator.com/item?id=14687936)

(Full disclosure: it's my thread)

------
thrwia22
dat c++ function on page 36 tho.. omg

~~~
enriquto
It is much more readable than the version using full-length words for
variables.

~~~
thrwia22
i totally agree, but living in the world of mostly ascii-limited code this
looks exotic, weird and refreshing. and cool

~~~
enriquto
> 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
> 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
> 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
I suppose you have the same problem when reading this comment too.

~~~
enriquto
no, I do not mistake regular text with mathematical formulas. My problem is
that I read code as if it was mathematical formulas.

------
occamrazor
2016? I’m fairly sure I read this (or something very similar) around 2012.

