Skip to content

Commit

Permalink
Updated templates for pandoc 3.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Dec 12, 2023
1 parent f7d8b62 commit 395d56d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion default.latex
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ $endif$
$if(csquotes)$
\usepackage{csquotes}
$endif$
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\usepackage{bookmark}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}
$if(links-as-notes)$
Expand Down
24 changes: 15 additions & 9 deletions default.typst
Original file line number Diff line number Diff line change
Expand Up @@ -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$",
Expand Down Expand Up @@ -76,14 +79,17 @@ $endfor$
$if(toc)$
#outline(
title: auto,
depth: none
depth: $toc-depth$
);
$endif$

$body$

$if(citations)$
$if(bibliographystyle)$
$if(csl)$

#set bibliography(style: "$csl$")
$elseif(bibliographystyle)$

#set bibliography(style: "$bibliographystyle$")
$endif$
Expand Down
5 changes: 0 additions & 5 deletions definitions.typst
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Some definitions presupposed by pandoc's typst output.
#let blockquote(body) = [
#set text( size: 0.92em )
#block(inset: (left: 1.5em, top: 0.2em, bottom: 0.2em))[#body]
]

#let horizontalrule = [
#line(start: (25%,0%), end: (75%,0%))
]
Expand Down
10 changes: 8 additions & 2 deletions template.typst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#let conf(
title: none,
authors: none,
authors: (),
keywords: (),
date: none,
abstract: none,
cols: 1,
Expand All @@ -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,
Expand All @@ -31,7 +37,7 @@
]]
}

if authors != none {
if authors != none and authors != [] {
let count = authors.len()
let ncols = calc.min(count, 3)
grid(
Expand Down

0 comments on commit 395d56d

Please sign in to comment.