[comp.text.tex] Problem with Table of Contents

st@heike.uucp (Stefan Timphus) (12/12/90)

Hello,

I have a problem with a document which has in chapter 13 a section numbered
10 which has a subsection numbered 11. (Problem is the same for any numbers
>=10).
In the tableofcontents in the line
                  13.10 Sectionname.......................15
the "S" of Sectionname is overwritten by the "0" of 10.
The problem continues with the line
                  13.10.11 Subsectionname.................23
("S" overwritten by "1").
Can anything be done to fix this ?

                                             Stefan

*****************************************************************************
Stefan         st@heike.informatik.uni-dortmund.de
Timphus        ...{uunet,mcsun}!unido!heike.informatik.uni-dortmund.de!st 
               Phone: +49 231 755-3419
*****************************************************************************

raichle@azu.informatik.uni-stuttgart.de (Bernd Raichle) (12/13/90)

> In the tableofcontents in the line
>                   13.10 Sectionname.......................15
> the "S" of Sectionname is overwritten by the "0" of 10.

In article/book/report.sty:

  \def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
  \def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
  ...

should be changed to (in a style option file)

  \def\l@subsection{\@dottedtocline{2}{1.5em}{2.8em}}
  \def\l@subsubsection{\@dottedtocline{3}{3.8em}{4.1em}}
  ...


The third argument of \@dottedtocline is the "Width of box for
number if the TITLE has a \numberline command." (see latex.tex).

bernd
__________________________________________________________________________
Bernd Raichle, Student der Universit"at Stuttgart | "Le langage est source
privat: Stettener Str. 73, D-7300 Esslingen       |  de malentendus"
email:  raichle@azu.informatik.uni-stuttgart.de   |  (A. de Saint-Exupery)

st@heike.uucp (Stefan Timphus) (12/13/90)

I am the original poster.  Thanks for the answers.
Raymond, you are right I should have read the internals docs. When I did
so, after posting here, I came up with the following solution. To my excuse
I must say that I didn't expect it to be this easy.

-------- CUT HERE ---------------

%
% TOC_ENTRY.STY of 13 Dec 90
% written by Stefan Timphus
%
% Will produce the right space for sectionnumbers in the tableofcontents
% Necessary for entries where the number for each kind of section
% is greater 10 (e.g. "12.14.18 Sectionname")
% When using the original definition the first letter of the sectionname
% overwrites the last number of the sectionnumber
%
% call adjustments with command \adjustSTYLENAME
%

\typeout{`toc_entry.sty' 1.0 of 13 Dec 90}

%
% HERE ARE THE ORIGINAL DEFINITIONS
%

% article.sty
%
%\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
%\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
%\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
%\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}

% report.sty and book.sty
%
%\def\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
%\def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
%\def\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
%\def\l@paragraph{\@dottedtocline{4}{10em}{5em}}
%\def\l@subparagraph{\@dottedtocline{5}{12em}{6em}}

%
% MODIFICATIONS
%

\newlength{\twonum}
        \settowidth{\twonum}{99.99.}
\newlength{\threenum}
        \settowidth{\threenum}{99.99.99.}
\newlength{\fournum}
        \settowidth{\fournum}{99.99.99.99.}
\newlength{\fivenum}
        \settowidth{\fivenum}{99.99.99.99.99.}
\newlength{\sixnum}
        \settowidth{\sixnum}{99.99.99.99.99.99.}

\newcommand{\adjustarticle}
{\def\l@subsection{\@dottedtocline{2}{1.5em}{\twonum}}
\def\l@subsubsection{\@dottedtocline{3}{4.0em}{\threenum}}
\def\l@paragraph{\@dottedtocline{4}{7.8em}{\fournum}}
\def\l@subparagraph{\@dottedtocline{5}{10.4em}{\fivenum}}}

\newcommand{\adjustreport}
{\def\l@section{\@dottedtocline{1}{1.5em}{\twonum}}
\def\l@subsection{\@dottedtocline{2}{4.0em}{\threenum}}
\def\l@subsubsection{\@dottedtocline{3}{7.8em}{\fournum}}
\def\l@paragraph{\@dottedtocline{4}{10.4em}{\fivenum}}
\def\l@subparagraph{\@dottedtocline{5}{12.6em}{\sixnum}}}

\newcommand{\adjustbook}{\adjustreport}

% end of TOC_ENTRY.STY

--------- CUT HERE --------------------------

I think setting the lenghts can be done automatically by processing
the information from the .toc file. But since I am no TeX-guru I don't
know how to do it. So any improvements are welcome.
                   
                                 Stefan


*****************************************************************************
Stefan         st@heike.informatik.uni-dortmund.de
Timphus        ...{uunet,mcsun}!unido!heike.informatik.uni-dortmund.de!st 
               Phone: +49 231 755-3419
*****************************************************************************