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

+16
View File
@@ -55,6 +55,16 @@ impl Default for PageSize {
}
}
/// Layout style for the document title block.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub enum TitleStyle {
/// The generic article title: title, author, date, no rules.
#[default]
Article,
/// Preprint-style title block with rules, an undertitle, and author columns.
Preprint,
}
#[derive(Clone)]
pub struct Footnote {
pub number: u32,
@@ -66,6 +76,10 @@ pub struct DocumentModel {
pub title: String,
pub author: String,
pub date: String,
/// Style selected by the document's class/package layer.
pub title_style: TitleStyle,
/// Optional line printed under the title rules, e.g. "A Preprint".
pub undertitle: Option<String>,
pub page: PageSize,
pub parindent: common::Scaled,
/// Base font size selected by the document class (10, 11, or 12pt).
@@ -87,6 +101,8 @@ impl Default for DocumentModel {
title: String::new(),
author: String::new(),
date: String::new(),
title_style: TitleStyle::default(),
undertitle: None,
page: PageSize::default(),
// article's default \parindent for 10/11pt text.
parindent: common::Scaled(17 * 65_536),