Quantcast
Channel: How to prepend and append tokens to a macro definition in the current scope only? - TeX - LaTeX Stack Exchange
Browsing latest articles
Browse All 5 View Live

Image may be NSFW.
Clik here to view.

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 Article



Answer 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 Article

Image may be NSFW.
Clik here to view.

Answer 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 Article

Answer 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 Article

How 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

Browsing latest articles
Browse All 5 View Live




Latest Images