ltxmarkup.sty 1.19 KB
Newer Older
1 2 3 4 5 6 7 8
% Created by Fred L. Drake, Jr. <fdrake@acm.org>, as part of the
% Python Documentation Project.
%
% Define some simple markup for the LaTeX command documentation:

\ProvidesPackage{ltxmarkup}
\RequirePackage{python}      % fulllineitems environment

9 10 11 12 13 14
% 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}\}}

15 16
\newenvironment{envdesc}[2]{
  \begin{fulllineitems}
17 18 19
    \item[\code{\e begin\{{\bfseries #1}\}{%
      \let\op=\py@ltx@optparam%
      \let\p=\py@ltx@param%
20 21 22
      \let\unspecified=\py@unspecified%
      \let\moreargs=\py@moreargs%
         #2}}]
23
    \item[\code{\e end\{{\bfseries #1}\}}]
24 25 26 27 28 29
    \index{#1 environment@\idxcode{#1} environment}
    \index{environments!#1@\idxcode{#1}}
}{\end{fulllineitems}}

\newenvironment{macrodesc}[2]{
  \begin{fulllineitems}
30
    \item[\code{{\e\bfseries#1}{%
31 32
      \let\op=\py@ltx@optparam%
      \let\p=\py@ltx@param%
33 34
      \let\unspecified=\py@unspecified%
      \let\moreargs=\py@moreargs%
35
      #2}}]
36 37 38 39 40
    \index{#1@\idxcode{\e #1}}
}{\end{fulllineitems}}

\newcommand{\env}[1]{\code{#1}}
\newcommand{\macro}[1]{\code{\e#1}}