summaryrefslogtreecommitdiff
path: root/info/examples/ltt/chaptoc.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/examples/ltt/chaptoc.sty
Initial commit
Diffstat (limited to 'info/examples/ltt/chaptoc.sty')
-rw-r--r--info/examples/ltt/chaptoc.sty56
1 files changed, 56 insertions, 0 deletions
diff --git a/info/examples/ltt/chaptoc.sty b/info/examples/ltt/chaptoc.sty
new file mode 100644
index 0000000000..d334b29d62
--- /dev/null
+++ b/info/examples/ltt/chaptoc.sty
@@ -0,0 +1,56 @@
+% chaptoc.sty
+% Kapitelstartseite mit Mini-TOC
+% Format Mini-TOC
+\newcommand{\l@chapentry}[2]
+{\renewcommand{\numberline}[1]
+ {\parbox[r]{2em}{##1}}
+ #1\\}
+
+% erweitere Mini-TOC bei jeder \section
+\renewcommand{\sectionmark}[1]
+{\markright{\sffamily\thesection\quad#1}
+ \myaddtocont{\protect\contentsline{chapentry}%
+ {\protect\numberline{\thesection}#1}{\thepage}}
+}
+
+% Aus LaTeX.ltx mit Aenderungen fuer Mini-TOC
+\renewcommand{\@makechapterhead}[1]
+{\vspace*{3em}\noindent%
+ \textsf{\Large\thechapter\quad #1}\\*[2em]
+ \rule{\textwidth}{0.5pt}
+ \noindent\@mystarttoc{t\thechapter}\par
+ \vspace*{3em}}
+
+% Sternform ohne TOC
+\renewcommand{\@makeschapterhead}[1]
+{\vspace*{3em}\noindent\textsf{\Large#1}\\*[3em]}
+
+% allokiere einen einzigen Ausgabestream
+\newwrite\shorttoc
+
+% Uebernahme aus LaTeX.ltx mit Anpassungen ---
+% liest Mini-TOC ein und setze Ausgabestream
+% auf neue Datei.
+\newcommand{\@mystarttoc}[1]
+{\begingroup
+ \makeatletter
+ \typeout{input jobname.#1}
+ \@input{\jobname.#1}
+ \protected@write\@auxout
+ {\let\label\@gobble \let\index\@gobble
+ \let\glossary\@gobble}%
+ {\immediate\openout\shorttoc \jobname.#1\relax}
+ \global\@nobreakfalse\endgroup}
+
+\newcommand{\myaddtocont}[1]
+{\protected@write \@auxout
+ {\let\label\@gobble \let\index\@gobble
+ \let\glossary\@gobble}%
+ {\string\@mywritefile{#1}}}
+
+\newcommand{\@mywritefile}[1]
+{\@temptokena{#1}
+ \immediate\write\shorttoc{\the\@temptokena}}
+
+\AtEndDocument{\protected@write\@auxout
+ {}{\immediate\closeout\shorttoc}}