Edit Links |
Tips /
TheLetTrickCategories: Tips << | Page list | >>Redefining a Command While Keeping the Old OneIt is very common for people to want to redefine a LaTeX command while keeping the old one around, perhaps because they want to use the old one in the definition of the new one. Thus, for example, you might want to redefine the \let\oldfoot\footnote Now \renewcommand\footnote[1]{\newstuff\oldfoot{#1}} Note that this is different from: \newcommand\oldfoot{\footnote} That will not do what you want, because Steve Litt also points out:- What they forget is this, which is often very necessary because every environment has its own "end" environment:
Without that, an environment whose "end" part actually does something will either do the wrong thing or fail. It's rare, but I've seen it happen. Also, the hint above works well if you want the new functionality to come before the original, after the original, or both. Where if fails is if you want to insert something in the middle of the original. |