summaryrefslogtreecommitdiff
path: root/info/examples/lb2/2-3-13.ltx
blob: be0c21f92f368a9a9678464d226036bf6c0cd1a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
%%
%% 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}