Debian Codegraph @

test/functional/input/latex_leavevmode.rst

raw
1 Styling of Elements in Definition- or Field-List
2 ================================================
3
4 :Authors: Hänsel, Gretel
5 :Address: 123 Example Street
6 Example, EX Canada
7 :Generic Docinfo List Field:
8 - This is a list.
9 - It does not require ``\leavevmode`` because it is in the docinfo.
10 :Abstract:
11 Test that ``\leavevmode`` is inserted after the term or field-name
12 when required for correct placement of the item.
13
14 Elements needing ``\leavevmode``
15 ********************************
16
17 :Bullet List:
18 - This is a bullet list nested in a field list.
19 - It needs ``\leavevmode`` so that it will start on a new line
20 after the term.
21 - Without ``\leavevmode``, the first bullet would be on the same line as
22 the term, and the following bullets would not line up.
23
24 :Enumerated List:
25 1. This is an enumerated list.
26 2. All lists need ``\leavevmode``.
27
28 :Field List:
29 :Field List: Like this one
30 :Needs ``\leavevmode``: Yes
31
32 :empty:
33
34 Definition List
35 Nested
36 inside another definition list.
37 Needs ``\leavevmode``?
38 Yes.
39 Independent of the nesting level.
40
41 Option List
42 -h Show help
43 -v Be verbose
44 --rare a) This description starts with an enumeration
45 b) but does not need ``\leavevmode``.
46
47 Literal Block
48 ::
49
50 _needs_leavevmode = True
51
52 Doctest Block
53 >>> needs_leavevmode(nodes.doctest_block)
54 True
55
56 Line Block
57 | Needs "``\leavevmode``",
58 | so that all lines start with the same indent.
59
60 Block Quote
61 ..
62
63 Block Quotes need "``\leavevmode``", too,
64 so that all lines start with the same indent.
65
66 Table
67 +---+---+
68 | 1 | 2 |
69 +---+---+
70 | 3 | 4 |
71 +---+---+
72
73 Figure
74 .. figure:: ../../../docs/user/rst/images/title.png
75
76 A figure
77
78 Image
79 .. image:: ../../../docs/user/rst/images/title.png
80
81 Rubric
82 .. rubric:: A Rubric
83
84 Admonition
85 .. note::
86
87 Admonitions need to be preceded by ``\leavevmode``.
88 Otherwise, the term ends up centered above the admonition box.
89
90 So do *System Messages*, as they use the "DUadmonition"
91 LaTeX environment.
92
93
94 Elements not needing ``\leavevmode``
95 ************************************
96
97 Paragraph
98 Paragraphs don't need ``\leavevmode``. They are meant
99 to start after the term and have a hanging indent.
100
101 * Subsequent elements don't need ``\leavevmode`` either.
102
103 Math Block
104 .. math::
105
106 \sum_{i=1}^n i = \frac{n^2+n}{2}
107
108 LaTeX starts math blocks (both single-line and multiline) in a new
109 paragraph automatically, with or without ``\leavevmode``, so
110 ``\leavevmode`` isn't needed.
111
112 Term with Classifier : classifier
113 - After a *classifier*, ``\leavevmode`` is not required
114 - because the classifier is added (in parentheses) after the term.
115
116 Ambiguous cases
117 ***************
118
119 Comment and Target
120 .. This is ignored.
121
122 .. _foo:
123
124 * Comments and other "Invisible" nodes (substitution definitions,
125 targets, pending) must be skipped when determining whether a
126 ``\leavevmode`` is required.
127
128 Substitution Definition and Class directive
129 .. |no-leavevmode| replace:: No (because a paragraph follows).
130
131 .. class:: test
132
133 Is ``\leavevmode`` required? Answer: |no-leavevmode|
134
135 Compound
136 .. compound::
137
138 `Compound` and `Container` wrap around other block elements.
139 They get a ``\leavevmode``, if the first nested element is a
140 list or similar.
141
142 Container
143 .. container:: my-class
144
145 * This list inside a container requires a ``\leavevmode``.
146
147 Footnote
148 .. [#f1] This footnote will move to the bottom of the page.
149
150 A ``\leavevmode`` is required, if the first list item value is a
151 footnote and a list or similar follows.
152
153 Citation
154 .. [example73] No Name, "Citations move to the bottom as well",
155 Musterstadt, 1973.
156
157 * A ``\leavevmode`` is required, if the first list item value is a
158 citation and a list or similar follows.
159
160 Raw Block Text
161 .. raw:: latex
162
163 “Raw” blocks are always preceded by
164 \verb|\leavevmode|, just in case.