Hacker News new | ask | show | jobs
by jon_richards 3302 days ago
I once heard a professor talk about writing a book 30 or so years ago. He looked at all the available options and decided latex wasn't perfect, but was the best available. 20 years later he decided to look at everything again and was appalled that latex was still the best option he had.

Have you ever tried to color a latex table? If you color a cell, most readers will cover ~1 pixel of the upper and left table borders with the cell color, regardless of the zoom level. This is especially a problem on zoom levels where the border is only 1 or 2 pixels, but makes you feel insane when you zoom in so it's 10 or more. You know what the most common advice for fixing this is? "Get rid of your table borders. It will make your table look better."

Latex is full of little problems like this, but it's still the best.

4 comments

You have much more control if you make your table in TikZ using a matrix of nodes. If you want borders, the key thing is setting "row sep=-\pgflinewidth, column sep=-\pgflinewidth" so the border doesn't get doubled up (see e.g. [1]).

Latex is far from ideal, but it's still the best because it hasn't stood still - many people are constantly contributing improvements and new packages, and it's very hard for a new replacement system to compete with that.

[1] https://tex.stackexchange.com/questions/18521/tikz-matrix-as...

The takeaway is: If you are to judge LaTeX, judge its whole ecosystem.

Otherwise, this is like saying Python is not suitable as HTTP client because "urllib" has too many quirk - ignoring the fact everyone else uses the excellent "requests" libraray.

Although there are interesting developments at its code (XeLaTex, LuaTex), it is the packages which are ever evolving at a rapid pace. Have trouble with the "graphics" package? Use "graphicx" instead. Don't like the old "letter" class? Use "scrlttr2". And of course, use TikZ, it is one of the most well-designed, best-documented and comprehensive packages out there.

Compared to most programming languages, what I really like about LaTeX is their almost almost merciless take on backwards compatibility. This means that your old "article" document almost certainly works with later LaTeX versions. There will never be a breaking new version of "article" that forces you to adapt your LaTeX code, like we see with so many libraries in other languages. But this also means that you are stuck in your "old world" if you don't keep your eye open for new packages, and are willing to learn them. There are quite a lot of StackExchange questions that are essentially like this:

"Q: How do I fix my issue with package X? A: Use the newer package Y instead (or in addition)."

I think it's also the degree of flexibility. Typesetting is itself a creative process as much as a technical one. When I do technical writing with LaTeX (and I do a lot) I'm usually ok with about 99% of what it outputs, but then I have the ability to fiddle around and make that one table have the borders exactly how I like them and that picture caption to be spaced just a little differently etc; I want to indulge my sense of aesthetics just a bit.

It's the combination of (mostly works by default) and (I can make it look just right) that is appealing. It gives me just enough stuff to play with to be satisfying and even a bit fun, without having to tweak so many things that it gets frustrating.

> I once heard a professor talk about writing a book 30 or so years ago. He looked at all the available options and decided latex wasn't perfect, but was the best available. 20 years later he decided to look at everything again and was appalled that latex was still the best option he had.

Many many years ago I evaluated the available options as well to write internal documentation for the company I worked for. Looked at groff with the mom macro package. But eventually settled on Lout.

Lout worked very pleasantly (it has a nice markup language) but the output didn't look as beautiful as Latex. Unfortunately it doesn't seemed to be developed anymore.

https://en.m.wikipedia.org/wiki/Lout_%28software%29

Lout was the inspiration for LILArt (see http://runtimeterror.com/rep/lilart) which has a @-based syntax. The idea is that you define a document in a tree-like format with nodes, properties and such (similar to XML but not as verbose) and then you pass it to a LIL (a scripting language similar to Tcl) script to... do stuff with the nodes. You call lilart like "lilart -f<format> file.ladoc" where <format> simply makes lilart to load the "<format>.lil" script and call its "process-tree" function, passing in the root node.

The reason i made it was that i liked Lout's syntax but i wanted something closer to DocBook that i could convert to other formats (Lout only works with printed output). I think the closest is GNU Texinfo, but even that was too specific and it needs way more handholding for the underlying output than i'd like. Texinfo defines its node types (and its format isn't really a tree nor very generic) whereas LILArt's node types are just a convention and in practice the scripts can define any sort of node.

Having said that, LILArt is really a backburner project which i only touch wherever i need to write a document in more than one format. The default LILArt scripts can output groff macros for conversion to PS and PDF (i used that because it is already installed in many systems, including the iMac i used at the time, and it is small to download for where it isn't available) and HTML in several variations, like semantic HTML, "simple" HTML for systems like Java help and LHelp, HTML for conversion to mobi and plain text and "naked" HTML for use with QuHelp (a program that i wrote some years ago to convert naked HTML files to full web-based help sites with search). I also had a Texinfo target that could be used to make info files, PDF and PS through TeX and CHM files for a while but it was buggy and decided to rewrite it at some point.

However i only touch that rarely when i need it so i don't really recommend its use as it is right now (the processor is more or less done, but the scripts aren't very well thought out since i was doing stuff as i needed them and they need a bit of a cleanup and some nodes are needlessly verbose - the DocBook inspiration - and need some abbreviation aliases).

Similarly, check out Racket's Scribble mode (https://docs.racket-lang.org/scribble/).

"Scribble is a collection of tools for creating prose documents—papers, books, library documentation, etc.—in HTML or PDF (via Latex) form. More generally, Scribble helps you write programs that are rich in textual content, whether the content is prose to be typeset or any other form of text to be generated programmatically."

You type in text and mark up using @-tags that are defined in, and can also contain, the full Racket language. It's like LaTeX with a modern language (but without the tons of available packages).

Nowadays Sphinx is quite usable for writing both long-form documentation and reference docs.

It's a really complex piece of software (much more complex than everyone thinks at first), but most of the time that isn't noticeable. The rST syntax can be somewhat confusing with advanced constructs, but for most stuff a short primer gets everyone going in the right direction. Since it's Python, deployment is a little bit annoying on non-Linux machines, but for docs you want CI anyway. To tweak PDF (i.e. latex) output it requires a fair bit of knowledge of both Sphinx and latex (and possibly rST [0]).

Like I said... it's quite usable.

[0] rST again being much more complex than everyone thinks at first. It's an enterprise markup language.

As soon as your start talking about that sort of thing you probably want to look at ConTeXT.

LaTeX::Word as Context::PageMaker.

> 20 years later he decided to look at everything again and was appalled that latex was still the best option he had.

I've always wanted to build a latex based reporting system for similar reasons, all existing reporting systems suck and I wouldn't be surprised if I could build a latex based system to be the least worst option.

I wonder if there are other areas that it would be useful?