News for hackers. Stuff that matters.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by grenoire on Friday November 23, 2018 @03:47AM (#18515220)
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...

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by jcagalawan on Friday November 23, 2018 @04:37AM (#18515407)
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/

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by ygra on Friday November 23, 2018 @08:06AM (#18516150)
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.

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by robinhouston on Friday November 23, 2018 @04:37AM (#18515411)
The author of this paper, Murray Sargent, has a blog at https://blogs.msdn.microsoft.com/murrays/
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by enriquto on Friday November 23, 2018 @05:51AM (#18515693)
> All I know is that LaTEX is much, much easier to manage than this jumbled mess...

LaTeX is beautiful and powerful, but mixed with unicode (in the right doses) it becomes astonishingly more powerful. For example, you can keep the block constructors {} _ and ^, but use unicode symbols such as α, ∂, ∫, instead of \alpha, \partial, \int

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by guipsp on Friday November 23, 2018 @07:02AM (#18515930)
But you can't type α, ∂, or ∫ in a standard keyboard.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by joppy on Friday November 23, 2018 @08:49AM (#18516369)
I feel like this is the sweet spot for the editor to do some of the heavy lifting, for example being able to type "\alpha" and have the editor automatically transform it into the symbol α. I write a lot of LaTeX, and I would absolutely love an editor which could just transparently deal with all of the underlying mathematics markup so I would never have to see it again, and just directly edit the damn equations. Serialising and unserialising mathematics markup mentally is basically the antithesis of mathematical notation.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by quietbritishjim on Friday November 23, 2018 @09:31AM (#18516592)
In case you haven't already heard of it, LyX [1] does exactly that and it's phenominal. As an added bonus, when you move your cursor out of the equation it goes from a graphical almost-right visualisation to a proper LaTeX-generated absolutely-right preview, and manages other related LaTeX things like heading levels with a live clickable outline.

The big disadvantage to LyX is that it's not LaTeX editor but a LaTeX generator. So if you want to write your next article or dissertation and can commit to it then it's great, but if you want to import work so far or collaborate with someone not using LyX then it doesn't really work (it has an import function but it's almost unusable).

[1] http://www.lyx.org/

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by iguy on Friday November 23, 2018 @10:00AM (#18516758)
I've actually had good luck round-tripping lyx-latex-lyx repeatedly to collaborate with lyx-phobic co-authors. (As long as they don't mind equations they typed getting auto-formatted, etc.)
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by tokai on Friday November 23, 2018 @10:06AM (#18516793)
The julia interpreter does this. Or you have to press tab to do the transformation.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by mrmyers on Friday November 23, 2018 @05:29PM (#18519269)
Emacs already has you covered. Good old C-x RET C-\ TeX will switch your input method to TeX, converting \alpha etc to unicode alpha, etc for most math symbols. Additionally, ^[char] or _[char] will become superscript/subscript unicode chars.

Once you've done that once in the session, you can just hit C-\ to toggle it on and off (C-x RET C-\ [input method] actually lets you select from a wide variety of input methods, and C-\ toggles on and off the most recently selected input method).

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by gh02t on Friday November 23, 2018 @09:44AM (#18516662)
There are some editor plugins that do something like this. I know for Vim there is tex-conceal (https://github.com/KeitaNakamura/tex-conceal.vim), which collapses a lot of LaTeX symbols to their Unicode equivalent on lines other than your current line. It's a nice middle-ground, though far from perfect.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by namarkiv on Friday November 23, 2018 @11:59AM (#18517549)
I use LaTeX with unicode-math regularly and I use emacs with quail mode to do exactly this.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by gugagore on Friday November 23, 2018 @10:16AM (#18516854)
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by rbonvall on Friday November 23, 2018 @01:34PM (#18518113)
Vim digraph feature (ctrl-k) is very convenient for this. Digraphs are two-character mnemonics for symbols. They tend to be easy to remember and they are standardized in RFC 1345 [1].

Greek letters are always a latin letter followed by an asterisk. Arrows and comparison operators are what one would guess. Mathematical symbols generally make some sense:

    <C-k> a *     α
    <C-k> F *     Φ

    <C-k> = >     ⇒
    <C-k> - >     →
    <C-k> > =     ≥

    <C-k> 0 0     ∞
    <C-k> d P     ∂
    <C-k> I n     ∫
[1]: https://tools.ietf.org/html/rfc1345
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by enriquto on Friday November 23, 2018 @08:36AM (#18516293)
> But you can't type α, ∂, or ∫ in a standard keyboard.

I have a standard keyboard and I type greek letters easily. ALTGR+a, and so on.

If somebody is not able to configure their keyboard to do this they are not probably writing LaTeX, either.

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by zimpenfish on Friday November 23, 2018 @08:42AM (#18516337)
If memory serves me correctly, there was no way to type those symbols on an Acorn A5000 which is where I did the bulk of my LaTeXing back in the day (1992-95).

(Admittedly, this anecdata is even more useless than usual.)

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by Technetium_Hat on Saturday November 24, 2018 @12:46AM (#18520673)
Unfortunately ANSI (US layout) keyboards make this much more difficult.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by claudiawerner on Friday November 23, 2018 @08:52AM (#18516387)
In DrRacket, you can press Ctrl+\ to insert a lambda character.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by starbeast on Friday November 23, 2018 @09:00AM (#18516424)
Of course you can. Armed with only a text editor, a craft knife and some tippex, you can have any keyboard layout you like on a standard keyboard.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by iguy on Friday November 23, 2018 @09:57AM (#18516741)
On a recent mac, you can enable Greek as a second keyboard, and tick the box there to make caps lock switch keyboards.

As long as you don't need caps lock as your escape key...

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by knolan on Friday November 23, 2018 @07:22AM (#18515991)
You can on a Mac. Holding the option key allows typing a whole host of symbols.

https://beebom.com/how-type-hidden-mac-keyboard-symbols/

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by grenoire on Friday November 23, 2018 @07:32AM (#18516028)
This is like asking someone to use Alt codes (https://www.alt-codes.net/) on Windows, it's highly unintuitive and cumbersome.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by Jtsummers on Friday November 23, 2018 @08:11AM (#18516174)
They aren’t terribly intuitive, but they are much easier than alt-codes. If you’re a touch typist it doesn’t take long to memorize a reasonable number of symbol positions. I still can’t temember any alt-codes though when I’m on a windows machine.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by knolan on Friday November 23, 2018 @10:00AM (#18516763)
I know the few I use regularly and the rest are easy to get via ctrl CMD Space. I’ve added various symbol sets to the character viewer and it suits my work flow.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by guipsp on Friday November 23, 2018 @07:25AM (#18515999)
Right, and you can do the same on linux with the compose key. But it isn't very intuitive, discoverable or rememberable.
Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by slrz on Saturday November 24, 2018 @08:25PM (#18524882)
Badly discoverable? Sure. You can vastly improve the remembering part by picking appropriate mnemonics. The Plan 9 keyboard file is a nice start, I think.

It follows a set of rules so you don't have to remember a large number of sequences but can often guess the right one intuitively.

    ASCII digraphs for mathematical operators give the corresponding operator, e.g., <= yields ≤.
    Greek letters are given by an asterisk followed by a corresponding latin letter, e.g., *d yields δ.
https://github.com/9fans/plan9port/blob/master/lib/keyboard

https://9fans.github.io/plan9port/man/man7/keyboard.html

There's a program (mklatinkbd) to convert it to a format usable with X11.

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by enriquto on Friday November 23, 2018 @11:13AM (#18517253)
> you can do the same on linux with the compose key. But it isn't very intuitive, discoverable or rememberable.

Well, LaTeX itself is not very discoverable either

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by knolan on Friday November 23, 2018 @12:03PM (#18517578)
It’s pretty good IMHO. Greek symbols are all obvious. \Omega and \omega for upper and lowercase omega etc. Super and subscripts with ^{} and _{} also work with \sum and \int for indices and intervals.

Software like Latexit and Mathpix also help a lot.

Re:UnicodeMath – A Nearly Plain-Text Encoding of Mathematics... by adarsh_p on Friday November 23, 2018 @12:04PM (#18517583)
You can do so relatively easily with Vim digraphs. For example, the alpha symbol can be obtained by typing

Ctrl-k a Shift-8