A lame joke on LaTeX and HTML.
A bit of JS that converts a bunch of tags into something perhaps useful.
A while ago, @scoskey asked @pkra got talking about authoring long form for the web when you have a LaTeX background.
@scoskey suggested that the key may be in the experience of having a text editor open (perhaps with a live preview side-by-side), writing somewhat raw code, having a bit of magic to transform said code into something nice, having the ability to modify existing transformations and adding your own.
@pkra claimed that this is not hard nowadays and @scoskey called him out on it.
This is the result.
Caveat emptor this is the result of a few hours.
Vince Vatter, An Erdős-Hajnal analogue for permutation classes" (source)
Some simple components
renameTag
to "rename" elements<abstract>
<section>
and add a class.<theorem>, <lemma>, <proposition>, <corollary>, <proof>
, customizable via metadata)
<name>
, add heading with auto-numbering<blame>
, rename and add it<figure>
<name>
, add heading with auto-numbering<name>
<ref target=ID>
<a>
tags<a>
content with it (but strip <blame>
)<cite target=ID>
<cite>
elements with target=ID of bibitem<cite>
with content and wrap link pointing to bibitem<note>
See the issues.
<script src="https://github.com/pkra/laml/raw/master/dist/laml-browser.js"></script>
to itnpx reload -b -s YOUR.html
$ node bin/mjextract input.html
to generate a mathjax store (repeat whenever equations change)$ node bin/laml.js input.html output.html
output.html
$ npm run live ./samples/vatter/vatter.html
combines both of the above$ node bin/renderPDF input.html
Some tools and training tips might help.
Emmet is a fantastic tool built into many text editors these days. Think of it as overpowered code snippets.
We strongly suggest learning it as it makes writing lots of HTML reasonable.