Live data from Hacker News

Towards LaTeX in the Browser

hackernoon.com

51–60 of 68 posts

Re: Towards LaTeX in the Browser

#51

Earlier quoted context omitted.

Classic TeX would be damn near useless in the age of Unicode, so you're looking at something like XeLaTeX or LUATex. The problem is that it's really easy to implement a really basic form of TeX, but unless you already planned for the really hard cases, maintaining your implementation is going to become intractible. TeX's real text typesetting is almost always woefully ignored even though _everything_ has to type beau…

> Classic TeX would be damn near useless in the age of Unicode Unless you want to write in English, which i am going to bet it still has a somewhat large audience :-P

As soon you want to mention names of people, English text often requires Unicode characters. Looking up some examples, the first random paper I took from arxiv mentioned three surnames that needed Unicode, the second needed four, including the name of one of authors herself.

Even if you're talking purely about people in USA - for example, a page of MIT faculty https://www.eecs.mit.edu/people/faculty-advisors includes names like Jesús, Corbató and Tomás.

Re: Towards LaTeX in the Browser

#52

Earlier quoted context omitted.

I really like the idea of adding math support to Unicode via combining characters. It's more complicated than anything Unicode currently deals with, but not that much more complicated, and the idea of being able to put math into anything that currently accepts strings is just so enticing. We should treat math as it's own language, and rendering it as we would any other human language with an unusual way of laying out…

It's an interesting idea. At what point, though, do we draw the line between what a character set (like Unicode) should handle, and what should be handled by a higher-level layer? I'm thinking that things like boldness, italicisation, and super script aren't really the job for a character set.

I'd say if the formatting changes the meaning of the language, Unicode should support it. So if you are searching through text, any change to your query string that you would like to constrain the text that matches should be supported by Unicode. Unicode should at least support anything that affects the semantic equality of strings.

Re: Towards LaTeX in the Browser

#53

Earlier quoted context omitted.

> Classic TeX would be damn near useless in the age of Unicode Unless you want to write in English, which i am going to bet it still has a somewhat large audience :-P

As soon you want to mention names of people, English text often requires Unicode characters. Looking up some examples, the first random paper I took from arxiv mentioned three surnames that needed Unicode, the second needed four, including the name of one of authors herself. Even if you're talking purely about people in USA - for example, a page of MIT faculty https://www.eecs.mit.edu/people/faculty-advisors includes…

Doesn't TeX already handle that? A quick search shows http://vjimc.osu.cz/TeXform.html

FWIW my own name would need Unicode too (Κώστας Μιχαλόπουλος) but i always use its romanized form (Kostas Michalopoulos) in English. I think that is common when writing English text and names from languages that do not use the latin (or derived) alphabet.

Re: Towards LaTeX in the Browser

#54

Earlier quoted context omitted.

A task easier said than done. Also, it should be considered that it's impossible to make breaking changes in the LaTeX language otherwise you lost the ability to compile a paper from 30 years ago. But if you're trying to do something simple, I would say go for pandoc and use whatever format you're comfortable, then convert it to TeX: https://pandoc.org/

At that point... why use TeX at all?

Because it looks much better. If you want proper kerning, ligatures, spacing, layouts etc. just reusing all the work that has been put into TeX is much better than trying to catch up.

Re: Towards LaTeX in the Browser

#55
post #44

Earlier quoted context omitted.

> it’s tooling is abysmal It seems like you haven't tried many editors. Have you tried TeXStudio ( https://www.texstudio.org/ )? > it rarely seems to work except on the person who wrote its machine. I and many others edit the same documents at the university where I work, without significant issues. Distributions like TeXLive ( https://www.tug.org/texlive/ ) provide a consistent all-inclusive cross-platform solution.

TeXStudio would be a perfect example of its abysmal tooling. It’s better than the CLI tools but it’s an awful editor and highlights how incompatible with a good writing experience LaTeX is. Yes, many people produce good work in it - it’s output is fantastic after all - but an editor that would have been a substandard user experience in the 90s is the best LaTeX has in tooling. That’s exactly what I mean!

Can you try to phrase that more precisely/constructively by including a reason why it is "awful" or give an example of "good tooling"?

As far as editing goes, latexmk, syntax highlighting and good shortcuts are all I ever use and am perfectly happy with (emacs+auctex). It is a different paradigm than WYSIWYG, but different does not say anything about good or bad.

Now writing new latex classes, I agree. That is very unintuitive and would greatly benefit from simplification, templates and tools.

Re: Towards LaTeX in the Browser

#56

