News for hackers. Stuff that matters.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by hfkwer on Monday July 31, 2023 @12:08PM (#36944775)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by fabiensanglard on Monday July 31, 2023 @01:03PM (#36945607)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by chungy on Monday July 31, 2023 @01:06PM (#36945645)
> 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 :)

Re:LaTeX3: Programming in LaTeX with Ease (2020) by hfkwer on Monday July 31, 2023 @01:08PM (#36945675)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by chungy on Monday July 31, 2023 @01:14PM (#36945777)
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)

Re:LaTeX3: Programming in LaTeX with Ease (2020) by eldaisfish on Monday July 31, 2023 @03:07PM (#36947348)
>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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by chungy on Monday July 31, 2023 @03:23PM (#36947540)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by kaba0 on Monday July 31, 2023 @04:59PM (#36948730)
For anything more complex, world utterly fails when you inadvertently edit a column of that table, that will break page 533 beyond recognition.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by hfkwer on Monday July 31, 2023 @05:16PM (#36948943)
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.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by kaba0 on Monday July 31, 2023 @06:26PM (#36949712)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by pjmlp on Tuesday August 01, 2023 @03:11AM (#36953255)
The right answer is a structured editor like Framemaker, or Oxygen.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by chungy on Tuesday August 01, 2023 @11:42AM (#36957522)
Can't say I've heard of those, but TeXmacs does pride itself on being structured.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by pjmlp on Tuesday August 01, 2023 @01:02PM (#36958829)
Those exist since the 1990's, and sorry to say, they are hardly unknown.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by chungy on Wednesday August 02, 2023 @12:42AM (#36967041)
Perhaps they aren't. TeXmacs is also from the 1990s and from your brief description, no compelling reason was offered to prefer them. :p
Re:LaTeX3: Programming in LaTeX with Ease (2020) by pjmlp on Wednesday August 02, 2023 @02:17AM (#36967595)
So here is one, plenty of people used those at CERN, I haven't ever seen TeXmacs in action.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by MayeulC on Monday July 31, 2023 @01:07PM (#36945665)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by bee_rider on Monday July 31, 2023 @01:47PM (#36946254)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by chaxor on Monday July 31, 2023 @01:08PM (#36945688)
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?

Re:LaTeX3: Programming in LaTeX with Ease (2020) by thangalin on Monday July 31, 2023 @03:48PM (#36947826)
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

Re:LaTeX3: Programming in LaTeX with Ease (2020) by bobbylarrybobby on Monday July 31, 2023 @01:09PM (#36945696)
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.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by SantalBlush on Monday July 31, 2023 @01:35PM (#36946088)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by WillAdams on Monday July 31, 2023 @02:00PM (#36946433)
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

Re:LaTeX3: Programming in LaTeX with Ease (2020) by diarrhea on Monday July 31, 2023 @01:44PM (#36946211)
Great rant, and on the money. Made my day! Thank you.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by coliveira on Monday July 31, 2023 @01:57PM (#36946397)
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.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by IshKebab on Monday July 31, 2023 @02:02PM (#36946457)
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.

Re:LaTeX3: Programming in LaTeX with Ease (2020) by esalman on Monday July 31, 2023 @02:18PM (#36946675)
While we're at it let's stop using PDF files too /s
Re:LaTeX3: Programming in LaTeX with Ease (2020) by nequo on Monday July 31, 2023 @02:35PM (#36946908)
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

Re:LaTeX3: Programming in LaTeX with Ease (2020) by esalman on Monday July 31, 2023 @03:17PM (#36947463)
Nice, thanks. I knew of arxiv vanity as well- https://www.arxiv-vanity.com/papers/1708.06733/
Re:LaTeX3: Programming in LaTeX with Ease (2020) by kaba0 on Monday July 31, 2023 @05:02PM (#36948776)
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.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by nequo on Monday July 31, 2023 @05:25PM (#36949072)
I don't really understand. Which figure is 10 pages down in the example that I linked?
Re:LaTeX3: Programming in LaTeX with Ease (2020) by hfkwer on Monday July 31, 2023 @02:59PM (#36947260)
Not sure why you're being sarcastic. PDF is terrible for anything other than printing documents.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by esalman on Monday July 31, 2023 @03:15PM (#36947435)
Yet they persist. So does latex, even in 2023. There is intrinsic value in both that OP does not want to acknowledge.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by hfkwer on Monday July 31, 2023 @05:20PM (#36949010)
And mp3 persists despite being inferior to any alternative. The reason isn't intrinsic value, it's inertia.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by kaba0 on Monday July 31, 2023 @05:02PM (#36948782)
It is perfect for its job, and nothing else comes even close to it.

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

Re:LaTeX3: Programming in LaTeX with Ease (2020) by kaba0 on Monday July 31, 2023 @04:57PM (#36948705)
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)
Re:LaTeX3: Programming in LaTeX with Ease (2020) by hfkwer on Monday July 31, 2023 @05:12PM (#36948897)
Do any scientific publishers accept it?
Re:LaTeX3: Programming in LaTeX with Ease (2020) by fdupress on Tuesday August 01, 2023 @03:43AM (#36953456)
Give it 20 years, maybe 50.
Re:LaTeX3: Programming in LaTeX with Ease (2020) by pjmlp on Tuesday August 01, 2023 @03:10AM (#36953244)
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).