From 9fcf1a2208bde6e94419d25eeeb26a75a43dbf8c Mon Sep 17 00:00:00 2001 From: Felix Wolf Date: Thu, 28 Nov 2024 11:59:43 +0100 Subject: [PATCH] add title-width param to force line breaks on title --- main.typ | 1 + template/lib.typ | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.typ b/main.typ index 53d4bb2..617a0fa 100644 --- a/main.typ +++ b/main.typ @@ -21,6 +21,7 @@ examiner-label: "Comittee", examiners: ("Prof. Dr. Chris Biemann, Universität Hamburg", "Dr. Konrad Zuse, Universität Hamburg"), date: datetime(year: 2055, month: 5, day: 25), + title-width: 0.6, bibliography: bibliography("bibliography.bib"), language: "en", ) diff --git a/template/lib.typ b/template/lib.typ index 80e5d04..d6d0490 100644 --- a/template/lib.typ +++ b/template/lib.typ @@ -108,6 +108,7 @@ /// - student-registration-number: Number of student, 'Matrikelnummer' /// - date (datetime): The date of submission of the thesis. /// - bibliography (content): The bibliography (```typc bibliography()```) to use for the thesis. +/// - title-width (number): fractial with of title, can be used to force line breaks. Default 1, should be between 0 and 1. /// - language (string): The language in which the thesis is written. `"de"` and `"en"` are /// supported. The choice of language influences certain texts on the title page and in headings, /// as well as the date format used on the title page. @@ -132,6 +133,7 @@ matriculation-number: none, date: none, bibliography: none, + title-width: 1, language: "en", paper: "a4", ) = body => { @@ -298,9 +300,9 @@ ), text(1.44em, font: "TeX Gyre Heros", weight: "extrabold", tracking: 4pt, fill: red)[#upper(t-type)], layout(size => { - let w = 0.76 * size.width + let w = title-width * size.width box(width: w, { - text(1.8em, weight: "bold", {title}) + text(1.8em, weight: "bold", hyphenate: false, {title}) parbreak() text(1.44em)[#subtitle] })}),