remove breaks for certain terms

This commit is contained in:
2025-10-09 21:33:43 +02:00
parent 5397c85397
commit a0eb5f4ed0
4 changed files with 35 additions and 4 deletions

View File

@@ -70,5 +70,5 @@
content; content;
bibliogr(language, citation_file); bibliogr(language, citation_file);
attachment_list(language); attachment_list(language);
}); }, language);
} }

View File

@@ -1,5 +1,5 @@
#import "../theme.typ": faculty_logotype, tul_logomark, faculty_color #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 #import "../utils.typ": is_none, assert_dict_has, map_none
#let base_font = "Inter"; #let base_font = "Inter";
@@ -15,7 +15,7 @@
// TYPST ELEMENT STYLING // TYPST ELEMENT STYLING
#let default_styling(flip_bonding, faculty_color, content) = { #let default_styling(flip_bonding, faculty_color, content, language) = {
// page // page
set page( set page(
margin: if flip_bonding { margin: if flip_bonding {
@@ -37,6 +37,9 @@
// text // text
set text(font: serif_font); set text(font: serif_font);
set par(justify: true, first-line-indent: 0.63cm); set par(justify: true, first-line-indent: 0.63cm);
if language == "cs" {
content = set_czech_nonbreakable_terms(content);
}
// figures // figures
let figure_numbering(realcount, c) = { let figure_numbering(realcount, c) = {

View File

@@ -40,5 +40,5 @@
content; content;
bibliogr(language, citation_file); bibliogr(language, citation_file);
attachment_list(language); attachment_list(language);
}); }, language);
} }

View File

@@ -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(language, document_type, author_pronouns) = {
let disclaimer = get_lang_item(language, "disclaimer_content"); let disclaimer = get_lang_item(language, "disclaimer_content");
let replacements = get_lang_item(language, "disclaimer_replace").at(document_type); let replacements = get_lang_item(language, "disclaimer_replace").at(document_type);