Live data from Hacker News

I don't always use LaTeX, but when I do, I compile to HTML (2013)

peterkrautzberger.org

61–70 of 152 posts

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#62
post #60

I feel ambivalent to LaTeX. I don't like the language, the ecosystem is too big, complicated and breaks, but the end result is hard to do any other way. This applies both the equations part, and the text reflow part (I think them as separate things, but they usually go together). It should be possible to write text in HTML or markdown, and write the equations in latex or asciimath, and turn it into a beautiful/articl…

I believe I have used pandoc to convert markdown to PDF. Maybe this is something you could try?

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#63
post #60

I feel ambivalent to LaTeX. I don't like the language, the ecosystem is too big, complicated and breaks, but the end result is hard to do any other way. This applies both the equations part, and the text reflow part (I think them as separate things, but they usually go together). It should be possible to write text in HTML or markdown, and write the equations in latex or asciimath, and turn it into a beautiful/articl…

Using REVTeX I honestly have no issues with LaTeX, especially if I just stick to Overleaf

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#64
post #35

The recommendation to use Markdown+MathJAX fall short when you want to write longer documents with numbered section, subsection, and theorem/definition/figure etc tracking and referencing. I'm sure with Sphinx and reStructuredText you can get that large-scale document tracking stuff, but with LaTeX it just works for the most part and you don't need to juggle a bunch of different side-projects and extensions. Plus you…

Markdown actually works great for larger documents when you use it with pandoc [1]. That way you get HTML output and PDF output via Latex, without the HTML being a second class citizen.

I wrote my thesis (50 pages) and multiple published papers this way. Maybe it seems janky but honestly my experience with Latex and it's 10 incompatible compilers and thousands of semi-incompatible packages has been much worse.

I also don't understand why (academic) publishing is so PDF focused. It's a horrible format to read on screens (think multi-column PDFs, and scrolling / jumping up and down to find references), and who actually prints stuff anymore?

The thing I love most about Pandoc is that my notes can just slowly turn into a fully fledged document. Like bullet points - The syntax in Latex is far too verbose to make taking notes with it comfortable.

It's also much easier to extend, I wrote a simple tool that automatically converts URLs into full and correctly formatted citations, so I don't even need a citation manager to get the same results:

    The GAN was first introduced in [@gan](https://papers.nips.cc/paper/5423-generative-adversarial-nets).
Turns into https://github.com/phiresky/pandoc-url2cite/blob/master/exam...

Another great project with similar structure is Manubot [3], though the PDFs there are not generated by LaTeX.

[1]: https://pandoc.org/ [2]: https://github.com/phiresky/pandoc-url2cite [3]: https://manubot.org/

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#65

This is from 2013, so the bet that "nobody will want to read [PDFs] in 5 years" can be considered failed. If anything, PDF has become the lingua franca of the academic web, crowding out even DjVU at the thing that DjVU was made for and PDF was not. I have not been following the development of mathjax, pandoc, etc. carefully, so I'm wondering: Have the main issues been solved? By these I mean (1) support for most popu…

The problem with DjVu is that its viewers suck, especially on macOS, which is very popular in modern academia

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#66
post #60

I feel ambivalent to LaTeX. I don't like the language, the ecosystem is too big, complicated and breaks, but the end result is hard to do any other way. This applies both the equations part, and the text reflow part (I think them as separate things, but they usually go together). It should be possible to write text in HTML or markdown, and write the equations in latex or asciimath, and turn it into a beautiful/articl…

It's entirely possible. One tool one could use for this is Quarto: https://quarto.org/

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#67
> don't just produce PDFs that nobody can read on small screens

I was thinking about this recently. If you get pedantic enough* about it, the typesetting quality you can get from a LaTeX+PDF is strictly better than what can be achieved using (sane) HTML.

I wanted to blog in LaTeX, and to solve the screen-size issue I thought I'd pre-bake to a wide range of page geometries, and then serve up an appropriate one to the client using pdf.js.

Fortunately for everyone, I decided against it in the end and continued blogging in markdown+html (with mathml support)

*well beyond what most readers would possibly care about

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#68
For me, the main problem with most tools that render to HTML was that they don't support all math typesetting libraries that latex supports. I used to work with category theory, where it's common to use the tikz-cd library to typeset commutative diagrams. tikz-cd is based on tikz, which is usually not supported for HTML output.

But apart from math typesetting, my latex documents were usually very simple: They just used sections, paragraphs, some theorem environments and references to those, perhaps similar to what the stack project uses [3]. Simple latex such as this corresponds relatively directly to HTML (except for the math formulas of course). But many latex to html tools try to implement a full tex engine, which I believe means that they lower the high-level constructs to something more low level (or that's at least my understanding). This results in very complicated HTML documents from even simple latex input documents.

So what would've been needed for me was a tool that can (1) render all math that pdflatex can render, but that apart from math only needs to (2) support a very limited set of other latex features. In a hacky way, (1) can be accomplished by simply using pdflatex to render each formula of a latex document in isolation to a separate pdf, then converting this pdf to svg, and then incuding this svg in the output HTML in the appropriate position. And (2) is simply a matter of parsing this limited subset of latex. I've prototyped a tool like that here [1]. An example output can be found here [2].

Of course, SVGs are not exactly great for accessibility. But my understanding is that many blind mathematicians are very good at reading latex source code, so perhaps an SVG with alt text set to the latex source for that image is already pretty good.

[1] https://github.com/mbid/latex-to-html

[2] https://www.mbid.me/lcc-model/

[3] https://stacks.math.columbia.edu/

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#70
post #41
post #27

Earlier quoted context omitted.

I guess latex is still unbeatable for writing complex math expressions. These days, when I don't need that, I'm happy with AsciiDoc.

Typst. Typst is better IMO

As a certified grumpy old developer I spent years writing off the "X but in Rust" projects, but I have to confess that a lot of good things with meaningful improvements have come from the rewrite-everything-in-Rust movement.

I've not used Typst and not authored much LaTeX (but worked on a project with a group of scientists who used nothing but LaTeX) and can see obvious advantages to Typst. Same with many, many other Rust libraries.

Post reply on HN