Fix :width: option for the table directives.
[docutils.git] / docutils / test / functional / expected / standalone_rst_xetex.tex
blob3f8e9f1b69c447c06df9be42a3aff029f2a5eed4
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{alltt}
13 \usepackage{amsmath}
14 \usepackage{polyglossia}
15 \setdefaultlanguage{english}
16 \setotherlanguages{english,french,german}
17 \usepackage{color}
18 \usepackage{float} % float configuration
19 \floatplacement{figure}{H} % place figures here definitely
20 \usepackage{graphicx}
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
189 % hyperlinks:
190 \ifthenelse{\isundefined{\hypersetup}}{
191 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
192 \usepackage{bookmark}
193 \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
195 \hypersetup{
196 pdftitle={reStructuredText Test Document},
197 pdfauthor={David Goodger;Me;Myself;I}
200 \title{reStructuredText Test Document%
201 \label{restructuredtext-test-document}%
202 \label{doctitle}%
203 \\ % subtitle%
204 \DUdocumentsubtitle{Examples of Syntax Constructs}%
205 \label{examples-of-syntax-constructs}%
206 \label{subtitle}}
207 \author{}
208 \date{}
210 %%% Body
211 \begin{document}
212 \maketitle
214 % Docinfo
215 \begin{center}
216 \begin{tabularx}{\DUdocinfowidth}{lX}
217 \textbf{Author}: &
218 David Goodger \\
219 \textbf{Address}: &
220 {\raggedright
221 123 Example Street\\
222 Example, EX Canada\\
223 A1B 2C3 } \\
224 \textbf{Contact}: &
225 \href{mailto:goodger@python.org}{goodger@python.org} \\
226 \textbf{Author}: &
227 Me \\
228 \textbf{Author}: &
229 Myself \\
230 \textbf{Author}: &
231 I \\
232 \textbf{Organization}: &
233 humankind \\
234 \textbf{Date}: &
235 Now, or yesterday. Or maybe even \emph{before} yesterday. \\
236 \textbf{Status}: &
237 This is a “work in progress” \\
238 \textbf{Revision}: &
239 is managed by a version control system. \\
240 \textbf{Version}: &
241 1 \\
242 \textbf{Copyright}: &
243 This document has been placed in the public domain. You
244 may do with it as you wish. You may copy, modify,
245 redistribute, reattribute, sell, buy, rent, lease,
246 destroy, or improve it, quote it at length, excerpt,
247 incorporate, collate, fold, staple, or mutilate it, or do
248 anything else to it that your or anyone else’s heart
249 desires. \\
250 \textbf{field name}: &
251 This is a “generic bibliographic field”.
253 \textbf{field name “2}: &
254 Generic bibliographic fields may contain multiple body elements.
256 Like this.
258 \end{tabularx}
259 \end{center}
261 \begin{DUclass}{dedication}
262 \begin{quote}
263 \DUtitle[dedication]{Dedication}
265 For Docutils users \& co-developers.
266 \end{quote}
267 \end{DUclass}
269 \begin{DUclass}{abstract}
270 \begin{quote}
271 \DUtitle[abstract]{Abstract}
273 This is a test document, containing at least one example of each
274 reStructuredText construct.
275 \end{quote}
276 \end{DUclass}
278 % This is a comment. Note how any initial comments are moved by
279 % transforms to after the document title, subtitle, and docinfo.
281 % Above is the document title, and below is the subtitle.
282 % They are transformed from section titles after parsing.
284 % bibliographic fields (which also require a transform):
286 \pagebreak[4] % start ToC on new page
288 \phantomsection\label{table-of-contents}
289 \pdfbookmark[1]{Table of Contents}{table-of-contents}
290 \renewcommand{\contentsname}{Table of Contents}
291 \tableofcontents
294 \section{1   Structural Elements%
295 \label{structural-elements}%
299 \subsection{1.1   Section Title%
300 \label{section-title}%
302 \subsubsection*{Section Subtitle}
304 Lone subsections are converted to a section subtitle by a transform
305 activated with the \texttt{--section-subtitles} command line option or the
306 \texttt{sectsubtitle-xform} configuration value.
309 \subsection{1.2   Empty Section%
310 \label{empty-section}%
314 \subsection{1.3   Transitions%
315 \label{transitions}%
318 Here’s a transition:
320 %___________________________________________________________________________
321 \DUtransition
323 It divides the section. Transitions may also occur between sections:
325 %___________________________________________________________________________
326 \DUtransition
329 \section{2   Body Elements%
330 \label{body-elements}%
334 \subsection{2.1   Paragraphs%
335 \label{paragraphs}%
338 A paragraph.
341 \subsubsection{2.1.1   Inline Markup%
342 \label{inline-markup}%
345 Paragraphs contain text and may contain inline markup: \emph{emphasis},
346 \textbf{strong emphasis}, \texttt{inline literals}, standalone hyperlinks
347 (\url{http://www.python.org}), external hyperlinks (\href{http://www.python.org/}{Python}\DUfootnotemark{id30}{id29}{5}), internal
348 cross-references (\hyperref[example]{example}), external hyperlinks with embedded URIs
349 (\href{http://www.python.org}{Python web site}), \href{http://www.python.org/}{anonymous hyperlink
350 references}\DUfootnotemark{id40}{id29}{5} (\href{http://docutils.sourceforge.net/}{a second reference}\DUfootnotemark{id42}{id41}{9}), footnote references (manually
351 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]}),
352 substitution references (\includegraphics{../../../docs/user/rst/images/biohazard.png}), and %
353 \phantomsection\label{inline-hyperlink-targets}inline hyperlink targets
354 (see \hyperref[targets]{Targets} below for a reference back to here). Character-level
355 inline markup is also possible (although exceedingly ugly!) in \emph{re}\texttt{Structured}\emph{Text}. Problems are indicated by %
356 \raisebox{1em}{\hypertarget{id28}{}}\hyperlink{id27}{\textbf{\color{red}|problematic|}} text
357 (generated by processing errors; this one is intentional). Here is a
358 reference to the \hyperref[doctitle]{doctitle} and the \hyperref[subtitle]{subtitle}.
360 The default role for interpreted text is \DUroletitlereference{Title Reference}. Here are
361 some explicit interpreted text roles: a PEP reference (\href{http://www.python.org/dev/peps/pep-0287}{PEP 287}); an
362 RFC reference (\href{http://tools.ietf.org/html/rfc2822.html}{RFC 2822}); an abbreviation (\DUrole{abbreviation}{abb.}), an acronym
363 (\DUrole{acronym}{reST}), code (\texttt{\DUrole{code}{print \textquotedbl{}hello world\textquotedbl{}}}); a \textsubscript{subscript};
364 a \textsuperscript{superscript} and explicit roles for \DUroletitlereference{Docutils}
365 \emph{standard} \textbf{inline} \texttt{markup}.
367 % DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!
369 Let’s test wrapping and whitespace significance in inline literals:
370 \texttt{This is an example of --inline-literal --text, --including some--
371 strangely--hyphenated-words. ~Adjust-the-width-of-your-browser-window
372 to see how the text is wrapped. ~-- ---- -------- ~Now note ~ ~the
373 spacing ~ ~between the ~ ~words of ~ ~this sentence ~ ~(words
374 should ~ ~be grouped ~ ~in pairs).}
376 If the \texttt{--pep-references} option was supplied, there should be a
377 live link to PEP 258 here.
380 \subsection{2.2   Bullet Lists%
381 \label{bullet-lists}%
384 \begin{itemize}
385 \item A bullet list
387 \begin{itemize}
388 \item Nested bullet list.
390 \item Nested item 2.
391 \end{itemize}
393 \item Item 2.
395 Paragraph 2 of item 2.
397 \begin{itemize}
398 \item Nested bullet list.
400 \item Nested item 2.
402 \begin{itemize}
403 \item Third level.
405 \item Item 2.
406 \end{itemize}
408 \item Nested item 3.
410 \item This nested list should be compacted by the HTML writer.
412 \phantomsection\label{target}
413 % Even if this item contains a target and a comment.
414 \end{itemize}
415 \end{itemize}
418 \subsection{2.3   Enumerated Lists%
419 \label{enumerated-lists}%
422 \begin{enumerate}
423 \item Arabic numerals.
425 \begin{enumerate}
426 \renewcommand{\labelenumii}{\alph{enumii})}
427 \item lower alpha)
429 \begin{enumerate}
430 \renewcommand{\labelenumiii}{(\roman{enumiii})}
431 \item (lower roman)
433 \begin{enumerate}
434 \item upper alpha.
436 \begin{list}{\Roman{enumv})}{\usecounter{enumv}}
437 \item upper roman)
438 \end{list}
439 \end{enumerate}
440 \end{enumerate}
441 \end{enumerate}
443 \item Lists that don’t start at 1:
445 \begin{enumerate}
446 \renewcommand{\labelenumii}{\arabic{enumii}.}
447 \setcounter{enumii}{2}
448 \item Three
450 \item Four
451 \end{enumerate}
453 \begin{enumerate}
454 \renewcommand{\labelenumii}{\Alph{enumii}.}
455 \setcounter{enumii}{2}
456 \item C
458 \item D
459 \end{enumerate}
461 \begin{enumerate}
462 \renewcommand{\labelenumii}{\roman{enumii}.}
463 \setcounter{enumii}{2}
464 \item iii
466 \item iv
467 \end{enumerate}
468 \end{enumerate}
471 \subsection{2.4   Definition Lists%
472 \label{definition-lists}%
475 \begin{description}
476 \item[{Term}] \leavevmode
477 Definition
479 \item[{Term}] \leavevmode (\textbf{classifier})
480 Definition paragraph 1.
482 Definition paragraph 2.
484 \item[{Term}] \leavevmode
485 Definition
487 \item[{Term}] \leavevmode (\textbf{classifier one})(\textbf{classifier two})
488 Definition
490 \end{description}
493 \subsection{2.5   Field Lists%
494 \label{field-lists}%
497 \begin{DUfieldlist}
498 \item[{what:}]
499 Field lists map field names to field bodies, like database
500 records. They are often part of an extension syntax. They are
501 an unambiguous variant of RFC 2822 fields.
503 \item[{how arg1 arg2:}]
504 The field marker is a colon, the field name, and a colon.
506 The field body may contain one or more body elements, indented
507 relative to the field marker.
509 \item[{credits:}]
510 \DUrole{credits}{This paragraph has the \DUroletitlereference{credits} class set. (This is actually not
511 about credits but just for ensuring that the class attribute
512 doesn’t get stripped away.)}
513 \end{DUfieldlist}
516 \subsection{2.6   Option Lists%
517 \label{option-lists}%
520 For listing command-line options:
522 \begin{DUoptionlist}
523 \item[-a] command-line option “a”
525 \item[-b file] options can have arguments
526 and long descriptions
528 \item[--long] options can be long also
530 \item[--input=file] long options can also have
531 arguments
533 \item[--very-long-option] The description can also start on the next line.
535 The description may contain multiple body elements,
536 regardless of where it starts.
538 \item[-x, -y, -z] Multiple options are an “option group”.
540 \item[-v, --verbose] Commonly-seen: short \& long options.
542 \item[-1 file, --one=file, --two file] Multiple options with arguments.
544 \item[/V] DOS/VMS-style options too
545 \end{DUoptionlist}
547 There must be at least two spaces between the option and the
548 description.
551 \subsection{2.7   Literal Blocks%
552 \label{literal-blocks}%
555 Literal blocks are indicated with a double-colon (“::”) at the end of
556 the preceding paragraph (over there \texttt{-->}). They can be indented:
558 \begin{quote}
559 \begin{alltt}
560 if literal_block:
561 text = 'is left as-is'
562 spaces_and_linebreaks = 'are preserved'
563 markup_processing = None
564 \end{alltt}
565 \end{quote}
567 Or they can be quoted without indentation:
569 \begin{quote}
570 \begin{alltt}
571 >> Great idea!
573 > Why didn't I think of that?
574 \end{alltt}
575 \end{quote}
578 \subsection{2.8   Line Blocks%
579 \label{line-blocks}%
582 This section tests line blocks. Line blocks are body elements which
583 consist of lines and other line blocks. Nested line blocks cause
584 indentation.
586 \begin{DUlineblock}{0em}
587 \item[] This is a line block. It ends with a blank line.
588 \item[]
589 \begin{DUlineblock}{\DUlineblockindent}
590 \item[] New lines begin with a vertical bar (“|”).
591 \item[] Line breaks and initial indent are significant, and preserved.
592 \item[]
593 \begin{DUlineblock}{\DUlineblockindent}
594 \item[] Continuation lines are also possible. A long line that is intended
595 to wrap should begin with a space in place of the vertical bar.
596 \end{DUlineblock}
597 \item[] The left edge of a continuation line need not be aligned with
598 the left edge of the text above it.
599 \end{DUlineblock}
600 \end{DUlineblock}
602 \begin{DUlineblock}{0em}
603 \item[] This is a second line block.
604 \item[]
605 \item[] Blank lines are permitted internally, but they must begin with a “|”.
606 \end{DUlineblock}
608 Another line block, surrounded by paragraphs:
610 \begin{DUlineblock}{0em}
611 \item[] And it’s no good waiting by the window
612 \item[] It’s no good waiting for the sun
613 \item[] Please believe me, the things you dream of
614 \item[] They don’t fall in the lap of no-one
615 \end{DUlineblock}
617 Take it away, Eric the Orchestra Leader!
619 \begin{quote}
620 \begin{DUlineblock}{0em}
621 \item[] A one, two, a one two three four
622 \item[]
623 \item[] Half a bee, philosophically,
624 \item[]
625 \begin{DUlineblock}{\DUlineblockindent}
626 \item[] must, \emph{ipso facto}, half not be.
627 \end{DUlineblock}
628 \item[] But half the bee has got to be,
629 \item[]
630 \begin{DUlineblock}{\DUlineblockindent}
631 \item[] \emph{vis a vis} its entity. D’you see?
632 \item[]
633 \end{DUlineblock}
634 \item[] But can a bee be said to be
635 \item[]
636 \begin{DUlineblock}{\DUlineblockindent}
637 \item[] or not to be an entire bee,
638 \item[]
639 \begin{DUlineblock}{\DUlineblockindent}
640 \item[] when half the bee is not a bee,
641 \item[]
642 \begin{DUlineblock}{\DUlineblockindent}
643 \item[] due to some ancient injury?
644 \item[]
645 \end{DUlineblock}
646 \end{DUlineblock}
647 \end{DUlineblock}
648 \item[] Singing…
649 \end{DUlineblock}
650 \end{quote}
652 A line block, like the following poem by Christian Morgenstern, can
653 also be centre-aligned:
655 \begin{selectlanguage}{german}
656 \begin{DUlineblock}{0em}
657 \centering
658 \item[] \textbf{Die Trichter}
659 \item[]
660 \item[] Zwei Trichter wandeln durch die Nacht.
661 \item[] Durch ihres Rumpfs verengten Schacht
662 \item[] fließt weißes Mondlicht
663 \item[] still und heiter
664 \item[] auf   ihren
665 \item[] Waldweg
666 \item[] u. s.
667 \item[] w.
668 \item[]
669 \end{DUlineblock}
670 \end{selectlanguage}
673 \subsection{2.9   Block Quotes%
674 \label{block-quotes}%
677 Block quotes consist of indented body elements:
679 \begin{quote}
680 My theory by A. Elk. Brackets Miss, brackets. This theory goes
681 as follows and begins now. All brontosauruses are thin at one
682 end, much much thicker in the middle and then thin again at the
683 far end. That is my theory, it is mine, and belongs to me and I
684 own it, and what it is too.
685 \nopagebreak
687 \raggedleft —Anne Elk (Miss)
688 \end{quote}
690 The language of a quote (like any other object) can be specified by
691 a class attribute:
695 \begin{selectlanguage}{french}
696 \begin{quote}
697 ReStructuredText est un langage de balisage léger utilisé
698 notamment dans la documentation du langage Python.
699 \end{quote}
700 \end{selectlanguage}
703 \subsection{2.10   Doctest Blocks%
704 \label{doctest-blocks}%
707 \begin{quote}
708 \begin{alltt}
709 >>> print 'Python-specific usage examples; begun with ">>>"'
710 Python-specific usage examples; begun with ">>>"
711 >>> print '(cut and pasted from interactive Python sessions)'
712 (cut and pasted from interactive Python sessions)
713 \end{alltt}
714 \end{quote}
717 \subsection{2.11   Footnotes%
718 \label{footnotes}%
721 \DUfootnotetext{id8}{id1}{1}{%
722 A footnote contains body elements, consistently indented by at
723 least 3 spaces.
725 This is the footnote’s second paragraph.
728 \DUfootnotetext{label}{id3}{2}{\phantomsection\label{label}%
729 Footnotes may be numbered, either manually (as in\DUfootnotemark{id9}{id8}{1}) or
730 automatically using a “\#”-prefixed label. This footnote has a
731 label so it can be referred to from multiple places, both as a
732 footnote reference (\DUfootnotemark{id10}{label}{2}) and as a \hyperref[label]{hyperlink reference}.
735 \DUfootnotetext{id12}{id2}{3}{%
736 This footnote is numbered automatically and anonymously using a
737 label of “\#” only.
739 This is the second paragraph.
741 And this is the third paragraph.
744 \DUfootnotetext{id13}{id4}{*}{%
745 Footnotes may also use symbols, specified with a “*” label.
746 Here’s a reference to the next footnote:\DUfootnotemark{id14}{id15}{}.
749 \DUfootnotetext{id15}{id14}{}{%
750 This footnote shows the next symbol in the sequence.
753 \DUfootnotetext{id16}{id16}{4}{%
754 Here’s an unreferenced footnote, with a reference to a
755 nonexistent footnote:%
756 \raisebox{1em}{\hypertarget{id17}{}}\hyperlink{id47}{\textbf{\color{red}{[}5{]}\_}}.
760 \subsection{2.12   Citations%
761 \label{citations}%
763 \begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
764 Citations are text-labeled footnotes. They may be
765 rendered separately and differently from footnotes.
766 \end{figure}
768 Here’s a reference to the above, \hyperlink{cit2002}{[CIT2002]}, and a %
769 \raisebox{1em}{\hypertarget{id19}{}}\hyperlink{id48}{\textbf{\color{red}{[}nonexistent{]}\_}}
770 citation.
773 \subsection{2.13   Targets%
774 \label{targets}%
775 \label{another-target}%
778 \phantomsection\label{example}
779 This paragraph is pointed to by the explicit “example” target. A
780 reference can be found under \hyperref[inline-markup]{Inline Markup}, above. \hyperref[inline-hyperlink-targets]{Inline
781 hyperlink targets} are also possible.
783 Section headers are implicit targets, referred to by name. See
784 \hyperref[targets]{Targets}, which is a subsection of \hyperref[body-elements]{Body Elements}.
786 Explicit external targets are interpolated into references such as
787 \href{http://www.python.org/}{Python}\DUfootnotemark{id31}{id29}{5}”.
789 Targets may be indirect and anonymous. Thus \hyperref[targets]{this phrase} may also
790 refer to the \hyperref[targets]{Targets} section.
792 Here’s a %
793 \raisebox{1em}{\hypertarget{id50}{}}\hyperlink{id49}{\textbf{\color{red}`hyperlink reference without a target`\_}}, which generates an
794 error.
797 \subsubsection{2.13.1   Duplicate Target Names%
798 \label{duplicate-target-names}%
801 Duplicate names in section headers or other implicit targets will
802 generate “info” (level-1) system messages. Duplicate names in
803 explicit targets will generate “warning” (level-2) system messages.
806 \subsubsection{2.13.2   Duplicate Target Names%
807 \label{id21}%
810 Since there are two “Duplicate Target Names” section headers, we
811 cannot uniquely refer to either of them by name. If we try to (like
812 this: %
813 \raisebox{1em}{\hypertarget{id52}{}}\hyperlink{id51}{\textbf{\color{red}`Duplicate Target Names`\_}}), an error is generated.
816 \subsection{2.14   Directives%
817 \label{directives}%
820 \phantomsection\label{contents}
821 These are just a sample of the many reStructuredText Directives. For
822 others, please see
823 \url{http://docutils.sourceforge.net/docs/ref/rst/directives.html}.
826 \subsubsection{2.14.1   Document Parts%
827 \label{document-parts}%
830 An example of the “contents” directive can be seen above this section
831 (a local, untitled table of \hyperref[contents]{contents}) and at the beginning of the
832 document (a document-wide \hyperref[table-of-contents]{table of contents}).
835 \subsubsection{2.14.2   Images and Figures%
836 \label{images-and-figures}%
839 An image directive (also clickable – a hyperlink reference):
841 \hyperref[directives]{\includegraphics{../../../docs/user/rst/images/title.png}}
843 Image with multiple IDs:
845 \includegraphics{../../../docs/user/rst/images/title.png}
846 \phantomsection\label{image-target-3}\label{image-target-2}\label{image-target-1}
848 A centered image:
850 \noindent\makebox[\linewidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
852 A left-aligned image:
854 \noindent{\includegraphics{../../../docs/user/rst/images/biohazard.png}\hfill}
856 This paragraph might flow around the image.
857 The specific behavior depends upon the style sheet and
858 the browser or rendering software used.
860 A right-aligned image:
862 \noindent{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png}}
864 This paragraph might flow around the image.
865 The specific behavior depends upon the style sheet and
866 the browser or rendering software used.
868 For inline images see \hyperref[substitution-definitions]{Substitution Definitions}.
870 Image size:
872 An image 2 em wide:
874 \includegraphics[width=2em]{../../../docs/user/rst/images/biohazard.png}
876 An image 2 em wide and 15 pixel high:
878 \includegraphics[height=15\pdfpxdimen,width=2em]{../../../docs/user/rst/images/biohazard.png}
880 An image occupying 50\% of the line width:
882 \includegraphics[width=0.500\linewidth]{../../../docs/user/rst/images/title.png}
884 An image 2 cm high:
886 \includegraphics[height=2cm]{../../../docs/user/rst/images/biohazard.png}
888 A \emph{figure} is an image with a caption and/or a legend. With page-based output
889 media, figures might float to a different position if this helps the page
890 layout.
892 \begin{DUclass}{figclass1}
893 \begin{DUclass}{figclass2}
894 \begin{figure}
895 \noindent\makebox[\linewidth][c]{\includegraphics[width=258bp]{../../../docs/user/rst/images/title.png}}
896 \caption{Plaintext markup syntax and parser system.}
897 \begin{DUlegend}
898 \setlength{\DUtablewidth}{\linewidth}
899 \begin{longtable*}[c]{|p{0.156\DUtablewidth}|p{0.563\DUtablewidth}|}
900 \hline
904 Revised, revisited, based on ‘re’ module.
906 \hline
908 Structured
910 Structure-enhanced text, structuredtext.
912 \hline
914 Text
916 Well it is, isn’t it?
918 \hline
919 \end{longtable*}
921 This paragraph is also part of the legend.
922 \end{DUlegend}
923 \end{figure}
924 \end{DUclass}
925 \end{DUclass}
927 A left-aligned figure:
929 \begin{DUclass}{figclass1}
930 \begin{DUclass}{figclass2}
931 \begin{figure} % align = "left"
932 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
933 \caption{This is the caption.}
934 \begin{DUlegend}
935 This is the legend.
937 The legend may consist of several paragraphs.
938 \end{DUlegend}
939 \end{figure}
940 \end{DUclass}
941 \end{DUclass}
943 This paragraph might flow around the figure.
945 The specific behavior depends upon the style sheet and the browser or
946 rendering software used.
948 A centered figure:
950 \begin{figure}
951 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
952 \caption{This is the caption.}
953 \begin{DUlegend}
954 This is the legend.
956 The legend may consist of several paragraphs.
957 \end{DUlegend}
958 \end{figure}
960 This paragraph might flow around the figure.
962 The specific behavior depends upon the style sheet and the browser or
963 rendering software used.
965 A right-aligned figure:
967 \begin{figure} % align = "right"
968 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
969 \caption{This is the caption.}
970 \begin{DUlegend}
971 This is the legend.
973 The legend may consist of several paragraphs.
974 \end{DUlegend}
975 \end{figure}
977 This paragraph might flow around the figure. The specific behavior depends
978 upon the style sheet and the browser or rendering software used.
980 Tables may be given titles and additional arguments with the \emph{table}
981 directive:
983 \setlength{\DUtablewidth}{\linewidth}
984 \begin{longtable}[l]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
985 \caption{left-aligned table}\\
986 \hline
987 \textbf{%
989 } & \textbf{%
990 not A
991 } \\
992 \hline
993 \endfirsthead
994 \caption[]{left-aligned table (... continued)}\\
995 \hline
996 \textbf{%
998 } & \textbf{%
999 not A
1000 } \\
1001 \hline
1002 \endhead
1003 \multicolumn{2}{c}{\hfill ... continued on next page} \\
1004 \endfoot
1005 \endlastfoot
1007 False
1009 True
1011 \hline
1013 True
1015 False
1017 \hline
1018 \end{longtable}
1020 \setlength{\DUtablewidth}{\linewidth}
1021 \begin{longtable}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
1022 \caption{center-aligned table}\\
1023 \hline
1024 \textbf{%
1026 } & \textbf{%
1027 not A
1028 } \\
1029 \hline
1030 \endfirsthead
1031 \caption[]{center-aligned table (... continued)}\\
1032 \hline
1033 \textbf{%
1035 } & \textbf{%
1036 not A
1037 } \\
1038 \hline
1039 \endhead
1040 \multicolumn{2}{c}{\hfill ... continued on next page} \\
1041 \endfoot
1042 \endlastfoot
1044 False
1046 True
1048 \hline
1050 True
1052 False
1054 \hline
1055 \end{longtable}
1057 \setlength{\DUtablewidth}{\linewidth}
1058 \begin{longtable}[r]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
1059 \caption{right-aligned table}\\
1060 \hline
1061 \textbf{%
1063 } & \textbf{%
1064 not A
1065 } \\
1066 \hline
1067 \endfirsthead
1068 \caption[]{right-aligned table (... continued)}\\
1069 \hline
1070 \textbf{%
1072 } & \textbf{%
1073 not A
1074 } \\
1075 \hline
1076 \endhead
1077 \multicolumn{2}{c}{\hfill ... continued on next page} \\
1078 \endfoot
1079 \endlastfoot
1081 False
1083 True
1085 \hline
1087 True
1089 False
1091 \hline
1092 \end{longtable}
1094 With the “widths” argument “auto” (or “class” value “colwidths-auto”),
1095 column widths are determined by the backend (if supported by the
1096 writer/backend).
1098 \begin{longtable*}[c]{|l|l|l|}
1099 \hline
1100 \textbf{A} & \textbf{B} & \textbf{A or B} \\
1101 \hline
1102 \endfirsthead
1103 \hline
1104 \textbf{A} & \textbf{B} & \textbf{A or B} \\
1105 \hline
1106 \endhead
1107 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1108 \endfoot
1109 \endlastfoot
1110 False & False & False \\
1111 \hline
1112 True & False & True \\
1113 \hline
1114 False & True & True \\
1115 \hline
1116 True & True & True \\
1117 \hline
1118 \end{longtable*}
1119 \label{target2}\label{target1}
1122 \subsubsection{2.14.3   Admonitions%
1123 \label{admonitions}%
1126 \DUadmonition[attention]{
1127 \DUtitle[attention]{Attention!}
1129 Directives at large.
1132 \DUadmonition[caution]{
1133 \DUtitle[caution]{Caution!}
1135 Don’t take any wooden nickels.
1138 \DUadmonition[danger]{
1139 \DUtitle[danger]{!DANGER!}
1141 Mad scientist at work!
1144 \DUadmonition[error]{
1145 \DUtitle[error]{Error}
1147 Does not compute.
1150 \DUadmonition[hint]{
1151 \DUtitle[hint]{Hint}
1153 It’s bigger than a bread box.
1156 \DUadmonition[important]{
1157 \DUtitle[important]{Important}
1159 \begin{itemize}
1160 \item Wash behind your ears.
1162 \item Clean up your room.
1164 \item Call your mother.
1166 \item Back up your data.
1167 \end{itemize}
1170 \DUadmonition[note]{
1171 \DUtitle[note]{Note}
1173 This is a note.
1176 \DUadmonition[tip]{
1177 \DUtitle[tip]{Tip}
1179 15\% if the service is good.
1182 \DUadmonition[warning]{
1183 \DUtitle[warning]{Warning}
1185 Strong prose may provoke extreme mental exertion.
1186 Reader discretion is strongly advised.
1189 \DUadmonition[admonition-and-by-the-way]{
1190 \DUtitle[admonition-and-by-the-way]{And, by the way…}
1192 You can make up your own admonition too.
1196 \subsubsection{2.14.4   Topics, Sidebars, and Rubrics%
1197 \label{topics-sidebars-and-rubrics}%
1200 \emph{Sidebars} are like miniature, parallel documents.
1202 \DUsidebar{
1203 \DUtitle[title]{Sidebar Title}
1205 \DUsubtitle[sidebar]{Optional Subtitle}
1207 This is a sidebar. It is for text outside the flow of the main
1208 text.
1210 \DUrubric{This is a rubric inside a sidebar}
1212 Sidebars often appear beside the main text with a border and a different
1213 background or font color.
1216 A \emph{topic} is like a block quote with a title, or a self-contained section
1217 with no subsections.
1219 \begin{DUclass}{topic}
1220 \begin{quote}
1221 \DUtitle[topic]{Topic Title}
1223 This is a topic.
1224 \end{quote}
1225 \end{DUclass}
1227 A \emph{rubric} is like an informal heading that doesn’t correspond to the
1228 document’s structure. It is typically highlighted in red (hence the name).
1230 \DUrubric{This is a rubric}
1232 Topics and rubrics can be used at places where a \hyperref[section-title]{section title} is not
1233 allowed (e.g. inside a directive).
1236 \subsubsection{2.14.5   Target Footnotes%
1237 \label{target-footnotes}%
1240 \DUfootnotetext{id29}{id30}{5}{%
1241 \url{http://www.python.org/}
1244 \DUfootnotetext{id33}{id34}{6}{%
1245 \url{http://pygments.org/}
1248 \DUfootnotetext{id35}{id36}{7}{%
1249 \url{ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf}
1252 \DUfootnotetext{id38}{id39}{8}{%
1253 \url{http://ctan.org/pkg/polyglossia}
1256 \DUfootnotetext{id41}{id42}{9}{%
1257 \url{http://docutils.sourceforge.net/}
1260 \DUfootnotetext{id43}{id44}{10}{%
1261 \url{A:DOS\\path\\}
1265 \subsubsection{2.14.6   Replacement Text%
1266 \label{replacement-text}%
1269 I recommend you try \href{http://www.python.org/}{Python, \emph{the} best language around}\DUfootnotemark{id32}{id29}{5}.
1272 \subsubsection{2.14.7   Compound Paragraph%
1273 \label{compound-paragraph}%
1276 The \emph{compound} directive is used to create a “compound paragraph”, which
1277 is a single logical paragraph containing multiple physical body
1278 elements. For example:
1280 \begin{DUclass}{compound}
1281 The ‘rm’ command is very dangerous. If you are logged
1282 in as root and enter
1283 \begin{quote}
1284 \begin{alltt}
1285 cd /
1286 rm -rf *
1287 \end{alltt}
1288 \end{quote}
1289 you will erase the entire contents of your file system.
1290 \end{DUclass}
1292 Test the handling and display of compound paragraphs:
1294 \begin{DUclass}{compound}
1295 \begin{DUclass}{some-class}
1296 Compound 2, paragraph 1,
1298 compound 2, paragraph 2,
1299 \begin{itemize}
1300 \item list item 1,
1302 \item list item 2,
1303 \end{itemize}
1304 compound 2, paragraph 3.
1305 \end{DUclass}
1306 \end{DUclass}
1308 \begin{DUclass}{compound}
1309 Compound 3, only consisting of one paragraph.
1310 \end{DUclass}
1312 \begin{DUclass}{compound}
1313 \begin{quote}
1314 \begin{alltt}
1315 Compound 4.
1316 This one starts with a literal block.
1317 \end{alltt}
1318 \end{quote}
1319 Compound 4, paragraph following the literal block.
1320 \end{DUclass}
1322 Now something \emph{really} perverted – a nested compound block. This is
1323 just to test that it works at all; the results don’t have to be
1324 meaningful.
1326 \begin{DUclass}{compound}
1327 Compound 5, block 1 (a paragraph).
1329 \begin{DUclass}{compound}
1330 Compound 6 is block 2 in compound 5.
1332 Compound 6, another paragraph.
1333 \end{DUclass}
1335 Compound 5, block 3 (a paragraph).
1336 \end{DUclass}
1338 \begin{DUclass}{compound}
1339 Compound 7, tests the inclusion of various block-level
1340 elements in one logical paragraph. First a table,
1342 \setlength{\DUtablewidth}{\linewidth}
1343 \begin{longtable*}[c]{|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|}
1344 \hline
1346 Left cell, first
1347 paragraph.
1349 Left cell, second
1350 paragraph.
1352 Middle cell,
1353 consisting of
1354 exactly one
1355 paragraph.
1357 Right cell.
1359 Paragraph 2.
1361 Paragraph 3.
1363 \hline
1364 \end{longtable*}
1365 followed by a paragraph. This physical paragraph is
1366 actually a continuation of the paragraph before the table. It is followed
1368 \begin{quote}
1369 a quote and
1370 \end{quote}
1371 \begin{enumerate}
1372 \item an enumerated list,
1373 \end{enumerate}
1374 a paragraph,
1375 \begin{DUoptionlist}
1376 \item[--an] option list,
1377 \end{DUoptionlist}
1378 a paragraph,
1379 \begin{DUfieldlist}
1380 \item[{a field:}]
1381 list,
1382 \end{DUfieldlist}
1383 a paragraph,
1384 \begin{description}
1385 \item[{a definition}] \leavevmode
1386 list,
1388 \end{description}
1389 a paragraph, an image:
1390 \includegraphics{../../../docs/user/rst/images/biohazard.png}
1391 a paragraph,
1392 \begin{DUlineblock}{0em}
1393 \item[] a line
1394 \item[] block,
1395 \end{DUlineblock}
1396 a paragraph followed by a comment,
1397 % this is a comment
1398 a paragraph, a
1400 \DUadmonition[note]{
1401 \DUtitle[note]{Note}
1403 with content
1405 and the final paragraph of the compound 7.
1406 \end{DUclass}
1409 \subsubsection{2.14.8   Parsed Literal Blocks%
1410 \label{parsed-literal-blocks}%
1413 \begin{quote}
1414 \ttfamily\raggedright
1415 This~is~a~parsed~literal~block.\\
1416 ~~~~This~line~is~indented.~~The~next~line~is~blank.\\
1418 Inline~markup~is~supported,~e.g.~\emph{emphasis},~\textbf{strong},~\texttt{literal\\
1419 text},~\textsubscript{sub-}~and~\textsuperscript{super}scripts,\\
1420 inline~formulas:~$A = 2 \pi r^2$,\\
1421 footnotes\DUfootnotemark{id22}{id8}{1},~%
1422 \phantomsection\label{hyperlink-targets}hyperlink~targets,~and~\href{http://www.python.org/}{references}.
1423 \end{quote}
1426 \subsubsection{2.14.9   Code%
1427 \label{code}%
1430 Blocks of source code can be set with the \DUroletitlereference{code} directive. If the code
1431 language is specified, the content is parsed and tagged by the \href{http://pygments.org/}{Pygments}\DUfootnotemark{id34}{id33}{6}
1432 syntax highlighter and can be formatted with a style sheet. (Code parsing
1433 is turned off using the \texttt{syntax-highlight} config setting in the test
1434 conversions in order to get identical results with/without installed
1435 Pygments highlighter.)
1437 \begin{DUclass}{code}
1438 \begin{DUclass}{python}
1439 \begin{quote}
1440 \begin{alltt}
1441 print 'This is Python code.'
1442 \end{alltt}
1443 \end{quote}
1444 \end{DUclass}
1445 \end{DUclass}
1447 The \texttt{:number-lines:} option (with optional start value) generates line
1448 numbers:
1450 \begin{DUclass}{code}
1451 \begin{DUclass}{python}
1452 \begin{quote}
1453 \ttfamily\raggedright
1454 \DUrole{ln}{~8~}\#~print~integers~from~0~to~9:\\
1455 \DUrole{ln}{~9~}for~i~in~range(10):\\
1456 \DUrole{ln}{10~}~~~~print~i
1457 \end{quote}
1458 \end{DUclass}
1459 \end{DUclass}
1461 For inline code snippets, there is the \DUroletitlereference{code} role, which can be used
1462 directly (the code will not be parsed/tagged, as the language is not known)
1463 or as base for special code roles, e.g. the LaTeX code in the next
1464 paragraph.
1466 Docutils uses LaTeX syntax for math directives and roles:
1467 \texttt{\DUrole{code}{\DUrole{tex}{\textbackslash{}alpha = f(x)}}} prints $\alpha = f(x)$.
1469 The \texttt{:code:} option of the \DUroletitlereference{include} directive sets the included content
1470 as a code block, here the rst file \texttt{header\_footer.txt} with line numbers:
1472 \begin{DUclass}{code}
1473 \begin{DUclass}{rst}
1474 \begin{quote}
1475 \ttfamily\raggedright
1476 \DUrole{ln}{1~}..~header::~Document~header\\
1477 \DUrole{ln}{2~}..~footer::~Document~footer
1478 \end{quote}
1479 \end{DUclass}
1480 \end{DUclass}
1483 \subsection{2.15   Substitution Definitions%
1484 \label{substitution-definitions}%
1487 An inline image (\includegraphics{../../../docs/user/rst/images/biohazard.png}) example:
1489 (Substitution definitions are not visible in the HTML source.)
1492 \subsection{2.16   Comments%
1493 \label{comments}%
1496 Here’s one:
1498 % Comments begin with two dots and a space. Anything may
1499 % follow, except for the syntax of footnotes, hyperlink
1500 % targets, directives, or substitution definitions.
1502 % Double-dashes -- "--" -- must be escaped somehow in HTML output.
1504 % Comments may contain non-ASCII characters: ä ö ü æ ø å
1506 (View the HTML source to see the comment.)
1509 \subsection{2.17   Raw text%
1510 \label{raw-text}%
1513 This does not necessarily look nice, because there may be missing white space.
1515 It’s just there to freeze the behavior.
1517 A test.
1519 Second test.
1521 \DUrole{myclass}{Another test with myclass set.}
1523 This is the \DUrole{myrawroleclass}{fourth test} with myrawroleclass set.
1525 Fifth test in LaTeX.\\Line two.
1528 \subsection{2.18   Container%
1529 \label{container}%
1532 \begin{DUclass}{custom}
1534 paragraph 1
1536 paragraph 2
1537 \end{DUclass}
1539 % currently not implemented in LaTeX:
1540 % .. include:: data/header_footer.txt
1543 \subsection{2.19   Colspanning tables%
1544 \label{colspanning-tables}%
1547 This table has a cell spanning two columns:
1549 \setlength{\DUtablewidth}{\linewidth}
1550 \begin{longtable*}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.086\DUtablewidth}|}
1551 \hline
1552 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1553 Inputs
1554 }} & \textbf{%
1555 Output
1556 } \\
1557 \hline
1558 \textbf{%
1560 } & \textbf{%
1562 } & \textbf{%
1563 A or B
1564 } \\
1565 \hline
1566 \endfirsthead
1567 \hline
1568 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1569 Inputs
1570 }} & \textbf{%
1571 Output
1572 } \\
1573 \hline
1574 \textbf{%
1576 } & \textbf{%
1578 } & \textbf{%
1579 A or B
1580 } \\
1581 \hline
1582 \endhead
1583 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1584 \endfoot
1585 \endlastfoot
1587 False
1589 False
1591 False
1593 \hline
1595 True
1597 False
1599 True
1601 \hline
1603 False
1605 True
1607 True
1609 \hline
1611 True
1613 True
1615 True
1617 \hline
1618 \end{longtable*}
1621 \subsection{2.20   Rowspanning tables%
1622 \label{rowspanning-tables}%
1625 Here’s a table with cells spanning several rows:
1627 \setlength{\DUtablewidth}{\linewidth}
1628 \begin{longtable*}[c]{|p{0.296\DUtablewidth}|p{0.156\DUtablewidth}|p{0.226\DUtablewidth}|}
1629 \hline
1630 \textbf{%
1631 Header row, column 1
1632 (header rows optional)
1633 } & \textbf{%
1634 Header 2
1635 } & \textbf{%
1636 Header 3
1637 } \\
1638 \hline
1639 \endfirsthead
1640 \hline
1641 \textbf{%
1642 Header row, column 1
1643 (header rows optional)
1644 } & \textbf{%
1645 Header 2
1646 } & \textbf{%
1647 Header 3
1648 } \\
1649 \hline
1650 \endhead
1651 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1652 \endfoot
1653 \endlastfoot
1655 body row 1, column 1
1657 column 2
1659 column 3
1661 \hline
1663 body row 2
1664 & \multirow{2}{0.16\DUtablewidth}{%
1665 Cells may
1666 span rows.
1667 } & \multirow{2}{0.23\DUtablewidth}{%
1668 Another
1669 rowspanning
1670 cell.
1671 } \\
1672 \cline{1-1}
1674 body row 3
1675 & & \\
1676 \hline
1677 \end{longtable*}
1680 \subsection{2.21   List Tables%
1681 \label{list-tables}%
1684 Here’s a list table exercising all features:
1686 \setlength{\DUtablewidth}{40em}
1687 \begin{longtable}[c]{|p{0.133\DUtablewidth}|p{0.249\DUtablewidth}|p{0.365\DUtablewidth}|}
1688 \caption{list table with integral header}\\
1689 \hline
1690 \textbf{%
1691 Treat
1692 } & \textbf{%
1693 Quantity
1694 } & \textbf{%
1695 Description
1696 } \\
1697 \hline
1698 \endfirsthead
1699 \caption[]{list table with integral header (... continued)}\\
1700 \hline
1701 \textbf{%
1702 Treat
1703 } & \textbf{%
1704 Quantity
1705 } & \textbf{%
1706 Description
1707 } \\
1708 \hline
1709 \endhead
1710 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1711 \endfoot
1712 \endlastfoot
1713 \textbf{%
1714 Albatross
1715 } &
1716 2.99
1718 On a stick!
1720 \hline
1721 \textbf{%
1722 Crunchy Frog
1723 } &
1724 1.49
1726 If we took the bones out, it wouldn’t be
1727 crunchy, now would it?
1729 \hline
1730 \textbf{%
1731 Gannet Ripple
1732 } &
1733 1.99
1735 On a stick!
1737 \hline
1738 \end{longtable}
1740 \begin{longtable}[c]{|l|l|}
1741 \caption{center aligned list table}\\
1742 \hline
1743 Albatross & 2.99 \\
1744 \hline
1745 Crunchy Frog & 1.49 \\
1746 \hline
1747 Gannet Ripple & 1.99 \\
1748 \hline
1749 \end{longtable}
1752 \subsection{2.22   Custom Roles%
1753 \label{custom-roles}%
1756 \begin{itemize}
1757 \item A role based on an existing role.
1759 \texttt{\DUrole{custom}{one}} \texttt{\DUrole{custom}{two}} \texttt{\DUrole{custom}{three}}
1761 \item A new role.
1763 \DUrole{customnew}{one two three}
1765 \item A role with class attribute.
1767 \DUrole{special}{interpreted text}
1769 \item A language-switching role:
1771 Let’s count in German \foreignlanguage{german}{eins zwei drei}.
1773 \item A role with multiple class attributes, styled with raw directives:
1775 \newcommand{\DUrolegreen}[1]{\textcolor{green}{#1}}
1776 \newcommand{\DUrolesc}[1]{\textsc{#1}}
1778 The following works in most browsers but does not validate
1779 (\texttt{<style>} is only allowed in the document head):
1781 \begin{quote}
1782 \begin{alltt}
1783 .. raw:: html
1785 <style type="text/css"><!--
1786 .green \{color: green;\}
1787 .sc \{font-variant: small-caps;\}
1788 --></style>
1789 \end{alltt}
1790 \end{quote}
1792 \DUrole{green}{\DUrole{sc}{\foreignlanguage{english}{British colourful text in small-caps}}}.
1793 \end{itemize}
1796 \subsection{2.23   Mathematics%
1797 \label{mathematics}%
1800 Docutils supports inline math with the prefix or postfix \texttt{:math:}
1801 role specificator, $n! + \sin(x_n^2)$ and $A_\text{c} =
1802 \frac{\pi}{4} d^2$, as well as displayed math via the
1803 \DUroletitlereference{math} directive:
1805 \begin{equation*}
1806 f(\epsilon) = \frac{1}{1 + \exp\left(\frac{\varepsilon}{k_\text{B}T}\right)}
1807 \end{equation*}
1808 Content may start on the first line of the directive, e.g.
1810 \begin{equation*}
1811 N = \frac{\text{number of apples}}{7}
1812 \end{equation*}
1813 Equations can be labeled with a reference name using the \texttt{:name:} option.
1814 See \hyperref[eq-m]{eq:M} and \hyperref[eq-schrodinger]{eq:schrödinger} below.
1816 The determinant of the matrix
1818 \begin{equation*}
1819 \mathbf{M} = \left(\begin{matrix}a&b\\c&d\end{matrix}\right)
1820 \phantomsection
1821 \label{eq-m}
1822 \end{equation*}
1823 is $|\mathbf{M}| = ad - bc$.
1825 More than one display math block can be put in one math directive.
1826 For example, the following sum and integral with limits:
1828 \begin{equation*}
1829 \int_0^1 x^n dx = \frac{1}{n + 1}
1830 \end{equation*}%
1831 \begin{equation*}
1832 \sum_{n=1}^m n = \frac{m(m+1)}{2}
1833 \end{equation*}
1834 LaTeX-supported Unicode math symbols can be used in math roles and
1835 directives:
1837 The Schrödinger equation
1839 \begin{equation*}
1840 i\hbar \frac{\partial }{\partial t}\Psi = \hat{H}\Psi ,
1841 \phantomsection
1842 \label{eq-schrodinger}
1843 \end{equation*}
1844 with the \emph{wave function} $\Psi $, describes how the quantum state of a
1845 physical system changes in time.
1847 \begin{description}
1848 \item[{Math-Accents:}] \leavevmode
1849 \setlength{\DUtablewidth}{\linewidth}
1850 \begin{longtable*}[c]{p{0.315\DUtablewidth}p{0.315\DUtablewidth}p{0.315\DUtablewidth}}
1852 $\acute{a}$ \texttt{\textbackslash{}acute\{a\}}
1854 $\dot{t}$ \texttt{\textbackslash{}dot\{t\}}
1856 $\hat{\gamma}$ \texttt{\textbackslash{}hat\{\textbackslash{}gamma\}}
1859 $\grave{a}$ \texttt{\textbackslash{}grave\{a\}}
1861 $\ddot{t}$ \texttt{\textbackslash{}ddot\{t\}}
1863 $\tilde{\alpha}$ \texttt{\textbackslash{}tilde\{\textbackslash{}alpha\}}
1866 $\breve{x}$ \texttt{\textbackslash{}breve\{x\}}
1868 $\dddot{t}$ \texttt{\textbackslash{}dddot\{t\}}
1870 $\vec{\imath}$ \texttt{\textbackslash{}vec\{\textbackslash{}imath\}}
1873 $\check{a}$ \texttt{\textbackslash{}check\{a\}}
1875 $\bar{a}$ \texttt{\textbackslash{}bar\{a\}}
1877 $\vec{R}$ \texttt{\textbackslash{}vec\{R\}}
1879 \end{longtable*}
1881 \end{description}
1883 % \widetilde{xxx}
1884 % \widehat{xxx}
1886 Modulation Transfer Function:
1888 \begin{equation*}
1889 \text{MTF} = \left|\frac{\mathcal{F}\{s(x)\}}
1890 {\mathcal{F}\{ s(x)\} |_{\omega _{x}=0}}\right|
1891 = \mathrm{abs}\left(\frac
1892 {\int _{-\infty }^{\infty }s(x) \mathrm{e}^{\mathrm{i}\omega _{x}x}\mathrm{d}{x}}
1893 {\int _{-\infty }^{\infty }s(x)\mathrm{d}{x}}
1894 \right).
1895 \end{equation*}
1896 Math split over two lines: If a double backslash is detected outside a
1897 \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}
1898 \texttt{align} environment:
1900 \begin{align*}
1901 s_{\mathrm{out}}(x) & = s_{\mathrm{in}}(x') * s_\delta (x-x') \\
1902 & = \int s_{\mathrm{in}}(x')s_\delta (x-x')\mathrm{d}x'
1903 \end{align*}
1904 Cases (“manually”, with \texttt{matrix} environment):
1906 \begin{equation*}
1907 \mathrm{sgn}(x) = \left\{\begin{matrix}
1908 -1 & x<0\\
1909 1 & x>0
1910 \end{matrix}\right.
1911 \end{equation*}
1912 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
1913 HTML writers with \texttt{--math-output=MathML}):
1915 \begin{equation*}
1916 \mathrm{sgn}(x) = \begin{cases}
1917 -1 & x<0\\
1918 1 & x>0
1919 \end{cases}
1920 \end{equation*}
1922 \section{3   Tests for the LaTeX writer%
1923 \label{tests-for-the-latex-writer}%
1926 Test syntax elements which may cause trouble for the LaTeX writer but might
1927 not need to be tested with other writers (e.g. the HTML writer).
1930 \subsection{3.1   Custom Roles in LaTeX%
1931 \label{custom-roles-in-latex}%
1934 \begin{itemize}
1935 \item Role names and class arguments are converted to conform to the
1936 regular expression \texttt{{[}a-z{]}{[}-a-z0-9{]}*} (letters are downcased,
1937 accents and similar decoration is stripped, non-conforming
1938 characters are replaced by a hyphen).
1940 Class arguments may contain numbers and hyphens, which need special
1941 treatment in LaTeX command names.
1943 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{Text with role “custom4”}}}}} (but without styling by \texttt{DUrole*}
1944 macros).
1946 \item With LaTeX, roles can be styled within the document using the \DUroletitlereference{raw}
1947 directive.
1949 \newcommand{\DUrolelarge}[1]{{\large #1}}
1950 \makeatletter
1951 \@namedef{DUrolesmall-caps}{\textsc}
1952 \@namedef{DUrolecustom4}{\textbf}
1953 \makeatother
1955 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{inline text}}}}} in large, bold, small-caps.
1957 \item Custom roles can be based on standard roles:
1959 This is a \emph{\DUrole{custom-emphasis}{customized emphasis text role}}
1961 This is a \texttt{\DUrole{custom-literal}{customized literal text role}}
1963 This is a \textbf{\DUrole{custom-strong}{customized strong text role}}
1965 This is a \textsubscript{\DUrole{custom-subscript}{customized subscript text role}}
1967 This is a \textsuperscript{\DUrole{custom-superscript}{customized superscript text role}}
1969 This is a \DUroletitlereference{\DUrole{custom-title-reference}{customized title-reference text role}}
1970 \end{itemize}
1973 \subsection{3.2   class handling%
1974 \label{class-handling}%
1977 This section tests class handling for block level elements by the LaTeX
1978 writer. See the input file \texttt{classes\_latex.txt} for the raw LaTeX code used
1979 to style the examples.
1981 An “epigraph” directive is exported as “quote” wrapped in a “DUclass”
1982 environment. Here, it is styled by a “DUCLASSepigraph” environment
1983 redefining the “quote” environment as “minipage”:
1985 \newcommand*{\DUCLASSepigraph}{%
1986 \renewenvironment{quote}{\vspace{1em}
1987 \footnotesize\hfill{}%
1988 \begin{minipage}{0.4\columnwidth}}%
1989 {\end{minipage}\vskip\baselineskip}}
1991 \begin{DUclass}{epigraph}
1992 \begin{quote}
1993 Do not play this piece fast. It is never right to play \emph{Ragtime} fast.
1994 \nopagebreak
1996 \raggedleft —Scott Joplin
1997 \end{quote}
1998 \end{DUclass}
2000 Raw latex is also used to style the following lists: “DUCLASSenumerateitems”
2001 redefines “itemize” as “enumerate”, “DUCLASSrules” draws horizontal lines
2002 above and below.
2004 \newcommand*{\DUCLASSenumerateitems}{%
2005 \renewenvironment{itemize}{\begin{enumerate}}%
2006 {\end{enumerate}}%
2009 \newenvironment{DUCLASSrules}%
2010 {\noindent\rule[0.5ex]{1\columnwidth}{1pt}}%
2011 {\noindent\rule[0.5ex]{1\columnwidth}{1pt}}
2013 An “enumerated” bullet list:
2015 \begin{DUclass}{enumerateitems}
2016 \begin{itemize}
2017 \item item
2019 \item next item
2021 \item third item
2022 \end{itemize}
2023 \end{DUclass}
2025 A list with lines above and below:
2027 \begin{DUclass}{rules}
2028 \begin{itemize}
2029 \item item
2031 \item next item
2032 \end{itemize}
2033 \end{DUclass}
2035 A normal bullet list is kept unchanged by the above redefinitions:
2037 \begin{itemize}
2038 \item item
2040 \item next item
2042 \item third item
2043 \end{itemize}
2045 A container wraps several elements in a common “class wrapper”. Here, we use
2046 it to set 2 paragraphs and a list in small caps:
2048 \newcommand*{\DUCLASSscshape}{\scshape}
2050 \begin{DUclass}{scshape}
2052 paragraph 1
2054 paragraph 2
2056 \begin{itemize}
2057 \item bullet list
2059 \item still bullet list
2060 \end{itemize}
2061 \end{DUclass}
2063 A right-aligned line-block. Alignment handling is built into the latex
2064 writer for image, table, and line block elements.
2066 \begin{DUlineblock}{0em}
2067 \raggedleft
2068 \item[] Max Mustermann
2069 \item[] Waldstr. 22
2070 \item[] D 01234 Testdorf
2071 \item[] Tel.: 0123/456789
2072 \end{DUlineblock}
2075 \subsection{3.3   More Tables%
2076 \label{more-tables}%
2079 A table with multi-paragraph multicolumn cells:
2081 \setlength{\DUtablewidth}{\linewidth}
2082 \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}|}
2083 \hline
2085 test
2087 \textbf{bold hd}
2088 & \multicolumn{3}{p{0.41\DUtablewidth}|}{%
2089 multicolumn 1
2091 With a second paragraph
2092 } &
2093 \emph{emph hd}
2095 \hline
2096 \multicolumn{2}{|p{0.31\DUtablewidth}|}{%
2097 multicolumn 2
2099 With a second paragraph
2100 } &
2101 cell
2103 cell
2105 cell
2107 cell
2109 \hline
2111 cell
2112 & \multicolumn{2}{p{0.36\DUtablewidth}|}{%
2113 multicolumn 3 (one line,
2114 but very very very very
2115 very looooong)
2116 } &
2117 cell
2119 cell
2121 cell
2123 \hline
2125 cell
2127 cell
2129 cell
2130 & \multicolumn{3}{p{0.38\DUtablewidth}|}{%
2131 Short multicolumn 4
2132 } \\
2133 \hline
2134 \end{longtable*}
2136 Tables with multi-paragraph multirow cells currently fail due to a LaTeX
2137 limitation (see \url{https://sourceforge.net/p/docutils/bugs/225/}).
2139 A table with multirow header and column-widths set by LaTeX:
2141 \begin{longtable*}[c]{|l|l|}
2142 \hline
2143 \multirow{2}{*}{\textbf{XXX}} & \textbf{Variable Summary} \\
2144 \cline{2-2}
2145 & \textbf{Description} \\
2146 \hline
2147 \endfirsthead
2148 \hline
2149 \multirow{2}{*}{\textbf{XXX}} & \textbf{Variable Summary} \\
2150 \cline{2-2}
2151 & \textbf{Description} \\
2152 \hline
2153 \endhead
2154 \multicolumn{2}{c}{\hfill ... continued on next page} \\
2155 \endfoot
2156 \endlastfoot
2157 \multicolumn{2}{|l|}{multicollumn cell} \\
2158 \hline
2159 \end{longtable*}
2161 In a table with column-widths set by LaTeX, each cell has just one line.
2162 Paragraphs are merged (a warning is given).
2164 \begin{longtable*}[c]{|l|l|}
2165 \hline
2166 11 & first paragraph
2167 second paragraph
2168 third paragraph \\
2169 \hline
2170 21 & 22 \\
2171 \hline
2172 \end{longtable*}
2174 % This file is used by the standalone_rst_latex test.
2177 \subsection{3.4   Option lists%
2178 \label{id23}%
2181 The LaTeX-2e description environment is used for definition lists.
2182 The definition is continued on the same line as the term, this should
2183 not happen if a option-list is at the top of the definition.
2185 If the option list is not at the first element in the definition, it
2186 is contained in a quote
2188 \begin{quote}
2189 \begin{DUoptionlist}
2190 \item[--help] show help
2192 \item[-v] verbose
2193 \end{DUoptionlist}
2194 \end{quote}
2196 \begin{description}
2197 \item[{In a definition list:}] \leavevmode
2198 \begin{DUoptionlist}
2199 \item[--help] show help
2201 \item[-v] verbose
2202 \end{DUoptionlist}
2204 \end{description}
2207 \subsection{3.5   Monospaced non-alphanumeric characters%
2208 \label{monospaced-non-alphanumeric-characters}%
2211 These are all ASCII characters except a-zA-Z0-9 and space:
2213 \texttt{!!!\textquotedbl{}\textquotedbl{}\textquotedbl{}\#\#\#\$\$\$\%\%\%\&\&\&'''((()))***+++,,,---...///:::}
2215 \texttt{;;;<<<===>>>???@@@{[}{[}{[}\textbackslash{}\textbackslash{}\textbackslash{}{]}{]}{]}\textasciicircum{}\textasciicircum{}\textasciicircum{}\_\_\_```\{\{\{|||\}\}\}\textasciitilde{}\textasciitilde{}\textasciitilde{}}
2217 \texttt{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
2219 The two lines of non-alphanumeric characters should both have the same
2220 width as the third line.
2223 \subsection{3.6   Non-ASCII characters%
2224 \label{non-ascii-characters}%
2227 Punctuation and footnote symbols
2229 \setlength{\DUtablewidth}{\linewidth}
2230 \begin{longtable*}[c]{|p{0.028\DUtablewidth}|p{0.424\DUtablewidth}|}
2231 \hline
2235 en-dash
2237 \hline
2241 em-dash
2243 \hline
2247 single turned comma quotation mark
2249 \hline
2253 single comma quotation mark
2255 \hline
2259 low single comma quotation mark
2261 \hline
2265 double turned comma quotation mark
2267 \hline
2271 double comma quotation mark
2273 \hline
2277 low double comma quotation mark
2279 \hline
2283 dagger
2285 \hline
2289 double dagger
2291 \hline
2295 black diamond suit
2297 \hline
2301 black heart suit
2303 \hline
2307 black spade suit
2309 \hline
2313 black club suit
2315 \hline
2319 ellipsis
2321 \hline
2325 trade mark sign
2327 \hline
2331 left-right double arrow
2333 \hline
2334 \end{longtable*}
2336 The \DUroletitlereference{Latin-1 extended} Unicode block
2338 \setlength{\DUtablewidth}{\linewidth}
2339 \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}|}
2340 \hline
2364 \hline
2367 & &
2373 & &
2384 \hline
2408 \hline
2432 \hline
2456 \hline
2480 \hline
2504 \hline
2528 \hline
2552 \hline
2576 \hline
2591 & & & & \\
2592 \hline
2593 \end{longtable*}
2595 \begin{itemize}
2596 \item The following line should not be wrapped, because it uses
2597 no-break spaces (\textbackslash{}u00a0):
2599 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
2601 \item Line wrapping with/without breakpoints marked by soft hyphens
2602 (\textbackslash{}u00ad):
2604 pdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-sch
2606 pdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrisch
2607 \end{itemize}
2610 \subsection{3.7   Encoding special chars%
2611 \label{encoding-special-chars}%
2614 The LaTeX Info pages lists under “2.18 Special Characters”
2616 \begin{quote}
2617 The following characters play a special role in LaTeX and are called
2618 “special printing characters”, or simply “special characters”.
2620 \begin{quote}
2621 \# \$ \% \& \textasciitilde{} \_ \textasciicircum{} \textbackslash{} \{ \}
2622 \end{quote}
2623 \end{quote}
2625 The special chars verbatim:
2627 \begin{quote}
2628 \begin{alltt}
2629 # $ % & ~ _ ^ \textbackslash{} \{ \}
2630 \end{alltt}
2631 \end{quote}
2633 However also \emph{square brackets} {[}{]} need special care.
2635 \begin{quote}
2636 Commands with optional arguments (e.g. \texttt{\textbackslash{}item}) check
2637 if the token right after the macro name is an opening bracket.
2638 In that case the contents between that bracket and the following
2639 closing bracket on the same grouping level are taken as the
2640 optional argument. What makes this unintuitive is the fact that
2641 the square brackets aren’t grouping characters themselves, so in
2642 your last example item{[}{[}{]}{]} the optional argument consists of
2643 {[}… (without the closing bracket).
2644 \end{quote}
2646 Compare the items in the following lists:
2648 \begin{itemize}
2649 \item simple item
2651 \item {[}bracketed{]} item
2652 \end{itemize}
2654 \begin{description}
2655 \item[{simple}] \leavevmode
2656 description term
2658 \item[{{[}bracketed{]}}] \leavevmode
2659 description term
2661 \end{description}
2663 The OT1 font-encoding has different characters for the less-than,
2664 greater-than and bar, < | >, except for typewriter font \DUroletitlereference{cmtt}:
2666 \begin{quote}
2667 \begin{alltt}
2668 < | >
2669 \end{alltt}
2670 \end{quote}
2673 \subsection{3.8   Hyperlinks and -targets%
2674 \label{hyperlinks-and-targets}%
2677 In LaTeX, we must set an explicit anchor (\texttt{\textbackslash{}phantomsection}) for a
2679 \phantomsection\label{hypertarget-in-plain-text}hypertarget in plain text or in a figure but not in a longtable or
2680 caption:
2682 \setlength{\DUtablewidth}{\linewidth}
2683 \begin{longtable}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
2684 \caption{Table with %
2685 \label{hypertarget-in-table-title}hypertarget in table title.}\\
2686 \hline
2688 False
2690 True
2692 None
2694 \hline
2695 \end{longtable}
2696 \label{table-label}
2698 \begin{figure}
2699 \phantomsection\label{figure-label}
2700 \noindent\makebox[\linewidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
2701 \caption{Figure with %
2702 \label{hypertarget-in-figure-caption}hypertarget in figure caption.}
2703 \begin{DUlegend}
2704 Legend with %
2705 \phantomsection\label{hypertarget-in-figure-legend}hypertarget in figure legend.
2706 \end{DUlegend}
2707 \end{figure}
2709 \includegraphics{../../../docs/user/rst/images/biohazard.png}
2710 \phantomsection\label{image-label}
2712 See \hyperref[hypertarget-in-plain-text]{hypertarget in plain text},
2713 \hyperref[table-label]{table label}, \hyperref[hypertarget-in-table-title]{hypertarget in table title},
2714 \hyperref[figure-label]{figure label}, \hyperref[hypertarget-in-figure-caption]{hypertarget in figure caption},
2715 \hyperref[hypertarget-in-figure-legend]{hypertarget in figure legend}, and
2716 \hyperref[image-label]{image label}.
2719 \subsection{3.9   External references%
2720 \label{external-references}%
2723 Long URLs should be wrapped in the PDF.
2724 This can be achieved with the url command which is used by the LaTeX writer
2725 whenever the content (name) of a reference node equals the link URL.
2727 \begin{description}
2728 \item[{Example:}] \leavevmode
2729 a long URL that should wrap in the output
2730 \url{http://docutils.sourceforge.net/docs/user/latex.html\#id79}
2732 \end{description}
2734 If the argument contains any “\%”, “\#”, or “\textasciicircum{}\textasciicircum{}”, or ends with \texttt{\textbackslash{}}, it can’t
2735 be used in the argument to another command. The argument must not contain
2736 unbalanced braces.
2738 The characters \textasciicircum{}, \{, \}, and \texttt{\textbackslash{}} are invalid in a “http:” or “ftp:” URL
2739 and not recognized as part of it:
2741 \begin{DUlineblock}{0em}
2742 \item[] \url{http://www.example.org}/strange\textasciicircum{}\textasciicircum{}name
2743 \item[] \url{http://www.example.org}\textbackslash{}using\textbackslash{}DOS\textbackslash{}paths\textbackslash{}
2744 \item[] \url{http://www.example.org/XML}/strange\{n\}ame
2745 \end{DUlineblock}
2747 They can, however be used in paths and/or filenames.
2749 Handling by the LaTeX writer:
2751 \begin{itemize}
2752 \item \texttt{\#}, \texttt{\textbackslash{}} and \texttt{\%} are escaped:
2754 \begin{DUlineblock}{0em}
2755 \item[] \href{http://www.w3.org/XML/Schema\#dev}{URL with \#}
2756 \url{http://www.w3.org/XML/Schema\#dev}
2757 \item[] \href{http://www.w3.org/XML/Schema\%dev}{URL with \%}
2758 \url{http://example.org/Schema\%dev}
2759 \item[] \href{A:DOS\\path\\}{file with DOS path}\DUfootnotemark{id44}{id43}{10} \url{A:DOS\\path\\}\DUfootnotemark{id45}{id43}{10}
2760 \end{DUlineblock}
2762 \DUadmonition[note]{
2763 \DUtitle[note]{Note}
2765 These URLs are typeset inside a LaTeX command without error.
2767 \begin{DUlineblock}{0em}
2768 \item[] \url{http://www.w3.org/XML/Schema\#dev}
2769 \item[] \url{http://example.org/Schema\%dev}
2770 \item[] \url{A:DOS\\path\\}\DUfootnotemark{id46}{id43}{10}
2771 \end{DUlineblock}
2773 \end{itemize}
2775 \begin{itemize}
2776 \item \textasciicircum{}\textasciicircum{} LaTeX’s special syntax for characters results in “strange” replacements
2777 (both with href and url). A warning is given.
2779 \href{../strange^^name}{file with \textasciicircum{}\textasciicircum{}}:
2780 \url{../strange^^name}
2782 \item Unbalanced braces, \{ or \}, will fail (both with href and url):
2784 \begin{quote}
2785 \begin{alltt}
2786 `file with \{ <../strange\{name>`__
2787 `<../strange\{name>`__
2788 \end{alltt}
2789 \end{quote}
2791 while balanced braces are suported:
2793 \begin{DUlineblock}{0em}
2794 \item[] \url{../strange{n}ame}
2795 \item[] \url{../st{r}ange{n}ame}
2796 \item[] \url{../{st{r}ange{n}ame}}
2797 \end{DUlineblock}
2798 \end{itemize}
2801 \subsection{3.10   Section titles with \hyperref[inline-markup]{inline markup}%
2802 \label{section-titles-with-inline-markup}%
2806 \subsubsection{3.10.1   \emph{emphasized}, H\textsubscript{2}O and $x^2$%
2807 \label{emphasized-h2o-and-x-2}%
2811 \subsubsection{3.10.2   Substitutions work%
2812 \label{substitutions-fail}%
2816 \subsection{3.11   Deeply nested sections%
2817 \label{deeply-nested-sections}%
2820 In LaTeX and HTML,
2823 \subsubsection{3.11.1   Level 3%
2824 \label{level-3}%
2827 nested sections
2830 \paragraph{3.11.1.1   level 4%
2831 \label{level-4}%
2834 reach at some level
2837 \subparagraph{3.11.1.1.1   level 5%
2838 \label{level-5}%
2841 (depending on the document class)
2844 \DUtitle[sectionVI]{3.11.1.1.1.1   level 6%
2845 \label{level-6}%
2848 an unsupported level.
2851 \section{4   Tests for the XeTeX writer%
2852 \label{tests-for-the-xetex-writer}%
2855 With XeTeX, you can typeset text in any language/script supported by
2856 Unicode and the selected font, e.g. Azərbaycanca, Bân-lâm-gú, Башҡорт
2857 Беларуская, Български, Català, Чӑвашла, Česky, Ελληνικά, Español,
2858 Français, Føroyskt, Хальмг, Íslenska, עברית , Қазақша, Kurdî,
2859 Latviešu, Lietuvių, Македонски, Монгол, Nāhuatl, Português, Română,
2860 Русский, Slovenščina, Српски, Türkçe, Українська, Tiếng Việt, Volapük,
2861 Võro, ייִדיש , Žemaitėška.
2862 Currently, there is extended support for 28 languages in the
2863 \href{http://ctan.org/pkg/polyglossia}{polyglossia}\DUfootnotemark{id39}{id38}{8} package.
2865 % System Messages:
2868 \section{5   Error Handling%
2869 \label{error-handling}%
2872 Any errors caught during processing will generate system messages.
2874 There should be five messages in the following, auto-generated
2875 section, “Docutils System Messages”:
2877 % section should be added by Docutils automatically
2880 \section[Docutils System Messages]{\color{red}Docutils System Messages%
2883 \DUadmonition[system-message]{
2884 \DUtitle[system-message]{system-message}
2885 \raisebox{1em}{\hypertarget{id27}{}}
2887 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~104
2889 \hyperlink{id28}{
2890 Undefined substitution referenced: \textquotedbl{}problematic\textquotedbl{}.
2893 \DUadmonition[system-message]{
2894 \DUtitle[system-message]{system-message}
2895 \raisebox{1em}{\hypertarget{id47}{}}
2897 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~391
2899 \hyperlink{id17}{
2900 Unknown target name: \textquotedbl{}5\textquotedbl{}.
2903 \DUadmonition[system-message]{
2904 \DUtitle[system-message]{system-message}
2905 \raisebox{1em}{\hypertarget{id48}{}}
2907 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~400
2909 \hyperlink{id19}{
2910 Unknown target name: \textquotedbl{}nonexistent\textquotedbl{}.
2913 \DUadmonition[system-message]{
2914 \DUtitle[system-message]{system-message}
2915 \raisebox{1em}{\hypertarget{id49}{}}
2917 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~427
2919 \hyperlink{id50}{
2920 Unknown target name: \textquotedbl{}hyperlink reference without a target\textquotedbl{}.
2923 \DUadmonition[system-message]{
2924 \DUtitle[system-message]{system-message}
2925 \raisebox{1em}{\hypertarget{id51}{}}
2927 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~440
2929 \hyperlink{id52}{
2930 Duplicate target name, cannot be used as a unique reference: \textquotedbl{}duplicate target names\textquotedbl{}.
2933 \end{document}