Debian Codegraph @

test/functional/expected/latex_literal_block_fancyvrb.tex

raw
1 \documentclass[a4paper]{article}
2 % generated by Docutils <https://docutils.sourceforge.io/>
3 \usepackage{cmap} % fix search and cut-and-paste in Acrobat
4 \usepackage[T1]{fontenc}
5 \usepackage{amsmath}
6 \usepackage{color}
7 \usepackage{graphicx}
8 \usepackage{fancyvrb}
9 \usepackage{longtable,ltcaption,array}
10 \setlength{\extrarowheight}{2pt}
11 \newlength{\DUtablewidth} % internal use in tables
12
13 %%% Custom LaTeX preamble
14 % PDF Standard Fonts
15 \usepackage{mathptmx} % Times
16 \usepackage[scaled=.90]{helvet}
17 \usepackage{courier}
18
19 %%% User specified packages and stylesheets
20
21 %%% Fallback definitions for Docutils-specific commands
22 \usepackage{docutils}[2026-05-06]
23
24 % character width in monospaced font
25 \newlength{\ttemwidth}
26 \settowidth{\ttemwidth}{\ttfamily M}
27
28 % hyperlinks:
29 \ifdefined\hypersetup
30 \else
31 \usepackage[hyperfootnotes=false,
32 colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
33 \usepackage{bookmark}
34 \urlstyle{same} % normal text font (alternatives: tt, rm, sf)
35 \fi
36
37 %%% Body
38 \begin{document}
39
40 In LaTeX, literal blocks can be customized with the \textquotedbl{}literal-block-env\textquotedbl{}
41 setting. This test file exists to check if the LaTeX writer output compiles
42 and looks as expected.
43
44 Start with a plain literal block:
45
46 \begin{quote}
47 \begin{Verbatim}
48 $\sin^2(x)$ and $\cos^2(x)$ equals one:
49
50 \[
51 \sin^2(x) + \cos^2(x) = 1 % for all x
52 \]
53 \end{Verbatim}
54 \end{quote}
55
56 A latex \textquotedbl{}code-block\textquotedbl{} (set with \textquotedbl{}literal-block-env\textquotedbl{}, if syntax
57 highlight is \textquotedbl{}none\textquotedbl{}):
58
59 \begin{DUclass}{code}
60 \begin{DUclass}{latex}
61 \begin{quote}
62 \begin{Verbatim}
63 $\sin^2(x)$ and $\cos^2(x)$ equals one:
64
65 \[
66 \sin^2(x) + \cos^2(x) = 1 % for all x
67 \]
68 \end{Verbatim}
69 \end{quote}
70 \end{DUclass}
71 \end{DUclass}
72
73 A literal block in a table:
74
75 \setlength{\DUtablewidth}{\linewidth}%
76 \begin{longtable*}{|p{0.063\DUtablewidth}|p{0.145\DUtablewidth}|p{0.063\DUtablewidth}|}
77 \hline
78
79 test
80 &
81 \begin{minipage}{8\ttemwidth}
82 \begin{Verbatim}
83 \sin^2 x
84 \end{Verbatim}
85 \end{minipage}
86 &
87 test
88 \\
89 \hline
90 \end{longtable*}
91
92 A literal block in a table with auto-width columns:
93
94 \begin{longtable*}{|l|l|l|}
95 \hline
96 test &
97 \ttfamily\raggedright
98 \textbackslash{}sin\textasciicircum{}2~x
99 & test \\
100 \hline
101 \end{longtable*}
102
103 \begin{DUclass}{note}
104 \begin{DUadmonition}
105 \DUtitle{Note}
106
107 A literal block in an admonition:
108
109 \begin{quote}
110 \begin{Verbatim}
111 \sin^2 x
112 \end{Verbatim}
113 \end{quote}
114 \end{DUadmonition}
115 \end{DUclass}
116
117 \DUsidebar{
118 \DUtitle{Literal Block in a Sidebar}
119
120 \begin{quote}
121 \ttfamily\raggedright
122 \textbackslash{}sin\textasciicircum{}2~x
123 \end{quote}
124 }
125
126 Parsed literal block with inline markup and leading whitespace:
127
128 \begin{quote}
129 \ttfamily\raggedright
130 ~~~\emph{emphasis},~\textbf{strong~emphasis},~\texttt{inline~literals},\\
131 standalone~hyperlinks~(\url{http://www.python.org}),\\
132 \hyperref[internal]{internal}~and~\href{http://www.python.org/}{external}~hyperlinks,\\
133 %
134 \phantomsection\label{internal}internal~hyperlink~targets,\\
135 images~via~substitution~references~(\includegraphics{../../../docs/user/rst/images/biohazard.png}),\\
136 footnote~references\DUfootnotemark{footnote-reference-1}{footnote-1}{*},\\
137 citation~references~(\hyperlink{cit2002}{[CIT2002]}),~and~more.\\
138 ~\\
139 ~~~Here~are~some~explicit~interpreted~text~roles:\\
140 a~PEP~reference~(\href{https://peps.python.org/pep-0287}{PEP~287}),\\
141 an~RFC~reference~(\href{https://tools.ietf.org/html/rfc2822.html}{RFC~2822}),\\
142 an~abbreviation~(\DUrole{abbreviation}{abb.}),~an~acronym~(\DUrole{acronym}{reST}),\\
143 code~(\texttt{\DUrole{code}{print~\textquotedbl{}hello~world\textquotedbl{}}}),\\
144 maths~$\sin^2(x)$,\\
145 \textsubscript{subscript}~and~\textsuperscript{superscript},\\
146 \DUrole{custom}{custom}~\DUrole{custom-role}{roles},~and~explicit~roles~for\\
147 \DUroletitlereference{Docutils}'~\emph{standard}~\textbf{inline}~\texttt{markup}.
148 \end{quote}
149 %
150 \DUfootnotetext{footnote-1}{footnote-reference-1}{*}{%
151 This footnote is referenced in a \DUroletitlereference{parsed literal} block.
152
153 It contains a literal block:
154
155 \begin{quote}
156 \ttfamily\raggedright
157 \textbackslash{}sin\textasciicircum{}2~x
158 \end{quote}
159 }
160 \begin{figure}[b]\raisebox{1em}{\hypertarget{cit2002}{}}[CIT2002]
161 Sample Citation, 2017.
162 \end{figure}
163
164 \end{document}