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

I'm a little sad that there still doesn't seem to be a "LaTeX for the Web", a document markup system with similar philosophy as LaTeX but for HTML output. LaTeX is basically only suited for static PDF output, which only survives because there don't seem to be tools that do an equally good job generating HTML documents.

There are a lot of special-purpose markup languages, like Markdown and AsciiDoc. They involve toolchains written in other languages to convert them to HTML. If you want to add features, you have to hack the toolchain.

For blog posts and simple websites, that's fine. But sometimes I want to build something nontrivial -- as an academic, the first thing that comes to mind is an academic paper, where I might want to have special markup for theorems, proofs, examples, figures, and tables, and have ways to automatically cross-reference them, generate tables of contents, embed automatically formatted bibliographies, and so on. Or generate figures from code (like TiKZ), or embed data analysis code right in the source and embed the results (via knitr or Sweave).

With pandoc, bookdown, and knitr, you can get pretty close to this. But what made LaTeX so powerful is that it is programmable in LaTeX. It can be extended: you can define new types of environments (example problems! homework exercises! every example shows equivalent source code in three different languages! category diagrams generated automatically! musical notation is typeset!), you can make new commands to automate drudgery (typesetting chemical equations! building complicated equations!), and you can do it all with at least some basic separation between content and presentation style. Converting the larger LaTeX documents I've made to Markdown or Org would be basically impossible without writing a bunch of scripts to extend the Markdown renderer and hack everything together. There's no equivalent of just writing a LaTeX package.

I'm not aware of another document preparation system that comes close to LaTeX. Org mode is probably the closest, since it has tools to embed code blocks in other languages and include their output, but after a week of fighting with conversions between markup languages I can really see the appeal of LaTeX's uniform syntax and built-in programmability.

The other promising option seems to be Pollen[0], a Racket-based programmable system. But it seems more like TeX than LaTeX: it provides the very basic tools to build a programmable document system, but not the higher-level conveniences (like cross-referencing commands and standard sectioning and environment commands) you would need to build yourself. Maybe someday...

[0] https://docs.racket-lang.org/pollen/




Have you looked at Scribble? It's very programmable, and evaluated similarly to TeX or LaTeX, but in a more powerful and straightforward language (Racket).

It's used by academics to write conference papers, it's used for most of the Racket books for both Web and camera-ready typesetting for print, and I've even used it for embedded API docs.

https://docs.racket-lang.org/scribble/

(That manual itself was written in Scribble.)

(I'm actually thinking of moving from Scribble to Markdown for embedded API docs, as part of an open source ecosystem goal, to make docs for reusable modules more lightweight to add, but it's hard to give up some things about Scribble. For example, for one module, I needed substantial documentation about each opcode, and wanted it to be formatted similarly to an API function, but with different meta properties, and some tricky formatting. Scribble let me make a simple semantic form for that, separate from formatting, like LaTeX would.)


That looks nice, but it’s no match for LaTeX in the academic publishing world, simply because virtually all technical conferences and journals only provide Word and LaTeX templates.


Scribble can export to LaTeX and includes templates for a couple different CS conferences, actually, though probably one would have to extend it a bit to use it for other venues.


You should take a look at PreTeXt. https://pretextbook.org/


I actually was just looking at it a few days ago. Interesting project, and looks designed exactly to produce academic books and texts. But it's not programmable in the TeX sense, where you can extend it to do new things within the language -- it's just that PreTeXt's base features include most of the things I want.

I'm trying to resist writing another book, since I know how much time it would suck up, but if I do, I'll probably look at PreTeXt and maybe Scribble as options.


Here an interesting attempt to apply LaTeX to a javascript package called MathML with which I'm unfamiliar.

https://www.maths.nottingham.ac.uk/plp/pmadw/lm.html

There is some exploration at the site itself that is worth looking through if anyone plans to attempt LaTeX markdown being interpreted-and-served.

The Unix Philosophy in me thinks "use lynx. oh and forget https, use gopher to serve. when you hit a .tex switch to a program that's supposed to do that" etc etc etc but I definitely think the entirety of the internetworkings - i.e. not-exclusive-to-hackers - would benefit from *TeX markdown being as common as HTML (perhaps not AS common, but more common than currently).


It seems that the one-size-fits-all tool is a tough row to hoe.

Part of the reason that LaTeX works at all is that it targets, as you note, (essentially) .pdf.

Trying to pack so much precision into a web/os tool and make it performant, would seem beyond the reach of a real-world business case, as far as I can tell.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: