Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!wuarchive!udel!brahms.udel.edu!anita From: anita@chopin.udel.edu (Anita Marie Hoover) Newsgroups: comp.text.tex Subject: Re: Redefining a macro in terms of itself Message-ID: <16221@chopin.udel.edu> Date: 15 Jan 91 18:21:48 GMT References: <1991Jan15.061451@bcat1.prime.com> Organization: University of Delaware Lines: 34 In article <1991Jan15.061451@bcat1.prime.com> kjg@s49.prime.com writes: > > While trying to create a private LaTeX style file, I stumbled while attempting >to redefine \tableofcontents and \marginpar in terms of themselves. This is what >my intention is: > >PSEUDOCODE > >\renewcommand{\tableofcontents}{\parskip 0in \tableofcontents} >\renewcommand{\marginpar}{#1}{\scriptsize \marginpar{#1}} > 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. So you would want to go to which ever style file your private LaTeX style is based on and copy that code and modify it. For example, I took the \tableofcontents from the report.sty and modified it for our UDThesis purposes. Anyway here is the changes \def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn \fi\chapter*{Table of Contents\@mkboth{CONTENTS}{CONTENTS}} % This adds more space after the title Table of Contents \vspace*{\baselineskip} % This sets up some environment changes like read a \linebreak as % a \space, set \parskip 0pt, no hyphenation, and no justification {\let\linebreak=\space\parskip=0pt\pretolerance=10000\raggedright \advance\hsize by -\@pnumwidth % Set spacing back to 1 since UDThesis sets it to 1.5 \def\baselinestretch{1}\large\normalsize \@starttoc{toc}\if@restonecol\twocolumn\fi}} Anita Hoover University of Delaware