mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 17:20:47 +08:00
Typst template fixes.
This commit is contained in:
@@ -23,19 +23,22 @@ $if(author)$
|
||||
authors: (
|
||||
$for(author)$
|
||||
$if(author.name)$
|
||||
( name: [$author.name$],
|
||||
affiliation: [$author.affiliation$],
|
||||
email: [$author.email$] ),
|
||||
( name: "$author.name$",
|
||||
affiliation: "$author.affiliation$",
|
||||
email: "$author.email$" ),
|
||||
$else$
|
||||
( name: [$author$],
|
||||
affiliation: [],
|
||||
email: [] ),
|
||||
( name: "$author$",
|
||||
affiliation: "",
|
||||
email: "" ),
|
||||
$endif$
|
||||
$endfor$
|
||||
),
|
||||
$endif$
|
||||
$if(keywords)$
|
||||
keywords: ($for(keywords)$$keyword$$sep$,$endfor$),
|
||||
$endif$
|
||||
$if(date)$
|
||||
date: [$date$],
|
||||
date: "$date$",
|
||||
$endif$
|
||||
$if(lang)$
|
||||
lang: "$lang$",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#let conf(
|
||||
title: none,
|
||||
authors: none,
|
||||
authors: (),
|
||||
keywords: (),
|
||||
date: none,
|
||||
abstract: none,
|
||||
cols: 1,
|
||||
@@ -13,6 +14,11 @@
|
||||
sectionnumbering: none,
|
||||
doc,
|
||||
) = {
|
||||
set document(
|
||||
title: title,
|
||||
author: authors.map(author => author.name),
|
||||
keywords: keywords,
|
||||
)
|
||||
set page(
|
||||
paper: paper,
|
||||
margin: margin,
|
||||
@@ -31,7 +37,7 @@
|
||||
]]
|
||||
}
|
||||
|
||||
if authors != none {
|
||||
if authors != none and authors != [] {
|
||||
let count = authors.len()
|
||||
let ncols = calc.min(count, 3)
|
||||
grid(
|
||||
|
||||
+15
-9
@@ -17,7 +17,8 @@
|
||||
|
||||
#let conf(
|
||||
title: none,
|
||||
authors: none,
|
||||
authors: (),
|
||||
keywords: (),
|
||||
date: none,
|
||||
abstract: none,
|
||||
cols: 1,
|
||||
@@ -30,6 +31,11 @@
|
||||
sectionnumbering: none,
|
||||
doc,
|
||||
) = {
|
||||
set document(
|
||||
title: title,
|
||||
author: authors.map(author => author.name),
|
||||
keywords: keywords,
|
||||
)
|
||||
set page(
|
||||
paper: paper,
|
||||
margin: margin,
|
||||
@@ -48,7 +54,7 @@
|
||||
]]
|
||||
}
|
||||
|
||||
if authors != none {
|
||||
if authors != none and authors != [] {
|
||||
let count = authors.len()
|
||||
let ncols = calc.min(count, 3)
|
||||
grid(
|
||||
@@ -85,14 +91,14 @@
|
||||
#show: doc => conf(
|
||||
title: [Pandoc Test Suite],
|
||||
authors: (
|
||||
( name: [John MacFarlane],
|
||||
affiliation: [],
|
||||
email: [] ),
|
||||
( name: [Anonymous],
|
||||
affiliation: [],
|
||||
email: [] ),
|
||||
( name: "John MacFarlane",
|
||||
affiliation: "",
|
||||
email: "" ),
|
||||
( name: "Anonymous",
|
||||
affiliation: "",
|
||||
email: "" ),
|
||||
),
|
||||
date: [July 17, 2006],
|
||||
date: "July 17, 2006",
|
||||
cols: 1,
|
||||
doc,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user