Change default of "syntax highlight" option to "long",
[docutils.git] / test / functional / expected / standalone_rst_xetex.tex
blobd3ab640f050ba69ba26f9aba20e1ad09cb665f19
1 \documentclass[a4paper]{article}
2 % generated by Docutils <http://docutils.sourceforge.net/>
3 % rubber: set program xelatex
4 \usepackage[no-sscript]{xltxtra} % loads fixltx2e, metalogo, xunicode, fontspec
5 % \defaultfontfeatures{Scale=MatchLowercase}
6 \usepackage{ifthen}
7 \usepackage{amsmath}
8 \usepackage{polyglossia}
9 \setdefaultlanguage{english}
10 \setotherlanguages{british,french,german}
11 % basic code highlight:
12 \providecommand*\DUrolecomment[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
13 \providecommand*\DUroledeleted[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
14 \providecommand*\DUrolekeyword[1]{\textbf{#1}}
15 \providecommand*\DUrolestring[1]{\textit{#1}}
16 \usepackage{color}
17 \usepackage{float} % float configuration
18 \floatplacement{figure}{H} % place figures here definitely
19 \usepackage{graphicx}
20 \usepackage{multirow}
21 \setcounter{secnumdepth}{0}
22 \usepackage{longtable,ltcaption,array}
23 \setlength{\extrarowheight}{2pt}
24 \newlength{\DUtablewidth} % internal use in tables
25 \usepackage{tabularx}
27 %%% Custom LaTeX preamble
28 % Linux Libertine (free, wide coverage, not only for Linux)
29 \setmainfont{Linux Libertine O}
30 \setsansfont{Linux Biolinum O}
31 \setmonofont[HyphenChar=None]{DejaVu Sans Mono}
33 %%% User specified packages and stylesheets
35 %%% Fallback definitions for Docutils-specific commands
37 % providelength (provide a length variable and set default, if it is new)
38 \providecommand*{\DUprovidelength}[2]{
39 \ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{}
42 % abstract title
43 \providecommand*{\DUtitleabstract}[1]{\centerline{\textbf{#1}}}
45 % admonition (specially marked topic)
46 \providecommand{\DUadmonition}[2][class-arg]{%
47 % try \DUadmonition#1{#2}:
48 \ifcsname DUadmonition#1\endcsname%
49 \csname DUadmonition#1\endcsname{#2}%
50 \else
51 \begin{center}
52 \fbox{\parbox{0.9\textwidth}{#2}}
53 \end{center}
54 \fi
57 \makeatletter
58 \@namedef{DUrolealign-center}{\centering}
59 \makeatother
62 % dedication topic
63 \providecommand{\DUtopicdedication}[1]{\begin{center}#1\end{center}}
65 % docinfo (width of docinfo table)
66 \DUprovidelength{\DUdocinfowidth}{0.9\textwidth}
68 % error admonition title
69 \providecommand*{\DUtitleerror}[1]{\DUtitle{\color{red}#1}}
71 % fieldlist environment
72 \ifthenelse{\isundefined{\DUfieldlist}}{
73 \newenvironment{DUfieldlist}%
74 {\quote\description}
75 {\enddescription\endquote}
76 }{}
77 % numeric or symbol footnotes with hyperlinks
78 \providecommand*{\DUfootnotemark}[3]{%
79 \raisebox{1em}{\hypertarget{#1}{}}%
80 \hyperlink{#2}{\textsuperscript{#3}}%
82 \providecommand{\DUfootnotetext}[4]{%
83 \begingroup%
84 \renewcommand{\thefootnote}{%
85 \protect\raisebox{1em}{\protect\hypertarget{#1}{}}%
86 \protect\hyperlink{#2}{#3}}%
87 \footnotetext{#4}%
88 \endgroup%
91 % inline markup (custom roles)
92 % \DUrole{#1}{#2} tries \DUrole#1{#2}
93 \providecommand*{\DUrole}[2]{%
94 \ifcsname DUrole#1\endcsname%
95 \csname DUrole#1\endcsname{#2}%
96 \else% backwards compatibility: try \docutilsrole#1{#2}
97 \ifcsname docutilsrole#1\endcsname%
98 \csname docutilsrole#1\endcsname{#2}%
99 \else%
101 \fi%
102 \fi%
105 % legend environment
106 \ifthenelse{\isundefined{\DUlegend}}{
107 \newenvironment{DUlegend}{\small}{}
110 % lineblock environment
111 \DUprovidelength{\DUlineblockindent}{2.5em}
112 \ifthenelse{\isundefined{\DUlineblock}}{
113 \newenvironment{DUlineblock}[1]{%
114 \list{}{\setlength{\partopsep}{\parskip}
115 \addtolength{\partopsep}{\baselineskip}
116 \setlength{\topsep}{0pt}
117 \setlength{\itemsep}{0.15\baselineskip}
118 \setlength{\parsep}{0pt}
119 \setlength{\leftmargin}{#1}}
120 \raggedright
122 {\endlist}
125 % optionlist environment
126 \providecommand*{\DUoptionlistlabel}[1]{\bf #1 \hfill}
127 \DUprovidelength{\DUoptionlistindent}{3cm}
128 \ifthenelse{\isundefined{\DUoptionlist}}{
129 \newenvironment{DUoptionlist}{%
130 \list{}{\setlength{\labelwidth}{\DUoptionlistindent}
131 \setlength{\rightmargin}{1cm}
132 \setlength{\leftmargin}{\rightmargin}
133 \addtolength{\leftmargin}{\labelwidth}
134 \addtolength{\leftmargin}{\labelsep}
135 \renewcommand{\makelabel}{\DUoptionlistlabel}}
137 {\endlist}
140 \DUprovidelength{\pdfpxdimen}{1bp}
143 % rubric (informal heading)
144 \providecommand*{\DUrubric}[2][class-arg]{%
145 \subsubsection*{\centering\textit{\textmd{#2}}}}
147 % sidebar (text outside the main text flow)
148 \providecommand{\DUsidebar}[2][class-arg]{%
149 \begin{center}
150 \colorbox[gray]{0.80}{\parbox{0.9\textwidth}{#2}}
151 \end{center}
154 % subtitle (for topic/sidebar)
155 \providecommand*{\DUsubtitle}[2][class-arg]{\par\emph{#2}\smallskip}
157 % title for topics, admonitions, unsupported section levels, and sidebar
158 \providecommand*{\DUtitle}[2][class-arg]{%
159 % call \DUtitle#1{#2} if it exists:
160 \ifcsname DUtitle#1\endcsname%
161 \csname DUtitle#1\endcsname{#2}%
162 \else
163 \smallskip\noindent\textbf{#2}\smallskip%
167 % titlereference role
168 \providecommand*{\DUroletitlereference}[1]{\textsl{#1}}
170 % topic (quote with heading)
171 \providecommand{\DUtopic}[2][class-arg]{%
172 \ifcsname DUtopic#1\endcsname%
173 \csname DUtopic#1\endcsname{#2}%
174 \else
175 \begin{quote}#2\end{quote}
179 % transition (break, fancybreak, anonymous section)
180 \providecommand*{\DUtransition}[1][class-arg]{%
181 \hspace*{\fill}\hrulefill\hspace*{\fill}
182 \vskip 0.5\baselineskip
185 % hyperlinks:
186 \ifthenelse{\isundefined{\hypersetup}}{
187 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
188 \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
190 \hypersetup{
191 pdftitle={reStructuredText Test Document},
192 pdfauthor={David Goodger;Me;Myself;I}
195 %%% Title Data
196 \title{\phantomsection%
197 reStructuredText Test Document%
198 \label{restructuredtext-test-document}%
199 \label{doctitle}%
200 \\ % subtitle%
201 \large{Examples of Syntax Constructs}%
202 \label{examples-of-syntax-constructs}%
203 \label{subtitle}}
204 \author{}
205 \date{}
207 %%% Body
208 \begin{document}
209 \maketitle
211 % Docinfo
212 \begin{center}
213 \begin{tabularx}{\DUdocinfowidth}{lX}
214 \textbf{Author}: &
215 David Goodger \\
216 \textbf{Address}: &
217 {\raggedright
218 123 Example Street\\
219 Example, EX Canada\\
220 A1B 2C3 } \\
221 \textbf{Contact}: &
222 \href{mailto:goodger@python.org}{goodger@python.org} \\
223 \textbf{Author}: &
224 Me \\
225 \textbf{Author}: &
226 Myself \\
227 \textbf{Author}: &
228 I \\
229 \textbf{Organization}: &
230 humankind \\
231 \textbf{Date}: &
232 Now, or yesterday. Or maybe even \emph{before} yesterday. \\
233 \textbf{Status}: &
234 This is a "work in progress" \\
235 \textbf{Revision}: &
236 is managed by a version control system. \\
237 \textbf{Version}: &
238 1 \\
239 \textbf{Copyright}: &
240 This document has been placed in the public domain. You
241 may do with it as you wish. You may copy, modify,
242 redistribute, reattribute, sell, buy, rent, lease,
243 destroy, or improve it, quote it at length, excerpt,
244 incorporate, collate, fold, staple, or mutilate it, or do
245 anything else to it that your or anyone else's heart
246 desires. \\
247 \textbf{field name}: &
248 This is a "generic bibliographic field".
250 \textbf{field name "2"}: &
251 Generic bibliographic fields may contain multiple body elements.
253 Like this.
255 \end{tabularx}
256 \end{center}
258 \DUtopic[dedication]{
259 \DUtitle[dedication]{Dedication}
261 For Docutils users \& co-developers.
264 \DUtopic[abstract]{
265 \DUtitle[abstract]{Abstract}
267 This is a test document, containing at least one example of each
268 reStructuredText construct.
271 % This is a comment. Note how any initial comments are moved by
272 % transforms to after the document title, subtitle, and docinfo.
274 % Above is the document title, and below is the subtitle.
275 % They are transformed from section titles after parsing.
277 % bibliographic fields (which also require a transform):
279 \pagebreak[4] % start ToC on new page
281 \phantomsection\label{table-of-contents}
282 \pdfbookmark[1]{Table of Contents}{table-of-contents}
283 \renewcommand{\contentsname}{Table of Contents}
284 \tableofcontents
288 \section{1   Structural Elements%
289 \label{structural-elements}%
293 \subsection{1.1   Section Title%
294 \label{section-title}%
296 \subsubsection*{Section Subtitle}
298 Lone subsections are converted to a section subtitle by a transform
299 activated with the \texttt{--section-subtitles} command line option or the
300 \texttt{sectsubtitle-xform} configuration value.
303 \subsection{1.2   Empty Section%
304 \label{empty-section}%
308 \subsection{1.3   Transitions%
309 \label{transitions}%
312 Here's a transition:
315 %___________________________________________________________________________
316 \DUtransition
319 It divides the section. Transitions may also occur between sections:
322 %___________________________________________________________________________
323 \DUtransition
327 \section{2   Body Elements%
328 \label{body-elements}%
332 \subsection{2.1   Paragraphs%
333 \label{paragraphs}%
336 A paragraph.
339 \subsubsection{2.1.1   Inline Markup%
340 \label{inline-markup}%
343 Paragraphs contain text and may contain inline markup: \emph{emphasis},
344 \textbf{strong emphasis}, \texttt{inline literals}, standalone hyperlinks
345 (\url{http://www.python.org}), external hyperlinks (\href{http://www.python.org/}{Python}\DUfootnotemark{id30}{id29}{5}), internal
346 cross-references (\hyperref[example]{example}), external hyperlinks with embedded URIs
347 (\href{http://www.python.org}{Python web site}), \href{http://www.python.org/}{anonymous hyperlink
348 references}\DUfootnotemark{id37}{id29}{5} (\href{http://docutils.sourceforge.net/}{a second reference}\DUfootnotemark{id39}{id38}{8}), footnote references (manually
349 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]}),
350 substitution references (\includegraphics{../../../docs/user/rst/images/biohazard.png}), and %
351 \phantomsection\label{inline-hyperlink-targets}inline hyperlink targets
352 (see \hyperref[targets]{Targets} below for a reference back to here). Character-level
353 inline markup is also possible (although exceedingly ugly!) in \emph{re}\texttt{Structured}\emph{Text}. Problems are indicated by %
354 \raisebox{1em}{\hypertarget{id28}{}}\hyperlink{id27}{\textbf{\color{red}|problematic|}} text
355 (generated by processing errors; this one is intentional). Here is a
356 reference to the \hyperref[doctitle]{doctitle} and the \hyperref[subtitle]{subtitle}.
358 The default role for interpreted text is \DUroletitlereference{Title Reference}. Here are
359 some explicit interpreted text roles: a PEP reference (\href{http://www.python.org/dev/peps/pep-0287}{PEP 287}); an
360 RFC reference (\href{http://www.faqs.org/rfcs/rfc2822.html}{RFC 2822}); an abbreviation (\DUrole{abbreviation}{abb.}), an acronym
361 (\DUrole{acronym}{reST}), code (\texttt{\DUrole{code}{print "hello world"}}); a \textsubscript{subscript};
362 a \textsuperscript{superscript} and explicit roles for \DUroletitlereference{Docutils}'
363 \emph{standard} \textbf{inline} \texttt{markup}.
365 % DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!
367 Let's test wrapping and whitespace significance in inline literals:
368 \texttt{This is an example of --inline-literal --text, --including some--
369 strangely--hyphenated-words. ~Adjust-the-width-of-your-browser-window
370 to see how the text is wrapped. ~-- ---- -------- ~Now note ~ ~the
371 spacing ~ ~between the ~ ~words of ~ ~this sentence ~ ~(words
372 should ~ ~be grouped ~ ~in pairs).}
374 If the \texttt{--pep-references} option was supplied, there should be a
375 live link to PEP 258 here.
378 \subsection{2.2   Bullet Lists%
379 \label{bullet-lists}%
382 \begin{itemize}
384 \item A bullet list
386 \begin{itemize}
388 \item Nested bullet list.
390 \item Nested item 2.
392 \end{itemize}
394 \item Item 2.
396 Paragraph 2 of item 2.
398 \begin{itemize}
400 \item Nested bullet list.
402 \item Nested item 2.
404 \begin{itemize}
406 \item Third level.
408 \item Item 2.
410 \end{itemize}
412 \item Nested item 3.
414 \item This nested list should be compacted by the HTML writer.
416 \phantomsection\label{target}
417 % Even if this item contains a target and a comment.
419 \end{itemize}
421 \end{itemize}
424 \subsection{2.3   Enumerated Lists%
425 \label{enumerated-lists}%
427 \newcounter{listcnt0}
428 \begin{list}{\arabic{listcnt0}.}
430 \usecounter{listcnt0}
431 \setlength{\rightmargin}{\leftmargin}
434 \item Arabic numerals.
435 \newcounter{listcnt1}
436 \begin{list}{\alph{listcnt1})}
438 \usecounter{listcnt1}
439 \setlength{\rightmargin}{\leftmargin}
442 \item lower alpha)
443 \newcounter{listcnt2}
444 \begin{list}{(\roman{listcnt2})}
446 \usecounter{listcnt2}
447 \setlength{\rightmargin}{\leftmargin}
450 \item (lower roman)
451 \newcounter{listcnt3}
452 \begin{list}{\Alph{listcnt3}.}
454 \usecounter{listcnt3}
455 \setlength{\rightmargin}{\leftmargin}
458 \item upper alpha.
459 \newcounter{listcnt4}
460 \begin{list}{\Roman{listcnt4})}
462 \usecounter{listcnt4}
463 \setlength{\rightmargin}{\leftmargin}
466 \item upper roman)
467 \end{list}
468 \end{list}
469 \end{list}
470 \end{list}
472 \item Lists that don't start at 1:
473 \setcounter{listcnt1}{0}
474 \begin{list}{\arabic{listcnt1}.}
476 \usecounter{listcnt1}
477 \addtocounter{listcnt1}{2}
478 \setlength{\rightmargin}{\leftmargin}
481 \item Three
483 \item Four
484 \end{list}
485 \setcounter{listcnt1}{0}
486 \begin{list}{\Alph{listcnt1}.}
488 \usecounter{listcnt1}
489 \addtocounter{listcnt1}{2}
490 \setlength{\rightmargin}{\leftmargin}
493 \item C
495 \item D
496 \end{list}
497 \setcounter{listcnt1}{0}
498 \begin{list}{\roman{listcnt1}.}
500 \usecounter{listcnt1}
501 \addtocounter{listcnt1}{2}
502 \setlength{\rightmargin}{\leftmargin}
505 \item iii
507 \item iv
508 \end{list}
509 \end{list}
512 \subsection{2.4   Definition Lists%
513 \label{definition-lists}%
516 \begin{description}
517 \item[{Term}] \leavevmode
518 Definition
520 \item[{Term}] \leavevmode (\textbf{classifier})
522 Definition paragraph 1.
524 Definition paragraph 2.
526 \item[{Term}] \leavevmode
527 Definition
529 \item[{Term}] \leavevmode (\textbf{classifier one})
530 (\textbf{classifier two})
532 Definition
534 \end{description}
537 \subsection{2.5   Field Lists%
538 \label{field-lists}%
541 \begin{DUfieldlist}
542 \item[{what:}]
543 Field lists map field names to field bodies, like database
544 records. They are often part of an extension syntax. They are
545 an unambiguous variant of RFC 2822 fields.
547 \item[{how arg1 arg2:}]
548 The field marker is a colon, the field name, and a colon.
550 The field body may contain one or more body elements, indented
551 relative to the field marker.
553 \item[{credits:}]
554 \DUrole{credits}{This paragraph has the \DUroletitlereference{credits} class set. (This is actually not
555 about credits but just for ensuring that the class attribute
556 doesn't get stripped away.)}
558 \end{DUfieldlist}
561 \subsection{2.6   Option Lists%
562 \label{option-lists}%
565 For listing command-line options:
567 \begin{DUoptionlist}
569 \item[-a] command-line option "a"
571 \item[-b file] options can have arguments
572 and long descriptions
574 \item[--long] options can be long also
576 \item[--input=file] long options can also have
577 arguments
579 \item[--very-long-option] The description can also start on the next line.
581 The description may contain multiple body elements,
582 regardless of where it starts.
584 \item[-x, -y, -z] Multiple options are an "option group".
586 \item[-v, --verbose] Commonly-seen: short \& long options.
588 \item[-1 file, --one=file, --two file] Multiple options with arguments.
590 \item[/V] DOS/VMS-style options too
592 \end{DUoptionlist}
594 There must be at least two spaces between the option and the
595 description.
598 \subsection{2.7   Literal Blocks%
599 \label{literal-blocks}%
602 Literal blocks are indicated with a double-colon ("::") at the end of
603 the preceding paragraph (over there \texttt{-->}). They can be indented:
605 \begin{quote}{\ttfamily \raggedright \noindent
606 if~literal\_block:\\
607 ~~~~text~=~'is~left~as-is'\\
608 ~~~~spaces\_and\_linebreaks~=~'are~preserved'\\
609 ~~~~markup\_processing~=~None
611 \end{quote}
613 Or they can be quoted without indentation:
615 \begin{quote}{\ttfamily \raggedright \noindent
616 >>~Great~idea!\\
618 >~Why~didn't~I~think~of~that?
620 \end{quote}
623 \subsection{2.8   Line Blocks%
624 \label{line-blocks}%
627 This section tests line blocks. Line blocks are body elements which
628 consist of lines and other line blocks. Nested line blocks cause
629 indentation.
631 \begin{DUlineblock}{0em}
632 \item[] This is a line block. It ends with a blank line.
633 \item[]
634 \begin{DUlineblock}{\DUlineblockindent}
635 \item[] New lines begin with a vertical bar ("|").
636 \item[] Line breaks and initial indent are significant, and preserved.
637 \item[]
638 \begin{DUlineblock}{\DUlineblockindent}
639 \item[] Continuation lines are also possible. A long line that is intended
640 to wrap should begin with a space in place of the vertical bar.
641 \end{DUlineblock}
642 \item[] The left edge of a continuation line need not be aligned with
643 the left edge of the text above it.
644 \end{DUlineblock}
645 \end{DUlineblock}
647 \begin{DUlineblock}{0em}
648 \item[] This is a second line block.
649 \item[]
650 \item[] Blank lines are permitted internally, but they must begin with a "|".
651 \end{DUlineblock}
653 Another line block, surrounded by paragraphs:
655 \begin{DUlineblock}{0em}
656 \item[] And it's no good waiting by the window
657 \item[] It's no good waiting for the sun
658 \item[] Please believe me, the things you dream of
659 \item[] They don't fall in the lap of no-one
660 \end{DUlineblock}
662 Take it away, Eric the Orchestra Leader!
664 \begin{quote}
666 \begin{DUlineblock}{0em}
667 \item[] A one, two, a one two three four
668 \item[]
669 \item[] Half a bee, philosophically,
670 \item[]
671 \begin{DUlineblock}{\DUlineblockindent}
672 \item[] must, \emph{ipso facto}, half not be.
673 \end{DUlineblock}
674 \item[] But half the bee has got to be,
675 \item[]
676 \begin{DUlineblock}{\DUlineblockindent}
677 \item[] \emph{vis a vis} its entity. D'you see?
678 \item[]
679 \end{DUlineblock}
680 \item[] But can a bee be said to be
681 \item[]
682 \begin{DUlineblock}{\DUlineblockindent}
683 \item[] or not to be an entire bee,
684 \item[]
685 \begin{DUlineblock}{\DUlineblockindent}
686 \item[] when half the bee is not a bee,
687 \item[]
688 \begin{DUlineblock}{\DUlineblockindent}
689 \item[] due to some ancient injury?
690 \item[]
691 \end{DUlineblock}
692 \end{DUlineblock}
693 \end{DUlineblock}
694 \item[] Singing...
695 \end{DUlineblock}
697 \end{quote}
699 A line block, like the following poem by Christian Morgenstern, can
700 also be centre-aligned:
702 \begin{DUlineblock}{0em}
703 \otherlanguage{german}{\DUrole{align-center}{
704 \item[] \textbf{Die Trichter}
705 \item[]
706 \item[] Zwei Trichter wandeln durch die Nacht.
707 \item[] Durch ihres Rumpfs verengten Schacht
708 \item[] fließt weißes Mondlicht
709 \item[] still und heiter
710 \item[] auf   ihren
711 \item[] Waldweg
712 \item[] u. s.
713 \item[] w.
714 \item[]
716 \end{DUlineblock}
719 \subsection{2.9   Block Quotes%
720 \label{block-quotes}%
723 Block quotes consist of indented body elements:
725 \begin{quote}
727 My theory by A. Elk. Brackets Miss, brackets. This theory goes
728 as follows and begins now. All brontosauruses are thin at one
729 end, much much thicker in the middle and then thin again at the
730 far end. That is my theory, it is mine, and belongs to me and I
731 own it, and what it is too.
732 \nopagebreak
734 \raggedleft —Anne Elk (Miss)
736 \end{quote}
738 The language of a quote (like any other object) can be specified by
739 a class attribute:
743 \begin{quote}
744 \otherlanguage{french}{
745 ReStructuredText est un langage de balisage léger utilisé
746 notamment dans la documentation du langage Python.
748 \end{quote}
751 \subsection{2.10   Doctest Blocks%
752 \label{doctest-blocks}%
755 \begin{quote}{\ttfamily \raggedright \noindent
756 >>>~print~'Python-specific~usage~examples;~begun~with~">>>"'\\
757 Python-specific~usage~examples;~begun~with~">>>"\\
758 >>>~print~'(cut~and~pasted~from~interactive~Python~sessions)'\\
759 (cut~and~pasted~from~interactive~Python~sessions)
761 \end{quote}
764 \subsection{2.11   Footnotes%
765 \label{footnotes}%
768 \DUfootnotetext{id8}{id1}{1}{%
769 A footnote contains body elements, consistently indented by at
770 least 3 spaces.
772 This is the footnote's second paragraph.
775 \DUfootnotetext{label}{id3}{2}{\phantomsection\label{label}%
776 Footnotes may be numbered, either manually (as in\DUfootnotemark{id9}{id8}{1}) or
777 automatically using a "\#"-prefixed label. This footnote has a
778 label so it can be referred to from multiple places, both as a
779 footnote reference (\DUfootnotemark{id10}{label}{2}) and as a \hyperref[label]{hyperlink reference}.
782 \DUfootnotetext{id12}{id2}{3}{%
783 This footnote is numbered automatically and anonymously using a
784 label of "\#" only.
786 This is the second paragraph.
788 And this is the third paragraph.
791 \DUfootnotetext{id13}{id4}{*}{%
792 Footnotes may also use symbols, specified with a "*" label.
793 Here's a reference to the next footnote:\DUfootnotemark{id14}{id15}{}.
796 \DUfootnotetext{id15}{id14}{}{%
797 This footnote shows the next symbol in the sequence.
800 \DUfootnotetext{id16}{id16}{4}{%
801 Here's an unreferenced footnote, with a reference to a
802 nonexistent footnote:%
803 \raisebox{1em}{\hypertarget{id45}{}}%
804 \raisebox{1em}{\hypertarget{id17}{}}\hyperlink{id44}{\textbf{\color{red}{[}5{]}\_}}.
808 \subsection{2.12   Citations%
809 \label{citations}%
811 \begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
812 Citations are text-labeled footnotes. They may be
813 rendered separately and differently from footnotes.
814 \end{figure}
816 Here's a reference to the above, \hyperlink{cit2002}{[CIT2002]}, and a %
817 \raisebox{1em}{\hypertarget{id47}{}}%
818 \raisebox{1em}{\hypertarget{id19}{}}\hyperlink{id46}{\textbf{\color{red}{[}nonexistent{]}\_}}
819 citation.
822 \subsection{2.13   Targets%
823 \label{targets}%
824 \label{another-target}%
827 \phantomsection\label{example}
828 This paragraph is pointed to by the explicit "example" target. A
829 reference can be found under \hyperref[inline-markup]{Inline Markup}, above. \hyperref[inline-hyperlink-targets]{Inline
830 hyperlink targets} are also possible.
832 Section headers are implicit targets, referred to by name. See
833 \hyperref[targets]{Targets}, which is a subsection of \hyperref[body-elements]{Body Elements}.
835 Explicit external targets are interpolated into references such as
836 "\href{http://www.python.org/}{Python}\DUfootnotemark{id31}{id29}{5}".
838 Targets may be indirect and anonymous. Thus \hyperref[targets]{this phrase} may also
839 refer to the \hyperref[targets]{Targets} section.
841 Here's a %
842 \raisebox{1em}{\hypertarget{id49}{}}\hyperlink{id48}{\textbf{\color{red}`hyperlink reference without a target`\_}}, which generates an
843 error.
846 \subsubsection{2.13.1   Duplicate Target Names%
847 \label{duplicate-target-names}%
850 Duplicate names in section headers or other implicit targets will
851 generate "info" (level-1) system messages. Duplicate names in
852 explicit targets will generate "warning" (level-2) system messages.
855 \subsubsection{2.13.2   Duplicate Target Names%
856 \label{id21}%
859 Since there are two "Duplicate Target Names" section headers, we
860 cannot uniquely refer to either of them by name. If we try to (like
861 this: %
862 \raisebox{1em}{\hypertarget{id51}{}}\hyperlink{id50}{\textbf{\color{red}`Duplicate Target Names`\_}}), an error is generated.
865 \subsection{2.14   Directives%
866 \label{directives}%
869 \phantomsection\label{contents}
870 These are just a sample of the many reStructuredText Directives. For
871 others, please see
872 \url{http://docutils.sourceforge.net/docs/ref/rst/directives.html}.
875 \subsubsection{2.14.1   Document Parts%
876 \label{document-parts}%
879 An example of the "contents" directive can be seen above this section
880 (a local, untitled table of \hyperref[contents]{contents}) and at the beginning of the
881 document (a document-wide \hyperref[table-of-contents]{table of contents}).
884 \subsubsection{2.14.2   Images and Figures%
885 \label{images-and-figures}%
888 An image directive (also clickable -- a hyperlink reference):
890 \hyperref[directives]{\includegraphics{../../../docs/user/rst/images/title.png}}
892 Image with multiple IDs:
894 \includegraphics{../../../docs/user/rst/images/title.png}
895 \phantomsection\label{image-target-3}\label{image-target-2}\label{image-target-1}
897 A centered image:
899 \noindent\makebox[\textwidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
901 A left-aligned image:
903 \noindent{\includegraphics{../../../docs/user/rst/images/biohazard.png}\hfill}
905 This paragraph might flow around the image.
906 The specific behavior depends upon the style sheet and
907 the browser or rendering software used.
909 A right-aligned image:
911 \noindent{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png}}
913 This paragraph might flow around the image.
914 The specific behavior depends upon the style sheet and
915 the browser or rendering software used.
917 For inline images see \hyperref[substitution-definitions]{Substitution Definitions}.
919 Image size:
921 An image 2 em wide:
923 \includegraphics[width=2em]{../../../docs/user/rst/images/biohazard.png}
925 An image 2 em wide and 15 pixel high:
927 \includegraphics[height=15\pdfpxdimen,width=2em]{../../../docs/user/rst/images/biohazard.png}
929 An image occupying 50\% of the line width:
931 \includegraphics[width=0.500\linewidth]{../../../docs/user/rst/images/title.png}
933 An image 2 cm high:
935 \includegraphics[height=2cm]{../../../docs/user/rst/images/biohazard.png}
937 A \emph{figure} is an image with a caption and/or a legend. With page-based output
938 media, figures might float to a different position if this helps the page
939 layout.
940 \begin{figure}
941 \noindent\makebox[\textwidth][c]{\includegraphics[width=258bp]{../../../docs/user/rst/images/title.png}}
942 \caption{Plaintext markup syntax and parser system.}
943 \begin{DUlegend}
944 \setlength{\DUtablewidth}{\linewidth}
945 \begin{longtable*}[c]{|p{0.156\DUtablewidth}|p{0.563\DUtablewidth}|}
946 \hline
950 Revised, revisited, based on 're' module.
952 \hline
954 Structured
956 Structure-enhanced text, structuredtext.
958 \hline
960 Text
962 Well it is, isn't it?
964 \hline
965 \end{longtable*}
967 This paragraph is also part of the legend.
968 \end{DUlegend}
969 \end{figure}
971 A left-aligned figure:
972 \begin{figure}
973 \noindent\makebox[\textwidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
974 \caption{This is the caption.}
975 \begin{DUlegend}
976 This is the legend.
978 The legend may consist of several paragraphs.
979 \end{DUlegend}
980 \end{figure}
982 This paragraph might flow around the figure.
984 The specific behavior depends upon the style sheet and the browser or
985 rendering software used.
987 A centered figure:
988 \begin{figure}
989 \noindent\makebox[\textwidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
990 \caption{This is the caption.}
991 \begin{DUlegend}
992 This is the legend.
994 The legend may consist of several paragraphs.
995 \end{DUlegend}
996 \end{figure}
998 This paragraph might flow around the figure.
1000 The specific behavior depends upon the style sheet and the browser or
1001 rendering software used.
1003 A right-aligned figure:
1004 \begin{figure}
1005 \noindent\makebox[\textwidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}}
1006 \caption{This is the caption.}
1007 \begin{DUlegend}
1008 This is the legend.
1010 The legend may consist of several paragraphs.
1011 \end{DUlegend}
1012 \end{figure}
1014 This paragraph might flow around the figure. The specific behavior depends
1015 upon the style sheet and the browser or rendering software used.
1018 \subsubsection{2.14.3   Admonitions%
1019 \label{admonitions}%
1022 \DUadmonition[attention]{
1023 \DUtitle[attention]{Attention!}
1025 Directives at large.
1028 \DUadmonition[caution]{
1029 \DUtitle[caution]{Caution!}
1031 Don't take any wooden nickels.
1034 \DUadmonition[danger]{
1035 \DUtitle[danger]{!DANGER!}
1037 Mad scientist at work!
1040 \DUadmonition[error]{
1041 \DUtitle[error]{Error}
1043 Does not compute.
1046 \DUadmonition[hint]{
1047 \DUtitle[hint]{Hint}
1049 It's bigger than a bread box.
1052 \DUadmonition[important]{
1053 \DUtitle[important]{Important}
1055 \begin{itemize}
1057 \item Wash behind your ears.
1059 \item Clean up your room.
1061 \item Call your mother.
1063 \item Back up your data.
1065 \end{itemize}
1068 \DUadmonition[note]{
1069 \DUtitle[note]{Note}
1071 This is a note.
1074 \DUadmonition[tip]{
1075 \DUtitle[tip]{Tip}
1077 15\% if the service is good.
1080 \DUadmonition[warning]{
1081 \DUtitle[warning]{Warning}
1083 Strong prose may provoke extreme mental exertion.
1084 Reader discretion is strongly advised.
1087 \DUadmonition[admonition-and-by-the-way]{
1088 \DUtitle[admonition-and-by-the-way]{And, by the way...}
1090 You can make up your own admonition too.
1094 \subsubsection{2.14.4   Topics, Sidebars, and Rubrics%
1095 \label{topics-sidebars-and-rubrics}%
1098 \emph{Sidebars} are like miniature, parallel documents.
1100 \DUsidebar{
1101 \DUtitle[title]{Sidebar Title}
1103 \DUsubtitle[sidebar]{Optional Subtitle}
1105 This is a sidebar. It is for text outside the flow of the main
1106 text.
1108 \DUrubric{This is a rubric inside a sidebar}
1110 Sidebars often appear beside the main text with a border and a different
1111 background or font color.
1114 A \emph{topic} is like a block quote with a title, or a self-contained section
1115 with no subsections.
1117 \DUtopic[]{
1118 \DUtitle[title]{Topic Title}
1120 This is a topic.
1123 A \emph{rubric} is like an informal heading that doesn't correspond to the
1124 document's structure. It is typically highlighted in red (hence the name).
1126 \DUrubric{This is a rubric}
1128 Topics and rubrics can be used at places where a \hyperref[section-title]{section title} is not
1129 allowed (e.g. inside a directive).
1132 \subsubsection{2.14.5   Target Footnotes%
1133 \label{target-footnotes}%
1136 \DUfootnotetext{id29}{id30}{5}{%
1137 \url{http://www.python.org/}
1140 \DUfootnotetext{id33}{id34}{6}{%
1141 \url{http://pygments.org/}
1144 \DUfootnotetext{id35}{id36}{7}{%
1145 \url{http://ctan.org/pkg/polyglossia}
1148 \DUfootnotetext{id38}{id39}{8}{%
1149 \url{http://docutils.sourceforge.net/}
1152 \DUfootnotetext{id40}{id41}{9}{%
1153 \url{A:DOS\\path\\}
1157 \subsubsection{2.14.6   Replacement Text%
1158 \label{replacement-text}%
1161 I recommend you try \href{http://www.python.org/}{Python, \emph{the} best language around}\DUfootnotemark{id32}{id29}{5}.
1164 \subsubsection{2.14.7   Compound Paragraph%
1165 \label{compound-paragraph}%
1168 Compound 1, paragraph 1.
1170 Compound 1, paragraph 2.
1172 \begin{itemize}
1174 \item Compound 1, list item one.
1176 \item Compound 1, list item two.
1178 \end{itemize}
1180 Another compound statement:
1182 Compound 2, a literal block:
1184 \begin{quote}{\ttfamily \raggedright \noindent
1185 Compound~2,~literal.
1187 \end{quote}
1188 Compound 2, this is a test.
1190 Compound 3, only consisting of one paragraph.
1192 \begin{quote}{\ttfamily \raggedright \noindent
1193 Compound~4.\\
1194 This~one~starts~with~a~literal~block.
1196 \end{quote}
1197 Compound 4, a paragraph.
1199 Now something \emph{really} perverted -- a nested compound block. This is
1200 just to test that it works at all; the results don't have to be
1201 meaningful.
1203 Compound 5, block 1 (a paragraph).
1205 Compound 6, block 2 in compound 5.
1207 Compound 6, another paragraph.
1209 Compound 5, block 3 (a paragraph).
1211 Compound 7, with a table inside:
1213 \setlength{\DUtablewidth}{\linewidth}
1214 \begin{longtable*}[c]{|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|p{0.249\DUtablewidth}|}
1215 \hline
1217 Left cell, first
1218 paragraph.
1220 Left cell, second
1221 paragraph.
1223 Middle cell,
1224 consisting of
1225 exactly one
1226 paragraph.
1228 Right cell.
1230 Paragraph 2.
1232 Paragraph 3.
1234 \hline
1235 \end{longtable*}
1236 Compound 7, a paragraph after the table.
1238 Compound 7, another paragraph.
1241 \subsubsection{2.14.8   Parsed Literal Blocks%
1242 \label{parsed-literal-blocks}%
1245 \begin{quote}{\ttfamily \raggedright \noindent
1246 This~is~a~parsed~literal~block.\\
1247 ~~~~This~line~is~indented.~~The~next~line~is~blank.\\
1249 Inline~markup~is~supported,~e.g.~\emph{emphasis},~\textbf{strong},~\texttt{literal\\
1250 text},~footnotes\DUfootnotemark{id22}{id8}{1},~%
1251 \phantomsection\label{hyperlink-targets}hyperlink~targets,~and~\href{http://www.python.org/}{references}.
1253 \end{quote}
1256 \subsubsection{2.14.9   Code%
1257 \label{code}%
1260 Blocks of source code can be set with the \DUroletitlereference{code} directive. If the code
1261 language is specified, the content is parsed and tagged by the \href{http://pygments.org/}{Pygments}\DUfootnotemark{id34}{id33}{6}
1262 syntax highlighter and can be formatted with a style sheet. (Code parsing
1263 is turned off using the \texttt{syntax-highlight} config setting in the test
1264 conversions in order to get identical results with/without installed
1265 Pygments highlighter.)
1267 \begin{quote}{\ttfamily \raggedright \noindent
1268 print~'This~is~Python~code.'
1270 \end{quote}
1272 The \texttt{:number-lines:} option (with optional start value) generates line
1273 numbers:
1275 \begin{quote}{\ttfamily \raggedright \noindent
1276 \DUrole{ln}{~8~}\#~print~integers~from~0~to~9:\\
1277 \DUrole{ln}{~9~}for~i~in~range(10):\\
1278 \DUrole{ln}{10~}~~~~print~i
1280 \end{quote}
1282 For inline code snippets, there is the \DUroletitlereference{code} role, which can be used
1283 directly (the code will not be parsed/tagged, as the language is not known)
1284 or as base for special code roles, e.g. the LaTeX code in the next
1285 paragraph.
1287 Docutils uses LaTeX syntax for math directives and roles:
1288 \texttt{\DUrole{code}{\DUrole{tex}{\textbackslash{}alpha = f(x)}}} prints $\alpha = f(x)$.
1290 The \texttt{:code:} option of the \DUroletitlereference{include} directive sets the included content
1291 as a code block, here the rst file \texttt{header\_footer.txt} with line numbers:
1293 \begin{quote}{\ttfamily \raggedright \noindent
1294 \DUrole{ln}{1~}..~header::~Document~header\\
1295 \DUrole{ln}{2~}..~footer::~Document~footer
1297 \end{quote}
1300 \subsection{2.15   Substitution Definitions%
1301 \label{substitution-definitions}%
1304 An inline image (\includegraphics{../../../docs/user/rst/images/biohazard.png}) example:
1306 (Substitution definitions are not visible in the HTML source.)
1309 \subsection{2.16   Comments%
1310 \label{comments}%
1313 Here's one:
1315 % Comments begin with two dots and a space. Anything may
1316 % follow, except for the syntax of footnotes, hyperlink
1317 % targets, directives, or substitution definitions.
1319 % Double-dashes -- "--" -- must be escaped somehow in HTML output.
1321 % Comments may contain non-ASCII characters: ä ö ü æ ø å
1323 (View the HTML source to see the comment.)
1326 \subsection{2.17   Raw text%
1327 \label{raw-text}%
1330 This does not necessarily look nice, because there may be missing white space.
1332 It's just there to freeze the behavior.
1334 A test.
1336 Second test.
1338 \DUrole{myclass}{Another test with myclass set.}
1340 This is the \DUrole{myrawroleclass}{fourth test} with myrawroleclass set.
1342 Fifth test in LaTeX.\\Line two.
1345 \subsection{2.18   Container%
1346 \label{container}%
1349 paragraph 1
1351 paragraph 2
1353 % currently not implemented in LaTeX:
1354 % .. include:: data/header_footer.txt
1357 \subsection{2.19   Colspanning tables%
1358 \label{colspanning-tables}%
1361 This table has a cell spanning two columns:
1363 \setlength{\DUtablewidth}{\linewidth}
1364 \begin{longtable*}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.086\DUtablewidth}|}
1365 \hline
1366 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1367 Inputs
1368 }} & \textbf{%
1369 Output
1370 } \\
1371 \hline
1372 \textbf{%
1374 } & \textbf{%
1376 } & \textbf{%
1377 A or B
1378 } \\
1379 \hline
1380 \endfirsthead
1381 \hline
1382 \multicolumn{2}{|p{0.15\DUtablewidth}|}{\textbf{%
1383 Inputs
1384 }} & \textbf{%
1385 Output
1386 } \\
1387 \hline
1388 \textbf{%
1390 } & \textbf{%
1392 } & \textbf{%
1393 A or B
1394 } \\
1395 \hline
1396 \endhead
1397 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1398 \endfoot
1399 \endlastfoot
1401 False
1403 False
1405 False
1407 \hline
1409 True
1411 False
1413 True
1415 \hline
1417 False
1419 True
1421 True
1423 \hline
1425 True
1427 True
1429 True
1431 \hline
1432 \end{longtable*}
1435 \subsection{2.20   Rowspanning tables%
1436 \label{rowspanning-tables}%
1439 Here's a table with cells spanning several rows:
1441 \setlength{\DUtablewidth}{\linewidth}
1442 \begin{longtable*}[c]{|p{0.296\DUtablewidth}|p{0.156\DUtablewidth}|p{0.226\DUtablewidth}|}
1443 \hline
1444 \textbf{%
1445 Header row, column 1
1446 (header rows optional)
1447 } & \textbf{%
1448 Header 2
1449 } & \textbf{%
1450 Header 3
1451 } \\
1452 \hline
1453 \endfirsthead
1454 \hline
1455 \textbf{%
1456 Header row, column 1
1457 (header rows optional)
1458 } & \textbf{%
1459 Header 2
1460 } & \textbf{%
1461 Header 3
1462 } \\
1463 \hline
1464 \endhead
1465 \multicolumn{3}{c}{\hfill ... continued on next page} \\
1466 \endfoot
1467 \endlastfoot
1469 body row 1, column 1
1471 column 2
1473 column 3
1475 \hline
1477 body row 2
1478 & \multirow{2}{0.16\DUtablewidth}{%
1479 Cells may
1480 span rows.
1481 } & \multirow{2}{0.23\DUtablewidth}{%
1482 Another
1483 rowspanning
1484 cell.
1485 } \\
1486 \cline{1-1}
1488 body row 3
1489 & \\
1490 \hline
1491 \end{longtable*}
1494 \subsection{2.21   Custom Roles%
1495 \label{custom-roles}%
1498 \begin{itemize}
1500 \item A role based on an existing role.
1502 \texttt{\DUrole{custom}{one}} \texttt{\DUrole{custom}{two}} \texttt{\DUrole{custom}{three}}
1504 \item A new role.
1506 \DUrole{customnew}{one two three}
1508 \item A role with class attribute.
1510 \DUrole{special}{interpreted text}
1512 \item A language-switching role:
1514 Let's count in German \otherlanguage{german}{eins zwei drei}.
1516 \item A role with multiple class attributes, styled with raw directives:
1518 \newcommand{\DUrolegreen}[1]{\textcolor{green}{#1}}
1519 \newcommand{\DUrolesc}[1]{\textsc{#1}}
1521 The following works in most browsers but does not validate
1522 (\texttt{<style>} is only allowed in the document head):
1524 \begin{quote}{\ttfamily \raggedright \noindent
1525 ..~raw::~html\\
1527 ~~<style~type="text/css"><!--\\
1528 ~~~.green~\{color:~green;\}\\
1529 ~~~.sc~\{font-variant:~small-caps;\}\\
1530 ~~~--></style>
1532 \end{quote}
1534 \otherlanguage{british}{\DUrole{green}{\DUrole{sc}{British colourful text in small-caps}}}.
1536 \end{itemize}
1539 \section{3   Tests for the LaTeX writer%
1540 \label{tests-for-the-latex-writer}%
1543 Test syntax elements which may cause trouble for the LaTeX writer but might
1544 not need to be tested with other writers (e.g. the HTML writer).
1547 \subsection{3.1   Custom Roles in LaTeX%
1548 \label{custom-roles-in-latex}%
1551 \begin{itemize}
1553 \item Role names and class arguments are converted to conform to the
1554 regular expression \texttt{{[}a-z{]}{[}-a-z0-9{]}*} (letters are downcased,
1555 accents and similar decoration is stripped, non-conforming
1556 characters are replaced by a hyphen).
1558 Class arguments may contain numbers and hyphens, which need special
1559 treatment in LaTeX command names.
1561 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{Interpreted Text}}}}}
1563 \item With LaTeX, roles can be styled within the document using the \DUroletitlereference{raw}
1564 directive.
1566 \newcommand{\DUrolelarge}[1]{{\large #1}}
1567 \makeatletter
1568 \@namedef{DUrolesmall-caps}{\textsc}
1569 \@namedef{DUrolecustom4}{\textbf}
1570 \makeatother
1572 \DUrole{large}{\DUrole{custom4}{\DUrole{small-caps}{\DUrole{custom-role}{\DUrole{custom-role}{Interpreted Text}}}}} in large, bold, small-caps.
1574 \item Custom roles can be based on standard roles:
1576 This is a \emph{\DUrole{custom-emphasis}{customized emphasis text role}}
1578 This is a \texttt{\DUrole{custom-literal}{customized literal text role}}
1580 This is a \textbf{\DUrole{custom-strong}{customized strong text role}}
1582 This is a \textsubscript{\DUrole{custom-subscript}{customized subscript text role}}
1584 This is a \textsuperscript{\DUrole{custom-superscript}{customized superscript text role}}
1586 This is a \DUroletitlereference{\DUrole{custom-title-reference}{customized title-reference text role}}
1588 \end{itemize}
1590 % This file is used by the standalone_rst_latex test.
1593 \subsection{3.2   Option lists%
1594 \label{id23}%
1597 The LaTeX-2e description environment is used for definition lists.
1598 The definition is continued on the same line as the term, this should
1599 not happen if a option-list is at the top of the definition.
1601 If the option list is not at the first element in the definition, it
1602 is contained in a quote
1604 \begin{quote}
1606 \begin{DUoptionlist}
1608 \item[--help] show help
1610 \item[-v] verbose
1612 \end{DUoptionlist}
1614 \end{quote}
1616 \begin{description}
1617 \item[{In a definition list:}] \leavevmode %
1618 \begin{DUoptionlist}
1620 \item[--help] show help
1622 \item[-v] verbose
1624 \end{DUoptionlist}
1626 \end{description}
1629 \subsection{3.3   Monospaced non-alphanumeric characters%
1630 \label{monospaced-non-alphanumeric-characters}%
1633 These are all ASCII characters except a-zA-Z0-9 and space:
1635 \texttt{!!!"""\#\#\#\$\$\$\%\%\%\&\&\&'''((()))***+++,,,---...///:::}
1637 \texttt{;;;<<<===>>>???@@@{[}{[}{[}\textbackslash{}\textbackslash{}\textbackslash{}{]}{]}{]}\textasciicircum{}\textasciicircum{}\textasciicircum{}\_\_\_```\{\{\{|||\}\}\}\textasciitilde{}\textasciitilde{}\textasciitilde{}}
1639 \texttt{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
1641 The two lines of non-alphanumeric characters should both have the same
1642 width as the third line.
1645 \subsection{3.4   Non-ASCII characters%
1646 \label{non-ascii-characters}%
1649 Punctuation and footnote symbols
1651 \setlength{\DUtablewidth}{\linewidth}
1652 \begin{longtable*}[c]{|p{0.028\DUtablewidth}|p{0.424\DUtablewidth}|}
1653 \hline
1657 en-dash
1659 \hline
1663 em-dash
1665 \hline
1669 single turned comma quotation mark
1671 \hline
1675 single comma quotation mark
1677 \hline
1681 low single comma quotation mark
1683 \hline
1687 double turned comma quotation mark
1689 \hline
1693 double comma quotation mark
1695 \hline
1699 low double comma quotation mark
1701 \hline
1705 dagger
1707 \hline
1711 double dagger
1713 \hline
1717 black diamond suit
1719 \hline
1723 black heart suit
1725 \hline
1729 black spade suit
1731 \hline
1735 black club suit
1737 \hline
1741 ellipsis
1743 \hline
1747 trade mark sign
1749 \hline
1753 left-right double arrow
1755 \hline
1756 \end{longtable*}
1758 The \DUroletitlereference{Latin-1 extended} Unicode block
1760 \setlength{\DUtablewidth}{\linewidth}
1761 \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}|}
1762 \hline
1786 \hline
1789 & &
1795 & &
1806 \hline
1830 \hline
1854 \hline
1878 \hline
1902 \hline
1926 \hline
1950 \hline
1974 \hline
1998 \hline
2013 & & & & \\
2014 \hline
2015 \end{longtable*}
2017 \begin{itemize}
2019 \item The following line should not be wrapped, because it uses
2020 no-break spaces (\textbackslash{}u00a0):
2022 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
2024 \item Line wrapping with/without breakpoints marked by soft hyphens
2025 (\textbackslash{}u00ad):
2027 pdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-sch
2029 pdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrisch
2031 \item The currency sign (\textbackslash{}u00a4) is not supported by all fonts
2032 (some have an Euro sign at its place). You might see an error
2033 like:
2035 \begin{quote}{\ttfamily \raggedright \noindent
2036 !~Package~textcomp~Error:~Symbol~\textbackslash{}textcurrency~not~provided~by\\
2037 (textcomp)~~~~~~~~~~~~~~~~font~family~ptm~in~TS1~encoding.\\
2038 (textcomp)~~~~~~~~~~~~~~~~Default~family~used~instead.
2040 \end{quote}
2042 (which in case of font family ptm is a false positive). Add either
2044 \begin{DUfieldlist}
2045 \item[{warn:}]
2046 turn the error in a warning, use the default symbol (bitmap), or
2048 \item[{force,almostfull:}]
2049 use the symbol provided by the font at the users
2050 risk,
2052 \end{DUfieldlist}
2054 to the document options or use a different font package.
2056 \end{itemize}
2059 \subsection{3.5   Encoding special chars%
2060 \label{encoding-special-chars}%
2063 The LaTeX Info pages lists under "2.18 Special Characters"
2065 \begin{quote}
2067 The following characters play a special role in LaTeX and are called
2068 "special printing characters", or simply "special characters".
2070 \begin{quote}
2072 \# \$ \% \& \textasciitilde{} \_ \textasciicircum{} \textbackslash{} \{ \}
2074 \end{quote}
2076 \end{quote}
2078 The special chars verbatim:
2080 \begin{quote}{\ttfamily \raggedright \noindent
2081 \#~\$~\%~\&~\textasciitilde{}~\_~\textasciicircum{}~\textbackslash{}~\{~\}
2083 \end{quote}
2085 However also \emph{square brackets} {[}{]} need special care.
2087 \begin{quote}
2089 item and all the other commands with optional arguments check
2090 if the token right after the macro name is an opening bracket.
2091 In that case the contents between that bracket and the following
2092 closing bracket on the same grouping level are taken as the
2093 optional argument. What makes this unintuitive is the fact that
2094 the square brackets aren't grouping characters themselves, so in
2095 your last example item{[}{[}...{]}{]} the optional argument consists of
2096 {[}... (without the closing bracket).
2098 \end{quote}
2100 Compare the items in the following lists:
2102 \begin{itemize}
2104 \item simple item
2106 \item {[}bracketed{]} item
2108 \end{itemize}
2110 \begin{description}
2111 \item[{simple}] \leavevmode
2112 description term
2114 \item[{{[}bracketed{]}}] \leavevmode
2115 description term
2117 \end{description}
2119 The OT1 font-encoding has different characters for the less-than,
2120 greater-than and bar, < | >, except for typewriter font \DUroletitlereference{cmtt}:
2122 \begin{quote}{\ttfamily \raggedright \noindent
2123 <~|~>
2125 \end{quote}
2128 \subsection{3.6   Hyperlinks and -targets%
2129 \label{hyperlinks-and-targets}%
2132 In LaTeX, we must set an explicit anchor (\texttt{\textbackslash{}phantomsection}) for a
2134 \phantomsection\label{hypertarget-in-plain-text}hypertarget in plain text or in a figure but not in a longtable or
2135 caption:
2137 \setlength{\DUtablewidth}{\linewidth}
2138 \begin{longtable}[c]{|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|p{0.075\DUtablewidth}|}
2139 \caption{Table with %
2140 \label{hypertarget-in-table-title}hypertarget in table title.}\\
2141 \hline
2143 False
2145 True
2147 None
2149 \hline
2150 \end{longtable}
2151 \label{table-label}
2152 \begin{figure}
2153 \phantomsection\label{figure-label}
2154 \noindent\makebox[\textwidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}}
2155 \caption{Figure with %
2156 \label{hypertarget-in-figure-caption}hypertarget in figure caption.}
2157 \begin{DUlegend}
2158 Legend with %
2159 \phantomsection\label{hypertarget-in-figure-legend}hypertarget in figure legend.
2160 \end{DUlegend}
2161 \end{figure}
2163 \includegraphics{../../../docs/user/rst/images/biohazard.png}
2164 \phantomsection\label{image-label}
2166 See \hyperref[hypertarget-in-plain-text]{hypertarget in plain text},
2167 \hyperref[table-label]{table label}, \hyperref[hypertarget-in-table-title]{hypertarget in table title},
2168 \hyperref[figure-label]{figure label}, \hyperref[hypertarget-in-figure-caption]{hypertarget in figure caption},
2169 \hyperref[hypertarget-in-figure-legend]{hypertarget in figure legend}, and
2170 \hyperref[image-label]{image label}.
2173 \subsection{3.7   External references%
2174 \label{external-references}%
2177 Long URLs should be wrapped in the PDF.
2178 This can be achieved with the url command which is used by the LaTeX writer
2179 whenever the content (name) of a reference node equals the link URL.
2181 \begin{description}
2182 \item[{Example:}] \leavevmode
2183 a long URL that should wrap in the output
2184 \url{http://docutils.sourceforge.net/docs/user/latex.html\#id79}
2186 \end{description}
2188 If the argument contains any "\%", "\#", or "\textasciicircum{}\textasciicircum{}", or ends with \texttt{\textbackslash{}}, it can't
2189 be used in the argument to another command. The argument must not contain
2190 unbalanced braces.
2192 The characters \textasciicircum{}, \{, \}, and \texttt{\textbackslash{}} are invalid in a "http:" or "ftp:" URL
2193 and not recognized as part of it:
2195 \begin{DUlineblock}{0em}
2196 \item[] \url{http://www.example.org}/strange\textasciicircum{}\textasciicircum{}name
2197 \item[] \url{http://www.example.org}\textbackslash{}using\textbackslash{}DOS\textbackslash{}paths\textbackslash{}
2198 \item[] \url{http://www.example.org/XML}/strange\{n\}ame
2199 \end{DUlineblock}
2201 They can, however be used in paths and/or filenames.
2203 Handling by the LaTeX writer:
2205 \begin{itemize}
2207 \item \texttt{\#}, \texttt{\textbackslash{}} and \texttt{\%} are escaped:
2209 \begin{DUlineblock}{0em}
2210 \item[] \href{http://www.w3.org/XML/Schema\#dev}{URL with \#}
2211 \url{http://www.w3.org/XML/Schema\#dev}
2212 \item[] \href{http://www.w3.org/XML/Schema\%dev}{URL with \%}
2213 \url{http://example.org/Schema\%dev}
2214 \item[] \href{A:DOS\\path\\}{file with DOS path}\DUfootnotemark{id41}{id40}{9} \url{A:DOS\\path\\}\DUfootnotemark{id42}{id40}{9}
2215 \end{DUlineblock}
2217 \DUadmonition[note]{
2218 \DUtitle[note]{Note}
2220 These URLs are typeset inside a LaTeX command without error.
2222 \begin{DUlineblock}{0em}
2223 \item[] \url{http://www.w3.org/XML/Schema\#dev}
2224 \item[] \url{http://example.org/Schema\%dev}
2225 \item[] \url{A:DOS\\path\\}\DUfootnotemark{id43}{id40}{9}
2226 \end{DUlineblock}
2229 \end{itemize}
2231 \begin{itemize}
2233 \item \textasciicircum{}\textasciicircum{} LaTeX's special syntax for characters results in "strange" replacements
2234 (both with href and url). A warning is given.
2236 \href{../strange^^name}{file with \textasciicircum{}\textasciicircum{}}:
2237 \url{../strange^^name}
2239 \item Unbalanced braces, \{ or \}, will fail (both with href and url):
2241 \begin{quote}{\ttfamily \raggedright \noindent
2242 `file~with~\{~<../strange\{name>`\_\_\\
2243 `<../strange\{name>`\_\_
2245 \end{quote}
2247 while balanced braces are suported:
2249 \begin{DUlineblock}{0em}
2250 \item[] \url{../strange{n}ame}
2251 \item[] \url{../st{r}ange{n}ame}
2252 \item[] \url{../{st{r}ange{n}ame}}
2253 \end{DUlineblock}
2255 \end{itemize}
2258 \subsection{3.8   Section titles with \hyperref[inline-markup]{inline markup}%
2259 \label{section-titles-with-inline-markup}%
2263 \subsubsection{3.8.1   \emph{emphasized}, H\textsubscript{2}O and $x^2$%
2264 \label{emphasized-h2o-and-x-2}%
2268 \subsubsection{3.8.2   Substitutions work%
2269 \label{substitutions-fail}%
2273 \subsection{3.9   Deeply nested sections%
2274 \label{deeply-nested-sections}%
2277 In LaTeX and HTML,
2280 \subsubsection{3.9.1   Level 3%
2281 \label{level-3}%
2284 nested sections
2287 \paragraph{3.9.1.1   level 4%
2288 \label{level-4}%
2291 reach at some level
2294 \subparagraph{3.9.1.1.1   level 5%
2295 \label{level-5}%
2298 (depending on the document class)
2301 \DUtitle[sectionVI]{3.9.1.1.1.1   level 6%
2302 \label{level-6}%
2305 an unsupported level.
2308 \section{4   Tests for the XeTeX writer%
2309 \label{tests-for-the-xetex-writer}%
2312 With XeTeX, you can typeset text in any language/script supported by
2313 Unicode and the selected font, e.g. Azərbaycanca, Bân-lâm-gú, Башҡорт
2314 Беларуская, Български, Català, Чӑвашла, Česky, Ελληνικά, Español,
2315 Français, Føroyskt, Хальмг, Íslenska, עברית , Қазақша, Kurdî,
2316 Latviešu, Lietuvių, Македонски, Монгол, Nāhuatl, Português, Română,
2317 Русский, Slovenščina, Српски, Türkçe, Українська, Tiếng Việt, Volapük,
2318 Võro, ייִדיש , Žemaitėška.
2319 Currently, there is extended support for 28 languages in the
2320 \href{http://ctan.org/pkg/polyglossia}{polyglossia}\DUfootnotemark{id36}{id35}{7} package.
2322 % System Messages:
2325 \section{5   Error Handling%
2326 \label{error-handling}%
2329 Any errors caught during processing will generate system messages.
2331 There should be five messages in the following, auto-generated
2332 section, "Docutils System Messages":
2334 % section should be added by Docutils automatically
2337 \section[Docutils System Messages]{\color{red}Docutils System Messages%
2340 \DUadmonition[system-message]{
2341 \DUtitle[system-message]{system-message}
2342 \raisebox{1em}{\hypertarget{id27}{}}
2344 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~104
2346 \hyperlink{id28}{
2347 Undefined substitution referenced: "problematic".
2350 \DUadmonition[system-message]{
2351 \DUtitle[system-message]{system-message}
2352 \raisebox{1em}{\hypertarget{id44}{}}
2354 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~391
2356 \hyperlink{id45}{
2357 Unknown target name: "5".
2360 \DUadmonition[system-message]{
2361 \DUtitle[system-message]{system-message}
2362 \raisebox{1em}{\hypertarget{id46}{}}
2364 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~400
2366 \hyperlink{id47}{
2367 Unknown target name: "nonexistent".
2370 \DUadmonition[system-message]{
2371 \DUtitle[system-message]{system-message}
2372 \raisebox{1em}{\hypertarget{id48}{}}
2374 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~427
2376 \hyperlink{id49}{
2377 Unknown target name: "hyperlink reference without a target".
2380 \DUadmonition[system-message]{
2381 \DUtitle[system-message]{system-message}
2382 \raisebox{1em}{\hypertarget{id50}{}}
2384 {\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~440
2386 \hyperlink{id51}{
2387 Duplicate target name, cannot be used as a unique reference: "duplicate target names".
2390 \end{document}