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}
13 % basic code highlight:
14 \providecommand*
\DUrolecomment[1]{\textcolor[rgb
]{0.40,
0.40,
0.40}{#1}}
15 \providecommand*
\DUroledeleted[1]{\textcolor[rgb
]{0.40,
0.40,
0.40}{#1}}
16 \providecommand*
\DUrolekeyword[1]{\textbf{#1}}
17 \providecommand*
\DUrolestring[1]{\textit{#1}}
19 \usepackage{float
} % float configuration
20 \floatplacement{figure
}{H
} % place figures here definitely
24 \setcounter{secnumdepth
}{0}
25 \usepackage{longtable,ltcaption,array
}
26 \setlength{\extrarowheight}{2pt
}
27 \newlength{\DUtablewidth} % internal use in tables
29 \usepackage{textcomp
} % text symbol macros
31 %%% Custom LaTeX preamble
33 \usepackage{mathptmx
} % Times
34 \usepackage[scaled=
.90]{helvet
}
37 %%% User specified packages and stylesheets
39 %%% Fallback definitions for Docutils-specific commands
41 % providelength (provide a length variable and set default, if it is new)
42 \providecommand*
{\DUprovidelength}[2]{
43 \ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{}
47 \providecommand*
{\DUtitleabstract}[1]{\centerline{\textbf{#1}}}
49 % admonition (specially marked topic)
50 \providecommand{\DUadmonition}[2][class-arg
]{%
51 % try \DUadmonition#1{#2}:
52 \ifcsname DUadmonition
#1\endcsname%
53 \csname DUadmonition
#1\endcsname{#2}%
56 \fbox{\parbox{0.9\textwidth}{#2}}
62 \@namedef
{DUrolealign-center
}{\centering}
67 \providecommand{\DUtopicdedication}[1]{\begin{center
}#1\end{center
}}
69 % docinfo (width of docinfo table)
70 \DUprovidelength{\DUdocinfowidth}{0.9\textwidth}
72 % error admonition title
73 \providecommand*
{\DUtitleerror}[1]{\DUtitle{\color{red
}#1}}
75 % fieldlist environment
76 \ifthenelse{\isundefined{\DUfieldlist}}{
77 \newenvironment{DUfieldlist
}%
79 {\enddescription\endquote}
81 % numeric or symbol footnotes with hyperlinks
82 \providecommand*
{\DUfootnotemark}[3]{%
83 \raisebox{1em
}{\hypertarget{#1}{}}%
84 \hyperlink{#2}{\textsuperscript{#3}}%
86 \providecommand{\DUfootnotetext}[4]{%
88 \renewcommand{\thefootnote}{%
89 \protect\raisebox{1em
}{\protect\hypertarget{#1}{}}%
90 \protect\hyperlink{#2}{#3}}%
95 % inline markup (custom roles)
96 % \DUrole{#1}{#2} tries \DUrole#1{#2}
97 \providecommand*
{\DUrole}[2]{%
98 \ifcsname DUrole
#1\endcsname%
99 \csname DUrole
#1\endcsname{#2}%
100 \else% backwards compatibility: try \docutilsrole#1{#2}
101 \ifcsname docutilsrole
#1\endcsname%
102 \csname docutilsrole
#1\endcsname{#2}%
110 \ifthenelse{\isundefined{\DUlegend}}{
111 \newenvironment{DUlegend
}{\small}{}
114 % lineblock environment
115 \DUprovidelength{\DUlineblockindent}{2.5em
}
116 \ifthenelse{\isundefined{\DUlineblock}}{
117 \newenvironment{DUlineblock
}[1]{%
118 \list{}{\setlength{\partopsep}{\parskip}
119 \addtolength{\partopsep}{\baselineskip}
120 \setlength{\topsep}{0pt
}
121 \setlength{\itemsep}{0.15\baselineskip}
122 \setlength{\parsep}{0pt
}
123 \setlength{\leftmargin}{#1}}
129 % optionlist environment
130 \providecommand*
{\DUoptionlistlabel}[1]{\bf #1 \hfill}
131 \DUprovidelength{\DUoptionlistindent}{3cm
}
132 \ifthenelse{\isundefined{\DUoptionlist}}{
133 \newenvironment{DUoptionlist
}{%
134 \list{}{\setlength{\labelwidth}{\DUoptionlistindent}
135 \setlength{\rightmargin}{1cm
}
136 \setlength{\leftmargin}{\rightmargin}
137 \addtolength{\leftmargin}{\labelwidth}
138 \addtolength{\leftmargin}{\labelsep}
139 \renewcommand{\makelabel}{\DUoptionlistlabel}}
144 % rubric (informal heading)
145 \providecommand*
{\DUrubric}[2][class-arg
]{%
146 \subsubsection*
{\centering\textit{\textmd{#2}}}}
148 % sidebar (text outside the main text flow)
149 \providecommand{\DUsidebar}[2][class-arg
]{%
151 \colorbox[gray
]{0.80}{\parbox{0.9\textwidth}{#2}}
155 % subtitle (for topic/sidebar)
156 \providecommand*
{\DUsubtitle}[2][class-arg
]{\par\emph{#2}\smallskip}
158 % title for topics, admonitions, unsupported section levels, and sidebar
159 \providecommand*
{\DUtitle}[2][class-arg
]{%
160 % call \DUtitle#1{#2} if it exists:
161 \ifcsname DUtitle
#1\endcsname%
162 \csname DUtitle
#1\endcsname{#2}%
164 \smallskip\noindent\textbf{#2}\smallskip%
168 % titlereference role
169 \providecommand*
{\DUroletitlereference}[1]{\textsl{#1}}
171 % topic (quote with heading)
172 \providecommand{\DUtopic}[2][class-arg
]{%
173 \ifcsname DUtopic
#1\endcsname%
174 \csname DUtopic
#1\endcsname{#2}%
176 \begin{quote
}#2\end{quote
}
180 % transition (break, fancybreak, anonymous section)
181 \providecommand*
{\DUtransition}[1][class-arg
]{%
182 \hspace*
{\fill}\hrulefill\hspace*
{\fill}
183 \vskip 0.5\baselineskip
187 \ifthenelse{\isundefined{\hypersetup}}{
188 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue
]{hyperref
}
189 \urlstyle{same
} % normal text font (alternatives: tt, rm, sf)
192 pdftitle=
{reStructuredText Test Document
},
193 pdfauthor=
{David Goodger;Me;Myself;I
}
197 \title{\phantomsection%
198 reStructuredText Test Document
%
199 \label{restructuredtext-test-
document}%
202 \large{Examples of Syntax Constructs
}%
203 \label{examples-of-syntax-constructs
}%
214 \begin{tabularx
}{\DUdocinfowidth}{lX
}
223 \href{mailto:goodger@python.org
}{goodger@python.org
} \\
230 \textbf{Organization
}: &
233 Now, or yesterday. Or maybe even
\emph{before
} yesterday. \\
235 This is a “work in progress” \\
237 is managed by a version control system. \\
240 \textbf{Copyright
}: &
241 This
document has been placed in the public domain. You
242 may do with it as you wish. You may copy, modify,
243 redistribute, reattribute, sell, buy, rent, lease,
244 destroy, or improve it, quote it at length, excerpt,
245 incorporate, collate, fold, staple, or mutilate it, or do
246 anything else to it that your or anyone else’s heart
248 \textbf{field name
}: &
249 This is a “generic bibliographic field”.
251 \textbf{field name “
2”
}: &
252 Generic bibliographic fields may contain multiple body elements.
259 \DUtopic[dedication
]{
260 \DUtitle[dedication
]{Dedication
}
262 For Docutils users \& co-developers.
266 \DUtitle[abstract
]{Abstract
}
268 This is a test
document, containing at least one example of each
269 reStructuredText construct.
272 % This is a comment. Note how any initial comments are moved by
273 % transforms to after the document title, subtitle, and docinfo.
275 % Above is the document title, and below is the subtitle.
276 % They are transformed from section titles after parsing.
278 % bibliographic fields (which also require a transform):
280 \pagebreak[4] % start ToC on new page
282 \phantomsection\label{table-of-contents
}
283 \pdfbookmark[1]{Table of Contents
}{table-of-contents
}
284 \renewcommand{\contentsname}{Table of Contents
}
289 \section{1~~~Structural Elements
%
290 \label{structural-elements
}%
294 \subsection{1.1~~~Section Title
%
295 \label{section-title
}%
297 \subsubsection*
{Section Subtitle
}
299 Lone subsections are converted to a section subtitle by a transform
300 activated with the
\texttt{-
{}-section-subtitles
} command line option or the
301 \texttt{sectsubtitle-xform
} configuration value.
304 \subsection{1.2~~~Empty Section
%
305 \label{empty-section
}%
309 \subsection{1.3~~~Transitions
%
316 %___________________________________________________________________________
320 It divides the section. Transitions may also occur between sections:
323 %___________________________________________________________________________
328 \section{2~~~Body Elements
%
329 \label{body-elements
}%
333 \subsection{2.1~~~Paragraphs
%
340 \subsubsection{2.1.1~~~Inline Markup
%
341 \label{inline-markup
}%
344 Paragraphs contain text and may contain inline markup:
\emph{emphasis
},
345 \textbf{strong emphasis
},
\texttt{inline literals
}, standalone hyperlinks
346 (
\url{http://www.python.org
}), external hyperlinks (
\href{http://www.python.org/
}{Python
}\DUfootnotemark{id30
}{id29
}{5}), internal
347 cross-references (
\hyperref[example
]{example
}), external hyperlinks with embedded URIs
348 (
\href{http://www.python.org
}{Python web site
}),
\href{http://www.python.org/
}{anonymous hyperlink
349 references
}\DUfootnotemark{id38
}{id29
}{5} (
\href{http://docutils.sourceforge.net/
}{a second reference
}\DUfootnotemark{id40
}{id39
}{8}), footnote references (manually
350 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
]}),
351 substitution references (
\includegraphics{../../../docs/user/rst/images/biohazard.png
}), and
%
352 \phantomsection\label{inline-hyperlink-targets
}inline hyperlink targets
353 (see
\hyperref[targets
]{Targets
} below for a reference back to here). Character-level
354 inline markup is also possible (although exceedingly ugly!) in
\emph{re
}\texttt{Structured
}\emph{Text
}. Problems are indicated by
%
355 \raisebox{1em
}{\hypertarget{id28
}{}}\hyperlink{id27
}{\textbf{\color{red
}|problematic|
}} text
356 (generated by processing errors; this one is intentional). Here is a
357 reference to the
\hyperref[doctitle
]{doctitle
} and the
\hyperref[subtitle
]{subtitle
}.
359 The default role for interpreted text is
\DUroletitlereference{Title Reference
}. Here are
360 some explicit interpreted text roles: a PEP reference (
\href{http://www.python.org/dev/peps/pep-
0287}{PEP
287}); an
361 RFC reference (
\href{http://www.faqs.org/rfcs/rfc2822.html
}{RFC
2822}); an abbreviation (
\DUrole{abbreviation
}{abb.
}), an acronym
362 (
\DUrole{acronym
}{reST
}), code (
\texttt{\DUrole{code
}{print
\textquotedbl{}hello world
\textquotedbl{}}}); a
\textsubscript{subscript
};
363 a
\textsuperscript{superscript
} and explicit roles for
\DUroletitlereference{Docutils
}’
364 \emph{standard
} \textbf{inline
} \texttt{markup
}.
366 % DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!
368 Let’s test wrapping and whitespace significance in inline literals:
369 \texttt{This is an example of -
{}-inline-literal -
{}-text, -
{}-including some-
{}-
370 strangely-
{}-hyphenated-words. ~Adjust-the-width-of-your-browser-window
371 to see how the text is wrapped. ~-
{}- -
{}-
{}-
{}- -
{}-
{}-
{}-
{}-
{}-
{}-
{}- ~Now note ~ ~the
372 spacing ~ ~between the ~ ~words of ~ ~this sentence ~ ~(words
373 should ~ ~be grouped ~ ~in pairs).
}
375 If the
\texttt{-
{}-pep-references
} option was supplied, there should be a
376 live link to PEP
258 here.
379 \subsection{2.2~~~Bullet Lists
%
380 \label{bullet-lists
}%
389 \item Nested bullet list.
397 Paragraph
2 of item
2.
401 \item Nested bullet list.
415 \item This nested list should be compacted by the HTML writer.
417 \phantomsection\label{target
}
418 % Even if this item contains a target and a comment.
425 \subsection{2.3~~~Enumerated Lists
%
426 \label{enumerated-lists
}%
428 \newcounter{listcnt0
}
429 \begin{list
}{\arabic{listcnt0
}.
}
431 \usecounter{listcnt0
}
432 \setlength{\rightmargin}{\leftmargin}
435 \item Arabic numerals.
436 \newcounter{listcnt1
}
437 \begin{list
}{\alph{listcnt1
})
}
439 \usecounter{listcnt1
}
440 \setlength{\rightmargin}{\leftmargin}
444 \newcounter{listcnt2
}
445 \begin{list
}{(
\roman{listcnt2
})
}
447 \usecounter{listcnt2
}
448 \setlength{\rightmargin}{\leftmargin}
452 \newcounter{listcnt3
}
453 \begin{list
}{\Alph{listcnt3
}.
}
455 \usecounter{listcnt3
}
456 \setlength{\rightmargin}{\leftmargin}
460 \newcounter{listcnt4
}
461 \begin{list
}{\Roman{listcnt4
})
}
463 \usecounter{listcnt4
}
464 \setlength{\rightmargin}{\leftmargin}
473 \item Lists that don’t start at
1:
474 \setcounter{listcnt1
}{0}
475 \begin{list
}{\arabic{listcnt1
}.
}
477 \usecounter{listcnt1
}
478 \addtocounter{listcnt1
}{2}
479 \setlength{\rightmargin}{\leftmargin}
486 \setcounter{listcnt1
}{0}
487 \begin{list
}{\Alph{listcnt1
}.
}
489 \usecounter{listcnt1
}
490 \addtocounter{listcnt1
}{2}
491 \setlength{\rightmargin}{\leftmargin}
498 \setcounter{listcnt1
}{0}
499 \begin{list
}{\roman{listcnt1
}.
}
501 \usecounter{listcnt1
}
502 \addtocounter{listcnt1
}{2}
503 \setlength{\rightmargin}{\leftmargin}
513 \subsection{2.4~~~Definition Lists
%
514 \label{definition-lists
}%
518 \item[{Term
}] \leavevmode
521 \item[{Term
}] \leavevmode (
\textbf{classifier
})
523 Definition paragraph
1.
525 Definition paragraph
2.
527 \item[{Term
}] \leavevmode
530 \item[{Term
}] \leavevmode (
\textbf{classifier one
})
531 (
\textbf{classifier two
})
538 \subsection{2.5~~~Field Lists
%
544 Field lists map field names to field bodies, like database
545 records. They are often part of an extension syntax. They are
546 an unambiguous variant of RFC
2822 fields.
548 \item[{how arg1 arg2:
}]
549 The field marker is a colon, the field name, and a colon.
551 The field body may contain one or more body elements, indented
552 relative to the field marker.
555 \DUrole{credits
}{This paragraph has the
\DUroletitlereference{credits
} class set. (This is actually not
556 about credits but just for ensuring that the class attribute
557 doesn’t get stripped away.)
}
562 \subsection{2.6~~~Option Lists
%
563 \label{option-lists
}%
566 For listing command-line options:
570 \item[-a
] command-line option “a”
572 \item[-b file
] options can have arguments
573 and long descriptions
575 \item[-
{}-long
] options can be long also
577 \item[-
{}-input=file
] long options can also have
580 \item[-
{}-very-long-option
] The description can also start on the next line.
582 The description may contain multiple body elements,
583 regardless of where it starts.
585 \item[-x, -y, -z
] Multiple options are an “option group”.
587 \item[-v, -
{}-verbose
] Commonly-seen: short \& long options.
589 \item[-
1 file, -
{}-one=file, -
{}-two file
] Multiple options with arguments.
591 \item[/V
] DOS/VMS-style options too
595 There must be at least two spaces between the option and the
599 \subsection{2.7~~~Literal Blocks
%
600 \label{literal-blocks
}%
603 Literal blocks are indicated with a double-colon (“::”) at the end of
604 the preceding paragraph (over there
\texttt{-
{}->
}). They can be indented:
606 \begin{quote
}{\ttfamily \raggedright \noindent
608 ~~~~text~=~'is~left~as-is'\\
609 ~~~~spaces
\_and\_linebreaks~=~'are~preserved'\\
610 ~~~~markup
\_processing~=~None
614 Or they can be quoted without indentation:
616 \begin{quote
}{\ttfamily \raggedright \noindent
619 >~Why~didn't~I~think~of~that?
624 \subsection{2.8~~~Line Blocks
%
628 This section tests line blocks. Line blocks are body elements which
629 consist of lines and other line blocks. Nested line blocks cause
632 \begin{DUlineblock
}{0em
}
633 \item[] This is a line block. It ends with a blank line.
635 \begin{DUlineblock
}{\DUlineblockindent}
636 \item[] New lines begin with a vertical bar (“|”).
637 \item[] Line breaks and initial indent are significant, and preserved.
639 \begin{DUlineblock
}{\DUlineblockindent}
640 \item[] Continuation lines are also possible. A long line that is intended
641 to wrap should begin with a space in place of the vertical bar.
643 \item[] The left edge of a continuation line need not be aligned with
644 the left edge of the text above it.
648 \begin{DUlineblock
}{0em
}
649 \item[] This is a second line block.
651 \item[] Blank lines are permitted internally, but they must begin with a “|”.
654 Another line block, surrounded by paragraphs:
656 \begin{DUlineblock
}{0em
}
657 \item[] And it’s no good waiting by the window
658 \item[] It’s no good waiting for the sun
659 \item[] Please believe me, the things you dream of
660 \item[] They don’t fall in the lap of no-one
663 Take it away, Eric the Orchestra Leader!
667 \begin{DUlineblock
}{0em
}
668 \item[] A one, two, a one two three four
670 \item[] Half a bee, philosophically,
672 \begin{DUlineblock
}{\DUlineblockindent}
673 \item[] must,
\emph{ipso facto
}, half not be.
675 \item[] But half the bee has got to be,
677 \begin{DUlineblock
}{\DUlineblockindent}
678 \item[] \emph{vis a vis
} its entity. D’you see?
681 \item[] But can a bee be said to be
683 \begin{DUlineblock
}{\DUlineblockindent}
684 \item[] or not to be an entire bee,
686 \begin{DUlineblock
}{\DUlineblockindent}
687 \item[] when half the bee is not a bee,
689 \begin{DUlineblock
}{\DUlineblockindent}
690 \item[] due to some ancient injury?
700 A line block, like the following poem by Christian Morgenstern, can
701 also be centre-aligned:
703 \begin{DUlineblock
}{0em
}
704 \foreignlanguage{ngerman}{\DUrole{align-center
}{
705 \item[] \textbf{Die Trichter
}
707 \item[] Zwei Trichter wandeln durch die Nacht.
708 \item[] Durch ihres Rumpfs verengten Schacht
709 \item[] fließt weißes Mondlicht
710 \item[] still und heiter
720 \subsection{2.9~~~Block Quotes
%
721 \label{block-quotes
}%
724 Block quotes consist of indented body elements:
728 My theory by A. Elk. Brackets Miss, brackets. This theory goes
729 as follows and begins now. All brontosauruses are thin at one
730 end, much much thicker in the middle and then thin again at the
731 far end. That is my theory, it is mine, and belongs to me and I
732 own it, and what it is too.
735 \raggedleft —Anne Elk (Miss)
739 The language of a quote (like any other object) can be specified by
745 \foreignlanguage{french
}{
746 ReStructuredText est un langage de balisage léger utilisé
747 notamment dans la documentation du langage Python.
752 \subsection{2.10~~~Doctest Blocks
%
753 \label{doctest-blocks
}%
756 \begin{quote
}{\ttfamily \raggedright \noindent
757 >
{}>
{}>~print~'Python-specific~usage~examples;~begun~with~
\textquotedbl{}>
{}>
{}>
\textquotedbl{}'\\
758 Python-specific~usage~examples;~begun~with~
\textquotedbl{}>
{}>
{}>
\textquotedbl{}\\
759 >
{}>
{}>~print~'(cut~and~pasted~from~interactive~Python~sessions)'\\
760 (cut~and~pasted~from~interactive~Python~sessions)
765 \subsection{2.11~~~Footnotes
%
769 \DUfootnotetext{id8
}{id1
}{1}{%
770 A footnote contains body elements, consistently indented by at
773 This is the footnote’s second paragraph.
776 \DUfootnotetext{label
}{id3
}{2}{\phantomsection\label{label
}%
777 Footnotes may be numbered, either manually (as in
\DUfootnotemark{id9
}{id8
}{1}) or
778 automatically using a “\#”-prefixed label. This footnote has a
779 label so it can be referred to from multiple places, both as a
780 footnote reference (
\DUfootnotemark{id10
}{label
}{2}) and as a
\hyperref[label
]{hyperlink reference
}.
783 \DUfootnotetext{id12
}{id2
}{3}{%
784 This footnote is numbered automatically and anonymously using a
787 This is the second paragraph.
789 And this is the third paragraph.
792 \DUfootnotetext{id13
}{id4
}{*
}{%
793 Footnotes may also use symbols, specified with a “*” label.
794 Here’s a reference to the next footnote:
\DUfootnotemark{id14
}{id15
}{†
}.
797 \DUfootnotetext{id15
}{id14
}{†
}{%
798 This footnote shows the next symbol in the sequence.
801 \DUfootnotetext{id16
}{id16
}{4}{%
802 Here’s an unreferenced footnote, with a reference to a
803 nonexistent footnote:
%
804 \raisebox{1em
}{\hypertarget{id46
}{}}%
805 \raisebox{1em
}{\hypertarget{id17
}{}}\hyperlink{id45
}{\textbf{\color{red
}{[}5{]}\_}}.
809 \subsection{2.12~~~Citations
%
812 \begin{figure
}[b
]\raisebox{1em
}{\hypertarget{cit2002
}{}}[CIT2002
]
813 Citations are text-labeled footnotes. They may be
814 rendered separately and differently from footnotes.
817 Here’s a reference to the above,
\hyperlink{cit2002
}{[CIT2002
]}, and a
%
818 \raisebox{1em
}{\hypertarget{id48
}{}}%
819 \raisebox{1em
}{\hypertarget{id19
}{}}\hyperlink{id47
}{\textbf{\color{red
}{[}nonexistent
{]}\_}}
823 \subsection{2.13~~~Targets
%
825 \label{another-target
}%
828 \phantomsection\label{example
}
829 This paragraph is pointed to by the explicit “example” target. A
830 reference can be found under
\hyperref[inline-markup
]{Inline Markup
}, above.
\hyperref[inline-hyperlink-targets
]{Inline
831 hyperlink targets
} are also possible.
833 Section headers are implicit targets, referred to by name. See
834 \hyperref[targets
]{Targets
}, which is a subsection of
\hyperref[body-elements
]{Body Elements
}.
836 Explicit external targets are interpolated into references such as
837 “
\href{http://www.python.org/
}{Python
}\DUfootnotemark{id31
}{id29
}{5}”.
839 Targets may be indirect and anonymous. Thus
\hyperref[targets
]{this phrase
} may also
840 refer to the
\hyperref[targets
]{Targets
} section.
843 \raisebox{1em
}{\hypertarget{id50
}{}}\hyperlink{id49
}{\textbf{\color{red
}`hyperlink reference without a target`
\_}}, which generates an
847 \subsubsection{2.13.1~~~Duplicate Target Names
%
848 \label{duplicate-target-names
}%
851 Duplicate names in section headers or other implicit targets will
852 generate “info” (level-
1) system messages. Duplicate names in
853 explicit targets will generate “warning” (level-
2) system messages.
856 \subsubsection{2.13.2~~~Duplicate Target Names
%
860 Since there are two “Duplicate Target Names” section headers, we
861 cannot uniquely refer to either of them by name. If we try to (like
863 \raisebox{1em
}{\hypertarget{id52
}{}}\hyperlink{id51
}{\textbf{\color{red
}`Duplicate Target Names`
\_}}), an error is generated.
866 \subsection{2.14~~~Directives
%
870 \phantomsection\label{contents
}
871 These are just a sample of the many reStructuredText Directives. For
873 \url{http://docutils.sourceforge.net/docs/ref/rst/directives.html
}.
876 \subsubsection{2.14.1~~~Document Parts
%
877 \label{document-parts
}%
880 An example of the “contents” directive can be seen above this section
881 (a local, untitled table of
\hyperref[contents
]{contents
}) and at the beginning of the
882 document (a
document-wide
\hyperref[table-of-contents
]{table of contents
}).
885 \subsubsection{2.14.2~~~Images and Figures
%
886 \label{images-and-figures
}%
889 An image directive (also clickable – a hyperlink reference):
891 \hyperref[directives
]{\includegraphics{../../../docs/user/rst/images/title.png
}}
893 Image with multiple IDs:
895 \includegraphics{../../../docs/user/rst/images/title.png
}
896 \phantomsection\label{image-target-
3}\label{image-target-
2}\label{image-target-
1}
900 \noindent\makebox[\textwidth][c
]{\includegraphics{../../../docs/user/rst/images/biohazard.png
}}
902 A left-aligned image:
904 \noindent{\includegraphics{../../../docs/user/rst/images/biohazard.png
}\hfill}
906 This paragraph might flow around the image.
907 The specific behavior depends upon the style sheet and
908 the browser or rendering software used.
910 A right-aligned image:
912 \noindent{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png
}}
914 This paragraph might flow around the image.
915 The specific behavior depends upon the style sheet and
916 the browser or rendering software used.
918 For inline images see
\hyperref[substitution-definitions
]{Substitution Definitions
}.
924 \includegraphics[width=
2em
]{../../../docs/user/rst/images/biohazard.png
}
926 An image
2 em wide and
15 pixel high:
928 \includegraphics[height=
15px,width=
2em
]{../../../docs/user/rst/images/biohazard.png
}
930 An image occupying
50\% of the line width:
932 \includegraphics[width=
0.500\linewidth]{../../../docs/user/rst/images/title.png
}
936 \includegraphics[height=
2cm
]{../../../docs/user/rst/images/biohazard.png
}
938 A
\emph{figure
} is an image with a caption and/or a legend. With page-based output
939 media, figures might float to a different position if this helps the page
943 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
258bp
]{../../../docs/user/rst/images/title.png
}}
944 \caption{Plaintext markup syntax and parser system.
}
946 \setlength{\DUtablewidth}{\linewidth}
947 \begin{longtable*
}[c
]{|p
{0.156\DUtablewidth}|p
{0.563\DUtablewidth}|
}
952 Revised, revisited, based on ‘re’ module.
958 Structure-enhanced text, structuredtext.
964 Well it is, isn’t it?
969 This paragraph is also part of the legend.
973 A left-aligned figure:
975 \begin{figure
} % align = "left"
976 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
40px
]{../../../docs/user/rst/images/biohazard.png
}}
977 \caption{This is the caption.
}
981 The legend may consist of several paragraphs.
985 This paragraph might flow around the figure.
987 The specific behavior depends upon the style sheet and the browser or
988 rendering software used.
993 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
40px
]{../../../docs/user/rst/images/biohazard.png
}}
994 \caption{This is the caption.
}
998 The legend may consist of several paragraphs.
1002 This paragraph might flow around the figure.
1004 The specific behavior depends upon the style sheet and the browser or
1005 rendering software used.
1007 A right-aligned figure:
1009 \begin{figure
} % align = "right"
1010 \noindent\makebox[\textwidth][c
]{\includegraphics[width=
40px
]{../../../docs/user/rst/images/biohazard.png
}}
1011 \caption{This is the caption.
}
1015 The legend may consist of several paragraphs.
1019 This paragraph might flow around the figure. The specific behavior depends
1020 upon the style sheet and the browser or rendering software used.
1023 \subsubsection{2.14.3~~~Admonitions
%
1024 \label{admonitions
}%
1027 \DUadmonition[attention
]{
1028 \DUtitle[attention
]{Attention!
}
1030 Directives at large.
1033 \DUadmonition[caution
]{
1034 \DUtitle[caution
]{Caution!
}
1036 Don’t take any wooden nickels.
1039 \DUadmonition[danger
]{
1040 \DUtitle[danger
]{!DANGER!
}
1042 Mad scientist at work!
1045 \DUadmonition[error
]{
1046 \DUtitle[error
]{Error
}
1051 \DUadmonition[hint
]{
1052 \DUtitle[hint
]{Hint
}
1054 It’s bigger than a bread box.
1057 \DUadmonition[important
]{
1058 \DUtitle[important
]{Important
}
1062 \item Wash behind your ears.
1064 \item Clean up your room.
1066 \item Call your mother.
1068 \item Back up your data.
1073 \DUadmonition[note
]{
1074 \DUtitle[note
]{Note
}
1082 15\% if the service is good.
1085 \DUadmonition[warning
]{
1086 \DUtitle[warning
]{Warning
}
1088 Strong prose may provoke extreme mental exertion.
1089 Reader discretion is strongly advised.
1092 \DUadmonition[admonition-and-by-the-way
]{
1093 \DUtitle[admonition-and-by-the-way
]{And, by the way…
}
1095 You can make up your own admonition too.
1099 \subsubsection{2.14.4~~~Topics, Sidebars, and Rubrics
%
1100 \label{topics-sidebars-and-rubrics
}%
1103 \emph{Sidebars
} are like miniature, parallel documents.
1106 \DUtitle[title
]{Sidebar Title
}
1108 \DUsubtitle[sidebar
]{Optional Subtitle
}
1110 This is a sidebar. It is for text outside the flow of the main
1113 \DUrubric{This is a rubric inside a sidebar
}
1115 Sidebars often appear beside the main text with a border and a different
1116 background or font
color.
1119 A
\emph{topic
} is like a block quote with a title, or a self-contained section
1120 with no subsections.
1123 \DUtitle[title
]{Topic Title
}
1128 A
\emph{rubric
} is like an informal heading that doesn’t correspond to the
1129 document’s structure. It is typically highlighted in red (hence the name).
1131 \DUrubric{This is a rubric
}
1133 Topics and rubrics can be used at places where a
\hyperref[section-title
]{section title
} is not
1134 allowed (e.g. inside a directive).
1137 \subsubsection{2.14.5~~~Target Footnotes
%
1138 \label{target-footnotes
}%
1141 \DUfootnotetext{id29
}{id30
}{5}{%
1142 \url{http://www.python.org/
}
1145 \DUfootnotetext{id33
}{id34
}{6}{%
1146 \url{http://pygments.org/
}
1149 \DUfootnotetext{id35
}{id36
}{7}{%
1150 \url{ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf
}
1153 \DUfootnotetext{id39
}{id40
}{8}{%
1154 \url{http://docutils.sourceforge.net/
}
1157 \DUfootnotetext{id41
}{id42
}{9}{%
1162 \subsubsection{2.14.6~~~Replacement Text
%
1163 \label{replacement-text
}%
1166 I recommend you try
\href{http://www.python.org/
}{Python,
\emph{the
} best language around
}\DUfootnotemark{id32
}{id29
}{5}.
1169 \subsubsection{2.14.7~~~Compound Paragraph
%
1170 \label{compound-paragraph
}%
1173 Compound
1, paragraph
1.
1175 Compound
1, paragraph
2.
1179 \item Compound
1, list item one.
1181 \item Compound
1, list item two.
1185 Another compound statement:
1187 Compound
2, a literal block:
1189 \begin{quote
}{\ttfamily \raggedright \noindent
1190 Compound~
2,~literal.
1193 Compound
2, this is a test.
1195 Compound
3, only consisting of one paragraph.
1197 \begin{quote
}{\ttfamily \raggedright \noindent
1199 This~one~starts~with~a~literal~block.
1202 Compound
4, a paragraph.
1204 Now something
\emph{really
} perverted – a nested compound block. This is
1205 just to test that it works at all; the results don’t have to be
1208 Compound
5, block
1 (a paragraph).
1210 Compound
6, block
2 in compound
5.
1212 Compound
6, another paragraph.
1214 Compound
5, block
3 (a paragraph).
1216 Compound
7, with a table inside:
1218 \setlength{\DUtablewidth}{\linewidth}
1219 \begin{longtable*
}[c
]{|p
{0.249\DUtablewidth}|p
{0.249\DUtablewidth}|p
{0.249\DUtablewidth}|
}
1241 Compound
7, a paragraph after the table.
1243 Compound
7, another paragraph.
1246 \subsubsection{2.14.8~~~Parsed Literal Blocks
%
1247 \label{parsed-literal-blocks
}%
1250 \begin{quote
}{\ttfamily \raggedright \noindent
1251 This~is~a~parsed~literal~block.\\
1252 ~~~~This~line~is~indented.~~The~next~line~is~blank.\\
1254 Inline~markup~is~supported,~e.g.~
\emph{emphasis
},~
\textbf{strong
},~
\texttt{literal\\
1255 text
},~footnotes
\DUfootnotemark{id22
}{id8
}{1},~
%
1256 \phantomsection\label{hyperlink-targets
}hyperlink~targets,~and~
\href{http://www.python.org/
}{references
}.
1261 \subsubsection{2.14.9~~~Code
%
1265 Blocks of source code can be set with the
\DUroletitlereference{code
} directive. If the code
1266 language is specified, the content is parsed and tagged by the
\href{http://pygments.org/
}{Pygments
}\DUfootnotemark{id34
}{id33
}{6}
1267 syntax highlighter and can be formatted with a style sheet. (Code parsing
1268 is turned off using the
\texttt{syntax-highlight
} config setting in the test
1269 conversions in order to get identical results with/without installed
1270 Pygments highlighter.)
1272 \begin{quote
}{\ttfamily \raggedright \noindent
1273 print~'This~is~Python~code.'
1277 The
\texttt{:number-lines:
} option (with optional start value) generates line
1280 \begin{quote
}{\ttfamily \raggedright \noindent
1281 \DUrole{ln
}{~
8~
}\#~print~integers~from~
0~to~
9:\\
1282 \DUrole{ln
}{~
9~
}for~i~in~range(
10):\\
1283 \DUrole{ln
}{10~
}~~~~print~i
1287 For inline code snippets, there is the
\DUroletitlereference{code
} role, which can be used
1288 directly (the code will not be parsed/tagged, as the language is not known)
1289 or as base for special code roles, e.g. the LaTeX code in the next
1292 Docutils uses LaTeX syntax for math directives and roles:
1293 \texttt{\DUrole{code
}{\DUrole{tex
}{\textbackslash{}alpha = f(x)
}}} prints $
\alpha = f(x)$.
1295 The
\texttt{:code:
} option of the
\DUroletitlereference{include
} directive sets the included content
1296 as a code block, here the rst file
\texttt{header
\_footer.txt
} with line numbers:
1298 \begin{quote
}{\ttfamily \raggedright \noindent
1299 \DUrole{ln
}{1~
}..~header::~Document~header\\
1300 \DUrole{ln
}{2~
}..~footer::~Document~footer
1305 \subsection{2.15~~~Substitution Definitions
%
1306 \label{substitution-definitions
}%
1309 An inline image (
\includegraphics{../../../docs/user/rst/images/biohazard.png
}) example:
1311 (Substitution definitions are not visible in the HTML source.)
1314 \subsection{2.16~~~Comments
%
1320 % Comments begin with two dots and a space. Anything may
1321 % follow, except for the syntax of footnotes, hyperlink
1322 % targets, directives, or substitution definitions.
1324 % Double-dashes -- "--" -- must be escaped somehow in HTML output.
1326 % Comments may contain non-ASCII characters: ä ö ü æ ø å
1328 (View the HTML source to see the comment.)
1331 \subsection{2.17~~~Raw text
%
1335 This does not necessarily look nice, because there may be missing white space.
1337 It’s just there to freeze the behavior.
1343 \DUrole{myclass
}{Another test with myclass set.
}
1345 This is the
\DUrole{myrawroleclass
}{fourth test
} with myrawroleclass set.
1347 Fifth test in LaTeX.\
\Line two.
1350 \subsection{2.18~~~Container
%
1358 % currently not implemented in LaTeX:
1359 % .. include:: data/header_footer.txt
1362 \subsection{2.19~~~Colspanning tables
%
1363 \label{colspanning-tables
}%
1366 This table has a cell spanning two columns:
1368 \setlength{\DUtablewidth}{\linewidth}
1369 \begin{longtable*
}[c
]{|p
{0.075\DUtablewidth}|p
{0.075\DUtablewidth}|p
{0.086\DUtablewidth}|
}
1371 \multicolumn{2}{|p
{0.15\DUtablewidth}|
}{\textbf{%
1387 \multicolumn{2}{|p
{0.15\DUtablewidth}|
}{\textbf{%
1402 \multicolumn{3}{c
}{\hfill ... continued on next page
} \\
1440 \subsection{2.20~~~Rowspanning tables
%
1441 \label{rowspanning-tables
}%
1444 Here’s a table with cells spanning several rows:
1446 \setlength{\DUtablewidth}{\linewidth}
1447 \begin{longtable*
}[c
]{|p
{0.296\DUtablewidth}|p
{0.156\DUtablewidth}|p
{0.226\DUtablewidth}|
}
1450 Header row, column
1
1451 (header rows optional)
1461 Header row, column
1
1462 (header rows optional)
1470 \multicolumn{3}{c
}{\hfill ... continued on next page
} \\
1474 body row
1, column
1
1483 &
\multirow{2}{0.16\DUtablewidth}{%
1486 } &
\multirow{2}{0.23\DUtablewidth}{%
1499 \subsection{2.21~~~Custom Roles
%
1500 \label{custom-roles
}%
1505 \item A role based on an existing role.
1507 \texttt{\DUrole{custom
}{one
}} \texttt{\DUrole{custom
}{two
}} \texttt{\DUrole{custom
}{three
}}
1511 \DUrole{customnew
}{one two three
}
1513 \item A role with class attribute.
1515 \DUrole{special
}{interpreted text
}
1517 \item A language-switching role:
1519 Let’s count in German
\foreignlanguage{ngerman}{eins zwei drei
}.
1521 \item A role with multiple class attributes, styled with raw directives:
1523 \newcommand{\DUrolegreen}[1]{\textcolor{green
}{#1}}
1524 \newcommand{\DUrolesc}[1]{\textsc{#1}}
1526 The following works in most browsers but does not validate
1527 (
\texttt{<style>
} is only allowed in the
document head):
1529 \begin{quote
}{\ttfamily \raggedright \noindent
1532 ~~<style~type=
\textquotedbl{}text/css
\textquotedbl{}><!-
{}-\\
1533 ~~~.green~\
{color:~green;\
}\\
1534 ~~~.sc~\
{font-variant:~small-caps;\
}\\
1539 \DUrole{green
}{\DUrole{sc
}{\foreignlanguage{british
}{British colourful text in small-caps
}}}.
1544 \subsection{2.22~~~Mathematics
%
1545 \label{mathematics
}%
1548 Docutils supports inline math with the prefix or postfix
\texttt{:math:
}
1549 role specificator, $n! +
\sin(x_n^
2)$ and $A_
\text{c
} =
1550 \frac{\pi}{4} d^
2$, as well as displayed math via the
1551 \DUroletitlereference{math
} directive:
1554 f(
\epsilon) =
\frac{1}{1 +
\exp\left(
\frac{\varepsilon}{k_
\text{B
}T
}\right)
}
1556 Content may start on the first line of the directive, e.g.
1559 N =
\frac{\text{number of apples
}}{7}
1561 Equations can be labeled with a reference name using the
\texttt{:name:
} option.
1562 See
\hyperref[eq-m
]{eq:M
} and
\hyperref[eq-schrodinger
]{eq:schrödinger
} below.
1564 The determinant of the matrix
1567 \mathbf{M
} =
\left(
\begin{matrix
}a&b\
\c&d
\end{matrix
}\right)
1571 is $|
\mathbf{M
}| = ad - bc$.
1573 More than one display math block can be put in one math directive.
1574 For example, the following sum and integral with limits:
1577 \int_0^
1 x^n dx =
\frac{1}{n +
1}
1580 \sum_{n=
1}^m n =
\frac{m(m+
1)
}{2}
1582 LaTeX-supported Unicode math symbols can be used in math roles and
1585 The Schrödinger equation
1588 i
\hbar \frac{\partial }{\partial t
}\Psi =
\hat{H
}\Psi ,
1590 \label{eq-schrodinger
}
1592 with the
\emph{wave function
} $
\Psi $, describes how the quantum state of a
1593 physical system changes in time.
1596 \item[{Math-Accents:
}] \leavevmode
1597 \setlength{\DUtablewidth}{\linewidth}
1598 \begin{longtable*
}[c
]{p
{0.315\DUtablewidth}p
{0.315\DUtablewidth}p
{0.315\DUtablewidth}}
1600 $
\acute{a
}$
\texttt{\textbackslash{}acute\
{a\
}}
1602 $
\dot{t
}$
\texttt{\textbackslash{}dot\
{t\
}}
1604 $
\hat{\gamma}$
\texttt{\textbackslash{}hat\
{\textbackslash{}gamma\
}}
1607 $
\grave{a
}$
\texttt{\textbackslash{}grave\
{a\
}}
1609 $
\ddot{t
}$
\texttt{\textbackslash{}ddot\
{t\
}}
1611 $
\tilde{\alpha}$
\texttt{\textbackslash{}tilde\
{\textbackslash{}alpha\
}}
1614 $
\breve{x
}$
\texttt{\textbackslash{}breve\
{x\
}}
1616 $
\dddot{t
}$
\texttt{\textbackslash{}dddot\
{t\
}}
1618 $
\vec{\imath}$
\texttt{\textbackslash{}vec\
{\textbackslash{}imath\
}}
1621 $
\check{a
}$
\texttt{\textbackslash{}check\
{a\
}}
1623 $
\bar{a
}$
\texttt{\textbackslash{}bar\
{a\
}}
1625 $
\vec{R
}$
\texttt{\textbackslash{}vec\
{R\
}}
1634 Modulation Transfer Function:
1637 \text{MTF
} =
\left|
\frac{\mathcal{F
}\
{s(x)\
}}
1638 {\mathcal{F
}\
{ s(x)\
} |_
{\omega _
{x
}=
0}}\right|
1639 =
\mathrm{abs
}\left(
\frac
1640 {\int _
{-
\infty }^
{\infty }s(x)
\mathrm{e
}^
{\mathrm{i
}\omega _
{x
}x
}\mathrm{d
}{x
}}
1641 {\int _
{-
\infty }^
{\infty }s(x)
\mathrm{d
}{x
}}
1644 Math split over two lines: If a double backslash is detected outside a
1645 \texttt{\textbackslash{}begin\
{...\
} \textbackslash{}end\
{...\
}} pair, the math code is wrapped in an
\href{ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf
}{AMSmath
}\DUfootnotemark{id36
}{id35
}{7}
1646 \texttt{align
} environment:
1649 s_
{\mathrm{out
}}(x) & = s_
{\mathrm{in
}}(x') * s_
\delta (x-x') \\
1650 & =
\int s_
{\mathrm{in
}}(x')s_
\delta (x-x')
\mathrm{d
}x'
1652 Cases (“manually”, with
\texttt{matrix
} environment):
1655 \mathrm{sgn
}(x) =
\left\
{\begin{matrix
}
1660 Cases with the
\href{ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf
}{AMSmath
}\DUfootnotemark{id37
}{id35
}{7} \texttt{cases
} environment (not (yet) supported by
1661 HTML writers with
\texttt{-
{}-math-output=MathML
}):
1664 \mathrm{sgn
}(x) =
\begin{cases
}
1670 \section{3~~~Tests for the LaTeX writer
%
1671 \label{tests-for-the-latex-writer
}%
1674 Test syntax elements which may cause trouble for the LaTeX writer but might
1675 not need to be tested with other writers (e.g. the HTML writer).
1678 \subsection{3.1~~~Custom Roles in LaTeX
%
1679 \label{custom-roles-in-latex
}%
1684 \item Role names and class arguments are converted to conform to the
1685 regular expression
\texttt{{[}a-z
{]}{[}-a-z0-
9{]}*
} (letters are downcased,
1686 accents and similar decoration is stripped, non-conforming
1687 characters are replaced by a hyphen).
1689 Class arguments may contain numbers and hyphens, which need special
1690 treatment in LaTeX command names.
1692 \DUrole{large
}{\DUrole{custom4
}{\DUrole{small-caps
}{\DUrole{custom-role
}{\DUrole{custom-role
}{Interpreted Text
}}}}}
1694 \item With LaTeX, roles can be styled within the
document using the
\DUroletitlereference{raw
}
1697 \newcommand{\DUrolelarge}[1]{{\large #1}}
1699 \@namedef
{DUrolesmall-caps
}{\textsc}
1700 \@namedef
{DUrolecustom4
}{\textbf}
1703 \DUrole{large
}{\DUrole{custom4
}{\DUrole{small-caps
}{\DUrole{custom-role
}{\DUrole{custom-role
}{Interpreted Text
}}}}} in large, bold, small-caps.
1705 \item Custom roles can be based on standard roles:
1707 This is a
\emph{\DUrole{custom-emphasis
}{customized emphasis text role
}}
1709 This is a
\texttt{\DUrole{custom-literal
}{customized literal text role
}}
1711 This is a
\textbf{\DUrole{custom-strong
}{customized strong text role
}}
1713 This is a
\textsubscript{\DUrole{custom-subscript
}{customized subscript text role
}}
1715 This is a
\textsuperscript{\DUrole{custom-superscript
}{customized superscript text role
}}
1717 This is a
\DUroletitlereference{\DUrole{custom-title-reference
}{customized title-reference text role
}}
1722 \subsection{3.2~~~More Tables
%
1723 \label{more-tables
}%
1726 A multicolumn table with multi-paragraph rowspanning cells:
1728 \setlength{\DUtablewidth}{\linewidth}
1729 \begin{longtable*
}[c
]{|p
{0.133\DUtablewidth}|p
{0.179\DUtablewidth}|p
{0.179\DUtablewidth}|p
{0.110\DUtablewidth}|p
{0.121\DUtablewidth}|p
{0.145\DUtablewidth}|
}
1735 &
\multicolumn{3}{p
{0.41\DUtablewidth}|
}{
1738 With a second paragraph
1743 \multicolumn{2}{|p
{0.31\DUtablewidth}|
}{
1746 With a second paragraph
1759 &
\multicolumn{2}{p
{0.36\DUtablewidth}|
}{
1760 multicolumn
3 (one line,
1761 but very very very very
1777 &
\multicolumn{3}{p
{0.38\DUtablewidth}|
}{
1783 A table with multirow header
1787 \setlength{\DUtablewidth}{\linewidth}
1788 \begin{longtable*
}[c
]{|p
{0.156\DUtablewidth}|p
{0.238\DUtablewidth}|
}
1790 \multirow{2}{0.16\DUtablewidth}{%
1803 \multirow{2}{0.16\DUtablewidth}{%
1815 \multicolumn{2}{c
}{\hfill ... continued on next page
} \\
1818 \multicolumn{2}{|p
{0.39\DUtablewidth}|
}{
1819 multirow header breaks latex
1826 % This file is used by the standalone_rst_latex test.
1829 \subsection{3.3~~~Option lists
%
1833 The LaTeX-
2e description environment is used for definition lists.
1834 The definition is continued on the same line as the term, this should
1835 not happen if a option-list is at the top of the definition.
1837 If the option list is not at the first element in the definition, it
1838 is contained in a quote
1842 \begin{DUoptionlist
}
1844 \item[-
{}-help
] show help
1853 \item[{In a definition list:
}] \leavevmode %
1854 \begin{DUoptionlist
}
1856 \item[-
{}-help
] show help
1865 \subsection{3.4~~~Monospaced non-alphanumeric characters
%
1866 \label{monospaced-non-alphanumeric-characters
}%
1869 These are all ASCII characters except a-zA-Z0-
9 and space:
1871 \texttt{!!!
\textquotedbl{}\textquotedbl{}\textquotedbl{}\#\#\#\$\$\$\%\%\%\&\&\&'
{}'
{}'((()))***+++,
{},
{},-
{}-
{}-...///:::
}
1873 \texttt{;;;<
{}<
{}<===>
{}>
{}>???@@@
{[}{[}{[}\textbackslash{}\textbackslash{}\textbackslash{}{]}{]}{]}\textasciicircum{}\textasciicircum{}\textasciicircum{}\_\_\_`
{}`
{}`\
{\
{\
{|||\
}\
}\
}\textasciitilde{}\textasciitilde{}\textasciitilde{}}
1875 \texttt{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
1877 The two lines of non-alphanumeric characters should both have the same
1878 width as the third line.
1881 \subsection{3.5~~~Non-ASCII characters
%
1882 \label{non-ascii-characters
}%
1885 Punctuation and footnote symbols
1887 \setlength{\DUtablewidth}{\linewidth}
1888 \begin{longtable*
}[c
]{|p
{0.028\DUtablewidth}|p
{0.424\DUtablewidth}|
}
1905 single turned comma quotation mark
1911 single comma quotation mark
1917 low single comma quotation mark
1923 double turned comma quotation mark
1929 double comma quotation mark
1935 low double comma quotation mark
1989 left-right double arrow
1994 The
\DUroletitlereference{Latin-
1 extended
} Unicode block
1996 \setlength{\DUtablewidth}{\linewidth}
1997 \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}|
}
2255 \item The following line should not be wrapped, because it uses
2256 no-break spaces (
\textbackslash{}u00a0):
2258 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
2260 \item Line wrapping with/without breakpoints marked by soft hyphens
2261 (
\textbackslash{}u00ad):
2263 pdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-schpdn\-derd\-mdtd\-ri\-sch
2265 pdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrischpdnderdmdtdrisch
2267 \item The currency sign (
\textbackslash{}u00a4) is not supported by all fonts
2268 (some have an Euro sign at its place). You might see an error
2271 \begin{quote
}{\ttfamily \raggedright \noindent
2272 !~Package~textcomp~Error:~Symbol~
\textbackslash{}textcurrency~not~provided~by\\
2273 (textcomp)~~~~~~~~~~~~~~~~font~family~ptm~in~TS1~encoding.\\
2274 (textcomp)~~~~~~~~~~~~~~~~Default~family~used~instead.
2278 (which in case of font family ptm is a false positive). Add either
2282 turn the error in a warning, use the default symbol (bitmap), or
2284 \item[{force,almostfull:
}]
2285 use the symbol provided by the font at the users
2290 to the
document options or use a different font package.
2295 \subsection{3.6~~~Encoding special chars
%
2296 \label{encoding-special-chars
}%
2299 The LaTeX Info pages lists under “
2.18 Special Characters”
2303 The following characters play a special role in LaTeX and are called
2304 “special printing characters”, or simply “special characters”.
2308 \# \$ \% \&
\textasciitilde{} \_ \textasciicircum{} \textbackslash{} \
{ \
}
2314 The special chars verbatim:
2316 \begin{quote
}{\ttfamily \raggedright \noindent
2317 \#~\$~\%~\&~
\textasciitilde{}~
\_~
\textasciicircum{}~
\textbackslash{}~\
{~\
}
2321 However also
\emph{square brackets
} {[}{]} need special care.
2325 item and all the other commands with optional arguments check
2326 if the token right after the macro name is an opening bracket.
2327 In that case the contents between that bracket and the following
2328 closing bracket on the same grouping level are taken as the
2329 optional argument. What makes this unintuitive is the fact that
2330 the square brackets aren’t grouping characters themselves, so in
2331 your last example item
{[}{[}…
{]}{]} the optional argument consists of
2332 {[}… (without the closing bracket).
2336 Compare the items in the following lists:
2342 \item {[}bracketed
{]} item
2347 \item[{simple
}] \leavevmode
2350 \item[{{[}bracketed
{]}}] \leavevmode
2355 The OT1 font-encoding has different characters for the less-than,
2356 greater-than and bar, < | >, except for typewriter font
\DUroletitlereference{cmtt
}:
2358 \begin{quote
}{\ttfamily \raggedright \noindent
2364 \subsection{3.7~~~Hyperlinks and -targets
%
2365 \label{hyperlinks-and-targets
}%
2368 In LaTeX, we must set an explicit anchor (
\texttt{\textbackslash{}phantomsection
}) for a
2370 \phantomsection\label{hypertarget-in-plain-text
}hypertarget in plain text or in a figure but not in a longtable or
2373 \setlength{\DUtablewidth}{\linewidth}
2374 \begin{longtable
}[c
]{|p
{0.075\DUtablewidth}|p
{0.075\DUtablewidth}|p
{0.075\DUtablewidth}|
}
2375 \caption{Table with
%
2376 \label{hypertarget-in-table-title
}hypertarget in table title.
}\\
2390 \phantomsection\label{figure-label
}
2391 \noindent\makebox[\textwidth][c
]{\includegraphics{../../../docs/user/rst/images/biohazard.png
}}
2392 \caption{Figure with
%
2393 \label{hypertarget-in-figure-caption
}hypertarget in figure caption.
}
2396 \phantomsection\label{hypertarget-in-figure-legend
}hypertarget in figure legend.
2400 \includegraphics{../../../docs/user/rst/images/biohazard.png
}
2401 \phantomsection\label{image-label
}
2403 See
\hyperref[hypertarget-in-plain-text
]{hypertarget in plain text
},
2404 \hyperref[table-label
]{table label
},
\hyperref[hypertarget-in-table-title
]{hypertarget in table title
},
2405 \hyperref[figure-label
]{figure label
},
\hyperref[hypertarget-in-figure-caption
]{hypertarget in figure caption
},
2406 \hyperref[hypertarget-in-figure-legend
]{hypertarget in figure legend
}, and
2407 \hyperref[image-label
]{image label
}.
2410 \subsection{3.8~~~External references
%
2411 \label{external-references
}%
2414 Long URLs should be wrapped in the PDF.
2415 This can be achieved with the url command which is used by the LaTeX writer
2416 whenever the content (name) of a reference node equals the link URL.
2419 \item[{Example:
}] \leavevmode
2420 a long URL that should wrap in the output
2421 \url{http://docutils.sourceforge.net/docs/user/latex.html\#id79
}
2425 If the argument contains any “\%”, “\#”, or “
\textasciicircum{}\textasciicircum{}”, or ends with
\texttt{\textbackslash{}}, it can’t
2426 be used in the argument to another command. The argument must not contain
2429 The characters
\textasciicircum{}, \
{, \
}, and
\texttt{\textbackslash{}} are invalid in a “http:” or “ftp:” URL
2430 and not recognized as part of it:
2432 \begin{DUlineblock
}{0em
}
2433 \item[] \url{http://www.example.org
}/strange
\textasciicircum{}\textasciicircum{}name
2434 \item[] \url{http://www.example.org
}\textbackslash{}using
\textbackslash{}DOS
\textbackslash{}paths
\textbackslash{}
2435 \item[] \url{http://www.example.org/XML
}/strange\
{n\
}ame
2438 They can, however be used in paths and/or filenames.
2440 Handling by the LaTeX writer:
2444 \item \texttt{\#
},
\texttt{\textbackslash{}} and
\texttt{\%
} are escaped:
2446 \begin{DUlineblock
}{0em
}
2447 \item[] \href{http://www.w3.org/XML/Schema\#dev
}{URL with \#
}
2448 \url{http://www.w3.org/XML/Schema\#dev
}
2449 \item[] \href{http://www.w3.org/XML/Schema\%dev
}{URL with \%
}
2450 \url{http://example.org/Schema\%dev
}
2451 \item[] \href{A:DOS\
\path\\
}{file with DOS path
}\DUfootnotemark{id42
}{id41
}{9} \url{A:DOS\
\path\\
}\DUfootnotemark{id43
}{id41
}{9}
2454 \DUadmonition[note
]{
2455 \DUtitle[note
]{Note
}
2457 These URLs are typeset inside a LaTeX command without error.
2459 \begin{DUlineblock
}{0em
}
2460 \item[] \url{http://www.w3.org/XML/Schema\#dev
}
2461 \item[] \url{http://example.org/Schema\%dev
}
2462 \item[] \url{A:DOS\
\path\\
}\DUfootnotemark{id44
}{id41
}{9}
2470 \item \textasciicircum{}\textasciicircum{} LaTeX’s special syntax for characters results in “strange” replacements
2471 (both with href and url). A warning is given.
2473 \href{../strange^^name
}{file with
\textasciicircum{}\textasciicircum{}}:
2474 \url{../strange^^name
}
2476 \item Unbalanced braces, \
{ or \
}, will fail (both with href and url):
2478 \begin{quote
}{\ttfamily \raggedright \noindent
2479 `file~with~\
{~<../strange\
{name>`
\_\_\\
2480 `<../strange\
{name>`
\_\_
2484 while balanced braces are suported:
2486 \begin{DUlineblock
}{0em
}
2487 \item[] \url{../strange
{n
}ame
}
2488 \item[] \url{../st
{r
}ange
{n
}ame
}
2489 \item[] \url{../
{st
{r
}ange
{n
}ame
}}
2495 \subsection{3.9~~~Section titles with
\hyperref[inline-markup
]{inline markup
}%
2496 \label{section-titles-with-inline-markup
}%
2500 \subsubsection{3.9.1~~~
\emph{emphasized
}, H
\textsubscript{2}O and $x^
2$
%
2501 \label{emphasized-h2o-and-x-
2}%
2505 \subsubsection{3.9.2~~~Substitutions work
%
2506 \label{substitutions-fail
}%
2510 \subsection{3.10~~~Deeply nested sections
%
2511 \label{deeply-nested-sections
}%
2517 \subsubsection{3.10.1~~~Level
3%
2524 \paragraph{3.10.1.1~~~level
4%
2531 \subparagraph{3.10.1.1.1~~~level
5%
2535 (depending on the
document class)
2538 \DUtitle[sectionVI
]{3.10.1.1.1.1~~~level
6%
2542 an unsupported level.
2544 % unusual combinations (from newlatex, for interactive testing)
2545 % .. include:: data/latex.txt
2547 % Preface for System Messages:
2550 \section{4~~~Error Handling
%
2551 \label{error-handling
}%
2554 Any errors caught during processing will generate system messages.
2556 There should be five messages in the following, auto-generated
2557 section, “Docutils System Messages”:
2559 % section should be added by Docutils automatically
2562 \section[Docutils System Messages
]{\color{red
}Docutils System Messages
%
2565 \DUadmonition[system-message
]{
2566 \DUtitle[system-message
]{system-message
}
2567 \raisebox{1em
}{\hypertarget{id27
}{}}
2569 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
104
2572 Undefined substitution referenced:
\textquotedbl{}problematic
\textquotedbl{}.
2575 \DUadmonition[system-message
]{
2576 \DUtitle[system-message
]{system-message
}
2577 \raisebox{1em
}{\hypertarget{id45
}{}}
2579 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
391
2582 Unknown target name:
\textquotedbl{}5\textquotedbl{}.
2585 \DUadmonition[system-message
]{
2586 \DUtitle[system-message
]{system-message
}
2587 \raisebox{1em
}{\hypertarget{id47
}{}}
2589 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
400
2592 Unknown target name:
\textquotedbl{}nonexistent
\textquotedbl{}.
2595 \DUadmonition[system-message
]{
2596 \DUtitle[system-message
]{system-message
}
2597 \raisebox{1em
}{\hypertarget{id49
}{}}
2599 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
427
2602 Unknown target name:
\textquotedbl{}hyperlink reference without a target
\textquotedbl{}.
2605 \DUadmonition[system-message
]{
2606 \DUtitle[system-message
]{system-message
}
2607 \raisebox{1em
}{\hypertarget{id51
}{}}
2609 {\color{red
}ERROR/
3} in
\texttt{functional/input/data/standard.txt
}, line~
440
2612 Duplicate target name, cannot be used as a unique reference:
\textquotedbl{}duplicate target names
\textquotedbl{}.