Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nope, because plain-text is incompatible with centuries of mathematical notation.


This.

My wife is a math teacher, and the piss-poor experience of writing mathematical notation outside of MS Word keeps them stuck on Word. As much as she and I love LaTeX's math notation, she can't get her departmentmates onboard with that kind of syntax.

They need to maintain notes, guides, tests, quizzes, etc. and basically running a team OneDrive is really the only option because all the alternatives utterly fail a group of non-technical mathies.


Fun fact!

Microsoft Office has two internal math formats, one of them is Ecma Math[0], the other the other is the "Unicode Nearly Plain-Text Encoding of Mathematics"[1], it is a Unicode standard and uses only Unicode standard characters. It has the unfortunate property of being hard to type on its own (the integral character isn't on most people's keyboards), but it is pretty easy to read as just plain text. If you copy an equation out of Word you'll get something like this: ∫(x^2/2)

[0] https://blogs.msdn.microsoft.com/murrays/2006/10/06/mathml-a...

[1] http://unicode.org/notes/tn28/UTN28-PlainTextMath-v3.pdf

Disclaimer: I work @Microsoft improving on some math features, and we are the main implementors of the spec. Which makes me sad, since it is an open spec and it is really powerful!


Funny that it's not ∫(x²/2), though!

OK, I went and looked at the standard and it seems like they're thought about this: they allow input as either ∫(x²/2) or ∫(x^2/2) but they apparently output as ∫(x^2/2) because it's more general and editable, like if you wanted to change the exponent to something that didn't have a predefined Unicode superscript.


I like that, except I prefer "un-necessary" parenthesis to be explicit about the ordering of operations.

Thus assume only + - and * / are unambiguous, everything else be explicit about ordering.

EG: ∫((x^2)/2)


It's alright, somebody has to do it first. Though you shouldn't be surprised that a specification written by an employee at Microsoft is still primarily implemented at Microsoft.

Maybe it could be integrated into the Unicode shaper (HarfBuzz/Uniscribe/AAT) with a language code for "maths".


Since you're here, is something like that relatively easy to use in a UWP application? I have an idea for a chemistry app and am looking for a good way to show formulas.


> Since you're here, is something like that relatively easy to use in a UWP application? I have an idea for a chemistry app and am looking for a good way to show formulas.

Unfortunately not! I am wondering if I should make requests to the Windows team internally, the Managed wrapper class they ship has the math features compiled out. :( I'm in Office, where we use an internal UWP safe C++ version of Rich Edit. We bundle it with our AppX and load it up like any other C++ DLL.


So in other words I shouldn't hold my breath for this to appear on NuGet. That's a shame. It seems like it would play nicely with MarkDown.


I fired off an email to the team responsible. :)

Please post over on https://wpdev.uservoice.com/ and get others to upvote! If internal and external asks line up, it becomes much easier to argue in favor of doing a feature.


Ugh ugh ugh no.

Storytime. A couple years ago, I was in the midst of copyedits on a book with a bunch of math in it. The copyeditors were using a different version of Word.

When they sent the edits back to me, the math was gone. Completely.

Not only that, but when I tried to copy-paste the math in from a prior draft, the Word file refused to save.

Eventually, I had to reconstruct every one of the damn things, by hand.

(Happy consequence: I caught and corrected an error doing so. But still!)

That would never happen in a plain text format. And this was the experience that made me abandon word processors for good.


"What You See Is Not What Others Get"


Well, one advantage of OneDrive is you have full history.


Then try AsciiMath[0]. It does a fine job of representing math as plain-text, and I find it far more sane than LaTeX for my typical use cases.

LaTeX:

    \begin{bmatrix}
        0 & 1 \\
        1 & 0 \\
    \end{bmatrix}
AsciiMath:

    [[0,1], [1,0]]
[0]: http://asciimath.org/


Neat! I wonder if asciimath could be extended to an "intermediate form". Just like how there are two forms of MarkDown, there's the easy to type

    # this is a header
and the more elaborate

    this is a header
    ================
which conveys more "headerness" and is more readable than the first.

the same could be done with something like ASCIIMath, where a plain-Unicode representation could be an intermediate form between ASCII and MathML. Why? Because keyboards don't type in Unicode, but you don't want to be storing only the final output - storing an intermediate Unicode form seems best, assuming you can keep modifyign it using ASCII and then going ASCII + Unicode => Unicode.


Try Lyx. It's a front-end for LaTeX. It's UI for math notation is very similar to MS Word's. (IIRC - I used them about a decade apart.)


Something Overleaf [1] might help -- it's an online collaborative LaTeX editor with a rich text mode [2] to help make it easier for non-LaTeX users to collaborate on LaTeX docs. If you do use it, feedback would be appreciated -- I'm one of the founders :)

We also published a short post on 'the stoic resilience of the PDF within the digital ecosystem' recently [3], which seems relevant...although it's just a short background piece.

[1] https://www.overleaf.com

