HTML4 writer: Wrap literal blocks in a <span> to support sub- and superscript
[docutils.git] / docutils / test / functional / expected / standalone_rst_xhtml11.xhtml
blobe539c77c59c62a9410f5dbe3d5bd16ffb1e5d028
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.13: http://docutils.sourceforge.net/" />
7 <title>reStructuredText Test Document</title>
8 <meta name="author" content="David Goodger" />
9 <meta content="reStructuredText, test, parser" name="keywords" />
10 <meta content="A test document, containing at least one example of each reStructuredText construct." name="description" xml:lang="en" />
11 <link rel="stylesheet" href="../input/data/html-base.css" type="text/css" />
12 <link rel="stylesheet" href="../input/data/xhtml11.css" type="text/css" />
13 </head>
14 <body>
15 <div class="header">
16 <p>Document header</p>
18 <hr class="header"/>
19 </div>
20 <div class="document" id="restructuredtext-test-document">
21 <span id="doctitle"></span>
22 <h1 class="title">reStructuredText Test Document</h1>
24 <p class="subtitle" id="examples-of-syntax-constructs"><span id="subtitle"></span>Examples of Syntax Constructs</p>
25 <dl class="docinfo">
26 <dt class="author">Author</dt>
27 <dd class="author"><p>David Goodger</p></dd>
28 <dt class="address">Address</dt>
29 <dd class="address"><pre class="address">123 Example Street
30 Example, EX Canada
31 A1B 2C3
32 </pre>
33 </dd>
34 <dt class="contact">Contact</dt>
35 <dd class="contact"><a class="reference external" href="mailto:goodger&#64;python.org">goodger&#64;python.org</a></dd>
36 <dt class="authors">Authors</dt>
37 <dd class="authors"><p>Me</p>
38 <p>Myself</p>
39 <p>I</p>
40 </dd>
41 <dt class="organization">Organization</dt>
42 <dd class="organization">humankind</dd>
43 <dt class="date">Date</dt>
44 <dd class="date">Now, or yesterday. Or maybe even <em>before</em> yesterday.</dd>
45 <dt class="status">Status</dt>
46 <dd class="status">This is a &quot;work in progress&quot;</dd>
47 <dt class="revision">Revision</dt>
48 <dd class="revision">is managed by a version control system.</dd>
49 <dt class="version">Version</dt>
50 <dd class="version">1</dd>
51 <dt class="copyright">Copyright</dt>
52 <dd class="copyright">This document has been placed in the public domain. You
53 may do with it as you wish. You may copy, modify,
54 redistribute, reattribute, sell, buy, rent, lease,
55 destroy, or improve it, quote it at length, excerpt,
56 incorporate, collate, fold, staple, or mutilate it, or do
57 anything else to it that your or anyone else's heart
58 desires.</dd>
59 <dt>field name</dt>
60 <dd><p>This is a &quot;generic bibliographic field&quot;.</p>
61 </dd>
62 <dt>field name &quot;2&quot;</dt>
63 <dd><p>Generic bibliographic fields may contain multiple body elements.</p>
64 <p>Like this.</p>
65 </dd>
66 </dl>
67 <div class="dedication topic">
68 <p class="topic-title first">Dedication</p>
69 <p>For Docutils users &amp; co-developers.</p>
70 </div>
71 <div class="abstract topic">
72 <p class="topic-title first">Abstract</p>
73 <p>This is a test document, containing at least one example of each
74 reStructuredText construct.</p>
75 </div>
76 <!-- This is a comment. Note how any initial comments are moved by
77 transforms to after the document title, subtitle, and docinfo. -->
78 <!-- Above is the document title, and below is the subtitle.
79 They are transformed from section titles after parsing. -->
80 <!-- bibliographic fields (which also require a transform): -->
81 <div class="contents topic" id="table-of-contents">
82 <p class="topic-title first">Table of Contents</p>
83 <ul class="auto-toc simple">
84 <li><p><a class="reference internal" href="#structural-elements" id="id38"><span class="sectnum">1</span> Structural Elements</a></p>
85 <ul class="auto-toc">
86 <li><p><a class="reference internal" href="#section-title" id="id39"><span class="sectnum">1.1</span> Section Title</a></p></li>
87 <li><p><a class="reference internal" href="#empty-section" id="id40"><span class="sectnum">1.2</span> Empty Section</a></p></li>
88 <li><p><a class="reference internal" href="#transitions" id="id41"><span class="sectnum">1.3</span> Transitions</a></p></li>
89 </ul>
90 </li>
91 <li><p><a class="reference internal" href="#body-elements" id="id42"><span class="sectnum">2</span> Body Elements</a></p>
92 <ul class="auto-toc">
93 <li><p><a class="reference internal" href="#paragraphs" id="id43"><span class="sectnum">2.1</span> Paragraphs</a></p>
94 <ul class="auto-toc">
95 <li><p><a class="reference internal" href="#inline-markup" id="id44"><span class="sectnum">2.1.1</span> Inline Markup</a></p></li>
96 </ul>
97 </li>
98 <li><p><a class="reference internal" href="#bullet-lists" id="id45"><span class="sectnum">2.2</span> Bullet Lists</a></p></li>
99 <li><p><a class="reference internal" href="#enumerated-lists" id="id46"><span class="sectnum">2.3</span> Enumerated Lists</a></p></li>
100 <li><p><a class="reference internal" href="#definition-lists" id="id47"><span class="sectnum">2.4</span> Definition Lists</a></p></li>
101 <li><p><a class="reference internal" href="#field-lists" id="id48"><span class="sectnum">2.5</span> Field Lists</a></p></li>
102 <li><p><a class="reference internal" href="#option-lists" id="id49"><span class="sectnum">2.6</span> Option Lists</a></p></li>
103 <li><p><a class="reference internal" href="#literal-blocks" id="id50"><span class="sectnum">2.7</span> Literal Blocks</a></p></li>
104 <li><p><a class="reference internal" href="#line-blocks" id="id51"><span class="sectnum">2.8</span> Line Blocks</a></p></li>
105 <li><p><a class="reference internal" href="#block-quotes" id="id52"><span class="sectnum">2.9</span> Block Quotes</a></p></li>
106 <li><p><a class="reference internal" href="#doctest-blocks" id="id53"><span class="sectnum">2.10</span> Doctest Blocks</a></p></li>
107 <li><p><a class="reference internal" href="#footnotes" id="id54"><span class="sectnum">2.11</span> Footnotes</a></p></li>
108 <li><p><a class="reference internal" href="#citations" id="id55"><span class="sectnum">2.12</span> Citations</a></p></li>
109 <li><p><a class="reference internal" href="#targets" id="id56"><span class="sectnum">2.13</span> Targets</a></p>
110 <ul class="auto-toc">
111 <li><p><a class="reference internal" href="#duplicate-target-names" id="id57"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></p></li>
112 <li><p><a class="reference internal" href="#id21" id="id58"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></p></li>
113 </ul>
114 </li>
115 <li><p><a class="reference internal" href="#directives" id="id59"><span class="sectnum">2.14</span> Directives</a></p>
116 <ul class="auto-toc">
117 <li><p><a class="reference internal" href="#document-parts" id="id60"><span class="sectnum">2.14.1</span> Document Parts</a></p></li>
118 <li><p><a class="reference internal" href="#images-and-figures" id="id61"><span class="sectnum">2.14.2</span> Images and Figures</a></p></li>
119 <li><p><a class="reference internal" href="#admonitions" id="id62"><span class="sectnum">2.14.3</span> Admonitions</a></p></li>
120 <li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id63"><span class="sectnum">2.14.4</span> Topics, Sidebars, and Rubrics</a></p></li>
121 <li><p><a class="reference internal" href="#target-footnotes" id="id64"><span class="sectnum">2.14.5</span> Target Footnotes</a></p></li>
122 <li><p><a class="reference internal" href="#replacement-text" id="id65"><span class="sectnum">2.14.6</span> Replacement Text</a></p></li>
123 <li><p><a class="reference internal" href="#compound-paragraph" id="id66"><span class="sectnum">2.14.7</span> Compound Paragraph</a></p></li>
124 <li><p><a class="reference internal" href="#parsed-literal-blocks" id="id67"><span class="sectnum">2.14.8</span> Parsed Literal Blocks</a></p></li>
125 <li><p><a class="reference internal" href="#code" id="id68"><span class="sectnum">2.14.9</span> Code</a></p></li>
126 </ul>
127 </li>
128 <li><p><a class="reference internal" href="#substitution-definitions" id="id69"><span class="sectnum">2.15</span> Substitution Definitions</a></p></li>
129 <li><p><a class="reference internal" href="#comments" id="id70"><span class="sectnum">2.16</span> Comments</a></p></li>
130 <li><p><a class="reference internal" href="#raw-text" id="id71"><span class="sectnum">2.17</span> Raw text</a></p></li>
131 <li><p><a class="reference internal" href="#container" id="id72"><span class="sectnum">2.18</span> Container</a></p></li>
132 <li><p><a class="reference internal" href="#colspanning-tables" id="id73"><span class="sectnum">2.19</span> Colspanning tables</a></p></li>
133 <li><p><a class="reference internal" href="#rowspanning-tables" id="id74"><span class="sectnum">2.20</span> Rowspanning tables</a></p></li>
134 <li><p><a class="reference internal" href="#complex-tables" id="id75"><span class="sectnum">2.21</span> Complex tables</a></p></li>
135 <li><p><a class="reference internal" href="#list-tables" id="id76"><span class="sectnum">2.22</span> List Tables</a></p></li>
136 <li><p><a class="reference internal" href="#custom-roles" id="id77"><span class="sectnum">2.23</span> Custom Roles</a></p></li>
137 <li><p><a class="reference internal" href="#svg-images" id="id78"><span class="sectnum">2.24</span> SVG Images</a></p></li>
138 <li><p><a class="reference internal" href="#swf-images" id="id79"><span class="sectnum">2.25</span> SWF Images</a></p></li>
139 </ul>
140 </li>
141 <li><p><a class="reference internal" href="#additional-html4css2-features" id="id80"><span class="sectnum">3</span> Additional html4css2 features</a></p>
142 <ul class="auto-toc">
143 <li><p><a class="reference internal" href="#enumerated-lists-with-nested-counters" id="id81"><span class="sectnum">3.1</span> Enumerated lists with nested counters</a></p></li>
144 <li><p><a class="reference internal" href="#description-list" id="id82"><span class="sectnum">3.2</span> Description list</a></p></li>
145 <li><p><a class="reference internal" href="#field-list-handling" id="id83"><span class="sectnum">3.3</span> Field list handling</a></p>
146 <ul class="auto-toc">
147 <li><p><a class="reference internal" href="#styling-with-class-arguments" id="id84"><span class="sectnum">3.3.1</span> Styling with class arguments</a></p></li>
148 </ul>
149 </li>
150 <li><p><a class="reference internal" href="#table-styling-with-class-arguments" id="id85"><span class="sectnum">3.4</span> Table styling with class arguments</a></p></li>
151 <li><p><a class="reference internal" href="#maths" id="id86"><span class="sectnum">3.5</span> Maths</a></p></li>
152 </ul>
153 </li>
154 <li><p><a class="reference internal" href="#error-handling" id="id87"><span class="sectnum">4</span> Error Handling</a></p></li>
155 </ul>
156 </div>
157 <div class="section" id="structural-elements">
158 <h1><a class="toc-backref" href="#id38"><span class="sectnum">1</span> Structural Elements</a></h1>
159 <div class="section" id="section-title">
160 <h2 class="with-subtitle"><a class="toc-backref" href="#id39"><span class="sectnum">1.1</span> Section Title</a></h2>
161 <p class="section-subtitle" id="section-subtitle">Section Subtitle</p>
162 <p>Lone subsections are converted to a section subtitle by a transform
163 activated with the <span class="docutils literal"><span class="pre">--section-subtitles</span></span> command line option or the
164 <span class="docutils literal"><span class="pre">sectsubtitle-xform</span></span> configuration value.</p>
165 </div>
166 <div class="section" id="empty-section">
167 <h2><a class="toc-backref" href="#id40"><span class="sectnum">1.2</span> Empty Section</a></h2>
168 </div>
169 <div class="section" id="transitions">
170 <h2><a class="toc-backref" href="#id41"><span class="sectnum">1.3</span> Transitions</a></h2>
171 <p>Here's a transition:</p>
172 <hr class="docutils" />
173 <p>It divides the section. Transitions may also occur between sections:</p>
174 </div>
175 </div>
176 <hr class="docutils" />
177 <div class="section" id="body-elements">
178 <h1><a class="toc-backref" href="#id42"><span class="sectnum">2</span> Body Elements</a></h1>
179 <div class="section" id="paragraphs">
180 <h2><a class="toc-backref" href="#id43"><span class="sectnum">2.1</span> Paragraphs</a></h2>
181 <p>A paragraph.</p>
182 <div class="section" id="inline-markup">
183 <h3><a class="toc-backref" href="#id44"><span class="sectnum">2.1.1</span> Inline Markup</a></h3>
184 <p>Paragraphs contain text and may contain inline markup: <em>emphasis</em>,
185 <strong>strong emphasis</strong>, <span class="docutils literal">inline literals</span>, standalone hyperlinks
186 (<a class="reference external" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference" href="#id25" id="id26">[5]</a>), internal
187 cross-references (<a class="reference internal" href="#example">example</a>), external hyperlinks with embedded URIs
188 (<a class="reference external" href="http://www.python.org">Python web site</a>), <a class="reference external" href="http://www.python.org/">anonymous hyperlink
189 references</a> <a class="footnote-reference" href="#id25" id="id35">[5]</a> (<a class="reference external" href="http://docutils.sourceforge.net/">a second reference</a> <a class="footnote-reference" href="#id36" id="id37">[9]</a>), footnote references (manually
190 numbered <a class="footnote-reference" href="#id8" id="id1">[1]</a>, anonymous auto-numbered <a class="footnote-reference" href="#id12" id="id2">[3]</a>, labeled auto-numbered
191 <a class="footnote-reference" href="#label" id="id3">[2]</a>, or symbolic <a class="footnote-reference" href="#id13" id="id4">[*]</a>), citation references (<a class="citation-reference" href="#cit2002" id="id5">[CIT2002]</a>),
192 substitution references (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />), and <span class="target" id="inline-hyperlink-targets">inline hyperlink targets</span>
193 (see <a class="reference internal" href="#targets">Targets</a> below for a reference back to here). Character-level
194 inline markup is also possible (although exceedingly ugly!) in <em>re</em><span class="docutils literal">Structured</span><em>Text</em>. Problems are indicated by <a href="#id23"><span class="problematic" id="id24">|problematic|</span></a> text
195 (generated by processing errors; this one is intentional). Here is a
196 reference to the <a class="reference internal" href="#doctitle">doctitle</a> and the <a class="reference internal" href="#subtitle">subtitle</a>.</p>
197 <p>The default role for interpreted text is <cite>Title Reference</cite>. Here are
198 some explicit interpreted text roles: a PEP reference (<a class="reference external" href="http://www.python.org/dev/peps/pep-0287">PEP 287</a>); an
199 RFC reference (<a class="reference external" href="http://tools.ietf.org/html/rfc2822.html">RFC 2822</a>); an abbreviation (<abbr>abb.</abbr>), an acronym
200 (<abbr>reST</abbr>), code (<code>print &quot;hello world&quot;</code>); a <sub>subscript</sub>;
201 a <sup>superscript</sup> and explicit roles for <cite>Docutils</cite>'
202 <em>standard</em> <strong>inline</strong> <span class="docutils literal">markup</span>.</p>
203 <!-- DO NOT RE-WRAP THE FOLLOWING PARAGRAPH! -->
204 <p>Let's test wrapping and whitespace significance in inline literals:
205 <span class="docutils literal">This is an example of <span class="pre">--inline-literal</span> <span class="pre">--text,</span> <span class="pre">--including</span> <span class="pre">some--</span> <span class="pre">strangely--hyphenated-words.</span> <span class="pre">Adjust-the-width-of-your-browser-window</span> to see how the text is wrapped. <span class="pre">--</span> <span class="pre">----</span> <span class="pre">--------</span> Now note the spacing between the words of this sentence (words should be grouped in pairs).</span></p>
206 <p>If the <span class="docutils literal"><span class="pre">--pep-references</span></span> option was supplied, there should be a
207 live link to PEP 258 here.</p>
208 </div>
209 </div>
210 <div class="section" id="bullet-lists">
211 <h2><a class="toc-backref" href="#id45"><span class="sectnum">2.2</span> Bullet Lists</a></h2>
212 <ul>
213 <li><p>A bullet list</p>
214 <ul class="simple">
215 <li><p>Nested bullet list.</p></li>
216 <li><p>Nested item 2.</p></li>
217 </ul>
218 </li>
219 <li><p>Item 2.</p>
220 <p>Paragraph 2 of item 2.</p>
221 <ul class="simple">
222 <li><p>Nested bullet list.</p></li>
223 <li><p>Nested item 2.</p>
224 <ul>
225 <li><p>Third level.</p></li>
226 <li><p>Item 2.</p></li>
227 </ul>
228 </li>
229 <li><p>Nested item 3.</p></li>
230 <li><p>This nested list should be compacted by the HTML writer.</p>
231 <span class="target" id="target"></span><!-- Even if this item contains a target and a comment. -->
232 </li>
233 </ul>
234 </li>
235 </ul>
236 </div>
237 <div class="section" id="enumerated-lists">
238 <h2><a class="toc-backref" href="#id46"><span class="sectnum">2.3</span> Enumerated Lists</a></h2>
239 <ol class="arabic">
240 <li><p>Arabic numerals.</p>
241 <ol class="loweralpha simple">
242 <li><p>lower alpha)</p>
243 <ol class="lowerroman simple">
244 <li><p>(lower roman)</p>
245 <ol class="upperalpha simple">
246 <li><p>upper alpha.</p>
247 <ol class="upperroman simple">
248 <li><p>upper roman)</p></li>
249 </ol>
250 </li>
251 </ol>
252 </li>
253 </ol>
254 </li>
255 </ol>
256 </li>
257 <li><p>Lists that don't start at 1:</p>
258 <ol class="arabic simple" style="counter-reset: item 2;">
259 <li><p>Three</p></li>
260 <li><p>Four</p></li>
261 </ol>
262 <ol class="upperalpha simple" style="counter-reset: item 2;">
263 <li><p>C</p></li>
264 <li><p>D</p></li>
265 </ol>
266 <ol class="lowerroman simple" style="counter-reset: item 2;">
267 <li><p>iii</p></li>
268 <li><p>iv</p></li>
269 </ol>
270 </li>
271 </ol>
272 </div>
273 <div class="section" id="definition-lists">
274 <h2><a class="toc-backref" href="#id47"><span class="sectnum">2.4</span> Definition Lists</a></h2>
275 <dl>
276 <dt>Term</dt>
277 <dd><p>Definition</p>
278 </dd>
279 <dt>Term<span class="classifier">classifier</span></dt>
280 <dd><p>Definition paragraph 1.</p>
281 <p>Definition paragraph 2.</p>
282 </dd>
283 <dt>Term</dt>
284 <dd><p>Definition</p>
285 </dd>
286 <dt>Term<span class="classifier">classifier one</span><span class="classifier">classifier two</span></dt>
287 <dd><p>Definition</p>
288 </dd>
289 </dl>
290 </div>
291 <div class="section" id="field-lists">
292 <h2><a class="toc-backref" href="#id48"><span class="sectnum">2.5</span> Field Lists</a></h2>
293 <dl class="field-list">
294 <dt>what</dt>
295 <dd><p>Field lists map field names to field bodies, like database
296 records. They are often part of an extension syntax. They are
297 an unambiguous variant of RFC 2822 fields.</p>
298 </dd>
299 <dt>how arg1 arg2</dt>
300 <dd><p>The field marker is a colon, the field name, and a colon.</p>
301 <p>The field body may contain one or more body elements, indented
302 relative to the field marker.</p>
303 </dd>
304 <dt>credits</dt>
305 <dd><p class="credits">This paragraph has the <cite>credits</cite> class set. (This is actually not
306 about credits but just for ensuring that the class attribute
307 doesn't get stripped away.)</p>
308 </dd>
309 </dl>
310 </div>
311 <div class="section" id="option-lists">
312 <h2><a class="toc-backref" href="#id49"><span class="sectnum">2.6</span> Option Lists</a></h2>
313 <p>For listing command-line options:</p>
314 <dl class="option-list">
315 <dt><kbd><span class="option">-a</span></kbd></dt>
316 <dd><p>command-line option &quot;a&quot;</p>
317 </dd>
318 <dt><kbd><span class="option">-b <var>file</var></span></kbd></dt>
319 <dd><p>options can have arguments
320 and long descriptions</p>
321 </dd>
322 <dt><kbd><span class="option">--long</span></kbd></dt>
323 <dd><p>options can be long also</p>
324 </dd>
325 <dt><kbd><span class="option">--input=<var>file</var></span></kbd></dt>
326 <dd><p>long options can also have
327 arguments</p>
328 </dd>
329 <dt><kbd><span class="option">--very-long-option</span></kbd></dt>
330 <dd><p>The description can also start on the next line.</p>
331 <p>The description may contain multiple body elements,
332 regardless of where it starts.</p>
333 </dd>
334 <dt><kbd><span class="option">-x</span>, <span class="option">-y</span>, <span class="option">-z</span></kbd></dt>
335 <dd><p>Multiple options are an &quot;option group&quot;.</p>
336 </dd>
337 <dt><kbd><span class="option">-v</span>, <span class="option">--verbose</span></kbd></dt>
338 <dd><p>Commonly-seen: short &amp; long options.</p>
339 </dd>
340 <dt><kbd><span class="option">-1 <var>file</var></span>, <span class="option">--one=<var>file</var></span>, <span class="option">--two <var>file</var></span></kbd></dt>
341 <dd><p>Multiple options with arguments.</p>
342 </dd>
343 <dt><kbd><span class="option">/V</span></kbd></dt>
344 <dd><p>DOS/VMS-style options too</p>
345 </dd>
346 </dl>
347 <p>There must be at least two spaces between the option and the
348 description.</p>
349 </div>
350 <div class="section" id="literal-blocks">
351 <h2><a class="toc-backref" href="#id50"><span class="sectnum">2.7</span> Literal Blocks</a></h2>
352 <p>Literal blocks are indicated with a double-colon (&quot;::&quot;) at the end of
353 the preceding paragraph (over there <span class="docutils literal"><span class="pre">--&gt;</span></span>). They can be indented:</p>
354 <pre class="literal-block"><span>if literal_block:
355 text = 'is left as-is'
356 spaces_and_linebreaks = 'are preserved'
357 markup_processing = None</span></pre>
358 <p>Or they can be quoted without indentation:</p>
359 <pre class="literal-block"><span>&gt;&gt; Great idea!
360 &gt;
361 &gt; Why didn't I think of that?</span></pre>
362 </div>
363 <div class="section" id="line-blocks">
364 <h2><a class="toc-backref" href="#id51"><span class="sectnum">2.8</span> Line Blocks</a></h2>
365 <p>This section tests line blocks. Line blocks are body elements which
366 consist of lines and other line blocks. Nested line blocks cause
367 indentation.</p>
368 <div class="line-block">
369 <div class="line">This is a line block. It ends with a blank line.</div>
370 <div class="line-block">
371 <div class="line">New lines begin with a vertical bar (&quot;|&quot;).</div>
372 <div class="line">Line breaks and initial indent are significant, and preserved.</div>
373 <div class="line-block">
374 <div class="line">Continuation lines are also possible. A long line that is intended
375 to wrap should begin with a space in place of the vertical bar.</div>
376 </div>
377 <div class="line">The left edge of a continuation line need not be aligned with
378 the left edge of the text above it.</div>
379 </div>
380 </div>
381 <div class="line-block">
382 <div class="line">This is a second line block.</div>
383 <div class="line"><br /></div>
384 <div class="line">Blank lines are permitted internally, but they must begin with a &quot;|&quot;.</div>
385 </div>
386 <p>Another line block, surrounded by paragraphs:</p>
387 <div class="line-block">
388 <div class="line">And it's no good waiting by the window</div>
389 <div class="line">It's no good waiting for the sun</div>
390 <div class="line">Please believe me, the things you dream of</div>
391 <div class="line">They don't fall in the lap of no-one</div>
392 </div>
393 <p>Take it away, Eric the Orchestra Leader!</p>
394 <blockquote>
395 <div class="line-block">
396 <div class="line">A one, two, a one two three four</div>
397 <div class="line"><br /></div>
398 <div class="line">Half a bee, philosophically,</div>
399 <div class="line-block">
400 <div class="line">must, <em>ipso facto</em>, half not be.</div>
401 </div>
402 <div class="line">But half the bee has got to be,</div>
403 <div class="line-block">
404 <div class="line"><em>vis a vis</em> its entity. D'you see?</div>
405 <div class="line"><br /></div>
406 </div>
407 <div class="line">But can a bee be said to be</div>
408 <div class="line-block">
409 <div class="line">or not to be an entire bee,</div>
410 <div class="line-block">
411 <div class="line">when half the bee is not a bee,</div>
412 <div class="line-block">
413 <div class="line">due to some ancient injury?</div>
414 <div class="line"><br /></div>
415 </div>
416 </div>
417 </div>
418 <div class="line">Singing...</div>
419 </div>
420 </blockquote>
421 <p>A line block, like the following poem by Christian Morgenstern, can
422 also be centre-aligned:</p>
423 <div class="align-center line-block" xml:lang="de">
424 <div class="line"><strong>Die Trichter</strong></div>
425 <div class="line"><br /></div>
426 <div class="line">Zwei Trichter wandeln durch die Nacht.</div>
427 <div class="line">Durch ihres Rumpfs verengten Schacht</div>
428 <div class="line">fließt weißes Mondlicht</div>
429 <div class="line">still und heiter</div>
430 <div class="line">auf   ihren</div>
431 <div class="line">Waldweg</div>
432 <div class="line">u. s.</div>
433 <div class="line">w.</div>
434 <div class="line"><br /></div>
435 </div>
436 </div>
437 <div class="section" id="block-quotes">
438 <h2><a class="toc-backref" href="#id52"><span class="sectnum">2.9</span> Block Quotes</a></h2>
439 <p>Block quotes consist of indented body elements:</p>
440 <blockquote>
441 <p>My theory by A. Elk. Brackets Miss, brackets. This theory goes
442 as follows and begins now. All brontosauruses are thin at one
443 end, much much thicker in the middle and then thin again at the
444 far end. That is my theory, it is mine, and belongs to me and I
445 own it, and what it is too.</p>
446 <p class="attribution"><cite>Anne Elk (Miss)</cite></p>
447 </blockquote>
448 <p>The language of a quote (like any other object) can be specified by
449 a class attribute:</p>
450 <!-- -->
451 <blockquote xml:lang="fr">
452 <p>ReStructuredText est un langage de balisage léger utilisé
453 notamment dans la documentation du langage Python.</p>
454 </blockquote>
455 </div>
456 <div class="section" id="doctest-blocks">
457 <h2><a class="toc-backref" href="#id53"><span class="sectnum">2.10</span> Doctest Blocks</a></h2>
458 <pre class="code python doctest">&gt;&gt;&gt; print 'Python-specific usage examples; begun with &quot;&gt;&gt;&gt;&quot;'
459 Python-specific usage examples; begun with &quot;&gt;&gt;&gt;&quot;
460 &gt;&gt;&gt; print '(cut and pasted from interactive Python sessions)'
461 (cut and pasted from interactive Python sessions)
462 </pre>
463 </div>
464 <div class="section" id="footnotes">
465 <h2><a class="toc-backref" href="#id54"><span class="sectnum">2.11</span> Footnotes</a></h2>
466 <dl class="footnote">
467 <dt class="label" id="id8">[1]<span class="fn-backref">(<a href="#id1">1</a>,<a href="#id9">2</a>,<a href="#id22">3</a>)</span></dt>
468 <dd><p>A footnote contains body elements, consistently indented by at
469 least 3 spaces.</p>
470 <p>This is the footnote's second paragraph.</p>
471 </dd>
472 <dt class="label" id="label">[2]<span class="fn-backref">(<a href="#id3">1</a>,<a href="#id10">2</a>)</span></dt>
473 <dd><p>Footnotes may be numbered, either manually (as in <a class="footnote-reference" href="#id8" id="id9">[1]</a>) or
474 automatically using a &quot;#&quot;-prefixed label. This footnote has a
475 label so it can be referred to from multiple places, both as a
476 footnote reference (<a class="footnote-reference" href="#label" id="id10">[2]</a>) and as a <a class="reference internal" href="#label">hyperlink reference</a>.</p>
477 </dd>
478 <dt class="label" id="id12"><a class="fn-backref" href="#id2">[3]</a></dt>
479 <dd><p>This footnote is numbered automatically and anonymously using a
480 label of &quot;#&quot; only.</p>
481 <p>This is the second paragraph.</p>
482 <p>And this is the third paragraph.</p>
483 </dd>
484 <dt class="label" id="id13"><a class="fn-backref" href="#id4">[*]</a></dt>
485 <dd><p>Footnotes may also use symbols, specified with a &quot;*&quot; label.
486 Here's a reference to the next footnote: <a class="footnote-reference" href="#id15" id="id14">[†]</a>.</p>
487 </dd>
488 <dt class="label" id="id15"><a class="fn-backref" href="#id14">[†]</a></dt>
489 <dd><p>This footnote shows the next symbol in the sequence.</p>
490 </dd>
491 <dt class="label" id="id16">[4]</dt>
492 <dd><p>Here's an unreferenced footnote, with a reference to a
493 nonexistent footnote: <a href="#id97"><span class="problematic" id="id98"><span id="id17"></span>[5]_</span></a>.</p>
494 </dd>
495 </dl>
496 </div>
497 <div class="section" id="citations">
498 <h2><a class="toc-backref" href="#id55"><span class="sectnum">2.12</span> Citations</a></h2>
499 <dl class="citation">
500 <dt class="label" id="cit2002">[CIT2002]<span class="fn-backref">(<a href="#id5">1</a>,<a href="#id18">2</a>)</span></dt>
501 <dd><p>Citations are text-labeled footnotes. They may be
502 rendered separately and differently from footnotes.</p>
503 </dd>
504 </dl>
505 <p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id18">[CIT2002]</a>, and a <a href="#id99"><span class="problematic" id="id100"><span id="id19"></span>[nonexistent]_</span></a>
506 citation.</p>
507 </div>
508 <div class="section" id="targets">
509 <span id="another-target"></span><h2><a class="toc-backref" href="#id56"><span class="sectnum">2.13</span> Targets</a></h2>
510 <p id="example">This paragraph is pointed to by the explicit &quot;example&quot; target. A
511 reference can be found under <a class="reference internal" href="#inline-markup">Inline Markup</a>, above. <a class="reference internal" href="#inline-hyperlink-targets">Inline
512 hyperlink targets</a> are also possible.</p>
513 <p>Section headers are implicit targets, referred to by name. See
514 <a class="reference internal" href="#targets">Targets</a>, which is a subsection of <a class="reference internal" href="#body-elements">Body Elements</a>.</p>
515 <p>Explicit external targets are interpolated into references such as
516 &quot;<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference" href="#id25" id="id27">[5]</a>&quot;.</p>
517 <p>Targets may be indirect and anonymous. Thus <a class="reference internal" href="#targets">this phrase</a> may also
518 refer to the <a class="reference internal" href="#targets">Targets</a> section.</p>
519 <p>Here's a <a href="#id101"><span class="problematic" id="id102">`hyperlink reference without a target`_</span></a>, which generates an
520 error.</p>
521 <div class="section" id="duplicate-target-names">
522 <h3><a class="toc-backref" href="#id57"><span class="sectnum">2.13.1</span> Duplicate Target Names</a></h3>
523 <p>Duplicate names in section headers or other implicit targets will
524 generate &quot;info&quot; (level-1) system messages. Duplicate names in
525 explicit targets will generate &quot;warning&quot; (level-2) system messages.</p>
526 </div>
527 <div class="section" id="id21">
528 <h3><a class="toc-backref" href="#id58"><span class="sectnum">2.13.2</span> Duplicate Target Names</a></h3>
529 <p>Since there are two &quot;Duplicate Target Names&quot; section headers, we
530 cannot uniquely refer to either of them by name. If we try to (like
531 this: <a href="#id103"><span class="problematic" id="id104">`Duplicate Target Names`_</span></a>), an error is generated.</p>
532 </div>
533 </div>
534 <div class="section" id="directives">
535 <h2><a class="toc-backref" href="#id59"><span class="sectnum">2.14</span> Directives</a></h2>
536 <div class="contents local topic" id="contents">
537 <ul class="auto-toc simple">
538 <li><p><a class="reference internal" href="#document-parts" id="id88"><span class="sectnum">2.14.1</span> Document Parts</a></p></li>
539 <li><p><a class="reference internal" href="#images-and-figures" id="id89"><span class="sectnum">2.14.2</span> Images and Figures</a></p></li>
540 <li><p><a class="reference internal" href="#admonitions" id="id90"><span class="sectnum">2.14.3</span> Admonitions</a></p></li>
541 <li><p><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id91"><span class="sectnum">2.14.4</span> Topics, Sidebars, and Rubrics</a></p></li>
542 <li><p><a class="reference internal" href="#target-footnotes" id="id92"><span class="sectnum">2.14.5</span> Target Footnotes</a></p></li>
543 <li><p><a class="reference internal" href="#replacement-text" id="id93"><span class="sectnum">2.14.6</span> Replacement Text</a></p></li>
544 <li><p><a class="reference internal" href="#compound-paragraph" id="id94"><span class="sectnum">2.14.7</span> Compound Paragraph</a></p></li>
545 <li><p><a class="reference internal" href="#parsed-literal-blocks" id="id95"><span class="sectnum">2.14.8</span> Parsed Literal Blocks</a></p></li>
546 <li><p><a class="reference internal" href="#code" id="id96"><span class="sectnum">2.14.9</span> Code</a></p></li>
547 </ul>
548 </div>
549 <p>These are just a sample of the many reStructuredText Directives. For
550 others, please see
551 <a class="reference external" href="http://docutils.sourceforge.net/docs/ref/rst/directives.html">http://docutils.sourceforge.net/docs/ref/rst/directives.html</a>.</p>
552 <div class="section" id="document-parts">
553 <h3><a class="toc-backref" href="#id88"><span class="sectnum">2.14.1</span> Document Parts</a></h3>
554 <p>An example of the &quot;contents&quot; directive can be seen above this section
555 (a local, untitled table of <a class="reference internal" href="#contents">contents</a>) and at the beginning of the
556 document (a document-wide <a class="reference internal" href="#table-of-contents">table of contents</a>).</p>
557 </div>
558 <div class="section" id="images-and-figures">
559 <h3><a class="toc-backref" href="#id89"><span class="sectnum">2.14.2</span> Images and Figures</a></h3>
560 <p>An image directive (also clickable -- a hyperlink reference):</p>
561 <a class="reference internal image-reference" href="#directives"><img alt="../../../docs/user/rst/images/title.png" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></a>
562 <p>Image with multiple IDs:</p>
563 <span id="image-target-2"></span><span id="image-target-1"></span><img alt="../../../docs/user/rst/images/title.png" id="image-target-3" src="../../../docs/user/rst/images/title.png" />
564 <p>A centered image:</p>
565 <img alt="../../../docs/user/rst/images/biohazard.png" class="align-center" src="../../../docs/user/rst/images/biohazard.png" />
566 <p>A left-aligned image:</p>
567 <img alt="../../../docs/user/rst/images/biohazard.png" class="align-left" src="../../../docs/user/rst/images/biohazard.png" />
568 <p>This paragraph might flow around the image.
569 The specific behavior depends upon the style sheet and
570 the browser or rendering software used.</p>
571 <p>A right-aligned image:</p>
572 <img alt="../../../docs/user/rst/images/biohazard.png" class="align-right" src="../../../docs/user/rst/images/biohazard.png" />
573 <p>This paragraph might flow around the image.
574 The specific behavior depends upon the style sheet and
575 the browser or rendering software used.</p>
576 <p>For inline images see <a class="reference internal" href="#substitution-definitions">Substitution Definitions</a>.</p>
577 <p>Image size:</p>
578 <p>An image 2 em wide:</p>
579 <img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 2em;" />
580 <p>An image 2 em wide and 15 pixel high:</p>
581 <img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 2em; height: 15px;" />
582 <p>An image occupying 50% of the line width:</p>
583 <img alt="../../../docs/user/rst/images/title.png" src="../../../docs/user/rst/images/title.png" style="width: 50%;" />
584 <p>An image 2 cm high:</p>
585 <img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="height: 2cm;" />
586 <p>A <em>figure</em> is an image with a caption and/or a legend. With page-based output
587 media, figures might float to a different position if this helps the page
588 layout.</p>
589 <div class="figclass1 figclass2 figure">
590 <img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/title.png" style="width: 258px;" />
591 <p class="caption">Plaintext markup syntax and parser system.</p>
592 <div class="legend">
593 <table>
594 <colgroup>
595 <col style="width: 20%" />
596 <col style="width: 80%" />
597 </colgroup>
598 <tbody>
599 <tr><td><p>re</p></td>
600 <td><p>Revised, revisited, based on 're' module.</p></td>
601 </tr>
602 <tr><td><p>Structured</p></td>
603 <td><p>Structure-enhanced text, structuredtext.</p></td>
604 </tr>
605 <tr><td><p>Text</p></td>
606 <td><p>Well it is, isn't it?</p></td>
607 </tr>
608 </tbody>
609 </table>
610 <p>This paragraph is also part of the legend.</p>
611 </div>
612 </div>
613 <p>A left-aligned figure:</p>
614 <div class="figclass1 figclass2 figure align-left" style="width: 70%">
615 <img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/biohazard.png" style="width: 40px;" />
616 <p class="caption">This is the caption.</p>
617 <div class="legend">
618 <p>This is the legend.</p>
619 <p>The legend may consist of several paragraphs.</p>
620 </div>
621 </div>
622 <p>This paragraph might flow around the figure.</p>
623 <p>The specific behavior depends upon the style sheet and the browser or
624 rendering software used.</p>
625 <p>A centered figure:</p>
626 <div class="figure align-center">
627 <img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 40px;" />
628 <p class="caption">This is the caption.</p>
629 <div class="legend">
630 <p>This is the legend.</p>
631 <p>The legend may consist of several paragraphs.</p>
632 </div>
633 </div>
634 <p>This paragraph might flow around the figure.</p>
635 <p>The specific behavior depends upon the style sheet and the browser or
636 rendering software used.</p>
637 <p>A right-aligned figure:</p>
638 <div class="figure align-right">
639 <img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 40px;" />
640 <p class="caption">This is the caption.</p>
641 <div class="legend">
642 <p>This is the legend.</p>
643 <p>The legend may consist of several paragraphs.</p>
644 </div>
645 </div>
646 <p>This paragraph might flow around the figure. The specific behavior depends
647 upon the style sheet and the browser or rendering software used.</p>
648 </div>
649 <div class="section" id="admonitions">
650 <h3><a class="toc-backref" href="#id90"><span class="sectnum">2.14.3</span> Admonitions</a></h3>
651 <div class="admonition attention">
652 <p class="admonition-title">Attention!</p>
653 <p>Directives at large.</p>
654 </div>
655 <div class="admonition caution">
656 <p class="admonition-title">Caution!</p>
657 <p>Don't take any wooden nickels.</p>
658 </div>
659 <div class="admonition danger">
660 <p class="admonition-title">!DANGER!</p>
661 <p>Mad scientist at work!</p>
662 </div>
663 <div class="admonition error">
664 <p class="admonition-title">Error</p>
665 <p>Does not compute.</p>
666 </div>
667 <div class="admonition hint">
668 <p class="admonition-title">Hint</p>
669 <p>It's bigger than a bread box.</p>
670 </div>
671 <div class="admonition important">
672 <p class="admonition-title">Important</p>
673 <ul class="simple">
674 <li><p>Wash behind your ears.</p></li>
675 <li><p>Clean up your room.</p></li>
676 <li><p>Call your mother.</p></li>
677 <li><p>Back up your data.</p></li>
678 </ul>
679 </div>
680 <div class="admonition note">
681 <p class="admonition-title">Note</p>
682 <p>This is a note.</p>
683 </div>
684 <div class="admonition tip">
685 <p class="admonition-title">Tip</p>
686 <p>15% if the service is good.</p>
687 </div>
688 <div class="admonition warning">
689 <p class="admonition-title">Warning</p>
690 <p>Strong prose may provoke extreme mental exertion.
691 Reader discretion is strongly advised.</p>
692 </div>
693 <div class="admonition admonition-and-by-the-way">
694 <p class="admonition-title">And, by the way...</p>
695 <p>You can make up your own admonition too.</p>
696 </div>
697 </div>
698 <div class="section" id="topics-sidebars-and-rubrics">
699 <h3><a class="toc-backref" href="#id91"><span class="sectnum">2.14.4</span> Topics, Sidebars, and Rubrics</a></h3>
700 <p><em>Sidebars</em> are like miniature, parallel documents.</p>
701 <div class="sidebar">
702 <p class="sidebar-title">Sidebar Title</p>
703 <p class="sidebar-subtitle">Optional Subtitle</p>
704 <p>This is a sidebar. It is for text outside the flow of the main
705 text.</p>
706 <p class="rubric">This is a rubric inside a sidebar</p>
707 <p>Sidebars often appear beside the main text with a border and a different
708 background or font color.</p>
709 </div>
710 <p>A <em>topic</em> is like a block quote with a title, or a self-contained section
711 with no subsections.</p>
712 <div class="topic">
713 <p class="topic-title first">Topic Title</p>
714 <p>This is a topic.</p>
715 </div>
716 <p>A <em>rubric</em> is like an informal heading that doesn't correspond to the
717 document's structure. It is typically highlighted in red (hence the name).</p>
718 <p class="rubric">This is a rubric</p>
719 <p>Topics and rubrics can be used at places where a <a class="reference internal" href="#section-title">section title</a> is not
720 allowed (e.g. inside a directive).</p>
721 </div>
722 <div class="section" id="target-footnotes">
723 <h3><a class="toc-backref" href="#id92"><span class="sectnum">2.14.5</span> Target Footnotes</a></h3>
724 <dl class="footnote">
725 <dt class="label" id="id25">[5]<span class="fn-backref">(<a href="#id26">1</a>,<a href="#id27">2</a>,<a href="#id28">3</a>,<a href="#id35">4</a>)</span></dt>
726 <dd><p><a class="reference external" href="http://www.python.org/">http://www.python.org/</a></p>
727 </dd>
728 <dt class="label" id="id29"><a class="fn-backref" href="#id30">[6]</a></dt>
729 <dd><p><a class="reference external" href="http://pygments.org/">http://pygments.org/</a></p>
730 </dd>
731 <dt class="label" id="id31"><a class="fn-backref" href="#id32">[7]</a></dt>
732 <dd><p><a class="reference external" href="http://docutils.sourceforge.net/docs/user/config.html#table-style">http://docutils.sourceforge.net/docs/user/config.html#table-style</a></p>
733 </dd>
734 <dt class="label" id="id33"><a class="fn-backref" href="#id34">[8]</a></dt>
735 <dd><p><a class="reference external" href="http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf">http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf</a></p>
736 </dd>
737 <dt class="label" id="id36"><a class="fn-backref" href="#id37">[9]</a></dt>
738 <dd><p><a class="reference external" href="http://docutils.sourceforge.net/">http://docutils.sourceforge.net/</a></p>
739 </dd>
740 </dl>
741 </div>
742 <div class="section" id="replacement-text">
743 <h3><a class="toc-backref" href="#id93"><span class="sectnum">2.14.6</span> Replacement Text</a></h3>
744 <p>I recommend you try <a class="reference external" href="http://www.python.org/">Python, <em>the</em> best language around</a> <a class="footnote-reference" href="#id25" id="id28">[5]</a>.</p>
745 </div>
746 <div class="section" id="compound-paragraph">
747 <h3><a class="toc-backref" href="#id94"><span class="sectnum">2.14.7</span> Compound Paragraph</a></h3>
748 <div class="some-class compound">
749 <p class="compound-first">Compound 1, paragraph 1.</p>
750 <p class="compound-middle">Compound 1, paragraph 2.</p>
751 <ul class="compound-last simple">
752 <li><p>Compound 1, list item one.</p></li>
753 <li><p>Compound 1, list item two.</p></li>
754 </ul>
755 </div>
756 <p>Another compound statement:</p>
757 <div class="compound">
758 <p class="compound-first">Compound 2, a literal block:</p>
759 <pre class="compound-middle literal-block"><span>Compound 2, literal.</span></pre>
760 <p class="compound-last">Compound 2, this is a test.</p>
761 </div>
762 <div class="compound">
763 <p>Compound 3, only consisting of one paragraph.</p>
764 </div>
765 <div class="compound">
766 <pre class="compound-first literal-block"><span>Compound 4.
767 This one starts with a literal block.</span></pre>
768 <p class="compound-last">Compound 4, a paragraph.</p>
769 </div>
770 <p>Now something <em>really</em> perverted -- a nested compound block. This is
771 just to test that it works at all; the results don't have to be
772 meaningful.</p>
773 <div class="compound">
774 <p class="compound-first">Compound 5, block 1 (a paragraph).</p>
775 <div class="compound-middle compound">
776 <p class="compound-first">Compound 6, block 2 in compound 5.</p>
777 <p class="compound-last">Compound 6, another paragraph.</p>
778 </div>
779 <p class="compound-last">Compound 5, block 3 (a paragraph).</p>
780 </div>
781 <div class="compound">
782 <p class="compound-first">Compound 7, with a table inside:</p>
783 <table class="compound-middle">
784 <colgroup>
785 <col style="width: 33%" />
786 <col style="width: 33%" />
787 <col style="width: 33%" />
788 </colgroup>
789 <tbody>
790 <tr><td><p>Left cell, first
791 paragraph.</p>
792 <p>Left cell, second
793 paragraph.</p>
794 </td>
795 <td><p>Middle cell,
796 consisting of
797 exactly one
798 paragraph.</p></td>
799 <td><p>Right cell.</p>
800 <p>Paragraph 2.</p>
801 <p>Paragraph 3.</p>
802 </td>
803 </tr>
804 </tbody>
805 </table>
806 <p class="compound-middle">Compound 7, a paragraph after the table.</p>
807 <p class="compound-last">Compound 7, another paragraph.</p>
808 </div>
809 </div>
810 <div class="section" id="parsed-literal-blocks">
811 <h3><a class="toc-backref" href="#id95"><span class="sectnum">2.14.8</span> Parsed Literal Blocks</a></h3>
812 <pre class="literal-block"><span>This is a parsed literal block.
813 This line is indented. The next line is blank.
815 Inline markup is supported, e.g. <em>emphasis</em>, <strong>strong</strong>, <span class="docutils literal">literal
816 text</span>, <sub>sub-</sub> and <sup>super</sup>scripts,
817 inline formulas: <math xmlns="http://www.w3.org/1998/Math/MathML">
818 <mrow><mi>A</mi><mo>=</mo><mn>2</mn><mi>π</mi><msup><mi>r</mi><mn>2</mn></msup></mrow></math>,
819 footnotes <a class="footnote-reference" href="#id8" id="id22">[1]</a>, <span class="target" id="hyperlink-targets">hyperlink targets</span>, and <a class="reference external" href="http://www.python.org/">references</a>.</span></pre>
820 </div>
821 <div class="section" id="code">
822 <h3><a class="toc-backref" href="#id96"><span class="sectnum">2.14.9</span> Code</a></h3>
823 <p>Blocks of source code can be set with the <cite>code</cite> directive. If the code
824 language is specified, the content is parsed and tagged by the <a class="reference external" href="http://pygments.org/">Pygments</a> <a class="footnote-reference" href="#id29" id="id30">[6]</a>
825 syntax highlighter and can be formatted with a style sheet. (Code parsing
826 is turned off using the <span class="docutils literal"><span class="pre">syntax-highlight</span></span> config setting in the test
827 conversions in order to get identical results with/without installed
828 Pygments highlighter.)</p>
829 <pre class="code python literal-block"><code>print 'This is Python code.'</code></pre>
830 <p>The <span class="docutils literal"><span class="pre">:number-lines:</span></span> option (with optional start value) generates line
831 numbers:</p>
832 <pre class="code python literal-block"><code><span class="ln"> 8 </span># print integers from 0 to 9:
833 <span class="ln"> 9 </span>for i in range(10):
834 <span class="ln">10 </span> print i</code></pre>
835 <p>For inline code snippets, there is the <cite>code</cite> role, which can be used
836 directly (the code will not be parsed/tagged, as the language is not known)
837 or as base for special code roles, e.g. the LaTeX code in the next
838 paragraph.</p>
839 <p>Docutils uses LaTeX syntax for math directives and roles:
840 <code class="tex">\alpha = f(x)</code> prints <math xmlns="http://www.w3.org/1998/Math/MathML">
841 <mrow><mi>α</mi><mo>=</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></math>.</p>
842 <p>The <span class="docutils literal">:code:</span> option of the <cite>include</cite> directive sets the included content
843 as a code block, here the rst file <span class="docutils literal">header_footer.txt</span> with line numbers:</p>
844 <pre class="code rst literal-block"><code><span class="ln">1 </span>.. header:: Document header
845 <span class="ln">2 </span>.. footer:: Document footer</code></pre>
846 </div>
847 </div>
848 <div class="section" id="substitution-definitions">
849 <h2><a class="toc-backref" href="#id69"><span class="sectnum">2.15</span> Substitution Definitions</a></h2>
850 <p>An inline image (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />) example:</p>
851 <p>(Substitution definitions are not visible in the HTML source.)</p>
852 </div>
853 <div class="section" id="comments">
854 <h2><a class="toc-backref" href="#id70"><span class="sectnum">2.16</span> Comments</a></h2>
855 <p>Here's one:</p>
856 <!-- Comments begin with two dots and a space. Anything may
857 follow, except for the syntax of footnotes, hyperlink
858 targets, directives, or substitution definitions.
860 Double-dashes - - "- -" - - must be escaped somehow in HTML output.
862 Comments may contain non-ASCII characters: ä ö ü æ ø å -->
863 <p>(View the HTML source to see the comment.)</p>
864 </div>
865 <div class="section" id="raw-text">
866 <h2><a class="toc-backref" href="#id71"><span class="sectnum">2.17</span> Raw text</a></h2>
867 <p>This does not necessarily look nice, because there may be missing white space.</p>
868 <p>It's just there to freeze the behavior.</p>
869 A test.Second test.<div class="myclass">Another test with myclass set.</div><p>This is the <span class="myrawroleclass">fourth test</span> with myrawroleclass set.</p>
870 Fifth test in HTML.<br />Line two.</div>
871 <div class="section" id="container">
872 <h2><a class="toc-backref" href="#id72"><span class="sectnum">2.18</span> Container</a></h2>
873 <div class="custom docutils container">
874 <p>paragraph 1</p>
875 <p>paragraph 2</p>
876 </div>
877 </div>
878 <div class="section" id="colspanning-tables">
879 <h2><a class="toc-backref" href="#id73"><span class="sectnum">2.19</span> Colspanning tables</a></h2>
880 <p>This table has a cell spanning two columns:</p>
881 <table>
882 <colgroup>
883 <col style="width: 31%" />
884 <col style="width: 31%" />
885 <col style="width: 38%" />
886 </colgroup>
887 <thead>
888 <tr><th class="head" colspan="2"><p>Inputs</p></th>
889 <th class="head"><p>Output</p></th>
890 </tr>
891 <tr><th class="head"><p>A</p></th>
892 <th class="head"><p>B</p></th>
893 <th class="head"><p>A or B</p></th>
894 </tr>
895 </thead>
896 <tbody>
897 <tr><td><p>False</p></td>
898 <td><p>False</p></td>
899 <td><p>False</p></td>
900 </tr>
901 <tr><td><p>True</p></td>
902 <td><p>False</p></td>
903 <td><p>True</p></td>
904 </tr>
905 <tr><td><p>False</p></td>
906 <td><p>True</p></td>
907 <td><p>True</p></td>
908 </tr>
909 <tr><td><p>True</p></td>
910 <td><p>True</p></td>
911 <td><p>True</p></td>
912 </tr>
913 </tbody>
914 </table>
915 </div>
916 <div class="section" id="rowspanning-tables">
917 <h2><a class="toc-backref" href="#id74"><span class="sectnum">2.20</span> Rowspanning tables</a></h2>
918 <p>Here's a table with cells spanning several rows:</p>
919 <table>
920 <colgroup>
921 <col style="width: 44%" />
922 <col style="width: 22%" />
923 <col style="width: 33%" />
924 </colgroup>
925 <thead>
926 <tr><th class="head"><p>Header row, column 1
927 (header rows optional)</p></th>
928 <th class="head"><p>Header 2</p></th>
929 <th class="head"><p>Header 3</p></th>
930 </tr>
931 </thead>
932 <tbody>
933 <tr><td><p>body row 1, column 1</p></td>
934 <td><p>column 2</p></td>
935 <td><p>column 3</p></td>
936 </tr>
937 <tr><td><p>body row 2</p></td>
938 <td rowspan="2"><p>Cells may
939 span rows.</p></td>
940 <td rowspan="2"><p>Another
941 rowspanning
942 cell.</p></td>
943 </tr>
944 <tr><td><p>body row 3</p></td>
945 </tr>
946 </tbody>
947 </table>
948 </div>
949 <div class="section" id="complex-tables">
950 <h2><a class="toc-backref" href="#id75"><span class="sectnum">2.21</span> Complex tables</a></h2>
951 <p>Here's a complex table, which should test all features.</p>
952 <table>
953 <colgroup>
954 <col style="width: 43%" />
955 <col style="width: 21%" />
956 <col style="width: 18%" />
957 <col style="width: 18%" />
958 </colgroup>
959 <thead>
960 <tr><th class="head"><p>Header row, column 1
961 (header rows optional)</p></th>
962 <th class="head"><p>Header 2</p></th>
963 <th class="head"><p>Header 3</p></th>
964 <th class="head"><p>Header 4</p></th>
965 </tr>
966 </thead>
967 <tbody>
968 <tr><td><p>body row 1, column 1</p></td>
969 <td><p>column 2</p></td>
970 <td><p>column 3</p></td>
971 <td><p>column 4</p></td>
972 </tr>
973 <tr><td><p>body row 2</p></td>
974 <td colspan="3"><p>Cells may span columns.</p></td>
975 </tr>
976 <tr><td><p>body row 3</p></td>
977 <td rowspan="2"><p>Cells may
978 span rows.</p>
979 <p>Paragraph.</p>
980 </td>
981 <td colspan="2" rowspan="2"><ul class="simple">
982 <li><p>Table cells</p></li>
983 <li><p>contain</p></li>
984 <li><p>body elements.</p></li>
985 </ul>
986 </td>
987 </tr>
988 <tr><td><p>body row 4</p></td>
989 </tr>
990 <tr><td><p>body row 5</p></td>
991 <td colspan="2"><p>Cells may also be
992 empty: <span class="docutils literal"><span class="pre">--&gt;</span></span></p></td>
993 <td></td>
994 </tr>
995 </tbody>
996 </table>
997 </div>
998 <div class="section" id="list-tables">
999 <h2><a class="toc-backref" href="#id76"><span class="sectnum">2.22</span> List Tables</a></h2>
1000 <p>Here's a list table exercising all features:</p>
1001 <table class="test">
1002 <caption>list table with integral header</caption>
1003 <colgroup>
1004 <col style="width: 17%" />
1005 <col style="width: 33%" />
1006 <col style="width: 50%" />
1007 </colgroup>
1008 <thead>
1009 <tr><th class="head stub"><p>Treat</p></th>
1010 <th class="head"><p>Quantity</p></th>
1011 <th class="head"><p>Description</p></th>
1012 </tr>
1013 </thead>
1014 <tbody>
1015 <tr><th class="stub"><p>Albatross</p></th>
1016 <td><p>2.99</p></td>
1017 <td><p>On a stick!</p></td>
1018 </tr>
1019 <tr><th class="stub"><p>Crunchy Frog</p></th>
1020 <td><p>1.49</p></td>
1021 <td><p>If we took the bones out, it wouldn't be
1022 crunchy, now would it?</p></td>
1023 </tr>
1024 <tr><th class="stub"><p>Gannet Ripple</p></th>
1025 <td><p>1.99</p></td>
1026 <td><p>On a stick!</p></td>
1027 </tr>
1028 </tbody>
1029 </table>
1030 </div>
1031 <div class="section" id="custom-roles">
1032 <h2><a class="toc-backref" href="#id77"><span class="sectnum">2.23</span> Custom Roles</a></h2>
1033 <ul>
1034 <li><p>A role based on an existing role.</p>
1035 <p><span class="custom docutils literal">one</span> <span class="custom docutils literal">two</span> <span class="custom docutils literal">three</span></p>
1036 </li>
1037 <li><p>A new role.</p>
1038 <p><span class="customnew">one two three</span></p>
1039 </li>
1040 <li><p>A role with class attribute.</p>
1041 <p><span class="special">interpreted text</span></p>
1042 </li>
1043 <li><p>A language-switching role:</p>
1044 <p>Let's count in German <span xml:lang="de">eins zwei drei</span>.</p>
1045 </li>
1046 <li><p>A role with multiple class attributes, styled with raw directives:</p>
1047 <p>The following works in most browsers but does not validate
1048 (<span class="docutils literal">&lt;style&gt;</span> is only allowed in the document head):</p>
1049 <pre class="literal-block"><span>.. raw:: html
1051 &lt;style type=&quot;text/css&quot;&gt;&lt;!--
1052 .green {color: green;}
1053 .sc {font-variant: small-caps;}
1054 --&gt;&lt;/style&gt;</span></pre>
1055 <p><span class="green sc" xml:lang="en-gb">British colourful text in small-caps</span>.</p>
1056 </li>
1057 </ul>
1058 </div>
1059 <div class="section" id="svg-images">
1060 <h2><a class="toc-backref" href="#id78"><span class="sectnum">2.24</span> SVG Images</a></h2>
1061 <img alt="../../../docs/user/rst/images/biohazard.svg" class="align-left" src="../../../docs/user/rst/images/biohazard.svg" style="width: 48px; height: 48px;" />
1062 <p>Scalable vector graphics (SVG) images are the only standards-compliable way
1063 to include vector graphics in HTML documents. However, they are not
1064 supported by all backends/output formats. (E.g., LaTeX supports the
1065 PDF or Postscript formats for vector graphics instead.)</p>
1066 <p>Rendering behaviour varies, depending on</p>
1067 <ol class="loweralpha">
1068 <li><p>The SVG image itself, e.g. fixed-size vs. scaling:</p>
1069 <pre class="literal-block"><span>width=&quot;280&quot; viewBox=&quot;0 0 280 27&quot;
1070 height=&quot;27&quot; width=&quot;100%&quot;
1071 height=&quot;100%&quot;</span></pre>
1072 </li>
1073 <li><p>The method used to put the image in the document.</p>
1074 <p>For HTML, there are several alternatives including:</p>
1075 <ul class="simple">
1076 <li><p>using the HTML <span class="docutils literal">&lt;img&gt;</span> tag (not for interactive/animated SVG),</p></li>
1077 <li><p>using the HTML <span class="docutils literal">&lt;object&gt;</span> tag,</p></li>
1078 <li><p>including within SVG using the SVG <span class="docutils literal">&lt;image&gt;</span> tag,</p></li>
1079 <li><p>embedd the SVG code within HTML (inlining).</p></li>
1080 </ul>
1081 <p>The <cite>html4css1</cite> writer uses <span class="docutils literal">&lt;object&gt;</span> tags, the <cite>html-base</cite> and <cite>xhtml11</cite>
1082 writers use <span class="docutils literal">&lt;img&gt;</span> tags.</p>
1083 <!-- cf. http://edutechwiki.unige.ch/en/Using_SVG_with_HTML5_tutorial -->
1084 </li>
1085 <li><p>The viewing agent.</p>
1086 <p>All up-to-date HTML browsers support SVG, however not all do this fully
1087 and in the same manner. Many older versions, especially IE &lt; 9, have
1088 deficiencies or require plug-ins (i.e. don't support the <span class="docutils literal">&lt;img&gt;</span> tag).</p>
1089 </li>
1090 </ol>
1091 <p>If the image is wrapped in <span class="docutils literal">&lt;object&gt;</span> or <span class="docutils literal">&lt;svg&gt;</span> tags, it depends on the
1092 <span class="docutils literal">viewBox</span> declaration inside the images root <span class="docutils literal">&lt;svg&gt;</span> element whether an
1093 SVG image is scaled or clipped/padded. Images wrapped in <span class="docutils literal">&lt;img&gt;</span> are
1094 always scaled.</p>
1095 <ul>
1096 <li><img alt="../../../docs/user/rst/images/title-scaling.svg" class="align-right" src="../../../docs/user/rst/images/title-scaling.svg" style="width: 50%;" />
1097 <p>A scaling image (scales with the browser window), occupying 50% of the line
1098 width. The <span class="docutils literal">viewBox</span> setting in the image file enables auto-scaling also in
1099 <span class="docutils literal">&lt;object&gt;</span> tags and embedded SVG (if width and hight are set to 100% in the
1100 SVG &lt;image&gt; tag).</p>
1101 </li>
1102 <li><img alt="../../../docs/user/rst/images/title.svg" class="align-right" src="../../../docs/user/rst/images/title.svg" style="width: 50%; height: 15px;" />
1103 <p>A fixed-size image in a box 50% wide and 15 pixles high. This image is
1104 scaled, if wrapped in an <span class="docutils literal">&lt;img&gt;</span> tag but clipped in an <span class="docutils literal">&lt;object&gt;</span> tag
1105 or within SVG.</p>
1106 </li>
1107 <li><img alt="../../../docs/user/rst/images/title-scaling.svg" class="align-right" src="../../../docs/user/rst/images/title-scaling.svg" style="width: 50%; height: 1.5em;" />
1108 <p>A right aligned, scaling image 50% wide and 1.5 em high. (This SVG image
1109 keeps the aspect ratio.)</p>
1110 </li>
1111 <li><p>An inline image <img alt="inline-svg" src="../../../docs/user/rst/images/biohazard-scaling.svg" style="height: 0.8em;" /> scaled to a height of 0.8 em.</p>
1112 </li>
1113 <li><img alt="../../../docs/user/rst/images/biohazard-scaling.svg" class="align-right" src="../../../docs/user/rst/images/biohazard-scaling.svg" style="height: 1em;" />
1114 <p>A scaling image 1 em high, right aligned:</p>
1115 </li>
1116 <li><p>A scaling image 5 mm x 5 mm, centered, with hyperlink reference:</p>
1117 <a class="reference external image-reference" href="SVGImages_"><img alt="../../../docs/user/rst/images/biohazard-scaling.svg" class="align-center" src="../../../docs/user/rst/images/biohazard-scaling.svg" style="width: 5mm; height: 5mm;" /></a>
1118 </li>
1119 <li><img alt="../../../docs/user/rst/images/biohazard.svg" class="align-right" src="../../../docs/user/rst/images/biohazard.svg" style="width: 4cm; height: 2em;" />
1120 <p>A fixed-size image in a 4 cm x 2 em box.</p>
1121 </li>
1122 </ul>
1123 <p>Older versions of <cite>webkit</cite> based browsers (chromium, safari, midori,
1124 konqueror) support the <span class="docutils literal">&lt;img&gt;</span> tag but don't display contained bitmap
1125 images in this case.</p>
1126 <ul>
1127 <li><img alt="../../../docs/user/rst/images/biohazard-bitmap.svg" class="align-right" src="../../../docs/user/rst/images/biohazard-bitmap.svg" style="width: 3em;" />
1128 <p>A small, fixed-size SVG image with embedded bitmap, The <span class="docutils literal">:width:</span> is
1129 set to 3 em in the rST source. Does not scale if wrapped in <span class="docutils literal">&lt;object&gt;</span>
1130 tags.</p>
1131 </li>
1132 <li><img alt="../../../docs/user/rst/images/biohazard-bitmap-scaling.svg" class="align-right" src="../../../docs/user/rst/images/biohazard-bitmap-scaling.svg" style="width: 3em;" />
1133 <p>A scaling SVG image with embedded bitmap, 3 em wide.</p>
1134 </li>
1135 </ul>
1136 <p>SVG images can also be put in figures:</p>
1137 <blockquote>
1138 <div class="figure align-center">
1139 <img alt="reStructuredText, the markup syntax" src="../../../docs/user/rst/images/title.svg" style="width: 290px; height: 28px;" />
1140 <p class="caption"><strong>Figure:</strong> SVG image in a figure.</p>
1141 </div>
1142 </blockquote>
1143 </div>
1144 <div class="section" id="swf-images">
1145 <h2><a class="toc-backref" href="#id79"><span class="sectnum">2.25</span> SWF Images</a></h2>
1146 <p>Shockwave Flash is an image/movie format that most modern web browsers
1147 support via a plugin. It is sometimes blocked due to privacy/security
1148 concerns.</p>
1149 <p>Images with extension <span class="docutils literal">.swf</span> are placed inside &lt;object&gt; elements.
1150 For complete control over display options use raw HTML.</p>
1151 <object class="align-left" data="../../../docs/user/rst/images/biohazard.swf" style="width: 4cm; height: 2em;" type="application/x-shockwave-flash">
1152 [biohazard.swf]</object>
1153 <p>An SWF image in a 4 cm x 2 em box, left aligned.</p>
1154 <p>An inline SWF image <object data="../../../docs/user/rst/images/biohazard.swf" style="width: 0.8em; height: 0.8em;" type="application/x-shockwave-flash">inline-swf</object> scaled to 0.8 em x 0.8 em.</p>
1155 </div>
1156 </div>
1157 <div class="section" id="additional-html4css2-features">
1158 <h1><a class="toc-backref" href="#id80"><span class="sectnum">3</span> Additional html4css2 features</a></h1>
1159 <div class="section" id="enumerated-lists-with-nested-counters">
1160 <h2><a class="toc-backref" href="#id81"><span class="sectnum">3.1</span> Enumerated lists with nested counters</a></h2>
1161 <ol class="nested arabic">
1162 <li><p>first point</p>
1163 <ol class="arabic">
1164 <li><p>first sub-point</p></li>
1165 <li><p>second sub-point</p>
1166 <p>With a standard paragraph</p>
1167 <ol class="arabic simple">
1168 <li><p>first sub-sub-point</p></li>
1169 </ol>
1170 </li>
1171 <li><p>third sub-point with a long and silly text just to test the line
1172 wrapping in this kind of lists.</p></li>
1173 </ol>
1174 <ul class="simple">
1175 <li><p>Unordered list nested in enumeration.</p></li>
1176 </ul>
1177 <dl class="simple">
1178 <dt>Definition list</dt>
1179 <dd><p>nested in top-level enumeration</p>
1180 </dd>
1181 </dl>
1182 </li>
1183 <li><p>second top-level point</p></li>
1184 </ol>
1185 </div>
1186 <div class="section" id="description-list">
1187 <h2><a class="toc-backref" href="#id82"><span class="sectnum">3.2</span> Description list</a></h2>
1188 <p>Definition lists with the <span class="docutils literal">description</span> class argument:</p>
1189 <dl class="description simple">
1190 <dt>description lists</dt>
1191 <dd><p>Lists that are styled like in most dictionaries, encyclopedias
1192 etc. (as well as the LaTeX <cite>description</cite> environment).</p>
1193 </dd>
1194 <dt>label</dt>
1195 <dd><p>The term to be described. Put in boldface.</p>
1196 </dd>
1197 <dt>content</dt>
1198 <dd><p>starts on the same line and has a hanging indent.</p>
1199 </dd>
1200 </dl>
1201 </div>
1202 <div class="section" id="field-list-handling">
1203 <h2><a class="toc-backref" href="#id83"><span class="sectnum">3.3</span> Field list handling</a></h2>
1204 <p>The following list demonstrates the problems with the html4css1
1205 approach: the <cite>field-name-limit</cite> setting is given in &quot;number of
1206 characters&quot; but the field name uses a proportional font.</p>
1207 <dl class="field-list simple">
1208 <dt>The field name</dt>
1209 <dd><p>is typeset on the same line, unless it is &quot;long&quot;.</p>
1210 </dd>
1211 <dt>this field name</dt>
1212 <dd><p>is considered &quot;long&quot; in the html table rendering by
1213 the html4css1 writer with the default setting of
1214 <span class="docutils literal"><span class="pre">--field-name-limit=14</span></span>.</p>
1215 </dd>
1216 <dt>iiiiiiiiiiiiiii</dt>
1217 <dd><p>a field name that is considered &quot;long&quot; by html4css1
1218 with the default setting of <cite>field-name-limit: 14</cite>.</p>
1219 </dd>
1220 <dt>MMMMMMMMMMMMMM</dt>
1221 <dd><p>a field name that is actually longer than the
1222 previous one but regarded &quot;short&quot; by html4css1.</p>
1223 </dd>
1224 </dl>
1225 <p>With <cite>html4css2</cite>, a <cite>field list</cite> is typeset as CSS-styled <cite>definition
1226 list</cite>. The default layout is similar to the look with <cite>html4css1</cite>:</p>
1227 <dl class="open field-list">
1228 <dt>A long field name</dt>
1229 <dd><p>sticks into the field body.</p>
1230 <p>The field body is pushed to the next line (you can
1231 suppress this behaviour with the <a class="reference internal" href="#run-in">run-in</a> or
1232 <a class="reference internal" href="#fix-labelwidth">fix-labelwidth</a> class arguments).</p>
1233 </dd>
1234 <dt>Customization</dt>
1235 <dd><p>of the field name width is possible with CSS instead
1236 of the <cite>field-name-limit</cite> configuration setting, for
1237 example:</p>
1238 <pre class="literal-block"><span>dl.field-list &gt; dd { margin-left: 6em; }</span></pre>
1239 </dd>
1240 </dl>
1241 <div class="section" id="styling-with-class-arguments">
1242 <h3><a class="toc-backref" href="#id84"><span class="sectnum">3.3.1</span> Styling with class arguments</a></h3>
1243 <p>The <span class="docutils literal">xhtml11.css</span> style sheet supports the following class arguments
1244 for alternative styles:</p>
1245 <dl class="simple">
1246 <dt><em>compact</em></dt>
1247 <dd><dl class="compact field-list simple">
1248 <dt>Feature</dt>
1249 <dd><p>No additional space between list items.</p>
1250 </dd>
1251 <dt>Option</dt>
1252 <dd><p>The <span class="docutils literal"><span class="pre">--compact-field-lists</span></span> command line option (and the
1253 corresponding configuration setting) set the <cite>compact</cite>
1254 class argument on all &quot;simple&quot; field lists, if not
1255 overridden with <cite>open</cite>.</p>
1256 </dd>
1257 <dt>Use</dt>
1258 <dd><p>For lists with short field body.</p>
1259 </dd>
1260 </dl>
1261 </dd>
1262 <dt><em>open</em></dt>
1263 <dd><dl class="open field-list">
1264 <dt>Feature</dt>
1265 <dd><p>Additional space between list items also in &quot;simple&quot; lists.
1266 (Overrides the <span class="docutils literal"><span class="pre">--compact-field-lists</span></span> command line
1267 option and the corresponding configuration setting)</p>
1268 </dd>
1269 <dt>Use</dt>
1270 <dd><p>For &quot;simple&quot; lists that should keep the space between list items.</p>
1271 </dd>
1272 </dl>
1273 </dd>
1274 <dt><em>narrow</em></dt>
1275 <dd><dl class="narrow field-list simple">
1276 <dt>Feature</dt>
1277 <dd><p>Less indented field body.</p>
1278 </dd>
1279 <dt>Use</dt>
1280 <dd><p>For lists with short field names.</p>
1281 </dd>
1282 <dt>A long field name</dt>
1283 <dd><p>sticks into the field body and the field body starts on a
1284 new line (if not combined with <a class="reference internal" href="#run-in">run-in</a> or <a class="reference internal" href="#fix-labelwidth">fix-labelwidth</a>).</p>
1285 </dd>
1286 </dl>
1287 </dd>
1288 <dt id="run-in"><em>run-in</em></dt>
1289 <dd><dl class="run-in field-list simple">
1290 <dt>Feature</dt>
1291 <dd><p>Field body starts on the same line also after long field
1292 names.</p>
1293 </dd>
1294 <dt>A long field name</dt>
1295 <dd><p>sticks into the field body which continues on
1296 the same line.</p>
1297 </dd>
1298 <dt>The next field name</dt>
1299 <dd><p>and field body should align. Long text in the field
1300 body is wrapped and aligns with other fields.</p>
1301 </dd>
1302 </dl>
1303 </dd>
1304 <dt id="fix-labelwidth"><em>fix-labelwidth</em></dt>
1305 <dd><dl class="fix-labelwidth field-list simple">
1306 <dt>Feature</dt>
1307 <dd><p>The width of the field name (label) is fixed. Long labels
1308 wrap.</p>
1309 </dd>
1310 <dt>this long field name</dt>
1311 <dd><p>will wrap.</p>
1312 </dd>
1313 <dt>the next field name</dt>
1314 <dd><p>and field body should align.</p>
1315 <!-- If the field name is wrapped but the field body just
1316 one line, following field bodies "float up" if not
1317 prevented by a dummy dd:after element in the CSS. -->
1318 </dd>
1319 <dt>Problem</dt>
1320 <dd><p>Non-wrappable field names are truncated.</p>
1321 </dd>
1322 <dt>a_very_long_field_name</dt>
1323 <dd><p>is truncated if it can not wrap.</p>
1324 </dd>
1325 </dl>
1326 </dd>
1327 </dl>
1328 </div>
1329 </div>
1330 <div class="section" id="table-styling-with-class-arguments">
1331 <h2><a class="toc-backref" href="#id85"><span class="sectnum">3.4</span> Table styling with class arguments</a></h2>
1332 <p>The <span class="docutils literal"><span class="pre">html-base.css</span></span> style sheet provides rules for easy styling of tables
1333 with the &quot;class&quot; directive or directive argument.</p>
1334 <p>Numbered tables can be achieved with the <span class="docutils literal">numbered</span> class option</p>
1335 <table class="numbered">
1336 <caption>truth values</caption>
1337 <colgroup>
1338 <col style="width: 29%" />
1339 <col style="width: 29%" />
1340 <col style="width: 42%" />
1341 </colgroup>
1342 <thead>
1343 <tr><th class="head"><p>A</p></th>
1344 <th class="head"><p>B</p></th>
1345 <th class="head"><p>A or B</p></th>
1346 </tr>
1347 </thead>
1348 <tbody>
1349 <tr><td><p>False</p></td>
1350 <td><p>False</p></td>
1351 <td><p>False</p></td>
1352 </tr>
1353 <tr><td><p>True</p></td>
1354 <td><p>False</p></td>
1355 <td><p>True</p></td>
1356 </tr>
1357 <tr><td><p>False</p></td>
1358 <td><p>True</p></td>
1359 <td><p>True</p></td>
1360 </tr>
1361 <tr><td><p>True</p></td>
1362 <td><p>True</p></td>
1363 <td><p>True</p></td>
1364 </tr>
1365 </tbody>
1366 </table>
1367 <p>Currently, referencing to the table by number is not supported. This is a
1368 common request and already on the <cite>TODO list</cite>.</p>
1369 <p>In addition to the &quot;borderless&quot; <a class="reference external" href="http://docutils.sourceforge.net/docs/user/config.html#table-style">table-style</a> <a class="footnote-reference" href="#id31" id="id32">[7]</a>, the style sheet also
1370 defines &quot;booktabs&quot;, that will be rendered similar to the style from
1371 the <a class="reference external" href="http://tug.ctan.org/tex-archive/macros/latex/contrib/booktabs/booktabs.pdf">booktabs</a> <a class="footnote-reference" href="#id33" id="id34">[8]</a> LaTeX package.</p>
1372 <table class="booktabs">
1373 <colgroup>
1374 <col style="width: 31%" />
1375 <col style="width: 31%" />
1376 <col style="width: 38%" />
1377 </colgroup>
1378 <tbody>
1379 <tr><td><p>False</p></td>
1380 <td><p>False</p></td>
1381 <td><p>False</p></td>
1382 </tr>
1383 <tr><td><p>True</p></td>
1384 <td><p>False</p></td>
1385 <td><p>True</p></td>
1386 </tr>
1387 <tr><td><p>False</p></td>
1388 <td><p>True</p></td>
1389 <td><p>True</p></td>
1390 </tr>
1391 <tr><td><p>True</p></td>
1392 <td><p>True</p></td>
1393 <td><p>True</p></td>
1394 </tr>
1395 </tbody>
1396 </table>
1397 <p>This table also uses the &quot;align-left&quot; class argument, to left-align
1398 the headers:</p>
1399 <table class="booktabs align-left">
1400 <colgroup>
1401 <col style="width: 29%" />
1402 <col style="width: 29%" />
1403 <col style="width: 41%" />
1404 </colgroup>
1405 <thead>
1406 <tr><th class="head"><p>A</p></th>
1407 <th class="head"><p>B</p></th>
1408 <th class="head"><p>A or B</p></th>
1409 </tr>
1410 </thead>
1411 <tbody>
1412 <tr><td><p>False</p></td>
1413 <td><p>False</p></td>
1414 <td><p>False</p></td>
1415 </tr>
1416 <tr><td><p>True</p></td>
1417 <td><p>False</p></td>
1418 <td><p>True</p></td>
1419 </tr>
1420 <tr><td><p>False</p></td>
1421 <td><p>True</p></td>
1422 <td><p>True</p></td>
1423 </tr>
1424 <tr><td><p>True</p></td>
1425 <td><p>True</p></td>
1426 <td><p>True</p></td>
1427 </tr>
1428 </tbody>
1429 </table>
1430 <p>Of course, also &quot;booktabs&quot; style tables can be numbered:</p>
1431 <table class="numbered booktabs">
1432 <caption>I/O values</caption>
1433 <colgroup>
1434 <col style="width: 31%" />
1435 <col style="width: 31%" />
1436 <col style="width: 38%" />
1437 </colgroup>
1438 <thead>
1439 <tr><th class="head" colspan="2"><p>Inputs</p></th>
1440 <th class="head"><p>Output</p></th>
1441 </tr>
1442 <tr><th class="head"><p>A</p></th>
1443 <th class="head"><p>B</p></th>
1444 <th class="head"><p>A or B</p></th>
1445 </tr>
1446 </thead>
1447 <tbody>
1448 <tr><td><p>False</p></td>
1449 <td><p>False</p></td>
1450 <td><p>False</p></td>
1451 </tr>
1452 <tr><td><p>True</p></td>
1453 <td><p>False</p></td>
1454 <td><p>True</p></td>
1455 </tr>
1456 <tr><td><p>False</p></td>
1457 <td><p>True</p></td>
1458 <td><p>True</p></td>
1459 </tr>
1460 <tr><td><p>True</p></td>
1461 <td><p>True</p></td>
1462 <td><p>True</p></td>
1463 </tr>
1464 </tbody>
1465 </table>
1466 </div>
1467 <div class="section" id="maths">
1468 <h2><a class="toc-backref" href="#id86"><span class="sectnum">3.5</span> Maths</a></h2>
1469 <p>The <span class="docutils literal"><span class="pre">html-output</span></span> setting defaults to »MathML«. If there is mathematical
1470 content in <cite>MathML</cite> format, the document type is XHTML 1.1 plus MathML 2.0.</p>
1471 <p>The linear mapping <math xmlns="http://www.w3.org/1998/Math/MathML">
1472 <mrow><mi>f</mi><mo>:</mo><msup><mi></mi>
1473 <mrow><mi>N</mi></mrow></msup><mo></mo><msup><mi></mi>
1474 <mrow><mi>N</mi></mrow></msup></mrow></math>
1475 with</p>
1476 <div>
1477 <math xmlns="http://www.w3.org/1998/Math/MathML" mode="display">
1478 <mtable>
1479 <mtr>
1480 <mtd><msub><mi>c</mi>
1481 <mrow><mi>k</mi></mrow></msub><mo>=</mo><mi>F</mi><mo>(</mo><mi>k</mi><msub><mi>f</mi>
1482 <mrow><mn>0</mn></mrow></msub><mo>)</mo><mo>=</mo><msub><mi>T</mi>
1483 <mrow><mtext>A</mtext></mrow></msub><munderover><mo></mo>
1484 <mrow><mi>n</mi><mo>=</mo><mo>-</mo><mi>N</mi><mo>/</mo><mn>2</mn></mrow>
1485 <mrow><mo>+</mo><mi>N</mi><mo>/</mo><mn>2</mn></mrow></munderover><mi>f</mi><mo>(</mo><msub><mi>x</mi>
1486 <mrow><mi>n</mi></mrow></msub><mo>)</mo><msup><mtext>e</mtext>
1487 <mrow><mo>-</mo><mn>2</mn><mi>π</mi><mtext>i</mtext><mfrac>
1488 <mrow><mi>n</mi><mi>k</mi></mrow>
1489 <mrow><mi>N</mi></mrow></mfrac></mrow></msup></mtd></mtr></mtable></math>
1490 </div>
1491 <p>for all <math xmlns="http://www.w3.org/1998/Math/MathML">
1492 <mrow><mi>a</mi><mo></mo><msup><mi></mi>
1493 <mrow><mi>N</mi></mrow></msup></mrow></math> is called discrete Fourier
1494 transformation (DFT).</p>
1495 </div>
1496 </div>
1497 <div class="section" id="error-handling">
1498 <h1><a class="toc-backref" href="#id87"><span class="sectnum">4</span> Error Handling</a></h1>
1499 <p>Any errors caught during processing will generate system messages.</p>
1500 <p>There should be five messages in the following, auto-generated
1501 section, &quot;Docutils System Messages&quot;:</p>
1502 <!-- section should be added by Docutils automatically -->
1503 </div>
1504 <div class="system-messages section">
1505 <h1>Docutils System Messages</h1>
1506 <div class="system-message" id="id23">
1507 <p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.txt</span>, line 104); <em><a href="#id24">backlink</a></em></p>
1508 <p>Undefined substitution referenced: &quot;problematic&quot;.</p>
1509 </div>
1510 <div class="system-message" id="id97">
1511 <p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.txt</span>, line 391); <em><a href="#id98">backlink</a></em></p>
1512 <p>Unknown target name: &quot;5&quot;.</p>
1513 </div>
1514 <div class="system-message" id="id99">
1515 <p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.txt</span>, line 400); <em><a href="#id100">backlink</a></em></p>
1516 <p>Unknown target name: &quot;nonexistent&quot;.</p>
1517 </div>
1518 <div class="system-message" id="id101">
1519 <p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.txt</span>, line 427); <em><a href="#id102">backlink</a></em></p>
1520 <p>Unknown target name: &quot;hyperlink reference without a target&quot;.</p>
1521 </div>
1522 <div class="system-message" id="id103">
1523 <p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal">functional/input/data/standard.txt</span>, line 440); <em><a href="#id104">backlink</a></em></p>
1524 <p>Duplicate target name, cannot be used as a unique reference: &quot;duplicate target names&quot;.</p>
1525 </div>
1526 </div>
1527 </div>
1528 <div class="footer">
1529 <hr class="footer" />
1530 <p>Document footer</p>
1531 <p><a class="reference external" href="http://validator.w3.org/check?uri=referer"><img alt="Valid XHTML 1.1!" src="http://www.w3.org/Icons/valid-xhtml11" style="width: 88px; height: 31px;" /></a> <a class="reference external" href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="Valid CSS 2.1!" src="http://jigsaw.w3.org/css-validator/images/vcss" style="width: 88px; height: 31px;" /></a></p>
1533 </div>
1534 </body>
1535 </html>