Hacker News new | ask | show | jobs
by svnpenn 2105 days ago
I had a realization a while back, that in my opinion LaTeX isnt really needed anymore. Pretty much anything you can do with LaTeX, you can do with HTML. Want a PDF? Most browsers will print to PDF now, or you can use a library like this:

https://github.com/dompdf/dompdf

Need a page break? Here you go:

https://developer.mozilla.org/Web/CSS/break-after

Im not sure what you would do about TikZ and stuff like this, but I have seen some pretty wild stuff in CSS, so surely its possible:

https://pattle.github.io/simpsons-in-css

6 comments

> I had a realization a while back, that in my opinion LaTeX isnt really needed anymore

Am I correct in assuming that you are not working in academia/on research? In that case, I would argue that from your point of view latex was never needed. On the other hand, if you are working on math/cs/physics research latex is indispensable...

Not even considering the math formatting, Html is still lacking good footnotes, bibliographies, glossary generation, index generation, and table of context generation. Browsers also render things atrociously compared to a latex pdf.
There are third-party tools that do all of this.

A LaTeX-generated PDF does not render correctly at all for a blind user.

I'm not saying latex is exemplary in all forms. (I would also like to know if the big browsers render all web pages as accessible PDFs, though).

I simply meant that a plain html document + the browser leaves much to be desired for even non-technical documents.

Tbh, I would like to see a more advanced and open html-based ecosystem for documents. Latex has many watts, but also a lot of features.

> There are third-party tools that do all of this.

The things that today do this will be all gone in ten years, or replaced with other things that will in turn be replaced ... LaTeX has been here for a long time, and has been strikingly stable.

I wrote my bachelor thesis in markdown with inline mathtex(?) and compiler it from there with pandoc.

I also tried from/to HTML and the result is just bad. HTML isn't suited at all to write scientific documents with proper formatting.

Also I still need to do some things directly in latex and include them with inline latex in markdown.

So no HTML+CSS isn't suited for this at all.

At least for now where scientific papers are still DIN A4 real paper based/targeting.

Maybe it's time to change that. People read papers a lot in 24" Monitors, tablets, laptops and e-book readers for all of this the current formatting sucks.

You can definitely generate good scientific PDFs from HTML and CSS, combined with tools to generate SVGs from your LaTeX/MathML. I've converted a fair number of textbooks from print to high quality digital and print hybrid PDFs.

The learning curve is pretty high though. If you're not a web developer already, there are better options out there.

I get that things like proper kerning are probably doable with CSS.

LaTeX still does a better job out of the box, which goes a long way for my understanding of its typical use cases (resumes or long form reports).

No need for (much) CSS, browsers already support vector graphics: SVG!

In Pandoc, what you would do is you would use a general Latex plugin, and then TikZ supports PNG or SVG output by 'standalone' (https://tex.stackexchange.com/questions/51757/how-can-i-use-...), and you can either save that to a file & use as an image or you can inline them.

This uses Latex at compile-time, but considering the extent to which TikZ is a graphics DSL, I wonder how hard it would be to implement a TikZ->SVG compiler as a standalone tool in a different language? (Or make it available in a variant like Mathjax? Like https://github.com/kisonecat/tikzjax except without running an entire TeX engine in the user's browser.)

Well, LaTeX is great for mathematical symbols. I have not seen a typesetting in the web space that can compare itself to LaTeX. This is why scientists from the exact sciences use it.
MathJax is routinely used for inserting equations into HTML documents [0]. A side benefit is that it uses LaTeX-like syntax for defining equations.

Static site generators like Sphinx, Hugo, and Jekyll have support for MathJax which allows for inline equations in Markdown/RsT docs. See a Sphinx example here [1].

[0]: https://www.mathjax.org

[1]: https://www.pflotran.org/documentation/theory_guide/mode_th....