I read the post but I still don't understand: is it possible to define new commands using \def or \newcommand? At first I thought these are what the other meant by "macro", but later he says > We are exploring ways for users to define non-default environment behaviors in the browser. The same goes for macros used outside the dollar and double-dollar fences. But I can't use \def or \newcommend to define things that ap…

Here is an example: $$ \newcommand{\bra}{\left } $$ $$ \bra a | b \ket $$ If you go to https://jxxcarlson.github.io/app/minilatex/src/index.html , press the "Clear" button, then paste the above text, then press "Render", you should see the macros \bra and \ket properly rendered.

Oh I see, thanks. For what it's worth, I would definitely include this example in the demo; it's basically the first thing I wanted to use. Given your pipeline, it makes sense that the \newcommand definitions themselves has to appear inside dollar signs (not just when they are used), but for people with a TeX background it's pretty unintuitive.

Also, you should definitely use \lange and \rangle in place of for bra-ket notation :)

Re: Towards LaTeX in the Browser

#57

Earlier quoted context omitted.

Classic TeX would be damn near useless in the age of Unicode, so you're looking at something like XeLaTeX or LUATex. The problem is that it's really easy to implement a really basic form of TeX, but unless you already planned for the really hard cases, maintaining your implementation is going to become intractible. TeX's real text typesetting is almost always woefully ignored even though _everything_ has to type beau…

> Classic TeX would be damn near useless in the age of Unicode Unless you want to write in English, which i am going to bet it still has a somewhat large audience :-P

There is no "you". If the idea is to make a thing for the web, the audience is everyone there, not that one guy who insist they will only ever use English.

Re: Towards LaTeX in the Browser

#58

Earlier quoted context omitted.

At that point... why use TeX at all?

Because it looks much better. If you want proper kerning, ligatures, spacing, layouts etc. just reusing all the work that has been put into TeX is much better than trying to catch up.

Hmmm the Windows API strategy? That’s not super convincing.

Re: Towards LaTeX in the Browser

#59

Earlier quoted context omitted.

TeXStudio would be a perfect example of its abysmal tooling. It’s better than the CLI tools but it’s an awful editor and highlights how incompatible with a good writing experience LaTeX is. Yes, many people produce good work in it - it’s output is fantastic after all - but an editor that would have been a substandard user experience in the 90s is the best LaTeX has in tooling. That’s exactly what I mean!

Can you try to phrase that more precisely/constructively by including a reason why it is "awful" or give an example of "good tooling"? As far as editing goes, latexmk, syntax highlighting and good shortcuts are all I ever use and am perfectly happy with (emacs+auctex). It is a different paradigm than WYSIWYG, but different does not say anything about good or bad. Now writing new latex classes, I agree. That is very u…

I could go into a long, detailed, breakdown of how bad TeXStudio is but, frankly, if they want UI/UX work they should pay for it. Which they clearly don’t.

It’s... decent enough in the pack of “open source UI” but that isn’t a high bar.

Here’s the thing about that (oft repeated) line about WYSIWYG vs WYSIWYW: it’s bullshit.

There’s no justification for it other than the deficiencies of the tooling and tool chain. It’s an excuse.

Re: Towards LaTeX in the Browser

#60

Earlier quoted context omitted.

As soon you want to mention names of people, English text often requires Unicode characters. Looking up some examples, the first random paper I took from arxiv mentioned three surnames that needed Unicode, the second needed four, including the name of one of authors herself. Even if you're talking purely about people in USA - for example, a page of MIT faculty https://www.eecs.mit.edu/people/faculty-advisors includes…

Doesn't TeX already handle that? A quick search shows http://vjimc.osu.cz/TeXform.html FWIW my own name would need Unicode too (Κώστας Μιχαλόπουλος) but i always use its romanized form (Kostas Michalopoulos) in English. I think that is common when writing English text and names from languages that do not use the latin (or derived) alphabet.

An answer here would be way too long, but the short answer is "no". The technologies that were available at the time of TeX meant that TeX had to do all kinds of things that in today's world are bizarre.

TeX has seen a lot of improvements over the last 30 years, and modern TeX engines such as XeTeX and LuaTex have removed a lot of the insane painpoints that came with traditional TeX, which worked well only because there was literally nothing better at the time.

A modern TeX engine will let you just write what you want to write, using all of Unicode as your playground, using modern OpenType fonts, and with real vector graphics. None of those things can be done with original TeX, not just "it's hard to", it's literally impossible without rewriting it from the ground up. Which is why we HAVE modern TeX engines: just because it worked, doesn't mean it was good. It was merely the best available at the time.

Time moved on.

Post reply on HN