diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-patch.html')
-rw-r--r-- | Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-patch.html | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-patch.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-patch.html index 41ea39fc4c6..059f2bf68af 100644 --- a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-patch.html +++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-patch.html @@ -15,7 +15,7 @@ would naturally write: </blockquote><p> However, this would not work: a call to <code>\</code><code>splat</code> would execute <code>\</code><code>mumble</code>, and the call the redefined <code>\</code><code>splat</code> again; this is an -infinite recursive loop, that will quickly exhaust TeX’s memory. +unterminated recursion, that will quickly exhaust TeX’s memory. <p/>Fortunately, the TeX primitive <code>\</code><code>let</code> command comes to our rescue; it allows us to take a “snapshot” of the current state of a command, which we can then use in the redefinition of the command. @@ -73,7 +73,12 @@ debugging tool. programming facilities) provides a command <code>\</code><code>patchcmd</code> which will perform a “string substitution” in a macro’s definition. The package also provides commands that prepend (<code>\</code><code>pretocmd</code>) or append -(<code>\</code><code>apptocmd</code>) to the definition of a command. +(<code>\</code><code>apptocmd</code>) to the definition of a command. Not all commands may +be patched in this way; the package provides a command +<code>\</code><code>ifpatchable</code> which checks the prerequisites, and checks that the +target command’s body does indeed include the patch string you propose +to use. (The command <code>\</code><code>ifpatchable*</code> omits the test on the patch +string.) <p/>Finally, we’ll briefly consider a package that is (just about) usable, but not really recommendable. <i>Patch</i> gives you an ingenious (and difficult to understand) mechanism, and comes as an @@ -86,12 +91,12 @@ Fortunately, the file (<i>patch.doc</i>) may be input directly, and Roughly speaking, one gives the command a set of instructions analogous to <i>sed</i> substitutions, and it regenerates the command thus amended. Unless you can’t do your job any other way, you -had probably best avoid <i>Patch</i>. +had probably best avoid <i>patch</i>. <dl> -<dt><tt><i>etoolbox.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/etoolbox.zip">macros/latex/contrib/etoolbox</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/etoolbox.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/etoolbox/">browse</a>) -<dt><tt><i>patch.doc</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/generic/misc/patch.doc">macros/generic/misc/patch.doc</a> -<dt><tt><i>patchcommand.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/patchcmd.zip">macros/latex/contrib/patchcmd</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/patchcmd.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/patchcmd/">browse</a>) -<dt><tt><i>ted.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/ted.zip">macros/latex/contrib/ted</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/ted.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ted/">browse</a>) +<dt><tt><i>etoolbox.sty</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk tex-archive/macros/latex/contrib/etoolbox.zip">macros/latex/contrib/etoolbox</a> (or <a href="http://www.tex.ac.uk/www.tex.ac.uk tex-archive/macros/latex/contrib/etoolbox/">browse the directory</a>) +<dt><tt><i>patch.doc</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk tex-archivemacros/generic/misc/patch.doc">macros/generic/misc/patch.doc</a> +<dt><tt><i>patchcommand.sty</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk tex-archive/macros/latex/contrib/patchcmd.zip">macros/latex/contrib/patchcmd</a> (or <a href="http://www.tex.ac.uk/www.tex.ac.uk tex-archive/macros/latex/contrib/patchcmd/">browse the directory</a>) +<dt><tt><i>ted.sty</i></tt><dd><a href="http://www.tex.ac.uk/www.tex.ac.uk tex-archive/macros/latex/contrib/ted.zip">macros/latex/contrib/ted</a> (or <a href="http://www.tex.ac.uk/www.tex.ac.uk tex-archive/macros/latex/contrib/ted/">browse the directory</a>) </dl> <p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=patch">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=patch</a> </body> |