summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-01-18 05:09:54 (GMT)
committerFred Drake <fdrake@acm.org>1998-01-18 05:09:54 (GMT)
commit9e24309bb5a1392c840503c11a4cd07088f2b9ec (patch)
tree94cbff3b68d75febd86b3aad44580d1cb4cfc86c /Doc
parentb660b63edf665f0a1de5781989c713e235053357 (diff)
downloadcpython-9e24309bb5a1392c840503c11a4cd07088f2b9ec.zip
cpython-9e24309bb5a1392c840503c11a4cd07088f2b9ec.tar.gz
cpython-9e24309bb5a1392c840503c11a4cd07088f2b9ec.tar.bz2
\funcitem{}, \dataitem{}, \excitem{}: Removed obsolete macros; there are no
longer used anywhere. Use the {*desc} environments instead. \var{}: Ensure that the argument is always set in roman italic, in case an alternate font is being used for code. These keeps the result of \var{} consistent. Some minor changes to allow easier exploration of alternate fonts for code in the running text. Haven't changed the selected font; I haven't found one that has everything required! (The best non-monospaced font so far was missing the <, >, and | characters, or at least had them at the wrong locations. It also allowed confusion between upper-case I and lower-case L.)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/myformat.sty59
1 files changed, 23 insertions, 36 deletions
diff --git a/Doc/myformat.sty b/Doc/myformat.sty
index 8ecb59b..2e782c5 100644
--- a/Doc/myformat.sty
+++ b/Doc/myformat.sty
@@ -6,13 +6,13 @@
\topmargin 0pt
\advance \topmargin by -\headheight
\advance \topmargin by -\headsep
-
+
\textheight 8.9in
-
+
\oddsidemargin 0pt
\evensidemargin \oddsidemargin
\marginparwidth 0.5in
-
+
\textwidth 6.5in
% Style parameters and macros used by most documents here
@@ -21,6 +21,13 @@
\parindent = 0mm
\parskip = 2mm
+% old code font selections:
+\let\codefont=\tt
+\let\sectcodefont=\tt
+
+% (Haven't found a new one that gets <, >, and _ right without being
+% monospaced.)
+
% Variable used by begin code command
\newlength{\codewidth}
@@ -88,14 +95,14 @@
}
% Command to generate a reference to a function, statement, keyword, operator
-\newcommand{\stindex}[1]{\indexii{statement}{#1@{\tt#1}}}
-\newcommand{\opindex}[1]{\indexii{operator}{#1@{\tt#1}}}
-\newcommand{\exindex}[1]{\indexii{exception}{#1@{\tt#1}}}
+\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{\obindex}[1]{\indexii{object}{#1}}
-\newcommand{\bifuncindex}[1]{\index{#1@{\tt#1} (built-in function)}}
+\newcommand{\bifuncindex}[1]{\index{#1@{\codefont#1} (built-in function)}}
% Add an index entry for a module
-\newcommand{\refmodule}[2]{\index{#1@{\tt#1} (#2module)}}
+\newcommand{\refmodule}[2]{\index{#1@{\codefont#1} (#2module)}}
\newcommand{\refmodindex}[1]{\refmodule{#1}{}}
\newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }}
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
@@ -105,14 +112,14 @@
\openout\modindexfile=modules.idx
% Add the defining entry for a module
-\newcommand{\defmodindex}[2]{\index{#1@{\tt#1} (#2module)|textbf}%
+\newcommand{\defmodindex}[2]{\index{#1@{\codefont#1} (#2module)|textbf}%
\write\modindexfile{#1 \thepage}}
\newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }}
\newcommand{\stmodindex}[1]{\defmodindex{#1}{standard }}
% Additional string for an index entry
\newcommand{\indexsubitem}{}
-\newcommand{\ttindex}[1]{\index{#1@{\tt#1} \indexsubitem}}
+\newcommand{\ttindex}[1]{\index{#1@{\codefont#1} \indexsubitem}}
% Define \itemjoin: some negative vspace to join two items together
\newcommand{\itemjoin}{
@@ -121,14 +128,6 @@
\vspace{-\parsep}
}
-% Define \funcitem{func}{args}: define a function item
-\newcommand{\funcitem}[2]{%
-\ttindex{#1}%
-\item[\code{#1(\varvars{#2})}]
-\
-}
-
-
% from user-level, fulllineitems should be called as an environment
\def\fulllineitems{\list{}{\labelwidth \leftmargin \labelsep 0pt
\rightmargin 0pt \topsep -\parskip \partopsep \parskip
@@ -177,20 +176,6 @@
\let\endopcodedesc\endfulllineitems
-% 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
-}
-
\let\nodename=\label
%% For these commands, use \command{} to get the typography right, not
@@ -205,12 +190,14 @@
% code is the most difficult one...
\newcommand{\code}[1]{{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}%
-\mbox{\tt #1}}}
+\mbox{\codefont{#1}}}}
\newcommand{\kbd}[1]{\mbox{\tt #1}}
\newcommand{\key}[1]{\mbox{\tt #1}}
\newcommand{\samp}[1]{\mbox{`\code{#1}'}}
-\newcommand{\var}[1]{\mbox{\it#1\/}}
+% This weird definition of \var{} allows it to always appear in roman italics,
+% and won't be sans-serif in code fragments.
+\newcommand{\var}[1]{\mbox{\textrm{\textit{#1\/}}}}
\let\file=\samp
\newcommand{\dfn}[1]{{\em #1\/}}
\renewcommand{\emph}[1]{{\em #1\/}}
@@ -230,7 +217,7 @@
\newcommand{\itemnewline}[1]{\@tempdima\linewidth
\advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}}
-\newcommand{\sectcode}[1]{{\tt #1}}
+\newcommand{\sectcode}[1]{{\sectcodefont{#1}}}
% Cross-referencing (AMK)
% Sample usage:
@@ -240,7 +227,7 @@
% \end{seealso}
\newenvironment{seealso}[0]{{\bf See Also:}\par}{\par}
-\newcommand{\seemodule}[2]{\ref{module-#1}: {\tt #1} (#2)}
+\newcommand{\seemodule}[2]{\ref{module-#1}: {\codefont #1} (#2)}
\newcommand{\seetext}[1]{\par{#1}}
% Fix the theindex environment to add an entry to the Table of Contents;