Repository navigation
Commit 0e60218
docs: fix the math block in the tr2adjoint and tr2adjoint2 docstrings (#260)
## Problem
The math block in the `tr2adjoint` and `tr2adjoint2` docstrings has
never rendered, and would not have rendered correctly if it had:
```rst
.. math:
Ad(\mat{T}) \vec{X} X = \vee \left( \mat{T} \skew{\vec{X} \mat{T}^{-1} \right)
```
- **Single colon:** `.. math:` is not the directive (`.. math::` is).
reST treats it as a comment, so the whole block was swallowed and
nothing showed in the docs.
- **Undefined macro:** `\skew` is not defined in `docs/source/conf.py`.
The macros there are `\sk`, `\skx` and `\vex`.
- **Unbalanced braces:** `\skew{...` was never closed.
- **Stray `X`:** there is an extra trailing `X`, and `Ad` was set in
italic, so it read as `A·d`.
The inline `\mat{T} \in \SE3` below it only worked because `\SE` takes
one argument, so `\SE3` parses as `\SE` applied to `3`. The docs
elsewhere write `\SE{3}`.
The 2D docstring was a copy of the 3D one, so both carried the same
errors. The 3D text also named `tr2jac` and gave only the 6x6 size.
## Change
- The block is now `.. math::` with `\mathrm{Ad}(\mat{T})\,\vec{X} =
\vex{\mat{T}\,\sk{\vec{X}}\,\mat{T}^{-1}}`, written with the macros
already defined in `conf.py`. No change to `conf.py` was needed.
- `\SE3` and `\SE2` are now `\SE{3}` and `\SE{2}`.
- The 3D text names `tr2adjoint` and gives 6x6 for SE(3), 3x3 for SO(3).
Docstrings only, so no behavior change.
## Verification
- Parsing each docstring with docutils: math-block nodes went from 0 to
1 for both functions.
- Every macro in the formula is defined in `conf.py`, and the braces
balance.
- Searched the package for other single-colon `.. math:` directives and
for `\skew`, `\SE3` or `\SO3`; none remain.
- Full suite: 380 passed, 3 skipped.
- Merge simulations against #225, #246, #248, #249, #258 and #259 are
all clean. This PR and #259 both edit the `tr2adjoint2` docstring, but
in separate hunks.
**Not verified:** I have not looked at it rendered in a browser. MathJax
runs client-side, so a docs build would show only the raw TeX. A quick
look at the built page before merging would be worthwhile.
Related: #259, which fixed the other 2D-specific text in `tr2adjoint2`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>1 parent 13cef32 commit 0e60218
2 files changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
793 | | - | |
| 793 | + | |
794 | 794 | | |
795 | | - | |
| 795 | + | |
796 | 796 | | |
797 | | - | |
| 797 | + | |
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2732 | 2732 | | |
2733 | 2733 | | |
2734 | 2734 | | |
2735 | | - | |
| 2735 | + | |
2736 | 2736 | | |
2737 | | - | |
| 2737 | + | |
2738 | 2738 | | |
2739 | | - | |
| 2739 | + | |
2740 | 2740 | | |
2741 | | - | |
2742 | | - | |
2743 | | - | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
2744 | 2744 | | |
2745 | 2745 | | |
2746 | 2746 | | |
| |||
0 commit comments