18

What should I read in the TeXbook that is necessary to try to be proficient in LaTeX3 coding?

6
  • 7
    +1 I've read the TeXbook and yet I don't understand a line of expl3 coding so I'm really curious about the answers... Commented May 14, 2021 at 9:20
  • 4
    Given that part of the expl3 idea is to hide appendix D ;-) a bit, it would be nice to have a tutorial in LaTeX3 based on not having read the TeXBook... (mainly joking, but...) Commented May 14, 2021 at 9:32
  • 1
    Starting place: alanshawn.com/latex3-tutorial For technical details, read the LaTeX3 Interfaces Commented May 14, 2021 at 13:07
  • @AlanXiang I have already read your post and thank you for it by email. ;-) My question is about the need, or not, to read some parts of the TeXbook. Commented May 14, 2021 at 13:31
  • 2
    @projetmbc Oh, I didn't realize it's you. LaTeX3 is more about programming, while TeX book introduces both typesetting and programming. To create high quality documents, I think it is recommended to read the TeXbook. Commented May 14, 2021 at 13:44

1 Answer 1

18

The answer to your question (but not the answer you want) is “all of it”[1,2]. In the end, expl3 is just TeX, so if you know the underlying language, you have all you need to understand a higher-level interface that is built on top of it.

The chapters of The TeXbook that I would say are the absolute basics to know TeX (or expl3) coding are the ones that deal with programming flow: 3, 5, 7, 8, and 20, and maybe also the summary chapters 24 to 26, and if the task you're at involves typesetting, chapters 10 to 12. Of course The TeXbook is written much like a storybook, so if you skip some chapters you may have trouble understanding later ones.

1Plus the ε-TeX manual and the pdfTeX manual for the additional primitives.


However, one of the ideas in expl3 is to hide TeX's oddities from the programmer by using a standardised API, very much like LaTeX does, for example, by hiding the non-regular TeX {a \over b} syntax in a \frac{a}{b} command that follows the standard “commands take arguments” notion, so that the user doesn't need to know that in math mode a {...} will make a subformula and all that.

As Rmano put it: the idea is to hide Appendix D, so eventually there should be an expl3 manual that teaches expl3 coding without the need to read the entirety of The TeXbook, but that doesn't exist yet (for various factors, including that there simply isn't enough free time to dedicate to such project). But even when such manual exist, you will still be using an expl3 based on TeX, so if you know how to use TeX you can tackle expl3 rather easily.


Speaking from personal experience now: I'm a learn-by-doing type of person, so just reading a manual has little benefit for me. I learned expl3 after I had already been hacking around with TeX for a while and had read The TeXbook, so I knew the basics of expansion and execution in TeX, which made understanding things in the expl3 documentation a lot easier.

When I went to tackle expl3 I read expl3.pdf, which gives you the basics of the naming scheme, data types, and argument types (which are the fundamentals of expl3), and then skimmed through interface3.pdf to have an idea of what functions does expl3 have for me to use, and then proceeded to write code with it: making tons of mistakes along the way, and trying to learn something from them.

So my suggestion (may or may not work for you):

  • Know some TeX. After all it's the basics of the system you are using. Once you know this, expl3 are just TeX macros with _ and : in their names, instead of @ (really!);
  • Read expl3.pdf (it's just 15 pages) to get acquainted with the fundamental ideas of expl3;
  • Take a look at interface3.pdf to know what tools you have available; then
  • Take on some coding project: you will be faced with a challenge and and then you will know which tools you have available from expl3 to complete that task.
5
  • 4
    You wrote: "if you know how to use TeX you can tackle expl3 rather easily." This is not case of mine. I know how to use TeX but I am unable to tackle expl3. And I need not this, because I know how to use TeX. Commented May 14, 2021 at 14:16
  • I fear I have to second wipet's comment (though I don't share his innate dislike of LaTeX): while I am surely no expert I believe I'm not an absolute beginner either, and yet all my attempts at expl3 failed miserably. But +1 anyway :-) Commented May 14, 2021 at 14:24
  • 3
    @wipet Easily yes, effortlessly no, after all you still have to learn a whole new syntax. What I meant with that is that once you know TeX, you just have to learn the syntax and a bunch of new utility macros (compare that with the difficulty of learning all of TeX) Commented May 14, 2021 at 14:25
  • 2
    @campa As I said in the comment above, you don't magically learn expl3 once you know TeX (in the same say that I know TeX but I suck at TikZ :), you have to put some effort to it. But if you compare the difficulty of learning a new syntax to the difficulty of learning the whole of TeX, the former is a lot easier (in my opinion, of course) Commented May 14, 2021 at 14:27
  • @wipet you are "The exception that proves the rule" ;-). Commented May 14, 2021 at 16:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.