[2] https://www.overleaf.com/blog/81

[3] https://www.overleaf.com/blog/509


> piss-poor experience of writing mathematical notation outside of MS Word

Mind blown. I only write a little math, and I can't imagine my first choice not being MathJax/LaTex in a plain text file.


I use Microsoft OneNote to take notes. The math notation is almost exactly the same as in LaTeX and you basically compile it on the fly with the spacebar. <ctrl>+'=' toggles math mode on and off from the Mac. There are some hiccups, especially with OneNote keeping track of fonts (in my experience) but you get used to them.


This is mostly a social problem, not technical. It's a shame, as MS Word has at best mediocre support for typesetting mathematics.


TeX users would like a word. Of course, that requires learning TeX notation for those reading it without an interpreter.


TeX is a joke.

I mean, it's not a joke for its intended purpose; that's fine. It typesets the #$@! out of documents. But TeX is a joke for mathematical notation in particular. Put another way: the best way to understand what an arbitrary mathematical expression in LaTeX really means, is to render it as an image and read that image. TeX can be understood best as a concise way of writing a certain class of vector images, and when you are reading TeX you are reading a computer program which generates an image.

I'm not saying it can't be used for this context, of course it can, I have used it a ton and found it quite enjoyable. The fact that it's an image-based representation makes it very easy to switch from `\int_A dx~\int_B dy~f(x,y)` to `\iint_{A\times B} dx~dy~f(x,y).` However let's not mistake the fact that TeX does not know and does not want to know how you are using the `\int` and `\iint` symbols, is 100% OK with omitting those `~` characters, and has no semantic conception of what `dx` and `dy` are. If TeX were the CAS that it doesn't claim to be, as far as it's concerned that expression could be canonically refactored to `\iint d^2fxy(x,y),` since no one wrapped the `dx` and `dy` in curly braces. TeX claims to be a typesetting and layout system, and it does that well; it's not trying to be a universal mathematical notation.

The contention of the original link posted is, all of these image-based formats like PDF and lecture videos are going away. This may or may not be true, but if it is true then TeX is not going to survive the death of images, precisely because it is a programming language for a class of images.

Maybe something else will survive. The biggest player right now is the Wolfram language, of course, but that can look terribly unwieldy too.


Very well said. I only use TeX over Word for writing math because emacs 1. makes writing it easy with macros and helper functions, and 2. is able to display the rendered visual snippets inline in the text. If I could not have the second feature, TeX would be borderline unusable, and this dependence on editors and tooling means it's not truly open. Can't envision what could be better for mathematical notation in plain text, though.


I've been using LaTeX for about 5 years now. I don't recommend picking up TeX notation for reading maths in plaintext. It's the nicest way to produce nice looking mathematics PDFs or MathJax, if you have a powerful text editor. And after a while, you learn things like "underscore is for subscript" and "^ is for superscript".

But the point is, mathematics written as a plaintext document needs an interpreter, unless you have been writing papers with math notation for some years. But it is still far more cumbersome (and looks ugly) than writing formulas by hand. And that's not exactly plaintext learning material anymore, then, even though the sources are text files (unlike Word documents).

My ideal workflow (the one I dream about) would be a document camera -like setup that parses math I write on a paper (or a blackboard) into LaTeX (or MathML) style format and ~immediately renders it as beautiful document (with MathJax or similar tool). Like Overleaf, but without typing. (And of course then I could open the source file in text editor to make edits.)


Not sure if you are aware of detexify [0], but it recognizes my trackpad-scratch quite well. The backend and all of the training data are open source, so you could indeed implement this yourself if you wanted.

I'd buy mobile app any LaTeX OCR software.

[0] http://detexify.kirelabs.org


Yes, detexify is amazing! That's probablly how I got the idea in the first place... "Imagine if detexify would automatically read all of my math writing, not symbol by symbol what I draw with mouse."


TeX is completely avoidable. I have never used it apart from at university decades ago, before I learned Word. I have done proper science jobs where papers get written but still not needed TeX. Furthermore, in all my years surfing the internet, I have never downloaded a TeX file willingly or unwittingly.


It varies by field. Try publishing in Math, CS, or Physics without using TeX.


Yeah, go teach a 60-year-old math teacher to use TeX.


I'm over 60 and have been using TeX since '85. Same manual after all these years... I still seem to be able to learn new stuff, though it's not always clear it's worth the bother.


So I'm guessing you were 28-38 when you learned TeX, rather than 60+.

If you were over 60 in 1985 and are still posting to HN, that would be really cool.


Indeed, I was 30 and my brain was still plastic. Really, the only notable thing from my post was the fact I'm still using the same Latex manual after all these years. Kinda ragged now, but still useful.


I will be 60 in a few months. I am a math[s] teacher. I have been using TeX since late 80s/early 90s when I started using small computers.


why would someone with 40+ years of math experience have such a hard time learning a new notation?


