1 \documentclass[a4paper]{article
}
2 % generated by Docutils <http://docutils.sourceforge.net/>
3 \usepackage{fixltx2e
} % LaTeX patches, \textsubscript
4 \usepackage{cmap
} % fix search and cut-and-paste in Acrobat
6 \usepackage[T1]{fontenc}
7 \usepackage[utf8
]{inputenc}
9 \usepackage[british,french,
ngerman,english
]{babel
}
10 % Prevent side-effects if French hyphenation patterns are not loaded:
11 \frenchbsetup{StandardLayout
}
12 \AtBeginDocument{\selectlanguage{english
}\noextrasfrench}
14 \usepackage{float
} % float configuration
15 \floatplacement{figure
}{H
} % place figures here definitely
19 \usepackage{longtable
}
21 \setlength{\extrarowheight}{2pt
}
22 \newlength{\DUtablewidth} % internal use in tables
24 \usepackage{textcomp
} % text symbol macros
26 %%% Custom LaTeX preamble
28 \usepackage{mathptmx
} % Times
29 \usepackage[scaled=
.90]{helvet
}
32 %%% User specified packages and stylesheets
34 %%% Fallback definitions for Docutils-specific commands
36 % providelength (provide a length variable and set default, if it is new)
37 \providecommand*
{\DUprovidelength}[2]{
38 \ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{}
42 \providecommand*
{\DUtitleabstract}[1]{\centerline{\textbf{#1}}}
44 % admonition (specially marked topic)
45 \providecommand{\DUadmonition}[2][class-arg
]{%
46 % try \DUadmonition#1{#2}:
47 \ifcsname DUadmonition
#1\endcsname%
48 \csname DUadmonition
#1\endcsname{#2}%
51 \fbox{\parbox{0.9\textwidth}{#2}}
57 \@namedef
{DUrolealign-center
}{\centering}
62 \providecommand{\DUtopicdedication}[1]{\begin{center
}#1\end{center
}}
64 % docinfo (width of docinfo table)
65 \DUprovidelength{\DUdocinfowidth}{0.9\textwidth}
67 % error admonition title
68 \providecommand*
{\DUtitleerror}[1]{\DUtitle{\color{red
}#1}}
70 % fieldlist environment
71 \ifthenelse{\isundefined{\DUfieldlist}}{
72 \newenvironment{DUfieldlist
}%
74 {\enddescription\endquote}
76 % numeric or symbol footnotes with hyperlinks
77 \providecommand*
{\DUfootnotemark}[3]{%
78 \raisebox{1em
}{\hypertarget{#1}{}}%
79 \hyperlink{#2}{\textsuperscript{#3}}%
81 \providecommand{\DUfootnotetext}[4]{%
83 \renewcommand{\thefootnote}{%
84 \protect\raisebox{1em
}{\protect\hypertarget{#1}{}}%
85 \protect\hyperlink{#2}{#3}}%
90 % inline markup (custom roles)
91 % \DUrole{#1}{#2} tries \DUrole#1{#2}
92 \providecommand*
{\DUrole}[2]{%
93 \ifcsname DUrole
#1\endcsname%
94 \csname DUrole
#1\endcsname{#2}%
95 \else% backwards compatibility: try \docutilsrole#1{#2}
96 \ifcsname docutilsrole
#1\endcsname%
97 \csname docutilsrole
#1\endcsname{#2}%
105 \ifthenelse{\isundefined{\DUlegend}}{
106 \newenvironment{DUlegend
}{\small}{}
109 % lineblock environment
110 \DUprovidelength{\DUlineblockindent}{2.5em
}
111 \ifthenelse{\isundefined{\DUlineblock}}{
112 \newenvironment{DUlineblock
}[1]{%
113 \list{}{\setlength{\partopsep}{\parskip}
114 \addtolength{\partopsep}{\baselineskip}
115 \setlength{\topsep}{0pt
}
116 \setlength{\itemsep}{0.15\baselineskip}
117 \setlength{\parsep}{0pt
}
118 \setlength{\leftmargin}{#1}}
124 % optionlist environment
125 \providecommand*
{\DUoptionlistlabel}[1]{\bf #1 \hfill}
126 \DUprovidelength{\DUoptionlistindent}{3cm
}
127 \ifthenelse{\isundefined{\DUoptionlist}}{
128 \newenvironment{DUoptionlist
}{%
129 \list{}{\setlength{\labelwidth}{\DUoptionlistindent}
130 \setlength{\rightmargin}{1cm
}
131 \setlength{\leftmargin}{\rightmargin}
132 \addtolength{\leftmargin}{\labelwidth}
133 \addtolength{\leftmargin}{\labelsep}
134 \renewcommand{\makelabel}{\DUoptionlistlabel}}
139 % rubric (informal heading)
140 \providecommand*
{\DUrubric}[2][class-arg
]{%
141 \subsubsection*
{\centering\textit{\textmd{#2}}}}
143 % sidebar (text outside the main text flow)
144 \providecommand{\DUsidebar}[2][class-arg
]{%
146 \colorbox[gray
]{0.80}{\parbox{0.9\textwidth}{#2}}
150 % subtitle (for topic/sidebar)
151 \providecommand*
{\DUsubtitle}[2][class-arg
]{\par\emph{#2}\smallskip}
153 % title for topics, admonitions and sidebar
154 \providecommand*
{\DUtitle}[2][class-arg
]{%
155 % call \DUtitle#1{#2} if it exists:
156 \ifcsname DUtitle
#1\endcsname%
157 \csname DUtitle
#1\endcsname{#2}%
159 \smallskip\noindent\textbf{#2}\smallskip%
163 % titlereference role
164 \providecommand*
{\DUroletitlereference}[1]{\textsl{#1}}
166 % topic (quote with heading)
167 \providecommand{\DUtopic}[2][class-arg
]{%
168 \ifcsname DUtopic
#1\endcsname%
169 \csname DUtopic
#1\endcsname{#2}%
171 \begin{quote
}#2\end{quote
}
175 % transition (break, fancybreak, anonymous section)
176 \providecommand*
{\DUtransition}[1][class-arg
]{%
177 \hspace*
{\fill}\hrulefill\hspace*
{\fill}
178 \vskip 0.5\baselineskip
182 \ifthenelse{\isundefined{\hypersetup}}{
183 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue
]{hyperref
}
184 \urlstyle{same
} % normal text font (alternatives: tt, rm, sf)
187 pdftitle=
{reStructuredText Test Document
},
188 pdfauthor=
{David Goodger;Me;Myself;I
}
192 \title{\phantomsection%
193 reStructuredText Test Document
%
194 \label{restructuredtext-test-
document}%
197 \large{Examples of Syntax Constructs
}%
198 \label{examples-of-syntax-constructs
}%
209 \begin{tabularx
}{\DUdocinfowidth}{lX
}
218 \href{mailto:goodger@python.org
}{goodger@python.org
} \\
225 \textbf{Organization
}: &
228 Now, or yesterday. Or maybe even
\emph{before
} yesterday. \\
230 This is a ``work in progress'' \\
232 is managed by a version control system. \\
235 \textbf{Copyright
}: &
236 This
document has been placed in the public domain. You
237 may do with it as you wish. You may copy, modify,
238 redistribute, reattribute, sell, buy, rent, lease,
239 destroy, or improve it, quote it at length, excerpt,
240 incorporate, collate, fold, staple, or mutilate it, or do
241 anything else to it that your or anyone else's heart
243 \textbf{field name
}: &
244 This is a ``generic bibliographic field''.
246 \textbf{field name ``
2''
}: &
247 Generic bibliographic fields may contain multiple body elements.
254 \DUtopic[dedication
]{
255 \DUtitle[dedication
]{Dedication
}
257 For Docutils users \& co-developers.
261 \DUtitle[abstract
]{Abstract
}
263 This is a test
document, containing at least one example of each
264 reStructuredText construct.
267 % This is a comment. Note how any initial comments are moved by
268 % transforms to after the document title, subtitle, and docinfo.
270 % Above is the document title, and below is the subtitle.
271 % They are transformed from section titles after parsing.
273 % bibliographic fields (which also require a transform):
275 \pagebreak[4] % start ToC on new page
277 \phantomsection\label{table-of-contents
}
278 \pdfbookmark[1]{Table of Contents
}{table-of-contents
}
279 \renewcommand{\contentsname}{Table of Contents
}
284 %___________________________________________________________________________
286 \section*
{\phantomsection%
287 1~~~Structural Elements
%
288 \addcontentsline{toc
}{section
}{1~~~Structural Elements
}%
289 \label{structural-elements
}%
293 %___________________________________________________________________________
295 \subsection*
{\phantomsection%
297 \addcontentsline{toc
}{subsection
}{1.1~~~Section Title
}%
298 \label{section-title
}%
300 \subsubsection*
{Section Subtitle
}
302 Lone subsections are converted to a section subtitle by a transform
303 activated with the
\texttt{-
{}-section-subtitles
} command line option or the
304 \texttt{sectsubtitle-xform
} configuration value.
307 %___________________________________________________________________________
309 \subsection*
{\phantomsection%
311 \addcontentsline{toc
}{subsection
}{1.2~~~Empty Section
}%
312 \label{empty-section
}%
316 %___________________________________________________________________________
318 \subsection*
{\phantomsection%
320 \addcontentsline{toc
}{subsection
}{1.3~~~Transitions
}%
327 %___________________________________________________________________________
331 It divides the section. Transitions may also occur between sections:
334 %___________________________________________________________________________
339 %___________________________________________________________________________
341 \section*
{\phantomsection%
343 \addcontentsline{toc
}{section
}{2~~~Body Elements
}%
344 \label{body-elements
}%
348 %___________________________________________________________________________
350 \subsection*
{\phantomsection%
352 \addcontentsline{toc
}{subsection
}{2.1~~~Paragraphs
}%
359 %___________________________________________________________________________
361 \subsubsection*
{\phantomsection%
362 2.1.1~~~Inline Markup
%
363 \addcontentsline{toc
}{subsubsection
}{2.1.1~~~Inline Markup
}%
364 \label{inline-markup
}%
367 Paragraphs contain text and may contain inline markup:
\emph{emphasis
},
368 \textbf{strong emphasis
},
\texttt{inline literals
}, standalone hyperlinks
369 (
\url{http://www.python.org
}), external hyperlinks (
\href{http://www.python.org/
}{Python
}\DUfootnotemark{id30
}{id29
}{5}), internal
370 cross-references (
\hyperref[example
]{example
}), external hyperlinks with embedded URIs
371 (
\href{http://www.python.org
}{Python web site
}),
\href{http://www.python.org/
}{anonymous hyperlink
372 references
}\DUfootnotemark{id33
}{id29
}{5} (
\href{http://docutils.sourceforge.net/
}{a second reference
}\DUfootnotemark{id35
}{id34
}{6}), footnote references (manually
373 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
}]),
374 substitution references (
\includegraphics{../../../docs/user/rst/images/biohazard.png
}), and
%
375 \phantomsection\label{inline-hyperlink-targets
}inline hyperlink targets
376 (see
\hyperref[targets
]{Targets
} below for a reference back to here). Character-level
377 inline markup is also possible (although exceedingly ugly!) in
\emph{re
}\texttt{Structured
}\emph{Text
}. Problems are indicated by
%
378 \raisebox{1em
}{\hypertarget{id28
}{}}\hyperlink{id27
}{\textbf{\color{red
}|problematic|
}} text
379 (generated by processing errors; this one is intentional). Here is a
380 reference to the
\hyperref[doctitle
]{doctitle
} and the
\hyperref[subtitle
]{subtitle
}.
382 The default role for interpreted text is
\DUroletitlereference{Title Reference
}. Here are
383 some explicit interpreted text roles: a PEP reference (
\href{http://www.python.org/dev/peps/pep-
0287}{PEP
287}); an
384 RFC reference (
\href{http://www.faqs.org/rfcs/rfc2822.html
}{RFC
2822}); a
\textsubscript{subscript
}; a
\textsuperscript{superscript
};
385 and explicit roles for
\emph{standard
} \textbf{inline
}
388 % DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!
390 Let's test wrapping and whitespace significance in inline literals:
391 \texttt{This is an example of -
{}-inline-literal -
{}-text, -
{}-including some-
{}-
392 strangely-
{}-hyphenated-words. ~Adjust-the-width-of-your-browser-window
393 to see how the text is wrapped. ~-
{}- -
{}-
{}-
{}- -
{}-
{}-
{}-
{}-
{}-
{}-
{}- ~Now note ~ ~the
394 spacing ~ ~between the ~ ~words of ~ ~this sentence ~ ~(words
395 should ~ ~be grouped ~ ~in pairs).
}
397 If the
\texttt{-
{}-pep-references
} option was supplied, there should be a
398 live link to PEP
258 here.
401 %___________________________________________________________________________
403 \subsection*
{\phantomsection%
405 \addcontentsline{toc
}{subsection
}{2.2~~~Bullet Lists
}%
406 \label{bullet-lists
}%
415 \item Nested bullet list.
423 Paragraph
2 of item
2.
427 \item Nested bullet list.
441 \item This nested list should be compacted by the HTML writer.
443 \phantomsection\label{target
}
444 % Even if this item contains a target and a comment.
451 %___________________________________________________________________________
453 \subsection*
{\phantomsection%
454 2.3~~~Enumerated Lists
%
455 \addcontentsline{toc
}{subsection
}{2.3~~~Enumerated Lists
}%
456 \label{enumerated-lists
}%
458 \newcounter{listcnt0
}
459 \begin{list
}{\arabic{listcnt0
}.
}
461 \usecounter{listcnt0
}
462 \setlength{\rightmargin}{\leftmargin}
465 \item Arabic numerals.
466 \newcounter{listcnt1
}
467 \begin{list
}{\alph{listcnt1
})
}
469 \usecounter{listcnt1
}
470 \setlength{\rightmargin}{\leftmargin}
474 \newcounter{listcnt2
}
475 \begin{list
}{(
\roman{listcnt2
})
}
477 \usecounter{listcnt2
}
478 \setlength{\rightmargin}{\leftmargin}
482 \newcounter{listcnt3
}
483 \begin{list
}{\Alph{listcnt3
}.
}
485 \usecounter{listcnt3
}
486 \setlength{\rightmargin}{\leftmargin}
490 \newcounter{listcnt4
}
491 \begin{list
}{\Roman{listcnt4
})
}
493 \usecounter{listcnt4
}
494 \setlength{\rightmargin}{\leftmargin}
503 \item Lists that don't start at
1:
504 \setcounter{listcnt1
}{0}
505 \begin{list
}{\arabic{listcnt1
}.
}
507 \usecounter{listcnt1
}
508 \addtocounter{listcnt1
}{2}
509 \setlength{\rightmargin}{\leftmargin}
516 \setcounter{listcnt1
}{0}
517 \begin{list
}{\Alph{listcnt1
}.
}
519 \usecounter{listcnt1
}
520 \addtocounter{listcnt1
}{2}
521 \setlength{\rightmargin}{\leftmargin}
528 \setcounter{listcnt1
}{0}
529 \begin{list
}{\roman{listcnt1
}.
}
531 \usecounter{listcnt1
}
532 \addtocounter{listcnt1
}{2}
533 \setlength{\rightmargin}{\leftmargin}
543 %___________________________________________________________________________
545 \subsection*
{\phantomsection%
546 2.4~~~Definition Lists
%
547 \addcontentsline{toc
}{subsection
}{2.4~~~Definition Lists
}%
548 \label{definition-lists
}%
552 \item[{Term
}] \leavevmode
555 \item[{Term
}] \leavevmode (
\textbf{classifier
})
557 Definition paragraph
1.
559 Definition paragraph
2.
561 \item[{Term
}] \leavevmode
564 \item[{Term
}] \leavevmode (
\textbf{classifier one
})
565 (
\textbf{classifier two
})
572 %___________________________________________________________________________
574 \subsection*
{\phantomsection%
576 \addcontentsline{toc
}{subsection
}{2.5~~~Field Lists
}%
582 Field lists map field names to field bodies, like database
583 records. They are often part of an extension syntax. They are
584 an unambiguous variant of RFC
2822 fields.
586 \item[{how arg1 arg2:
}]
587 The field marker is a colon, the field name, and a colon.
589 The field body may contain one or more body elements, indented
590 relative to the field marker.
593 \DUrole{credits
}{This paragraph has the
\DUroletitlereference{credits
} class set. (This is actually not
594 about credits but just for ensuring that the class attribute
595 doesn't get stripped away.)
}
600 %___________________________________________________________________________
602 \subsection*
{\phantomsection%
604 \addcontentsline{toc
}{subsection
}{2.6~~~Option Lists
}%
605 \label{option-lists
}%
608 For listing command-line options:
612 \item[-a
] command-line option ``a''
614 \item[-b file
] options can have arguments
615 and long descriptions
617 \item[-
{}-long
] options can be long also
619 \item[-
{}-input=file
] long options can also have
622 \item[-
{}-very-long-option
] The description can also start on the next line.
624 The description may contain multiple body elements,
625 regardless of where it starts.
627 \item[-x, -y, -z
] Multiple options are an ``option group''.
629 \item[-v, -
{}-verbose
] Commonly-seen: short \& long options.
631 \item[-
1 file, -
{}-one=file, -
{}-two file
] Multiple options with arguments.
633 \item[/V
] DOS/VMS-style options too
637 There must be at least two spaces between the option and the
641 %___________________________________________________________________________
643 \subsection*
{\phantomsection%
644 2.7~~~Literal Blocks
%
645 \addcontentsline{toc
}{subsection
}{2.7~~~Literal Blocks
}%
646 \label{literal-blocks
}%
649 Literal blocks are indicated with a double-colon (``::'') at the end of
650 the preceding paragraph (over there
\texttt{-
{}->
}). They can be indented:
652 \begin{quote
}{\ttfamily \raggedright \noindent
654 ~~~~text~=~'is~left~as-is'\\
655 ~~~~spaces
\_and\_linebreaks~=~'are~preserved'\\
656 ~~~~markup
\_processing~=~None
660 Or they can be quoted without indentation:
662 \begin{quote
}{\ttfamily \raggedright \noindent
665 >~Why~didn't~I~think~of~that?
670 %___________________________________________________________________________
672 \subsection*
{\phantomsection%
674 \addcontentsline{toc
}{subsection
}{2.8~~~Line Blocks
}%
678 This section tests line blocks. Line blocks are body elements which
679 consist of lines and other line blocks. Nested line blocks cause
682 \begin{DUlineblock
}{0em
}
683 \item[] This is a line block. It ends with a blank line.
685 \begin{DUlineblock
}{\DUlineblockindent}
686 \item[] New lines begin with a vertical bar (``|'').
687 \item[] Line breaks and initial indent are significant, and preserved.
689 \begin{DUlineblock
}{\DUlineblockindent}
690 \item[] Continuation lines are also possible. A long line that is intended
691 to wrap should begin with a space in place of the vertical bar.
693 \item[] The left edge of a continuation line need not be aligned with
694 the left edge of the text above it.
698 \begin{DUlineblock
}{0em
}
699 \item[] This is a second line block.
701 \item[] Blank lines are permitted internally, but they must begin with a ``|''.
704 Another line block, surrounded by paragraphs:
706 \begin{DUlineblock
}{0em
}
707 \item[] And it's no good waiting by the window
708 \item[] It's no good waiting for the sun
709 \item[] Please believe me, the things you dream of
710 \item[] They don't fall in the lap of no-one
713 Take it away, Eric the Orchestra Leader!
717 \begin{DUlineblock
}{0em
}
718 \item[] A one, two, a one two three four
720 \item[] Half a bee, philosophically,
722 \begin{DUlineblock
}{\DUlineblockindent}
723 \item[] must,
\emph{ipso facto
}, half not be.
725 \item[] But half the bee has got to be,
727 \begin{DUlineblock
}{\DUlineblockindent}
728 \item[] \emph{vis a vis
} its entity. D'you see?
731 \item[] But can a bee be said to be
733 \begin{DUlineblock
}{\DUlineblockindent}
734 \item[] or not to be an entire bee,
736 \begin{DUlineblock
}{\DUlineblockindent}
737 \item[] when half the bee is not a bee,
739 \begin{DUlineblock
}{\DUlineblockindent}
740 \item[] due to some ancient injury?
750 A line block, like the following poem by Christian Morgenstern, can
751 also be centre-aligned:
753 \begin{DUlineblock
}{0em
}
754 \otherlanguage{ngerman}{\DUrole{align-center
}{
755 \item[] \textbf{Die Trichter
}
757 \item[] Zwei Trichter wandeln durch die Nacht.
758 \item[] Durch ihres Rumpfs verengten Schacht
759 \item[] fließt weißes Mondlicht
760 \item[] still und heiter
770 %___________________________________________________________________________
772 \subsection*
{\phantomsection%
774 \addcontentsline{toc
}{subsection
}{2.9~~~Block Quotes
}%
775 \label{block-quotes
}%
778 Block quotes consist of indented body elements:
782 My theory by A. Elk. Brackets Miss, brackets. This theory goes
783 as follows and begins now. All brontosauruses are thin at one
784 end, much much thicker in the middle and then thin again at the
785 far end. That is my theory, it is mine, and belongs to me and I
786 own it, and what it is too.
789 \raggedleft —Anne Elk (Miss)
793 The language of a quote (like any other object) can be specified by
799 \otherlanguage{french
}{
800 ReStructuredText est un langage de balisage léger utilisé
801 notamment dans la documentation du langage Python.
806 %___________________________________________________________________________
808 \subsection*
{\phantomsection%
809 2.10~~~Doctest Blocks
%
810 \addcontentsline{toc
}{subsection
}{2.10~~~Doctest Blocks
}%
811 \label{doctest-blocks
}%
814 \begin{quote
}{\ttfamily \raggedright \noindent
815 >
{}>
{}>~print~'Python-specific~usage~examples;~begun~with~">
{}>
{}>"'\\
816 Python-specific~usage~examples;~begun~with~">
{}>
{}>"\\
817 >
{}>
{}>~print~'(cut~and~pasted~from~interactive~Python~sessions)'\\
818 (cut~and~pasted~from~interactive~Python~sessions)
823 %___________________________________________________________________________
825 \subsection*
{\phantomsection%
827 \addcontentsline{toc
}{subsection
}{2.11~~~Footnotes
}%
831 \DUfootnotetext{id8
}{id1
}{1}{%
832 A footnote contains body elements, consistently indented by at
835 This is the footnote's second paragraph.
838 \DUfootnotetext{label
}{id3
}{2}{\phantomsection\label{label
}%
839 Footnotes may be numbered, either manually (as in
\DUfootnotemark{id9
}{id8
}{1}) or
840 automatically using a ``\#''-prefixed label. This footnote has a
841 label so it can be referred to from multiple places, both as a
842 footnote reference (
\DUfootnotemark{id10
}{label
}{2}) and as a
\hyperref[label
]{hyperlink reference
}.
845 \DUfootnotetext{id12
}{id2
}{3}{%
846 This footnote is numbered automatically and anonymously using a
847 label of ``\#'' only.
849 This is the second paragraph.
851 And this is the third paragraph.
854 \DUfootnotetext{id13
}{id4
}{*
}{%
855 Footnotes may also use symbols, specified with a ``*'' label.
856 Here's a reference to the next footnote:
\DUfootnotemark{id14
}{id15
}{†
}.
859 \DUfootnotetext{id15
}{id14
}{†
}{%
860 This footnote shows the next symbol in the sequence.
863 \DUfootnotetext{id16
}{id16
}{4}{%
864 Here's an unreferenced footnote, with a reference to a
865 nonexistent footnote:
%
866 \raisebox{1em
}{\hypertarget{id41
}{}}%
867 \raisebox{1em
}{\hypertarget{id17
}{}}\hyperlink{id40
}{\textbf{\color{red
}{[}5{]}\_}}.
871 %___________________________________________________________________________
873 \subsection*
{\phantomsection%
875 \addcontentsline{toc
}{subsection
}{2.12~~~Citations
}%
878 \begin{figure
}[b
]\raisebox{1em
}{\hypertarget{cit2002
}{}}[CIT2002
]
879 Citations are text-labeled footnotes. They may be
880 rendered separately and differently from footnotes.
883 Here's a reference to the above,
[\hyperlink{cit2002
}{CIT2002
}], and a
%
884 \raisebox{1em
}{\hypertarget{id43
}{}}%
885 \raisebox{1em
}{\hypertarget{id19
}{}}\hyperlink{id42
}{\textbf{\color{red
}{[}nonexistent
{]}\_}}
889 %___________________________________________________________________________
891 \subsection*
{\phantomsection%
893 \addcontentsline{toc
}{subsection
}{2.13~~~Targets
}%
895 \label{another-target
}%
898 \phantomsection\label{example
}
899 This paragraph is pointed to by the explicit ``example'' target. A
900 reference can be found under
\hyperref[inline-markup
]{Inline Markup
}, above.
\hyperref[inline-hyperlink-targets
]{Inline
901 hyperlink targets
} are also possible.
903 Section headers are implicit targets, referred to by name. See
904 \hyperref[targets
]{Targets
}, which is a subsection of
\hyperref[body-elements
]{Body Elements
}.
906 Explicit external targets are interpolated into references such as
907 ``
\href{http://www.python.org/
}{Python
}\DUfootnotemark{id31
}{id29
}{5}''.
909 Targets may be indirect and anonymous. Thus
\hyperref[targets
]{this phrase
} may also
910 refer to the
\hyperref[targets
]{Targets
} section.
913 \raisebox{1em
}{\hypertarget{id45
}{}}\hyperlink{id44
}{\textbf{\color{red
}`hyperlink reference without a target`
\_}}, which generates an
917 %___________________________________________________________________________
919 \subsubsection*
{\phantomsection%
920 2.13.1~~~Duplicate Target Names
%
921 \addcontentsline{toc
}{subsubsection
}{2.13.1~~~Duplicate Target Names
}%
922 \label{duplicate-target-names
}%
925 Duplicate names in section headers or other implicit targets will
926 generate ``info'' (level-
1) system messages. Duplicate names in
927 explicit targets will generate ``warning'' (level-
2) system messages.
930 %___________________________________________________________________________
932 \subsubsection*
{\phantomsection%
933 2.13.2~~~Duplicate Target Names
%
934 \addcontentsline{toc
}{subsubsection
}{2.13.2~~~Duplicate Target Names
}%
938 Since there are two ``Duplicate Target Names'' section headers, we
939 cannot uniquely refer to either of them by name. If we try to (like
941 \raisebox{1em
}{\hypertarget{id47
}{}}\hyperlink{id46
}{\textbf{\color{red
}`Duplicate Target Names`
\_}}), an error is generated.
944 %___________________________________________________________________________
946 \subsection*
{\phantomsection%
948 \addcontentsline{toc
}{subsection
}{2.14~~~Directives
}%
952 \phantomsection\label{contents
}
953 These are just a sample of the many reStructuredText Directives. For
955 \url{http://docutils.sourceforge.net/docs/ref/rst/directives.html
}.
958 %___________________________________________________________________________
960 \subsubsection*
{\phantomsection%
961 2.14.1~~~Document Parts
%
962 \addcontentsline{toc
}{subsubsection
}{2.14.1~~~Document Parts
}%
963 \label{document-parts
}%
966 An example of the ``contents'' directive can be seen above this section
967 (a local, untitled table of
\hyperref[contents
]{contents
}) and at the beginning of the
968 document (a
document-wide
\hyperref[table-of-contents
]{table of contents
}).
971 %___________________________________________________________________________
973 \subsubsection*
{\phantomsection%
974 2.14.2~~~Images and Figures
%
975 \addcontentsline{toc
}{subsubsection
}{2.14.2~~~Images and Figures
}%
976 \label{images-and-figures
}%
979 An image directive (also clickable -
{}- a hyperlink reference):
981 \hyperref[directives
]{\includegraphics{../../../docs/user/rst/images/title.png
}}
983 Image with multiple IDs:
985 \includegraphics{../../../docs/user/rst/images/title.png
}
986 \phantomsection\label{image-target-
3}\label{image-target-
2}\label{image-target-
1}
990 \noindent\makebox[\textwidth][c
]{\includegraphics{../../../docs/user/rst/images/biohazard.png
}}
992 A left-aligned image:
994 \noindent{\includegraphics{../../../docs/user/rst/images/biohazard.png
}\hfill}
996 This paragraph might flow around the image.
997 The specific behavior depends upon the style sheet and
998 the browser or rendering software used.
1000 A right-aligned image:
1002 \noindent{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png
}}
1004 This paragraph might flow around the image.
1005 The specific behavior depends upon the style sheet and
1006 the browser or rendering software used.
1008 For inline images see
\hyperref[substitution-definitions
]{Substitution Definitions
}.
1014 \includegraphics[width=
2em
]{../../../docs/user/rst/images/biohazard.png
}
1016 An image
2 em wide and
15 pixel high:
1018 \includegraphics[height=
15px,width=
2em
]{../../../docs/user/rst/images/biohazard.png
}
1020 An image occupying
50\% of the line width:
1022 \includegraphics[width=
0.500\linewidth]{../../../docs/user/rst/images/title.png
}
1026 \includegraphics[height=
2cm
]{../../../docs/user/rst/images/biohazard.png
}
1028 A
\emph{figure
} is an image with a caption and/or a legend. With page-based output
1029 media, figures might float to a different position if this helps the page
1032 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
258bp
]{../../../docs/user/rst/images/title.png
}}
1033 \caption{Plaintext markup syntax and parser system.
}
1036 \setlength{\DUtablewidth}{\linewidth}
1037 \begin{longtable
}[c
]{|p
{0.156\DUtablewidth}|p
{0.563\DUtablewidth}|
}
1042 Revised, revisited, based on 're' module.
1048 Structure-enhanced text, structuredtext.
1054 Well it is, isn't it?
1059 This paragraph is also part of the legend.
1063 A left-aligned figure:
1065 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
40px
]{../../../docs/user/rst/images/biohazard.png
}}
1066 \caption{This is the caption.
}
1070 The legend may consist of several paragraphs.
1074 This paragraph might flow around the figure.
1076 The specific behavior depends upon the style sheet and the browser or
1077 rendering software used.
1081 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
40px
]{../../../docs/user/rst/images/biohazard.png
}}
1082 \caption{This is the caption.
}
1086 The legend may consist of several paragraphs.
1090 This paragraph might flow around the figure.
1092 The specific behavior depends upon the style sheet and the browser or
1093 rendering software used.
1095 A right-aligned figure:
1097 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
40px
]{../../../docs/user/rst/images/biohazard.png
}}
1098 \caption{This is the caption.
}
1102 The legend may consist of several paragraphs.
1106 This paragraph might flow around the figure. The specific behavior depends
1107 upon the style sheet and the browser or rendering software used.
1110 %___________________________________________________________________________
1112 \subsubsection*
{\phantomsection%
1113 2.14.3~~~Admonitions
%
1114 \addcontentsline{toc
}{subsubsection
}{2.14.3~~~Admonitions
}%
1115 \label{admonitions
}%
1118 \DUadmonition[attention
]{
1119 \DUtitle[attention
]{Attention!
}
1121 Directives at large.
1124 \DUadmonition[caution
]{
1125 \DUtitle[caution
]{Caution!
}
1127 Don't take any wooden nickels.
1130 \DUadmonition[danger
]{
1131 \DUtitle[danger
]{!DANGER!
}
1133 Mad scientist at work!
1136 \DUadmonition[error
]{
1137 \DUtitle[error
]{Error
}
1142 \DUadmonition[hint
]{
1143 \DUtitle[hint
]{Hint
}
1145 It's bigger than a bread box.
1148 \DUadmonition[important
]{
1149 \DUtitle[important
]{Important
}
1153 \item Wash behind your ears.
1155 \item Clean up your room.
1157 \item Call your mother.
1159 \item Back up your data.
1164 \DUadmonition[note
]{
1165 \DUtitle[note
]{Note
}
1173 15\% if the service is good.
1176 \DUadmonition[warning
]{
1177 \DUtitle[warning
]{Warning
}
1179 Strong prose may provoke extreme mental exertion.
1180 Reader discretion is strongly advised.
1183 \DUadmonition[admonition-and-by-the-way
]{
1184 \DUtitle[admonition-and-by-the-way
]{And, by the way...
}
1186 You can make up your own admonition too.
1190 %___________________________________________________________________________
1192 \subsubsection*
{\phantomsection%
1193 2.14.4~~~Topics, Sidebars, and Rubrics
%
1194 \addcontentsline{toc
}{subsubsection
}{2.14.4~~~Topics, Sidebars, and Rubrics
}%
1195 \label{topics-sidebars-and-rubrics
}%
1198 \emph{Sidebars
} are like miniature, parallel documents.
1201 \DUtitle[title
]{Sidebar Title
}
1203 \DUsubtitle[sidebar
]{Optional Subtitle
}
1205 This is a sidebar. It is for text outside the flow of the main
1208 \DUrubric{This is a rubric inside a sidebar
}
1210 Sidebars often appear beside the main text with a border and a different
1211 background or font
color.
1214 A
\emph{topic
} is like a block quote with a title, or a self-contained section
1215 with no subsections.
1218 \DUtitle[title
]{Topic Title
}
1223 A
\emph{rubric
} is like an informal heading that doesn't correspond to the
1224 document's structure. It is typically highlighted in red (hence the name).
1226 \DUrubric{This is a rubric
}
1228 Topics and rubrics can be used at places where a
\hyperref[section-title
]{section title
} is not
1229 allowed (e.g. inside a directive).
1232 %___________________________________________________________________________
1234 \subsubsection*
{\phantomsection%
1235 2.14.5~~~Target Footnotes
%
1236 \addcontentsline{toc
}{subsubsection
}{2.14.5~~~Target Footnotes
}%
1237 \label{target-footnotes
}%
1240 \DUfootnotetext{id29
}{id30
}{5}{%
1241 \url{http://www.python.org/
}
1244 \DUfootnotetext{id34
}{id35
}{6}{%
1245 \url{http://docutils.sourceforge.net/
}
1248 \DUfootnotetext{id36
}{id37
}{7}{%
1253 %___________________________________________________________________________
1255 \subsubsection*
{\phantomsection%
1256 2.14.6~~~Replacement Text
%
1257 \addcontentsline{toc
}{subsubsection
}{2.14.6~~~Replacement Text
}%
1258 \label{replacement-text
}%
1261 I recommend you try
\href{http://www.python.org/
}{Python,
\emph{the
} best language around
}\DUfootnotemark{id32
}{id29
}{5}.
1264 %___________________________________________________________________________
1266 \subsubsection*
{\phantomsection%
1267 2.14.7~~~Compound Paragraph
%
1268 \addcontentsline{toc
}{subsubsection
}{2.14.7~~~Compound Paragraph
}%
1269 \label{compound-paragraph
}%
1272 Compound
1, paragraph
1.
1274 Compound
1, paragraph
2.
1278 \item Compound
1, list item one.
1280 \item Compound
1, list item two.
1284 Another compound statement:
1286 Compound
2, a literal block:
1288 \begin{quote
}{\ttfamily \raggedright \noindent
1289 Compound~
2,~literal.
1292 Compound
2, this is a test.
1294 Compound
3, only consisting of one paragraph.
1296 \begin{quote
}{\ttfamily \raggedright \noindent
1298 This~one~starts~with~a~literal~block.
1301 Compound
4, a paragraph.
1303 Now something
\emph{really
} perverted -
{}- a nested compound block. This is
1304 just to test that it works at all; the results don't have to be
1307 Compound
5, block
1 (a paragraph).
1309 Compound
6, block
2 in compound
5.
1311 Compound
6, another paragraph.
1313 Compound
5, block
3 (a paragraph).
1315 Compound
7, with a table inside:
1318 \setlength{\DUtablewidth}{\linewidth}
1319 \begin{longtable
}[c
]{|p
{0.249\DUtablewidth}|p
{0.249\DUtablewidth}|p
{0.249\DUtablewidth}|
}
1341 Compound
7, a paragraph after the table.
1343 Compound
7, another paragraph.
1346 %___________________________________________________________________________
1348 \subsubsection*
{\phantomsection%
1349 2.14.8~~~Parsed Literal Blocks
%
1350 \addcontentsline{toc
}{subsubsection
}{2.14.8~~~Parsed Literal Blocks
}%
1351 \label{parsed-literal-blocks
}%
1354 \begin{quote
}{\ttfamily \raggedright \noindent
1355 This~is~a~parsed~literal~block.\\
1356 ~~~~This~line~is~indented.~~The~next~line~is~blank.\\
1358 Inline~markup~is~supported,~e.g.~
\emph{emphasis
},~
\textbf{strong
},~
\texttt{literal\\
1359 text
},~footnotes
\DUfootnotemark{id22
}{id8
}{1},~
%
1360 \phantomsection\label{hyperlink-targets
}hyperlink~targets,~and~
\href{http://www.python.org/
}{references
}.
1365 %___________________________________________________________________________
1367 \subsection*
{\phantomsection%
1368 2.15~~~Substitution Definitions
%
1369 \addcontentsline{toc
}{subsection
}{2.15~~~Substitution Definitions
}%
1370 \label{substitution-definitions
}%
1373 An inline image (
\includegraphics{../../../docs/user/rst/images/biohazard.png
}) example:
1375 (Substitution definitions are not visible in the HTML source.)
1378 %___________________________________________________________________________
1380 \subsection*
{\phantomsection%
1382 \addcontentsline{toc
}{subsection
}{2.16~~~Comments
}%
1388 % Comments begin with two dots and a space. Anything may
1389 % follow, except for the syntax of footnotes, hyperlink
1390 % targets, directives, or substitution definitions.
1392 % Double-dashes -- "--" -- must be escaped somehow in HTML output.
1394 % Comments may contain non-ASCII characters: ä ö ü æ ø å
1396 (View the HTML source to see the comment.)
1399 %___________________________________________________________________________
1401 \subsection*
{\phantomsection%
1403 \addcontentsline{toc
}{subsection
}{2.17~~~Raw text
}%
1407 This does not necessarily look nice, because there may be missing white space.
1409 It's just there to freeze the behavior.
1415 \DUrole{myclass
}{Another test with myclass set.
}
1417 This is the
\DUrole{myrawroleclass
}{fourth test
} with myrawroleclass set.
1419 Fifth test in LaTeX.\
\Line two.
1422 %___________________________________________________________________________
1424 \subsection*
{\phantomsection%
1426 \addcontentsline{toc
}{subsection
}{2.18~~~Container
}%
1434 % currently not implemented in LaTeX:
1435 % .. include:: data/header_footer.txt
1438 %___________________________________________________________________________
1440 \subsection*
{\phantomsection%
1441 2.19~~~Colspanning tables
%
1442 \addcontentsline{toc
}{subsection
}{2.19~~~Colspanning tables
}%
1443 \label{colspanning-tables
}%
1446 This table has a cell spanning two columns:
1449 \setlength{\DUtablewidth}{\linewidth}
1450 \begin{longtable
}[c
]{|p
{0.075\DUtablewidth}|p
{0.075\DUtablewidth}|p
{0.086\DUtablewidth}|
}
1452 \multicolumn{2}{|l|
}{\textbf{%
1468 \multicolumn{2}{|l|
}{\textbf{%
1483 \multicolumn{3}{c
}{\hfill ... continued on next page
} \\
1521 %___________________________________________________________________________
1523 \subsection*
{\phantomsection%
1524 2.20~~~Rowspanning tables
%
1525 \addcontentsline{toc
}{subsection
}{2.20~~~Rowspanning tables
}%
1526 \label{rowspanning-tables
}%
1529 Here's a table with cells spanning several rows:
1532 \setlength{\DUtablewidth}{\linewidth}
1533 \begin{longtable
}[c
]{|p
{0.296\DUtablewidth}|p
{0.156\DUtablewidth}|p
{0.226\DUtablewidth}|
}
1536 Header row, column
1
1537 (header rows optional)
1547 Header row, column
1
1548 (header rows optional)
1556 \multicolumn{3}{c
}{\hfill ... continued on next page
} \\
1560 body row
1, column
1
1569 &
\multirow{2}{0.16\DUtablewidth}{%
1572 } &
\multirow{2}{0.23\DUtablewidth}{%
1585 %___________________________________________________________________________
1587 \subsection*
{\phantomsection%
1588 2.21~~~Custom Roles
%
1589 \addcontentsline{toc
}{subsection
}{2.21~~~Custom Roles
}%
1590 \label{custom-roles
}%
1595 \item A role based on an existing role.
1597 \texttt{\DUrole{custom
}{one
}} \texttt{\DUrole{custom
}{two
}} \texttt{\DUrole{custom
}{three
}}
1601 \DUrole{customnew
}{one two three
}
1603 \item A role with class attribute.
1605 \DUrole{special
}{interpreted text
}
1607 \item A language-switching role:
1609 Let's count in German
\otherlanguage{ngerman}{eins zwei drei
}.
1611 \item A role with multiple class attributes, styled with raw directives:
1613 \newcommand{\DUrolegreen}[1]{\textcolor{green
}{#1}}
1614 \newcommand{\DUrolesc}[1]{\textsc{#1}}
1616 The following works in most browsers but does not validate
1617 (
\texttt{<style>
} is only allowed in the
document head):
1619 \begin{quote
}{\ttfamily \raggedright \noindent
1622 ~~<style~type="text/css"><!-
{}-\\
1623 ~~~.green~\
{color:~green;\
}\\
1624 ~~~.sc~\
{font-variant:~small-caps;\
}\\
1629 \otherlanguage{british
}{\DUrole{green
}{\DUrole{sc
}{British colourful text in small-caps
}}}.
1634 %___________________________________________________________________________
1636 \subsection*
{\phantomsection%
1637 2.22~~~Testing Math
%
1638 \addcontentsline{toc
}{subsection
}{2.22~~~Testing Math
}%
1639 \label{testing-math
}%
1642 Docutils supports inline math with the prefix or postfix
\texttt{:math:
}
1643 role specificator, $n! +
\sin(x_n^
2)$ and $A_
\text{c
} =
1644 \frac{\pi}{4} d^
2$, as well as displayed math via the
1645 \texttt{math
} directive:
1648 f(
\epsilon) =
\frac{1}{1 +
\exp\left(
\frac{\varepsilon}{k_
\text{B
}T
}\right)
}
1651 N =
\frac{\text{number of apples
}}{7}
1653 The determinant of the matrix
1656 \mathbf{M
} =
\left(
\begin{matrix
}a&b\
\c&d
\end{matrix
}\right)
1658 is $|
\mathbf{M
}| = ad - bc$.
1660 Sum and Integral with limits:
1663 \int_0^
1 x^n dx =
\frac{1}{n +
1}
1666 \sum_{n=
1}^m n =
\frac{m(m+
1)
}{2}
1669 \item[{Math-Accents:
}] \leavevmode
1671 \setlength{\DUtablewidth}{\linewidth}
1672 \begin{longtable
}[c
]{p
{0.315\DUtablewidth}p
{0.315\DUtablewidth}p
{0.315\DUtablewidth}}
1674 $
\acute{a
}$
\texttt{\textbackslash{}acute\
{a\
}}
1676 $
\dot{t
}$
\texttt{\textbackslash{}dot\
{t\
}}
1678 $
\hat{\gamma}$
\texttt{\textbackslash{}hat\
{\textbackslash{}gamma\
}}
1681 $
\grave{a
}$
\texttt{\textbackslash{}grave\
{a\
}}
1683 $
\ddot{t
}$
\texttt{\textbackslash{}ddot\
{t\
}}
1685 $
\tilde{\alpha}$
\texttt{\textbackslash{}tilde\
{\textbackslash{}alpha\
}}
1688 $
\breve{x
}$
\texttt{\textbackslash{}breve\
{x\
}}
1690 $
\dddot{t
}$
\texttt{\textbackslash{}dddot\
{t\
}}
1692 $
\vec{\imath}$
\texttt{\textbackslash{}vec\
{\textbackslash{}imath\
}}
1695 $
\check{a
}$
\texttt{\textbackslash{}check\
{a\
}}
1697 $
\bar{a
}$
\texttt{\textbackslash{}bar\
{a\
}}
1699 $
\vec{R
}$
\texttt{\textbackslash{}vec\
{R\
}}
1711 -
\frac{1}{2}\nabla^
2 \psi + v
\psi =
\varepsilon \psi
1713 Math split over two lines:
1716 g(
\alpha) = & (
1 +
\alpha +
\alpha^
2 +
\alpha^
3 +
\alpha^
4\\
1719 Cases (``manually'', with
\texttt{matrix
} environment):
1728 Cases with the AMSmath
\texttt{cases
} environment is not (yet)
1729 supported by latex2MathML.
1733 % \mathrm{sgn}(x) = \begin{cases}
1739 %___________________________________________________________________________
1741 \section*
{\phantomsection%
1742 3~~~Tests for the LaTeX writer
%
1743 \addcontentsline{toc
}{section
}{3~~~Tests for the LaTeX writer
}%
1744 \label{tests-for-the-latex-writer
}%
1747 Test syntax elements which may cause trouble for the LaTeX writer but might
1748 not need to be tested with other writers (e.g. the HTML writer).
1751 %___________________________________________________________________________
1753 \subsection*
{\phantomsection%
1754 3.1~~~Custom Roles in LaTeX
%
1755 \addcontentsline{toc
}{subsection
}{3.1~~~Custom Roles in LaTeX
}%
1756 \label{custom-roles-in-latex
}%
1761 \item Role names and class arguments are converted to conform to the
1762 regular expression
\texttt{{[}a-z
{]}{[}-a-z0-
9{]}*
} (letters are downcased,
1763 accents and similar decoration is stripped, non-conforming
1764 characters are replaced by a hyphen).
1766 Class arguments may contain numbers and hyphens, which need special
1767 treatment in LaTeX command names.
1769 \DUrole{large
}{\DUrole{custom4
}{\DUrole{small-caps
}{\DUrole{custom-role
}{\DUrole{custom-role
}{Interpreted Text
}}}}}
1771 \item With LaTeX, roles can be styled within the
document using the
\DUroletitlereference{raw
}
1774 \newcommand{\DUrolelarge}[1]{{\large #1}}
1776 \@namedef
{DUrolesmall-caps
}{\textsc}
1777 \@namedef
{DUrolecustom4
}{\textbf}
1780 \DUrole{large
}{\DUrole{custom4
}{\DUrole{small-caps
}{\DUrole{custom-role
}{\DUrole{custom-role
}{Interpreted Text
}}}}} in large, bold, small-caps.
1782 \item Custom roles can be based on standard roles:
1784 This is a
\emph{\DUrole{custom-emphasis
}{customized emphasis text role
}}
1786 This is a
\texttt{\DUrole{custom-literal
}{customized literal text role
}}
1788 This is a
\textbf{\DUrole{custom-strong
}{customized strong text role
}}
1790 This is a
\textsubscript{\DUrole{custom-subscript
}{customized subscript text role
}}
1792 This is a
\textsuperscript{\DUrole{custom-superscript
}{customized superscript text role
}}
1794 This is a
\DUroletitlereference{\DUrole{custom-title-reference
}{customized title-reference text role
}}
1798 % This file is used by the standalone_rst_latex test.
1801 %___________________________________________________________________________
1803 \subsection*
{\phantomsection%
1805 \addcontentsline{toc
}{subsection
}{3.2~~~Option lists
}%
1809 The LaTeX-
2e description environment is used for definition lists.
1810 The definition is continued on the same line as the term, this should
1811 not happen if a option-list is at the top of the definition.
1813 If the option list is not at the first element in the definition, it
1814 is contained in a quote
1818 \begin{DUoptionlist
}
1820 \item[-
{}-help
] show help
1829 \item[{In a definition list:
}] \leavevmode %
1830 \begin{DUoptionlist
}
1832 \item[-
{}-help
] show help
1841 %___________________________________________________________________________
1843 \subsection*
{\phantomsection%
1844 3.3~~~Monospaced non-alphanumeric characters
%
1845 \addcontentsline{toc
}{subsection
}{3.3~~~Monospaced non-alphanumeric characters
}%
1846 \label{monospaced-non-alphanumeric-characters
}%
1849 These are all ASCII characters except a-zA-Z0-
9 and space:
1851 \texttt{!!!"
{}"
{}"\#\#\#\$\$\$\%\%\%\&\&\&'
{}'
{}'((()))***+++,
{},
{},-
{}-
{}-...///:::
}
1853 \texttt{;;;<
{}<
{}<===>
{}>
{}>???@@@
{[}{[}{[}\textbackslash{}\textbackslash{}\textbackslash{}{]}{]}{]}\textasciicircum{}\textasciicircum{}\textasciicircum{}\_\_\_`
{}`
{}`\
{\
{\
{|||\
}\
}\
}\textasciitilde{}\textasciitilde{}\textasciitilde{}}
1855 \texttt{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
1857 The two lines of non-alphanumeric characters should both have the same
1858 width as the third line.
1861 %___________________________________________________________________________
1863 \subsection*
{\phantomsection%
1864 3.4~~~Non-ASCII characters
%
1865 \addcontentsline{toc
}{subsection
}{3.4~~~Non-ASCII characters
}%
1866 \label{non-ascii-characters
}%
1869 Punctuation and footnote symbols
1872 \setlength{\DUtablewidth}{\linewidth}
1873 \begin{longtable
}[c
]{|p
{0.028\DUtablewidth}|p
{0.424\DUtablewidth}|
}
1890 single turned comma quotation mark
1896 single comma quotation mark
1902 low single comma quotation mark
1908 double turned comma quotation mark
1914 double comma quotation mark
1920 low double comma quotation mark
1974 left-right double arrow
1979 The
\DUroletitlereference{Latin-
1 extended
} Unicode block
1982 \setlength{\DUtablewidth}{\linewidth}
1983 \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}|
}
2241 \item The following line should not be wrapped, because it uses
2242 no-break spaces (
\textbackslash{}u00a0):
2244 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
2246 \item Line wrapping with/without breakpoints marked by soft hyphens
2247 (
\textbackslash{}u00ad):
2249 pdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-sch
2251 pdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrisch
2253 \item The currency sign (
\textbackslash{}u00a4) is not supported by all fonts
2254 (some have an Euro sign at its place). You might see an error
2257 \begin{quote
}{\ttfamily \raggedright \noindent
2258 !~Package~textcomp~Error:~Symbol~
\textbackslash{}textcurrency~not~provided~by\\
2259 (textcomp)~~~~~~~~~~~~~~~~font~family~ptm~in~TS1~encoding.\\
2260 (textcomp)~~~~~~~~~~~~~~~~Default~family~used~instead.
2264 (which in case of font family ptm is a false positive). Add either
2268 turn the error in a warning, use the default symbol (bitmap), or
2270 \item[{force,almostfull:
}]
2271 use the symbol provided by the font at the users
2276 to the
document options or use a different font package.
2281 %___________________________________________________________________________
2283 \subsection*
{\phantomsection%
2284 3.5~~~Encoding special chars
%
2285 \addcontentsline{toc
}{subsection
}{3.5~~~Encoding special chars
}%
2286 \label{encoding-special-chars
}%
2289 The LaTeX Info pages lists under ``
2.18 Special Characters''
2293 The following characters play a special role in LaTeX and are called
2294 ``special printing characters'', or simply ``special characters''.
2298 \# \$ \% \&
\textasciitilde{} \_ \textasciicircum{} \textbackslash{} \
{ \
}
2304 The special chars verbatim:
2306 \begin{quote
}{\ttfamily \raggedright \noindent
2307 \#~\$~\%~\&~
\textasciitilde{}~
\_~
\textasciicircum{}~
\textbackslash{}~\
{~\
}
2311 However also
\emph{square brackets
} {[}{]} need special care.
2315 item and all the other commands with optional arguments check
2316 if the token right after the macro name is an opening bracket.
2317 In that case the contents between that bracket and the following
2318 closing bracket on the same grouping level are taken as the
2319 optional argument. What makes this unintuitive is the fact that
2320 the square brackets aren't grouping characters themselves, so in
2321 your last example item
{[}{[}...
{]}{]} the optional argument consists of
2322 {[}... (without the closing bracket).
2326 Compare the items in the following lists:
2332 \item {[}bracketed
{]} item
2337 \item[{simple
}] \leavevmode
2340 \item[{{[}bracketed
{]}}] \leavevmode
2345 The OT1 font-encoding has different characters for the less-than,
2346 greater-than and bar, < | >, except for typewriter font
\DUroletitlereference{cmtt
}:
2348 \begin{quote
}{\ttfamily \raggedright \noindent
2354 %___________________________________________________________________________
2356 \subsection*
{\phantomsection%
2357 3.6~~~Hyperlinks and -targets
%
2358 \addcontentsline{toc
}{subsection
}{3.6~~~Hyperlinks and -targets
}%
2359 \label{hyperlinks-and-targets
}%
2362 In LaTeX, we must set an explicit anchor (
\texttt{\textbackslash{}phantomsection
}) for a
2364 \phantomsection\label{hypertarget-in-plain-text
}hypertarget in plain text or in a figure but not in a longtable or
2368 \setlength{\DUtablewidth}{\linewidth}
2369 \begin{longtable
}[c
]{|p
{0.075\DUtablewidth}|p
{0.075\DUtablewidth}|p
{0.075\DUtablewidth}|
}
2370 \caption{Table with
%
2371 \label{hypertarget-in-table-title
}hypertarget in table title.
}\\
2384 \phantomsection\label{figure-label
}
2385 \noindent\makebox[\textwidth][c
]{\includegraphics{../../../docs/user/rst/images/biohazard.png
}}
2386 \caption{Figure with
%
2387 \label{hypertarget-in-figure-caption
}hypertarget in figure caption.
}
2390 \phantomsection\label{hypertarget-in-figure-legend
}hypertarget in figure legend.
2394 \includegraphics{../../../docs/user/rst/images/biohazard.png
}
2395 \phantomsection\label{image-label
}
2397 See
\hyperref[hypertarget-in-plain-text
]{hypertarget in plain text
},
2398 \hyperref[table-label
]{table label
},
\hyperref[hypertarget-in-table-title
]{hypertarget in table title
},
2399 \hyperref[figure-label
]{figure label
},
\hyperref[hypertarget-in-figure-caption
]{hypertarget in figure caption
},
2400 \hyperref[hypertarget-in-figure-legend
]{hypertarget in figure legend
}, and
2401 \hyperref[image-label
]{image label
}.
2404 %___________________________________________________________________________
2406 \subsection*
{\phantomsection%
2407 3.7~~~External references
%
2408 \addcontentsline{toc
}{subsection
}{3.7~~~External references
}%
2409 \label{external-references
}%
2412 Long URLs should be wrapped in the PDF.
2413 This can be achieved with the url command which is used by the LaTeX writer
2414 wheneve the content (name) of a reference node equals the link URL.
2417 \item[{Example:
}] \leavevmode
2418 a long URL that should wrap in the output
2419 \url{http://docutils.sourceforge.net/docs/user/latex.html\#id79
}
2423 If the argument contains any ``\%'', ``\#'', or ``
\textasciicircum{}\textasciicircum{}'', or ends with
\texttt{\textbackslash{}}, it can't
2424 be used in the argument to another command. The argument must not contain
2427 The characters
\textasciicircum{}, \
{, \
}, and
\texttt{\textbackslash{}} are invalid in a ``http:'' or ``ftp:'' URL
2428 and not recognized as part of it:
2430 \begin{DUlineblock
}{0em
}
2431 \item[] \url{http://www.example.org
}/strange
\textasciicircum{}\textasciicircum{}name
2432 \item[] \url{http://www.example.org
}\textbackslash{}using
\textbackslash{}DOS
\textbackslash{}paths
\textbackslash{}
2433 \item[] \url{http://www.example.org/XML
}/strange\
{n\
}ame
2436 They can, however be used in paths and/or filenames.
2438 Handling by the LaTeX writer:
2442 \item \texttt{\#
},
\texttt{\textbackslash{}} and
\texttt{\%
} are escaped:
2444 \begin{DUlineblock
}{0em
}
2445 \item[] \href{http://www.w3.org/XML/Schema\#dev
}{URL with \#
}
2446 \url{http://www.w3.org/XML/Schema\#dev
}
2447 \item[] \href{http://www.w3.org/XML/Schema\%dev
}{URL with \%
}
2448 \url{http://example.org/Schema\%dev
}
2449 \item[] \href{A:DOS\
\path\\
}{file with DOS path
}\DUfootnotemark{id37
}{id36
}{7} \url{A:DOS\
\path\\
}\DUfootnotemark{id38
}{id36
}{7}
2452 \DUadmonition[note
]{
2453 \DUtitle[note
]{Note
}
2455 These URLs are typeset inside a LaTeX command without error.
2457 \begin{DUlineblock
}{0em
}
2458 \item[] \url{http://www.w3.org/XML/Schema\#dev
}
2459 \item[] \url{http://example.org/Schema\%dev
}
2460 \item[] \url{A:DOS\
\path\\
}\DUfootnotemark{id39
}{id36
}{7}
2468 \item \textasciicircum{}\textasciicircum{} LaTeX's special syntax for characters results in ``strange'' replacements
2469 (both with href and url). A warning is given.
2471 \href{../strange^^name
}{file with
\textasciicircum{}\textasciicircum{}}:
2472 \url{../strange^^name
}
2474 \item Unbalanced braces, \
{ or \
}, will fail (both with href and url):
2476 \begin{quote
}{\ttfamily \raggedright \noindent
2477 `file~with~\
{~<../strange\
{name>`
\_\_\\
2478 `<../strange\
{name>`
\_\_
2482 while balanced braces are suported:
2484 \begin{DUlineblock
}{0em
}
2485 \item[] \url{../strange
{n
}ame
}
2486 \item[] \url{../st
{r
}ange
{n
}ame
}
2487 \item[] \url{../
{st
{r
}ange
{n
}ame
}}
2492 % unusual combinations (from newlatex, for interactive testing)
2493 % .. include:: data/latex.txt
2495 % Preface for System Messages:
2498 %___________________________________________________________________________
2500 \section*
{\phantomsection%
2502 \addcontentsline{toc
}{section
}{4~~~Error Handling
}%
2503 \label{error-handling
}%
2506 Any errors caught during processing will generate system messages.
2508 There should be five messages in the following, auto-generated
2509 section, ``Docutils System Messages'':
2511 % section should be added by Docutils automatically
2514 %___________________________________________________________________________
2516 \section*
{\phantomsection%
2517 \color{red
}Docutils System Messages
%
2518 \addcontentsline{toc
}{section
}{Docutils System Messages
}%
2521 \DUadmonition[system-message
]{
2522 \DUtitle[system-message
]{system-message
}
2523 \raisebox{1em
}{\hypertarget{id27
}{}}
2525 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
104
2528 Undefined substitution referenced: ``problematic''.
2531 \DUadmonition[system-message
]{
2532 \DUtitle[system-message
]{system-message
}
2533 \raisebox{1em
}{\hypertarget{id40
}{}}
2535 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
390
2538 Unknown target name: ``
5''.
2541 \DUadmonition[system-message
]{
2542 \DUtitle[system-message
]{system-message
}
2543 \raisebox{1em
}{\hypertarget{id42
}{}}
2545 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
399
2548 Unknown target name: ``nonexistent''.
2551 \DUadmonition[system-message
]{
2552 \DUtitle[system-message
]{system-message
}
2553 \raisebox{1em
}{\hypertarget{id44
}{}}
2555 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
426
2558 Unknown target name: ``hyperlink reference without a target''.
2561 \DUadmonition[system-message
]{
2562 \DUtitle[system-message
]{system-message
}
2563 \raisebox{1em
}{\hypertarget{id46
}{}}
2565 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
439
2568 Duplicate target name, cannot be used as a unique reference: ``duplicate target names''.