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