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

+14
View File
@@ -65,6 +65,12 @@ pub enum TitleStyle {
Preprint,
}
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct CitationMetadata {
pub author: String,
pub year: String,
}
#[derive(Clone)]
pub struct Footnote {
pub number: u32,
@@ -90,6 +96,8 @@ pub struct DocumentModel {
pub block_sources: Vec<Option<SourceLocation>>,
pub labels: HashMap<String, String>,
pub citations: HashMap<String, usize>,
pub citation_metadata: HashMap<String, CitationMetadata>,
pub author_year_citations: bool,
pub footnotes: Vec<Footnote>,
pub page_style: PageStyle,
pub page_style_overrides: Vec<PageStyleOverride>,
@@ -113,6 +121,8 @@ impl Default for DocumentModel {
block_sources: Vec::new(),
labels: HashMap::new(),
citations: HashMap::new(),
citation_metadata: HashMap::new(),
author_year_citations: false,
footnotes: Vec::new(),
page_style: PageStyle::default(),
page_style_overrides: Vec::new(),
@@ -292,6 +302,9 @@ pub struct ListItem {
pub enum UnresolvedReference {
Label(String),
Citation(Vec<String>),
/// A textual citation such as natbib's `\citet`, rendered as
/// `Author (year)` instead of a parenthetical citation.
TextualCitation(Vec<String>),
/// A table-of-contents/list page number for the block with this index.
/// The target is resolved to a page number during page layout.
TocPage(usize),
@@ -341,6 +354,7 @@ pub enum ParagraphAlignment {
RaggedRight,
RaggedLeft,
Centered,
Quote,
}
#[derive(Clone, PartialEq, Eq, Hash)]