From f96615a4c0f8b52198eb76118f2ceec4f3e4851a Mon Sep 17 00:00:00 2001 From: Jean-Marie 'Histausse' Mineau Date: Thu, 24 Jul 2025 14:59:26 +0200 Subject: [PATCH] allow to compile only the abstract --- lib/abstracts.typ | 9 ++++--- lib/matisse-thesis.typ | 55 +++++++++++++++++++++++++++--------------- template/main.typ | 23 +++++++++++++++++- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/lib/abstracts.typ b/lib/abstracts.typ index 168ee74..afc5ce3 100644 --- a/lib/abstracts.typ +++ b/lib/abstracts.typ @@ -30,15 +30,18 @@ keywords-en: (), abstract-en: [], heading-font: "TeX Gyre Heros", - school-color-verso: rgb("0054a0") + school-color-verso: rgb("0054a0"), + align-to-even-page: true, ) = { set page( numbering: none, header: none, ) - pagebreak() - pagebreak(to: "even") + if align-to-even-page { + pagebreak() + pagebreak(to: "even") + } set page( margin: ( diff --git a/lib/matisse-thesis.typ b/lib/matisse-thesis.typ index 21c88d3..549583d 100644 --- a/lib/matisse-thesis.typ +++ b/lib/matisse-thesis.typ @@ -32,9 +32,19 @@ // text lang lang: "en", school-color-verso: rgb("0054a0"), + abstract-only: false, 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] @@ -211,31 +221,38 @@ // ---------- COVER PAGE ---------- - cover( - title-en: title-en, - title-fr: title-fr, - author: author, - affiliation: affiliation, - defense-place: defense-place, - defense-date: defense-date, - jury-content: jury-content, - university: university, - speciality: speciality, - heading-font: heading-font, - ) + if show_cover { + cover( + title-en: title-en, + title-fr: title-fr, + author: author, + affiliation: affiliation, + defense-place: defense-place, + defense-date: defense-date, + jury-content: jury-content, + university: university, + speciality: speciality, + heading-font: heading-font, + ) + } // ---------- BODY ---------- set par.line(numbering: n => text(red)[#n]) if draft show figure: set par.line(numbering: none) if draft - body + if show_body { + body + } // ---------- ABSTRACT ---------- - abstracts( - university: university, - title-fr: title-fr, keywords-fr: keywords-fr, abstract-fr: abstract-fr, - title-en: title-en, keywords-en: keywords-en, abstract-en: abstract-en, - heading-font: heading-font, school-color-verso: school-color-verso, - ) + if show_abstracts { + abstracts( + university: university, + title-fr: title-fr, keywords-fr: keywords-fr, abstract-fr: abstract-fr, + title-en: title-en, keywords-en: keywords-en, abstract-en: abstract-en, + heading-font: heading-font, school-color-verso: school-color-verso, + align-to-even-page: not abstract-only + ) + } } diff --git a/template/main.typ b/template/main.typ index b1a0561..66982f7 100644 --- a/template/main.typ +++ b/template/main.typ @@ -4,6 +4,26 @@ #import "abstract.typ": keywords-en, keywords-fr, abstract-en, abstract-fr #import "0_preamble/notations.typ": * +#let draft = if "draft" in sys.inputs { + assert( + sys.inputs.draft == "true" or sys.inputs.draft == "false", + message: "If --input draft= is set, must be 'true', or 'false'" + ) + sys.inputs.draft == "true" +} else { + 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 +} + #show: matisse-thesis.with( title-fr: "Lorem Ipsum Fr", title-en: "Lorem Ipsum", @@ -17,7 +37,8 @@ keywords-fr: keywords-fr, abstract-en: abstract-en, abstract-fr: abstract-fr, - draft: true, + draft: draft, + abstract-only: abstract-only, ) // Preamble