samer@2
|
1 % SWI-Prolog document-style
|
samer@2
|
2
|
samer@2
|
3 % Test for PDF generation using pdflatex
|
samer@2
|
4
|
samer@2
|
5 \usepackage{ifpdf}
|
samer@2
|
6 %Old tex versions
|
samer@2
|
7 %\newif\ifpdf
|
samer@2
|
8 %\ifx\pdfoutput\undefined
|
samer@2
|
9 % \pdffalse
|
samer@2
|
10 %\else
|
samer@2
|
11 % \pdfoutput=1
|
samer@2
|
12 % \pdftrue
|
samer@2
|
13 %\fi
|
samer@2
|
14
|
samer@2
|
15 % Get hyperrefs to work
|
samer@2
|
16
|
samer@2
|
17 \usepackage{makeidx}
|
samer@2
|
18 \usepackage{url}
|
samer@2
|
19
|
samer@2
|
20 \ifpdf
|
samer@2
|
21 \usepackage[pdftex,colorlinks=true,urlcolor=blue]{hyperref}
|
samer@2
|
22 \pdfcompresslevel=9
|
samer@2
|
23 % \pdfcatalog{
|
samer@2
|
24 % /PageMode /UseOutLines
|
samer@2
|
25 % }
|
samer@2
|
26 \usepackage[pdftex]{graphicx}
|
samer@2
|
27 \DeclareGraphicsExtensions{.pdf,.jpg,.png}
|
samer@2
|
28 \else
|
samer@2
|
29 \usepackage[dvips]{graphicx}
|
samer@2
|
30 \DeclareGraphicsExtensions{.eps,.ps}
|
samer@2
|
31 \fi
|
samer@2
|
32 \graphicspath{{figs/}{./}}
|
samer@2
|
33
|
samer@2
|
34 % Other styles
|
samer@2
|
35
|
samer@2
|
36 \usepackage{a4wide}
|
samer@2
|
37 \usepackage{longtable}
|
samer@2
|
38 \usepackage{ifthen}
|
samer@2
|
39 \usepackage{dcolumn}
|
samer@2
|
40 \usepackage{calc}
|
samer@2
|
41 \setlongtables
|
samer@2
|
42
|
samer@2
|
43 \catcode`\^^A=8% downarrow are for subscripts
|
samer@2
|
44 \catcode`\_=\active
|
samer@2
|
45 \def_{\ifmmode\else\_\fi}
|
samer@2
|
46 \def\vobeyspaces{\@vobeyspaces}
|
samer@2
|
47
|
samer@2
|
48 \newcommand{\onlinebreak}{}
|
samer@2
|
49
|
samer@2
|
50 % References
|
samer@2
|
51
|
samer@2
|
52 \newcommand{\secref}[1]{section~\ref{sec:#1}}
|
samer@2
|
53 \newcommand{\appref}[1]{appendix~\ref{sec:#1}}
|
samer@2
|
54 \newcommand{\chapref}[1]{chapter~\ref{sec:#1}}
|
samer@2
|
55 \newcommand{\figref}[1]{figure~\ref{fig:#1}}
|
samer@2
|
56 \newcommand{\tabref}[1]{table~\ref{tab:#1}}
|
samer@2
|
57
|
samer@2
|
58 \newcommand{\Secref}[1]{Section~\ref{sec:#1}}
|
samer@2
|
59 \newcommand{\Appref}[1]{Appendix~\ref{sec:#1}}
|
samer@2
|
60 \newcommand{\Chapref}[1]{Chapter~\ref{sec:#1}}
|
samer@2
|
61 \newcommand{\Figref}[1]{Figure~\ref{fig:#1}}
|
samer@2
|
62 \newcommand{\Tabref}[1]{Table~\ref{tab:#1}}
|
samer@2
|
63
|
samer@2
|
64 \newcommand{\tm}{$^{tm}$}
|
samer@2
|
65
|
samer@2
|
66 \newcommand{\reffont}{\tt}
|
samer@2
|
67 \newcommand{\predref}[2]{% % functor/arity
|
samer@2
|
68 \mbox{\reffont #1/#2}}
|
samer@2
|
69 \newcommand{\funcref}[2]{% % functor/arity
|
samer@2
|
70 \mbox{\reffont #1/#2}}
|
samer@2
|
71 \newcommand{\dcgref}[2]{% % functor//arity
|
samer@2
|
72 \mbox{\reffont #1//#2}}
|
samer@2
|
73 \newcommand{\qpredref}[3]{% % module:functor/arity
|
samer@2
|
74 \mbox{\reffont #1:#2/#3}}
|
samer@2
|
75 \newcommand{\qdcgref}[3]{% % module:functor//arity
|
samer@2
|
76 \mbox{\reffont #1:#2//#3}}
|
samer@2
|
77 \newcommand{\nopredref}[2]{% % functor/arity (external)
|
samer@2
|
78 \mbox{\reffont #1/#2}}
|
samer@2
|
79 \newcommand{\functor}[2]{% % functor/arity (no predicate)
|
samer@2
|
80 \mbox{\reffont #1/#2}}
|
samer@2
|
81 \newcommand{\manref}[2]{% % page(n)
|
samer@2
|
82 \mbox{{\reffont #1(}{\rm #2}{\tt )}}}
|
samer@2
|
83 \newcommand{\cfuncref}[2]{% % function(Args...)
|
samer@2
|
84 \mbox{{\reffont #1(}{\it #2}{\tt )}}}
|
samer@2
|
85 \newcommand{\prologflag}[1]{%
|
samer@2
|
86 \mbox{\reffont #1}}
|
samer@2
|
87
|
samer@2
|
88 % Descriptions (definitions) of various things
|
samer@2
|
89 % Note: I do not know where the 1ex comes from. This should fit
|
samer@2
|
90 % exactly, but appearently some dimension is missing. I suspect
|
samer@2
|
91 % a space creaping in somewhere.
|
samer@2
|
92
|
samer@2
|
93 \def\@nodescription{false}
|
samer@2
|
94
|
samer@2
|
95 \newcommand{\defentry}[1]{\definition{#1}}
|
samer@2
|
96 \newcommand{\definition}[1]{%
|
samer@2
|
97 \onlinebreak%
|
samer@2
|
98 \ifthenelse{\equal{\@nodescription}{true}}{%
|
samer@2
|
99 \def\@nodescription{false}%
|
samer@2
|
100 \makebox[-\leftmargin]{\mbox{}}\makebox[\linewidth+\leftmargin-1ex][l]{\bf #1}\\}{%
|
samer@2
|
101 \item[{\makebox[\linewidth+\leftmargin-1ex][l]{#1}}]}}
|
samer@2
|
102 \newcommand{\nodescription}{\def\@nodescription{true}}
|
samer@2
|
103
|
samer@2
|
104 \makeatletter
|
samer@2
|
105 \def\cmdlineoptionitem{\@ifstar{\@gluedcmdoptitem}{\@cmdoptitem}}
|
samer@2
|
106 \def\@gluedcmdoptitem#1#2{\definition{\texttt{#1}\var{#2}}}
|
samer@2
|
107 \def\@cmdoptitem#1#2{\definition{\texttt{#1} \var{#2}}}
|
samer@2
|
108 \makeatother
|
samer@2
|
109 \newcommand{\longoptionitem}[2]{%
|
samer@2
|
110 \ifthenelse{\equal{}{#2}}{%
|
samer@2
|
111 \definition{-{}-#1}}{%
|
samer@2
|
112 \definition{-{}-#1={\it #2}}}\ignorespaces}
|
samer@2
|
113 \newcommand{\longoption}[2]{%
|
samer@2
|
114 \ifthenelse{\equal{}{#2}}{%
|
samer@2
|
115 \mbox{\reffont -{}-#1}}{%
|
samer@2
|
116 \mbox{\reffont -{}-#1={\it #2}}}}
|
samer@2
|
117
|
samer@2
|
118 \newcommand{\traceoption}[3]{%
|
samer@2
|
119 \definition{{\tt #1} (#2)}#3%
|
samer@2
|
120 \ignorespaces}
|
samer@2
|
121 \newcommand{\pleaseoption}[3]{%
|
samer@2
|
122 \definition{#1 {\it #2} {\rm(default: \it #3)}}%
|
samer@2
|
123 \ignorespaces}
|
samer@2
|
124 %\prologflagitem{Name}{Type}{Access}
|
samer@2
|
125 \newcommand{\prologflagitem}[3]{%
|
samer@2
|
126 \definition{#1 {\it (#2%
|
samer@2
|
127 \ifthenelse{\equal{rw}{#3}}{, changeable}{})}}%
|
samer@2
|
128 \index{flag:#1}\ignorespaces}
|
samer@2
|
129 \newcommand{\escapeitem}[1]{%
|
samer@2
|
130 \definition{\Sesc{\tt #1}}
|
samer@2
|
131 \ignorespaces}
|
samer@2
|
132 \newcommand{\fmtchar}[1]{%
|
samer@2
|
133 \item[\tt #1]%
|
samer@2
|
134 \ignorespaces}
|
samer@2
|
135
|
samer@2
|
136 % \directive{Name}{Arity}{Args}
|
samer@2
|
137 % \predicate[Attibutes]{Name}{Arity}{Args}
|
samer@2
|
138 % \function[Attibutes]{Name}{Arity}{Args}
|
samer@2
|
139 % \infixop{Name}{Left}{Right}
|
samer@2
|
140 % \prefixop{Name}{Right}
|
samer@2
|
141 % \infixfunction{Name}{Left}{Right}
|
samer@2
|
142 % \prefixfunction{Name}{Right}
|
samer@2
|
143 % \dcg[Attibutes]{Name}{Arity}{Args}
|
samer@2
|
144 %
|
samer@2
|
145 % Predicate descriptions. Must appear in a description
|
samer@2
|
146 % environment.
|
samer@2
|
147
|
samer@2
|
148 \newcommand{\resitem}[1]{%
|
samer@2
|
149 \defentry{#1}%
|
samer@2
|
150 \index{#1}\ignorespaces}
|
samer@2
|
151 \makeatletter
|
samer@2
|
152 \def\predatt#1{\hfill{\it\footnotesize[#1]}}
|
samer@2
|
153 \def\predicate{\@ifnextchar[{\@attpredicate}{\@predicate}}
|
samer@2
|
154 \def\qpredicate{\@ifnextchar[{\@attqpredicate}{\@qpredicate}}
|
samer@2
|
155 \def\@predicate#1#2#3{%
|
samer@2
|
156 \ifthenelse{\equal{#2}{0}}{%
|
samer@2
|
157 \defentry{#1}}{%
|
samer@2
|
158 \defentry{#1({\it #3})}}%
|
samer@2
|
159 \index{#1/#2}\ignorespaces}
|
samer@2
|
160 \def\@attpredicate[#1]#2#3#4{%
|
samer@2
|
161 \ifthenelse{\equal{#3}{0}}{%
|
samer@2
|
162 \defentry{#2\predatt{#1}}}{%
|
samer@2
|
163 \defentry{#2({\it #4})\predatt{#1}}}%
|
samer@2
|
164 \index{#2/#3}\ignorespaces}
|
samer@2
|
165 \def\@qpredicate#1#2#3#4{%
|
samer@2
|
166 \ifthenelse{\equal{#3}{0}}{%
|
samer@2
|
167 \defentry{#1:#2}}{%
|
samer@2
|
168 \defentry{#1:#2({\it #4})}}%
|
samer@2
|
169 \index{#1/#2}\ignorespaces}
|
samer@2
|
170 \def\@attqpredicate[#1]#2#3#4#5{%
|
samer@2
|
171 \ifthenelse{\equal{#4}{0}}{%
|
samer@2
|
172 \defentry{#2:#3\predatt{#1}}}{%
|
samer@2
|
173 \defentry{#2:#3({\it #5})\predatt{#1}}}%
|
samer@2
|
174 \index{#2/#3}\ignorespaces}
|
samer@2
|
175 \def\directive{\@ifnextchar[{\@attdirective}{\@directive}}
|
samer@2
|
176 \def\@directive#1#2#3{%
|
samer@2
|
177 \ifthenelse{\equal{#2}{0}}{%
|
samer@2
|
178 \defentry{:- #1}}{%
|
samer@2
|
179 \defentry{:- #1({\it #3})}}%
|
samer@2
|
180 \index{#1/#2}\ignorespaces}
|
samer@2
|
181 \def\@attdirective[#1]#2#3#4{%
|
samer@2
|
182 \ifthenelse{\equal{#3}{0}}{%
|
samer@2
|
183 \defentry{:- #2\predatt{#1}}}{%
|
samer@2
|
184 \defentry{:- #2({\it #4})\predatt{#1}}}%
|
samer@2
|
185 \index{#2/#3}\ignorespaces}
|
samer@2
|
186 \def\dcg{\@ifnextchar[{\@attdcg}{\@dcg}}
|
samer@2
|
187 \def\@dcg#1#2#3{%
|
samer@2
|
188 \ifthenelse{\equal{#2}{0}}{%
|
samer@2
|
189 \defentry{#1}}{%
|
samer@2
|
190 \defentry{#1({\it #3}) \texttt{//}}}%
|
samer@2
|
191 \index{#1/#2}\ignorespaces}
|
samer@2
|
192 \def\@attdcg[#1]#2#3#4{%
|
samer@2
|
193 \ifthenelse{\equal{#3}{0}}{%
|
samer@2
|
194 \defentry{#2 \texttt{//}\predatt{#1}}}{%
|
samer@2
|
195 \defentry{#2({\it #4}) \texttt{//}\predatt{#1}}}%
|
samer@2
|
196 \index{#2//#3}\ignorespaces}
|
samer@2
|
197 \def\infixop{\@ifnextchar[{\@attinfixop}{\@infixop}}
|
samer@2
|
198 \def\@infixop#1#2#3{%
|
samer@2
|
199 \defentry{{\it #2} #1 {\it #3}}%
|
samer@2
|
200 \index{#1/2}\ignorespaces}
|
samer@2
|
201 \def\@attinfixop[#1]#2#3#4{%
|
samer@2
|
202 \defentry{{\it #3} #2 {\it #4}\predatt{#1}}%
|
samer@2
|
203 \index{#2/2}\ignorespaces}
|
samer@2
|
204 \def\prefixop{\@ifnextchar[{\@attprefixop}{\@prefixop}}
|
samer@2
|
205 \def\@prefixop#1#2{%
|
samer@2
|
206 \defentry{#1 {\it #2}}%
|
samer@2
|
207 \index{#1/1}\ignorespaces}
|
samer@2
|
208 \def\@attprefixop[#1]#2#3{%
|
samer@2
|
209 \defentry{#2 {\it #3}\predatt{#1}}%
|
samer@2
|
210 \index{#2/1}\ignorespaces}
|
samer@2
|
211 \let\function\predicate
|
samer@2
|
212 \let\infixfunction\infixop
|
samer@2
|
213 \let\prefixfunction\prefixop
|
samer@2
|
214 \makeatother
|
samer@2
|
215
|
samer@2
|
216 % \termitem{functor}{Args}
|
samer@2
|
217 % \infixtermitem{functor}{Left}{Right}
|
samer@2
|
218 % \prefixtermitem{functor}{Right}
|
samer@2
|
219 % \postfixtermitem{functor}{Left}
|
samer@2
|
220 %
|
samer@2
|
221 % Terms in description lists. Typically used to describe various
|
samer@2
|
222 % possible values or types for a term.
|
samer@2
|
223
|
samer@2
|
224 \newcommand{\termitem}[2]{%
|
samer@2
|
225 \ifthenelse{\equal{}{#2}}{%
|
samer@2
|
226 \definition{#1}}{%
|
samer@2
|
227 \definition{#1({\it #2})}}\ignorespaces}
|
samer@2
|
228 \newcommand{\infixtermitem}[3]{%
|
samer@2
|
229 \definition{{\it #2} #1 {\it #3}}\ignorespaces}
|
samer@2
|
230 \newcommand{\prefixtermitem}[2]{%
|
samer@2
|
231 \definition{#1 {\it #2}}\ignorespaces}
|
samer@2
|
232 \newcommand{\postfixtermitem}[2]{%
|
samer@2
|
233 \definition{{\it #2} #1}\ignorespaces}
|
samer@2
|
234
|
samer@2
|
235 % \term{functor}{Args}
|
samer@2
|
236 % \infixterm{functor}{Left}{Right}
|
samer@2
|
237 % \prefixterm{functor}{Right}
|
samer@2
|
238 % \postfixterm{functor}{Left}
|
samer@2
|
239 %
|
samer@2
|
240 % Terms used in running text.
|
samer@2
|
241
|
samer@2
|
242 \def\term{}
|
samer@2
|
243 \renewcommand{\term}[2]{%
|
samer@2
|
244 \ifthenelse{\equal{\protect}{\protect#2}}{%
|
samer@2
|
245 {\reffont #1}}{%
|
samer@2
|
246 {\reffont #1}({\it #2})}}
|
samer@2
|
247 \newcommand{\infixterm}[3]{{\it #2} #1 {\it #3}}
|
samer@2
|
248 \newcommand{\prefixterm}[2]{#1 {\it #2}}
|
samer@2
|
249 \newcommand{\postfixterm}[2]{{\it #2} #1}
|
samer@2
|
250 \newcommand{\errorterm}[2]{\mbox{\tt%
|
samer@2
|
251 \ifthenelse{\equal{}{#2}}{%
|
samer@2
|
252 #1}{%
|
samer@2
|
253 #1(#2)}}}
|
samer@2
|
254
|
samer@2
|
255
|
samer@2
|
256 \newcommand{\cfunction}[3]{%
|
samer@2
|
257 \defentry{{\tt #1} #2{\rm (}{\it #3}{\rm )}}%
|
samer@2
|
258 \index{#2()}\ignorespaces}
|
samer@2
|
259 \newcommand{\constructor}[2]{%
|
samer@2
|
260 \defentry{#1::#1{\rm (}{\it #2}{\rm )}}%
|
samer@2
|
261 \index{#1::#1()}\ignorespaces}
|
samer@2
|
262 \newcommand{\destructor}[1]{%
|
samer@2
|
263 \defentry{#1::\Stilde{}#1{\rm ()}}%
|
samer@2
|
264 \index{#1::\Stilde{}#1()}\ignorespaces}
|
samer@2
|
265 \newcommand{\cppcast}[2]{%
|
samer@2
|
266 \defentry{#1::operator #2{\rm ({\it void})}}%
|
samer@2
|
267 \index{#1::operator #2()}\ignorespaces}
|
samer@2
|
268 \newcommand{\cdecl}[2]{{\tt #1} {\em #2}}
|
samer@2
|
269 \newcommand{\cmacro}[3]{%
|
samer@2
|
270 \defentry{{\it #1} #2({\it #3})}%
|
samer@2
|
271 \index{#2()}\ignorespaces}
|
samer@2
|
272 \newcommand{\constitem}[1]{%
|
samer@2
|
273 \definition{#1}%
|
samer@2
|
274 \index{#1}\ignorespaces}
|
samer@2
|
275 \newcommand{\cglobalvar}[1]{{\tt #1}}
|
samer@2
|
276 \newcommand{\classitem}[1]{%
|
samer@2
|
277 \definition{Class #1}%
|
samer@2
|
278 \index{#1 \string\idxtype{class}}\ignorespaces}
|
samer@2
|
279 \newcommand{\menuitem}[2]{%
|
samer@2
|
280 \ifthenelse{\equal{\protect}{\protect#2}}{%
|
samer@2
|
281 \definition{\textsf #1}}{%
|
samer@2
|
282 \definition{\textsf #1 ({\it #2})}}%
|
samer@2
|
283 \index{#1 \string\idxtype{menu}}%
|
samer@2
|
284 \ignorespaces}
|
samer@2
|
285
|
samer@2
|
286
|
samer@2
|
287 % \tag{Keyword}
|
samer@2
|
288 %
|
samer@2
|
289 % PlDoc @keyword expansion. \mtag{Keyword} is a multi-valued tag
|
samer@2
|
290
|
samer@2
|
291 \newcommand{\tag}[1]{%
|
samer@2
|
292 \item[#1]}
|
samer@2
|
293 \newcommand{\mtag}[1]{%
|
samer@2
|
294 \item[#1]\mbox{}\\}
|
samer@2
|
295
|
samer@2
|
296 \newcommand{\bnfmeta}[1]{\ifmmode{\langle\mbox{\it #1}\rangle}\else$\langle\mbox{\it #1}\rangle$\fi}
|
samer@2
|
297 \newcommand{\bnfor}{\ifmmode\mid\else$\mid$\fi}
|
samer@2
|
298 \newcommand{\isa}{& ::= &}
|
samer@2
|
299 \newcommand{\ora}{& $\mid$ &}
|
samer@2
|
300
|
samer@2
|
301 \renewcommand{\arg}[1]{\ifmmode\mbox{\em #1}\else{\it #1}\fi}
|
samer@2
|
302 \newcommand{\class}[1]{{\em #1}\index{#1 \string\idxtype{class}}}
|
samer@2
|
303 \newcommand{\classs}[1]{{\em #1s}\index{#1 \string\idxtype{class}}}
|
samer@2
|
304 \newcommand{\demo}[1]{{\sf #1}\index{#1 \string\idxtype{demo}}}
|
samer@2
|
305 \newcommand{\pllib}[1]{{\texttt{#1}}\index{#1 \string\idxtype{library}}}
|
samer@2
|
306 \newcommand{\clib}[1]{{\tt #1}\index{#1 \string\idxtype{library}}}
|
samer@2
|
307 \newcommand{\tool}[1]{{\em #1}\index{#1 \string\idxtype{tool}}}
|
samer@2
|
308 \newcommand{\menuref}[1]{\textsf{#1}\index{#1 \string\idxtype{menu}}}
|
samer@2
|
309 \newcommand{\constf}[1]{{\reffont #1}}
|
samer@2
|
310 \newcommand{\const}[1]{{\tt #1}}
|
samer@2
|
311 \newcommand{\plflag}[1]{{\tt #1}}
|
samer@2
|
312 \newcommand{\type}[1]{{\reffont #1}}
|
samer@2
|
313 \newcommand{\idx}[1]{#1\index{#1}}
|
samer@2
|
314 \newcommand{\foreseen}[1]{\footnote{#1}}
|
samer@2
|
315 \newcommand{\metafile}[1]{\mbox{\tt #1}}
|
samer@2
|
316 \newcommand\file{\begingroup \urlstyle{tt}\Url}
|
samer@2
|
317 \newcommand\email{\begingroup \urlstyle{tt}\Url}
|
samer@2
|
318 \newcommand{\env}[1]{\mbox{\tt #1}}
|
samer@2
|
319 \newcommand{\except}[1]{\mbox{\tt #1}}
|
samer@2
|
320 \newcommand{\exam}[1]{\mbox{\tt #1}}
|
samer@2
|
321 \newcommand{\module}[1]{\mbox{\reffont #1}}
|
samer@2
|
322 \newcommand{\fileext}[1]{\mbox{\texttt{.#1}}}
|
samer@2
|
323 \newcommand{\option}[1]{\mbox{\tt #1}}
|
samer@2
|
324 \newcommand{\resource}[1]{\mbox{\reffont #1}}
|
samer@2
|
325 \newcommand{\cmdlineoption}[1]{\mbox{\tt #1}}
|
samer@2
|
326 \newcommand{\argoption}[2]{\mbox{\tt #1 \em #2}}
|
samer@2
|
327 \newcommand{\ctype}[1]{{\texttt{#1}}}
|
samer@2
|
328 \newcommand{\op}[1]{{\tt #1}}
|
samer@2
|
329 \newcommand{\program}[1]{\texttt{#1}}
|
samer@2
|
330 \newcommand{\manpage}[2]{{\bf #1}(#2)}
|
samer@2
|
331 \newcommand{\chr}[1]{{\tt #1}}
|
samer@2
|
332 \newcommand{\jargon}[1]{{\em #1}}
|
samer@2
|
333 \newcommand{\strong}[1]{{\bf #1}}
|
samer@2
|
334 \newcommand{\texcmd}[1]{{\Sesc}{\tt #1}}
|
samer@2
|
335 \newcommand{\texenv}[1]{{\tt #1}}
|
samer@2
|
336 \newcommand{\texmode}[1]{{\tt #1}}
|
samer@2
|
337 \newcommand{\HTML}[1]{{\bf #1}}
|
samer@2
|
338 \newcommand{\libdoc}[2]{\section{\pllib{#1}: #2}}
|
samer@2
|
339 \newcommand{\key}[1]{{\sf #1}}
|
samer@2
|
340 \newcommand{\menu}[2]{%
|
samer@2
|
341 {\sf #1}%
|
samer@2
|
342 \ifthenelse{\equal{#2}{}}{%
|
samer@2
|
343 }{%
|
samer@2
|
344 ~(\texttt{#2})}}
|
samer@2
|
345
|
samer@2
|
346 \newcommand\satom{\begingroup \urlstyle{tt}\Url}
|
samer@2
|
347 \newcommand\fmtseq{\begingroup \urlstyle{tt}\Url}
|
samer@2
|
348
|
samer@2
|
349 \urldef{\Sexe}\satom{#!} % #!
|
samer@2
|
350 \urldef{\Scgt}\satom{#>} % #>
|
samer@2
|
351 \urldef{\Scge}\satom{#>=} % #>=
|
samer@2
|
352 \urldef{\Sclt}\satom{#<} % #<
|
samer@2
|
353 \urldef{\Scle}\satom{#=<} % #=<
|
samer@2
|
354 \urldef{\Sceq}\satom{#=} % #=
|
samer@2
|
355 \urldef{\Scne}\satom{#\=} % #\=
|
samer@2
|
356 \urldef{\Scnot}\satom{#\} % #\
|
samer@2
|
357 \urldef{\Scor}\satom{#\/} % #\/
|
samer@2
|
358 \urldef{\Scand}\satom{#/\} % #/\
|
samer@2
|
359 \urldef{\Sequiv}\satom{#<=>} % #<=>
|
samer@2
|
360 \urldef{\Slimpl}\satom{#<=} % #<=
|
samer@2
|
361 \urldef{\Srimpl}\satom{#=>} % #=>
|
samer@2
|
362 \urldef{\Slimplies}\satom{#<==} % #<==
|
samer@2
|
363 \urldef{\Srimplies}\satom{#==>} % #==>
|
samer@2
|
364 \urldef{\Scequal}\satom{#<==>} % #<==>
|
samer@2
|
365 \urldef{\Scieq}\satom{#=:=} % #=:=
|
samer@2
|
366 \urldef{\Scine}\satom{#=\=} % #=\=
|
samer@2
|
367 \urldef{\Shash}\satom{#} % #
|
samer@2
|
368 \urldef{\Scut}\satom{!} % !
|
samer@2
|
369 \urldef{\Scomma}\satom{,} % ,
|
samer@2
|
370 \urldef{\Sifthen}\satom{->} % ->
|
samer@2
|
371 \urldef{\Ssoftcut}\satom{*->} % *->
|
samer@2
|
372 \urldef{\Sdot}\satom{.} % .
|
samer@2
|
373 \urldef{\Ssemicolon}\satom{;} % ;
|
samer@2
|
374 \urldef{\Slt}\satom{<} % <
|
samer@2
|
375 \urldef{\Sxor}\satom{><} % ><
|
samer@2
|
376 \urldef{\Seq}\satom{=} % =
|
samer@2
|
377 \urldef{\Suniv}\satom{=..} % =..
|
samer@2
|
378 \urldef{\Saeq}\satom{=:=} % =:=
|
samer@2
|
379 \urldef{\Sle}\satom{=<} % =<
|
samer@2
|
380 \urldef{\Sel}\satom{<=} % <=
|
samer@2
|
381 \urldef{\Sequal}\satom{==} % ==
|
samer@2
|
382 \urldef{\Sstructeq}\satom{=@=} % =@=
|
samer@2
|
383 \urldef{\Sstructneq}\satom{\=@=} % \=@=
|
samer@2
|
384 \urldef{\Sane}\satom{=\=} % =\=
|
samer@2
|
385 \urldef{\Sgt}\satom{>} % >
|
samer@2
|
386 \urldef{\Sge}\satom{>=} % >=
|
samer@2
|
387 \urldef{\Stlt}\satom{@<} % @<
|
samer@2
|
388 \urldef{\Stle}\satom{@=<} % @=<
|
samer@2
|
389 \urldef{\Stgt}\satom{@>} % @>
|
samer@2
|
390 \urldef{\Stge}\satom{@>=} % @>=
|
samer@2
|
391 \urldef{\Snot}\satom{\+} % \+
|
samer@2
|
392 \urldef{\Sne}\satom{\=} % \=
|
samer@2
|
393 \urldef{\Snequal}\satom{\==} % \==
|
samer@2
|
394 \urldef{\Shat}\satom{^} % ^
|
samer@2
|
395 \urldef{\Sbar}\satom{|} % |
|
samer@2
|
396 \urldef{\Stimes}\satom{*} % *
|
samer@2
|
397 \urldef{\Spow}\satom{**} % **
|
samer@2
|
398 \urldef{\Splus}\satom{+} % +
|
samer@2
|
399 \urldef{\Sminus}\satom{-} % -
|
samer@2
|
400 \urldef{\Sdiv}\satom{/} % /
|
samer@2
|
401 \urldef{\Sidiv}\satom{//} % //
|
samer@2
|
402 \urldef{\Sand}\satom{/\} % /\
|
samer@2
|
403 \urldef{\Slshift}\satom{<<} % <<
|
samer@2
|
404 \urldef{\Srshift}\satom{>>} % >>
|
samer@2
|
405 \urldef{\Sneg}\satom{\} % \
|
samer@2
|
406 \urldef{\Sesc}\satom{\} % \
|
samer@2
|
407 \urldef{\Sor}\satom{\/} % \/
|
samer@2
|
408 \urldef{\Sdollar}\satom{$} % $
|
samer@2
|
409 \urldef{\Squest}\satom{?} % ?
|
samer@2
|
410 \urldef{\Smodule}\satom{:} % :
|
samer@2
|
411 \urldef{\Sneck}\satom{:-} % :-
|
samer@2
|
412 \urldef{\Sdirective}\satom{?-} % ?-
|
samer@2
|
413 \urldef{\Sdcg}\satom{-->} % -->
|
samer@2
|
414 \urldef{\Bc}\satom{\c} % \c
|
samer@2
|
415 \urldef{\Bn}\satom{\n} % \n
|
samer@2
|
416 \urldef{\Br}\satom{\r} % \r
|
samer@2
|
417 \urldef{\Bl}\satom{\l} % \l
|
samer@2
|
418 \urldef{\BB}\satom{\\} % \\
|
samer@2
|
419 \urldef{\Stilde}\satom{~} % ~
|
samer@2
|
420 \urldef{\Spercent}\satom{%} % %
|
samer@2
|
421 \urldef{\Shash}\satom{#} % #
|
samer@2
|
422 \urldef{\Scurl}\satom{{}} % {}
|
samer@2
|
423 \urldef{\SxXX}\satom{xXX..\} % xXX..\
|
samer@2
|
424
|
samer@2
|
425 \newcommand{\bug}[1]{\footnote{BUG: #1}}
|
samer@2
|
426
|
samer@2
|
427 \newcommand{\mod}[2]{#1 \mbox{\rm mod} #2}
|
samer@2
|
428 \newcommand{\rem}[2]{#1 \mbox{\rm rem} #2}
|
samer@2
|
429 \newcommand{\pow}[2]{{#1}^{#2}}
|
samer@2
|
430 \newcommand{\bsl}[0]{\Sesc}
|
samer@2
|
431
|
samer@2
|
432 % Index handling
|
samer@2
|
433
|
samer@2
|
434 \newcommand{\idxtype}[1]{{\small\em #1}}
|
samer@2
|
435
|
samer@2
|
436 % Prolog predicate summary
|
samer@2
|
437
|
samer@2
|
438 \newenvironment{summarylist}[1]{\begin{longtable}[l]{#1}}{\end{longtable}}
|
samer@2
|
439 \newcommand{\predicatesummary}[3]{#1/#2 & #3 \\}
|
samer@2
|
440 \newcommand{\oppredsummary}[5]{#1/#2 & #5 \\}
|
samer@2
|
441 \newcommand{\functionsummary}[3]{#1/#2 & #3 \\}
|
samer@2
|
442 \newcommand{\opfuncsummary}[5]{#1/#2 & #5 \\}
|
samer@2
|
443 \newcommand{\opsummary}[4]{#3 & #1 & #2 & #4 \\}
|
samer@2
|
444 \newcommand{\hook}[1]{(hook)}
|
samer@2
|
445
|
samer@2
|
446
|
samer@2
|
447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
samer@2
|
448 % CODE environment %
|
samer@2
|
449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
samer@2
|
450
|
samer@2
|
451 \usepackage{fancyvrb}
|
samer@2
|
452 \usepackage{color}
|
samer@2
|
453
|
samer@2
|
454 %\definecolor{codeboxcolor}{rgb}{0.7,0.7,0.7}
|
samer@2
|
455 \definecolor{codeboxcolor}{rgb}{0.4,0.4,0.4}
|
samer@2
|
456 \DefineVerbatimEnvironment%
|
samer@2
|
457 {code}{Verbatim}
|
samer@2
|
458 {frame=single,
|
samer@2
|
459 framerule=0.2pt,
|
samer@2
|
460 rulecolor=\color{codeboxcolor},
|
samer@2
|
461 }
|
samer@2
|
462
|
samer@2
|
463
|
samer@2
|
464 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
samer@2
|
465 % INCLUDE FIGURES %
|
samer@2
|
466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
samer@2
|
467
|
samer@2
|
468 % PostScript figures
|
samer@2
|
469 % \postscriptfig[width=5in]{label}{Title}
|
samer@2
|
470
|
samer@2
|
471 \makeatletter
|
samer@2
|
472 \def\postscriptfig{\@ifnextchar[{\@scaledpostscriptfig}{\@postscriptfig}}
|
samer@2
|
473 \def\@scaledpostscriptfig[#1]#2#3{%
|
samer@2
|
474 \begin{figure}%
|
samer@2
|
475 \centerline{\includegraphics[#1]{#2}}
|
samer@2
|
476 \caption{#3}
|
samer@2
|
477 \label{fig:#2}
|
samer@2
|
478 \end{figure}}
|
samer@2
|
479 \def\@postscriptfig#1#2{%
|
samer@2
|
480 \begin{figure}%
|
samer@2
|
481 \centerline{\includegraphics{#1}}
|
samer@2
|
482 \caption{#2}
|
samer@2
|
483 \label{fig:#1}
|
samer@2
|
484 \end{figure}}
|
samer@2
|
485 \makeatother
|
samer@2
|
486
|
samer@2
|
487 % \begin{tabularlp}{longest-text}
|
samer@2
|
488
|
samer@2
|
489 \newlength{\tabDright}
|
samer@2
|
490 \newlength{\tabDleft}
|
samer@2
|
491 \newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
|
samer@2
|
492 \newcommand{\raggedrightcolumn}{\PreserveBackslash\raggedright\hspace{0pt}}
|
samer@2
|
493 \newenvironment{tabularlp}[1]%
|
samer@2
|
494 {\settowidth{\tabDleft}{#1}%
|
samer@2
|
495 \setlength{\tabDright}{\linewidth-\columnsep*3-\tabDleft}%
|
samer@2
|
496 \begin{tabular}{|p{\tabDleft}|>{\raggedrightcolumn}p{\tabDright}|}}%
|
samer@2
|
497 {\end{tabular}}
|
samer@2
|
498
|
samer@2
|
499 % \begin{tags} ... \end{tags}
|
samer@2
|
500
|
samer@2
|
501 \newenvironment{tags}%
|
samer@2
|
502 {\begin{quote}\begin{description}%
|
samer@2
|
503 \setlength{\itemsep}{0pt}%
|
samer@2
|
504 \footnotesize}%
|
samer@2
|
505 {\end{description}\end{quote}}
|
samer@2
|
506
|
samer@2
|
507
|
samer@2
|
508 % \begin{parameters} ... \end{parameters}
|
samer@2
|
509
|
samer@2
|
510 \newenvironment{parameters}%
|
samer@2
|
511 {\par%
|
samer@2
|
512 \makebox[\linewidth]{\hfill\footnotesize Parameters}
|
samer@2
|
513 \begin{tabular*}{\linewidth}{lp{0.7\linewidth}}
|
samer@2
|
514 \hline}%
|
samer@2
|
515 {\end{tabular*}}
|
samer@2
|
516
|
samer@2
|
517
|