You just want equations? You don’t need TeX-the-software, just TeX-the-markup. Lots of things can render TeX math. In particular if you have an HTML or a markdown document with mathematical markup, many mathematical typesetting options are available. In fact, too many, all with incompatible syntax of course. The de facto standard is pandoc, which is what I usually use for turning my markdown+math into various documents (including, for example, parts of this blog).
MathJax allows you to put LaTeX equations online easily without bothering with the rest of that bullshit.
- MathJax LaTeX manual
- Carol Burns’ Exhaustive MathJax Page I find more useful, though, since it shows and tells you at the same time.
- jupyter can use MathJax out of the box.
Katex is a faster competitor to MathJax, but is not yet as widely supported. Katex even eliminated another pain point, having supported macros since 0.10.rc1. You couldn’t define macros inline which was tedious because macros are ubiquitous in real mathematics work. Now you can either inject them via config, or use the esoteric low-level
\gdef to get LaTeX-like behaviour, since
\renewcommand exists but doesn’t persist between equations, which makes it pointless for anything except prototyping individual macro definitions. KaTex support of maths markup is not as complete as MathJax. In particular
- I miss the
- You can’t put math markup inside
Inlined HTML mathematics
Both MathJax and KaTeX are eventually slow if you have enough equations in a document - MathJax sooner than KaTeX, but neither scales to the documents I write as a mathematician. You ideally want something different. There are a few attempts to do this.
bookish is a project by parser nerd Terrence Parr which, like my latex_fragment, translates TeX markup to SVG, but in addition works out how to align the SVG with text correctly via herculean effort.
This approach is shared with Daan Leijen’s Madoko (introductory paper), which does math rendering in PDF or HTML as embedded SVG.
Both these last 2 projects took the unusual step of not using the de facto standard for markdown/academia, pandoc, in favour of implementing their own new engines, which makes them a little niche.
There is another school of methods of rendering mathematics in HTML, which is the school who note that you can render MathJax without a browser using
mjpage which will pre-render HTML for you—it even claims to render math as SVG too, through forbidden magic into which it is best not to enquire too closely. See also mathmd. Wikipedia aims to leverage this approach via their mathoid project.
There are some full-pipeline tools which leverage this. The one that looks shiniest is ReLaXed, which also makes the case for their take on this approach
Many of us prefer markup languages (Markdown, LaTeX, etc.) to GUI document-editors like MS Office or Google Docs. This is because markup languages make it easier to quickly write documents in a consistent style.
However, Markdown is limited to the title/sections/paragraphs structure, and LaTeX has obscure syntax and errors that also make it difficult to stray from the beaten track.
On the other hand, web technologies have never looked so good.
- Beautiful CSS frameworks make sure your documents look clean and modern.
- Millions of people (and growing) know how to use these.
- Shorthand languages like Pug and SCSS are finally making it fun to write HTML and CSS.
- (Headless) web browsers can easily turn web documents into PDF, on any platform.
ReLaXed is an attempt at finding the most comfortable way to leverage this for desktop PDF creation.
However, I need citations in my workflow, and it is not immediately clear how I would inject those into such an end-to-end solution, at least not without writing yet another plugin— however, possibly Zotero could help with its HTML citation reports or maybe one of the word processor plugins supports HTML documents? It merits investigation. Not by me.
Gerby looks to be somewhere intermediate between a new markup language and HTML presentation; it generates a large indexed website from a latex document instead of a PDF.
If you have a LaTeX document which
- is large (probably several hundreds of pages at least)
- is regularly updated
- needs to be externally referenced often
you will run into the problem that
- large PDFs are not easily navigable
- PDFs of any size are not very searchable
- the internal numbering changes often, making external references outdated
Gerby addresses these problems by providing an online tag-based view, instead of just having a big PDF. Gerby is tailored towards making large online textbooks and reference works more accessible.