5
In the following section, boxes containing text in typewriter-like font are
6
examples of APT source.
11
A short APT document is contained in a single text file. A longer document
12
may be contained in a ordered list of text files. For instance, first text
13
file contains section 1, second text file contains section 2, and so on.
15
[Note:] Splitting the APT document in several text files on a section
16
boundary is not mandatory. The split may occur anywhere.
17
However doing so is recommended because a text file containing a
18
section is by itself a valid APT document.
20
A file contains a sequence of paragraphs and ``displays'' (non paragraphs
21
such as tables) separated by open lines.
23
A paragraph is simply a sequence of consecutive text lines.
25
+------------------------------------------------------------------------+
26
First line of first paragraph.
27
Second line of first paragraph.
28
Third line of first paragraph.
30
Line 1 of paragraph 2 (separated from first paragraph by an open line).
31
Line 2 of paragraph 2.
32
+------------------------------------------------------------------------+
34
The indentation of the first line of a paragraph is the main method used by
35
an APT processor to recognize the type of the paragraph. For example, a
36
section title must not be indented at all.
38
A ``plain'' paragraph must be indented by a certain amount of space. For
39
example, a plain paragraph which is not contained in a list may be indented
42
+-------------------------------------------------+
43
My section title (not indented).
45
My paragraph first line (indented by 2 spaces).
46
+-------------------------------------------------+
48
Indentation is not rigid. Any amount of space will do. You don't even need
49
to use a consistent indentation all over your document. What really matters
50
for an APT processor is whether the paragraph is not indented at all or,
51
when inside a list, whether a paragraph is more or less indented than the
52
first item of the list (more about this later).
54
+-------------------------------------------------------+
55
First paragraph has its first line indented by four
56
spaces. Then the author did even bother to indent the
57
other lines of the paragraph.
59
Second paragraph contains several lines which are all
60
indented by two spaces. This style is much nicer than
61
the one used for the previous paragraph.
62
+-------------------------------------------------------+
64
Note that tabs are expanded with a tab width set to 8.
69
** Block level elements
70
~~~~~~~~~~~~~~~~~~~~~~~
75
A title is optional. If used, it must appear as the first block of the
78
+----------------------------------------------------------------------------+
85
+----------------------------------------------------------------------------+
87
A title block is indented (centering it is nicer). It begins with a line
88
containing at least 3 dashes (<<<--->>>).
90
After the first <<<--->>> line, one or several consecutive lines of text
91
(implicit line break after each line) specify the title of the document.
93
This text may immediately be followed by another <<<--->>> line and one or
94
several consecutive lines of text which specifies the author of the
97
The author sub-block may optionaly be followed by a date sub-block using the
100
The following example is used for a document with an title and a date but
101
with no declared author.
103
+----------------------------------------------------------------------------+
110
+----------------------------------------------------------------------------+
112
The last line is ignored. It is just there to make the block nicer.
117
Paragraphs other than the title block may appear before the first section.
119
+----------------------+
125
+----------------------+
127
Paragraphs are indented. They have already been described in the {{document
133
Sections are created by inserting section titles into the document. Simple
134
documents need not contain sections.
136
+-----------------------------------+
141
** Sub-sub-section title
143
*** Sub-sub-sub-section title
145
**** Sub-sub-sub-sub-section title
146
+-----------------------------------+
148
Section titles are not indented. A sub-section title begins with one
149
asterisk (<<<*>>>), a sub-sub-section title begins with two asterisks
150
(<<<**>>>), and so forth up to four sub-section levels.
155
+---------------------------------------+
160
Paragraph contained in list item 2.
167
+---------------------------------------+
169
List items are indented and begin with a asterisk (<<<*>>>).
171
Plain paragraphs more indented than the first list item are nested in that
172
list. Displays such as tables (not indented) are always nested in the
175
To nest a list inside a list, indent its first item more than its parent
176
list. To end a list, add a paragraph or list item less indented than the
179
Section titles always end a list. Displays cannot end a list but the
180
<<<[]>>> pseudo-element may be used to force the end of a list.
182
+------------------------------------+
188
--------------------------------------------
189
Verbatim text not contained in list item 3
190
--------------------------------------------
191
+------------------------------------+
193
In the previous example, without the <<<[]>>>, the verbatim text (not
194
indented as all displays) would have been contained in list item 3.
196
A single <<<[]>>> may be used to end several nested lists at the same
197
time. The indentation of <<<[]>>> may be used to specify exactly which
198
lists should be ended. Example:
200
+------------------------------------+
211
-------------------------------------------------------------------
212
Verbatim text contained in list item 2, but not in sub-list item 2
213
-------------------------------------------------------------------
214
+------------------------------------+
216
There are three kind of lists, the bulleted lists we have already described,
217
the numbered lists and the definition lists.
219
+-----------------------------------------+
220
[[1]] Numbered item 1.
222
[[A]] Numbered item A.
224
[[B]] Numbered item B.
226
[[2]] Numbered item 2.
227
+-----------------------------------------+
229
A numbered list item begins with a label beetween two square brackets. The
230
label of the first item establishes the numbering scheme for the whole list:
232
[<<<[[1\]\]>>>] Decimal numbering: 1, 2, 3, 4, etc.
234
[<<<[[a\]\]>>>] Lower-alpha numbering: a, b, c, d, etc.
236
[<<<[[A\]\]>>>] Upper-alpha numbering: A, B, C, D, etc.
238
[<<<[[i\]\]>>>] Lower-roman numbering: i, ii, iii, iv, etc.
240
[<<<[[I\]\]>>>] Upper-roman numbering: I, II, III, IV, etc.
242
The labels of the items other than the first one are ignored. It is
243
recommended to take the time to type the correct label for each item in
244
order to keep the APT source document readable.
246
+-------------------------------------------+
247
[Defined term 1] of definition list 2.
249
[Defined term 2] of definition list 2.
250
+-------------------------------------------+
252
A definition list item begins with a defined term: text between square
258
+----------------------------------------+
259
----------------------------------------
264
----------------------------------------
265
+----------------------------------------+
267
A verbatim block is not indented. It begins with a non indented line
268
containing at least 3 dashes (<<<--->>>). It ends with a similar line.
270
<<<+-->>> instead of <<<--->>> draws a box around verbatim text.
272
Like in HTML, verbatim text is preformatted. Unlike HTML, verbatim text is
273
escaped: inside a verbatim display, markup is not interpreted by the APT
279
+---------------------------+
280
[Figure name] Figure caption
281
+---------------------------+
283
A figure block is not indented. It begins with the figure name between
284
square brackets. The figure name is optionally followed by some text: the
287
The figure name is the pathname of the file containing the figure but
288
without an extension. Example: if your figure is contained in
289
<<</home/joe/docs/mylogo.jpeg>>>, the figure name is
290
<<</home/joe/docs/mylogo>>>.
292
If the figure name comes from a relative pathname (recommended practice)
293
rather than from an absolute pathname, this relative pathname is taken to be
294
relative to the directory of the current APT document (a la HTML)
295
rather than relative to the current working directory.
297
Why not leave the file extension in the figure name? This is better
298
explained by an example. You need to convert an APT document to PostScript
299
and your figure name is <<</home/joe/docs/mylogo>>>. A APT processor will
300
first try to load <<</home/joe/docs/mylogo.eps>>>. When the desired format
301
is not found, a APT processor tries to convert one of the existing
302
formats. In our example, the APT processor tries to convert
303
<<</home/joe/docs/mylogo.jpeg>>> to encapsulated PostScript.
308
A table block is not indented. It begins with a non indented line containing
309
an asterisk and at least 2 dashes (<<<*-->>>). It ends with a
312
The first line is not only used to recognize a table but also to specify
313
column justification. In the following example,
315
* the second asterisk (<<<*>>>) is used to specify that column 1 is
318
* the plus sign (<<<+>>>) specifies that column 2 is left aligned,
320
* the colon (<<<:>>>) specifies that column 3 is right aligned.
324
+---------------------------------------------+
325
*----------*--------------+----------------:
326
| Centered | Left-aligned | Right-aligned |
327
| cell 1,1 | cell 1,2 | cell 1,3 |
328
*----------*--------------+----------------:
329
| cell 2,1 | cell 2,2 | cell 2,3 |
330
*----------*--------------+----------------:
332
+---------------------------------------------+
334
Rows are separated by a non indented line beginning with <<<*-->>>.
336
An optional table caption (non indented text) may immediately follow the
339
Rows may contain single line or multiple line cells. Each line of cell text
340
is separated from the adjacent cell by the pipe character (<<<|>>>).
341
(<<<|>>> may be used in the cell text if quoted: <<<\\|>>>.)
343
The last <<<|>>> is only used to make the table nicer. The first <<<|>>> is
344
not only used to make the table nicer, but also to specify that a grid is to
345
be drawn around table cells.
347
The following example shows a simple table with no grid and no caption.
360
+---------------------+
361
=====================
362
+---------------------+
364
A non indented line containing at least 3 equal signs (<<<===>>>).
373
A non indented line containing a single form feed character (Control-L).
375
** Text level elements
376
~~~~~~~~~~~~~~~~~~~~~~
381
+-----------------------------------------------------+
382
<Italic> font. <<Bold>> font. <<<Monospaced>>> font.
383
+-----------------------------------------------------+
385
Text between \< and > must be rendered in italic. Text between \<\< and >>
386
must be rendered in bold. Text between \<\<\< and >>> must be rendered using
387
a monospaced, typewriter-like font.
389
Font elements may appear anywhere except inside other font elements.
391
It is not recommended to use font elements inside titles, section titles,
392
links and defined terms because a APT processor automatically applies
393
appropriate font styles to these elements.
398
+-----------------------------------------------------------------+
399
{Anchor}. Link to {{anchor}}. Link to {{http://www.pixware.fr}}.
400
Link to {{{anchor}showing alternate text}}.
401
Link to {{{http://www.pixware.fr}Pixware home page}}.
402
+-----------------------------------------------------------------+
404
Text between curly braces (<<<\{}>>>) specifies an anchor. Text between
405
double curly braces (<<<\{\{}}>>>) specifies a link.
407
It is an error to create a link element that does not refer to an anchor of
408
the same name. The name of an anchor/link is its text with all non
409
alphanumeric characters stripped.
411
This rule does not apply to links to <external> anchors. Text beginning
412
with <<<http:/>>>, <<<https:/>>>, <<<ftp:/>>>, <<<file:/>>>, <<<mailto:>>>,
413
<<<../>>>, <<<./>>> (<<<..\\>>> and <<<.\\>>> on Windows) is recognized as
414
an external anchor name.
416
When the construct <<\{\{\{>><name><<}>><text><<}}>> is used, the link text
417
<text> may differ from the link name <name>.
419
Anchor/link elements may appear anywhere except inside other anchor/link
422
Section titles are implicitly defined anchors.
432
A backslash character (<<<\\>>>) followed by a newline character.
434
Line breaks must not be used inside titles and tables (which are line
435
oriented blocks with implicit line breaks).
437
*** Non breaking space
438
~~~~~~~~~~~~~~~~~~~~~~
440
+----------------------+
441
Non\ breaking\ space.
442
+----------------------+
444
A backslash character (<<<\\>>>) followed by a space character.
446
*** Special character
447
~~~~~~~~~~~~~~~~~~~~~
449
+---------------------------------------------------------------------------+
450
Escaped special characters: \~, \=, \-, \+, \*, \[, \], \<, \>, \{, \}, \\.
451
+---------------------------------------------------------------------------+
453
In certain contexts, these characters have a special meaning and therefore
454
must be escaped if needed as is. They are escaped by adding a backslash in
455
front of them. The backslash may itself be escaped by adding another
456
backslash in front of it.
458
Note that an asterisk, for example, needs to be escaped only if its begins a
459
paragraph. (<<<*>>> has no special meaning in the middle of a paragraph.)
461
+--------------------------------------+
462
Copyright symbol: \251, \xA9, \u00a9.
463
+--------------------------------------+
465
Latin-1 characters (whatever is the encoding of the APT document) may be
466
specified by their codes using a backslash followed by one to three octal
467
digits or by using the <<<\x>>><NN> notation, where <NN> are two hexadecimal
470
Unicode characters may be specified by their codes using the <<<\u>>><NNNN>
471
notation, where <NNNN> are four hexadecimal digits.
480
Text found after two tildes (<<<\~~>>>) is ignored up to the end of line.
482
A line of <<<~>>> is often used to ``underline'' section titles in order to
483
make them stand out of other paragraphs.
486
* The APT format at a glance
487
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
489
------------------------------------------------------------------------------
507
** Sub-sub-section title
509
*** Sub-sub-sub-section title
511
**** Sub-sub-sub-sub-section title
517
Paragraph contained in list item 2.
528
+------------------------------------------+
529
Verbatim text not contained in list item 3
530
+------------------------------------------+
532
[[1]] Numbered item 1.
534
[[A]] Numbered item A.
536
[[B]] Numbered item B.
538
[[2]] Numbered item 2.
540
List numbering schemes: [[1]], [[a]], [[A]], [[i]], [[I]].
542
[Defined term 1] of definition list.
544
[Defined term 2] of definition list.
546
+-------------------------------+
549
+-------------------------------+
551
--- instead of +-- suppresses the box around verbatim text.
553
[Figure name] Figure caption
555
*----------*--------------+----------------:
556
| Centered | Left-aligned | Right-aligned |
557
| cell 1,1 | cell 1,2 | cell 1,3 |
558
*----------*--------------+----------------:
559
| cell 2,1 | cell 2,2 | cell 2,3 |
560
*----------*--------------+----------------:
573
=======================================================================
578
<Italic> font. <<Bold>> font. <<<Monospaced>>> font.
580
{Anchor}. Link to {{anchor}}. Link to {{http://www.pixware.fr}}.
581
Link to {{{anchor}showing alternate text}}.
582
Link to {{{http://www.pixware.fr}Pixware home page}}.
587
Non\ breaking\ space.
589
Escaped special characters: \~, \=, \-, \+, \*, \[, \], \<, \>, \{, \}, \\.
591
Copyright symbol: \251, \xA9, \u00a9.
595
------------------------------------------------------------------------------