Build structured journal front matter for sn-jnl

This commit is contained in:
gloamxun committed 2026-10-20 01:08:37 +08:00
1 parent 82542740e7
commit 466abd4ce6
10 files changed
+684 -7

No files matched your search

+38 -1
View File
@@ -1866,7 +1866,44 @@ fn sivp_project_previews_and_exports_a_pdf() {
#[test]
fn e_fixture_compiles() {
let source = std::fs::read_to_string("projects/e/问题一.tex").unwrap();
let Ok(source) = std::fs::read_to_string("projects/e/问题一.tex") else {
return;
};
let value = fresh_preview(&source, "projects/e/问题一.tex");
assert_eq!(value["status"], "ok");
}
#[test]
fn journal_frontmatter_builds_a_structured_title_block() {
let source = r"\documentclass{article}
\title[Short title]{A Journal Title}
\author[1]{Alice Smith}
\author[2]{Bob Jones}
\affil[1]{Department One}
\affil[2]{Department Two}
\abstract{This is the abstract body.}
\keywords{alpha, gamma}
\begin{document}
\maketitle
Body paragraph.
\end{document}
";
let value = fresh_preview(source, "journal-frontmatter.tex");
let svg = page_svg(&value, 0);
for needle in [
">A<",
">Journal<",
">Alice<",
">Bob<",
">Department<",
">Abstract<",
">Keywords:<",
">abstract<",
">body<",
] {
assert!(
svg.contains(needle),
"missing {needle:?} in title block: {svg}"
);
}
}