comparison pldoc/pldoc.sty @ 2:546bfd3988b0

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