22

Is there an introduction to programming in expl3? I saw http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/l3kernel/expl3.pdf but it doesn't discuss control structures (For example does it supersede ifthen package?) nor has any examples.

On a more specific note, ifthen package commands do not work inside of some tikz code, and I hoped that expl3 may remedy that.

This general question was asked before, but it was 9 years ago, so perhaps there is a better answer now? Where can I find the LaTeX3 manual?

8
  • 8
    I've taken it upon myself to write my own tutorials with information and examples gleaned from this site. The existing documentation (expl3.pdf, interface3.pdf, xparse.pdf, etc.) are fine for those who already know how to use the LaTeX3 programming layer, but I don't think their suitable for a general audience yet, and that's perfectly fine at this point. I'm writing for an audience of college/university STEM professors and their students who may already know a bit about LaTeX2e. There are no LaTeX3 books yet, and that too is understandable. Commented Aug 16, 2020 at 0:48
  • 4
    Perhaps we could initiate a community effort to create these materials. I for one would be willing to participate. I have already created a short tutorial, albeit it sparse at the moment, for NewDocumentCommand from xparse showing explicit examples of the different argument types. Commented Aug 16, 2020 at 0:50
  • Maybe a github like project could be interesting to do. I am voluntary to be a reader.
    – projetmbc
    Commented Aug 16, 2020 at 8:03
  • 1
    Let's keep that in mind! Commented Aug 17, 2020 at 12:19
  • @LaTeXereXeTaL Any progress?
    – user202729
    Commented Apr 17, 2022 at 0:39

1 Answer 1

22

Your question is a ominous mixture of multiple misconceptions about expl3.

First of all, the expl3.pdf document is the design document of expl3 which explains the rationale behind the architecture and how to use it. By virtue of its purpose expl3.pdf of course does not discuss control structures, which is the task of the reference manual interface3.pdf.

Next, expl3 does not supersede the ifthen package, just like apples do not supersede oranges. They are complementary approaches to the same problem. Therefore they should also not be mixed unless you understand the implications.

Finally you should avoid mixing TikZ code and expl3, again because of clashes in the design philosophy. One notorious gotcha in the TeX world is the “spurious space” problem, which expl3 solves by ignoring all whitespace within \ExplSyntaxOn...Off. However, this is incompatible with any other code that relies on the existence of whitespace, such as pgfkeys which form the fundamentals of TikZ. Nevertheless it is possible to make the two work together reasonably well, but this requires the user to write appropriate wrappers which join the space-less and the space-ful world.

3
  • 2
    If I am not wrong the PDF expl3 notes that a tutorial is missing. TeX and expl3 really need "easy to learn" books. I have found one in french for TeX and finally thing are less complex that they seem to be. The same document should exist for expl3 which for the few I try to do with gives a lot of power to the coder. Let the community grows. .. :-)
    – projetmbc
    Commented Aug 16, 2020 at 8:01
  • Mixing apples and oranges can give a tasty fruit salad, though. Commented Aug 16, 2020 at 13:50
  • 2
    @PaŭloEbermann But only when you peel the oranges first. Same here, you can successfully mix expl3 and TikZ but only when you are aware of the possible problems. Commented Aug 16, 2020 at 22:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .