summaryrefslogtreecommitdiffstats
path: root/Doc/texinputs/python.sty
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-03-15 23:21:37 (GMT)
committerFred Drake <fdrake@acm.org>2002-03-15 23:21:37 (GMT)
commit5381588073eced38d37a4cb5ab89d7bd9579b71c (patch)
treedc7860af56cc6a378032ed34735b1c331cf77cd4 /Doc/texinputs/python.sty
parent7fe80a108520479a62edd6adc5eef86f4a058341 (diff)
downloadcpython-5381588073eced38d37a4cb5ab89d7bd9579b71c.zip
cpython-5381588073eced38d37a4cb5ab89d7bd9579b71c.tar.gz
cpython-5381588073eced38d37a4cb5ab89d7bd9579b71c.tar.bz2
Revise the markup related to the grammar productions to increase the
level of predictability. This is not really "good" markup, but is arguably better than we had before. This closes SF bug #523117.
Diffstat (limited to 'Doc/texinputs/python.sty')
-rw-r--r--Doc/texinputs/python.sty22
1 files changed, 6 insertions, 16 deletions
diff --git a/Doc/texinputs/python.sty b/Doc/texinputs/python.sty
index 021ba5c..9fa6d4c 100644
--- a/Doc/texinputs/python.sty
+++ b/Doc/texinputs/python.sty
@@ -53,10 +53,10 @@
% the same for each link, and avoids having lots of garbage all over
% this style file.
\newcommand{\py@linkToName}[2]{%
- \pdfannotlink attr{/Border [0 0 0]} goto name{#1}%
+ \pdfstartlink attr{/Border [0 0 0]} goto name{#1}%
\py@LinkColor#2\py@NormalColor%
\pdfendlink%
- }
+ }
% Compute the padded page number separately since we end up with a pair of
% \relax tokens; this gets the right string computed and works.
\renewcommand{\contentsline}[3]{%
@@ -788,7 +788,7 @@
% but only if we actually used hyperref:
\ifpdf
\newcommand{\url}[1]{{%
- \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}%
+ \pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}%
\py@LinkColor% color of the link text
\small\sf #1%
\py@NormalColor% Turn it back off; these are declarative
@@ -864,9 +864,9 @@
% \ulink{link text}{URL}
\ifpdf
% The \noindent here is a hack -- we're forcing pdfTeX into
- % horizontal mode since \pdfannotlink requires that.
+ % horizontal mode since \pdfstartlink requires that.
\newcommand{\ulink}[2]{\noindent{%
- \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#2)}%
+ \pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#2)}%
\py@LinkColor% color of the link text
#1%
\py@NormalColor% Turn it back off; these are declarative
@@ -899,17 +899,7 @@
\newenvironment{productionlist}[1][\py@badkey]{
\def\optional##1{{\Large[}##1{\Large]}}
\def\production##1##2{\code{##1}&::=&\code{##2}\\}
- \def\orgroup##1{{\def\oritem{\textbar\ }##1}}
- \def\orgroup*##1{{
- \def\oritem{\\ \textbar&}
- % This uses math mode's ``negative thin space'' to avoid a weird
- % indentation that I've not been able to figure out, but
- % probably relates to nesting tabular environments.
- $\!\!\!\!\!\!\!\!\!\!$%
- \begin{tabular}[t]{ll}
- \ & ##1
- \end{tabular}
- }}
+ \def\productioncont##1{& &\code{##1}\\}
\def\token##1{##1}
\let\grammartoken=\token
\parindent=2em