1 \documentclass[a4paper]{article
}
2 % generated by Docutils <http://docutils.sourceforge.net/>
3 \usepackage{cmap
} % fix search and cut-and-paste in Acrobat
5 \usepackage[T1]{fontenc}
6 \usepackage[utf8
]{inputenc}
10 \usepackage{longtable,ltcaption,array
}
11 \setlength{\extrarowheight}{2pt
}
12 \newlength{\DUtablewidth} % internal use in tables
14 %%% Custom LaTeX preamble
16 \usepackage{mathptmx
} % Times
17 \usepackage[scaled=
.90]{helvet
}
20 %%% User specified packages and stylesheets
22 %%% Fallback definitions for Docutils-specific commands
24 % class handling for environments (block-level elements)
25 % \begin{DUclass}{spam} tries \DUCLASSspam and
26 % \end{DUclass}{spam} tries \endDUCLASSspam
27 \ifx\DUclass\undefined % poor man's "provideenvironment"
28 \newenvironment{DUclass
}[1]%
29 {\def\DocutilsClassFunctionName{DUCLASS
#1}% arg cannot be used in end-part of environment.
30 \csname \DocutilsClassFunctionName \endcsname}%
31 {\csname end
\DocutilsClassFunctionName \endcsname}%
33 % numeric or symbol footnotes with hyperlinks
34 \providecommand*
{\DUfootnotemark}[3]{%
35 \raisebox{1em
}{\hypertarget{#1}{}}%
36 \hyperlink{#2}{\textsuperscript{#3}}%
38 \providecommand{\DUfootnotetext}[4]{%
40 \renewcommand{\thefootnote}{%
41 \protect\raisebox{1em
}{\protect\hypertarget{#1}{}}%
42 \protect\hyperlink{#2}{#3}}%
47 % inline markup (custom roles)
48 % \DUrole{#1}{#2} tries \DUrole#1{#2}
49 \providecommand*
{\DUrole}[2]{%
50 \ifcsname DUrole
#1\endcsname%
51 \csname DUrole
#1\endcsname{#2}%
53 % backwards compatibility: try \docutilsrole#1{#2}
54 \ifcsname docutilsrole
#1\endcsname%
55 \csname docutilsrole
#1\endcsname{#2}%
63 \ifx\textsubscript\undefined
64 \usepackage{fixltx2e
} % since 2015 loaded by default
68 \providecommand*
{\DUroletitlereference}[1]{\textsl{#1}}
70 % character width in monospaced font
71 \newlength{\ttemwidth}
72 \settowidth{\ttemwidth}{\ttfamily M
}
75 \ifthenelse{\isundefined{\hypersetup}}{
76 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue
]{hyperref
}
78 \urlstyle{same
} % normal text font (alternatives: tt, rm, sf)
84 In LaTeX, literal blocks can be customized with the
\textquotedbl{}literal-block-env
\textquotedbl{}
85 setting. This test file exists to check the latex writer output compiles and
86 looks as expected. Start with a plain literal block:
90 $
\sin^
2(x)$ and $
\cos^
2(x)$ equals one:
93 \sin^
2(x) +
\cos^
2(x) =
1 % for all x
98 A latex
\textquotedbl{}code-block
\textquotedbl{} (set with
\textquotedbl{}literal-block-env
\textquotedbl{}, if syntax
99 highlight is
\textquotedbl{}none
\textquotedbl{}):
101 \begin{DUclass
}{code
}
102 \begin{DUclass
}{latex
}
105 $
\sin^
2(x)$ and $
\cos^
2(x)$ equals one:
108 \sin^
2(x) +
\cos^
2(x) =
1 % for all x
115 A literal block in a table:
117 \setlength{\DUtablewidth}{\linewidth}
118 \begin{longtable*
}[c
]{|p
{0.063\DUtablewidth}|p
{0.145\DUtablewidth}|p
{0.063\DUtablewidth}|
}
123 \begin{minipage
}{8\ttemwidth}
134 A literal block in a table with auto-width columns:
136 \begin{longtable*
}[c
]{|l|l|l|
}
139 \ttfamily\raggedright
140 \textbackslash{}sin
\textasciicircum{}2~x
145 Parsed literal block with inline markup and leading whitespace:
148 \ttfamily\raggedright
149 ~~~
\emph{emphasis
},~
\textbf{strong~emphasis
},~
\texttt{inline~literals
},\\
150 standalone~hyperlinks~(
\url{http://www.python.org
}),\\
151 \hyperref[internal
]{internal
}~and~
\href{http://www.python.org/
}{external
}~hyperlinks,\\
153 \phantomsection\label{internal
}internal~hyperlink~targets,\\
154 images~via~substitution~references~(
\includegraphics{../../../docs/user/rst/images/biohazard.png
}),\\
155 footnote~references
\DUfootnotemark{id1
}{id3
}{*
},\\
156 citation~references~(
\hyperlink{cit2002
}{[CIT2002
]}),~and~more.\\
158 ~~~Here~are~some~explicit~interpreted~text~roles:\\
159 a~PEP~reference~(
\href{http://www.python.org/dev/peps/pep-
0287}{PEP~
287}),\\
160 an~RFC~reference~(
\href{http://tools.ietf.org/html/rfc2822.html
}{RFC~
2822}),\\
161 an~abbreviation~(
\DUrole{abbreviation
}{abb.
}),~an~acronym~(
\DUrole{acronym
}{reST
}),\\
162 code~(
\texttt{\DUrole{code
}{print~
\textquotedbl{}hello~world
\textquotedbl{}}}),\\
164 \textsubscript{subscript
}~and~
\textsuperscript{superscript
},\\
165 \DUrole{custom
}{custom
}~
\DUrole{custom-role
}{roles
},~and~explicit~roles~for\\
166 \DUroletitlereference{Docutils
}'~
\emph{standard
}~
\textbf{inline
}~
\texttt{markup
}.
169 \DUfootnotetext{id3
}{id1
}{*
}{%
170 This footnote is referenced in a
\DUroletitlereference{parsed literal
} block.
172 \begin{figure
}[b
]\raisebox{1em
}{\hypertarget{cit2002
}{}}[CIT2002
]
173 Sample Citation,
2017.