← Back to context

Comment by gucci-on-fleek

2 days ago

(Disclaimer: I'm on the TeX Live team)

> cryptic error messages

These have somewhat improved recently, but I agree that they're still not great.

> complex pipeline

You can typically just run "latexmk --lualatex <filename.tex>" and your document should compile in a single step.

> lack of the proper Unicode symbols support out of the box

UTF-8 has been the default input encoding since 2018 [0], so character input should mostly just work. Using complex scripts (Arabic, Devanagari, etc.) requires XeLaTeX or LuaLaTeX, but LuaLaTeX is recommended for most documents anyways [1].

Now, you still won't be able to typeset arbitrary characters without any additional setup, but this is because there is no single font that contains all characters, and since mismatched fallback fonts usually looks bad, the (La)TeX developers do not want this to be the default. But

  \usepackage{fontspec}
  \setmainfont{Some Font with your Characters}

should be all that you need in most cases.

> Projects like Tectonic would solve this for TeX

All of these have already been fixed in TeX, except for the error messages, which would be impossible for Tectonic to fix.

(Background: the TeX engines give excellent error messages, and LaTeX gives good error messages for "expected" errors, but unexpected errors usually give a TeX engine error message unrelated to your LaTeX input, since LaTeX is internally implemented on top of TeX engine macros. So much like C++ template errors, it isn't really possible to fix this.)

> Otherwise, using TeX only makes sense nowadays only if

4) If you actually like TeX for some reason like I do :)

[0]: https://www.latex-project.org/news/latex2e-news/ltnews28.pdf...

[1]: https://www.latex-project.org/news/2024/11/01/issue40-of-lat...

I recently had a document break because I used umlauts together with the subfigs package. Apparently both use " characters internally and clash badly. This is not a particularly exotic use case.

  • Yeah, unfortunately lots of the third-party LaTeX packages are fairly poorly written. Which also applies to most other programming languages, but LaTeX is somewhat unique here since (1) approximately nobody makes money off of TeX, so even "important" packages are often volunteer-maintained, and (2) LaTeX2e has been around since the early 90s, so some of the popular packages have been unmaintained for over 20 years.

    The core/official LaTeX code is really quite stable, but it's also very limited, so it's pretty reasonable to conflate it with the LaTeX ecosystem as a whole. But yes, the LaTeX Team is definitely aware of the problems caused by Babel shorthands (which is what " is in German), and they're trying to figure out some way to fix it without breaking other documents.

I'd much prefer bad looking unicode characters to just skipping them and having broken output honestly. This is currently the main reason I'm considering moving from LaTeX to typst -- just always having broken output as I use more unicode (maths symbols, emojis) in my documents.

  • > I'd much prefer bad looking unicode characters to just skipping them

    That is an option that you can enable. If you're only using a few different languages (which is by far the most typical case), it's mostly automatic with Babel (by using "\babelfont"), but if you really want to support everything, you can use something like [0] (which is admittedly rather convoluted).

    > just always having broken output as I use more unicode (maths symbols, emojis) in my documents.

    Adding "\tracinglostchars=3" anywhere in your document (before the offending character) will turn any missing characters into an error message, and using the "--halt-on-error" command-line flag will make that error fatal. I've talked to the LaTeX Team and they'd really like it if they could make those the default, but they have 40 years of backwards compatibility to deal with. I've also talked to the Overleaf support team, and it's depressingly common for documents to compile with 50+ errors and for users to think that that's completely okay.

    LaTeX is fairly similar to C here, because in both cases, the errors are nearly always important, a good document/program should compile with zero errors, yet thousands of old documents/programs do compile with errors and their users complain if you make them fatal by default.

    [0]: https://tex.stackexchange.com/a/707031/270600

    • That's genuinely good to know.

      The thing that often hits me nowadays is using pandoc (or pandoc via quarto) to go markdown -> latex -> pdf, which tends to bury these issues (and in markdown it's more tempting to just write emojis / unicode maths symbols.

      Why use markdown, because I want good HTML output (which I realise is getting better in latex, but still not as good as markdown -> HTML.