Live data from Hacker News

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

peterkrautzberger.org

111–120 of 152 posts

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

#111

Note that one can convert PDF to HTML using tools like: https://pdf2htmlex.github.io/pdf2htmlEX/ Example of a paper with equations: https://pdf2htmlex.github.io/pdf2htmlEX/demo/demo.html

Oh, now that is beautiful! Thanks for sharing.

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

#112
post #56

Earlier quoted context omitted.

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/#bl…

For example: writing complicated expression invovling calculus/matrix. That's not something I need everyday, though.

I have documented at least 10 x 10 matrices with rst math directives and found it to be pretty convenient. I don't understand what the benefit of pure latex is in this context.

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

#113

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 forced myself to use it recently, I mostly found it to be both limited (cannot have part of a link in bold or italics) and inconvenient (each line of inline code must be indented).

It does have some limits, for sure. I havent tried bolding a portion of a url before.

I have enjoyed including inline code using the literal-include directive, which allows you to just include sections of code directly from a file in disk. This is great because you can cover your example code with unit tests while also talking about it in docs without replication. You can even use little border comments to mark snippet sections so that it's not sensitive to specific line numbers.

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

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

#114
post #60

I feel ambivalent to LaTeX. I don't like the language, the ecosystem is too big, complicated and breaks, but the end result is hard to do any other way. This applies both the equations part, and the text reflow part (I think them as separate things, but they usually go together). It should be possible to write text in HTML or markdown, and write the equations in latex or asciimath, and turn it into a beautiful/articl…

Every time I encounter LaTeX, I think of something I heard: "You shouldn't need a build environment for a word processor." I can't get away from that sentiment. Almost nobody I've seen using LaTeX has actually been using it for typesetting. Usually they're using a typesetter for word processing.

Sometimes it feels like they're only using LaTeX because they "learned it in college." You ever notice that? So many people in LaTeX threads say they learned it in college, or they've been using the same setting since college, or whatever. People learn LaTeX to make college papers look nice, and then they never need to configure it again? Isn't that strange?

The worst part, though, is that people complain if you call it latex. Which I think says quite a lot about it's userbase.

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

#115

Another LaTeX-to-HTML tool is lwarp ( https://github.com/bdtc/lwarp ) which starts from the idea that there only exists one program that can parse LaTeX: the LaTeX compiler itself. Implementing a new parser is almost futile. So instead, the lwarp package redefines all the macros to output HTML. Something like \renewcommand[1]{\textbf}{ #1 } This way, compiling LaTeX gives you a PDF whose text is HTML code, so now you…

You are the author of tikz.dev? I have always thought it was made by the tikz author. Mad props to you, the site is very functional and helpful to me. With it, using tikz feels a bit less like a chore.

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

#116
post #60

I feel ambivalent to LaTeX. I don't like the language, the ecosystem is too big, complicated and breaks, but the end result is hard to do any other way. This applies both the equations part, and the text reflow part (I think them as separate things, but they usually go together). It should be possible to write text in HTML or markdown, and write the equations in latex or asciimath, and turn it into a beautiful/articl…

Document formatting seems like one of those problems where 80% or so of the problem space is simple and the remaining 20% is an unfathomable pit of nightmares. There are so many different ways people could want characters printed on a sheet of virtual paper that the problem is virtually unconstrained in its difficulty. TeX was a major theoretical advance, and LaTeX is a nice enough UI layer on TeX that has gotten sig…

Thing is, you can't really cut the feature set much. Nobody needs 90% of the features but for almost everyone there's some 10% of the less-used features that's a must-have, a total dealbreaker if the other tool doesn't have them or does them poorly; and that's a different 10% for different people, so if you have a cut-down feature set you lose many people - some because you don't have A, some because you don't have B, some because you don't have Z, and they all instead use the same old, complex tool that has support for "their thing".

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

#117

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…

Sphinx/rst are a nice middle ground between the simplicity of markdown and complexity of LaTeX. I used it to generate a lot of html docs for test reports. I did try pdf gen using via LaTeX and pdflatex for a bit, but stopped after the pdf was breaking the multiple thousands of pages. And it's really tweakable, especially with html output where you can provide your own templates, or add in your own CSS/scripts even ma…

Providing my own templates is kind of a weird feature, because that's not really what I want (in the sense "people don't want to buy drills, they want to buy holes") - obviously that's a necessary feature, but I never ever want to make my own template, what I want instead is to have a template that does exactly what I need but that's made and maintained by someone else.

E.g. I don't care about a configurable formatting for bibliography, but I would want a pre-made template that implements the APA bibliography guidelines with all the tiny nuances correctly. I don't want to configure margins for columns, I want a template that does the IEEE formatting standard exactly. (95% compatibility doesn't work, if a single missing feature means the tool can't produce the required document because it's wrong at one spot on page 3, then I'd need to abandon the tool and pick something that works). And crucially, I want the separation between content and formatting so that I can easily take a blob of content that was formatted for one layout and just copy it in a completely different template and have it match the new formatting guidelines, e.g. automatically moving all the image captions to the other side, changing how they're numbered and referenced, etc.

Latex has all this baggage solved, almost everyone who wants a specific format from me will provide a Latex template with their weird typesetting fetishes included, and I just need to provide the content - while any upcoming tool has an uphill battle to become compatible and provide the same things, at the very least pre-made (and well made) templates for all the major formats (each discipline of science generally uses something different).

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

#118
I learned LaTeX in grad school in 2013, starting with LyX. Yesterday, I compiled an Rmarkdown document into an APA6-conformant PDF with just a bit of YAML, with a tex file as an intermediate output.

We're almost there for skipping LaTeX entirely, but in my experience, Google Docs and Overleaf still offer vastly superior collaborating tools. Now if we could just edit {.md; .rmd; .ipynb} files directly on Overleaf, with comments and track changes, we'd be in business...

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

#119

Note that one can convert PDF to HTML using tools like: https://pdf2htmlex.github.io/pdf2htmlEX/ Example of a paper with equations: https://pdf2htmlex.github.io/pdf2htmlEX/demo/demo.html

That's just HTML that looks like a PDF, though. Incredible feat, but not really what I want from PDF turned to HTML. I want something mobile friendly.

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

#120

Earlier quoted context omitted.

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

I've gone a few routes. I have used sphinx's singlehtml builder to make a huge HTML file and then used pandoc to convert it into docx for final adjustments. This worked surprisingly well on a 2000-page document. But it's a bit cludgy. Another (non-Sphinx) thing you can do is just write (portions of) your docx reports directly from Python using python-docx [1]. I use this approach when people give me strict docx templ…

I do something similar for my reports. I write most of it in markdown using Typora and then I export the last draft to docx for fine tuning and distribution (the agencies I work with want docx submissions, not pdf, which always bothers me).

Typora uses pandoc to do the conversion. My reports are mainly text, charts, and lots of math formulae and it works great. You don't get fine adjustment of layout, but I find that a feature not a bug. I see so many people waste time to put a figure in just the right place. It doesn't matter. The goal is clear information transfer so just get the figure in the doc where it makes sense and go on.

Post reply on HN