Add abstract quotations, unnumbered paragraphs, and author-year citations

This commit is contained in:
gloamxun committed 2026-10-19 15:39:02 +08:00
1 parent 3406f84e86
commit 7f1f202de1
11 files changed
+366 -60

No files matched your search

+50
View File
@@ -1173,3 +1173,53 @@ Second page.
"header was expanded too early: {second}"
);
}
#[test]
fn abstract_body_is_indented_like_a_quote() {
let source = r#"\documentclass{article}
\begin{document}
\begin{abstract}
Alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu.
\end{abstract}
Body text after the abstract.
\end{document}
"#;
let value = fresh_preview(source, "abstract-quote.tex");
assert_eq!(value["status"], "ok", "{}", value["message"]);
let svg = page_svg(&value, 0);
let abstract_x = text_x(&svg, "Alpha");
let body_x = text_x(&svg, "Body");
assert!(
abstract_x > 9.0,
"abstract body was not inset: x={abstract_x}"
);
assert!(
body_x + 3.0 < abstract_x,
"abstract inset did not differ from body: abstract={abstract_x}, body={body_x}"
);
}
#[test]
fn natbib_citations_use_author_year() {
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 second = page_svg(&value, 1);
assert!(
second.contains(">Kour</text>") && second.contains(">Saabne,</text>"),
"author-year citation missing: {second}"
);
assert!(
!second.contains(">[1, 3]</text>"),
"numeric citation was not replaced: {second}"
);
let third = page_svg(&value, 2);
assert!(
third.contains(">Kour</text>"),
"bibliography entry missing: {third}"
);
}