Hacker News new | ask | show | jobs
by hfkwer 1048 days ago
I'm a math professor. I've written articles, books, lecture notes, exams, exercise sheets, presentations... with latex. Hell, even a custom class for a journal I participate in.

I hate this language with a passion. The design choices may have made sense in the 80s when 128 kB of RAM was considered high-end, "tooling" was an unknown term, and modern parser design an academic matter. If I have to read "Runaway argument" and sift through a hundred lines of log to find an error again I will have a stroke.

LaTeX3? I have great admiration for the work they've done. But they have made at least two mistakes.

1. The fundamental mistake of insisting on backwards compatibility. Latex is choke-full of historical cruft. How many times have I read things to the effect of:

"Oh, you want an inline list? And you're using the inline-list package?! You poor fool! You should be using inllst3 with the xtabl option. Holy shit, you're using hyperref too?? (Spoiler alert: everyone uses fucking hyperref.) You cretin. Well, you should load these three other packages in this specific order. Then paste these esoteric commands:

\makeatletter\def\tbl@lst#1{\hy@tbl\vphantom{#2}#1\strut\lbl@lst##&!@\makeatother

No, I'm not going to explain what the commands do. Figure it out. Documentation? In the texbook. It's not online, you expect Knuth to work for free? Go buy it on amazon, you freeloader."

Don't get me started on how to get arXiv to accept your biblatex files.

Throw all this into the trash and start anew. There's no other good way forward.

2. The superficial on creating a theoretically beautiful and consistent syntax that is designed for computers, not for humans.

