Sorry for this general question but to be honest I hate more and more coding in TeX and even if I am a very beginner coder in LaTeX3, I really appreciate using it.

  • Since latex have full access to tex I don't really think your question make much sense. Just remember that several of the latex3 commands are just other names for tex commands – daleif Apr 21 at 12:57
  • Maybe some tricky things can only be done using TeX... That is why I am asking this question. – projetmbc Apr 21 at 13:03
  • You might mean 'are there interfaces missing' ('yes') or 'are there things deliberately omitted' ('yes') – Joseph Wright Apr 21 at 13:03
  • 1
    @projetmbc Depends on what you want to do. In the programming area, expl3 is very feature-rich, so there is a lot you can do with it (for example LaTeX's new hook management system is entirely written in expl3). In the typesetting area, expl3 is still lacking several interfaces, so there you might need to resort to “normal” TeX – Phelype Oleinik Apr 21 at 13:09
  • 1
    @projetmbc For parsing user input expl3 is really a good choice: you have the \peek_(catcode|charcode|meaning):NTF functions to look ahead in the input stream, and the newly-added \peek_analysis_map_inline:n, which is really powerful to build parsers. If you want to do things expandably you have three conditionals \tl_if_head_is_(N_type|group|space):nTF that allow you to dissect a token list token-by-token and do pretty much anything with it. If you give an example of what you want to do I can write a sample code to get you started – Phelype Oleinik Apr 21 at 13:15

Strictly speaking, as mentioned in the comments, LaTeX3 is a superset of TeX. So, if there is some capability that TeX provides, it will also be available in LaTeX3.

The LaTeX3 programming syntax is an attempt at making many aspects of TeX programming more regularized and predictable. TeX is, as you've noticed, very much an island unto itself in its programming style (I would say that its closest non-TeX analogue would be the C Prepreprocessor and the latter, being non–Turing complete is less capable than TeX's macro language). LaTeX3 attempts to establish conventions for naming and syntax that allow for greater expressiveness in programming while retaining TeX's power. The comments on the question give some good examples.

I would say that the best way to think of the relationship between LaTeX3 and TeX is to compare it to the relationship between the various JavaScript libraries (e.g., jQuery, Prototype, React, Angular, etc.) and bare JavaScript. The libraries impose a level of order on the somewhat unruly nature of JavaScript at the cost of effectively creating a new programming language on top of JavaScript, but nothing that can be done in bare JS is inaccessible to code written in those libraries and similarly LaTeX3 creates a new language on top of TeX while retaining access to its capabilities where necessary.

  • Thanks a lot for this clear answer and also to the people who have commented on my OP. – projetmbc Apr 21 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.