9 ms·
Blargh. It annoys me that MathML was even a thing. We've already had a perfectly-fine and widely-used markup language for mathematical formulae; it's called T
by CaliforniaKarl 11y ago
Blargh. It annoys me that MathML was even a thing. We've already had a perfectly-fine and widely-used markup language for mathematical formulae; it's called TeX.
Ideally, I'd prefer that HTML5 include a <math> tag, or something similar, that takes TeX as input and produces formatted output. A side benefit would mean that every browser, and every system, in the world would have TeX installed!
At least MathJax can take TeX as input.
- spicyj 11y agoTeX is analogous to Presentation MathML but doesn't solve the accessibility concerns because the semantic intent of the TeX source isn't always clear. (How do you read a \phantom{}? Or how can you know that "\left( 7 \atop 3 \right)" should be read as "7 choose 3"?)
- asdfaoeu 11y agoThe same way a sighted person does?
- spicyj 11y agoYes, you could try to build algorithms that turn that markup into semantic meaning but now we're almost talking about computer vision. I don't think a solution like that is likely to ever work reliably, and it's better to encode the semantic meaning so that it doesn't need to be re-derived.
- evincarofautumn 11y agoI think they meant that a person needs to interpret “two numbers arranged vertically between parentheses” according to context, regardless of whether they’re sighted. Having more semantic information in that scenario would help the sighted just as much as the visually impaired—imagine hovering over an unfamiliar notation with your mouse and seeing it explained.
- laughinghan 11y agoThe other reply made the same point I'm about to make, but I think it's worth clarifying. Specifically, just like a sighted person has to determine from context whether "a(b)" is function application or variable multiplication, a blind person can be asked to determine from context whether "a left-parenthesis b right-parenthesis" is function application or variable multiplication. No AI or CV is required for such a reading algorithm. It's unfortunate that this reading algorithm doesn't quite match what two mathematicians would say if they were conversing with each other, but there's at least one good reason to believe this is still a useful reading algorithm: it's exactly the system used by blind mathematician Abraham Nemeth with his readers, called "mathspeak": The speech generated by this protocol is not exactly what a professor in class would use, but it is absolutely unambiguous and results in a perfect Nemeth Code transcription. It avoids largely unsuccessful attempts by a reader to describe the notation he sees, accompanied by the shouting and gesturing that such attempts at description engender. http://www.nfbcal.org/s_e/list/0033.html http://www.nfbcal.org/s_e/list/0033.html (Nemeth notably created the Nemeth Braille Code for Mathematics, which is part of Unified English Braille and is probably the most widely used Braille code for math. MathSpeak hasn't enjoyed the same level of adoption, but only because there's no standard, MathPlayer, VoiceOver etc all have their own ad hoc rules for how to read math.) (Strictly speaking the example I gave was a verbose variant of the system described in the email: http://www.gh-mathspeak.com/examples/NemethBook/?rule=18 http://www.gh-mathspeak.com/examples/NemethBook/?rule=18 ) [2]:
- spicyj 11y agoThat's interesting, thanks for the references. I wonder if this is applicable to screen readers as well as Braille?
- laughinghan 11y agoOh, I was talking about screen readers the whole time, except for an aside that the speech rules system I was discussing was created by Nemeth who is known for his Braille system. Other than that though, I wasn't talking about Braille at all.
- ubernostrum 11y agoI'd imagine any real solution would actually be akin to ruby markup, with the author of the content needing to supply it since there will be cases where it simply cannot be usefully deduced by a browser.
- majewsky 11y agoThe problem is that mathematical notations can vary from topic to topic, from university to university, even from office to office inside a university department, even within the same lecture of a single professor. (Been there: "Notation will be different in this chapter since I've copied it from another author's paper.")
- deleted 11y ago[deleted]
- leereeves 11y agoTeX has "{n \choose k}". (Replaced by "\binom{n}{k}" in LaTeX with amsmath.)
- JadeNB 11y agoThe fact that semantic commands are available in TeX doesn't change the fact that it is, unabashedly, a display rather than a semantic language. Knuth's goal was to create a language to facilitate beautiful typography, rather than one directly for expressing mathematical meaning.
- leereeves 11y agoHence amsmath.
- Smaug123 11y agoYou should define your own commands and then use them, in preference to directly using markup. For example, at the start of my essay on non-standard analysis, I define some commands: - "\near" as a synonym for "\simeq" - \newcommand{\hyp}[1][\mathbb{R}]{\prescript{*}{}{#1}} - \newcommand{\powerset}{\mathcal{P}} This way you can change the notation easily and all-at-once if you need to, as well as making the semantics clear to the source-reader.
- ga6840 11y agoI think we do not need semantic representation in HTML case at all. For example, f(x+1) can be a multiplication, or a function, but should we write something like \function f (x+1) ? I think knowing the layout similarity with query is enough for math-ware search engine to identify similar math expressions. Adding too much in Math HTML standard is not helpful but redundant.
- spicyj 11y agoFor sighted users it may be possible to differentiate, but whether "f of x plus 1" or "f times x plus 1" is read aloud is a significant difference.
- ga6840 11y agoWhat I really want to say is whether f(x+1) is function or multiplication does not matter that much in terms of both browser presenting and math-aware search, moreover, extracting semantics can be done by algorithm from context. Considering that few author want to annotate on their expression semantic, and adding semantic does not really help math-aware search, I argue for the necessity for bringing math semantic notation into WEB.
- Tomte 11y agoThere is no "math subset" of TeX. You would have to define it. Or include a full TeX engine including macro capabilities into web browsers.
- IshKebab 11y agoIt wouldn't be that hard to define a "maths subset". The fact that there are javascript LaTeX equation renderers clearly means other people have done it. Here's an example: https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX You just need to standardise it. There's no need to include all of LaTeX in a standard that is just for rendering equations.
- therealmarv 11y agoyou cannot compute TeX... there are two versions of MathML: presentation MathML (which is like TeX) which shows only the look. And there is content MathML which describes semantic. So you are comparing only one side of the medal with TeX ;) See here https://en.wikipedia.org/wiki/MathML#Content_MathML https://en.wikipedia.org/wiki/MathML#Content_MathML But I agree TeX is easier to write and read if you only care about the look and feel.
- pcwalton 11y ago> A side benefit would mean that every browser, and every system, in the world would have TeX installed! TeX doesn't have dynamic reflow, is defined by a macro system that involves essentially monkey patching the parser as it goes, lacks anything resembling a DOM, wasn't designed with Unicode or internationalization in mind, is completely unparallelizable, doesn't interoperate with CSS, has its own concept of block and inline layout that doesn't allow for text wrapping around floats without hacks, requires multiple passes to compute various things like tables of contents, and wasn't designed for interactive-level performance. Something syntactically like TeX may well be the solution, but jamming TeX itself into the Web platform wouldn't end well.
- IshKebab 11y agoAll good points, it would be insane to include a full TeX engine in the browser. But for just rendering equations, I don't think you can beat TeX for ease of use. And most of the criticisms then don't apply - you can void the insane macro system, it doesn't require multiple passes, etc. I guess lack of CSS support could still be an issue.
- stshine 11y agoThanks, now I know I don't need to spend time to study the layout system of TeX.
- avian 11y agoConsidering amount of expertise that went into making TeX and the fact that (in my experience at least) it far surpasses other solutions, it might simply be that mathematical notation typesetting doesn't lend itself to dynamic reflow, internationalization, parallelization, DOM representation, interoperability with CSS and its concept of blocks and inline layouts, wrapping around floats, single pass processing and interactive-level performance.
- hansen 11y agoThis is about how I feel. Can someone who’s actually competent explain why (La)TeX output looks so much better than what web browsers do? I’m not talking about childish colors, sticky headers, and all the other annoying “modern web features”, just the relevant content: some text and inline images.
- elcapitan 11y ago> A side benefit would mean that every browser, and every system, in the world would have TeX installed! Is to run that giant heap of probably not sandboxed or security-audited code in every client actually a thing I would want to have? I mean people are paranoid about js doing unwanted things, but a large distribution of tex code running inside the browser, really?
- IshKebab 11y agoYou can already render LaTeX equations with javascript. It would be madness to include everything but a safe subset of commands that are commonly used to render maths would be fine.
- deleted 11y ago[deleted]
- pjc50 11y agoTeX's bug bounty and the credentials of its author are good reasons why it's probably one of the most reliable pieces of such code that you might have.
- dspillett 11y ago> widely-used markup language for mathematical formulae; it's called TeX. For display yes, though it is far larger in scope than that and I wouldn't want to teach someone TeX just for a few formulas, and it is geared for display and not manipulation. MathML was intended to be just for math type markup so is more concise in that respect, and IIRC was intended to allow automated manipulation in an easy manner (I wouldn't want to do it by hand due to the verbosity of it all, but understanding and manipulating the structure in code must be easier than trying to interpret TeX).
- 1ris 11y agoTeX is not a markup-language. It's a (actually two) turing-complete, proprietary (not defined by anything than it's implementation) programming language. Having a context-free representation is IMHO a necessity for processing untrusted inputs (e.g. webpages). It also makes it a way faster.
- StreamBright 11y agoI don't think that proprietary applies here. proprietary adjective 1. relating to an owner or ownership. 2.(of a product) marketed under and protected by a registered trade name. None of the above is true to TeX. What am I missing?
- 1ris 11y agoIn a more liberal sense the opposite of "open standard".
- StreamBright 11y agoWhy not use closed standard than, it is not ambiguous and exactly expresses what you would like to convey. Thanks for clarifying though.
- JadeNB 11y agoI don't think that it's a closed standard either. Rather, like Perl 5, it seems to be a non-standardised, or, perhaps less pejoratively, implementation-defined language. On the other hand, somewhat like Perl, it is also a language intended from its beginning to be extended. Knuth has said that he never expected things like LaTeX to be built on top of TeX; he rather thought that people would hack directly on the TeX source as necessary.
- ealloc 11y agoI wouldn't describe TeX as a "standard", but it's pretty hard to argue that it's "closed": TeX is arguably the best documented program in history! Knuth wrote it using his novel "literate programming" technique in which the source code is embedded in the documentation. Every 4-5 lines of source code has roughly a paragraph of explanation. That source/documentation is published for anyone to read as Knuth's "TeX: The Program" book, accompanied by his "TeXBook", a couple hundred pages each. That documentation has definitely encouraged all the people reimplementing the TeX layout algorithms, for example MathJax and matplotlib for math layout, as well as a number of alternative tex implementations.
- hughw 11y agoYou could put TeX code in a script tag <script type="application/x-tex"> ...TeX code... </script> and process it using a javascript TeX-to-DOM processor... seems likely somebody, somewhere, has done that? Update: I just read the rest of the comments and discovered KaTeX.
- spankalee 11y agoI made a set of essentially <math> web components that render with KaTeX: https://github.com/justinfagnani/katex-elements https://github.com/justinfagnani/katex-elements You use them like so: <katex-inline>c = \pm\sqrt{a^2 + b^2}</katex-inline>
- spot 11y agowe also use katex in beaker and it's great. very fast, not as complete as mathjax (also good and we used to use it). https://github.com/twosigma/beaker-notebook https://github.com/twosigma/beaker-notebook