summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-02-06 22:52:52 (GMT)
committerFred Drake <fdrake@acm.org>1998-02-06 22:52:52 (GMT)
commitb37a3952319835c2c5c3377e4a9496539186518d (patch)
treeabcf776ef34d7caf4ad64c8da76dddcd50b64b6a /Doc
parent1ad1b3f911513d973d32a3b2f090f237e9a1072b (diff)
downloadcpython-b37a3952319835c2c5c3377e4a9496539186518d.zip
cpython-b37a3952319835c2c5c3377e4a9496539186518d.tar.gz
cpython-b37a3952319835c2c5c3377e4a9496539186518d.tar.bz2
\itembreak, \itemjoin: Remove unused macros.
\idxcode{}: New macro; used to mark things that would be \code{} for entry into the index. This allows easily switching things around for the font used in the index. (O'Reilly seems to keep it all plain roman in the index. Looks reasonable in the Python documentation as well.) \*index{}: Use \idxcode{} instead of {\codefont{}}.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/myformat.sty35
1 files changed, 17 insertions, 18 deletions
diff --git a/Doc/myformat.sty b/Doc/myformat.sty
index 0261387..0eadab8 100644
--- a/Doc/myformat.sty
+++ b/Doc/myformat.sty
@@ -74,11 +74,15 @@
%\catcode`\_=12
%\catcode`\_=\active\def_{\ifnum\fam=\ttfamily \char'137 \else{\tt\char'137}\fi}
-% Define \itembreak: force the text after an item to start on a new line
-\newcommand{\itembreak}{
-\mbox{}
-\\*[0mm]
-}
+
+%% Lots of index-entry generation support.
+
+% Command to wrap around stuff that refers to function/module/attribute names
+% in the index. Default behavior: like \code{}. To just keep the index
+% entries in the roman font, uncomment the second definition to use instead;
+% it matches O'Reilly style more.
+\newcommand{\idxcode}[1]{\codefont{#1}}
+%\renewcommand{\idxcode}[1]{#1}
% Command to generate two index entries (using subentries)
\newcommand{\indexii}[2]{\index{#1!#2}\index{#2!#1}}
@@ -95,14 +99,14 @@
}
% Command to generate a reference to a function, statement, keyword, operator
-\newcommand{\stindex}[1]{\indexii{statement}{#1@{\codefont#1}}}
-\newcommand{\opindex}[1]{\indexii{operator}{#1@{\codefont#1}}}
-\newcommand{\exindex}[1]{\indexii{exception}{#1@{\codefont#1}}}
+\newcommand{\stindex}[1]{\indexii{statement}{#1@{\idxcode{#1}}}}
+\newcommand{\opindex}[1]{\indexii{operator}{#1@{\idxcode{#1}}}}
+\newcommand{\exindex}[1]{\indexii{exception}{#1@{\idxcode{#1}}}}
\newcommand{\obindex}[1]{\indexii{object}{#1}}
-\newcommand{\bifuncindex}[1]{\index{#1@{\codefont#1} (built-in function)}}
+\newcommand{\bifuncindex}[1]{\index{#1@{\idxcode{#1}} (built-in function)}}
% Add an index entry for a module
-\newcommand{\refmodule}[2]{\index{#1@{\codefont#1} (#2module)}}
+\newcommand{\refmodule}[2]{\index{#1@{\idxcode{#1}} (#2module)}}
\newcommand{\refmodindex}[1]{\refmodule{#1}{}}
\newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }}
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
@@ -112,7 +116,8 @@
\openout\modindexfile=modules.idx
% Add the defining entry for a module
-\newcommand{\defmodindex}[2]{\index{#1@{\codefont#1} (#2module)|textbf}%
+\newcommand{\defmodindex}[2]{%
+ \index{#1@{\idxcode{#1}} (#2module)|textbf}%
\write\modindexfile{#1 \thepage}}
\newcommand{\modindex}[1]{\defmodindex{#1}{}}
\newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }}
@@ -120,14 +125,8 @@
% Additional string for an index entry
\newcommand{\indexsubitem}{}
-\newcommand{\ttindex}[1]{\index{#1@{\codefont#1} \indexsubitem}}
+\newcommand{\ttindex}[1]{\index{#1@{\idxcode{#1}} \indexsubitem}}
-% Define \itemjoin: some negative vspace to join two items together
-\newcommand{\itemjoin}{
-\mbox{}
-\vspace{-\itemsep}
-\vspace{-\parsep}
-}
% from user-level, fulllineitems should be called as an environment
\def\fulllineitems{\list{}{\labelwidth \leftmargin \labelsep 0pt