diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-24 14:09:38 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-24 14:09:38 +0100 |
| commit | 448844d66cef5f4980d0575e783757264c962bb5 (patch) | |
| tree | f280aaef927da2a30c18f13cc124c8eb77ad3abf /src | |
| parent | 6547c2d6d5b25f44e52ac56698ed08ff6a5dbb3a (diff) | |
Allow multiple authors
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc.rs | 2 | ||||
| -rw-r--r-- | src/export/pdf/mod.rs | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -25,7 +25,7 @@ pub struct Document { /// The document's title. pub title: Option<EcoString>, /// The document's author. - pub author: Option<EcoString>, + pub author: Vec<EcoString>, } /// A finished layout with elements at fixed positions. diff --git a/src/export/pdf/mod.rs b/src/export/pdf/mod.rs index 69fa805b..3813bad5 100644 --- a/src/export/pdf/mod.rs +++ b/src/export/pdf/mod.rs @@ -122,9 +122,11 @@ fn write_catalog(ctx: &mut PdfContext) { info.title(TextStr(title)); xmp.title([(None, title.as_str())]); } - if let Some(author) = &ctx.document.author { - info.author(TextStr(author)); - xmp.creator([(author.as_str())]); + + let authors = &ctx.document.author; + if !authors.is_empty() { + info.author(TextStr(&authors.join(", "))); + xmp.creator(authors.iter().map(|s| s.as_str())); } info.creator(TextStr("Typst")); info.finish(); |
