mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-19 02:22:09 +08:00
+ Update manual with variables for Typst. + Split `lang` metadata into separate `lang` and `region` for Typst. + Fix label positioning in Divs. + Fix text customizations (lang, region, font, size) so they actually work. + Update tests and man page.
68 lines
1.2 KiB
Plaintext
68 lines
1.2 KiB
Plaintext
#let conf(
|
|
title: none,
|
|
authors: none,
|
|
date: none,
|
|
abstract: none,
|
|
cols: 1,
|
|
margin: (x: 1.25in, y: 1.25in),
|
|
paper: "us-letter",
|
|
lang: "en",
|
|
region: "US",
|
|
font: (),
|
|
fontsize: 11pt,
|
|
sectionnumbering: none,
|
|
doc,
|
|
) = {
|
|
set page(
|
|
paper: paper,
|
|
margin: margin,
|
|
numbering: "1",
|
|
)
|
|
set par(justify: true)
|
|
set text(lang: lang,
|
|
region: region,
|
|
font: font,
|
|
size: fontsize)
|
|
set heading(numbering: sectionnumbering)
|
|
|
|
if title != none {
|
|
align(center)[#block(inset: 2em)[
|
|
#text(weight: "bold", size: 1.5em)[#title]
|
|
]]
|
|
}
|
|
|
|
if authors != none {
|
|
let count = authors.len()
|
|
let ncols = calc.min(count, 3)
|
|
grid(
|
|
columns: (1fr,) * ncols,
|
|
row-gutter: 1.5em,
|
|
..authors.map(author =>
|
|
align(center)[
|
|
#author.name \
|
|
#author.affiliation \
|
|
#author.email
|
|
]
|
|
)
|
|
)
|
|
}
|
|
|
|
if date != none {
|
|
align(center)[#block(inset: 1em)[
|
|
#date
|
|
]]
|
|
}
|
|
|
|
if abstract != none {
|
|
block(inset: 2em)[
|
|
#text(weight: "semibold")[Abstract] #h(1em) #abstract
|
|
]
|
|
}
|
|
|
|
if cols == 1 {
|
|
doc
|
|
} else {
|
|
columns(cols, doc)
|
|
}
|
|
}
|