blob: 4b769be237e85b1facea174970c2d489b7be799e [file] [log] [blame]
Fred Drake1d8f07a1999-03-16 16:08:26 +00001% 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 Drake30a535c1999-04-22 13:03:49 +00009% 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 Drake1d8f07a1999-03-16 16:08:26 +000015\newenvironment{envdesc}[2]{
16 \begin{fulllineitems}
Fred Drake30a535c1999-04-22 13:03:49 +000017 \item[\code{\e begin\{{\bfseries #1}\}{%
18 \let\op=\py@ltx@optparam%
19 \let\p=\py@ltx@param%
20 #2}}]
Fred Drakeba828782000-04-03 04:19:14 +000021 \item[\code{\e end\{{\bfseries #1}\}}]
Fred Drake1d8f07a1999-03-16 16:08:26 +000022 \index{#1 environment@\idxcode{#1} environment}
23 \index{environments!#1@\idxcode{#1}}
24}{\end{fulllineitems}}
25
26\newenvironment{macrodesc}[2]{
27 \begin{fulllineitems}
Fred Draked960dc81999-04-23 14:44:53 +000028 \item[\code{{\e\bfseries#1}{%
Fred Drake30a535c1999-04-22 13:03:49 +000029 \let\op=\py@ltx@optparam%
30 \let\p=\py@ltx@param%
Fred Draked960dc81999-04-23 14:44:53 +000031 #2}}]
Fred Drake1d8f07a1999-03-16 16:08:26 +000032 \index{#1@\idxcode{\e #1}}
33}{\end{fulllineitems}}
34
35\newcommand{\env}[1]{\code{#1}}
36\newcommand{\macro}[1]{\code{\e#1}}