[Tugindia] TOC -- alignment

S Ragu ragu_raguam at rediffmail.com
Thu Mar 20 09:28:50 CET 2003


Dear Dinesh,

Please check the following lines of macros for you; I have defined 
for one of my jobs; hope this will help you to solve the 
problem.

I have defined a  control sequence called \TOCdigits  -- please 
note this commend.  For you it should be \TOCdigits{2}{2}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newdimen\TOCindentA
\newdimen\TOCindentB
\newdimen\TOCindentC
\def\TOCdigits#1#2{%
   \TOCindentA=1.25\ssem \TOCindentB=2.0\ssem
   \ifnum #1=2
     \advance\TOCindentA 0.5\ssem % another digit
     \advance\TOCindentB 0.5\ssem % another digit in the 
subsection entries
   \fi
   \ifnum #2=2
     \advance\TOCindentB 0.5\ssem
   \fi
   \TOCindentC\TOCindentA \advance\TOCindentC\TOCindentB}
\TOCdigits{1}{1}% default (< 10 sections with no more that 9 
subsections
each)



\makeatletter
\def\TOCPageNumbersYes{%
\def\EXPDOTTEDTOCLINE##1##2##3##4##5{%
   \ifnum ##1=1%
   \def\numberline####1{\hb at xt@ ##3{\null\hfill\hskip ##2
####1\,\kern0.5\ssem\hss}}%
   \else
   \ifnum ##1=2%
   \def\numberline####1{\hb at xt@ ##3{\null\hfill\hskip ##2
####1\,\kern0.5\ssem\hss}}%
   \else
   \let\numberline=\relax
   \fi\fi
   \ifnum ##1>\c at tocdepth
   \else
   \ifnum ##1=1
     \vskip 2pt plus 2pt
   \fi
     {\leftskip 6.25pc %% 24.001pt
      \rightskip 9pc plus 20pc \parfillskip -2.5pc plus -20pc
      \parindent 0pc\relax %%\@afterindenttrue
      \interlinepenalty\@M%
      \leavevmode\@tempdima##2\advance\leftskip##2
      \noindent\hangindent##3\advance\hangindent-\@tempdima
      \hskip-##2{##4\myfill}\mbox{\hskip 1pt##5}\par}%
   \fi}}
  \TOCPageNumbersYes %%
\makeatother

\TOCdigits{2}{2}

With Warm Regards
S.Ragu



%%%%%%%%%%%%%%%%%%%%%%%%%
_______________________________________________________________________
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htm&&odomos&&wn



More information about the Tugindia mailing list