Debian Codegraph @

test/functional/input/data/classes_latex.rst

raw
1 class handling
2 --------------
3
4 This section tests class handling for block level elements by the LaTeX
5 writer. See the input file ``classes_latex.rst`` for the raw LaTeX code used
6 to style the examples.
7
8 An "epigraph" directive is exported as "quote" wrapped in a "DUclass"
9 environment. Here, it is styled by a "DUCLASSepigraph" environment
10 redefining the "quote" environment as "minipage":
11
12 .. raw:: latex
13
14 \newcommand*{\DUCLASSepigraph}{%
15 \renewenvironment{quote}{\vspace{1em}
16 \footnotesize\hfill{}%
17 \begin{minipage}{0.4\columnwidth}}%
18 {\end{minipage}\vskip\baselineskip}}
19
20 .. epigraph::
21
22 Do not play this piece fast. It is never right to play *Ragtime* fast.
23
24 -- Scott Joplin
25
26 Raw latex is also used to style the following lists: "DUCLASSenumerateitems"
27 redefines "itemize" as "enumerate", "DUCLASSrules" draws horizontal lines
28 above and below.
29
30 .. raw:: latex
31
32 \newcommand*{\DUCLASSenumerateitems}{%
33 \renewenvironment{itemize}{\begin{enumerate}}%
34 {\end{enumerate}}%
35 }
36
37 \newenvironment{DUCLASSrules}%
38 {\noindent\rule[0.5ex]{1\columnwidth}{1pt}}%
39 {\noindent\rule[0.5ex]{1\columnwidth}{1pt}}
40
41 An "enumerated" bullet list:
42
43 .. class:: enumerateItems
44
45 * item
46 * next item
47 * third item
48
49 A list with lines above and below:
50
51 .. class:: rules
52
53 * item
54 * next item
55
56 A normal bullet list is kept unchanged by the above redefinitions:
57
58 * item
59 * next item
60 * third item
61
62 A container wraps several elements in a common "class wrapper". Here, we use
63 it to set 2 paragraphs and a list in small caps:
64
65 .. raw:: latex
66
67 \newcommand*{\DUCLASSscshape}{\scshape}
68
69 .. container:: scshape
70
71 paragraph 1
72
73 paragraph 2
74
75 * bullet list
76 * still bullet list
77
78
79 A right-aligned line-block. Alignment handling is built into the latex
80 writer for image, table, and line block elements.
81
82 .. class:: align-right
83
84 | Max Mustermann
85 | Waldstr. 22
86 | D 01234 Testdorf
87 | Tel.: 0123/456789