I don't think their assertion is that someone with 40+ years of math experience would have difficulty learning new notation, it's that LaTeX is composed of a lot more than straightfoward notation. LaTeX can get pretty complicated pretty quickly. While it's basic math notation is quite fantastic, it's the basic document formatting that I think would give most people trouble when learning.


Because the error messages from latex are truly awful, even just putting an underscore or less than in plain text is painful.


Assuming they have something that already works for them, lack of motivation.


Because knowledge about maths is independent of computer and programming literacy.


if we use a liberal definition of "computer and programming literacy", then it's just as much a requisite for math as it is TeX.

if we use a conservative definition of "computer and programming literacy", then it's not a requisite for either.

markup languages are not programming languages. most people have some familiarity with some markup language.


The 60 year old math professors at my faculty read and wrote LaTeX perfectly fine. One time I helped find errors in the manuscript of a book one of my professors wrote in LaTeX by himself. He was 79 years old at that time


Actually, the standardization of most symbols from mathematics and logics that we use today happened in the 20th and late 19th centuries. In my opinion, with UTF-8 one can represent most formulas in a very readable way, and also many diagrams. But if more expressive power is required, plain text TeX is available.


If you distribute things in Markdown with (e.g.) MathML markup, then the reader can format that nicely for display, with PlainText / Markdown being the distribution format.


I think it really stretches the definition of "plain text" by the time you need a parser.


I don't think it does, as I thought the title refered to the ubiquitous "view source" web tech compared to binary blobs.


Unicode has some symbols. But there is limited ability to arrange them freely. e.g: representing a continued fraction in plain text seems a very futile exercise.


The "Unicode Nearly Plain-Text Encoding of Mathematics" standard[0] can do this just fine. :)

a_0+1/(a_1+1/(a_2+1/(⋱+(1/a_n ) )))

Past that into an editor that accepts the spec, and you'll get something like http://imgur.com/a/7hBwv

Disclaimer: I work @Microsoft improving on some math features, and we are the main implementors of the spec. Which makes me sad, since it is an open spec and it is really powerful!

[0]http://unicode.org/notes/tn28/UTN28-PlainTextMath-v3.pdf


PDF and OOXML are also open specifications.

Try to implement them though, you will run into a lot of issues.


I'm curious about that one - was the space necessary?


I just tried it out in Word, apparently it isn't. :)


Subscript and superscript are the bigger problem than fractions, also larger-than-one-line parentheses. Fractions can be aped in the ugly approach of dashes just like how Markdown underlines headers.


Matricial data is quite hard to explain well in a non-graphical mode, though.


To be honest, human math notations is a weak type system combined with confusing single letter variables.

Some kind of plain text math notation using numpy expressions would be cool.


The single letter variables are opposite of confusing: they bring simplicity and clarity. This is not programming, where if an integer represents a destination address, you can meaningfully call the variable destination_address (or destinationAddress or dest_addr or whatever). In math, an integer is often just any integer, and rewriting formulas to replace "i" with "any_integer" will not make them any clearer.

If math notation is unclear to you, it's only because you spent little time learning and using it. Mathematicians care about clarity even more then you, as they actually do indeed spend large parts of their lives reading and writing math. They are very quick to adopt new notation, if it brings meaningful benefits over the old one -- for example, the commutative diagrams and category theory language is now commonplace in all fields of algebra and topology, because it is much easier to draw a diagram and claim it commutes rather than name all the maps involved and write down all the equalities.


markdown (pandoc compatible) + mathjax mathematical notations within dollar sign is future proof. Easily convertible to html/pdf etc, easily readable in raw.


Then, mathematical notation should be simplified.


Perhaps we should also all learn Esperanto as well, since English is such an inefficient and inconsistent means of communication.


There's been some work on english language versions of mathematical expressions, which at the very least can help with accessibility.

Handbook for Spoken Mathematics (1983) http://web.efzg.hr/dok/MAT/vkojic/Larrys_speakeasy.pdf

MathPlayer https://www.dessci.com/en/products/mathplayer/

TalkMaths http://talkmaths.sourceforge.net/

Language and Mathematics: Bridging between Natural Language and Mathematical Language in Solving Problems in Mathematics http://file.scirp.org/pdf/CE20100300008_45591409.pdf


I am not sure that is a good idea. The reduced entropy of our writing system, as easy to learn as it is, doesn't work very well with the density of mathematical formulas. If anything, I would favour more symbolic formulas.



Have you tried? You start to run into trouble the moment you have fractions and exponents.


There are plain text versions for that as well.


Not sure it's so simple. Is LaTeX plain text? Officially it is, but by the same standard so is PostScript or PDF.

Truly the limits are blurry. Even assembly code has an ASCII representation.


Well, plain LaTeX is quite readable, so IMO, it's good enough of a compromise. It does get difficult with a lot of parentheses though.


Which example did you have in mind?


http://asciimath.org/ is the best one I've seen, by far.


AsciiDoc with inline LaTeX?


Use FORTRAN.


You need be a little more detailed with this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: