Hacker News new | ask | show | jobs
by svat 1341 days ago
I'll agree that not the posted article but your comment does sum up the way many users experience LaTeX (without taking a few minutes to understand what's going on), and it's interesting to think about what factors of TeX/LaTeX and its documentation/ecosystem lead to this outcome.

About the posted article: if all one wanted to do was "typeset this bit of common math", one can just type "\lambda x.(2x)" in math mode. Or, if not constrained to keep it old school i.e. pdfTeX, use XeTeX/LuaTeX with \usepackage{unicode-math}, to type "λ x.(2x)" directly.

The posted article is actually about doing some parsing using TeX, namely the author wants to type "λ x.(2x)" into their .tex file and have it be parsed into, say, [arg:(x) body:(2x)] to be used later for whatever they're building. This is not related to typesetting at all, so why do they want to do such a thing in TeX, instead of doing it outside and using TeX just for typesetting? The motivation seems to be, as their footnote 2 indicates, that some people just enjoy being perverse. That's fine!

Even there, if you compare the author's approach with that in the comment here https://news.ycombinator.com/item?id=33296527 (by someone who knows what they're doing; cf. https://www.latex-project.org/about/team/), you'll see how the "right" way is less forbidding-looking, and also less breakage-prone. What's going on is that the author has just learned something new (how Unicode is handled in pdfTeX even though it only works with 8-bit bytes), become excited at the possibilities, and hacked their own solution using the primitives, without bothering to integrate with the broader ecosystem of other packages and conventions — which is also fine; TeX will let you do that and not get in the way.

The real interesting question raised by your comment IMO is not at all about the posted article but about experiences such as those in your comment: I can easily imagine many people doing what you did (not understanding the context, and possibly even copying ad-hoc code like this into one's document and crossing one's fingers): here we start to get into the actual problems with the LaTeX ecosystem and the mismatch between users' mental models and that of the (too many!) pieces of software involved, but I've exceeded the time limit I set to comment here so I'll stop :)

1 comments

It's true, I do enjoy being perverse. However, I think it's a bit unfair to say I have "picked up a few pieces of knowledge, become excited, and tried to hack their way through by themselves, without understanding the broader ecosystem of other packages and conventions". I'm aware of xparse, and other tools in the ecosystem (etoolbox, ifthenelse). This doesn't mean that I shouldn't try to get a given result with the provided primitives, rather than use an existing codebase. Very analogous to writing your own X programming lib rather than using an existing one: good for experimenting and learning, but maybe not something you should go for in production. (Of course, I'm certainly not at the level of a LaTeX team member.)
Yes fair! Sorry about that; I was focused on the comment I was replying to and forgot about being fair to you; I've now edited my post to change "without understanding" to "without bothering to integrate with" (and some other changes); hope it reads better now!

And as I said, doing things one's own way with the primitives is perfectly fine… I too have participated in my share of TeX perversity and doing things it wasn't designed for (example: https://tex.stackexchange.com/a/403353); I guess it's one of the things that attracts people like us to such an old system. :-)

Re. 403353: That's a lovely stackexchange post, and inspiring; I've run into it more than once when googling for answers. Great running into you here, and thanks for caring enough to rephrase the post.