Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue10294 new code for two column layout on typst 0.12.x #10324

Merged
merged 21 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/templates/default.typst
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ $endif$
$if(smart)$
$else$
#set smartquote(enabled: false)

$endif$

jarnowic marked this conversation as resolved.
Show resolved Hide resolved
$for(header-includes)$
$header-includes$

$endfor$

jarnowic marked this conversation as resolved.
Show resolved Hide resolved
#show: doc => conf(
$if(title)$
title: [$title$],
Expand Down
71 changes: 33 additions & 38 deletions data/templates/template.typst
Original file line number Diff line number Diff line change
Expand Up @@ -35,55 +35,50 @@
paper: paper,
margin: margin,
numbering: "1",
)
columns: cols,
)

jarnowic marked this conversation as resolved.
Show resolved Hide resolved
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 subtitle != none {
place(top + center, float: true, scope: "parent", clearance: 4mm)[
#if title != none {
text(weight: "bold", size: 1.5em)[#title]
jarnowic marked this conversation as resolved.
Show resolved Hide resolved
(if subtitle != none {
parbreak()
text(weight: "bold", size: 1.25em)[#subtitle]
})
]]
}

if authors != none and authors != [] {
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 authors != none and authors != [] {
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 abstract != none {
block(inset: 2em)[
#text(weight: "semibold")[Abstract] #h(1em) #abstract
]
}
#if date != none {
date
}

if cols == 1 {
doc
} else {
columns(cols, doc)
}
#if abstract != none {
text(weight: "semibold")[Abstract]
h(1em)
abstract
jarnowic marked this conversation as resolved.
Show resolved Hide resolved
}
]
doc
}
Loading