cpython/Doc/myformat.sty

116 lines
2.8 KiB
Plaintext
Raw Normal View History

% Style parameters and macros used by most documents here
1991-01-22 07:45:29 -04:00
1992-04-06 11:02:23 -03:00
\input{a4wide.sty} % Take this out if it doesn't exist or doesn't work
% This has to be tuned each time the repair person takes the printer apart:
\addtolength{\oddsidemargin}{-2.5mm}
\addtolength{\evensidemargin}{-2.5mm}
1991-01-22 07:45:29 -04:00
1992-03-06 06:55:46 -04:00
% Style parameters
\raggedbottom
\sloppy
\parindent = 0mm
\parskip = 2mm
1991-06-04 17:22:18 -03:00
% Frequently used system name
1991-01-22 07:45:29 -04:00
\newcommand{\UNIX}{U{\sc nix}}
% Variable used by begin code command
1991-01-24 12:54:29 -04:00
\newlength{\codewidth}
1992-03-06 06:55:46 -04:00
% Command to start a code block (follow this by \begin{verbatim})
\newcommand{\bcode}{
% Calculate the text width for the minipage:
\setlength{\codewidth}{\linewidth}
\addtolength{\codewidth}{-\parindent}
%
\par
1991-11-12 11:44:51 -04:00
\vspace{3mm}
\indent
\begin{minipage}[t]{\codewidth}
}
1992-03-06 06:55:46 -04:00
% Command to end a code block (precede this by \end{verbatim})
\newcommand{\ecode}{
\end{minipage}
\vspace{3mm}
\par
\noindent
}
1992-03-06 06:55:46 -04:00
1992-08-07 13:06:42 -03:00
% Underscores are not magic throughout the Python documentation.
% This still only gives the right effect in the tt font!!!
1992-03-06 06:55:46 -04:00
\catcode`_=12
% Define \itembreak: force the text after an item to start on a new line
\newcommand{\itembreak}{
\mbox{}
\\*[0mm]
}
% Command to generate two index entries (using subentries)
\newcommand{\indexii}[2]{
\index{#1!#2}
\index{#2!#1}
}
% And three entries (using only one level of subentries)
\newcommand{\indexiii}[3]{
\index{#1!#2 #3}
\index{#2!#3, #1}
\index{#3!#1 #2}
}
% And four (again, using only one level of subentries)
\newcommand{\indexiv}[4]{
\index{#1!#2 #3 #4}
\index{#2!#3 #4, #1}
\index{#3!#4, #1 #2}
\index{#4!#1 #2 #3}
}
% Command to generate a reference to a function, statement, keyword, operator
\newcommand{\stindex}[1]{\indexii{statement}{#1@{\tt#1}}}
\newcommand{\kwindex}[1]{\indexii{keyword}{#1@{\tt#1}}}
\newcommand{\opindex}[1]{\indexii{operator}{#1@{\tt#1}}}
1992-04-03 10:44:27 -04:00
\newcommand{\exindex}[1]{\indexii{exception}{#1@{\tt#1}}}
\newcommand{\obindex}[1]{\indexii{object}{#1}}
1992-03-06 06:55:46 -04:00
\newcommand{\bifuncindex}[1]{\index{#1@{\tt#1} (built-in function)}}
% Add an index entry for a module
\newcommand{\modindex}[2]{\index{#1@{\tt#1} (#2module)}}
\newcommand{\bimodindex}[1]{\modindex{#1}{built-in }}
\newcommand{\stmodindex}[1]{\modindex{#1}{standard }}
% Additional string for an index entry
\newcommand{\indexsubitem}{}
\newcommand{\ttindex}[1]{\index{#1@{\tt#1} \indexsubitem}}
% Define \itemjoin: some negative vspace to join two items together
\newcommand{\itemjoin}{
\mbox{}
\vspace{-\itemsep}
\vspace{-\parsep}
}
% Define \funcitem{func}{args}: define a function item
\newcommand{\funcitem}[2]{
\ttindex{#1}
\item[{\tt #1(#2)}]
\
}
% Define \dataitem{name}: define a data item
\newcommand{\dataitem}[1]{
\ttindex{#1}
\item[{\tt #1}]
\
}
% Define \excitem{name}: define an exception item
\newcommand{\excitem}[1]{
\ttindex{#1}
\item[{\tt #1}]
\itembreak
}