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 % backwards compatibility: try \docutilsrole#1{#2}
51 \ifcsname docutilsrole
#1\endcsname%
52 \csname docutilsrole
#1\endcsname{#2}%
54 \csname DUrole
#1\endcsname{#2}%
59 \ifx\textsubscript\undefined
60 \usepackage{fixltx2e
} % since 2015 loaded by default
64 \providecommand*
{\DUroletitlereference}[1]{\textsl{#1}}
66 % character width in monospaced font
67 \newlength{\ttemwidth}
68 \settowidth{\ttemwidth}{\ttfamily M
}
71 \ifthenelse{\isundefined{\hypersetup}}{
72 \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue
]{hyperref
}
74 \urlstyle{same
} % normal text font (alternatives: tt, rm, sf)
80 In LaTeX, literal blocks can be customized with the
\textquotedbl{}literal-block-env
\textquotedbl{}
81 setting. This test file exists to check the latex writer output compiles and
82 looks as expected. Start with a plain literal block:
86 $
\sin^
2(x)$ and $
\cos^
2(x)$ equals one:
89 \sin^
2(x) +
\cos^
2(x) =
1 % for all x
94 A latex
\textquotedbl{}code-block
\textquotedbl{} (set with
\textquotedbl{}literal-block-env
\textquotedbl{}, if syntax
95 highlight is
\textquotedbl{}none
\textquotedbl{}):
98 \begin{DUclass
}{latex
}
101 $
\sin^
2(x)$ and $
\cos^
2(x)$ equals one:
104 \sin^
2(x) +
\cos^
2(x) =
1 % for all x
111 A literal block in a table:
113 \setlength{\DUtablewidth}{\linewidth}
114 \begin{longtable*
}[c
]{|p
{0.063\DUtablewidth}|p
{0.145\DUtablewidth}|p
{0.063\DUtablewidth}|
}
119 \begin{minipage
}{8\ttemwidth}
130 A literal block in a table with auto-width columns:
132 \begin{longtable*
}[c
]{|l|l|l|
}
135 \ttfamily\raggedright
136 \textbackslash{}sin
\textasciicircum{}2~x
141 Parsed literal block with inline markup and leading whitespace:
144 \ttfamily\raggedright
145 ~~~
\emph{emphasis
},~
\textbf{strong~emphasis
},~
\texttt{inline~literals
},\\
146 standalone~hyperlinks~(
\url{http://www.python.org
}),\\
147 \hyperref[internal
]{internal
}~and~
\href{http://www.python.org/
}{external
}~hyperlinks,\\
149 \phantomsection\label{internal
}internal~hyperlink~targets,\\
150 images~via~substitution~references~(
\includegraphics{../../../docs/user/rst/images/biohazard.png
}),\\
151 footnote~references
\DUfootnotemark{id1
}{id3
}{*
},\\
152 citation~references~(
\hyperlink{cit2002
}{[CIT2002
]}),~and~more.\\
154 ~~~Here~are~some~explicit~interpreted~text~roles:\\
155 a~PEP~reference~(
\href{http://www.python.org/dev/peps/pep-
0287}{PEP~
287}),\\
156 an~RFC~reference~(
\href{http://tools.ietf.org/html/rfc2822.html
}{RFC~
2822}),\\
157 an~abbreviation~(
\DUrole{abbreviation
}{abb.
}),~an~acronym~(
\DUrole{acronym
}{reST
}),\\
158 code~(
\texttt{\DUrole{code
}{print~
\textquotedbl{}hello~world
\textquotedbl{}}}),\\
160 \textsubscript{subscript
}~and~
\textsuperscript{superscript
},\\
161 \DUrole{custom
}{custom
}~
\DUrole{custom-role
}{roles
},~and~explicit~roles~for\\
162 \DUroletitlereference{Docutils
}'~
\emph{standard
}~
\textbf{inline
}~
\texttt{markup
}.
165 \DUfootnotetext{id3
}{id1
}{*
}{%
166 This footnote is referenced in a
\DUroletitlereference{parsed literal
} block.
168 \begin{figure
}[b
]\raisebox{1em
}{\hypertarget{cit2002
}{}}[CIT2002
]
169 Sample Citation,
2017.