36a593e102d3c39066ea656747ccb7815a6f5690
[xmldoc.git] / doc / block.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE chapter SYSTEM "../doc.dtd">
3 <?xml-stylesheet type="text/xsl" href="../html.xsl"?>
4
5 <!--
6       XML documentation system
7       Original author :  Arjen Baart - arjen@andromeda.nl
8       Version         : $Revision: 1.1 $
9 -->
10
11 <chapter>
12 <heading><label name='block'/>Block-level content</heading>
13 <para>
14 The actual content of your document is organized in <emph>block-level</emph>
15 elements, such a paragraphs, lists or tables.
16 </para>
17
18 <section>
19 <heading>Paragraphs</heading>
20 <para>
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:
26 <verbatim>
27
28 &lt;para&gt;
29   This is an example of a small paragraph.
30 &lt;/para&gt;
31 &lt;para&gt;
32   And here is another paragraph.
33 &lt;/para&gt;
34
35 </verbatim>
36
37 </para>
38
39 <para>
40 A second type of paragraph is a <strong>quote</strong>.
41 You can make a quote by using the <code>quote</code> element:
42
43 <verbatim>
44    &lt;quote&gt;
45    This is an example of a quote.
46    The text within a quoted paragraph is usually slightly indented on both
47    the left and the right margin.
48    &lt;/quote&gt;
49 </verbatim>
50
51 Which results in:
52
53 <quote>
54 This is an example of a quote.
55 The text within a quoted paragraph is usually slightly indented on both
56 the left and the right margin.
57 </quote>
58 </para>
59
60 <para>
61 A special kind of paragraph is the <strong>verbatim</strong> environment.
62 Just as in LaTeX, this is used to include literal text output with spaces,
63 indentation and line breaks preserved.
64 The practical use for the <strong>verbatim</strong> element is to
65 include coding examples, such as:
66
67 <verbatim>
68    &lt;verbatim&gt;
69       struct complex
70       {
71          double   real;
72          double   imaginary;
73       };
74    &lt;/verbatim&gt;
75 </verbatim>
76
77 Which comes out like this:
78
79 <verbatim>
80    struct complex
81    {
82       double   real;
83       double   imaginary;
84    };
85 </verbatim>
86 </para>
87 </section>
88
89 <section>
90 <heading>Footnotes</heading>
91 <para>
92 Footnotes are created with the <strong>footnote</strong> element:
93 <footnote>This is an example of a footnote</footnote>
94
95 <verbatim>
96 &lt;footnote&gt;This is an example of a footnote&lt;/footnote&gt;
97 </verbatim>
98
99 Within a footnote, you can use <emph>inline</emph> content <footnote>described in the
100 next chapter</footnote> to format the type
101 styles of the text in the footnote. 
102 It is not possible to use the block content described in this chapter within
103 a footnote.
104 </para>
105
106 <para>
107 Footnotes appear at the bottom of the page, with a small number in the
108 running text referring to that footnote.
109 </para>
110
111 </section>
112
113 <section>
114 <heading>Lists</heading>
115 <para>
116 Two types of lists<footnote>A description list is not implemented yet</footnote> are supported:
117 <itemize>
118 <item><code>itemize</code> for bulleted lists such as this one.</item>
119 <item><code>enumerate</code> for numbered lists.</item>
120 </itemize>
121
122 Each item in such a list must be in an <strong>item</strong> element.
123 In fact, an <strong>item</strong> is the only element allowed in an
124 <strong>itemize</strong> or <strong>enumerate</strong> element.
125 You should not put ordinary text or any other element in a list without
126 enclosing them in <code>&lt;item&gt;</code> and <code>&lt;/item&gt;</code>.
127 Here is an example of a numbered list:
128
129 <verbatim>
130
131 &lt;enumerate&gt;
132    &lt;item&gt;First you need an enumerate or itemize tag.&lt;/item&gt;
133    &lt;item&gt;Second, include one or more item elements.&lt;/item&gt;
134    &lt;item&gt;Finally, put the content inside the items.&lt;/item&gt;
135 &lt;/enumerate&gt;
136
137 </verbatim>
138
139 And this is what the list turns into:
140
141 <enumerate>
142    <item>First you need an enumerate or itemize tag.</item>
143    <item>Second, include one or more item elements.</item>
144    <item>Finally, put the content inside the items.</item>
145 </enumerate>
146
147 </para>
148 </section>
149
150 <section>
151 <heading>Including graphics</heading>
152 <para>
153 The empty element <strong>picture</strong> is used to include
154 graphics in your document, like this:
155
156 <verbatim>
157    &lt;picture src='diagram.png' eps='diagram' scale='0.5'/&gt;
158 </verbatim>
159
160 The two attributes are used in either HTML or LaTeX.
161 </para>
162 </section>
163
164 <section>
165 <heading>Tables</heading>
166 <para>
167 Creating tables in XMLDoc is much like creating tables in HTML.
168 First, there is the <strong>table</strong> element.
169 The <strong>table</strong> element may contain any number of
170 <strong>row</strong> elements, which may in turn contain any number
171 of <strong>col</strong> elements.
172 The <strong>col</strong> elements hold the actual content of
173 the table, which must be inline content (see next chapter).
174 To use the tables in LaTeX, you must supply a <strong>cpos</strong>
175 attribute in the <strong>table</strong> tag.
176 <para>
177 <emph>...tune in next week for a table example...</emph>
178 </para>
179 </para>
180 </section>
181
182 </chapter>
183