diff options
author | Fred Drake <fdrake@acm.org> | 2001-12-11 18:47:36 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-12-11 18:47:36 (GMT) |
commit | c82bd7281fb52a66c59f567b7da18390ed9957c1 (patch) | |
tree | 8be3f0667e5b7443451f2067a4c9e25825231f00 /Doc | |
parent | df8adcd7ba210291c01a6c59b00139fe1e1a1f48 (diff) | |
download | cpython-c82bd7281fb52a66c59f567b7da18390ed9957c1.zip cpython-c82bd7281fb52a66c59f567b7da18390ed9957c1.tar.gz cpython-c82bd7281fb52a66c59f567b7da18390ed9957c1.tar.bz2 |
Save a new version of the productionlist environment for safe-keeping; this
will be replaced shortly. See the comments for more details.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/texinputs/python.sty | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/Doc/texinputs/python.sty b/Doc/texinputs/python.sty index bddffe7..51ee804 100644 --- a/Doc/texinputs/python.sty +++ b/Doc/texinputs/python.sty @@ -888,18 +888,35 @@ +% This version is being checked in for the historical record; it shows +% how I've managed to get some aspects of this to work. It will not +% be used in practice, so a subsequent revision will change things +% again. This version has problems, but shows how to do something +% that proved more tedious than I'd expected, so I don't want to lose +% the example completely. +% \newcommand{\grammartoken}[1]{\texttt{#1}} \newenvironment{productionlist}[1][\py@badkey]{ \def\optional##1{{\Large[}##1{\Large]}} \def\production##1##2{\code{##1}&::=&\code{##2}\\} - \def\orgroup##1{{\def\or{\textbar\ }##1}} + \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\token##1{##1} \let\grammartoken=\token - \begin{center} - \begin{tabular}{lcl} + \parindent=2em + \indent + \begin{tabular}{lcl} }{% - \end{tabular} - \end{center} + \end{tabular} } \newcommand{\note}[1]{\strong{Note:} #1} |