1 : |
jhr |
1684 |
% manpage.hva
|
2 : |
|
|
%
|
3 : |
|
|
% COPYRIGHT (c) 2012 John Reppy (http://cs.uchicago.edu/~jhr)
|
4 : |
|
|
% All rights reserved.
|
5 : |
|
|
%
|
6 : |
|
|
% HeVeA macro definitions to simulate the manpage.sty commands.
|
7 : |
|
|
%
|
8 : |
|
|
|
9 : |
|
|
%%%%%%%%%%%%%%%%%%%% Internal commands %%%%%%%%%%%%%%%%%%%%
|
10 : |
|
|
\newenvironment{MPSection}[1]{
|
11 : |
|
|
\@open{H3}{}#1\@close{H3}\@open{BLOCKQUOTE}{}}{%
|
12 : |
|
|
\@close{BLOCKQUOTE}}
|
13 : |
|
|
\newcommand{\MPArg}[1]{\textit{#1}}
|
14 : |
|
|
\newcommand{\MPOpt}[1]{\textbf{#1}}
|
15 : |
|
|
\newcommand{\MPFile}[1]{\texttt{#1}}
|
16 : |
|
|
%
|
17 : |
|
|
% versions for inside the OPTIONS environment
|
18 : |
|
|
%
|
19 : |
|
|
\newcommand{\MPOptionsArg}[1]{\textit{#1}}
|
20 : |
|
|
\newcommand{\MPOptionsOpt}[1]{\texttt{\textbf{#1}}}
|
21 : |
|
|
\newcommand{\MPOptionsFile}[1]{\textit{#1}}
|
22 : |
|
|
\newenvironment{MPOptions}{%
|
23 : |
|
|
\begin{MPSection}{OPTIONS}%
|
24 : |
|
|
\begin{list}{}{
|
25 : |
|
|
\setlength{\leftmargin}{\MPindent}%
|
26 : |
|
|
\setlength{\itemindent}{0em}%
|
27 : |
|
|
\setlength{\itemsep}{0em}%
|
28 : |
|
|
\setlength{\topsep}{0em}%
|
29 : |
|
|
% redefine external commands
|
30 : |
|
|
\renewcommand{\Opt}[1]{\MPOptionsOpt{##1}}
|
31 : |
|
|
\renewcommand{\Arg}[1]{\MPOptionsArg{##1}}
|
32 : |
|
|
\renewcommand{\OptEqArg}[2]{\MPOptionsOpt{##1=}\MPOptionsArg{##2}}
|
33 : |
|
|
\newenvironment{Flag}[1]{%
|
34 : |
|
|
\item[##1]\mbox{}\\
|
35 : |
|
|
}{\@print{<P>}}
|
36 : |
|
|
}%
|
37 : |
|
|
}{%
|
38 : |
|
|
\end{list}%
|
39 : |
|
|
\end{MPSection}%
|
40 : |
|
|
}
|
41 : |
|
|
|
42 : |
|
|
|
43 : |
|
|
\newenvironment{ManPage}[3]{%
|
44 : |
|
|
% #1 - section
|
45 : |
|
|
% #2 - name
|
46 : |
|
|
% #3 - author
|
47 : |
|
|
\cuthere{now}{#2}
|
48 : |
|
|
% define section commands
|
49 : |
|
|
\newenvironment{NAME}{\begin{MPSection}{NAME}}{\end{MPSection}}
|
50 : |
|
|
\newenvironment{SYNOPSIS}{\begin{MPSection}{SYNOPSIS}}{\end{MPSection}}
|
51 : |
|
|
\newenvironment{DESCRIPTION}{\begin{MPSection}{DESCRIPTION}}{\end{MPSection}}
|
52 : |
|
|
\newenvironment{OPTIONS}{\begin{MPOptions}}{\end{MPOptions}}
|
53 : |
|
|
\newenvironment{ENVIRONMENT}{\begin{MPSection}{ENVIRONMENT}}{\end{MPSection}}
|
54 : |
|
|
\newenvironment{FILES}{\begin{MPSection}{FILES}}{\end{MPSection}}
|
55 : |
|
|
\newenvironment{BUGS}{\begin{MPSection}{BUGS}}{\end{MPSection}}
|
56 : |
|
|
\newenvironment{SEEALSO}{\begin{MPSection}{SEEALSO}}{\end{MPSection}}
|
57 : |
|
|
% define external command names
|
58 : |
|
|
\newcommand{\Opt}[1]{\MPOpt{##1}} % Option
|
59 : |
|
|
\newcommand{\Arg}[1]{\MPArg{##1}} % Argument
|
60 : |
|
|
\newcommand{\OptEqArg}[2]{\MPOpt{##1=}\MPArg{##2}}
|
61 : |
|
|
\newcommand{\OptArg}[2]{\Opt{##1}\Arg{##2}} % Option with Argument
|
62 : |
|
|
\newcommand{\OptoArg}[2]{\Opt{##1}[\Arg{##2}]} % Option with optinal
|
63 : |
|
|
% Argument
|
64 : |
|
|
\newcommand{\oArg}[1]{[\Arg{##1}]} % optional Argument
|
65 : |
|
|
\newcommand{\oOpt}[1]{[\Opt{##1}]} % optional Option
|
66 : |
|
|
\newcommand{\oOptArg}[2]{[\OptArg{##1}{##2}]} % optional Option with
|
67 : |
|
|
% Argument
|
68 : |
|
|
\newcommand{\oOptoArg}[2]{[\OptoArg{##1}{##2}]} % optional Option with
|
69 : |
|
|
% optional Argument
|
70 : |
|
|
\newcommand{\Prog}[1]{\textit{##1}} % Program name
|
71 : |
|
|
\newcommand{\Cmd}[2]{\textit{##1}(##2)} % Command with section
|
72 : |
|
|
% number
|
73 : |
|
|
\newcommand{\File}[1]{\MPFile{##1}} % File name
|
74 : |
|
|
\newcommand{\Dots}{$\ldots$}
|
75 : |
|
|
}{}
|
76 : |
|
|
|