summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-04-22 13:03:49 (GMT)
committerFred Drake <fdrake@acm.org>1999-04-22 13:03:49 (GMT)
commit30a535c0f75ca4068d489e623d8d3893df9409cc (patch)
treeac2281c160e0f2e4a13ee86f9ca31af798edb448
parenteda232fdac4db6b8fc90d2492b133b8fda40e82f (diff)
downloadcpython-30a535c0f75ca4068d489e623d8d3893df9409cc.zip
cpython-30a535c0f75ca4068d489e623d8d3893df9409cc.tar.gz
cpython-30a535c0f75ca4068d489e623d8d3893df9409cc.tar.bz2
Added support for adding environment/macro parameters more cleanly:
\op adds an optional parameter, and \p adds a required parameter. These are only defined in the context of the parameter list parameter of the envdesc and macrodesc environments.
-rw-r--r--Doc/texinputs/ltxmarkup.sty16
1 files changed, 14 insertions, 2 deletions
diff --git a/Doc/texinputs/ltxmarkup.sty b/Doc/texinputs/ltxmarkup.sty
index 58bb060..440e697 100644
--- a/Doc/texinputs/ltxmarkup.sty
+++ b/Doc/texinputs/ltxmarkup.sty
@@ -6,9 +6,18 @@
\ProvidesPackage{ltxmarkup}
\RequirePackage{python} % fulllineitems environment
+% These two macros are used in constructing the last parameter to the
+% envdesc and macrodesc environments.
+
+\newcommand{\py@ltx@optparam}[1]{{[}\var{#1}{]}}
+\newcommand{\py@ltx@param}[1]{\{\var{#1}\}}
+
\newenvironment{envdesc}[2]{
\begin{fulllineitems}
- \item[\code{\e begin\{{\bfseries #1}\}#2}]
+ \item[\code{\e begin\{{\bfseries #1}\}{%
+ \let\op=\py@ltx@optparam%
+ \let\p=\py@ltx@param%
+ #2}}]
%\item[\code{\e end\{{\bfseries #1}\}}]
\index{#1 environment@\idxcode{#1} environment}
\index{environments!#1@\idxcode{#1}}
@@ -16,7 +25,10 @@
\newenvironment{macrodesc}[2]{
\begin{fulllineitems}
- \item[\code{\e\bfseries#1}#2]
+ \item[\code{\e\bfseries#1}{%
+ \let\op=\py@ltx@optparam%
+ \let\p=\py@ltx@param%
+ #2}]
\index{#1@\idxcode{\e #1}}
}{\end{fulllineitems}}