Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!uunet!mcsun!ukc!ox-prg!culhua!jg From: jg@prg.ox.ac.uk (Jeremy Gibbons) Newsgroups: comp.text.tex Subject: Re: Redefining a macro in terms of itself Message-ID: Date: 16 Jan 91 13:38:57 GMT References: <1991Jan15.061451@bcat1.prime.com> Sender: news@prg.ox.ac.uk Organization: Oxford University Computing Laboratory, UK Lines: 26 In-reply-to: kjg@bcat1.prime.com's message of 15 Jan 91 11:14:51 GMT kjg@bcat1.prime.com (Ken Gartner) asks > attempting > to redefine \tableofcontents and \marginpar in terms of themselves [...] > % Try to get table of contents tighter for article: > \let\k1\tableofcontents > \renewcommand{\tableofcontents}{\parskip 0in \k1} As others have pointed out, this is the (or a) right idea, but of course you can't use digits in control sequences (without a bit of catcode hackery). Try > % Try to get table of contents tighter for article: > \let\kone\tableofcontents > \renewcommand{\tableofcontents}{\parskip 0in \kone} (Of course, if you put this in a style file that subsequently gets read in twice, you'll still get caught in a loop, but that would serve you right...) You also have to be careful not to use \kone for anything else; the solution using \toks (raymond@math.berkeley.edu (Raymond Chen)) avoids this since it doesn't use any new control sequences. *-----------------------------------------------------------------------* | Jeremy Gibbons (jg@uk.ac.oxford.prg) Funky Monkey Multimedia Corp | *-----------------------------------------------------------------------*