Render arxiv-style preprint title blocks

This commit is contained in:
gloamxun committed 2026-10-19 15:23:13 +08:00
1 parent 8d5cbc69ba
commit 4991bdfcfc
12 files changed
+559 -77

No files matched your search

+22
View File
@@ -94,6 +94,28 @@ fn arxiv_fixture_is_three_letter_pages() {
(number(&value, "pageHeightMm") - 279.4).abs() < 0.1,
"Letter height"
);
let first_page = page_svg(&value, 0);
assert!(first_page.contains("REPRINT"), "missing undertitle");
assert!(first_page.contains("Hippocampus"), "missing author column");
assert!(first_page.contains("October"), "missing date");
}
#[test]
fn arxiv_title_block_uses_rules_and_small_caps() {
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("fixtures")
.join("arxiv-template")
.join("template.tex");
let source = std::fs::read_to_string(&path).expect("read arXiv fixture");
let value = fresh_preview(&source, &path.to_string_lossy());
assert_eq!(value["status"], "ok", "{}", value["message"]);
let first_page = page_svg(&value, 0);
let rule_count = first_page.matches("<rect").count();
assert!(rule_count >= 2, "title rules missing: {rule_count}");
assert!(
first_page.contains("font-size=\"4.9389\""),
"small-caps title glyphs missing"
);
}
#[test]