Seriously, go to the authors' website, the "LaTeX3 examples" page https://www.alanshawn.com/tech/2020/05/25/latex-3.html#examp.... Here's how you multiply a length by a float and store it somewhere.

    \cs_generate_variant:Nn  \fp_set:Nn {Nx}
    % #1: input name
    % #2: output name
    % #3: factor
    \cs_set:Npn \__multiply_length:NNn #1#2#3 {
        \fp_set:Nx \l_tmpa_fp {\dim_to_fp:n {#1}}
        \fp_set:Nx \l_tmpb_fp {\l_tmpa_fp * #3}
        \dim_set:Nx \l_tmpa_dim {\fp_to_dim:n {\l_tmpb_fp}}
        \dim_set_eq:NN #2 \l_tmpa_dim
    }
How anyone can look at this and think "that's the proper way of doing things" is beyond me.

I've started writing stuff with msword and I honestly like it better. Even UTN28 kind of makes sense. Yes, I'm expecting a fight after writing this.

12 comments

Oh, I'm with you on a lot of things here, and I've just typeset my PhD manuscript with it, being a longtime (10 years) user.

LaTeX does not feel like a programming language. It is first and foremost designed as a macro language, which is nice for writing text, not that much for implementing algorithms.

I quite like what lualatex is doing, including a lua interpreter to add some simple code to your document, and make writing packages easier. I admit I haven't used yet, being afraid of compatibility issues. I know a friend also uses a package to interoperate with python.

This doesn't completely solve my main gripes with LaTeX though, including the slow compilation speed (while 95% could be cached), and the bad error messages, as well as the brittleness of the programming part (I ended up typesetting my manuscript in 9pt because I forgot a comma after the previous documentclass argument).

And the adoption is slow, packages stick to the most compatible baseline.

Maybe the future really is to restrict LaTeX use to minor parts of the text, like Markdown (pandoc?). But there's still some value in having a plugin system that doesn't require additional dependencies.

The only thing I really don’t like about LaTeX is the slow compilations, which could I guess be solved by caching or breaking up my file.

OTOH, I’m of sure to what extent this slow compilation is actually just a symptom of something bad in the language. I’ve included a bunch of packages in my file, which probably slow down compilation, due to the fact that they have to deal with ancient cruft.

I have written three books in Latex and I also hate it. I am thinking of a fourth one but I don't think I can take another of these night trying to figure out why the lines in a table don't connect.

At this point I will try anything else.

I would try Lyx. No need to deal with Latex errors and its equation editor is actually worth using (unlike literally every other equation editor).

TeXmacs is another option. No idea if it's any good - I always ignored it based on the name because it sounds like some kind of Emacs based Latex editor but it's actually nothing to do with Emacs and not based on Latex. Terrible name. Might be good though.

I may be crazy, but I would love a functional language that compiles to LaTeX, BibTeX, and pgfplots--like the Elm language, but for typesetting. At least that way, once a document compiles, we could get some guarantees about its behavior, no matter what data we feed to it. Overflows would be handled however we define them, and the document would still produce something.

The reason I say this is because every document I produce in the TeX family needs to be tweaked slightly depending on the text and data I compile with it, or else it either won't compile or something will get visually screwed up. At least with strong typing I can get useful error messages and better control of the behavior throughout the whole document.

It's an interesting idea --- fundamentally a typeset document is nothing but nested key value pairs where there are:

- tags/formatting large --> small, document --> paragraph --> character-level

- content which is tagged

I find that if one just finds all the "right" packages and uses appropriate markup it mostly "just works", if one then adds a pair of packages:

- one which defines all the additional markup beyond the initial author markup as empty commands

- a second which redefines all those commands to achieve the formatting

There's a modern way of doing things now that's much simpler. Just use markdown, and then convert to PDF with pandoc.

Oh, right, you want to be able to comment on it in a nice way, and not everyone in the group is super familiar with git, so you can just use a self hosted overleaf for the comments. Oh, that's actually for latex, so just use markdown->latex->pdf, and now everyone can comment easily.

Oh shoot, nevermind, the latex comments aren't the original source, so the comments won't sync right. Easy, just make a custom script to make the comments as part of a git commit to the repo with the markdown, in a format that can re-apply the comments when they're pulled and synced with the latex. Sure, that will work :/.

You want easy version control of image placement too? No problem, markdown can work with css as well, so just add that into your markdown file wherever needed.

This is so much easier, right?

Right?

My Typesetting Markdown series goes into creating a number of scripts that use pandoc, knitr, and a YAML interpolator to do just that:

https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdow...

Later, I wrote KeenWrite, which is both a GUI and command-line application for converting Markdown documents to PDF. KeenWrite separates the content layer from the presentation layer and uses ConTeXt to do so. I've tried to keep my software backwards compatible with pandoc.

https://github.com/DaveJarvis/keenwrite

When I was into my UNIX phase, I was deep into LaTeX, wrote several assignments in it, including my graduation project reports and thesis.

Nowadays, I rather use a WYSIWYG editor, even if it takes a bit longer to type equations (when needed).

Ha, glad to see I'm not the only one. LaTeX math is great, the rest should be thrown out. Something like Asciidoctor is perfectly fine for creating “serious” documents and supports LaTeX.
> I've started writing stuff with msword and I honestly like it better.

Give TeXmacs a try. You don't need to suffer between Word and LaTeX :)

The appeal of word isn't the WYSIWYG aspect. It's that... it. just. works. You want a table? There's only one way to make a table, and it works. You want to insert an image? It f*cking works. You want to format running headers a certain way? Believe it or not, it works! No weird incompatibilities between packages. No delving through the depth of 1990-era latex library code to figure out where the weird space comes from. Everything just works! And there's documentation online! Written for humans!

Trust me, writing code is not the issue with latex. I've written C++ code for embedded MCUs. I've taught python to undergrads. The pain does not even compare.

The disadvantage of Word is that it has absolutely terrible output and quite a lot of use cases are hard or impossible to use in it.

Don't let the name fool you. TeXmacs won't make you write (La)TeX. You'll get tables that work, images that work, hyperlinks that work, running headers that work, math that works, kerning that words, hyphenation and justification that work. (From math forward are major failure points in Word)

>The disadvantage of Word is that it has absolutely terrible output

This is a moot point if most people are reluctant to pick up latex and those who do are greeted by often unreadable, esoteric code that produces error messages such as "badness". This is the problem with latex and its derivatives, not their output.

TeXmacs isn't a derivative of LaTeX. It has an unfortunate name. It is a WYSIWYG editor that produces comparable output. It does support some subset of (La)TeX backslash commands as convenience, but requires none of them.

Basically you get all the advantages of Word, all the advantages of (La)TeX, and none of the disadvantages of either.

For anything more complex, world utterly fails when you inadvertently edit a column of that table, that will break page 533 beyond recognition.
Do you have anything to contribute beyond rehashing memes? I can have a go at it too: better not miss a bracket on line 2000 of your document, otherwise latex will complain about a runaway argument in a different file and you'll have to sift through the whole thing to find where the error is.
But you at least get an error before you print your whole work! Like, the two is absolutely incomparable.

The sad part of Word is that even professionals mess it up constantly, because you have many ways to reach the same goal, and that every addition affects the whole document, or in some fortunate cases only the part till the next page break. But silent breakage is the worst, as is quite clear from any kind of programming background. Imo, Word just doesn’t scale due to this.

The right answer is a structured editor like Framemaker, or Oxygen.
Can't say I've heard of those, but TeXmacs does pride itself on being structured.
Those exist since the 1990's, and sorry to say, they are hardly unknown.
Perhaps they aren't. TeXmacs is also from the 1990s and from your brief description, no compelling reason was offered to prefer them. :p
So here is one, plenty of people used those at CERN, I haven't ever seen TeXmacs in action.
You might like Typst. It is a new language, new tooling that actually learned its lessons, and while its community won’t magically replace all the cruft that came from the LaTeX world overnight, I think it might have already managed to get a critical mass and it can be the next chapter of scientific papers (among other use cases)
Do any scientific publishers accept it?
Give it 20 years, maybe 50.
While we're at it let's stop using PDF files too /s
There's a variant of arXiv.org called ar5iv.org which renders papers in HTML5 instead of PDF. It is very handy when reading papers in a browser and it is generated from the same LaTeX files. You just need to replace the "x" with "5" in the URL:

https://arxiv.org/abs/1807.11408

https://ar5iv.org/abs/1807.11408

Why would I want completely broken layouting instead of artfully crafted one? PDF does its job absolutely well, sure it won’t accommodate to your screen but there is no automatic way of laying out the content in a way that it makes sense both semantically, and from a design perspective. That figure 10 pages down is completely useless, I want to see it when it is referenced in the text. I really have a hard time reading anything that requires more formatting that a novel in anything else than properly rendered PDF.
I don't really understand. Which figure is 10 pages down in the example that I linked?
Nice, thanks. I knew of arxiv vanity as well- https://www.arxiv-vanity.com/papers/1708.06733/
Not sure why you're being sarcastic. PDF is terrible for anything other than printing documents.
It is perfect for its job, and nothing else comes even close to it.

https://news.ycombinator.com/item?id=36948776

Yet they persist. So does latex, even in 2023. There is intrinsic value in both that OP does not want to acknowledge.
And mp3 persists despite being inferior to any alternative. The reason isn't intrinsic value, it's inertia.
Great rant, and on the money. Made my day! Thank you.
Latex doesn't require you to learn how to multiply two lengths! The beauty of LaTex is that it makes the simple things easy and hard things possible. If you don't like programming in TeX, great, just use a package that does what you want or use the defaults of the language. People who really care about the fine details of how the document looks can count on the TeX engine to do that (after reading Knuth's book). Everybody else can still take advantage of the great quality of the results.