2 <!DOCTYPE chapter SYSTEM "../doc.dtd">
3 <?xml-stylesheet type="text/xsl" href="../html.xsl"?>
6 XML documentation system
7 Original author : Arjen Baart - arjen@andromeda.nl
8 Version : $Revision: 1.3 $
12 <heading><label name='block'/>Block-level content</heading>
14 The actual content of your document is organized in <emph>block-level</emph>
15 elements, such a paragraphs, lists or tables.
19 <heading>Paragraphs</heading>
21 The most basic type of content block is an ordinary paragraph, contained
22 in a <strong>para</strong> element.
23 To make several separate paragraphs, you must enclose each paragraph
24 in a <strong>para</strong> open tag and a <strong>para</strong> close tag.
25 Here is an example of two small paragraphs:
31 This is an example of a small paragraph.
34 And here is another paragraph.
40 A second type of paragraph is a <strong>quote</strong>.
41 You can make a quote by using the <code>quote</code> element:
46 This is an example of a quote.
47 The text within a quoted paragraph is usually slightly indented on both
48 the left and the right margin.
57 This is an example of a quote.
58 The text within a quoted paragraph is usually slightly indented on both
59 the left and the right margin.
63 A special kind of paragraph is the <strong>verbatim</strong> environment.
64 Just as in LaTeX, this is used to include literal text output with spaces,
65 indentation and line breaks preserved.
66 The practical use for the <strong>verbatim</strong> element is to
67 include coding examples, such as:
81 Which comes out like this:
93 A variation on the <strong>verbatim</strong> text is the <strong>example</strong>
95 The only real difference is that <strong>example</strong> is placed inside
96 a box to make it stand out a bit more.
97 In fact, when converted to XHTML, only an attribute <code>class='example'</code>
99 It is up to the CSS linked to the XHTML page to add additional layout features.
100 The default styling will only add a border.
101 Here is the above example shown in an actual <strong>example</strong> element:
115 Which comes out like this:
129 <heading><label name='footnote'/>Footnotes</heading>
131 Footnotes are created with the <strong>footnote</strong> element:
132 <footnote>This is an example of a footnote</footnote>
136 <footnote>This is an example of a footnote</footnote>
140 Within a footnote, you can use <emph>inline</emph> content <footnote>described in the
141 next chapter</footnote> to format the type
142 styles of the text in the footnote.
143 It is not possible to use the block content described in this chapter within
148 Footnotes appear at the bottom of the page, with a small number in the
149 running text referring to that footnote.
155 <heading><label name='list'/>Lists</heading>
157 Three types of lists are supported:
161 <item><code>itemize</code> for bulleted lists such as this one.</item>
162 <item><code>enumerate</code> for numbered lists.</item>
163 <item><code>description</code> for tagged lists.</item>
167 Each item in such a list must be in an <code>item</code> element.
168 In fact, an <code>item</code> is the only element allowed in an
169 <code>itemize</code>, <code>enumerate</code> or <code>description</code> element.
170 You should not put ordinary text or any other element in a list without
171 enclosing them in <code><item></code> and <code></item></code>.
172 Here is an example of a numbered list:
178 <item>First you need an enumerate or itemize tag.</item>
179 <item>Second, include one or more item elements.</item>
180 <item>Finally, put the content inside the items.</item>
186 And this is what the list turns into:
190 <item>First you need an enumerate, itemize or description tag.</item>
191 <item>Second, include one or more item elements.</item>
192 <item>Finally, put the content inside the items.</item>
196 In a description list, you make your own tags for each item instead
197 of the automatically generated bullts or numbers.
198 The tags for each item go in the <code>tag</code> attribute of the
199 <code>item</code> element.
200 So, repeating the above list as a description list:
205 <item tag='itemize'> for bulleted lists such as this one.</item>
206 <item tag='enumerate'> for numbered lists.</item>
207 <item tag='description'> for tagged lists.</item>
212 Which creates the following output:
216 <item tag='itemize'> for bulleted lists.</item>
217 <item tag='enumerate'> for numbered lists.</item>
218 <item tag='description'> for tagged lists such as this one.</item>
222 An item can contain inline content as well as block-level content.
227 <heading><label name='graphics'/>Including graphics</heading>
229 The empty element <strong>picture</strong> is used to include
230 graphics in your document, like this:
234 <picture src='diagram.png' eps='diagram' scale='0.5'/>
238 The two attributes are used in either HTML or LaTeX.
243 <heading><label name='table'/>Tables</heading>
245 Creating tables in XMLDoc is much like creating tables in HTML.
246 First, there is the <code>table</code> element.
247 The <code>table</code> element may contain an optional <code>thead</code>
248 and any number of <code>row</code> elements.
249 Both the <code>thead</code> and the <code>row</code> elements must contain
250 one or more <code>col</code> elements.
251 The <code>col</code> elements hold the actual content of
252 the table, which must be inline content (see next chapter) or block content.
253 To use the tables in LaTeX, you must supply a <code>cpos</code>
254 attribute in the <code>table</code> tag.
258 An example of a table is shown below:
263 <table cpos='lr'>
264 <thead><col>Drink </col><col>Price</col></thead>
265 <row><col>Beer </col><col> 1.80</col></row>
266 <row><col>Wiskey </col><col> 3.50</col></row>
267 <row><col>Wine </col><col> 2.20</col></row>
273 <thead><col>Drink </col><col>Price</col></thead>
274 <row><col>Beer </col><col> 1.80</col></row>
275 <row><col>Wiskey </col><col> 3.50</col></row>
276 <row><col>Wine </col><col> 2.20</col></row>