Skip to content

Commit

Permalink
add title-width param to force line breaks on title
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-wolf committed Nov 28, 2024
1 parent aed7212 commit 9fcf1a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions main.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
6 changes: 4 additions & 2 deletions template/lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -132,6 +133,7 @@
matriculation-number: none,
date: none,
bibliography: none,
title-width: 1,
language: "en",
paper: "a4",
) = body => {
Expand Down Expand Up @@ -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]
})}),
Expand Down

0 comments on commit 9fcf1a2

Please sign in to comment.