LaTeX2e and e-TeX

LaTeX2e was released in 1994 and since then the LaTeX3 Project have been committed to keeping it working smoothly for users. That means balancing up keeping the code stable with fixing bugs and adding new features.

Back in 2003 the team announced that the e-TeX extensions would be used by the kernel when they were available. The new primitives offered by e-TeX make many parts of TeX programming easier and  often there’s no way in ‘classical’ TeX to get the same effect. As e-TeX was finalised in 1999, starting to use it seriously in around 2004 meant most people had access to them.

Since then, the availability and use of e-TeX has spread, and almost all users have them available. Indeed, the standard format-building routines for LaTeX have included them for many years. There are also a lot of packages on CTAN that use e-TeX, most obviously any using the expl3 programming language that the LaTeX3 Project have created.

The team had always meant to say at some stage that e-TeX was now required, and indeed thought we had until I checked over the official newsletters! So as of the next LaTeX2e release, scheduled for the start of 2017, the kernel will only build if e-TeX is enabled. For this release, we are likely to add a test for e-TeX but no actual use directly in the kernel, though in the future there will probably be more use of the extensions.

When to use \protected

ε-TeX introduced the idea of ‘protected’ macros over ten years ago, but many experienced (La)TeX users struggle with the concept. The idea of the \protected primitive is that it will prevent a macro being expanded inside an \edef or \write, so that

\protected\def\example{Hello}
\edef\test{\example}
\show\test

will give

\test=macro:
->\example .

Why would you want to do this? Well, there are some things that do not work properly inside an \edef. The classic one is an assignment: the following does not work

\edef\fails{\def\fails{stuff}}

This will give an undefined control sequence error for \fails, rather than carrying out in ‘inner’ \def. So as part of a general strategy I would recommend always making any macro that performs an assignment protected. That also applies if you know that one macro will use another that is itself protected. This is exactly what we’ve been doing in the work on LaTeX3, where the aim is that all macros are either protected or will expand safely inside an \edef. However, the idea applies more widely: making things protected is a lot more reliable than using LaTeX’s ‘robust’ mechanism, and avoids some nasty errors. ε-TeX has been around long enough that there is no real excuse not to make use of this mechanism.