Last update: 2025-01-02
The list of roles and directives I've added to "my" reST.
Contents
In order to use own roles you have to modify a file .../doctuils/parsers/rst/roles.py — simply append myroles.py at end of roles.py, and copy roles_aux.py to the same directory where roles.py is located.
Syntax of math expression has been borrowed from TeX; at the moment just subscripts and superscripts are supported. Small letters are italized, and some replacements are made.
Both roles math and cmath do the same thing, just produce nodes with different class names. For example my cmath style definition: display: block; text-align: center; font-size: larger.
Syntax:
:math:`expression` :cmath:`expression`
Famous Einstein equation (e = m*c^2)
e = m ⋅ c2
Determinant of matrix A4x4 (a_{11}*a_{22} - a_{12}*a_{21}):
det(A4x4) = a11 ⋅ a22 − a12 ⋅ a21
Cubic Bezier curve (p(t) = p_0 B^3_0(t) + p_1 B^3_1(t) + p_2 B^3_2(t) + p_3 B^3_3(t), 1 >= t >= 0):
p(t) = p0B30(t) + p1B31(t) + p2B32(t) + p3B33(t), 1 ≥ t ≥ 0
Polynomial of degree n (f(x) = a_0*x^n + a_1*x^{n-1} + ... + a_n*x^0):
f(x) = a0 ⋅ xn + a1 ⋅ xn − 1 + … + an ⋅ x0
Trigonometry: sin^2x+cos^2x=1
sin2x + cos2x = 1
Links to Wikipedia articles. For example :enwiki:`Albert Einstein` produces Albert Einstein, and :enwiki:`Albert Einstein|Einstein` makes shorter link title Einstein
Links to x86 documentation generated by Henk-Jan Lebbink or Félix Cloutier. For example :x86:`PSHUFB` produces PSHUFB, :x86:`blsi` yields BLSI.
.. asciidiag:: r: red g: green b: blue @: bold +-----------+-----------+------------+ | 1001 0000 | 1111 0110 | 1100 01011 | ^ rrrr rrrr gggg gggg bbbb bbbbb +-----------+-----------+------------+ <------------- 24 bits ------------> ^ @@@@@@@
┌───────────┬───────────┬────────────┐ │ 1001 0000 │ 1111 0110 │ 1100 01011 │ └───────────┴───────────┴────────────┘ ◀────────────╴ 24 bits ╶───────────▶