Live data from Hacker News

I don't always use LaTeX, but when I do, I compile to HTML (2013)

peterkrautzberger.org

1–10 of 152 posts

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#2
So, I originally posted this last year. When I posted it, I was using tectonic as my LaTeX compiler, and since it didn't support HTML output yet, I didn't actually try the article's suggestion.

Today, when I saw that I got an invitation to repost this article from the mods, I thought I'd take the time to try it out.

The two commands that the article suggests can be combined into one:

    latexmlpost --dest=mydoc.html --format=html5 
I did a comparison[1] of pdflatex and latexml using some old assignments, and it looks like compiling to HTML isn't fully there yet: the spacing was off in some places, and manual line breaks didn't work. But, I remain hopeful. If this gets polished, viewing LaTeX documents on phones would be much nicer.

[1]: https://imgur.com/a/yyyXWL8

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#3
Sphinx and reStructuredText are, IMHO, underrated power houses of document building. With extensions, you can hook them up to Zotero (or whatever)-managed bibtex files. You can render to beautiful HTML files, and you get latex PDFs and epubs for free. First class latex-math support, plenty of integrations with things like mermaid, graphviz, and the ability to build super-powerful custom directives to do basically anything. And way simpler/easier than pure LaTeX.

Heck you can even integrate a full-on requirements management system in them using sphinx-needs https://sphinx-needs.readthedocs.io/en/latest/

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#4

So, I originally posted this last year. When I posted it, I was using tectonic as my LaTeX compiler, and since it didn't support HTML output yet, I didn't actually try the article's suggestion. Today, when I saw that I got an invitation to repost this article from the mods, I thought I'd take the time to try it out. The two commands that the article suggests can be combined into one: latexmlpost --dest=mydoc.html --f…

What's the advantage of that subshell redirection over a simple pipe?

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#6

So, I originally posted this last year. When I posted it, I was using tectonic as my LaTeX compiler, and since it didn't support HTML output yet, I didn't actually try the article's suggestion. Today, when I saw that I got an invitation to repost this article from the mods, I thought I'd take the time to try it out. The two commands that the article suggests can be combined into one: latexmlpost --dest=mydoc.html --f…

There's some good news... arXiv just adopted LaTeXML for in-house HTML conversions of its papers. They allow users to submit bug reports and have collected over 700 so far.

LaTeXML is maintained by a team at NIST, and they are actively responding to the bug reports on github issues.

The LaTeX team headed by Frank Mittelbach is also working to add more structural information to the output of LaTeX, which will make compiling to HTML much easier.

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#7

So, I originally posted this last year. When I posted it, I was using tectonic as my LaTeX compiler, and since it didn't support HTML output yet, I didn't actually try the article's suggestion. Today, when I saw that I got an invitation to repost this article from the mods, I thought I'd take the time to try it out. The two commands that the article suggests can be combined into one: latexmlpost --dest=mydoc.html --f…

What's the advantage of that subshell redirection over a simple pipe?

I don't know if there's an advantage, haha. It was just the first thing that came to mind.

Looks like a pipe is also supported; you just need to pass `-` as the name of the file to `latexmlpost`.

    latexml mydoc.tex | latexmlpost --dest=mydoc.html --format=html5 -

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#9
I honestly don’t see the point of using LaTeX if you’re generating HTML. The great strength of LaTeX, in my view, is the precise control it provides over typography and formatting. As such, it works best with an output format which can faithfully render these documents — such as PDF. For an output format like HTML, which encourages reflowability over faithful rendering, I’d much prefer to use an ‘easier’ document format like Markdown or reStructuredText.

Re: I don't always use LaTeX, but when I do, I compile to HTML (2013)

#10
I spent a few weeks last year doing the opposite, HTML to LaTex in order to print and nicely typeset top HN articles, so I'd have a nicely printed booklet each morning. I think creating hard copies of web content for offline reading holds a lot of promise, but the internet is a beast.
Post reply on HN