Using lacheck on LaTeX3 styles

Marcel Fabian Krüger tex at 2krueger.de
Thu Mar 10 19:51:46 CET 2022


On Thu, Mar 10, 2022 at 12:14:21AM +0100, Zdenek Wagner wrote:
> I think that the problem of LaTeX3 is that the \catcode of an
> underscore is set to 11 (letter). If you just remove a check of
> unwanted spaces, you create a risk of unwanted spaces remained
> undetected. The proper solution is to add the underscore to the list
> of letters. If I understand LaTeX3 styles, \my_macro is a valid
> control sequence and TeX is then in a mode of gobbling spaces. If
> lacheck is unaware of the underscore being a letter, then \my_macro
> means that the control sequence is \my, it is followed by an
> underscore with the \catcode as defined in math followed by letters
> macro (\catcode 11) and all following spaces are collapsed to a single
> space (see The TeXbook, Chapter 7, How TeX reads what you write).

The L3 programming layer does make underscore (and the colon) a letter but
that's not the only change. It also changes the catcode of space to
ignored, therefore they should never cause unwanted spaces. The tilde
gets catcode space, but I think it's rather unlikely that someone
accidentially inserts a space through a tilde, so disabling the check
makes sense.

Best,
Marcel


More information about the tex-live mailing list.