Live data from Hacker News

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

peterkrautzberger.org

21–30 of 152 posts

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

#21
post #11

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 any…

One of the selling points of PDF is that it is a single self-contained file. I found this lacking in Sphinx and wrote an extension for it to zip and bundle the assets into a single HTML file: https://github.com/AdrianVollmer/Zundler Also works with HTML documents produced in other ways.

If you just run sphinx-build with the latex builder and then run xelatex or pdflatex on the result you'll get one fully-consistent PDF with everything it it, including fully functional internal hyperlinks. That's what I do for PDF. I can make big documentation packages this way building 2000 page pdfs in a minute or two on a modest laptop.

Wait: also, how is what you're saying different from the built-in singlehtml builder? https://www.sphinx-doc.org/en/master/usage/builders/index.ht...

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

#24

This is from 2013, so the bet that "nobody will want to read [PDFs] in 5 years" can be considered failed. If anything, PDF has become the lingua franca of the academic web, crowding out even DjVU at the thing that DjVU was made for and PDF was not. I have not been following the development of mathjax, pandoc, etc. carefully, so I'm wondering: Have the main issues been solved? By these I mean (1) support for most popu…

mathjax has come tremendously far, but not on the problems you mention :(

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

#25
post #8

Correct me if I’m wrong, but there isn’t a way to do a compile that incorporates Biblatex.

I've started auto-exporting Zotero-managed references to a bibtex file using better bibtex [1] and then using Sphinx and reStructuredText to process them uniformly into nicely formatted HTML, pdf, and epub using sphinxcontrib-bibtex [2].

[1] https://github.com/retorquere/zotero-better-bibtex

[2] https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage....

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

#26
post #11

Earlier quoted context omitted.

One of the selling points of PDF is that it is a single self-contained file. I found this lacking in Sphinx and wrote an extension for it to zip and bundle the assets into a single HTML file: https://github.com/AdrianVollmer/Zundler Also works with HTML documents produced in other ways.

If you just run sphinx-build with the latex builder and then run xelatex or pdflatex on the result you'll get one fully-consistent PDF with everything it it, including fully functional internal hyperlinks. That's what I do for PDF. I can make big documentation packages this way building 2000 page pdfs in a minute or two on a modest laptop. Wait: also, how is what you're saying different from the built-in singlehtml b…

In the product of the singlehtml builder, you will have the entire document in one single DOM tree. For large documents, even modern browsers on a modern machine will be brought to its knees.

Check out the CPython docs for example: https://adrianvollmer.github.io/Zundler/output/cpython.html

This is a huge document, and having this all rendered naively in one single page will not only be hard to navigate, it will also feel really sluggish if not crash the browser.

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

#27

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 any…

I guess latex is still unbeatable for writing complex math expressions. These days, when I don't need that, I'm happy with AsciiDoc.

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

#28
post #26

Earlier quoted context omitted.

If you just run sphinx-build with the latex builder and then run xelatex or pdflatex on the result you'll get one fully-consistent PDF with everything it it, including fully functional internal hyperlinks. That's what I do for PDF. I can make big documentation packages this way building 2000 page pdfs in a minute or two on a modest laptop. Wait: also, how is what you're saying different from the built-in singlehtml b…

In the product of the singlehtml builder, you will have the entire document in one single DOM tree. For large documents, even modern browsers on a modern machine will be brought to its knees. Check out the CPython docs for example: https://adrianvollmer.github.io/Zundler/output/cpython.html This is a huge document, and having this all rendered naively in one single page will not only be hard to navigate, it will also…

Ah, ok, so you want a PDF-like single file but in HTML in a way that's more efficient/scalable than the built-in singlehtml builder. Ok fair enough.

For my use cases, the default multi-file HTML builds are ok, and I just pound out a latex-builder generated PDF for the archives.

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

#29

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 any…

I write a fair amount of reports professionally and I use word.

Getting data from my Python analysis into the reports are tedious at best and updating numbers last minute is hair pulling frustrating.

But because of the good wysiwyg I can cheat on my adjustments when I need a graph to go “just there”, I can edit my paragraph wording such that I don’t get a almost completely blank page in between sections, etc, etc which is important to make a good looking report, imho.

How do you go about that with rst? I’d love to write a templates rst file that can be fed from my excel sheets and Python scripts, but how do I go about final layout adjustments?

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

#30
post #27

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 any…

I guess latex is still unbeatable for writing complex math expressions. These days, when I don't need that, I'm happy with AsciiDoc.

Sphinx/reStructuredText supports math in LaTeX input format [1], so you can still go nuts with complex math expressions while still benefitting from the relative simplicity.

[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/...

Looks like AsciiDoc supports similar latex math blocks [2]. Are there reasons you can't stick with that when doing math?

[2] https://docs.asciidoctor.org/asciidoc/latest/stem/#block

Post reply on HN