From 1230c08b8e158142baaa7619384bd7f6856532b2 Mon Sep 17 00:00:00 2001
From: Guido van Rossum <guido@python.org>
Date: Tue, 7 Jan 1992 16:40:44 +0000
Subject: Changes needed for indexing.

---
 Doc/lib.tex     | 45 ++++++++++++++++++++++++++++++++++-----------
 Doc/lib/lib.tex | 45 ++++++++++++++++++++++++++++++++++-----------
 2 files changed, 68 insertions(+), 22 deletions(-)

diff --git a/Doc/lib.tex b/Doc/lib.tex
index c11cb5b..101d33e 100644
--- a/Doc/lib.tex
+++ b/Doc/lib.tex
@@ -2,24 +2,44 @@
 
 \documentstyle[myformat]{report}		% To preview with xdvi
 
-% Support to leave changebars in...
+% Underscores are not magic throughout this document
+\catcode`_=12
+
+% Dummy \cbstart and \cbend so I can leave the changebars in...
 \newcommand{\cbstart}{}
 \newcommand{\cbend}{}
 
-% A command to force the text after an item to start on a new line
+% Define \itembreak: force the text after an item to start on a new line
 \newcommand{\itembreak}{
-	\mbox{}\\*[0mm]
+\mbox{}
+\\*[0mm]
+}
+
+% Define \itemjoin: some negative vspace to join two items together
+\newcommand{\itemjoin}{
+\mbox{}
+\vspace{-\itemsep}
+\vspace{-\parsep}
 }
 
-% A command to define a function item
-\newcommand{\funcitem}[2]{\item[#1(#2)]}
+% Define \funcitem{func}{args}: define a function item
+\newcommand{\funcitem}[2]{
+\index{#1@{\tt#1}}
+\item[{\tt #1(#2)}]
+\ 
+}
 
-% A command to define a data item
-\newcommand{\dataitem}[1]{\item[#1]}
+% Define \dataitem{name}: define a data item
+\newcommand{\dataitem}[1]{
+\index{#1@{\tt#1}}
+\item[{\tt #1}]
+\ 
+}
 
-% A command to define an exception item
+% Define \excitem{name}{string}: define an exception item
 \newcommand{\excitem}[2]{
-\item[#1 = {\tt '#2'}]
+\index{#1@{\tt#1}}
+\item[{\tt #1 = '#2'}]
 \itembreak
 }
 
@@ -34,6 +54,8 @@
 	E-mail: {\tt guido@cwi.nl}
 }
 
+\makeindex
+
 \begin{document}
 
 \pagenumbering{roman}
@@ -63,7 +85,8 @@ language.
 \input{lib1.tex}	% intro; built-in types, functions and exceptions
 \input{lib2.tex}	% built-in modules
 \input{lib3.tex}	% standard modules
-\input{lib4.tex}	% OS-dependent appendixes
-\input{lib5.tex}	% Graphics appendixes
+\input{lib4.tex}	% OS-dependent chapters
+\input{lib5.tex}	% Graphics chapters
+\input{libindex.tex}	% The index
 
 \end{document}
diff --git a/Doc/lib/lib.tex b/Doc/lib/lib.tex
index c11cb5b..101d33e 100644
--- a/Doc/lib/lib.tex
+++ b/Doc/lib/lib.tex
@@ -2,24 +2,44 @@
 
 \documentstyle[myformat]{report}		% To preview with xdvi
 
-% Support to leave changebars in...
+% Underscores are not magic throughout this document
+\catcode`_=12
+
+% Dummy \cbstart and \cbend so I can leave the changebars in...
 \newcommand{\cbstart}{}
 \newcommand{\cbend}{}
 
-% A command to force the text after an item to start on a new line
+% Define \itembreak: force the text after an item to start on a new line
 \newcommand{\itembreak}{
-	\mbox{}\\*[0mm]
+\mbox{}
+\\*[0mm]
+}
+
+% Define \itemjoin: some negative vspace to join two items together
+\newcommand{\itemjoin}{
+\mbox{}
+\vspace{-\itemsep}
+\vspace{-\parsep}
 }
 
-% A command to define a function item
-\newcommand{\funcitem}[2]{\item[#1(#2)]}
+% Define \funcitem{func}{args}: define a function item
+\newcommand{\funcitem}[2]{
+\index{#1@{\tt#1}}
+\item[{\tt #1(#2)}]
+\ 
+}
 
-% A command to define a data item
-\newcommand{\dataitem}[1]{\item[#1]}
+% Define \dataitem{name}: define a data item
+\newcommand{\dataitem}[1]{
+\index{#1@{\tt#1}}
+\item[{\tt #1}]
+\ 
+}
 
-% A command to define an exception item
+% Define \excitem{name}{string}: define an exception item
 \newcommand{\excitem}[2]{
-\item[#1 = {\tt '#2'}]
+\index{#1@{\tt#1}}
+\item[{\tt #1 = '#2'}]
 \itembreak
 }
 
@@ -34,6 +54,8 @@
 	E-mail: {\tt guido@cwi.nl}
 }
 
+\makeindex
+
 \begin{document}
 
 \pagenumbering{roman}
@@ -63,7 +85,8 @@ language.
 \input{lib1.tex}	% intro; built-in types, functions and exceptions
 \input{lib2.tex}	% built-in modules
 \input{lib3.tex}	% standard modules
-\input{lib4.tex}	% OS-dependent appendixes
-\input{lib5.tex}	% Graphics appendixes
+\input{lib4.tex}	% OS-dependent chapters
+\input{lib5.tex}	% Graphics chapters
+\input{libindex.tex}	% The index
 
 \end{document}
-- 
cgit v0.12

