Place display equation tags at the right margin

Tagged display math used the body width as its box, so the equation number sat
immediately after the formula. Add a TaggedWidth atom carrying the line
measure: the body is centred in the measure and the tag is painted at its right
edge.

The arXiv equation number now matches the TeX right-margin placement; the
formula body remains approximate. Test count stays 1077.
This commit is contained in:
gloamxun committed 2026-10-28 00:32:56 +08:00
1 parent 9181bf49fe
commit 764bc18850
5 files changed
+43 -3

No files matched your search

+2 -1
View File
@@ -13989,9 +13989,10 @@ fn build_document_with_labels(
.map(|number| format!("({number})"))
});
let atom = match tag {
Some(tag) => MathAtom::Tagged {
Some(tag) => MathAtom::TaggedWidth {
body: Box::new(atom),
tag,
width: line_width,
},
None => atom,
};