1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
|
.\" Copyright (c) 2010 Stijn van Dongen
.TH "aephea-base" 7 "8 Jan 2010" "aephea-base 1\&.002, 10-008" "MISCELLANEOUS "
.po 2m
.de ZI
.\" Zoem Indent/Itemize macro I.
.br
'in +\\$1
.nr xa 0
.nr xa -\\$1
.nr xb \\$1
.nr xb -\\w'\\$2'
\h'|\\n(xau'\\$2\h'\\n(xbu'\\
..
.de ZJ
.br
.\" Zoem Indent/Itemize macro II.
'in +\\$1
'in +\\$2
.nr xa 0
.nr xa -\\$2
.nr xa -\\w'\\$3'
.nr xb \\$2
\h'|\\n(xau'\\$3\h'\\n(xbu'\\
..
.if n .ll -2m
.am SH
.ie n .in 4m
.el .in 8m
..
.SH NAME
aephea-base \- a description of Aephea base definitions
The macros in this package have been ported to both html and
troff\&.
.SH DESCRIPTION
\fIaephea-base\fP \- A description of Aephea base definitions\&.
The macros in this package have been ported to both html and troff\&.
This package is used by the Aephea \fCsimpledocument\fP class
and by the Portable Unix Documentation (pud) mini-languages for
authoring manual pages (\fBpud-man\fP) and the pud language
for faq authoring (\fBpud-faq\fP)\&.
There is a small list of known issues in the \fBISSUES\fP section,
mostly concerning the troff device\&. These should generally be of no
concern at all, but if you run into trouble look there first\&. A quick
glance through the list \fIbefore\fP you run into trouble may be the
wisest thing to do\&.
.SH INTRODUCTION TO THE ITEMIZE ENVIRONMENT
The \fIitemize\fP environemnt is the Aephea workhorse for lists,
enumerations, itemizations, and other tailed creatures\&. A simple and
valid use is for example
.di ZV
.in 0
.nf \fC
\ebegin{itemize}
\eitem{\ebf{foo}}
\ecar{
For I am foo\&.
}
\eitems{
{\ebf{barra}}
{\ebf{zuttelezut}}
}
\ecar{
For we are bar and zut\&.
}
\eend{itemize}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR
This source result in the following output:
.ZI 2m "\fBfoo\fP"
\&
.br
For I am foo\&.
.in -2m
.ZI 2m "\fBbarra\fP"
\&
'in -2m
.ZI 2m "\fBzuttelezut\fP"
\&
'in -2m
'in +2m
\&
.br
For we are bar and zut\&.
.in -2m
This is not impressive at all, but it gives an idea of how itemize works\&.
The following example is a single itemize environment providing a
rollercoasterride through most of the features of the itemize environment\&.
As shown below, it is possible to change all the itemize settings and styles
at will even within a single itemize instance\&. Of course this is not useful
at all except for demonstrating the \fIitemize\fP capabilities, but it goes
to show that the itemize macros are quite robust (by virtue of modularity)\&.
\fBNOTE\fP
.br
The entire listing below was put in Aephea\&'s \fIspacing\fP environment,
described further below\&. The environment was used to create
extra margins on the two sides\&.
.in +2m
.ll -2m
.ZJ 2m 2m "1"
Spacing modes \fIcompact\fP and \fIcascade\fP are determined by the key \fIflow\fP\&.
The current mode is \fIcompact\fP, meaning that the itemize token and the ensuing text are on the same line\&.
Below, compact mode is switched off (approximately) halfway\&.
The \fIinteritem\fP key determines the amount skipped between an item description
and the next item\&.
.in -4m
.ZJ 2m 2m "2"
Several item modes (custom, mark, enumeration)\&.
.in -4m
.ZJ 2m 2m "3"
Several enumeration modes (roman, arabic, alphabetic)\&.
.in -4m
.ZJ 2m 2m "iv)"
The style of a list can be changed while in the middle of it\&.
.in -4m
.ZJ 2m 2m "v)"
Nuther item\&.
.in -4m
.ZJ 2m 2m "vi)"
The list can be \&'interupted\&' and resumed (by means of
the \fC\eintermezzo#1\fP macro)\&.
.in -4m
Perhaps you wonder what good is THAT for, and justly so\&.
The \fC\eintermezzo#1\fP macro should only be used inbetween different
items, i\&.e\&. it should \fInot\fP split content belonging to a single item\&.
.in -4m
.ZJ 2m 2m "[7]"
Items can be optionally and automatically
right and/or left delimited\&. The current
item is delimited with square brackets\&.
.in -4m
.ZI 4m "[8]"
Items can be left or right aligned\&.
.in -4m
.ZI 4m "[9]"
Items can be stacked, which is supported only when \fIflow\fP is set to \fIcascade\fP\&.
.in -4m
.ZI 4m "[10]"
\&
.br
Beginning with this item, \fIflow\fP is set to \fIcascade\fP\&.
.in -4m
.ZI 4m "Implying"
\&
'in -4m
.ZI 4m "That"
\&
'in -4m
.ZI 4m "Stacking"
\&
'in -4m
'in +4m
\&
.br
is now possible\&.
.in -4m
.ZJ 2m 2m "[12]"
\&
.br
(back to right-align) The itemcounter just keeps running by the way\&.
.in -4m
.ZJ 2m 2m "[18]"
(back to compact) But the counter can be manipulated at will\&.
.in -4m
.ZJ 2m 2m "\(bu"
A bullet item\&.
.in -4m
.ZJ 2m 2m "\(bu"
Now \fIinteritem\fP is set to 0 (affecting the current list), and a new list
is started contiguous to the present text (by having its margintop set to 0)\&.
.ZJ 2m 2m "a\&."
Hubris
.in -4m
.ZJ 2m 2m "b\&."
Laziness
.in -4m
.ZJ 2m 2m "c\&."
Impatience
.in -4m
Are the three virtues of programming\&.
.in -4m
.ZJ 2m 2m "\(bu"
This concludes a listing showing most of the itemize capabilities\&.
.in -4m
.in -2m
.ll +2m
.SH USING THE ITEMIZE ENVIRONMENT
You steer the itemize environment by providing it with tag-value pairs like so:
.di ZV
.in 0
.nf \fC
\ebegin{itemize}{
{flow}{compact}
{interitem}{1}
{align}{right}
{type}{abc}
{rp}{\&.}
}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR
This is the list of tags that you may use\&.
.ZI 2m "\fImargintop\fP"
\&
.br
Top of table, anomalous unit (ems), default 0\&.
.in -2m
.ZI 2m "\fIinteritem\fP"
\&
.br
Paragraph skip in \fIems\fP inbetween items, default 0\&.
.in -2m
.ZI 2m "\fIflow\fP"
\&
.br
Set to compact or cascade
.in -2m
.ZI 2m "\fItextindent\fP"
\&
.br
Width of text indent in ems\&.
.in -2m
.ZI 2m "\fIitemmargin\fP"
\&
.br
Width of item margin in ems (for right-aligned items)\&.
.in -2m
.ZI 2m "\fImark\fP"
\&
.br
E\&.g\&. \fC\e*{itembullet}\fP (if type=mark), affects \fC\eitem\fP\&.
.in -2m
.ZI 2m "\fIalign\fP"
\&
.br
One of left or right (item alignment), default left\&.
.in -2m
.ZI 2m "\fIclass_all\fP"
\&
.br
class name assigned to all block-level elements
.in -2m
.ZI 2m "\fIlp\fP"
\&
.br
What\&'s printed immediately to the left of an item\&.
.in -2m
.ZI 2m "\fIrp\fP"
\&
.br
What\&'s printed immediately to the right of an item\&.
.in -2m
.ZI 2m "\fItype\fP"
\&
.br
One of mark, roman, abc, arabic, affects \fC\eitem\fP\&.
.in -2m
.ZI 2m "\fIitemcount\fP"
\&
.br
The count of items seen so far, e\&.g\&. 13 right now\&.
.in -2m
You need to know that the itemize environment internally maps these tags
to dollar keys simply by prepending a dollar\&.
Thus, if you want to reset one of the values associated with such a tag,
you need to do e\&.g\&.
.di ZV
.in 0
.nf \fC
\eset{$align}{right}
\eset{$itemcount}{30}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR
A more robust to do this is to ensure that the modified key is retrieved
from the right dictionary, i\&.e\&. the top-level \fIitemize\fP dictionary,
as follows\&.
.di ZV
.in 0
.nf \fC
\eset{{dict}{itemize}}{$align}{right}
\eset{{dict}{itemize}}{$itemcount}{30}
.fi \fR
.in
.di
.ne \n(dnu
.nf \fC
.ZV
.fi \fR
.SH THE SPACING ENVIRONMENT
Its syntax is identical to that of the \fIitemize\fP environment\&.
It accepts tags \fIleft\fP, \fIright\fP, \fItop\fP, and \fIbottom\fP\&.
These should receive numeric values\&. The associated
unit is \fIem\fP\&.
The troff device does not yet support the \fItop\fP and \fIbottom\fP
tags\&.
.SH MACROS
.ZI 2m "\e\fBenref#2\fP"
\&
'in -2m
.ZI 2m "\e\fBiref#2\fP"
\&
'in -2m
.ZI 2m "\e\fBlref#2\fP"
\&
'in -2m
.ZI 2m "\e\fBaref#2\fP"
\&
'in -2m
.ZI 2m "\e\fBhttpref#1\fP"
\&
'in -2m
.ZI 2m "\e\fBsibref#1\fP"
\&
'in -2m
.ZI 2m "\e\fBsibref#2\fP"
\&
'in -2m
.ZI 2m "\e\fBsibref#3\fP"
\&
'in -2m
'in +2m
\&
.br
\fC\eenref#2\fP \fIcreates\fP a link for which the first argument is the anchor
and for which the second argument is the content (which can be left empty)\&.
\fC\eiref#2\fP takes such an anchor as the first argument and it takes content
that carries the link as the second argument\&. \fC\elref#2\fP takes a file name
(possibly including a relative or absolute path) as the first argument and
content as the second argument\&. \fC\earef#2\fP takes a URL (later possibly a
URI) as the first argument and content as the second argument\&. \fC\esibref#2\fP
takes a label as argument which presumably is the name of some application\&.
It may append an extension depending on the current device, and it assumes
that \fClabel + extension\fP is the name of a file in the current directory\&.
The second argument is displayed in the text\&. For \fC\esibref#1\fP the
displayed text is the same as the label\&. For \fC\esibref#3\fP the second
argument is an additional anchor within the file being linked to, and
the third argument is the displayed text\&.
\fC\ehttpref#1\fP simply prints a URL which will be active when html is output\&.
.in -2m
.ZI 2m "\e\fBpar#1\fP"
\&
'in -2m
.ZI 2m "\e\fBcpar#2\fP"
\&
'in -2m
.ZI 2m "\e\fBcar#1\fP"
\&
'in -2m
.ZI 2m "\e\fBccar#2\fP"
\&
'in -2m
'in +2m
\&
.br
These are all paragraph macros that carry the paragraph content as
the last argument\&. The first argument of \fC\ecpar#2\fP and \fC\eccar#2\fP
is the caption\&. These macros will ensure well-formedness for devices
that support it, such as html\&.
Use \fC\ecar#1\fP where you don\&'t need a paragraph skip, but just need to
indicate that you are in text mode again\&. You can simply always use
\fC\epar#1\fP and never use \fC\ecar#1\fP\&. If you care about the details of spacing
though, or if you have particular trouble for example in creating an itemize
environment where you do not want top and bottom margins, then it could be
worthwile to turn to \fC\ecar#1\fP\&. Examples for using \fC\ecar#1\fP are:
.ZJ 1m 1m "\(bu"
After an environment that always carries a bottom margin\&.
.in -2m
.ZJ 1m 1m "\(bu"
After an environment that does \fInot\fP carry a bottom margin,
and where you specifically want the environment to be contiguous to the
enclosing text\&. The listing you are currently reading is an
example of this\&.
.in -2m
As promised\&. The \fC\ecar\fP macro may feel a little unusual\&. If you don\&'t mind
standing the chance of a little spurious vertical white-space just use
\fC\epar\fP all the time\&. If you really need it, such as in an \&'inline\&' listing
as above, the \fC\ecar\fP macro is ready to do the job\&.
.in -2m
.ZI 2m "\e\fBbf#1\fP"
\&
'in -2m
.ZI 2m "\e\fBit#1\fP"
\&
'in -2m
.ZI 2m "\e\fBtt#1\fP"
\&
'in -2m
.ZI 2m "\e\fBv#1\fP"
\&
'in -2m
.ZI 2m "\e\fBftinc#2\fP"
\&
'in -2m
.ZI 2m "\e\fBftdec#2\fP"
\&
'in -2m
'in +2m
\&
.br
The first four items set their argument in the \fBfont\fP \fIspecified\fP\&.
\fC\ett#1\fP and \fC\ev#1\fP both denote a typewriter font\&. \fIThese macros should
not be nested if troff is to be among the output devices\fP\&. Support for the
last two items is not yet very robust\&. They temporarily \s+1increment\s-1
respectively \s-1decrement\s+1 the font by the amount of the first argument and
apply the resulting setting to the second argument\&.
.in -2m
.ZI 2m "\e\fBverbatim#1\fP"
\&
'in -2m
.ZI 2m "\e\fBverbatix#1\fP"
\&
'in -2m
'in +2m
\&
.br
Make the device output the contents verbatim in a mono-spaced font,
obeying spaces and newlines\&. This does not prohibit expansion of
macros, use \fC\eprotect#1\fP for that\&. The macro \fC\everbatim#1\fP will
create a non-breaking environment\&.
.in -2m
.SH ISSUES
.ZI 2m "\fBNesting\fP"
\&
.br
Do not nest \fC\ebf#1\fP, \fC\eit#1\fP, \fC\ett#1\fP, or \fC\ev#1\fP macros if troff is
among the output devices\&. It will yield unexpected results\&.
.in -2m
The rest of this list pertains to the \fIitemize\fP environment\&.
.in -2m
.ZI 2m "\fBMargins\fP"
\&
.br
Do not use fractional values for \fCtextindent\fP and \fCitemmargin\fP in the itemize
environment, if troff is among the output devices\&.
The reason is that the Aephea macros use the difference between these two values
and pass them on to the output devices\&. Troff rounds all values it gets
and thus the additive relationship between the values may be lost\&.
.in -2m
|