allow more control over what is rendered

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2025-09-11 10:13:30 +02:00
parent 5724072e51
commit f7bd39caab
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
2 changed files with 27 additions and 20 deletions

View file

@ -37,20 +37,13 @@
// text lang
lang: "en",
school-color-verso: school-color-verso,
abstract-only: false,
show_cover: true,
show_body: true,
show_abstracts: true,
body
) = {
assert-etablissements(university)
let show_cover = true
let show_body = true
let show_abstracts = true
if abstract-only {
show_cover = false
show_body = false
show_abstracts = true
}
if draft {
[== DRAFT - #title-en]
// if typst was called with `--input commit=$(git rev-parse --short HEAD)`, add the current commit:
@ -276,7 +269,7 @@
title-fr: title-fr, keywords-fr: keywords-fr, abstract-fr: abstract-fr,
title-en: title-en, keywords-en: keywords-en, abstract-en: abstract-en,
font: abstract-font, font-size: abstract-font-size, school-color-verso: school-color-verso,
align-to-even-page: not abstract-only
align-to-even-page: show_body, // Don't add blank pages when the body is not shown
)
}
}

View file

@ -14,14 +14,26 @@
true
}
#let abstract-only = if "abstract-only" in sys.inputs {
#let (show_cover, show_body, show_abstracts) = {
let show_cover = true
let show_body = true
let show_abstracts = true
let abstract-only = false
if "abstract-only" in sys.inputs {
assert(
sys.inputs.abstract-only == "true" or sys.inputs.draft == "false",
sys.inputs.abstract-only == "true" or sys.inputs.abstract-only == "false",
message: "If --input abstract-only=<val> is set, <val> must be 'true', or 'false'"
)
sys.inputs.abstract-only == "true"
} else {
false
if sys.inputs.abstract-only == "true" {
show_cover = false
show_body = false
show_abstracts = true
abstract-only = true
}
}
(show_cover, show_body, show_abstracts)
}
#show: matisse-thesis.with(
@ -38,7 +50,9 @@
abstract-en: abstract-en,
abstract-fr: abstract-fr,
draft: draft,
abstract-only: abstract-only,
show_cover: show_cover,
show_body: show_body,
show_abstracts: show_abstracts,
)
// Preamble