Improve and test "compound" handling in LaTeX.
[docutils.git] / docutils / test / functional / expected / standalone_rst_xetex.tex
blobbfffb36a61ef61b204ebf1c2cd0e056c8db9048e
1 \documentclass[a4paper]{article}
2 % generated by Docutils <http://docutils.sourceforge.net/>
3 % rubber: set program xelatex
4 \usepackage{fontspec}
5 % \defaultfontfeatures{Scale=MatchLowercase}
6 % straight double quotes (defined T1 but missing in TU):
7 \ifdefined \UnicodeEncodingName
8 \DeclareTextCommand{\textquotedbl}{\UnicodeEncodingName}{%
9 {\addfontfeatures{RawFeature=-tlig,Mapping=}\char34}}%
10 \fi
11 \usepackage{ifthen}
12 \usepackage{amsmath}
13 \usepackage{polyglossia}
14 \setdefaultlanguage{english}
15 \setotherlanguages{english,french,german}
16 \usepackage{color}
17 \usepackage{float} % float configuration
18 \floatplacement{figure}{H} % place figures here definitely
19 \usepackage{graphicx}
20 \usepackage{alltt}
21 \usepackage{multirow}
22 \setcounter{secnumdepth}{0}
23 \usepackage{longtable,ltcaption,array}
24 \setlength{\extrarowheight}{2pt}
25 \newlength{\DUtablewidth} % internal use in tables
26 \usepackage{tabularx}
28 %%% Custom LaTeX preamble
29 % Linux Libertine (free, wide coverage, not only for Linux)
30 \setmainfont{Linux Libertine O}
31 \setsansfont{Linux Biolinum O}
32 \setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}
34 %%% User specified packages and stylesheets
36 %%% Fallback definitions for Docutils-specific commands
38 % class handling for environments (block-level elements)
39 % \begin{DUclass}{spam} tries \DUCLASSspam and
40 % \end{DUclass}{spam} tries \endDUCLASSspam
41 \ifx\DUclass\undefined % poor man's "provideenvironment"
42 \newenvironment{DUclass}[1]%
43 {\def\DocutilsClassFunctionName{DUCLASS#1}% arg cannot be used in end-part of environment.
44 \csname \DocutilsClassFunctionName \endcsname}%
45 {\csname end\DocutilsClassFunctionName \endcsname}%
46 \fi
48 % providelength (provide a length variable and set default, if it is new)
49 \providecommand*{\DUprovidelength}[2]{
50 \ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{}
53 % abstract title
54 \providecommand*{\DUtitleabstract}[1]{\centerline{\textbf{#1}}}
56 % admonition (specially marked topic)
57 \providecommand{\DUadmonition}[2][class-arg]{%
58 % try \DUadmonition#1{#2}:
59 \ifcsname DUadmonition#1\endcsname%
60 \csname DUadmonition#1\endcsname{#2}%
61 \else
62 \begin{center}
63 \fbox{\parbox{0.9\linewidth}{#2}}
64 \end{center}
65 \fi
68 % dedication topic
69 \providecommand*{\DUCLASSdedication}{%
70 \renewenvironment{quote}{\begin{center}}{\end{center}}%
73 % docinfo (width of docinfo table)
74 \DUprovidelength{\DUdocinfowidth}{0.9\linewidth}
76 % subtitle (in document title)
77 \providecommand*{\DUdocumentsubtitle}[1]{{\large #1}}
78 \newcounter{enumv}
80 % error admonition title
81 \providecommand*{\DUtitleerror}[1]{\DUtitle{\color{red}#1}}
83 % fieldlist environment
84 \ifthenelse{\isundefined{\DUfieldlist}}{
85 \newenvironment{DUfieldlist}%
86 {\quote\description}
87 {\enddescription\endquote}
88 }{}
89 % numeric or symbol footnotes with hyperlinks
90 \providecommand*{\DUfootnotemark}[3]{%
91 \raisebox{1em}{\hypertarget{#1}{}}%
92 \hyperlink{#2}{\textsuperscript{#3}}%
94 \providecommand{\DUfootnotetext}[4]{%
95 \begingroup%
96 \renewcommand{\thefootnote}{%
97 \protect\raisebox{1em}{\protect\hypertarget{#1}{}}%
98 \protect\hyperlink{#2}{#3}}%
99 \footnotetext{#4}%
100 \endgroup%
103 % inline markup (custom roles)
104 % \DUrole{#1}{#2} tries \DUrole#1{#2}
105 \providecommand*{\DUrole}[2]{%
106 % backwards compatibility: try \docutilsrole#1{#2}
107 \ifcsname docutilsrole#1\endcsname%
108 \csname docutilsrole#1\endcsname{#2}%
109 \else
110 \csname DUrole#1\endcsname{#2}%
111 \fi%
114 % legend environment
115 \ifthenelse{\isundefined{\DUlegend}}{
116 \newenvironment{DUlegend}{\small}{}
119 % lineblock environment
120 \DUprovidelength{\DUlineblockindent}{2.5em}
121 \ifthenelse{\isundefined{\DUlineblock}}{
122 \newenvironment{DUlineblock}[1]{%
123 \list{}{\setlength{\partopsep}{\parskip}
124 \addtolength{\partopsep}{\baselineskip}
125 \setlength{\topsep}{0pt}
126 \setlength{\itemsep}{0.15\baselineskip}
127 \setlength{\parsep}{0pt}
128 \setlength{\leftmargin}{#1}}
129 \raggedright
131 {\endlist}
134 % optionlist environment
135 \providecommand*{\DUoptionlistlabel}[1]{\bf #1 \hfill}
136 \DUprovidelength{\DUoptionlistindent}{3cm}
137 \ifthenelse{\isundefined{\DUoptionlist}}{
138 \newenvironment{DUoptionlist}{%
139 \list{}{\setlength{\labelwidth}{\DUoptionlistindent}
140 \setlength{\rightmargin}{1cm}
141 \setlength{\leftmargin}{\rightmargin}
142 \addtolength{\leftmargin}{\labelwidth}
143 \addtolength{\leftmargin}{\labelsep}
144 \renewcommand{\makelabel}{\DUoptionlistlabel}}
146 {\endlist}
149 \DUprovidelength{\pdfpxdimen}{1bp}
152 % rubric (informal heading)
153 \providecommand*{\DUrubric}[1]{%
154 \subsubsection*{\centering\textit{\textmd{#1}}}}
156 % sidebar (text outside the main text flow)
157 \providecommand{\DUsidebar}[1]{%
158 \begin{center}
159 \colorbox[gray]{0.80}{\parbox{0.9\linewidth}{#1}}
160 \end{center}
163 % subtitle (for topic/sidebar)
164 \providecommand*{\DUsubtitle}[1]{\par\emph{#1}\smallskip}
166 % text mode subscript
167 \ifx\textsubscript\undefined
168 \usepackage{fixltx2e} % since 2015 loaded by default
171 % title for topics, admonitions, unsupported section levels, and sidebar
172 \providecommand*{\DUtitle}[2][class-arg]{%
173 % call \DUtitle#1{#2} if it exists:
174 \ifcsname DUtitle#1\endcsname%
175 \csname DUtitle#1\endcsname{#2}%
176 \else
177 \smallskip\noindent\textbf{#2}\smallskip%
181 % titlereference role
182 \providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
184 % transition (break, fancybreak, anonymous section)
185 \providecommand*{\DUtransition}{%
186 \hspace*{\fill}\hrulefill\hspace*{\fill}
187 \vskip 0.5\baselineskip
190 % hyperlinks:
191 \ifthenelse{\isundefined{\hypersetup}}{
192 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
193 \usepackage{bookmark}
194 \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
196 \hypersetup{
197 pdftitle={reStructuredText Test Document},
198 pdfauthor={David Goodger;Me;Myself;I}
201 %%% Title Data
202 \title{\phantomsection%
203 reStructuredText Test Document%
204 \label{restructuredtext-test-document}%
205 \label{doctitle}%
206 \\ % subtitle%
207 \DUdocumentsubtitle{Examples of Syntax Constructs}%
208 \label{examples-of-syntax-constructs}%
209 \label{subtitle}}
210 \author{}
211 \date{}
213 %%% Body
214 \begin{document}
215 \maketitle
217 % Docinfo
218 \begin{center}
219 \begin{tabularx}{\DUdocinfowidth}{lX}
220 \textbf{Author}: &
221 David Goodger \\
222 \textbf{Address}: &
223 {\raggedright
224 123 Example Street\\
225 Example, EX Canada\\
226 A1B 2C3 } \\
227 \textbf{Contact}: &
228 \href{mailto:goodger@python.org}{goodger@python.org} \\
229 \textbf{Author}: &
230 Me \\
231 \textbf{Author}: &
232 Myself \\
233 \textbf{Author}: &
234 I \\
235 \textbf{Organization}: &
236 humankind \\
237 \textbf{Date}: &
238 Now, or yesterday. Or maybe even \emph{before} yesterday. \\
239 \textbf{Status}: &
240 This is a “work in progress” \\
241 \textbf{Revision}: &
242 is managed by a version control system. \\
243 \textbf{Version}: &
244 1 \\
245 \textbf{Copyright}: &
246 This document has been placed in the public domain. You
247 may do with it as you wish. You may copy, modify,
248 redistribute, reattribute, sell, buy, rent, lease,
249 destroy, or improve it, quote it at length, excerpt,
250 incorporate, collate, fold, staple, or mutilate it, or do
251 anything else to it that your or anyone else’s heart
252 desires. \\
253 \textbf{field name}: &
254 This is a “generic bibliographic field”.
256 \textbf{field name “2}: &
257 Generic bibliographic fields may contain multiple body elements.
259 Like this.
261 \end{tabularx}
262 \end{center}
264 \begin{DUclass}{dedication}
265 \begin{quote}
266 \DUtitle[dedication]{Dedication}
268 For Docutils users \& co-developers.
269 \end{quote}
270 \end{DUclass}
272 \begin{DUclass}{abstract}
273 \begin{quote}
274 \DUtitle[abstract]{Abstract}
276 This is a test document, containing at least one example of each
277 reStructuredText construct.
278 \end{quote}
279 \end{DUclass}
281 % This is a comment. Note how any initial comments are moved by
282 % transforms to after the document title, subtitle, and docinfo.
284 % Above is the document title, and below is the subtitle.
285 % They are transformed from section titles after parsing.
287 % bibliographic fields (which also require a transform):
289 \pagebreak[4] % start ToC on new page
291 \phantomsection\label{table-of-contents}
292 \pdfbookmark[1]{Table of Contents}{table-of-contents}
293 \renewcommand{\contentsname}{Table of Contents}
294 \tableofcontents
297 \section{1   Structural Elements%
298 \label{structural-elements}%
302 \subsection{1.1   Section Title%
303 \label{section-title}%
305 \subsubsection*{Section Subtitle}
307 Lone subsections are converted to a section subtitle by a transform
308 activated with the \texttt{--section-subtitles} command line option or the
309 \texttt{sectsubtitle-xform} configuration value.
312 \subsection{1.2   Empty Section%
313 \label{empty-section}%
317 \subsection{1.3   Transitions%
318 \label{transitions}%
321 Here’s a transition:
323 %___________________________________________________________________________
324 \DUtransition
326 It divides the section. Transitions may also occur between sections:
328 %___________________________________________________________________________
329 \DUtransition
332 \section{2   Body Elements%
333 \label{body-elements}%
337 \subsection{2.1   Paragraphs%
338 \label{paragraphs}%
341 A paragraph.
344 \subsubsection{2.1.1   Inline Markup%
345 \label{inline-markup}%
348 Paragraphs contain text and may contain inline markup: \emph{emphasis},
349 \textbf{strong emphasis}, \texttt{inline literals}, standalone hyperlinks
350 (\url{http://www.python.org}), external hyperlinks (\href{http://www.python.org/}{Python}\DUfootnotemark{id30}{id29}{5}), internal
351 cross-references (\hyperref[example]{example}), external hyperlinks with embedded URIs
352 (\href{http://www.python.org}{Python web site}), \href{http://www.python.org/}{anonymous hyperlink
353 references}\DUfootnotemark{id40}{id29}{5} (\href{http://docutils.sourceforge.net/}{a second reference}\DUfootnotemark{id42}{id41}{9}), footnote references (manually
354 numbered\DUfootnotemark{id1}{id8}{1}, anonymous auto-numbered\DUfootnotemark{id2}{id12}{3}, labeled auto-numbered\DUfootnotemark{id3}{label}{2}, or symbolic\DUfootnotemark{id4}{id13}{*}), citation references (\hyperlink{cit2002}{[CIT2002]}),
355 substitution references (\includegraphics{../../../docs/user/rst/images/biohazard.png}), and %
356 \phantomsection\label{inline-hyperlink-targets}inline hyperlink targets
357 (see \hyperref[targets]{Targets} below for a reference back to here). Character-level
358 inline markup is also possible (although exceedingly ugly!) in \emph{re}\texttt{Structured}\emph{Text}. Problems are indicated by %
359 \raisebox{1em}{\hypertarget{id28}{}}\hyperlink{id27}{\textbf{\color{red}|problematic|}} text
360 (generated by processing errors; this one is intentional). Here is a
361 reference to the \hyperref[doctitle]{doctitle} and the \hyperref[subtitle]{subtitle}.
363 The default role for interpreted text is \DUroletitlereference{Title Reference}. Here are
364 some explicit interpreted text roles: a PEP reference (\href{http://www.python.org/dev/peps/pep-0287}{PEP 287}); an
365 RFC reference (\href{http://tools.ietf.org/html/rfc2822.html}{RFC 2822}); an abbreviation (\DUrole{abbreviation}{abb.}), an acronym
366 (\DUrole{acronym}{reST}), code (\texttt{\DUrole{code}{print \textquotedbl{}hello world\textquotedbl{}}}); a \textsubscript{subscript};
367 a \textsuperscript{superscript} and explicit roles for \DUroletitlereference{Docutils}
368 \emph{standard} \textbf{inline} \texttt{markup}.
370 % DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!
372 Let’s test wrapping and whitespace significance in inline literals:
373 \texttt{This is an example of --inline-literal --text, --including some--
374 strangely--hyphenated-words. ~Adjust-the-width-of-your-browser-window
375 to see how the text is wrapped. ~-- ---- -------- ~Now note ~ ~the
376 spacing ~ ~between the ~ ~words of ~ ~this sentence ~ ~(words
377 should ~ ~be grouped ~ ~in pairs).}
379 If the \texttt{--pep-references} option was supplied, there should be a
380 live link to PEP 258 here.
383 \subsection{2.2   Bullet Lists%
384 \label{bullet-lists}%
387 \begin{itemize}
388 \item A bullet list
390 \begin{itemize}
391 \item Nested bullet list.
393 \item Nested item 2.
394 \end{itemize}
396 \item Item 2.
398 Paragraph 2 of item 2.
400 \begin{itemize}
401 \item Nested bullet list.
403 \item Nested item 2.
405 \begin{itemize}
406 \item Third level.
408 \item Item 2.
409 \end{itemize}
411 \item Nested item 3.
413 \item This nested list should be compacted by the HTML writer.
415 \phantomsection\label{target}
416 % Even if this item contains a target and a comment.
417 \end{itemize}
418 \end{itemize}
421 \subsection{2.3   Enumerated Lists%
422 \label{enumerated-lists}%
425 \begin{enumerate}
426 \item Arabic numerals.
428 \begin{enumerate}
429 \renewcommand{\labelenumii}{\alph{enumii})}
430 \item lower alpha)
432 \begin{enumerate}
433 \renewcommand{\labelenumiii}{(\roman{enumiii})}
434 \item (lower roman)
436 \begin{enumerate}
437 \item upper alpha.
439 \begin{list}{\Roman{enumv})}{\usecounter{enumv}}
440 \item upper roman)
441 \end{list}
442 \end{enumerate}
443 \end{enumerate}
444 \end{enumerate}
446 \item Lists that don’t start at 1:
448 \begin{enumerate}
449 \renewcommand{\labelenumii}{\arabic{enumii}.}
450 \setcounter{enumii}{2}
451 \item Three
453 \item Four
454 \end{enumerate}
456 \begin{enumerate}
457 \renewcommand{\labelenumii}{\Alph{enumii}.}
458 \setcounter{enumii}{2}
459 \item C
461 \item D
462 \end{enumerate}
464 \begin{enumerate}
465 \renewcommand{\labelenumii}{\roman{enumii}.}
466 \setcounter{enumii}{2}
467 \item iii
469 \item iv
470 \end{enumerate}
471 \end{enumerate}
474 \subsection{2.4   Definition Lists%
475 \label{definition-lists}%
478 \begin{description}
479 \item[{Term}] \leavevmode
480 Definition
482 \item[{Term}] \leavevmode (\textbf{classifier})
483 Definition paragraph 1.
485 Definition paragraph 2.
487 \item[{Term}] \leavevmode
488 Definition
490 \item[{Term}] \leavevmode (\textbf{classifier one})(\textbf{classifier two})
491 Definition
493 \end{description}
496 \subsection{2.5   Field Lists%
497 \label{field-lists}%
500 \begin{DUfieldlist}
501 \item[{what:}]
502 Field lists map field names to field bodies, like database
503 records. They are often part of an extension syntax. They are
504 an unambiguous variant of RFC 2822 fields.
506 \item[{how arg1 arg2:}]
507 The field marker is a colon, the field name, and a colon.
509 The field body may contain one or more body elements, indented
510 relative to the field marker.
512 \item[{credits:}]
513 \DUrole{credits}{This paragraph has the \DUroletitlereference{credits} class set. (This is actually not
514 about credits but just for ensuring that the class attribute
515 doesn’t get stripped away.)}
516 \end{DUfieldlist}
519 \subsection{2.6   Option Lists%
520 \label{option-lists}%
523 For listing command-line options:
525 \begin{DUoptionlist}
526 \item[-a] command-line option “a”
528 \item[-b file] options can have arguments
529 and long descriptions
531 \item[--long] options can be long also
533 \item[--input=file] long options can also have
534 arguments
536 \item[--very-long-option] The description can also start on the next line.
538 The description may contain multiple body elements,
539 regardless of where it starts.
541 \item[-x, -y, -z] Multiple options are an “option group”.
543 \item[-v, --verbose] Commonly-seen: short \& long options.
545 \item[-1 file, --one=file, --two file] Multiple options with arguments.
547 \item[/V] DOS/VMS-style options too
548 \end{DUoptionlist}
550 There must be at least two spaces between the option and the
551 description.
554 \subsection{2.7   Literal Blocks%
555 \label{literal-blocks}%
558 Literal blocks are indicated with a double-colon (“::”) at the end of
559 the preceding paragraph (over there \texttt{-->}). They can be indented:
561 \begin{quote}
562 \begin{alltt}
563 if literal_block:
564 text = 'is left as-is'
565 spaces_and_linebreaks = 'are preserved'
566 markup_processing = None
567 \end{alltt}
568 \end{quote}
570 Or they can be quoted without indentation:
572 \begin{quote}
573 \begin{alltt}
574 >> Great idea!
576 > Why didn't I think of that?
577 \end{alltt}
578 \end{quote}
581 \subsection{2.8   Line Blocks%
582 \label{line-blocks}%
585 This section tests line blocks. Line blocks are body elements which
586 consist of lines and other line blocks. Nested line blocks cause
587 indentation.
589 \begin{DUlineblock}{0em}
590 \item[] This is a line block. It ends with a blank line.
591 \item[]
592 \begin{DUlineblock}{\DUlineblockindent}
593 \item[] New lines begin with a vertical bar (“|”).
594 \item[] Line breaks and initial indent are significant, and preserved.
595 \item[]
596 \begin{DUlineblock}{\DUlineblockindent}
597 \item[] Continuation lines are also possible. A long line that is intended
598 to wrap should begin with a space in place of the vertical bar.
599 \end{DUlineblock}
600 \item[] The left edge of a continuation line need not be aligned with
601 the left edge of the text above it.
602 \end{DUlineblock}
603 \end{DUlineblock}
605 \begin{DUlineblock}{0em}
606 \item[] This is a second line block.
607 \item[]
608 \item[] Blank lines are permitted internally, but they must begin with a “|”.
609 \end{DUlineblock}
611 Another line block, surrounded by paragraphs:
613 \begin{DUlineblock}{0em}
614 \item[] And it’s no good waiting by the window
615 \item[] It’s no good waiting for the sun
616 \item[] Please believe me, the things you dream of
617 \item[] They don’t fall in the lap of no-one
618 \end{DUlineblock}
620 Take it away, Eric the Orchestra Leader!
622 \begin{quote}
623 \begin{DUlineblock}{0em}
624 \item[] A one, two, a one two three four
625 \item[]
626 \item[] Half a bee, philosophically,
627 \item[]
628 \begin{DUlineblock}{\DUlineblockindent}
629 \item[] must, \emph{ipso facto}, half not be.
630 \end{DUlineblock}
631 \item[] But half the bee has got to be,
632 \item[]
633 \begin{DUlineblock}{\DUlineblockindent}
634 \item[] \emph{vis a vis} its entity. D’you see?
635 \item[]
636 \end{DUlineblock}
637 \item[] But can a bee be said to be
638 \item[]
639 \begin{DUlineblock}{\DUlineblockindent}
640 \item[] or not to be an entire bee,
641 \item[]
642 \begin{DUlineblock}{\DUlineblockindent}
643 \item[] when half the bee is not a bee,
644 \item[]
645 \begin{DUlineblock}{\DUlineblockindent}
646 \item[] due to some ancient injury?
647 \item[]
648 \end{DUlineblock}
649 \end{DUlineblock}
650 \end{DUlineblock}
651 \item[] Singing…
652 \end{DUlineblock}
653 \end{quote}
655 A line block, like the following poem by Christian Morgenstern, can
656 also be centre-aligned:
658 \begin{selectlanguage}{german}
659 \begin{DUlineblock}{0em}
660 \centering
661 \item[] \textbf{Die Trichter}
662 \item[]
663 \item[] Zwei Trichter wandeln durch die Nacht.
664 \item[] Durch ihres Rumpfs verengten Schacht
665 \item[] fließt weißes Mondlicht
666 \item[] still und heiter
667 \item[] auf   ihren
668 \item[] Waldweg
669 \item[] u. s.
670 \item[] w.
671 \item[]
672 \end{DUlineblock}
673 \end{selectlanguage}
676 \subsection{2.9   Block Quotes%
677 \label{block-quotes}%
680 Block quotes consist of indented body elements:
682 \begin{quote}
683 My theory by A. Elk. Brackets Miss, brackets. This theory goes
684 as follows and begins now. All brontosauruses are thin at one
685 end, much much thicker in the middle and then thin again at the
686 far end. That is my theory, it is mine, and belongs to me and I
687 own it, and what it is too.
688 \nopagebreak
690 \raggedleft —Anne Elk (Miss)
691 \end{quote}
693 The language of a quote (like any other object) can be specified by
694 a class attribute:
698 \begin{selectlanguage}{french}
699 \begin{quote}
700 ReStructuredText est un langage de balisage léger utilisé
701 notamment dans la documentation du langage Python.
702 \end{quote}
703 \end{selectlanguage}
706 \subsection{2.10   Doctest Blocks%
707 \label{doctest-blocks}%
710 \begin{quote}
711 \begin{alltt}
712 >>> print 'Python-specific usage examples; begun with ">>>"'
713 Python-specific usage examples; begun with ">>>"
714 >>> print '(cut and pasted from interactive Python sessions)'
715 (cut and pasted from interactive Python sessions)
716 \end{alltt}
717 \end{quote}
720 \subsection{2.11   Footnotes%
721 \label{footnotes}%
724 \DUfootnotetext{id8}{id1}{1}{%
725 A footnote contains body elements, consistently indented by at
726 least 3 spaces.
728 This is the footnote’s second paragraph.
731 \DUfootnotetext{label}{id3}{2}{\phantomsection\label{label}%
732 Footnotes may be numbered, either manually (as in\DUfootnotemark{id9}{id8}{1}) or
733 automatically using a “\#”-prefixed label. This footnote has a
734 label so it can be referred to from multiple places, both as a
735 footnote reference (\DUfootnotemark{id10}{label}{2}) and as a \hyperref[label]{hyperlink reference}.
738 \DUfootnotetext{id12}{id2}{3}{%
739 This footnote is numbered automatically and anonymously using a
740 label of “\#” only.
742 This is the second paragraph.
744 And this is the third paragraph.
747 \DUfootnotetext{id13}{id4}{*}{%
748 Footnotes may also use symbols, specified with a “*” label.
749 Here’s a reference to the next footnote:\DUfootnotemark{id14}{id15}{}.
752 \DUfootnotetext{id15}{id14}{}{%
753 This footnote shows the next symbol in the sequence.
756 \DUfootnotetext{id16}{id16}{4}{%
757 Here’s an unreferenced footnote, with a reference to a
758 nonexistent footnote:%
759 \raisebox{1em}{\hypertarget{id48}{}}%
760 \raisebox{1em}{\hypertarget{id17}{}}\hyperlink{id47}{\textbf{\color{red}{[}5{]}\_}}.
764 \subsection{2.12   Citations%
765 \label{citations}%
767 \begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
768 Citations are text-labeled footnotes. They may be
769 rendered separately and differently from footnotes.
770 \end{figure}
772 Here’s a reference to the above, \hyperlink{cit2002}{[CIT2002]}, and a %
773 \raisebox{1em}{\hypertarget{id50}{}}%
774 \raisebox{1em}{\hypertarget{id19}{}}\hyperlink{id49}{\textbf{\color{red}{[}nonexistent{]}\_}}
775 citation.
778 \subsection{2.13   Targets%
779 \label{targets}%
780 \label{another-target}%
783 \phantomsection\label{example}
784 This paragraph is pointed to by the explicit “example” target. A
785 reference can be found under \hyperref[inline-markup]{Inline Markup}, above. \hyperref[inline-hyperlink-targets]{Inline
786 hyperlink targets} are also possible.
788 Section headers are implicit targets, referred to by name. See
789 \hyperref[targets]{Targets}, which is a subsection of \hyperref[body-elements]{Body Elements}.
791 Explicit external targets are interpolated into references such as
792 \href{http://www.python.org/}{Python}\DUfootnotemark{id31}{id29}{5}”.
794 Targets may be indirect and anonymous. Thus \hyperref[targets]{this phrase} may also
795 refer to the \hyperref[targets]{Targets} section.
797 Here’s a %
798 \raisebox{1em}{\hypertarget{id52}{}}\hyperlink{id51}{\textbf{\color{red}`hyperlink reference without a target`\_}}, which generates an
799 error.
802 \subsubsection{2.13.1   Duplicate Target Names%
803 \label{duplicate-target-names}%
806 Duplicate names in section headers or other implicit targets will
807 generate “info” (level-1) system messages. Duplicate names in
808 explicit targets will generate “warning” (level-2) system messages.
811 \subsubsection{2.13.2   Duplicate Target Names%
812 \label{id21}%
815 Since there are two “Duplicate Target Names” section headers, we
816 cannot uniquely refer to either of them by name. If we try to (like
817 this: %
818 \raisebox{1em}{\hypertarget{id54}{}}\hyperlink{id53}{\textbf{\color{red}`Duplicate Target Names`\_}}), an error is generated.
821 \subsection{2.14   Directives%
822 \label{directives}%
825 \phantomsection\label{contents}
826 These are just a sample of the many reStructuredText Directives. For
827 others, please see
828 \url{http://docutils.sourceforge.net/docs/ref/rst/directives.html}.
831 \subsubsection{2.14.1   Document Parts%
832 \label{document-parts}%
835 An example of the “contents” directive can be seen above this section
836 (a local, untitled table of \hyperref[contents]{contents}) and at the beginning of the
837 document (a document-wide \hyperref[table-of-contents]{table of contents}).
840 \subsubsection{2.14.2   Images and Figures%
841 \label{images-and-figures}%
844 An image directive (also clickable – a hyperlink reference):
846 \hyperref[directives]{\includegraphics{../../../docs/user/rst/images/title.png}}
848 Image with multiple IDs:
850 \includegraphics{../../../docs/user/rst/images/title.png}
851 \phantomsection\label{image-target-3}\label{image-target-2}\label{image-target-1}
853 A centered image:
855 \noindent\makebox[\linewidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
857 A left-aligned image:
859 \noindent{\includegraphics{../../../docs/user/rst/images/biohazard.png}\hfill}
861 This paragraph might flow around the image.
862 The specific behavior depends upon the style sheet and
863 the browser or rendering software used.
865 A right-aligned image:
867 \noindent{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png}}
869 This paragraph might flow around the image.
870 The specific behavior depends upon the style sheet and
871 the browser or rendering software used.
873 For inline images see \hyperref[substitution-definitions]{Substitution Definitions}.
875 Image size:
877 An image 2 em wide:
879 \includegraphics[width=2em]{../../../docs/user/rst/images/biohazard.png}
881 An image 2 em wide and 15 pixel high:
883 \includegraphics[height=15\pdfpxdimen,width=2em]{../../../docs/user/rst/images/biohazard.png}
885 An image occupying 50\% of the line width:
887 \includegraphics[width=0.500\linewidth]{../../../docs/user/rst/images/title.png}
889 An image 2 cm high:
891 \includegraphics[height=2cm]{../../../docs/user/rst/images/biohazard.png}
893 A \emph{figure} is an image with a caption and/or a legend. With page-based output
894 media, figures might float to a different position if this helps the page
895 layout.
897 \begin{DUclass}{figclass1}
898 \begin{DUclass}{figclass2}
899 \begin{figure}
900 \noindent\makebox[\linewidth][c]{\includegraphics[width=258bp]{../../../docs/user/rst/images/title.png}}
901 \caption{Plaintext markup syntax and parser system.}
902 \begin{DUlegend}
903 \setlength{\DUtablewidth}{\linewidth}
904 \begin{longtable*}[c]{|p{0.156\DUtablewidth}|p{0.563\DUtablewidth}|}
905 \hline
909 Revised, revisited, based on ‘re’ module.
911 \hline
913 Structured
915 Structure-enhanced text, structuredtext.
917 \hline
919 Text
921 Well it is, isn’t it?
923 \hline
924 \end{longtable*}
926 This paragraph is also part of the legend.
927 \end{DUlegend}
928 \end{figure}
929 \end{DUclass}
930 \end{DUclass}
932 A left-aligned figure:
934 \begin{DUclass}{figclass1}
935 \begin{DUclass}{figclass2}
936 \begin{figure} % align = "left"
937 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
938 \caption{This is the caption.}
939 \begin{DUlegend}
940 This is the legend.
942 The legend may consist of several paragraphs.
943 \end{DUlegend}
944 \end{figure}
945 \end{DUclass}
946 \end{DUclass}
948 This paragraph might flow around the figure.
950 The specific behavior depends upon the style sheet and the browser or
951 rendering software used.
953 A centered figure:
955 \begin{figure}
956 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
957 \caption{This is the caption.}
958 \begin{DUlegend}
959 This is the legend.
961 The legend may consist of several paragraphs.
962 \end{DUlegend}
963 \end{figure}
965 This paragraph might flow around the figure.
967 The specific behavior depends upon the style sheet and the browser or
968 rendering software used.
970 A right-aligned figure:
972 \begin{figure} % align = "right"
973 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
974 \caption{This is the caption.}
975 \begin{DUlegend}
976 This is the legend.
978 The legend may consist of several paragraphs.
979 \end{DUlegend}
980 \end{figure}
982 This paragraph might flow around the figure. The specific behavior depends
983 upon the style sheet and the browser or rendering software used.
985 Tables may be given titles and additional arguments with the \emph{table}
986 directive:
988 \setlength{\DUtablewidth}{\linewidth}
989 \begin{longtable}[l]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
990 \caption{left-aligned table}\\
991 \hline
992 \textbf{%
994 } & \textbf{%
995 not A
996 } \\
997 \hline
998 \endfirsthead
999 \caption[]{left-aligned table (... continued)}\\
1000 \hline
1001 \textbf{%
1003 } & \textbf{%
1004 not A
1005 } \\
1006 \hline
1007 \endhead
1008 \multicolumn{2}{c}{\hfill ... continued on next page} \\
1009 \endfoot
1010 \endlastfoot
1012 False
1014 True
1016 \hline
1018 True
1020 False
1022 \hline
1023 \end{longtable}
1025 \setlength{\DUtablewidth}{\linewidth}
1026 \begin{longtable}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
1027 \caption{center-aligned table}\\
1028 \hline
1029 \textbf{%
1031 } & \textbf{%
1032 not A
1033 } \\
1034 \hline
1035 \endfirsthead
1036 \caption[]{center-aligned table (... continued)}\\
1037 \hline
1038 \textbf{%
1040 } & \textbf{%
1041 not A
1042 } \\
1043 \hline
1044 \endhead
1045 \multicolumn{2}{c}{\hfill ... continued on next page} \\
1046 \endfoot
1047 \endlastfoot
1049 False
1051 True
1053 \hline
1055 True
1057 False
1059 \hline
1060 \end{longtable}
1062 \setlength{\DUtablewidth}{\linewidth}
1063 \begin{longtable}[r]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
1064 \caption{right-aligned table}\\
1065 \hline
1066 \textbf{%
1068 } & \textbf{%
1069 not A
1070 } \\
1071 \hline
1072 \endfirsthead
1073 \caption[]{right-aligned table (... continued)}\\
1074 \hline
1075 \textbf{%
1077 } & \textbf{%
1078 not A
1079 } \\
1080 \hline
1081 \endhead
1082 \multicolumn{2}{c}{\hfill ... continued on next page} \\
1083 \endfoot
1084 \endlastfoot
1086 False
1088 True
1090 \hline
1092 True
1094 False
1096 \hline
1097 \end{longtable}
1099 With the “widths” argument “auto” (or “class” value “colwidths-auto”),
1100 column widths are determined by the backend (if supported by the
1101 writer/backend).
1103 \begin{longtable*}[c]{|l|l|l|}
1104 \hline
1105 \textbf{A} & \textbf{B} & \textbf{A or B} \\
1106 \hline
1107 \endfirsthead
1108 \hline
1109 \textbf{A} & \textbf{B} & \textbf{A or B} \\
1110 \hline
1111 \endhead
1112 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1113 \endfoot
1114 \endlastfoot
1115 False & False & False \\
1116 \hline
1117 True & False & True \\
1118 \hline
1119 False & True & True \\
1120 \hline
1121 True & True & True \\
1122 \hline
1123 \end{longtable*}
1124 \label{target2}\label{target1}
1127 \subsubsection{2.14.3   Admonitions%
1128 \label{admonitions}%
1131 \DUadmonition[attention]{
1132 \DUtitle[attention]{Attention!}
1134 Directives at large.
1137 \DUadmonition[caution]{
1138 \DUtitle[caution]{Caution!}
1140 Don’t take any wooden nickels.
1143 \DUadmonition[danger]{
1144 \DUtitle[danger]{!DANGER!}
1146 Mad scientist at work!
1149 \DUadmonition[error]{
1150 \DUtitle[error]{Error}
1152 Does not compute.
1155 \DUadmonition[hint]{
1156 \DUtitle[hint]{Hint}
1158 It’s bigger than a bread box.
1161 \DUadmonition[important]{
1162 \DUtitle[important]{Important}
1164 \begin{itemize}
1165 \item Wash behind your ears.
1167 \item Clean up your room.
1169 \item Call your mother.
1171 \item Back up your data.
1172 \end{itemize}
1175 \DUadmonition[note]{
1176 \DUtitle[note]{Note}
1178 This is a note.
1181 \DUadmonition[tip]{
1182 \DUtitle[tip]{Tip}
1184 15\% if the service is good.
1187 \DUadmonition[warning]{
1188 \DUtitle[warning]{Warning}
1190 Strong prose may provoke extreme mental exertion.
1191 Reader discretion is strongly advised.
1194 \DUadmonition[admonition-and-by-the-way]{
1195 \DUtitle[admonition-and-by-the-way]{And, by the way…}
1197 You can make up your own admonition too.
1201 \subsubsection{2.14.4   Topics, Sidebars, and Rubrics%
1202 \label{topics-sidebars-and-rubrics}%
1205 \emph{Sidebars} are like miniature, parallel documents.
1207 \DUsidebar{
1208 \DUtitle[title]{Sidebar Title}
1210 \DUsubtitle[sidebar]{Optional Subtitle}
1212 This is a sidebar. It is for text outside the flow of the main
1213 text.
1215 \DUrubric{This is a rubric inside a sidebar}
1217 Sidebars often appear beside the main text with a border and a different
1218 background or font color.
1221 A \emph{topic} is like a block quote with a title, or a self-contained section
1222 with no subsections.
1224 \begin{DUclass}{topic}
1225 \begin{quote}
1226 \DUtitle[topic]{Topic Title}
1228 This is a topic.
1229 \end{quote}
1230 \end{DUclass}
1232 A \emph{rubric} is like an informal heading that doesn’t correspond to the
1233 document’s structure. It is typically highlighted in red (hence the name).
1235 \DUrubric{This is a rubric}
1237 Topics and rubrics can be used at places where a \hyperref[section-title]{section title} is not
1238 allowed (e.g. inside a directive).
1241 \subsubsection{2.14.5   Target Footnotes%
1242 \label{target-footnotes}%
1245 \DUfootnotetext{id29}{id30}{5}{%
1246 \url{http://www.python.org/}
1249 \DUfootnotetext{id33}{id34}{6}{%
1250 \url{http://pygments.org/}
1253 \DUfootnotetext{id35}{id36}{7}{%
1254 \url{ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf}
1257 \DUfootnotetext{id38}{id39}{8}{%
1258 \url{http://ctan.org/pkg/polyglossia}
1261 \DUfootnotetext{id41}{id42}{9}{%
1262 \url{http://docutils.sourceforge.net/}
1265 \DUfootnotetext{id43}{id44}{10}{%
1266 \url{A:DOS\\path\\}
1270 \subsubsection{2.14.6   Replacement Text%
1271 \label{replacement-text}%
1274 I recommend you try \href{http://www.python.org/}{Python, \emph{the} best language around}\DUfootnotemark{id32}{id29}{5}.
1277 \subsubsection{2.14.7   Compound Paragraph%
1278 \label{compound-paragraph}%
1281 The \emph{compound} directive is used to create a “compound paragraph”, which
1282 is a single logical paragraph containing multiple physical body
1283 elements. For example:
1285 \begin{DUclass}{compound}
1286 The ‘rm’ command is very dangerous. If you are logged
1287 in as root and enter
1288 \begin{quote}
1289 \begin{alltt}
1290 cd /
1291 rm -rf *
1292 \end{alltt}
1293 \end{quote}
1294 you will erase the entire contents of your file system.
1295 \end{DUclass}
1297 Test the handling and display of compound paragraphs:
1299 \begin{DUclass}{compound}
1300 \begin{DUclass}{some-class}
1301 Compound 2, paragraph 1,
1303 compound 2, paragraph 2,
1304 \begin{itemize}
1305 \item list item 1,
1307 \item list item 2,
1308 \end{itemize}
1309 compound 2, paragraph 3.
1310 \end{DUclass}
1311 \end{DUclass}
1313 \begin{DUclass}{compound}
1314 Compound 3, only consisting of one paragraph.
1315 \end{DUclass}
1317 \begin{DUclass}{compound}
1318 \begin{quote}
1319 \begin{alltt}
1320 Compound 4.
1321 This one starts with a literal block.
1322 \end{alltt}
1323 \end{quote}
1324 Compound 4, paragraph following the literal block.
1325 \end{DUclass}
1327 Now something \emph{really} perverted – a nested compound block. This is
1328 just to test that it works at all; the results don’t have to be
1329 meaningful.
1331 \begin{DUclass}{compound}
1332 Compound 5, block 1 (a paragraph).
1334 \begin{DUclass}{compound}
1335 Compound 6 is block 2 in compound 5.
1337 Compound 6, another paragraph.
1338 \end{DUclass}
1340 Compound 5, block 3 (a paragraph).
1341 \end{DUclass}
1343 \begin{DUclass}{compound}
1344 Compound 7, tests the inclusion of various block-level
1345 elements in one logical paragraph. First a table,
1347 \setlength{\DUtablewidth}{\linewidth}
1348 \begin{longtable*}[c]{|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|}
1349 \hline
1351 Left cell, first
1352 paragraph.
1354 Left cell, second
1355 paragraph.
1357 Middle cell,
1358 consisting of
1359 exactly one
1360 paragraph.
1362 Right cell.
1364 Paragraph 2.
1366 Paragraph 3.
1368 \hline
1369 \end{longtable*}
1370 followed by a paragraph. This physical paragraph is
1371 actually a continuation of the paragraph before the table. It is followed
1373 \begin{quote}
1374 a quote and
1375 \end{quote}
1376 \begin{enumerate}
1377 \item an enumerated list,
1378 \end{enumerate}
1379 a paragraph,
1380 \begin{DUoptionlist}
1381 \item[--an] option list,
1382 \end{DUoptionlist}
1383 a paragraph,
1384 \begin{DUfieldlist}
1385 \item[{a field:}]
1386 list,
1387 \end{DUfieldlist}
1388 a paragraph,
1389 \begin{description}
1390 \item[{a definition}] \leavevmode
1391 list,
1393 \end{description}
1394 a paragraph, an image:
1395 \includegraphics{../../../docs/user/rst/images/biohazard.png}
1396 a paragraph,
1397 \begin{DUlineblock}{0em}
1398 \item[] a line
1399 \item[] block,
1400 \end{DUlineblock}
1401 a paragraph followed by a comment,
1402 % this is a comment
1403 a paragraph, a
1405 \DUadmonition[note]{
1406 \DUtitle[note]{Note}
1408 with content
1410 and the final paragraph of the compound 7.
1411 \end{DUclass}
1414 \subsubsection{2.14.8   Parsed Literal Blocks%
1415 \label{parsed-literal-blocks}%
1418 \begin{quote}
1419 {\ttfamily \raggedright \noindent
1420 This~is~a~parsed~literal~block.\\
1421 ~~~~This~line~is~indented.~~The~next~line~is~blank.\\
1423 Inline~markup~is~supported,~e.g.~\emph{emphasis},~\textbf{strong},~\texttt{literal\\
1424 text},~\textsubscript{sub-}~and~\textsuperscript{super}scripts,\\
1425 inline~formulas:~$A = 2 \pi r^2$,\\
1426 footnotes\DUfootnotemark{id22}{id8}{1},~%
1427 \phantomsection\label{hyperlink-targets}hyperlink~targets,~and~\href{http://www.python.org/}{references}.
1429 \end{quote}
1432 \subsubsection{2.14.9   Code%
1433 \label{code}%
1436 Blocks of source code can be set with the \DUroletitlereference{code} directive. If the code
1437 language is specified, the content is parsed and tagged by the \href{http://pygments.org/}{Pygments}\DUfootnotemark{id34}{id33}{6}
1438 syntax highlighter and can be formatted with a style sheet. (Code parsing
1439 is turned off using the \texttt{syntax-highlight} config setting in the test
1440 conversions in order to get identical results with/without installed
1441 Pygments highlighter.)
1443 \begin{DUclass}{code}
1444 \begin{DUclass}{python}
1445 \begin{quote}
1446 \begin{alltt}
1447 print 'This is Python code.'
1448 \end{alltt}
1449 \end{quote}
1450 \end{DUclass}
1451 \end{DUclass}
1453 The \texttt{:number-lines:} option (with optional start value) generates line
1454 numbers:
1456 \begin{DUclass}{code}
1457 \begin{DUclass}{python}
1458 \begin{quote}
1459 {\ttfamily \raggedright \noindent
1460 \DUrole{ln}{~8~}\#~print~integers~from~0~to~9:\\
1461 \DUrole{ln}{~9~}for~i~in~range(10):\\
1462 \DUrole{ln}{10~}~~~~print~i
1464 \end{quote}
1465 \end{DUclass}
1466 \end{DUclass}
1468 For inline code snippets, there is the \DUroletitlereference{code} role, which can be used
1469 directly (the code will not be parsed/tagged, as the language is not known)
1470 or as base for special code roles, e.g. the LaTeX code in the next
1471 paragraph.
1473 Docutils uses LaTeX syntax for math directives and roles:
1474 \texttt{\DUrole{code}{\DUrole{tex}{\textbackslash{}alpha = f(x)}}} prints $\alpha = f(x)$.
1476 The \texttt{:code:} option of the \DUroletitlereference{include} directive sets the included content
1477 as a code block, here the rst file \texttt{header\_footer.txt} with line numbers:
1479 \begin{DUclass}{code}
1480 \begin{DUclass}{rst}
1481 \begin{quote}
1482 {\ttfamily \raggedright \noindent
1483 \DUrole{ln}{1~}..~header::~Document~header\\
1484 \DUrole{ln}{2~}..~footer::~Document~footer
1486 \end{quote}
1487 \end{DUclass}
1488 \end{DUclass}
1491 \subsection{2.15   Substitution Definitions%
1492 \label{substitution-definitions}%
1495 An inline image (\includegraphics{../../../docs/user/rst/images/biohazard.png}) example:
1497 (Substitution definitions are not visible in the HTML source.)
1500 \subsection{2.16   Comments%
1501 \label{comments}%
1504 Here’s one:
1506 % Comments begin with two dots and a space. Anything may
1507 % follow, except for the syntax of footnotes, hyperlink
1508 % targets, directives, or substitution definitions.
1510 % Double-dashes -- "--" -- must be escaped somehow in HTML output.
1512 % Comments may contain non-ASCII characters: ä ö ü æ ø å
1514 (View the HTML source to see the comment.)
1517 \subsection{2.17   Raw text%
1518 \label{raw-text}%
1521 This does not necessarily look nice, because there may be missing white space.
1523 It’s just there to freeze the behavior.
1525 A test.
1527 Second test.
1529 \DUrole{myclass}{Another test with myclass set.}
1531 This is the \DUrole{myrawroleclass}{fourth test} with myrawroleclass set.
1533 Fifth test in LaTeX.\\Line two.
1536 \subsection{2.18   Container%
1537 \label{container}%
1540 \begin{DUclass}{custom}
1542 paragraph 1
1544 paragraph 2
1545 \end{DUclass}
1547 % currently not implemented in LaTeX:
1548 % .. include:: data/header_footer.txt
1551 \subsection{2.19   Colspanning tables%
1552 \label{colspanning-tables}%
1555 This table has a cell spanning two columns:
1557 \setlength{\DUtablewidth}{\linewidth}
1558 \begin{longtable*}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.086\DUtablewidth}|}
1559 \hline
1560 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1561 Inputs
1562 }} & \textbf{%
1563 Output
1564 } \\
1565 \hline
1566 \textbf{%
1568 } & \textbf{%
1570 } & \textbf{%
1571 A or B
1572 } \\
1573 \hline
1574 \endfirsthead
1575 \hline
1576 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1577 Inputs
1578 }} & \textbf{%
1579 Output
1580 } \\
1581 \hline
1582 \textbf{%
1584 } & \textbf{%
1586 } & \textbf{%
1587 A or B
1588 } \\
1589 \hline
1590 \endhead
1591 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1592 \endfoot
1593 \endlastfoot
1595 False
1597 False
1599 False
1601 \hline
1603 True
1605 False
1607 True
1609 \hline
1611 False
1613 True
1615 True
1617 \hline
1619 True
1621 True
1623 True
1625 \hline
1626 \end{longtable*}
1629 \subsection{2.20   Rowspanning tables%
1630 \label{rowspanning-tables}%
1633 Here’s a table with cells spanning several rows:
1635 \setlength{\DUtablewidth}{\linewidth}
1636 \begin{longtable*}[c]{|p{0.296\DUtablewidth}|p{0.156\DUtablewidth}|p{0.226\DUtablewidth}|}
1637 \hline
1638 \textbf{%
1639 Header row, column 1
1640 (header rows optional)
1641 } & \textbf{%
1642 Header 2
1643 } & \textbf{%
1644 Header 3
1645 } \\
1646 \hline
1647 \endfirsthead
1648 \hline
1649 \textbf{%
1650 Header row, column 1
1651 (header rows optional)
1652 } & \textbf{%
1653 Header 2
1654 } & \textbf{%
1655 Header 3
1656 } \\
1657 \hline
1658 \endhead
1659 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1660 \endfoot
1661 \endlastfoot
1663 body row 1, column 1
1665 column 2
1667 column 3
1669 \hline
1671 body row 2
1672 & \multirow{2}{0.16\DUtablewidth}{%
1673 Cells may
1674 span rows.
1675 } & \multirow{2}{0.23\DUtablewidth}{%
1676 Another
1677 rowspanning
1678 cell.
1679 } \\
1680 \cline{1-1}
1682 body row 3
1683 & & \\
1684 \hline
1685 \end{longtable*}
1688 \subsection{2.21   Custom Roles%
1689 \label{custom-roles}%
1692 \begin{itemize}
1693 \item A role based on an existing role.
1695 \texttt{\DUrole{custom}{one}} \texttt{\DUrole{custom}{two}} \texttt{\DUrole{custom}{three}}
1697 \item A new role.
1699 \DUrole{customnew}{one two three}
1701 \item A role with class attribute.
1703 \DUrole{special}{interpreted text}
1705 \item A language-switching role:
1707 Let’s count in German \foreignlanguage{german}{eins zwei drei}.
1709 \item A role with multiple class attributes, styled with raw directives:
1711 \newcommand{\DUrolegreen}[1]{\textcolor{green}{#1}}
1712 \newcommand{\DUrolesc}[1]{\textsc{#1}}
1714 The following works in most browsers but does not validate
1715 (\texttt{<style>} is only allowed in the document head):
1717 \begin{quote}
1718 \begin{alltt}
1719 .. raw:: html
1721 <style type="text/css"><!--
1722 .green \{color: green;\}
1723 .sc \{font-variant: small-caps;\}
1724 --></style>
1725 \end{alltt}
1726 \end{quote}
1728 \DUrole{green}{\DUrole{sc}{\foreignlanguage{english}{British colourful text in small-caps}}}.
1729 \end{itemize}
1732 \subsection{2.22   Mathematics%
1733 \label{mathematics}%
1736 Docutils supports inline math with the prefix or postfix \texttt{:math:}
1737 role specificator, $n! + \sin(x_n^2)$ and $A_\text{c} =
1738 \frac{\pi}{4} d^2$, as well as displayed math via the
1739 \DUroletitlereference{math} directive:
1741 \begin{equation*}
1742 f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\varepsilon}{k_\text{B}T}\right)}
1743 \end{equation*}
1744 Content may start on the first line of the directive, e.g.
1746 \begin{equation*}
1747 N = \frac{\text{number of apples}}{7}
1748 \end{equation*}
1749 Equations can be labeled with a reference name using the \texttt{:name:} option.
1750 See \hyperref[eq-m]{eq:M} and \hyperref[eq-schrodinger]{eq:schrödinger} below.
1752 The determinant of the matrix
1754 \begin{equation*}
1755 \mathbf{M} = \left(\begin{matrix}a&b\\c&d\end{matrix}\right)
1756 \phantomsection
1757 \label{eq-m}
1758 \end{equation*}
1759 is $|\mathbf{M}| = ad - bc$.
1761 More than one display math block can be put in one math directive.
1762 For example, the following sum and integral with limits:
1764 \begin{equation*}
1765 \int_0^1 x^n dx = \frac{1}{n + 1}
1766 \end{equation*}%
1767 \begin{equation*}
1768 \sum_{n=1}^m n = \frac{m(m+1)}{2}
1769 \end{equation*}
1770 LaTeX-supported Unicode math symbols can be used in math roles and
1771 directives:
1773 The Schrödinger equation
1775 \begin{equation*}
1776 i\hbar \frac{\partial }{\partial t}\Psi = \hat{H}\Psi ,
1777 \phantomsection
1778 \label{eq-schrodinger}
1779 \end{equation*}
1780 with the \emph{wave function} $\Psi $, describes how the quantum state of a
1781 physical system changes in time.
1783 \begin{description}
1784 \item[{Math-Accents:}] \leavevmode
1785 \setlength{\DUtablewidth}{\linewidth}
1786 \begin{longtable*}[c]{p{0.315\DUtablewidth}p{0.315\DUtablewidth}p{0.315\DUtablewidth}}
1788 $\acute{a}$ \texttt{\textbackslash{}acute\{a\}}
1790 $\dot{t}$ \texttt{\textbackslash{}dot\{t\}}
1792 $\hat{\gamma}$ \texttt{\textbackslash{}hat\{\textbackslash{}gamma\}}
1795 $\grave{a}$ \texttt{\textbackslash{}grave\{a\}}
1797 $\ddot{t}$ \texttt{\textbackslash{}ddot\{t\}}
1799 $\tilde{\alpha}$ \texttt{\textbackslash{}tilde\{\textbackslash{}alpha\}}
1802 $\breve{x}$ \texttt{\textbackslash{}breve\{x\}}
1804 $\dddot{t}$ \texttt{\textbackslash{}dddot\{t\}}
1806 $\vec{\imath}$ \texttt{\textbackslash{}vec\{\textbackslash{}imath\}}
1809 $\check{a}$ \texttt{\textbackslash{}check\{a\}}
1811 $\bar{a}$ \texttt{\textbackslash{}bar\{a\}}
1813 $\vec{R}$ \texttt{\textbackslash{}vec\{R\}}
1815 \end{longtable*}
1817 \end{description}
1819 % \widetilde{xxx}
1820 % \widehat{xxx}
1822 Modulation Transfer Function:
1824 \begin{equation*}
1825 \text{MTF} = \left|\frac{\mathcal{F}\{s(x)\}}
1826 {\mathcal{F}\{ s(x)\} |_{\omega _{x}=0}}\right|
1827 = \mathrm{abs}\left(\frac
1828 {\int _{-\infty }^{\infty }s(x) \mathrm{e}^{\mathrm{i}\omega _{x}x}\mathrm{d}{x}}
1829 {\int _{-\infty }^{\infty }s(x)\mathrm{d}{x}}
1830 \right).
1831 \end{equation*}
1832 Math split over two lines: If a double backslash is detected outside a
1833 \texttt{\textbackslash{}begin\{...\} \textbackslash{}end\{...\}} pair, the math code is wrapped in an \href{ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf}{AMSmath}\DUfootnotemark{id36}{id35}{7}
1834 \texttt{align} environment:
1836 \begin{align*}
1837 s_{\mathrm{out}}(x) & = s_{\mathrm{in}}(x') * s_\delta (x-x') \\
1838 & = \int s_{\mathrm{in}}(x')s_\delta (x-x')\mathrm{d}x'
1839 \end{align*}
1840 Cases (“manually”, with \texttt{matrix} environment):
1842 \begin{equation*}
1843 \mathrm{sgn}(x) = \left\{\begin{matrix}
1844 -1 & x<0\\
1845 1 & x>0
1846 \end{matrix}\right.
1847 \end{equation*}
1848 Cases with the \href{ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf}{AMSmath}\DUfootnotemark{id37}{id35}{7} \texttt{cases} environment (not (yet) supported by
1849 HTML writers with \texttt{--math-output=MathML}):
1851 \begin{equation*}
1852 \mathrm{sgn}(x) = \begin{cases}
1853 -1 & x<0\\
1854 1 & x>0
1855 \end{cases}
1856 \end{equation*}
1858 \section{3   Tests for the LaTeX writer%
1859 \label{tests-for-the-latex-writer}%
1862 Test syntax elements which may cause trouble for the LaTeX writer but might
1863 not need to be tested with other writers (e.g. the HTML writer).
1866 \subsection{3.1   Custom Roles in LaTeX%
1867 \label{custom-roles-in-latex}%
1870 \begin{itemize}
1871 \item Role names and class arguments are converted to conform to the
1872 regular expression \texttt{{[}a-z{]}{[}-a-z0-9{]}*} (letters are downcased,
1873 accents and similar decoration is stripped, non-conforming
1874 characters are replaced by a hyphen).
1876 Class arguments may contain numbers and hyphens, which need special
1877 treatment in LaTeX command names.
1879 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{Text with role “custom4”}}}}} (but without styling by \texttt{DUrole*}
1880 macros).
1882 \item With LaTeX, roles can be styled within the document using the \DUroletitlereference{raw}
1883 directive.
1885 \newcommand{\DUrolelarge}[1]{{\large #1}}
1886 \makeatletter
1887 \@namedef{DUrolesmall-caps}{\textsc}
1888 \@namedef{DUrolecustom4}{\textbf}
1889 \makeatother
1891 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{inline text}}}}} in large, bold, small-caps.
1893 \item Custom roles can be based on standard roles:
1895 This is a \emph{\DUrole{custom-emphasis}{customized emphasis text role}}
1897 This is a \texttt{\DUrole{custom-literal}{customized literal text role}}
1899 This is a \textbf{\DUrole{custom-strong}{customized strong text role}}
1901 This is a \textsubscript{\DUrole{custom-subscript}{customized subscript text role}}
1903 This is a \textsuperscript{\DUrole{custom-superscript}{customized superscript text role}}
1905 This is a \DUroletitlereference{\DUrole{custom-title-reference}{customized title-reference text role}}
1906 \end{itemize}
1909 \subsection{3.2   class handling%
1910 \label{class-handling}%
1913 This section tests class handling for block level elements by the LaTeX
1914 writer. See the input file \texttt{classes\_latex.txt} for the raw LaTeX code used
1915 to style the examples.
1917 An “epigraph” directive is exported as “quote” wrapped in a “DUclass”
1918 environment. Here, it is styled by a “DUCLASSepigraph” environment
1919 redefining the “quote” environment as “minipage”:
1921 \newcommand*{\DUCLASSepigraph}{%
1922 \renewenvironment{quote}{\vspace{1em}
1923 \footnotesize\hfill{}%
1924 \begin{minipage}{0.4\columnwidth}}%
1925 {\end{minipage}\vskip\baselineskip}}
1927 \begin{DUclass}{epigraph}
1928 \begin{quote}
1929 Do not play this piece fast. It is never right to play \emph{Ragtime} fast.
1930 \nopagebreak
1932 \raggedleft —Scott Joplin
1933 \end{quote}
1934 \end{DUclass}
1936 Raw latex is also used to style the following lists: “DUCLASSenumerateitems”
1937 redefines “itemize” as “enumerate”, “DUCLASSrules” draws horizontal lines
1938 above and below.
1940 \newcommand*{\DUCLASSenumerateitems}{%
1941 \renewenvironment{itemize}{\begin{enumerate}}%
1942 {\end{enumerate}}%
1945 \newenvironment{DUCLASSrules}%
1946 {\noindent\rule[0.5ex]{1\columnwidth}{1pt}}%
1947 {\noindent\rule[0.5ex]{1\columnwidth}{1pt}}
1949 An “enumerated” bullet list:
1951 \begin{DUclass}{enumerateitems}
1952 \begin{itemize}
1953 \item item
1955 \item next item
1957 \item third item
1958 \end{itemize}
1959 \end{DUclass}
1961 A list with lines above and below:
1963 \begin{DUclass}{rules}
1964 \begin{itemize}
1965 \item item
1967 \item next item
1968 \end{itemize}
1969 \end{DUclass}
1971 A normal bullet list is kept unchanged by the above redefinitions:
1973 \begin{itemize}
1974 \item item
1976 \item next item
1978 \item third item
1979 \end{itemize}
1981 A container wraps several elements in a common “class wrapper”. Here, we use
1982 it to set 2 paragraphs and a list in small caps:
1984 \newcommand*{\DUCLASSscshape}{\scshape}
1986 \begin{DUclass}{scshape}
1988 paragraph 1
1990 paragraph 2
1992 \begin{itemize}
1993 \item bullet list
1995 \item still bullet list
1996 \end{itemize}
1997 \end{DUclass}
1999 A right-aligned line-block. Alignment handling is built into the latex
2000 writer for image, table, and line block elements.
2002 \begin{DUlineblock}{0em}
2003 \raggedleft
2004 \item[] Max Mustermann
2005 \item[] Waldstr. 22
2006 \item[] D 01234 Testdorf
2007 \item[] Tel.: 0123/456789
2008 \end{DUlineblock}
2011 \subsection{3.3   More Tables%
2012 \label{more-tables}%
2015 A table with multi-paragraph multicolumn cells:
2017 \setlength{\DUtablewidth}{\linewidth}
2018 \begin{longtable*}[c]{|p{0.133\DUtablewidth}|p{0.179\DUtablewidth}|p{0.179\DUtablewidth}|p{0.110\DUtablewidth}|p{0.121\DUtablewidth}|p{0.145\DUtablewidth}|}
2019 \hline
2021 test
2023 \textbf{bold hd}
2024 & \multicolumn{3}{p{0.41\DUtablewidth}|}{%
2025 multicolumn 1
2027 With a second paragraph
2028 } &
2029 \emph{emph hd}
2031 \hline
2032 \multicolumn{2}{|p{0.31\DUtablewidth}|}{%
2033 multicolumn 2
2035 With a second paragraph
2036 } &
2037 cell
2039 cell
2041 cell
2043 cell
2045 \hline
2047 cell
2048 & \multicolumn{2}{p{0.36\DUtablewidth}|}{%
2049 multicolumn 3 (one line,
2050 but very very very very
2051 very looooong)
2052 } &
2053 cell
2055 cell
2057 cell
2059 \hline
2061 cell
2063 cell
2065 cell
2066 & \multicolumn{3}{p{0.38\DUtablewidth}|}{%
2067 Short multicolumn 4
2068 } \\
2069 \hline
2070 \end{longtable*}
2072 Tables with multi-paragraph multirow cells currently fail due to a LaTeX
2073 limitation (see \url{https://sourceforge.net/p/docutils/bugs/225/}).
2075 A table with multirow header and column-widths set by LaTeX:
2077 \begin{longtable*}[c]{|l|l|}
2078 \hline
2079 \multirow{2}{*}{\textbf{XXX}} & \textbf{Variable Summary} \\
2080 \cline{2-2}
2081 & \textbf{Description} \\
2082 \hline
2083 \endfirsthead
2084 \hline
2085 \multirow{2}{*}{\textbf{XXX}} & \textbf{Variable Summary} \\
2086 \cline{2-2}
2087 & \textbf{Description} \\
2088 \hline
2089 \endhead
2090 \multicolumn{2}{c}{\hfill ... continued on next page} \\
2091 \endfoot
2092 \endlastfoot
2093 \multicolumn{2}{|l|}{multicollumn cell} \\
2094 \hline
2095 \end{longtable*}
2097 In a table with column-widths set by LaTeX, each cell has just one line.
2098 Paragraphs are merged (a warning is given).
2100 \begin{longtable*}[c]{|l|l|}
2101 \hline
2102 11 & first paragraph
2103 second paragraph
2104 third paragraph \\
2105 \hline
2106 21 & 22 \\
2107 \hline
2108 \end{longtable*}
2110 % This file is used by the standalone_rst_latex test.
2113 \subsection{3.4   Option lists%
2114 \label{id23}%
2117 The LaTeX-2e description environment is used for definition lists.
2118 The definition is continued on the same line as the term, this should
2119 not happen if a option-list is at the top of the definition.
2121 If the option list is not at the first element in the definition, it
2122 is contained in a quote
2124 \begin{quote}
2125 \begin{DUoptionlist}
2126 \item[--help] show help
2128 \item[-v] verbose
2129 \end{DUoptionlist}
2130 \end{quote}
2132 \begin{description}
2133 \item[{In a definition list:}] \leavevmode
2134 \begin{DUoptionlist}
2135 \item[--help] show help
2137 \item[-v] verbose
2138 \end{DUoptionlist}
2140 \end{description}
2143 \subsection{3.5   Monospaced non-alphanumeric characters%
2144 \label{monospaced-non-alphanumeric-characters}%
2147 These are all ASCII characters except a-zA-Z0-9 and space:
2149 \texttt{!!!\textquotedbl{}\textquotedbl{}\textquotedbl{}\#\#\#\$\$\$\%\%\%\&\&\&'''((()))***+++,,,---...///:::}
2151 \texttt{;;;<<<===>>>???@@@{[}{[}{[}\textbackslash{}\textbackslash{}\textbackslash{}{]}{]}{]}\textasciicircum{}\textasciicircum{}\textasciicircum{}\_\_\_```\{\{\{|||\}\}\}\textasciitilde{}\textasciitilde{}\textasciitilde{}}
2153 \texttt{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
2155 The two lines of non-alphanumeric characters should both have the same
2156 width as the third line.
2159 \subsection{3.6   Non-ASCII characters%
2160 \label{non-ascii-characters}%
2163 Punctuation and footnote symbols
2165 \setlength{\DUtablewidth}{\linewidth}
2166 \begin{longtable*}[c]{|p{0.028\DUtablewidth}|p{0.424\DUtablewidth}|}
2167 \hline
2171 en-dash
2173 \hline
2177 em-dash
2179 \hline
2183 single turned comma quotation mark
2185 \hline
2189 single comma quotation mark
2191 \hline
2195 low single comma quotation mark
2197 \hline
2201 double turned comma quotation mark
2203 \hline
2207 double comma quotation mark
2209 \hline
2213 low double comma quotation mark
2215 \hline
2219 dagger
2221 \hline
2225 double dagger
2227 \hline
2231 black diamond suit
2233 \hline
2237 black heart suit
2239 \hline
2243 black spade suit
2245 \hline
2249 black club suit
2251 \hline
2255 ellipsis
2257 \hline
2261 trade mark sign
2263 \hline
2267 left-right double arrow
2269 \hline
2270 \end{longtable*}
2272 The \DUroletitlereference{Latin-1 extended} Unicode block
2274 \setlength{\DUtablewidth}{\linewidth}
2275 \begin{longtable*}[c]{|p{0.051\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|p{0.028\DUtablewidth}|}
2276 \hline
2300 \hline
2303 & &
2309 & &
2320 \hline
2344 \hline
2368 \hline
2392 \hline
2416 \hline
2440 \hline
2464 \hline
2488 \hline
2512 \hline
2527 & & & & \\
2528 \hline
2529 \end{longtable*}
2531 \begin{itemize}
2532 \item The following line should not be wrapped, because it uses
2533 no-break spaces (\textbackslash{}u00a0):
2535 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
2537 \item Line wrapping with/without breakpoints marked by soft hyphens
2538 (\textbackslash{}u00ad):
2540 pdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-sch
2542 pdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrisch
2543 \end{itemize}
2546 \subsection{3.7   Encoding special chars%
2547 \label{encoding-special-chars}%
2550 The LaTeX Info pages lists under “2.18 Special Characters”
2552 \begin{quote}
2553 The following characters play a special role in LaTeX and are called
2554 “special printing characters”, or simply “special characters”.
2556 \begin{quote}
2557 \# \$ \% \& \textasciitilde{} \_ \textasciicircum{} \textbackslash{} \{ \}
2558 \end{quote}
2559 \end{quote}
2561 The special chars verbatim:
2563 \begin{quote}
2564 \begin{alltt}
2565 # $ % & ~ _ ^ \textbackslash{} \{ \}
2566 \end{alltt}
2567 \end{quote}
2569 However also \emph{square brackets} {[}{]} need special care.
2571 \begin{quote}
2572 Commands with optional arguments (e.g. \texttt{\textbackslash{}item}) check
2573 if the token right after the macro name is an opening bracket.
2574 In that case the contents between that bracket and the following
2575 closing bracket on the same grouping level are taken as the
2576 optional argument. What makes this unintuitive is the fact that
2577 the square brackets aren’t grouping characters themselves, so in
2578 your last example item{[}{[}{]}{]} the optional argument consists of
2579 {[}… (without the closing bracket).
2580 \end{quote}
2582 Compare the items in the following lists:
2584 \begin{itemize}
2585 \item simple item
2587 \item {[}bracketed{]} item
2588 \end{itemize}
2590 \begin{description}
2591 \item[{simple}] \leavevmode
2592 description term
2594 \item[{{[}bracketed{]}}] \leavevmode
2595 description term
2597 \end{description}
2599 The OT1 font-encoding has different characters for the less-than,
2600 greater-than and bar, < | >, except for typewriter font \DUroletitlereference{cmtt}:
2602 \begin{quote}
2603 \begin{alltt}
2604 < | >
2605 \end{alltt}
2606 \end{quote}
2609 \subsection{3.8   Hyperlinks and -targets%
2610 \label{hyperlinks-and-targets}%
2613 In LaTeX, we must set an explicit anchor (\texttt{\textbackslash{}phantomsection}) for a
2615 \phantomsection\label{hypertarget-in-plain-text}hypertarget in plain text or in a figure but not in a longtable or
2616 caption:
2618 \setlength{\DUtablewidth}{\linewidth}
2619 \begin{longtable}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
2620 \caption{Table with %
2621 \label{hypertarget-in-table-title}hypertarget in table title.}\\
2622 \hline
2624 False
2626 True
2628 None
2630 \hline
2631 \end{longtable}
2632 \label{table-label}
2634 \begin{figure}
2635 \phantomsection\label{figure-label}
2636 \noindent\makebox[\linewidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
2637 \caption{Figure with %
2638 \label{hypertarget-in-figure-caption}hypertarget in figure caption.}
2639 \begin{DUlegend}
2640 Legend with %
2641 \phantomsection\label{hypertarget-in-figure-legend}hypertarget in figure legend.
2642 \end{DUlegend}
2643 \end{figure}
2645 \includegraphics{../../../docs/user/rst/images/biohazard.png}
2646 \phantomsection\label{image-label}
2648 See \hyperref[hypertarget-in-plain-text]{hypertarget in plain text},
2649 \hyperref[table-label]{table label}, \hyperref[hypertarget-in-table-title]{hypertarget in table title},
2650 \hyperref[figure-label]{figure label}, \hyperref[hypertarget-in-figure-caption]{hypertarget in figure caption},
2651 \hyperref[hypertarget-in-figure-legend]{hypertarget in figure legend}, and
2652 \hyperref[image-label]{image label}.
2655 \subsection{3.9   External references%
2656 \label{external-references}%
2659 Long URLs should be wrapped in the PDF.
2660 This can be achieved with the url command which is used by the LaTeX writer
2661 whenever the content (name) of a reference node equals the link URL.
2663 \begin{description}
2664 \item[{Example:}] \leavevmode
2665 a long URL that should wrap in the output
2666 \url{http://docutils.sourceforge.net/docs/user/latex.html\#id79}
2668 \end{description}
2670 If the argument contains any “\%”, “\#”, or “\textasciicircum{}\textasciicircum{}”, or ends with \texttt{\textbackslash{}}, it can’t
2671 be used in the argument to another command. The argument must not contain
2672 unbalanced braces.
2674 The characters \textasciicircum{}, \{, \}, and \texttt{\textbackslash{}} are invalid in a “http:” or “ftp:” URL
2675 and not recognized as part of it:
2677 \begin{DUlineblock}{0em}
2678 \item[] \url{http://www.example.org}/strange\textasciicircum{}\textasciicircum{}name
2679 \item[] \url{http://www.example.org}\textbackslash{}using\textbackslash{}DOS\textbackslash{}paths\textbackslash{}
2680 \item[] \url{http://www.example.org/XML}/strange\{n\}ame
2681 \end{DUlineblock}
2683 They can, however be used in paths and/or filenames.
2685 Handling by the LaTeX writer:
2687 \begin{itemize}
2688 \item \texttt{\#}, \texttt{\textbackslash{}} and \texttt{\%} are escaped:
2690 \begin{DUlineblock}{0em}
2691 \item[] \href{http://www.w3.org/XML/Schema\#dev}{URL with \#}
2692 \url{http://www.w3.org/XML/Schema\#dev}
2693 \item[] \href{http://www.w3.org/XML/Schema\%dev}{URL with \%}
2694 \url{http://example.org/Schema\%dev}
2695 \item[] \href{A:DOS\\path\\}{file with DOS path}\DUfootnotemark{id44}{id43}{10} \url{A:DOS\\path\\}\DUfootnotemark{id45}{id43}{10}
2696 \end{DUlineblock}
2698 \DUadmonition[note]{
2699 \DUtitle[note]{Note}
2701 These URLs are typeset inside a LaTeX command without error.
2703 \begin{DUlineblock}{0em}
2704 \item[] \url{http://www.w3.org/XML/Schema\#dev}
2705 \item[] \url{http://example.org/Schema\%dev}
2706 \item[] \url{A:DOS\\path\\}\DUfootnotemark{id46}{id43}{10}
2707 \end{DUlineblock}
2709 \end{itemize}
2711 \begin{itemize}
2712 \item \textasciicircum{}\textasciicircum{} LaTeX’s special syntax for characters results in “strange” replacements
2713 (both with href and url). A warning is given.
2715 \href{../strange^^name}{file with \textasciicircum{}\textasciicircum{}}:
2716 \url{../strange^^name}
2718 \item Unbalanced braces, \{ or \}, will fail (both with href and url):
2720 \begin{quote}
2721 \begin{alltt}
2722 `file with \{ <../strange\{name>`__
2723 `<../strange\{name>`__
2724 \end{alltt}
2725 \end{quote}
2727 while balanced braces are suported:
2729 \begin{DUlineblock}{0em}
2730 \item[] \url{../strange{n}ame}
2731 \item[] \url{../st{r}ange{n}ame}
2732 \item[] \url{../{st{r}ange{n}ame}}
2733 \end{DUlineblock}
2734 \end{itemize}
2737 \subsection{3.10   Section titles with \hyperref[inline-markup]{inline markup}%
2738 \label{section-titles-with-inline-markup}%
2742 \subsubsection{3.10.1   \emph{emphasized}, H\textsubscript{2}O and $x^2$%
2743 \label{emphasized-h2o-and-x-2}%
2747 \subsubsection{3.10.2   Substitutions work%
2748 \label{substitutions-fail}%
2752 \subsection{3.11   Deeply nested sections%
2753 \label{deeply-nested-sections}%
2756 In LaTeX and HTML,
2759 \subsubsection{3.11.1   Level 3%
2760 \label{level-3}%
2763 nested sections
2766 \paragraph{3.11.1.1   level 4%
2767 \label{level-4}%
2770 reach at some level
2773 \subparagraph{3.11.1.1.1   level 5%
2774 \label{level-5}%
2777 (depending on the document class)
2780 \DUtitle[sectionVI]{3.11.1.1.1.1   level 6%
2781 \label{level-6}%
2784 an unsupported level.
2787 \section{4   Tests for the XeTeX writer%
2788 \label{tests-for-the-xetex-writer}%
2791 With XeTeX, you can typeset text in any language/script supported by
2792 Unicode and the selected font, e.g. Azərbaycanca, Bân-lâm-gú, Башҡорт
2793 Беларуская, Български, Català, Чӑвашла, Česky, Ελληνικά, Español,
2794 Français, Føroyskt, Хальмг, Íslenska, עברית , Қазақша, Kurdî,
2795 Latviešu, Lietuvių, Македонски, Монгол, Nāhuatl, Português, Română,
2796 Русский, Slovenščina, Српски, Türkçe, Українська, Tiếng Việt, Volapük,
2797 Võro, ייִדיש , Žemaitėška.
2798 Currently, there is extended support for 28 languages in the
2799 \href{http://ctan.org/pkg/polyglossia}{polyglossia}\DUfootnotemark{id39}{id38}{8} package.
2801 % System Messages:
2804 \section{5   Error Handling%
2805 \label{error-handling}%
2808 Any errors caught during processing will generate system messages.
2810 There should be five messages in the following, auto-generated
2811 section, “Docutils System Messages”:
2813 % section should be added by Docutils automatically
2816 \section[Docutils System Messages]{\color{red}Docutils System Messages%
2819 \DUadmonition[system-message]{
2820 \DUtitle[system-message]{system-message}
2821 \raisebox{1em}{\hypertarget{id27}{}}
2823 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~104
2825 \hyperlink{id28}{
2826 Undefined substitution referenced: \textquotedbl{}problematic\textquotedbl{}.
2829 \DUadmonition[system-message]{
2830 \DUtitle[system-message]{system-message}
2831 \raisebox{1em}{\hypertarget{id47}{}}
2833 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~391
2835 \hyperlink{id48}{
2836 Unknown target name: \textquotedbl{}5\textquotedbl{}.
2839 \DUadmonition[system-message]{
2840 \DUtitle[system-message]{system-message}
2841 \raisebox{1em}{\hypertarget{id49}{}}
2843 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~400
2845 \hyperlink{id50}{
2846 Unknown target name: \textquotedbl{}nonexistent\textquotedbl{}.
2849 \DUadmonition[system-message]{
2850 \DUtitle[system-message]{system-message}
2851 \raisebox{1em}{\hypertarget{id51}{}}
2853 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~427
2855 \hyperlink{id52}{
2856 Unknown target name: \textquotedbl{}hyperlink reference without a target\textquotedbl{}.
2859 \DUadmonition[system-message]{
2860 \DUtitle[system-message]{system-message}
2861 \raisebox{1em}{\hypertarget{id53}{}}
2863 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~440
2865 \hyperlink{id54}{
2866 Duplicate target name, cannot be used as a unique reference: \textquotedbl{}duplicate target names\textquotedbl{}.
2869 \end{document}