%%
%% Der LaTeX-Begleiter, zweite Auflage (September 2005)
%%
%% Beispiel 2-3-13 von Seite 67.
%%
%% Copyright (C) 2005 Frank Mittelbach, Michel Goossens,
%%    Johannes Braams, David Carlisle, and Chris Rowley
%%
%% Uebersetzung: Copyright (C) 2005 Claudia Krysztofiak,
%%    Rebecca Stiels und Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%%
%% See http://www.latex-project.org/lppl.txt for details.
%%

\documentclass{lb2exareport}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{245.4372pt}

\begin{filecontents}{titletoc.new}
%
% Behebt einen Fehler in titletoc, der die Silbentrennung
% bei den letzten Wörtern der Einträge verhindert!
%
\def\ttl@tocentry#1#2#3#4#5#6#7#8{%
  \xdef\ttl@b{\csname ttll@#2\endcsname}%
  \ifnum\ttl@b>\c@tocdepth\else
    \ifnum\ttl@b<\ttl@toctop\else
      \edef\ttl@a{\ttl@lasttoc}%
      \gdef\thecontentspage{#8}%
      \global\let\thecontentslabel\@empty
      \global\ttl@labelfalse
      \sbox\z@{%  Leere Box. Nimmt nur die Zahlenzeile auf
        \def\numberline##1{\global\ttl@labeltrue\gdef\thecontentslabel{##1}}%
        #7}%    \ttl@b = current     \ttl@a = previous
      \ifttl@fromblock
        \ifcase#1\relax
          \ifnum\ttl@b>\ttl@a\relax
            \begingroup
            \protected@edef\ttl@preend{%
              \@nameuse{ttle@#2}%
              \endgroup
              \protect\@namedef{ttl@c}{\ttl@a}%
              \protect\ttl@outpunct}%
            #4%
            \@nameuse{ttlb@#2}%
          \else\ifnum\ttl@b<\ttl@a\relax
            \ttl@preend
            \@nameuse{ttlm@#2}%
          \else
            \@nameuse{ttlm@#2}%
          \fi\fi
        \else
          \ttl@preend
          \@@par
          \endgroup
          \@firstoftwo
        \fi
      \else
        \begingroup
        \ifnum\ttl@b>\ttl@a
          \nobreak
        \else\ifnum\ttl@b<\ttl@a
          \addpenalty{\@secpenalty}%
        \else
          \addpenalty{\z@}%
        \fi\fi
        \vskip \z@ \@plus .1\p@
        \nobreak
        \ifcase#1\relax\else\interlinepenalty\@M\fi
        \parindent\z@
        \ifx\@nil#3%
          \PackageError{titletoc}{Unimplemented}%
                {The optional argument is currently mandatory}%
        \else
          \setlength\leftskip{#3}%
        \fi
        \setlength\rightskip{\@pnumwidth}%
        \let\contentsmargin\ttl@margin
        \def\ttl@makeline##1{##1}%
        #4%
        \addtolength{\parfillskip}{-\ttl@corr}%
        \addtolength{\rightskip}{\ttl@corr}%
        \let\ttl@leaders\leaders
      \fi
      \def\numberline##1{\ignorespaces}%
      \ifttl@label
        {\leavevmode\strut\@firstoftwo#5{#7}\nobreak\hskip\z@\strut\kern\z@}%
%% FMi:                                     ^^^^^^^^^^^^^^^^^ separate
%%                                                            the strut
      \else
        {\leavevmode\strut\@secondoftwo#5{#7}\nobreak\hskip\z@\strut\kern\z@}%
%% FMi:                                     ^^^^^^^^^^^^^^^^^ separate
%%                                                            the strut
      \fi
      {#6}%
      \ifcase#1\relax
        \ifttl@fromblock\else
          \protected@edef\ttl@preend{\@nameuse{ttle@#2}}%
        \fi
        \global\ttl@fromblocktrue
      \else
        \@@par
        \nobreak
        \csname ttle@#2\endcsname
        \endgroup
        \global\ttl@fromblockfalse
      \fi
      \xdef\ttl@lasttoc{\csname ttll@#2\endcsname}%
    \fi
  \fi
  \ignorespaces}
\end{filecontents}

\StartShownPreambleCommands
\usepackage{eco,titletoc}
\contentsmargin{0pt}
\titlecontents{chapter}[1.5pc]
 {\addvspace{2pc}\large}
 {\contentslabel{2pc}%
  \scshape\MakeLowercase}
 {\scshape\MakeLowercase}
 {\hfill\thecontentspage}
 [\vspace{2pt}]
\titlecontents*{section}[1.5pc]
 {\small}{\S\thecontentslabel\ }
 {}{,~\thecontentspage}[. ][.]
\setcounter{tocdepth}{1}
\StopShownPreambleCommands
\begin{document}
\input{partial.toc}
\contentsfinish
\end{document}
