hgbook
view en/99defs.tex @ 171:8c1703a98266
Add a dependency on htlatex to HTML targets, even though we don't call it.
If the files it ships with aren't present, we can't build HTML.
If the files it ships with aren't present, we can't build HTML.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon Mar 26 23:57:58 2007 -0700 (2007-03-26) |
parents | 1e013fbe35f7 |
children | 7b812c428074 |
line source
1 % Bug ID.
2 \newcommand{\bug}[1]{\index{Mercurial bug
3 database!\href{http://www.selenic.com/mercurial/bts/issue#1}{bug
4 ~#1}}\href{http://www.selenic.com/mercurial/bts/issue#1}{Mercurial
5 bug no.~#1}}
7 % File name in the user's home directory.
8 \newcommand{\tildefile}[1]{\texttt{\~{}/#1}}
10 % File name.
11 \newcommand{\filename}[1]{\texttt{#1}}
13 % Directory name.
14 \newcommand{\dirname}[1]{\texttt{#1}}
16 % File name, with index entry.
17 % The ``s'' prefix comes from ``special''.
18 \newcommand{\sfilename}[1]{\index{\texttt{#1} file}\texttt{#1}}
20 % Directory name, with index entry.
21 \newcommand{\sdirname}[1]{\index{\texttt{#1} directory}\texttt{#1}}
23 % Mercurial extension.
24 \newcommand{\hgext}[1]{\index{\texttt{#1} extension}\texttt{#1}}
26 % Mercurial command.
27 \newcommand{\hgcmd}[1]{\index{\texttt{#1} command}``\texttt{hg #1}''}
29 % Mercurial command, with arguments.
30 \newcommand{\hgcmdargs}[2]{\index{\texttt{#1} command}``\texttt{hg #1 #2}''}
32 \newcommand{\tplkword}[1]{\index{\texttt{#1} template keyword}\index{template keywords!\texttt{#1}}\texttt{#1}}
34 \newcommand{\tplkwfilt}[2]{\index{\texttt{#1} template keyword!\texttt{#2}
35 filter}\index{template filters!\texttt{#2}}\index{\texttt{#2}
36 template filter}\texttt{#2}}
38 \newcommand{\tplfilter}[1]{\index{template
39 filters!\texttt{#1}}\index{\texttt{#1} template
40 filter}\texttt{#1}}
42 % Shell/system command.
43 \newcommand{\command}[1]{\index{\texttt{#1} command}\texttt{#1}}
45 % Shell/system command, with arguments.
46 \newcommand{\cmdargs}[2]{\index{\texttt{#1} command}``\texttt{#1 #2}''}
48 % Mercurial command option.
49 \newcommand{\hgopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
51 % Mercurial global option.
52 \newcommand{\hggopt}[1]{\index{global options!\texttt{#1} option}\texttt{#1}}
54 % Shell/system command option.
55 \newcommand{\cmdopt}[2]{\index{\texttt{#1} command!\texttt{#2} option}\texttt{#2}}
57 % Command option.
58 \newcommand{\option}[1]{\texttt{#1}}
60 % Software package.
61 \newcommand{\package}[1]{\index{\texttt{#1} package}\texttt{#1}}
63 % Section name from a hgrc file.
64 \newcommand{\rcsection}[1]{\index{\texttt{hgrc} file!\texttt{#1} section}\texttt{[#1]}}
66 % Named item in a hgrc file section.
67 \newcommand{\rcitem}[2]{\index{\texttt{hgrc} file!\texttt{#1}
68 section!\texttt{#2} entry}\texttt{#2}}
70 % hgrc file.
71 \newcommand{\hgrc}{\index{\texttt{hgrc} file}\texttt{hgrc}}
73 % Hook name.
74 \newcommand{\hook}[1]{\index{\texttt{#1} hook}\index{hooks!\texttt{#1}}\texttt{#1}}
76 % Environment variable.
77 \newcommand{\envar}[1]{\index{\texttt{#1} environment
78 variable}\index{environment variables!\texttt{#1}}\texttt{#1}}
80 % Python module.
81 \newcommand{\pymod}[1]{\index{\texttt{#1} module}\texttt{#1}}
83 % Python class in a module.
84 \newcommand{\pymodclass}[2]{\index{\texttt{#1} module!\texttt{#2}
85 class}\texttt{#1.#2}}
87 % Python function in a module.
88 \newcommand{\pymodfunc}[2]{\index{\texttt{#1} module!\texttt{#2}
89 function}\texttt{#1.#2}}
91 % Note: blah blah.
92 \newsavebox{\notebox}
93 \newenvironment{note}%
94 {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Note:}\space}%
95 {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}}
96 \newenvironment{caution}%
97 {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Caution:}\space}%
98 {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}}
100 % Code sample, eating 4 characters of leading space.
101 \DefineVerbatimEnvironment{codesample4}{Verbatim}{frame=single,gobble=4,numbers=left,commandchars=\\\{\}}
103 % Code sample, eating 2 characters of leading space.
104 \DefineVerbatimEnvironment{codesample2}{Verbatim}{frame=single,gobble=2,numbers=left,commandchars=\\\{\}}
106 % Interaction from the examples directory.
107 \newcommand{\interaction}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{examples/#1.lxo}}
108 % Example code from the examples directory.
109 \newcommand{\excode}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{../examples/#1}}
111 % Graphics inclusion.
112 \ifpdf
113 \newcommand{\grafix}[1]{\includegraphics{#1}}
114 \else
115 \newcommand{\grafix}[1]{\includegraphics{#1.png}}
116 \fi
118 % Reference entry for a command.
119 \newcommand{\cmdref}[2]{\section{\hgcmd{#1}---#2}\label{cmdref:#1}\index{\texttt{#1} command}}
121 % Reference entry for a command option with long and short forms.
122 \newcommand{\optref}[3]{\subsubsection{\hgopt{#1}{--#3}, also \hgopt{#1}{-#2}}}
124 % Reference entry for a command option with only long form.
125 \newcommand{\loptref}[2]{\subsubsection{\hgopt{#1}{--#2} option}}
127 %%% Local Variables:
128 %%% mode: latex
129 %%% TeX-master: "00book"
130 %%% End: