Fred Drake | 1d8f07a | 1999-03-16 16:08:26 +0000 | [diff] [blame] | 1 | % Created by Fred L. Drake, Jr. <fdrake@acm.org>, as part of the |
| 2 | % Python Documentation Project. |
| 3 | % |
| 4 | % Define some simple markup for the LaTeX command documentation: |
| 5 | |
| 6 | \ProvidesPackage{ltxmarkup} |
| 7 | \RequirePackage{python} % fulllineitems environment |
| 8 | |
Fred Drake | 30a535c | 1999-04-22 13:03:49 +0000 | [diff] [blame] | 9 | % These two macros are used in constructing the last parameter to the |
| 10 | % envdesc and macrodesc environments. |
| 11 | |
| 12 | \newcommand{\py@ltx@optparam}[1]{{[}\var{#1}{]}} |
| 13 | \newcommand{\py@ltx@param}[1]{\{\var{#1}\}} |
| 14 | |
Fred Drake | 1d8f07a | 1999-03-16 16:08:26 +0000 | [diff] [blame] | 15 | \newenvironment{envdesc}[2]{ |
| 16 | \begin{fulllineitems} |
Fred Drake | 30a535c | 1999-04-22 13:03:49 +0000 | [diff] [blame] | 17 | \item[\code{\e begin\{{\bfseries #1}\}{% |
| 18 | \let\op=\py@ltx@optparam% |
| 19 | \let\p=\py@ltx@param% |
Fred Drake | 2964268 | 2000-09-21 15:53:54 +0000 | [diff] [blame] | 20 | \let\unspecified=\py@unspecified% |
| 21 | \let\moreargs=\py@moreargs% |
| 22 | #2}}] |
Fred Drake | ba82878 | 2000-04-03 04:19:14 +0000 | [diff] [blame] | 23 | \item[\code{\e end\{{\bfseries #1}\}}] |
Fred Drake | 1d8f07a | 1999-03-16 16:08:26 +0000 | [diff] [blame] | 24 | \index{#1 environment@\idxcode{#1} environment} |
| 25 | \index{environments!#1@\idxcode{#1}} |
| 26 | }{\end{fulllineitems}} |
| 27 | |
| 28 | \newenvironment{macrodesc}[2]{ |
| 29 | \begin{fulllineitems} |
Fred Drake | d960dc8 | 1999-04-23 14:44:53 +0000 | [diff] [blame] | 30 | \item[\code{{\e\bfseries#1}{% |
Fred Drake | 30a535c | 1999-04-22 13:03:49 +0000 | [diff] [blame] | 31 | \let\op=\py@ltx@optparam% |
| 32 | \let\p=\py@ltx@param% |
Fred Drake | 2964268 | 2000-09-21 15:53:54 +0000 | [diff] [blame] | 33 | \let\unspecified=\py@unspecified% |
| 34 | \let\moreargs=\py@moreargs% |
Fred Drake | d960dc8 | 1999-04-23 14:44:53 +0000 | [diff] [blame] | 35 | #2}}] |
Fred Drake | 1d8f07a | 1999-03-16 16:08:26 +0000 | [diff] [blame] | 36 | \index{#1@\idxcode{\e #1}} |
| 37 | }{\end{fulllineitems}} |
| 38 | |
| 39 | \newcommand{\env}[1]{\code{#1}} |
| 40 | \newcommand{\macro}[1]{\code{\e#1}} |