3 Commits

8 changed files with 40 additions and 13 deletions

View File

@@ -21,8 +21,8 @@ PACKDIR := pack/tultemplate2
BUNDLEDIR := pack/bundle BUNDLEDIR := pack/bundle
TO_PACK := $(shell find template -type f) template/LICENSE TO_PACK := $(shell find template -type f) template/LICENSE
BUNDLE_TARGETS := $(TO_PACK:%=$(BUNDLEDIR)/%) $(BUNDLEDIR)/citations.bib $(BUNDLEDIR)/bp.typ \ BUNDLE_TARGETS := $(TO_PACK:%=$(BUNDLEDIR)/%) $(BUNDLEDIR)/citations.bib $(BUNDLEDIR)/bp_cs.typ \
$(BUNDLEDIR)/dp.typ $(BUNDLEDIR)/Makefile $(BUNDLEDIR)/bp_en.typ $(BUNDLEDIR)/dp_cs.typ $(BUNDLEDIR)/Makefile
PACK_TARGETS := $(TO_PACK:%=$(PACKDIR)/%) $(PACKDIR)/documentation.typ \ PACK_TARGETS := $(TO_PACK:%=$(PACKDIR)/%) $(PACKDIR)/documentation.typ \
$(PACKDIR)/documentation.pdf $(PACKDIR)/citations.bib $(PACKDIR)/documentation.pdf $(PACKDIR)/citations.bib
@@ -51,11 +51,7 @@ $(BUNDLEDIR)/citations.bib: citations.bib
@mkdir -p $(@D) @mkdir -p $(@D)
ln -f $< $@ ln -f $< $@
$(BUNDLEDIR)/bp.typ: theses/bp.typ $(BUNDLEDIR)/%.typ: theses/%.typ
@mkdir -p $(@D)
awk 'BEGIN{RS=""; ORS="\n\n"} NR>2{print}' $< | sed 's/\.\.\/template\//template\//' > $@
$(BUNDLEDIR)/dp.typ: theses/dp.typ
@mkdir -p $(@D) @mkdir -p $(@D)
awk 'BEGIN{RS=""; ORS="\n\n"} NR>2{print}' $< | sed 's/\.\.\/template\//template\//' > $@ awk 'BEGIN{RS=""; ORS="\n\n"} NR>2{print}' $< | sed 's/\.\.\/template\//template\//' > $@

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);

View File

@@ -297,7 +297,7 @@
<sort> <sort>
<key variable="citation-number"/> <key variable="citation-number"/>
</sort> </sort>
<layout prefix="(" suffix=")" delimiter=", "> <layout prefix="[" suffix="]" delimiter=", ">
<group delimiter=", "> <group delimiter=", ">
<text variable="citation-number"/> <text variable="citation-number"/>
<group> <group>
@@ -312,7 +312,7 @@
<key variable="citation-number"/> <key variable="citation-number"/>
</sort> </sort>
<layout> <layout>
<text variable="citation-number" display="left-margin" suffix=". "/> <text variable="citation-number" display="left-margin" prefix="[" suffix="] "/>
<choose> <choose>
<if type="book map" match="any"> <if type="book map" match="any">
<group display="right-inline"> <group display="right-inline">