From f7bd39caab11337dd36d7d01424f571ffd51125b Mon Sep 17 00:00:00 2001 From: Jean-Marie 'Histausse' Mineau Date: Thu, 11 Sep 2025 10:13:30 +0200 Subject: [PATCH] allow more control over what is rendered --- lib/matisse-thesis.typ | 15 ++++----------- template/main.typ | 32 +++++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/lib/matisse-thesis.typ b/lib/matisse-thesis.typ index 555fde6..62cb10a 100644 --- a/lib/matisse-thesis.typ +++ b/lib/matisse-thesis.typ @@ -37,19 +37,12 @@ // 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] @@ -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 ) } } diff --git a/template/main.typ b/template/main.typ index 14c4113..c4a8ee9 100644 --- a/template/main.typ +++ b/template/main.typ @@ -14,14 +14,26 @@ true } -#let abstract-only = if "abstract-only" in sys.inputs { - assert( - sys.inputs.abstract-only == "true" or sys.inputs.draft == "false", - message: "If --input abstract-only= is set, must be 'true', or 'false'" - ) - sys.inputs.abstract-only == "true" -} else { - false +#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.abstract-only == "false", + message: "If --input abstract-only= is set, must be 'true', or '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