Answer by egreg for How to prepend and append tokens to a macro definition in...
For adding tokens to a parameterless macro you can use, for simple cases, \preto and \appto from the etoolbox package, which obey the standard scoping...
View ArticleAnswer by Joseph Wright for How to prepend and append tokens to a macro...
The LaTeX kernel version uses only TeX90 primitives and as observed in the question it's very tricky to avoid issues with # tokens and leave all scratch variables unchanged in that scenario. (I was...
View ArticleAnswer by gernot for How to prepend and append tokens to a macro definition...
Use the xpatch package. It offers commands to prepend and append stuff to macro bodies, as well as to replace tokens. By putting the replacement into a group, it stays local.The following document is...
View ArticleAnswer by Ulrich Diez for How to prepend and append tokens to a macro...
[Due to objections of Bruno Le Floch I saw the need for a major edit of my answer:]You can use two scratch token registers. One for \edefing and another one for resetting both itself and the one that...
View ArticleHow to prepend and append tokens to a macro definition in the current scope...
I am facing the problem of both prepending and appending some tokens to the definition of a macro that does not take arguments.I found out that in the LaTeX2e kernel there is the macro \g@addto@macro...
View Article
More Pages to Explore .....