diff --git a/template/classic/bp.typ b/template/classic/bp.typ index 81de54a..23f5995 100644 --- a/template/classic/bp.typ +++ b/template/classic/bp.typ @@ -70,5 +70,5 @@ content; bibliogr(language, citation_file); attachment_list(language); - }); + }, language); } diff --git a/template/classic/common.typ b/template/classic/common.typ index f24d7a0..a09c7e2 100644 --- a/template/classic/common.typ +++ b/template/classic/common.typ @@ -1,5 +1,5 @@ #import "../theme.typ": faculty_logotype, tul_logomark, faculty_color -#import "../lang.typ": get_lang_item +#import "../lang.typ": get_lang_item, set_czech_nonbreakable_terms #import "../utils.typ": is_none, assert_dict_has, map_none #let base_font = "Inter"; @@ -15,7 +15,7 @@ // TYPST ELEMENT STYLING -#let default_styling(flip_bonding, faculty_color, content) = { +#let default_styling(flip_bonding, faculty_color, content, language) = { // page set page( margin: if flip_bonding { @@ -37,6 +37,9 @@ // text set text(font: serif_font); set par(justify: true, first-line-indent: 0.63cm); + if language == "cs" { + content = set_czech_nonbreakable_terms(content); + } // figures let figure_numbering(realcount, c) = { diff --git a/template/classic/other.typ b/template/classic/other.typ index 9b685df..ebfb3dc 100644 --- a/template/classic/other.typ +++ b/template/classic/other.typ @@ -40,5 +40,5 @@ content; bibliogr(language, citation_file); attachment_list(language); - }); + }, language); } diff --git a/template/lang.typ b/template/lang.typ index a6783fc..ee413b7 100644 --- a/template/lang.typ +++ b/template/lang.typ @@ -45,6 +45,34 @@ }); } +#let set_czech_nonbreakable_terms(content) = { + let space_after = ( + "[kosuvzai]", + "(tj|tzv|tzn)\.", + ); + show regex("\b((?i)(" + space_after.join("|") + ") )+\w+\b"): match => { + box(match); + } + + let nonbreaking_abbreviations = ( + "a. s", + "s. r. o", + "v. o. s", + "k. s", + "n. p", + "p. o", + "č. ([pe]|ev)", + "ev?. č", + ); + show regex( + "(?i)\b(" + nonbreaking_abbreviations.map((v) => { v.replace(".", "\\.") }).join("|") + ")\." + ): match => { + box(match); + } + + content +} + #let disclaimer(language, document_type, author_pronouns) = { let disclaimer = get_lang_item(language, "disclaimer_content"); let replacements = get_lang_item(language, "disclaimer_replace").at(document_type);