News for hackers. Stuff that matters.
Re:AsciiMath – An easy-to-write markup language for mathematics by jwmerrill on Sunday March 26, 2017 @05:45PM (#13963488)
To everyone who says "why do we need this when we have LaTeX?" I ask the question "why do we need Markdown when we have HTML?"

The nice thing about Markdown is that it's quite legible in its source form, which makes it less distracting to edit. Same deal with AsciiMath and LaTeX: AsciiMath is more legible in its source form which means that it has lower overhead during editing.

One of these is more legible than the other:

  (f'(x^2+y^2)^2)/(g'(x^2+y^2)^2)
  \frac{f'\left(x^2+y^2\right)}{g'\left(x^2+y^2\right)^2}
In my experience, most people who learn LaTeX don't do so until sometime around the middle or end of their undergrad career (certainly in Physics--maybe mathematicians learn it sooner). Earlier than that, people struggle with junk like the Microsoft equation editor. No big deal?
Re:AsciiMath – An easy-to-write markup language for mathematics by baldfat on Monday March 27, 2017 @08:23AM (#13967066)
I would say that markdown for informal writing is fine and I like Markdown for many thing BUT if I need formatting LaTeX is a better tool. I have always waited for a new system but its hard to replace what works (With some cursing and banging on the desktop). Writing Math equations there is almost always a need for formatting within the document.

To me a math equation is just another plot. I love making quick plots but when it is my name on the document I want to be able to control every line and space.

I really like Scribble a Racket made document language is certainly the way to go but it will take a while to get broader usage. https://docs.racket-lang.org/scribble/

EDIT----

Math Library - http://docs.racket-lang.org/scribble-math/

What Scribble does really well is you write your document and it is a one line change to change the output. It can output to MathJax or LaTeX or Markdown or PDF etc....

Re:AsciiMath – An easy-to-write markup language for mathematics by Aardwolf on Monday March 27, 2017 @07:51AM (#13966876)
Not a fan of markdown myself at least for comment boxes. Everything that uses markdown as input (which seems to be hacker news comments too) ignores a single newline as a single newline, giving you different output than what you see in the box you type it in, which is very bad for intuitive web comment boxes.

Lots of people make that mistake, making a nice listing with newlines in between but them it becomes an ugly single line.

BBcode from forums in the past worked better for comments.

Re:AsciiMath – An easy-to-write markup language for mathematics by shthed on Monday March 27, 2017 @09:14AM (#13967403)
I don't understand why they mess with newlines, what's the reason?
Re:AsciiMath – An easy-to-write markup language for mathematics by Aardwolf on Monday March 27, 2017 @10:26AM (#13967957)
Somebody argued to me that it is to support editing like source code where you want a line length limit like 80 characters.

That is a very specific thing for source code editors. But bad for comment boxes. So I don't understand the popularity of markdown for comment boxes.

IMHO markdown should have done the opposite, make listening to all your newlines the default, and if you want to make it ignore a newline, end the line with a backslash or something like that.

Re:AsciiMath – An easy-to-write markup language for mathematics by paulddraper on Sunday March 26, 2017 @05:54PM (#13963518)
I like MS equation editor.

I think it does a pretty great job at being a WYSIWYG editor.

Re:AsciiMath – An easy-to-write markup language for mathematics by Lxr on Sunday March 26, 2017 @09:49PM (#13964542)
The typesetting of MS equation editor is awful though. The spacing, fonts, font sizing etc all look wrong to me. LaTeX just looks beautiful.

https://image.slidesharecdn.com/latexseminar-130324215215-ph...

Re:AsciiMath – An easy-to-write markup language for mathematics by ygra on Monday March 27, 2017 @02:23AM (#13965569)
TL;DR: Actual output on Word 2010: http://hypftier.de/temp/2017-03-27_090308.png

That output is from the ancient equation editor (MathType Lite, effectively). It used a user-defined font (usuallly Times New Roman), so had no idea about what and where to kern. Output from Word 2007 onwards is significantly better as since then math typesetting is native to Word instead of an OLE object from another application. Also they have their own font (which I find okay for math but ugly for body text), which uses an OpenType table to define math-relevant spacing and kerning factors.

The syntax is something between ASCIImath and LaTeX and IMHO quite readable and way more writable than the latter. The syntax is also described in a Unicode Technical Note (http://unicode.org/notes/tn28/), so there's no reason it couldn't be used elsewhere, either.

What has been typed in Word (mostly; as it included cursor movement to get out of inner expressions again; thus can't be pasted right now):

    \iiint_G [u\nabla^2 v+(\nabla u,\nabla v)]\dd^3 V =\oiint_S (u \partial v/\partial n +v \partial u/\partial n)\dd^2 A
This results in this monstrosity when converted back to linear format (which can be pasted):

    ∭_G〖[u∇^2 v+(∇u,∇v)] ⅆ^3 V〗=∯_S〖(u ∂v/∂n+v ∂u/∂n) ⅆ^2 A〗
Although the following still works just as well (spacing can eliminate the explicit \begin and \end brackets):

    ∭_G[u∇^2 v+(∇u,∇v)] ⅆ^3 V =∯_S(u ∂v/∂n+v ∂u/∂n) ⅆ^2 A
It just seems to me that many people still decrying the old equation editor haven't used or seen Word in a decade. There was a time when publishers still enforced MathType since that's what their Word publishing toolchains were built around for math for over a decade, but I think that has passed by now as well.
Re:AsciiMath – An easy-to-write markup language for mathematics by adrianratnapala on Sunday March 26, 2017 @06:21PM (#13963665)
I used to think it was about as good as could be expected for a graphical editor (which meant it was rubbish). And then I found LyX which was infinitely better. That was years ago and MS might have caught up by now.

And yet, despite how much I like LyX, I keep using real LaTeX instead -- especially when there is complex maths. That's because the ability to create macros in maths eventually outweighs everything else readability-wise.

And I'm afraid the same logic applies to AsciiMath. Is there some equivalent to

    \newcommand[1]{vr}{\mathbf{r_#1}}
Or am I just going to have to use somethng `bb"r"_1` for every instance? That's a lot less readable than `\vr1`.
Re:AsciiMath – An easy-to-write markup language for mathematics by acrefoot on Sunday March 26, 2017 @07:44PM (#13964067)
I find TeXmac's equation editor to be an even faster WYSIWIG UI than LyX's.

For example, a λ is just 'l'+tab.

Simarly, you can cycle through other symbols. For b: b->β->

Sadly, TeXmacs hasn't gotten as much love as it deserves: I find it way better than jupyter at producing notebooks/papers that involve math, interactive code, and prose.

Re:AsciiMath – An easy-to-write markup language for mathematics by jessaustin on Monday March 27, 2017 @04:33PM (#13971498)
TeXmacs hasn't gotten as much love as it deserves...

Ouch, no Ubuntu package since Vivid? The screenshots look OK... is this worth building from source?

Re:AsciiMath – An easy-to-write markup language for mathematics by mhei on Monday March 27, 2017 @03:54AM (#13965879)
LyX actually has support for math macros, or is that support just not ergonomic for you? Not certain what the best way would be to support macros in a graphical math editor.
Re:AsciiMath – An easy-to-write markup language for mathematics by adrianratnapala on Monday March 27, 2017 @06:32AM (#13966476)
Never noticed them.

I mean you can always use evil-red-text. But then what is the point LyX?

Re:AsciiMath – An easy-to-write markup language for mathematics by iandioch on Sunday March 26, 2017 @07:11PM (#13963903)
My father opted to write his maths textbook with MS equation editor. There's always a strong need for tools that aren't just for the technically minded (or HN-reading) audience.
Re:AsciiMath – An easy-to-write markup language for mathematics by jwmerrill on Sunday March 26, 2017 @07:48PM (#13964088)
I wonder if it's gotten better since 2002-2004, which is when I used it a lot.

I'd be curious to hear what you think about the equation editor in Desmos[1] (full disclosure, my employer).

We use an open source WYSIWYG typesetting library called MathQuill[2]. The keystrokes you use are very similar to AsciiMath, but the result is direct editing of the typeset math. E.g. you type '_' to move into a subscript, '^' to move into a superscript, '/' to create a fraction, 'sqrt' to create a radical, etc.

I believe that I can edit much faster with this interface than with Microsoft Equation Editor, and that it's approximately similar difficulty to learn. But I'm biased.

[1] https://www.desmos.com/calculator

[2] http://mathquill.com/

Re:AsciiMath – An easy-to-write markup language for mathematics by gjjrfcbugxbhf on Monday March 27, 2017 @01:52AM (#13965456)
> I wonder if it's gotten better since 2002-2004, which is when I used it a lot.

MS equation editor? It's got so much better! The version released when office 2007 came out allows a latex like syntax when writing equations. - still don't use it myself because that would require using ms office which was still broken in other ways when i last used it (2010).

Re:AsciiMath – An easy-to-write markup language for mathematics by joatmon-snoo on Sunday March 26, 2017 @08:08PM (#13964169)
Desmos is decent IME (am an u/g, so I've used it occasionally); I don't think I ever had serious issues with typesetting (backspacing between sub and superscripts is occasionally awkward, iirc), but navigating the site and using advanced features was always troublesome. I had to fallback to Googling for a specific Desmos calculator a lot.
Re:AsciiMath – An easy-to-write markup language for mathematics by paulddraper on Sunday March 26, 2017 @11:12PM (#13964864)
I've used mathquill. Thanks so so much for open-sourcing it.

I think I remember MS being better in some edge cases. OTOH, I haven't used it in so long maybe that speaks for itself.

Re:AsciiMath – An easy-to-write markup language for mathematics by jwmerrill on Sunday March 26, 2017 @11:54PM (#13965076)
It was open source before we started using it, but we're friends with the creators, so I can pass on the compliment.
Re:AsciiMath – An easy-to-write markup language for mathematics by wenqin123 on Sunday March 26, 2017 @08:32PM (#13964264)
Actually it's funny you say that your employer is Desmos. My friends and I use Desmos for all of our graphing assignments and let's say that it has saved us a lot of trouble!
Re:AsciiMath – An easy-to-write markup language for mathematics by rtkwe on Sunday March 26, 2017 @11:12PM (#13964861)
I tried using MS equation editor when we were supposed to type our proofs in undergrad. Without fail it would crash or start to lag horribly half way through. It seemed to be tied to the number of equations in a document. That's what finally pushed me into learning LaTeX.
Re:AsciiMath – An easy-to-write markup language for mathematics by LeanderK on Monday March 27, 2017 @02:27PM (#13970350)
i am studying CS an we had to use it (not learn it ;) ) in the 3rd semester to hand in reports in their special format. I first thought this is stupid, but later when i needed it (my math proseminar, CS proseminar then now (or next semester) my bachelor-thesis), i could already do simple things. So in hindsight it was a good move from my university.

But i was always a bit disappointed, because i had to try hard to keep my source readable. LATEX really clutters your enumerations, equations etc with way to much syntax. I always thought about writing a simple Markdown-with special math mode (similar to AsciiMath)-to-LATEX compiler.

Re:AsciiMath – An easy-to-write markup language for mathematics by psychometry on Monday March 27, 2017 @01:09PM (#13969573)
If you were to remove your \left and \right commands, which are unnecessary in the example, there would be very little difference in legibility between the two examples.
Re:AsciiMath – An easy-to-write markup language for mathematics by ygra on Wednesday March 29, 2017 @10:05AM (#13986294)
Since there are superscripts in the parentheses they would appear at a different height, wouldn't they?