hgbook

view en/99defs.tex @ 37:9fd0c59b009a

Add to hook chapter.
Document each macro in 99defs.tex.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Jul 17 00:01:01 2006 -0700 (2006-07-17)
parents e68f4a96c16e
children b49a7dd4e564
line source
1 % Bug ID.
2 \newcommand{\bug}[1]{\index{Mercurial issue!no.~#1}\href{http://www.selenic.com/mercurial/bts/issue#1}{Mercurial issue no.~#1}}
4 % File name in the user's home directory.
5 \newcommand{\tildefile}[1]{\texttt{\~{}/#1}}
7 % File name.
8 \newcommand{\filename}[1]{\texttt{#1}}
10 % Directory name.
11 \newcommand{\dirname}[1]{\texttt{#1}}
13 % File name, with index entry.
14 % The ``s'' prefix comes from ``special''.
15 \newcommand{\sfilename}[1]{\index{\texttt{#1} file}\texttt{#1}}
17 % Directory name, with index entry.
18 \newcommand{\sdirname}[1]{\index{\texttt{#1} directory}\texttt{#1}}
20 % Mercurial extension.
21 \newcommand{\hgext}[1]{\index{\texttt{#1} extension}\texttt{#1}}
23 % Mercurial command.
24 \newcommand{\hgcmd}[1]{\index{\texttt{#1} command}``\texttt{hg #1}''}
26 % Mercurial command, with arguments.
27 \newcommand{\hgcmdargs}[2]{\index{\texttt{#1} command}``\texttt{hg #1 #2}''}
29 % Shell/system command.
30 \newcommand{\command}[1]{\index{\texttt{#1} command}\texttt{#1}}
32 % Shell/system command, with arguments.
33 \newcommand{\cmdargs}[2]{\index{\texttt{#1} command}``\texttt{#1 #2}''}
35 % Mercurial command option.
36 \newcommand{\hgopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
38 % Mercurial global option.
39 \newcommand{\hggopt}[1]{\index{global options!\texttt{#1} option}\texttt{#1}}
41 % Shell/system command option.
42 \newcommand{\cmdopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
44 % Command option.
45 \newcommand{\option}[1]{\texttt{#1}}
47 % Software package.
48 \newcommand{\package}[1]{\index{\texttt{#1} package}\texttt{#1}}
50 % Section name from a hgrc file.
51 \newcommand{\rcsection}[1]{\index{\texttt{hgrc} file!\texttt{#1} section}\texttt{[#1]}}
53 % Named item in a hgrc file section.
54 \newcommand{\rcitem}[2]{\index{\texttt{hgrc} file!\texttt{#1}
55 section!\texttt{#2} entry}\texttt{#1.#2}}
57 % hgrc file.
58 \newcommand{\hgrc}{\index{\texttt{hgrc} file}\texttt{hgrc}}
60 % Hook name.
61 \newcommand{\hook}[1]{\index{\texttt{#1} hook}\index{hooks!\texttt{#1}}\texttt{#1}}
63 % Environment variable.
64 \newcommand{\envar}[1]{\index{\texttt{#1} environment
65 variable}\index{environment variables!\texttt{#1}}\texttt{#1}}
67 % Python module.
68 \newcommand{\pymod}[1]{\index{\texttt{#1} module}\texttt{#1}}
70 % Python class in a module.
71 \newcommand{\pymodclass}[2]{\index{\texttt{#1} module!\texttt{#2}
72 class}\texttt{#1.#2}}
74 % Note: blah blah.
75 \newsavebox{\notebox}
76 \newenvironment{note}%
77 {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Note:}\space}%
78 {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}}
80 % Code sample, eating 4 characters of leading space.
81 \DefineVerbatimEnvironment{codesample4}{Verbatim}{frame=single,gobble=4,numbers=left,commandchars=\\\{\}}
83 % Code sample, eating 2 characters of leading space.
84 \DefineVerbatimEnvironment{codesample2}{Verbatim}{frame=single,gobble=2,numbers=left,commandchars=\\\{\}}
86 % Interaction from the examples directory.
87 \newcommand{\interaction}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{examples/#1.out}}
89 % Graphics inclusion.
90 \ifpdf
91 \newcommand{\grafix}[1]{\includegraphics{#1}}
92 \else
93 \newcommand{\grafix}[1]{\includegraphics{#1.png}}
94 \fi
96 %%% Local Variables:
97 %%% mode: latex
98 %%% TeX-master: "00book"
99 %%% End: