Adapt tests to latest latex writer fix.
[docutils.git] / docutils / test / functional / expected / standalone_rst_xetex.tex
blob29dc54c2bdeb5c52c4cd14eb2e7a8f1c6083db5a
1 \documentclass[a4paper]{article}
2 % generated by Docutils <http://docutils.sourceforge.net/>
3 % rubber: set program xelatex
4 \usepackage{fixltx2e}
5 \usepackage{fontspec}
6 % \defaultfontfeatures{Scale=MatchLowercase}
7 \usepackage{ifthen}
8 \usepackage{amsmath}
9 \usepackage{polyglossia}
10 \setdefaultlanguage{english}
11 \setotherlanguages{british,french,german}
12 \usepackage{color}
13 \usepackage{float} % float configuration
14 \floatplacement{figure}{H} % place figures here definitely
15 \usepackage{graphicx}
16 \usepackage{alltt}
17 \usepackage{multirow}
18 \setcounter{secnumdepth}{0}
19 \usepackage{longtable,ltcaption,array}
20 \setlength{\extrarowheight}{2pt}
21 \newlength{\DUtablewidth} % internal use in tables
22 \usepackage{tabularx}
24 %%% Custom LaTeX preamble
25 % Linux Libertine (free, wide coverage, not only for Linux)
26 \setmainfont{Linux Libertine O}
27 \setsansfont{Linux Biolinum O}
28 \setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}
30 %%% User specified packages and stylesheets
32 %%% Fallback definitions for Docutils-specific commands
34 % providelength (provide a length variable and set default, if it is new)
35 \providecommand*{\DUprovidelength}[2]{
36 \ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{}
39 % abstract title
40 \providecommand*{\DUtitleabstract}[1]{\centering\textbf{#1}}
42 % admonition (specially marked topic)
43 \providecommand{\DUadmonition}[2][class-arg]{%
44 % try \DUadmonition#1{#2}:
45 \ifcsname DUadmonition#1\endcsname%
46 \csname DUadmonition#1\endcsname{#2}%
47 \else
48 \begin{center}
49 \fbox{\parbox{0.9\linewidth}{#2}}
50 \end{center}
51 \fi
54 \makeatletter
55 \@namedef{DUrolealign-center}{\centering}
56 \makeatother
59 % dedication topic
60 \providecommand{\DUtopicdedication}[1]{\begin{center}#1\end{center}}
62 % docinfo (width of docinfo table)
63 \DUprovidelength{\DUdocinfowidth}{0.9\linewidth}
65 % subtitle (in document title)
66 \providecommand*{\DUdocumentsubtitle}[1]{{\large #1}}
67 \newcounter{enumv}
69 % error admonition title
70 \providecommand*{\DUtitleerror}[1]{\DUtitle{\color{red}#1}}
72 % fieldlist environment
73 \ifthenelse{\isundefined{\DUfieldlist}}{
74 \newenvironment{DUfieldlist}%
75 {\quote\description}
76 {\enddescription\endquote}
77 }{}
78 % numeric or symbol footnotes with hyperlinks
79 \providecommand*{\DUfootnotemark}[3]{%
80 \raisebox{1em}{\hypertarget{#1}{}}%
81 \hyperlink{#2}{\textsuperscript{#3}}%
83 \providecommand{\DUfootnotetext}[4]{%
84 \begingroup%
85 \renewcommand{\thefootnote}{%
86 \protect\raisebox{1em}{\protect\hypertarget{#1}{}}%
87 \protect\hyperlink{#2}{#3}}%
88 \footnotetext{#4}%
89 \endgroup%
92 % inline markup (custom roles)
93 % \DUrole{#1}{#2} tries \DUrole#1{#2}
94 \providecommand*{\DUrole}[2]{%
95 \ifcsname DUrole#1\endcsname%
96 \csname DUrole#1\endcsname{#2}%
97 \else% backwards compatibility: try \docutilsrole#1{#2}
98 \ifcsname docutilsrole#1\endcsname%
99 \csname docutilsrole#1\endcsname{#2}%
100 \else%
102 \fi%
103 \fi%
106 % legend environment
107 \ifthenelse{\isundefined{\DUlegend}}{
108 \newenvironment{DUlegend}{\small}{}
111 % lineblock environment
112 \DUprovidelength{\DUlineblockindent}{2.5em}
113 \ifthenelse{\isundefined{\DUlineblock}}{
114 \newenvironment{DUlineblock}[1]{%
115 \list{}{\setlength{\partopsep}{\parskip}
116 \addtolength{\partopsep}{\baselineskip}
117 \setlength{\topsep}{0pt}
118 \setlength{\itemsep}{0.15\baselineskip}
119 \setlength{\parsep}{0pt}
120 \setlength{\leftmargin}{#1}}
121 \raggedright
123 {\endlist}
126 % optionlist environment
127 \providecommand*{\DUoptionlistlabel}[1]{\bf #1 \hfill}
128 \DUprovidelength{\DUoptionlistindent}{3cm}
129 \ifthenelse{\isundefined{\DUoptionlist}}{
130 \newenvironment{DUoptionlist}{%
131 \list{}{\setlength{\labelwidth}{\DUoptionlistindent}
132 \setlength{\rightmargin}{1cm}
133 \setlength{\leftmargin}{\rightmargin}
134 \addtolength{\leftmargin}{\labelwidth}
135 \addtolength{\leftmargin}{\labelsep}
136 \renewcommand{\makelabel}{\DUoptionlistlabel}}
138 {\endlist}
141 \DUprovidelength{\pdfpxdimen}{1bp}
144 % rubric (informal heading)
145 \providecommand*{\DUrubric}[2][class-arg]{%
146 \subsubsection*{\centering\textit{\textmd{#2}}}}
148 % sidebar (text outside the main text flow)
149 \providecommand{\DUsidebar}[2][class-arg]{%
150 \begin{center}
151 \colorbox[gray]{0.80}{\parbox{0.9\linewidth}{#2}}
152 \end{center}
155 % subtitle (for topic/sidebar)
156 \providecommand*{\DUsubtitle}[2][class-arg]{\par\emph{#2}\smallskip}
158 % title for topics, admonitions, unsupported section levels, and sidebar
159 \providecommand*{\DUtitle}[2][class-arg]{%
160 % call \DUtitle#1{#2} if it exists:
161 \ifcsname DUtitle#1\endcsname%
162 \csname DUtitle#1\endcsname{#2}%
163 \else
164 \smallskip\noindent\textbf{#2}\smallskip%
168 % titlereference role
169 \providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
171 % topic (quote with heading)
172 \providecommand{\DUtopic}[2][class-arg]{%
173 \ifcsname DUtopic#1\endcsname%
174 \csname DUtopic#1\endcsname{#2}%
175 \else
176 \begin{quote}#2\end{quote}
180 % transition (break, fancybreak, anonymous section)
181 \providecommand*{\DUtransition}[1][class-arg]{%
182 \hspace*{\fill}\hrulefill\hspace*{\fill}
183 \vskip 0.5\baselineskip
186 % hyperlinks:
187 \ifthenelse{\isundefined{\hypersetup}}{
188 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
189 \usepackage{bookmark}
190 \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
192 \hypersetup{
193 pdftitle={reStructuredText Test Document},
194 pdfauthor={David Goodger;Me;Myself;I}
197 %%% Title Data
198 \title{\phantomsection%
199 reStructuredText Test Document%
200 \label{restructuredtext-test-document}%
201 \label{doctitle}%
202 \\ % subtitle%
203 \DUdocumentsubtitle{Examples of Syntax Constructs}%
204 \label{examples-of-syntax-constructs}%
205 \label{subtitle}}
206 \author{}
207 \date{}
209 %%% Body
210 \begin{document}
211 \maketitle
213 % Docinfo
214 \begin{center}
215 \begin{tabularx}{\DUdocinfowidth}{lX}
216 \textbf{Author}: &
217 David Goodger \\
218 \textbf{Address}: &
219 {\raggedright
220 123 Example Street\\
221 Example, EX Canada\\
222 A1B 2C3 } \\
223 \textbf{Contact}: &
224 \href{mailto:goodger@python.org}{goodger@python.org} \\
225 \textbf{Author}: &
226 Me \\
227 \textbf{Author}: &
228 Myself \\
229 \textbf{Author}: &
230 I \\
231 \textbf{Organization}: &
232 humankind \\
233 \textbf{Date}: &
234 Now, or yesterday. Or maybe even \emph{before} yesterday. \\
235 \textbf{Status}: &
236 This is a “work in progress” \\
237 \textbf{Revision}: &
238 is managed by a version control system. \\
239 \textbf{Version}: &
240 1 \\
241 \textbf{Copyright}: &
242 This document has been placed in the public domain. You
243 may do with it as you wish. You may copy, modify,
244 redistribute, reattribute, sell, buy, rent, lease,
245 destroy, or improve it, quote it at length, excerpt,
246 incorporate, collate, fold, staple, or mutilate it, or do
247 anything else to it that your or anyone else’s heart
248 desires. \\
249 \textbf{field name}: &
250 This is a “generic bibliographic field”.
252 \textbf{field name “2}: &
253 Generic bibliographic fields may contain multiple body elements.
255 Like this.
257 \end{tabularx}
258 \end{center}
260 \DUtopic[dedication]{
261 \DUtitle[dedication]{Dedication}
263 For Docutils users \& co-developers.
266 \DUtopic[abstract]{
267 \DUtitle[abstract]{Abstract}
269 This is a test document, containing at least one example of each
270 reStructuredText construct.
273 % This is a comment. Note how any initial comments are moved by
274 % transforms to after the document title, subtitle, and docinfo.
276 % Above is the document title, and below is the subtitle.
277 % They are transformed from section titles after parsing.
279 % bibliographic fields (which also require a transform):
281 \pagebreak[4] % start ToC on new page
283 \phantomsection\label{table-of-contents}
284 \pdfbookmark[1]{Table of Contents}{table-of-contents}
285 \renewcommand{\contentsname}{Table of Contents}
286 \tableofcontents
290 \section{1   Structural Elements%
291 \label{structural-elements}%
295 \subsection{1.1   Section Title%
296 \label{section-title}%
298 \subsubsection*{Section Subtitle}
300 Lone subsections are converted to a section subtitle by a transform
301 activated with the \texttt{--section-subtitles} command line option or the
302 \texttt{sectsubtitle-xform} configuration value.
305 \subsection{1.2   Empty Section%
306 \label{empty-section}%
310 \subsection{1.3   Transitions%
311 \label{transitions}%
314 Here’s a transition:
317 %___________________________________________________________________________
318 \DUtransition
321 It divides the section. Transitions may also occur between sections:
324 %___________________________________________________________________________
325 \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{id37}{id29}{5} (\href{http://docutils.sourceforge.net/}{a second reference}\DUfootnotemark{id39}{id38}{8}), 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}
386 \item A bullet list
388 \begin{itemize}
390 \item Nested bullet list.
392 \item Nested item 2.
394 \end{itemize}
396 \item Item 2.
398 Paragraph 2 of item 2.
400 \begin{itemize}
402 \item Nested bullet list.
404 \item Nested item 2.
406 \begin{itemize}
408 \item Third level.
410 \item Item 2.
412 \end{itemize}
414 \item Nested item 3.
416 \item This nested list should be compacted by the HTML writer.
418 \phantomsection\label{target}
419 % Even if this item contains a target and a comment.
421 \end{itemize}
423 \end{itemize}
426 \subsection{2.3   Enumerated Lists%
427 \label{enumerated-lists}%
429 \begin{enumerate}
431 \item Arabic numerals.
432 \begin{enumerate}
433 \renewcommand{\labelenumii}{\alph{enumii})}
435 \item lower alpha)
436 \begin{enumerate}
437 \renewcommand{\labelenumiii}{(\roman{enumiii})}
439 \item (lower roman)
440 \begin{enumerate}
442 \item upper alpha.
443 \begin{list}{\Roman{enumv})}{\usecounter{enumv}}
445 \item upper roman)
446 \end{list}
447 \end{enumerate}
448 \end{enumerate}
449 \end{enumerate}
451 \item Lists that don’t start at 1:
452 \begin{enumerate}
453 \renewcommand{\labelenumii}{\arabic{enumii}.}
454 \setcounter{enumii}{2}
456 \item Three
458 \item Four
459 \end{enumerate}
460 \begin{enumerate}
461 \renewcommand{\labelenumii}{\Alph{enumii}.}
462 \setcounter{enumii}{2}
464 \item C
466 \item D
467 \end{enumerate}
468 \begin{enumerate}
469 \renewcommand{\labelenumii}{\roman{enumii}.}
470 \setcounter{enumii}{2}
472 \item iii
474 \item iv
475 \end{enumerate}
476 \end{enumerate}
479 \subsection{2.4   Definition Lists%
480 \label{definition-lists}%
483 \begin{description}
484 \item[{Term}] \leavevmode
485 Definition
487 \item[{Term}] \leavevmode (\textbf{classifier})
489 Definition paragraph 1.
491 Definition paragraph 2.
493 \item[{Term}] \leavevmode
494 Definition
496 \item[{Term}] \leavevmode (\textbf{classifier one})
497 (\textbf{classifier two})
499 Definition
501 \end{description}
504 \subsection{2.5   Field Lists%
505 \label{field-lists}%
508 \begin{DUfieldlist}
509 \item[{what:}]
510 Field lists map field names to field bodies, like database
511 records. They are often part of an extension syntax. They are
512 an unambiguous variant of RFC 2822 fields.
514 \item[{how arg1 arg2:}]
515 The field marker is a colon, the field name, and a colon.
517 The field body may contain one or more body elements, indented
518 relative to the field marker.
520 \item[{credits:}]
521 \DUrole{credits}{This paragraph has the \DUroletitlereference{credits} class set. (This is actually not
522 about credits but just for ensuring that the class attribute
523 doesn’t get stripped away.)}
525 \end{DUfieldlist}
528 \subsection{2.6   Option Lists%
529 \label{option-lists}%
532 For listing command-line options:
534 \begin{DUoptionlist}
536 \item[-a] command-line option “a”
538 \item[-b file] options can have arguments
539 and long descriptions
541 \item[--long] options can be long also
543 \item[--input=file] long options can also have
544 arguments
546 \item[--very-long-option] The description can also start on the next line.
548 The description may contain multiple body elements,
549 regardless of where it starts.
551 \item[-x, -y, -z] Multiple options are an “option group”.
553 \item[-v, --verbose] Commonly-seen: short \& long options.
555 \item[-1 file, --one=file, --two file] Multiple options with arguments.
557 \item[/V] DOS/VMS-style options too
559 \end{DUoptionlist}
561 There must be at least two spaces between the option and the
562 description.
565 \subsection{2.7   Literal Blocks%
566 \label{literal-blocks}%
569 Literal blocks are indicated with a double-colon (“::”) at the end of
570 the preceding paragraph (over there \texttt{-->}). They can be indented:
572 \begin{quote}
573 \begin{alltt}
574 if literal_block:
575 text = 'is left as-is'
576 spaces_and_linebreaks = 'are preserved'
577 markup_processing = None
578 \end{alltt}
579 \end{quote}
581 Or they can be quoted without indentation:
583 \begin{quote}
584 \begin{alltt}
585 >> Great idea!
587 > Why didn't I think of that?
588 \end{alltt}
589 \end{quote}
592 \subsection{2.8   Line Blocks%
593 \label{line-blocks}%
596 This section tests line blocks. Line blocks are body elements which
597 consist of lines and other line blocks. Nested line blocks cause
598 indentation.
600 \begin{DUlineblock}{0em}
601 \item[] This is a line block. It ends with a blank line.
602 \item[]
603 \begin{DUlineblock}{\DUlineblockindent}
604 \item[] New lines begin with a vertical bar (“|”).
605 \item[] Line breaks and initial indent are significant, and preserved.
606 \item[]
607 \begin{DUlineblock}{\DUlineblockindent}
608 \item[] Continuation lines are also possible. A long line that is intended
609 to wrap should begin with a space in place of the vertical bar.
610 \end{DUlineblock}
611 \item[] The left edge of a continuation line need not be aligned with
612 the left edge of the text above it.
613 \end{DUlineblock}
614 \end{DUlineblock}
616 \begin{DUlineblock}{0em}
617 \item[] This is a second line block.
618 \item[]
619 \item[] Blank lines are permitted internally, but they must begin with a “|”.
620 \end{DUlineblock}
622 Another line block, surrounded by paragraphs:
624 \begin{DUlineblock}{0em}
625 \item[] And it’s no good waiting by the window
626 \item[] It’s no good waiting for the sun
627 \item[] Please believe me, the things you dream of
628 \item[] They don’t fall in the lap of no-one
629 \end{DUlineblock}
631 Take it away, Eric the Orchestra Leader!
633 \begin{quote}
635 \begin{DUlineblock}{0em}
636 \item[] A one, two, a one two three four
637 \item[]
638 \item[] Half a bee, philosophically,
639 \item[]
640 \begin{DUlineblock}{\DUlineblockindent}
641 \item[] must, \emph{ipso facto}, half not be.
642 \end{DUlineblock}
643 \item[] But half the bee has got to be,
644 \item[]
645 \begin{DUlineblock}{\DUlineblockindent}
646 \item[] \emph{vis a vis} its entity. D’you see?
647 \item[]
648 \end{DUlineblock}
649 \item[] But can a bee be said to be
650 \item[]
651 \begin{DUlineblock}{\DUlineblockindent}
652 \item[] or not to be an entire bee,
653 \item[]
654 \begin{DUlineblock}{\DUlineblockindent}
655 \item[] when half the bee is not a bee,
656 \item[]
657 \begin{DUlineblock}{\DUlineblockindent}
658 \item[] due to some ancient injury?
659 \item[]
660 \end{DUlineblock}
661 \end{DUlineblock}
662 \end{DUlineblock}
663 \item[] Singing…
664 \end{DUlineblock}
666 \end{quote}
668 A line block, like the following poem by Christian Morgenstern, can
669 also be centre-aligned:
671 \begin{DUlineblock}{0em}
672 \foreignlanguage{german}{\DUrole{align-center}{
673 \item[] \textbf{Die Trichter}
674 \item[]
675 \item[] Zwei Trichter wandeln durch die Nacht.
676 \item[] Durch ihres Rumpfs verengten Schacht
677 \item[] fließt weißes Mondlicht
678 \item[] still und heiter
679 \item[] auf   ihren
680 \item[] Waldweg
681 \item[] u. s.
682 \item[] w.
683 \item[]
685 \end{DUlineblock}
688 \subsection{2.9   Block Quotes%
689 \label{block-quotes}%
692 Block quotes consist of indented body elements:
694 \begin{quote}
696 My theory by A. Elk. Brackets Miss, brackets. This theory goes
697 as follows and begins now. All brontosauruses are thin at one
698 end, much much thicker in the middle and then thin again at the
699 far end. That is my theory, it is mine, and belongs to me and I
700 own it, and what it is too.
701 \nopagebreak
703 \raggedleft —Anne Elk (Miss)
705 \end{quote}
707 The language of a quote (like any other object) can be specified by
708 a class attribute:
712 \begin{quote}
713 \foreignlanguage{french}{
714 ReStructuredText est un langage de balisage léger utilisé
715 notamment dans la documentation du langage Python.
717 \end{quote}
720 \subsection{2.10   Doctest Blocks%
721 \label{doctest-blocks}%
724 \begin{quote}
725 \begin{alltt}
726 >>> print 'Python-specific usage examples; begun with ">>>"'
727 Python-specific usage examples; begun with ">>>"
728 >>> print '(cut and pasted from interactive Python sessions)'
729 (cut and pasted from interactive Python sessions)
730 \end{alltt}
731 \end{quote}
734 \subsection{2.11   Footnotes%
735 \label{footnotes}%
738 \DUfootnotetext{id8}{id1}{1}{%
739 A footnote contains body elements, consistently indented by at
740 least 3 spaces.
742 This is the footnote’s second paragraph.
745 \DUfootnotetext{label}{id3}{2}{\phantomsection\label{label}%
746 Footnotes may be numbered, either manually (as in\DUfootnotemark{id9}{id8}{1}) or
747 automatically using a “\#”-prefixed label. This footnote has a
748 label so it can be referred to from multiple places, both as a
749 footnote reference (\DUfootnotemark{id10}{label}{2}) and as a \hyperref[label]{hyperlink reference}.
752 \DUfootnotetext{id12}{id2}{3}{%
753 This footnote is numbered automatically and anonymously using a
754 label of “\#” only.
756 This is the second paragraph.
758 And this is the third paragraph.
761 \DUfootnotetext{id13}{id4}{*}{%
762 Footnotes may also use symbols, specified with a “*” label.
763 Here’s a reference to the next footnote:\DUfootnotemark{id14}{id15}{}.
766 \DUfootnotetext{id15}{id14}{}{%
767 This footnote shows the next symbol in the sequence.
770 \DUfootnotetext{id16}{id16}{4}{%
771 Here’s an unreferenced footnote, with a reference to a
772 nonexistent footnote:%
773 \raisebox{1em}{\hypertarget{id45}{}}%
774 \raisebox{1em}{\hypertarget{id17}{}}\hyperlink{id44}{\textbf{\color{red}{[}5{]}\_}}.
778 \subsection{2.12   Citations%
779 \label{citations}%
781 \begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
782 Citations are text-labeled footnotes. They may be
783 rendered separately and differently from footnotes.
784 \end{figure}
786 Here’s a reference to the above, \hyperlink{cit2002}{[CIT2002]}, and a %
787 \raisebox{1em}{\hypertarget{id47}{}}%
788 \raisebox{1em}{\hypertarget{id19}{}}\hyperlink{id46}{\textbf{\color{red}{[}nonexistent{]}\_}}
789 citation.
792 \subsection{2.13   Targets%
793 \label{targets}%
794 \label{another-target}%
797 \phantomsection\label{example}
798 This paragraph is pointed to by the explicit “example” target. A
799 reference can be found under \hyperref[inline-markup]{Inline Markup}, above. \hyperref[inline-hyperlink-targets]{Inline
800 hyperlink targets} are also possible.
802 Section headers are implicit targets, referred to by name. See
803 \hyperref[targets]{Targets}, which is a subsection of \hyperref[body-elements]{Body Elements}.
805 Explicit external targets are interpolated into references such as
806 \href{http://www.python.org/}{Python}\DUfootnotemark{id31}{id29}{5}”.
808 Targets may be indirect and anonymous. Thus \hyperref[targets]{this phrase} may also
809 refer to the \hyperref[targets]{Targets} section.
811 Here’s a %
812 \raisebox{1em}{\hypertarget{id49}{}}\hyperlink{id48}{\textbf{\color{red}`hyperlink reference without a target`\_}}, which generates an
813 error.
816 \subsubsection{2.13.1   Duplicate Target Names%
817 \label{duplicate-target-names}%
820 Duplicate names in section headers or other implicit targets will
821 generate “info” (level-1) system messages. Duplicate names in
822 explicit targets will generate “warning” (level-2) system messages.
825 \subsubsection{2.13.2   Duplicate Target Names%
826 \label{id21}%
829 Since there are two “Duplicate Target Names” section headers, we
830 cannot uniquely refer to either of them by name. If we try to (like
831 this: %
832 \raisebox{1em}{\hypertarget{id51}{}}\hyperlink{id50}{\textbf{\color{red}`Duplicate Target Names`\_}}), an error is generated.
835 \subsection{2.14   Directives%
836 \label{directives}%
839 \phantomsection\label{contents}
840 These are just a sample of the many reStructuredText Directives. For
841 others, please see
842 \url{http://docutils.sourceforge.net/docs/ref/rst/directives.html}.
845 \subsubsection{2.14.1   Document Parts%
846 \label{document-parts}%
849 An example of the “contents” directive can be seen above this section
850 (a local, untitled table of \hyperref[contents]{contents}) and at the beginning of the
851 document (a document-wide \hyperref[table-of-contents]{table of contents}).
854 \subsubsection{2.14.2   Images and Figures%
855 \label{images-and-figures}%
858 An image directive (also clickable – a hyperlink reference):
860 \hyperref[directives]{\includegraphics{../../../docs/user/rst/images/title.png}}
862 Image with multiple IDs:
864 \includegraphics{../../../docs/user/rst/images/title.png}
865 \phantomsection\label{image-target-3}\label{image-target-2}\label{image-target-1}
867 A centered image:
869 \noindent\makebox[\linewidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
871 A left-aligned image:
873 \noindent{\includegraphics{../../../docs/user/rst/images/biohazard.png}\hfill}
875 This paragraph might flow around the image.
876 The specific behavior depends upon the style sheet and
877 the browser or rendering software used.
879 A right-aligned image:
881 \noindent{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png}}
883 This paragraph might flow around the image.
884 The specific behavior depends upon the style sheet and
885 the browser or rendering software used.
887 For inline images see \hyperref[substitution-definitions]{Substitution Definitions}.
889 Image size:
891 An image 2 em wide:
893 \includegraphics[width=2em]{../../../docs/user/rst/images/biohazard.png}
895 An image 2 em wide and 15 pixel high:
897 \includegraphics[height=15\pdfpxdimen,width=2em]{../../../docs/user/rst/images/biohazard.png}
899 An image occupying 50\% of the line width:
901 \includegraphics[width=0.500\linewidth]{../../../docs/user/rst/images/title.png}
903 An image 2 cm high:
905 \includegraphics[height=2cm]{../../../docs/user/rst/images/biohazard.png}
907 A \emph{figure} is an image with a caption and/or a legend. With page-based output
908 media, figures might float to a different position if this helps the page
909 layout.
911 \begin{figure}
912 \noindent\makebox[\linewidth][c]{\includegraphics[width=258bp]{../../../docs/user/rst/images/title.png}}
913 \caption{Plaintext markup syntax and parser system.}
914 \begin{DUlegend}
915 \setlength{\DUtablewidth}{\linewidth}
916 \begin{longtable*}[c]{|p{0.156\DUtablewidth}|p{0.563\DUtablewidth}|}
917 \hline
921 Revised, revisited, based on ‘re’ module.
923 \hline
925 Structured
927 Structure-enhanced text, structuredtext.
929 \hline
931 Text
933 Well it is, isn’t it?
935 \hline
936 \end{longtable*}
938 This paragraph is also part of the legend.
939 \end{DUlegend}
940 \end{figure}
942 A left-aligned figure:
944 \begin{figure} % align = "left"
945 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
946 \caption{This is the caption.}
947 \begin{DUlegend}
948 This is the legend.
950 The legend may consist of several paragraphs.
951 \end{DUlegend}
952 \end{figure}
954 This paragraph might flow around the figure.
956 The specific behavior depends upon the style sheet and the browser or
957 rendering software used.
959 A centered figure:
961 \begin{figure}
962 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
963 \caption{This is the caption.}
964 \begin{DUlegend}
965 This is the legend.
967 The legend may consist of several paragraphs.
968 \end{DUlegend}
969 \end{figure}
971 This paragraph might flow around the figure.
973 The specific behavior depends upon the style sheet and the browser or
974 rendering software used.
976 A right-aligned figure:
978 \begin{figure} % align = "right"
979 \noindent\makebox[\linewidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
980 \caption{This is the caption.}
981 \begin{DUlegend}
982 This is the legend.
984 The legend may consist of several paragraphs.
985 \end{DUlegend}
986 \end{figure}
988 This paragraph might flow around the figure. The specific behavior depends
989 upon the style sheet and the browser or rendering software used.
992 \subsubsection{2.14.3   Admonitions%
993 \label{admonitions}%
996 \DUadmonition[attention]{
997 \DUtitle[attention]{Attention!}
999 Directives at large.
1002 \DUadmonition[caution]{
1003 \DUtitle[caution]{Caution!}
1005 Don’t take any wooden nickels.
1008 \DUadmonition[danger]{
1009 \DUtitle[danger]{!DANGER!}
1011 Mad scientist at work!
1014 \DUadmonition[error]{
1015 \DUtitle[error]{Error}
1017 Does not compute.
1020 \DUadmonition[hint]{
1021 \DUtitle[hint]{Hint}
1023 It’s bigger than a bread box.
1026 \DUadmonition[important]{
1027 \DUtitle[important]{Important}
1029 \begin{itemize}
1031 \item Wash behind your ears.
1033 \item Clean up your room.
1035 \item Call your mother.
1037 \item Back up your data.
1039 \end{itemize}
1042 \DUadmonition[note]{
1043 \DUtitle[note]{Note}
1045 This is a note.
1048 \DUadmonition[tip]{
1049 \DUtitle[tip]{Tip}
1051 15\% if the service is good.
1054 \DUadmonition[warning]{
1055 \DUtitle[warning]{Warning}
1057 Strong prose may provoke extreme mental exertion.
1058 Reader discretion is strongly advised.
1061 \DUadmonition[admonition-and-by-the-way]{
1062 \DUtitle[admonition-and-by-the-way]{And, by the way…}
1064 You can make up your own admonition too.
1068 \subsubsection{2.14.4   Topics, Sidebars, and Rubrics%
1069 \label{topics-sidebars-and-rubrics}%
1072 \emph{Sidebars} are like miniature, parallel documents.
1074 \DUsidebar{
1075 \DUtitle[title]{Sidebar Title}
1077 \DUsubtitle[sidebar]{Optional Subtitle}
1079 This is a sidebar. It is for text outside the flow of the main
1080 text.
1082 \DUrubric{This is a rubric inside a sidebar}
1084 Sidebars often appear beside the main text with a border and a different
1085 background or font color.
1088 A \emph{topic} is like a block quote with a title, or a self-contained section
1089 with no subsections.
1091 \DUtopic[]{
1092 \DUtitle[title]{Topic Title}
1094 This is a topic.
1097 A \emph{rubric} is like an informal heading that doesn’t correspond to the
1098 document’s structure. It is typically highlighted in red (hence the name).
1100 \DUrubric{This is a rubric}
1102 Topics and rubrics can be used at places where a \hyperref[section-title]{section title} is not
1103 allowed (e.g. inside a directive).
1106 \subsubsection{2.14.5   Target Footnotes%
1107 \label{target-footnotes}%
1110 \DUfootnotetext{id29}{id30}{5}{%
1111 \url{http://www.python.org/}
1114 \DUfootnotetext{id33}{id34}{6}{%
1115 \url{http://pygments.org/}
1118 \DUfootnotetext{id35}{id36}{7}{%
1119 \url{http://ctan.org/pkg/polyglossia}
1122 \DUfootnotetext{id38}{id39}{8}{%
1123 \url{http://docutils.sourceforge.net/}
1126 \DUfootnotetext{id40}{id41}{9}{%
1127 \url{A:DOS\\path\\}
1131 \subsubsection{2.14.6   Replacement Text%
1132 \label{replacement-text}%
1135 I recommend you try \href{http://www.python.org/}{Python, \emph{the} best language around}\DUfootnotemark{id32}{id29}{5}.
1138 \subsubsection{2.14.7   Compound Paragraph%
1139 \label{compound-paragraph}%
1142 Compound 1, paragraph 1.
1144 Compound 1, paragraph 2.
1146 \begin{itemize}
1148 \item Compound 1, list item one.
1150 \item Compound 1, list item two.
1152 \end{itemize}
1154 Another compound statement:
1156 Compound 2, a literal block:
1158 \begin{quote}
1159 \begin{alltt}
1160 Compound 2, literal.
1161 \end{alltt}
1162 \end{quote}
1163 Compound 2, this is a test.
1165 Compound 3, only consisting of one paragraph.
1167 \begin{quote}
1168 \begin{alltt}
1169 Compound 4.
1170 This one starts with a literal block.
1171 \end{alltt}
1172 \end{quote}
1173 Compound 4, a paragraph.
1175 Now something \emph{really} perverted – a nested compound block. This is
1176 just to test that it works at all; the results don’t have to be
1177 meaningful.
1179 Compound 5, block 1 (a paragraph).
1181 Compound 6, block 2 in compound 5.
1183 Compound 6, another paragraph.
1185 Compound 5, block 3 (a paragraph).
1187 Compound 7, with a table inside:
1189 \setlength{\DUtablewidth}{\linewidth}
1190 \begin{longtable*}[c]{|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|}
1191 \hline
1193 Left cell, first
1194 paragraph.
1196 Left cell, second
1197 paragraph.
1199 Middle cell,
1200 consisting of
1201 exactly one
1202 paragraph.
1204 Right cell.
1206 Paragraph 2.
1208 Paragraph 3.
1210 \hline
1211 \end{longtable*}
1212 Compound 7, a paragraph after the table.
1214 Compound 7, another paragraph.
1217 \subsubsection{2.14.8   Parsed Literal Blocks%
1218 \label{parsed-literal-blocks}%
1221 \begin{quote}
1222 {\ttfamily \raggedright \noindent
1223 This~is~a~parsed~literal~block.\\
1224 ~~~~This~line~is~indented.~~The~next~line~is~blank.\\
1226 Inline~markup~is~supported,~e.g.~\emph{emphasis},~\textbf{strong},~\texttt{literal\\
1227 text},~\textsubscript{sub-}~and~\textsuperscript{super}scripts,\\
1228 inline~formulas:~$A = 2 \pi r^2$,\\
1229 footnotes\DUfootnotemark{id22}{id8}{1},~%
1230 \phantomsection\label{hyperlink-targets}hyperlink~targets,~and~\href{http://www.python.org/}{references}.
1232 \end{quote}
1235 \subsubsection{2.14.9   Code%
1236 \label{code}%
1239 Blocks of source code can be set with the \DUroletitlereference{code} directive. If the code
1240 language is specified, the content is parsed and tagged by the \href{http://pygments.org/}{Pygments}\DUfootnotemark{id34}{id33}{6}
1241 syntax highlighter and can be formatted with a style sheet. (Code parsing
1242 is turned off using the \texttt{syntax-highlight} config setting in the test
1243 conversions in order to get identical results with/without installed
1244 Pygments highlighter.)
1246 \begin{quote}
1247 \begin{alltt}
1248 print 'This is Python code.'
1249 \end{alltt}
1250 \end{quote}
1252 The \texttt{:number-lines:} option (with optional start value) generates line
1253 numbers:
1255 \begin{quote}
1256 {\ttfamily \raggedright \noindent
1257 \DUrole{ln}{~8~}\#~print~integers~from~0~to~9:\\
1258 \DUrole{ln}{~9~}for~i~in~range(10):\\
1259 \DUrole{ln}{10~}~~~~print~i
1261 \end{quote}
1263 For inline code snippets, there is the \DUroletitlereference{code} role, which can be used
1264 directly (the code will not be parsed/tagged, as the language is not known)
1265 or as base for special code roles, e.g. the LaTeX code in the next
1266 paragraph.
1268 Docutils uses LaTeX syntax for math directives and roles:
1269 \texttt{\DUrole{code}{\DUrole{tex}{\textbackslash{}alpha = f(x)}}} prints $\alpha = f(x)$.
1271 The \texttt{:code:} option of the \DUroletitlereference{include} directive sets the included content
1272 as a code block, here the rst file \texttt{header\_footer.txt} with line numbers:
1274 \begin{quote}
1275 {\ttfamily \raggedright \noindent
1276 \DUrole{ln}{1~}..~header::~Document~header\\
1277 \DUrole{ln}{2~}..~footer::~Document~footer
1279 \end{quote}
1282 \subsection{2.15   Substitution Definitions%
1283 \label{substitution-definitions}%
1286 An inline image (\includegraphics{../../../docs/user/rst/images/biohazard.png}) example:
1288 (Substitution definitions are not visible in the HTML source.)
1291 \subsection{2.16   Comments%
1292 \label{comments}%
1295 Here’s one:
1297 % Comments begin with two dots and a space. Anything may
1298 % follow, except for the syntax of footnotes, hyperlink
1299 % targets, directives, or substitution definitions.
1301 % Double-dashes -- "--" -- must be escaped somehow in HTML output.
1303 % Comments may contain non-ASCII characters: ä ö ü æ ø å
1305 (View the HTML source to see the comment.)
1308 \subsection{2.17   Raw text%
1309 \label{raw-text}%
1312 This does not necessarily look nice, because there may be missing white space.
1314 It’s just there to freeze the behavior.
1316 A test.
1318 Second test.
1320 \DUrole{myclass}{Another test with myclass set.}
1322 This is the \DUrole{myrawroleclass}{fourth test} with myrawroleclass set.
1324 Fifth test in LaTeX.\\Line two.
1327 \subsection{2.18   Container%
1328 \label{container}%
1331 paragraph 1
1333 paragraph 2
1335 % currently not implemented in LaTeX:
1336 % .. include:: data/header_footer.txt
1339 \subsection{2.19   Colspanning tables%
1340 \label{colspanning-tables}%
1343 This table has a cell spanning two columns:
1345 \setlength{\DUtablewidth}{\linewidth}
1346 \begin{longtable*}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.086\DUtablewidth}|}
1347 \hline
1348 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1349 Inputs
1350 }} & \textbf{%
1351 Output
1352 } \\
1353 \hline
1354 \textbf{%
1356 } & \textbf{%
1358 } & \textbf{%
1359 A or B
1360 } \\
1361 \hline
1362 \endfirsthead
1363 \hline
1364 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1365 Inputs
1366 }} & \textbf{%
1367 Output
1368 } \\
1369 \hline
1370 \textbf{%
1372 } & \textbf{%
1374 } & \textbf{%
1375 A or B
1376 } \\
1377 \hline
1378 \endhead
1379 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1380 \endfoot
1381 \endlastfoot
1383 False
1385 False
1387 False
1389 \hline
1391 True
1393 False
1395 True
1397 \hline
1399 False
1401 True
1403 True
1405 \hline
1407 True
1409 True
1411 True
1413 \hline
1414 \end{longtable*}
1417 \subsection{2.20   Rowspanning tables%
1418 \label{rowspanning-tables}%
1421 Here’s a table with cells spanning several rows:
1423 \setlength{\DUtablewidth}{\linewidth}
1424 \begin{longtable*}[c]{|p{0.296\DUtablewidth}|p{0.156\DUtablewidth}|p{0.226\DUtablewidth}|}
1425 \hline
1426 \textbf{%
1427 Header row, column 1
1428 (header rows optional)
1429 } & \textbf{%
1430 Header 2
1431 } & \textbf{%
1432 Header 3
1433 } \\
1434 \hline
1435 \endfirsthead
1436 \hline
1437 \textbf{%
1438 Header row, column 1
1439 (header rows optional)
1440 } & \textbf{%
1441 Header 2
1442 } & \textbf{%
1443 Header 3
1444 } \\
1445 \hline
1446 \endhead
1447 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1448 \endfoot
1449 \endlastfoot
1451 body row 1, column 1
1453 column 2
1455 column 3
1457 \hline
1459 body row 2
1460 & \multirow{2}{0.16\DUtablewidth}{%
1461 Cells may
1462 span rows.
1463 } & \multirow{2}{0.23\DUtablewidth}{%
1464 Another
1465 rowspanning
1466 cell.
1467 } \\
1468 \cline{1-1}
1470 body row 3
1471 & \\
1472 \hline
1473 \end{longtable*}
1476 \subsection{2.21   Custom Roles%
1477 \label{custom-roles}%
1480 \begin{itemize}
1482 \item A role based on an existing role.
1484 \texttt{\DUrole{custom}{one}} \texttt{\DUrole{custom}{two}} \texttt{\DUrole{custom}{three}}
1486 \item A new role.
1488 \DUrole{customnew}{one two three}
1490 \item A role with class attribute.
1492 \DUrole{special}{interpreted text}
1494 \item A language-switching role:
1496 Let’s count in German \foreignlanguage{german}{eins zwei drei}.
1498 \item A role with multiple class attributes, styled with raw directives:
1500 \newcommand{\DUrolegreen}[1]{\textcolor{green}{#1}}
1501 \newcommand{\DUrolesc}[1]{\textsc{#1}}
1503 The following works in most browsers but does not validate
1504 (\texttt{<style>} is only allowed in the document head):
1506 \begin{quote}
1507 \begin{alltt}
1508 .. raw:: html
1510 <style type="text/css"><!--
1511 .green \{color: green;\}
1512 .sc \{font-variant: small-caps;\}
1513 --></style>
1514 \end{alltt}
1515 \end{quote}
1517 \DUrole{green}{\DUrole{sc}{\foreignlanguage{british}{British colourful text in small-caps}}}.
1519 \end{itemize}
1522 \section{3   Tests for the LaTeX writer%
1523 \label{tests-for-the-latex-writer}%
1526 Test syntax elements which may cause trouble for the LaTeX writer but might
1527 not need to be tested with other writers (e.g. the HTML writer).
1530 \subsection{3.1   Custom Roles in LaTeX%
1531 \label{custom-roles-in-latex}%
1534 \begin{itemize}
1536 \item Role names and class arguments are converted to conform to the
1537 regular expression \texttt{{[}a-z{]}{[}-a-z0-9{]}*} (letters are downcased,
1538 accents and similar decoration is stripped, non-conforming
1539 characters are replaced by a hyphen).
1541 Class arguments may contain numbers and hyphens, which need special
1542 treatment in LaTeX command names.
1544 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{Interpreted Text}}}}}
1546 \item With LaTeX, roles can be styled within the document using the \DUroletitlereference{raw}
1547 directive.
1549 \newcommand{\DUrolelarge}[1]{{\large #1}}
1550 \makeatletter
1551 \@namedef{DUrolesmall-caps}{\textsc}
1552 \@namedef{DUrolecustom4}{\textbf}
1553 \makeatother
1555 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{Interpreted Text}}}}} in large, bold, small-caps.
1557 \item Custom roles can be based on standard roles:
1559 This is a \emph{\DUrole{custom-emphasis}{customized emphasis text role}}
1561 This is a \texttt{\DUrole{custom-literal}{customized literal text role}}
1563 This is a \textbf{\DUrole{custom-strong}{customized strong text role}}
1565 This is a \textsubscript{\DUrole{custom-subscript}{customized subscript text role}}
1567 This is a \textsuperscript{\DUrole{custom-superscript}{customized superscript text role}}
1569 This is a \DUroletitlereference{\DUrole{custom-title-reference}{customized title-reference text role}}
1571 \end{itemize}
1573 % This file is used by the standalone_rst_latex test.
1576 \subsection{3.2   Option lists%
1577 \label{id23}%
1580 The LaTeX-2e description environment is used for definition lists.
1581 The definition is continued on the same line as the term, this should
1582 not happen if a option-list is at the top of the definition.
1584 If the option list is not at the first element in the definition, it
1585 is contained in a quote
1587 \begin{quote}
1589 \begin{DUoptionlist}
1591 \item[--help] show help
1593 \item[-v] verbose
1595 \end{DUoptionlist}
1597 \end{quote}
1599 \begin{description}
1600 \item[{In a definition list:}] \leavevmode %
1601 \begin{DUoptionlist}
1603 \item[--help] show help
1605 \item[-v] verbose
1607 \end{DUoptionlist}
1609 \end{description}
1612 \subsection{3.3   Monospaced non-alphanumeric characters%
1613 \label{monospaced-non-alphanumeric-characters}%
1616 These are all ASCII characters except a-zA-Z0-9 and space:
1618 \texttt{!!!\textquotedbl{}\textquotedbl{}\textquotedbl{}\#\#\#\$\$\$\%\%\%\&\&\&'''((()))***+++,,,---...///:::}
1620 \texttt{;;;<<<===>>>???@@@{[}{[}{[}\textbackslash{}\textbackslash{}\textbackslash{}{]}{]}{]}\textasciicircum{}\textasciicircum{}\textasciicircum{}\_\_\_```\{\{\{|||\}\}\}\textasciitilde{}\textasciitilde{}\textasciitilde{}}
1622 \texttt{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
1624 The two lines of non-alphanumeric characters should both have the same
1625 width as the third line.
1628 \subsection{3.4   Non-ASCII characters%
1629 \label{non-ascii-characters}%
1632 Punctuation and footnote symbols
1634 \setlength{\DUtablewidth}{\linewidth}
1635 \begin{longtable*}[c]{|p{0.028\DUtablewidth}|p{0.424\DUtablewidth}|}
1636 \hline
1640 en-dash
1642 \hline
1646 em-dash
1648 \hline
1652 single turned comma quotation mark
1654 \hline
1658 single comma quotation mark
1660 \hline
1664 low single comma quotation mark
1666 \hline
1670 double turned comma quotation mark
1672 \hline
1676 double comma quotation mark
1678 \hline
1682 low double comma quotation mark
1684 \hline
1688 dagger
1690 \hline
1694 double dagger
1696 \hline
1700 black diamond suit
1702 \hline
1706 black heart suit
1708 \hline
1712 black spade suit
1714 \hline
1718 black club suit
1720 \hline
1724 ellipsis
1726 \hline
1730 trade mark sign
1732 \hline
1736 left-right double arrow
1738 \hline
1739 \end{longtable*}
1741 The \DUroletitlereference{Latin-1 extended} Unicode block
1743 \setlength{\DUtablewidth}{\linewidth}
1744 \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}|}
1745 \hline
1769 \hline
1772 & &
1778 & &
1789 \hline
1813 \hline
1837 \hline
1861 \hline
1885 \hline
1909 \hline
1933 \hline
1957 \hline
1981 \hline
1996 & & & & \\
1997 \hline
1998 \end{longtable*}
2000 \begin{itemize}
2002 \item The following line should not be wrapped, because it uses
2003 no-break spaces (\textbackslash{}u00a0):
2005 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
2007 \item Line wrapping with/without breakpoints marked by soft hyphens
2008 (\textbackslash{}u00ad):
2010 pdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-sch
2012 pdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrisch
2014 \item The currency sign (\textbackslash{}u00a4) is not supported by all fonts
2015 (some have an Euro sign at its place). You might see an error
2016 like:
2018 \begin{quote}
2019 \begin{alltt}
2020 ! Package textcomp Error: Symbol \textbackslash{}textcurrency not provided by
2021 (textcomp) font family ptm in TS1 encoding.
2022 (textcomp) Default family used instead.
2023 \end{alltt}
2024 \end{quote}
2026 (which in case of font family ptm is a false positive). Add either
2028 \begin{DUfieldlist}
2029 \item[{warn:}]
2030 turn the error in a warning, use the default symbol (bitmap), or
2032 \item[{force,almostfull:}]
2033 use the symbol provided by the font at the users
2034 risk,
2036 \end{DUfieldlist}
2038 to the document options or use a different font package.
2040 \end{itemize}
2043 \subsection{3.5   Encoding special chars%
2044 \label{encoding-special-chars}%
2047 The LaTeX Info pages lists under “2.18 Special Characters”
2049 \begin{quote}
2051 The following characters play a special role in LaTeX and are called
2052 “special printing characters”, or simply “special characters”.
2054 \begin{quote}
2056 \# \$ \% \& \textasciitilde{} \_ \textasciicircum{} \textbackslash{} \{ \}
2058 \end{quote}
2060 \end{quote}
2062 The special chars verbatim:
2064 \begin{quote}
2065 \begin{alltt}
2066 # $ % & ~ _ ^ \textbackslash{} \{ \}
2067 \end{alltt}
2068 \end{quote}
2070 However also \emph{square brackets} {[}{]} need special care.
2072 \begin{quote}
2074 Commands with optional arguments (e.g. \texttt{\textbackslash{}item}) check
2075 if the token right after the macro name is an opening bracket.
2076 In that case the contents between that bracket and the following
2077 closing bracket on the same grouping level are taken as the
2078 optional argument. What makes this unintuitive is the fact that
2079 the square brackets aren’t grouping characters themselves, so in
2080 your last example item{[}{[}{]}{]} the optional argument consists of
2081 {[}… (without the closing bracket).
2083 \end{quote}
2085 Compare the items in the following lists:
2087 \begin{itemize}
2089 \item simple item
2091 \item {[}bracketed{]} item
2093 \end{itemize}
2095 \begin{description}
2096 \item[{simple}] \leavevmode
2097 description term
2099 \item[{{[}bracketed{]}}] \leavevmode
2100 description term
2102 \end{description}
2104 The OT1 font-encoding has different characters for the less-than,
2105 greater-than and bar, < | >, except for typewriter font \DUroletitlereference{cmtt}:
2107 \begin{quote}
2108 \begin{alltt}
2109 < | >
2110 \end{alltt}
2111 \end{quote}
2114 \subsection{3.6   Hyperlinks and -targets%
2115 \label{hyperlinks-and-targets}%
2118 In LaTeX, we must set an explicit anchor (\texttt{\textbackslash{}phantomsection}) for a
2120 \phantomsection\label{hypertarget-in-plain-text}hypertarget in plain text or in a figure but not in a longtable or
2121 caption:
2123 \setlength{\DUtablewidth}{\linewidth}
2124 \begin{longtable}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
2125 \caption{Table with %
2126 \label{hypertarget-in-table-title}hypertarget in table title.}\\
2127 \hline
2129 False
2131 True
2133 None
2135 \hline
2136 \end{longtable}
2137 \label{table-label}
2139 \begin{figure}
2140 \phantomsection\label{figure-label}
2141 \noindent\makebox[\linewidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
2142 \caption{Figure with %
2143 \label{hypertarget-in-figure-caption}hypertarget in figure caption.}
2144 \begin{DUlegend}
2145 Legend with %
2146 \phantomsection\label{hypertarget-in-figure-legend}hypertarget in figure legend.
2147 \end{DUlegend}
2148 \end{figure}
2150 \includegraphics{../../../docs/user/rst/images/biohazard.png}
2151 \phantomsection\label{image-label}
2153 See \hyperref[hypertarget-in-plain-text]{hypertarget in plain text},
2154 \hyperref[table-label]{table label}, \hyperref[hypertarget-in-table-title]{hypertarget in table title},
2155 \hyperref[figure-label]{figure label}, \hyperref[hypertarget-in-figure-caption]{hypertarget in figure caption},
2156 \hyperref[hypertarget-in-figure-legend]{hypertarget in figure legend}, and
2157 \hyperref[image-label]{image label}.
2160 \subsection{3.7   External references%
2161 \label{external-references}%
2164 Long URLs should be wrapped in the PDF.
2165 This can be achieved with the url command which is used by the LaTeX writer
2166 whenever the content (name) of a reference node equals the link URL.
2168 \begin{description}
2169 \item[{Example:}] \leavevmode
2170 a long URL that should wrap in the output
2171 \url{http://docutils.sourceforge.net/docs/user/latex.html\#id79}
2173 \end{description}
2175 If the argument contains any “\%”, “\#”, or “\textasciicircum{}\textasciicircum{}”, or ends with \texttt{\textbackslash{}}, it can’t
2176 be used in the argument to another command. The argument must not contain
2177 unbalanced braces.
2179 The characters \textasciicircum{}, \{, \}, and \texttt{\textbackslash{}} are invalid in a “http:” or “ftp:” URL
2180 and not recognized as part of it:
2182 \begin{DUlineblock}{0em}
2183 \item[] \url{http://www.example.org}/strange\textasciicircum{}\textasciicircum{}name
2184 \item[] \url{http://www.example.org}\textbackslash{}using\textbackslash{}DOS\textbackslash{}paths\textbackslash{}
2185 \item[] \url{http://www.example.org/XML}/strange\{n\}ame
2186 \end{DUlineblock}
2188 They can, however be used in paths and/or filenames.
2190 Handling by the LaTeX writer:
2192 \begin{itemize}
2194 \item \texttt{\#}, \texttt{\textbackslash{}} and \texttt{\%} are escaped:
2196 \begin{DUlineblock}{0em}
2197 \item[] \href{http://www.w3.org/XML/Schema\#dev}{URL with \#}
2198 \url{http://www.w3.org/XML/Schema\#dev}
2199 \item[] \href{http://www.w3.org/XML/Schema\%dev}{URL with \%}
2200 \url{http://example.org/Schema\%dev}
2201 \item[] \href{A:DOS\\path\\}{file with DOS path}\DUfootnotemark{id41}{id40}{9} \url{A:DOS\\path\\}\DUfootnotemark{id42}{id40}{9}
2202 \end{DUlineblock}
2204 \DUadmonition[note]{
2205 \DUtitle[note]{Note}
2207 These URLs are typeset inside a LaTeX command without error.
2209 \begin{DUlineblock}{0em}
2210 \item[] \url{http://www.w3.org/XML/Schema\#dev}
2211 \item[] \url{http://example.org/Schema\%dev}
2212 \item[] \url{A:DOS\\path\\}\DUfootnotemark{id43}{id40}{9}
2213 \end{DUlineblock}
2216 \end{itemize}
2218 \begin{itemize}
2220 \item \textasciicircum{}\textasciicircum{} LaTeX’s special syntax for characters results in “strange” replacements
2221 (both with href and url). A warning is given.
2223 \href{../strange^^name}{file with \textasciicircum{}\textasciicircum{}}:
2224 \url{../strange^^name}
2226 \item Unbalanced braces, \{ or \}, will fail (both with href and url):
2228 \begin{quote}
2229 \begin{alltt}
2230 `file with \{ <../strange\{name>`__
2231 `<../strange\{name>`__
2232 \end{alltt}
2233 \end{quote}
2235 while balanced braces are suported:
2237 \begin{DUlineblock}{0em}
2238 \item[] \url{../strange{n}ame}
2239 \item[] \url{../st{r}ange{n}ame}
2240 \item[] \url{../{st{r}ange{n}ame}}
2241 \end{DUlineblock}
2243 \end{itemize}
2246 \subsection{3.8   Section titles with \hyperref[inline-markup]{inline markup}%
2247 \label{section-titles-with-inline-markup}%
2251 \subsubsection{3.8.1   \emph{emphasized}, H\textsubscript{2}O and $x^2$%
2252 \label{emphasized-h2o-and-x-2}%
2256 \subsubsection{3.8.2   Substitutions work%
2257 \label{substitutions-fail}%
2261 \subsection{3.9   Deeply nested sections%
2262 \label{deeply-nested-sections}%
2265 In LaTeX and HTML,
2268 \subsubsection{3.9.1   Level 3%
2269 \label{level-3}%
2272 nested sections
2275 \paragraph{3.9.1.1   level 4%
2276 \label{level-4}%
2279 reach at some level
2282 \subparagraph{3.9.1.1.1   level 5%
2283 \label{level-5}%
2286 (depending on the document class)
2289 \DUtitle[sectionVI]{3.9.1.1.1.1   level 6%
2290 \label{level-6}%
2293 an unsupported level.
2296 \section{4   Tests for the XeTeX writer%
2297 \label{tests-for-the-xetex-writer}%
2300 With XeTeX, you can typeset text in any language/script supported by
2301 Unicode and the selected font, e.g. Azərbaycanca, Bân-lâm-gú, Башҡорт
2302 Беларуская, Български, Català, Чӑвашла, Česky, Ελληνικά, Español,
2303 Français, Føroyskt, Хальмг, Íslenska, עברית , Қазақша, Kurdî,
2304 Latviešu, Lietuvių, Македонски, Монгол, Nāhuatl, Português, Română,
2305 Русский, Slovenščina, Српски, Türkçe, Українська, Tiếng Việt, Volapük,
2306 Võro, ייִדיש , Žemaitėška.
2307 Currently, there is extended support for 28 languages in the
2308 \href{http://ctan.org/pkg/polyglossia}{polyglossia}\DUfootnotemark{id36}{id35}{7} package.
2310 % System Messages:
2313 \section{5   Error Handling%
2314 \label{error-handling}%
2317 Any errors caught during processing will generate system messages.
2319 There should be five messages in the following, auto-generated
2320 section, “Docutils System Messages”:
2322 % section should be added by Docutils automatically
2325 \section[Docutils System Messages]{\color{red}Docutils System Messages%
2328 \DUadmonition[system-message]{
2329 \DUtitle[system-message]{system-message}
2330 \raisebox{1em}{\hypertarget{id27}{}}
2332 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~104
2334 \hyperlink{id28}{
2335 Undefined substitution referenced: \textquotedbl{}problematic\textquotedbl{}.
2338 \DUadmonition[system-message]{
2339 \DUtitle[system-message]{system-message}
2340 \raisebox{1em}{\hypertarget{id44}{}}
2342 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~391
2344 \hyperlink{id45}{
2345 Unknown target name: \textquotedbl{}5\textquotedbl{}.
2348 \DUadmonition[system-message]{
2349 \DUtitle[system-message]{system-message}
2350 \raisebox{1em}{\hypertarget{id46}{}}
2352 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~400
2354 \hyperlink{id47}{
2355 Unknown target name: \textquotedbl{}nonexistent\textquotedbl{}.
2358 \DUadmonition[system-message]{
2359 \DUtitle[system-message]{system-message}
2360 \raisebox{1em}{\hypertarget{id48}{}}
2362 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~427
2364 \hyperlink{id49}{
2365 Unknown target name: \textquotedbl{}hyperlink reference without a target\textquotedbl{}.
2368 \DUadmonition[system-message]{
2369 \DUtitle[system-message]{system-message}
2370 \raisebox{1em}{\hypertarget{id50}{}}
2372 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~440
2374 \hyperlink{id51}{
2375 Duplicate target name, cannot be used as a unique reference: \textquotedbl{}duplicate target names\textquotedbl{}.
2378 \end{document}