Quantcast
Channel: What is exactly a hook in etoolbox - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by egreg for What is exactly a hook in etoolbox

$
0
0

The definition of \appto is

% etoolbox.sty, line 891:\newrobustcmd{\appto}[2]{%  \ifundef{#1}    {\edef#1{\unexpanded{#2}}}    {\edef#1{\expandonce#1\unexpanded{#2}}}}

The first argument should be a parameterless macro. Why not using \apptocmd? Because it is much less efficient and it may even not succeed if the replacement text has “non standard” tokens (for instance, characters with a different category code than usual).

Apart from this, the only other difference between \appto and \apptocmd is that the latter preserves the status of a \long (parameterless) macro, whereas \appto will always change it to non-\long.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>