Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!apple!bionet!agate!usenet From: raymond@math.berkeley.edu (Raymond Chen) Newsgroups: comp.text.tex Subject: Re: Redefining a macro in terms of itself Message-ID: <1991Jan15.192407.17832@agate.berkeley.edu> Date: 15 Jan 91 19:24:07 GMT References: <1991Jan15.061451@bcat1.prime.com> <16221@chopin.udel.edu> Sender: usenet@agate.berkeley.edu (USENET Administrator) Reply-To: raymond@math.berkeley.edu (Raymond Chen) Organization: U.C. Berkeley Lines: 23 In-Reply-To: anita@chopin.udel.edu (Anita Marie Hoover) In article <1991Jan15.061451@bcat1.prime.com> kjg@s49.prime.com writes: >my intention is: >\renewcommand{\tableofcontents}{\parskip 0in \tableofcontents} In article <16221@chopin.udel.edu>, anita@chopin (Anita Marie Hoover) writes: >The way to redefine such macros is to go to the style file and get the >definition and make it part of your private LaTeX style file. Another way is save the old value into a separate csname, e.g. \let\oldtableofcontents=\tableofcontents \def\tableofcontents{\parskip0in \oldtableofcontents} This has the advantage of automatically changing when your LaTeX version changes, or if you change style files. Of course, if you want to show off, you could use some clever hacks involving \edef and \toks. Something like \toks0=\expandafter{\tableofcontents} \edef\tableofcontents{\parskip0in \the\toks0} References: The TeXbook, page 216, in particular, exercise 20.15.