Hacker News new | ask | show | jobs
by SantalBlush 1060 days ago
I may be crazy, but I would love a functional language that compiles to LaTeX, BibTeX, and pgfplots--like the Elm language, but for typesetting. At least that way, once a document compiles, we could get some guarantees about its behavior, no matter what data we feed to it. Overflows would be handled however we define them, and the document would still produce something.

The reason I say this is because every document I produce in the TeX family needs to be tweaked slightly depending on the text and data I compile with it, or else it either won't compile or something will get visually screwed up. At least with strong typing I can get useful error messages and better control of the behavior throughout the whole document.

1 comments

It's an interesting idea --- fundamentally a typeset document is nothing but nested key value pairs where there are:

- tags/formatting large --> small, document --> paragraph --> character-level

- content which is tagged

I find that if one just finds all the "right" packages and uses appropriate markup it mostly "just works", if one then adds a pair of packages:

- one which defines all the additional markup beyond the initial author markup as empty commands

- a second which redefines all those commands to achieve the formatting