-
Consider the following
How can one insert a page break before the table of contents is placed? |
Beta Was this translation helpful? Give feedback.
Answered by
mcanouil
Sep 28, 2023
Replies: 1 comment 1 reply
-
You need to tweak the format template to include the page break where you want it, see https://quarto.org/docs/prerelease/1.4/typst.html#custom-formats. See "typst-template.typ" partial.#let article(
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,
toc: false,
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 toc {
pagebreak()
block(above: 0em, below: 2em)[
#outline(
title: auto,
depth: none
);
]
}
if cols == 1 {
doc
} else {
columns(cols, doc)
}
} See Quarto document code.---
title: "My first contact with Typst"
format:
typst:
template-partials:
- typst-template.typ
toc: true
number-sections: true
---
# Section 1
Hello, typst!
## Subsection
Hello again!
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
psads-git
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to tweak the format template to include the page break where you want it, see https://quarto.org/docs/prerelease/1.4/typst.html#custom-formats.
Without having to create a whole new template, you could use the partials, see https://quarto.org/docs/prerelease/1.4/typst.html#template-partials.
See "typst-template.typ" partial.