My old way of redefining a command no longer works.

Harald Hanche-Olsen hanche at runbox.no
Thu May 4 10:36:13 CEST 2023


>> =====================================
> \let\oldbeginsection=\beginsection
> \def\beginsection{\oldbeginsection}
> \bye
> =====================================
>
> The preceding code yields the following error:
>
> #####################################
> [slitt at mydesk plaintex]$ ./jj
> rm: cannot remove 'junk.pdf': No such file or directory
> This is LuaTeX, Version 1.17.0 (TeX Live 2023)
> restricted system commands enabled.
> (./junk.tex
> Runaway definition?
> ->
> ! Forbidden control sequence found while scanning definition of
> \beginsection.  
> }
>  
> \oldbeginsection
> l.2 \def\beginsection{\oldbeginsection
> }
> ?
> #####################################
>
> Anyone know why the preceding code yields the preceding error?

Apart from the fact that \beginsection is declared \outer and therefore can't be used in a macro definition, no.

I have texlive installations going back to 2015. In all that time, \beginsection has been \outer. If your redefinition used to work, you must recently have upgraded from a truly ancient version.

– Harald



More information about the texhax mailing list.