Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!SHSU.BITNET!bed_gdg From: bed_gdg@SHSU.BITNET ("George D. Greenwade") Newsgroups: comp.text.tex Subject: Re: LaTeX table of contents problem (sort of) Message-ID: <0094824E.DEA089A0.21246@SHSU.BITNET> Date: 5 May 91 15:46:20 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 69 The INFO-TeX/comp.text.tex connection comes to the rescue once again! Charles Geyer (Department of Statistics, University of Chicago) , points out: >> Ran (well, really walked) back to my office thinking, "this will be easy, >> just use \addtocontents{toc}{...} for these items and \tableofcontents at >> the start, then (a) LaTeX will generate a table of contents and (b) life >> will be easy." Guess what? (a) it doesn't and (b) it isn't. >> What am I missing? >Don't you want > > \addcontentsline{toc}{section}{\numberline {1} Leading required text} > \addcontentsline{toc}{subsection}{\numberline {1. 5} More leading required > text} > \addcontentsline{toc}{subsubsection}{\numberline {1. 5. 4} Yet more leading > required text} > >This will at least produce the Table of contents you want. > >Redefining \l@section \l@subsection \l@subsubsection in article.sty >will change the appearance of the table. Yes. Bless you and thank you. I got so caught up in my disdirected playing with \addtocontents that I forgot \addcontentsline! Although the appearance of the table is appropriate (for me), it may not be for my powers-that-be, so the insight on appearance is also appreciated. >> anyone can come up with a quick (and even dirty) trick to do this, I will be >> appreciative (especially if you can dream up a way to redefine \item in a >> list environment to do this directly, since everything presently is of the >> format \item {\bf Leading required text.} Discussion text..... and {Leading >> required text.} is what I need in the toc 8-)). >Redefining \@item so it does \addcontentsline like \@sect is possible >maybe, but it would take me longer than I want to spend on a lot of >experimentation. Presumably \@listdepth tells you what level you are >on. Thanks for this insight, as well. Looking at the code, you are right, it shouldn't be that big a job to redefine the behavior of \@item to do what I need. Glad you didn't use your time on this -- just pointing me in the proper direction was all I needed. Due to the time constraint, this may be put on a to-do list, but it will be seriously investigated. >Have you been carefully studying latex.tex and article.sty? You can't >figure stuff like this out from the book. You have to figure out the >source. Correct! Unfortunately, I (quite obviously) didn't know specifically what to even look for at the time -- long hours associated with finals, graduation, and this dumb project have pretty much vegged me out. Although I was looking at them, "carefully studying" is apparently a very bad misnomer for what I was doing. >Hope this helps. Indeed it does -- thank and bless you once again! >Disclaimer: I haven't actually tried any of this. Cross-claimer: I have and it works! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% George D. Greenwade, Ph.D. Bitnet: BED_GDG@SHSU Department of Economics and Business Analysis THEnet: SHSU::BED_GDG P. O. Box 2118 Voice: (409) 294-1266 Sam Houston State University FAX: (409) 294-3612 Huntsville, TX 77341 Internet: bed_gdg%shsu.decnet@relay.the.net %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%