Compare commits
25 Commits
v0.5
...
afc1ee372f
Author | SHA1 | Date | |
---|---|---|---|
afc1ee372f
|
|||
d478d63812
|
|||
527534f885
|
|||
5c35389dca
|
|||
f22b16a803
|
|||
![]() |
f66f36d560 | ||
011ef2c950
|
|||
2787bed48d
|
|||
a691d84e1b
|
|||
![]() |
a0c75deba0 | ||
![]() |
1a7418d2cd | ||
2e300ded3c
|
|||
0e9fbcdc93
|
|||
bfe08ac9b4
|
|||
8a76ee9e1e
|
|||
d954a0e687
|
|||
eba0ec7826
|
|||
768ba54856
|
|||
85a6ed8d44
|
|||
afe325da0a
|
|||
cc079dd87d
|
|||
08c7123041
|
|||
c786ec2a4a
|
|||
5773e9785b
|
|||
f31bcaddec
|
5
Makefile
5
Makefile
@@ -10,7 +10,8 @@ watch_example:
|
|||||||
example: example.pdf
|
example: example.pdf
|
||||||
|
|
||||||
TO_PACK := $(shell find template -type f) template/LICENSE
|
TO_PACK := $(shell find template -type f) template/LICENSE
|
||||||
PACK_TARGETS := $(TO_PACK:%=pack/tultemplate2/%) pack/tultemplate2/example.typ
|
PACK_TARGETS := $(TO_PACK:%=pack/tultemplate2/%) pack/tultemplate2/example.typ \
|
||||||
|
pack/tultemplate2/citations.bib
|
||||||
|
|
||||||
.PHONY: pack
|
.PHONY: pack
|
||||||
pack: pack/tultemplate2.zip
|
pack: pack/tultemplate2.zip
|
||||||
@@ -25,7 +26,7 @@ pack/tultemplate2.zip: $(PACK_TARGETS)
|
|||||||
rm -f $@
|
rm -f $@
|
||||||
cd pack && zip -r tultemplate2.zip tultemplate2
|
cd pack && zip -r tultemplate2.zip tultemplate2
|
||||||
|
|
||||||
pack/tultemplate2/example.typ: example.typ
|
pack/tultemplate2/%: %
|
||||||
ln -f $< $@
|
ln -f $< $@
|
||||||
|
|
||||||
pack/tultemplate2/template/LICENSE: LICENSE
|
pack/tultemplate2/template/LICENSE: LICENSE
|
||||||
|
@@ -6,6 +6,7 @@ Easy Typst template for TUL documents. Begin by compiling `example.typ` and read
|
|||||||
|
|
||||||
It is recommended to use either:
|
It is recommended to use either:
|
||||||
- The on-line Typst editor (https://typst.app/play/) - use some zip build from releases
|
- The on-line Typst editor (https://typst.app/play/) - use some zip build from releases
|
||||||
|
(https://git.zumepro.cz/tul/tultemplate2/releases).
|
||||||
- The `typst` CLI tool (available in Arch repos and Snap)
|
- The `typst` CLI tool (available in Arch repos and Snap)
|
||||||
|
|
||||||
On Linux, with the `typst` command available, you can just run:
|
On Linux, with the `typst` command available, you can just run:
|
||||||
|
91
example.typ
91
example.typ
@@ -191,6 +191,34 @@ Tady je praktická ukázka jednoduchého vložení obrázku s popiskem:
|
|||||||
Logo *TUL*
|
Logo *TUL*
|
||||||
])
|
])
|
||||||
|
|
||||||
|
Obrázky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje).
|
||||||
|
|
||||||
|
== Tabulky
|
||||||
|
|
||||||
|
Tabulky lze vytvářet takto:
|
||||||
|
|
||||||
|
```typst
|
||||||
|
#figure(table(
|
||||||
|
columns: 3,
|
||||||
|
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
|
||||||
|
[*Řádek 1*], [a], [b],
|
||||||
|
[*Řádek 2*], [c], [d],
|
||||||
|
), caption: "Moje krásná tabulka")
|
||||||
|
```
|
||||||
|
|
||||||
|
#highlight[Hlavičku tabulky (první řádek) je dobré zabalit do funkce header (viz. výše)], to je
|
||||||
|
kvůli tomu, že Typst do vygenerovaného PDF souboru poté přidá metadata (například pro osoby se
|
||||||
|
zrakovým postižením).
|
||||||
|
|
||||||
|
#figure(table(
|
||||||
|
columns: 3,
|
||||||
|
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
|
||||||
|
[*Řádek 1*], [a], [b],
|
||||||
|
[*Řádek 2*], [c], [d],
|
||||||
|
), caption: "Moje krásná tabulka")
|
||||||
|
|
||||||
|
Tabulky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje).
|
||||||
|
|
||||||
== Citace
|
== Citace
|
||||||
|
|
||||||
Šablona podporuje správu citací pomocí standardního BibTeX @bibtex souboru, stejně jako
|
Šablona podporuje správu citací pomocí standardního BibTeX @bibtex souboru, stejně jako
|
||||||
@@ -298,25 +326,41 @@ Zvýrazněné hodnoty jsou základní -- pokud vynecháte parametr, pak bude pou
|
|||||||
#line()
|
#line()
|
||||||
- `title` (nadpis dokumentu)
|
- `title` (nadpis dokumentu)
|
||||||
- Ve formátu `(<zkratka_jazyka>: "<nadpis>")`, například `(cs: "Můj nadpis")`
|
- Ve formátu `(<zkratka_jazyka>: "<nadpis>")`, například `(cs: "Můj nadpis")`
|
||||||
|
- Pro většinu dokumentů (kromě `other`) jsou vyžadovány verze _cs_ a _en_ (kvůli abstraktu).
|
||||||
#line()
|
#line()
|
||||||
- `author` (autor/autoři dokumentu)
|
- `author` (autor/autoři dokumentu)
|
||||||
- Příklad: `"Pavel Novák"` nebo `"Petra Velká, Jindřich Peterka"` (oddělujte jména `", "`)
|
- Příklad: `"Pavel Novák"` nebo `"Petra Velká, Jindřich Peterka"`
|
||||||
#line()
|
#line()
|
||||||
- `author_gender` (rod autora v českém jazyce - není potřeba pro angličtinu)
|
- `author_gender` (jazykový rod autora - není potřeba pro angličtinu, která má základní hodnotu)
|
||||||
- `"male"` - Mužský rod
|
- Pro vybraný jazyk _cs_:
|
||||||
- `"female"` - Ženský rod
|
- `"masculine"` - Mužský rod
|
||||||
|
- `"feminine"` - Ženský rod
|
||||||
|
- `"we"` - Množné číslo
|
||||||
|
- Pro vybraný jazyk _en_:
|
||||||
|
- *`"me"`* - První osoba jednotného čísla
|
||||||
|
- `"we"` - První osoba množného čísla
|
||||||
#line()
|
#line()
|
||||||
- `supervisor` (vedoucí práce)
|
- `supervisor` (vedoucí práce) <arg_supervisor>
|
||||||
- Příklad: `"prof. Jindřich Jindřich"`
|
- V podobě textového řetězce, příklad: `"prof. Jindřich Jindřich"`
|
||||||
|
- Ve formátu `(name: "<jméno>", institute: "<institut>")` (toto lze využít například při DP)
|
||||||
#line()
|
#line()
|
||||||
- `programme` (studijní program autora)
|
- `consultant` (konzultant práce)
|
||||||
- Příklad: `"4242 - Odborná tvorba a zpracování krásných šablon"`
|
- Stejně jako u #link(<arg_supervisor>, [`supervisor`])
|
||||||
|
#line()
|
||||||
|
- `programme` (studijní program) <arg_programme>
|
||||||
|
- Ve formátu `(<zkratka_jazyka>: "<název_programu>")`
|
||||||
|
- Je vyžadován jazyk, který je vybrán pro celou šablonu -- tohle je pojistka, aby uživatel šablony
|
||||||
|
nevynechal vybraný jazyk
|
||||||
|
#line()
|
||||||
|
- `branch` (studijní obor)
|
||||||
|
- Stejně jako #link(<arg_programme>, [`programme`])
|
||||||
#line()
|
#line()
|
||||||
- `abstract` (abstrakt)
|
- `abstract` (abstrakt)
|
||||||
- Ve formátu `(<zkratka_jazyka>: [<abstrakt>])`, například `(cs: [Můj *krásný* abstrakt.])`
|
- Ve formátu `(<zkratka_jazyka>: [<abstrakt>])`, například `(cs: [Můj *krásný* abstrakt.])`
|
||||||
|
- Dokumenty vyžadují _cs_ i _en_ abstrakt (kromě typu dokumentu `other`).
|
||||||
#line()
|
#line()
|
||||||
- `keywords` (klíčová slova zobrazovaná pod abstraktem)
|
- `keywords` (klíčová slova zobrazovaná pod abstraktem)
|
||||||
- Ve formátu `("slovo1", "slovo2", ...)`
|
- Ve formátu `(<zkratka_jazyka>: ("slovo1", "slovo2", ...))`
|
||||||
#line()
|
#line()
|
||||||
- `assignment` (PDF soubor se zadáním)
|
- `assignment` (PDF soubor se zadáním)
|
||||||
- Ve formě cesty k souboru, například: `"zadani.pdf"`. Pokud je tento argument vynechán, bude
|
- Ve formě cesty k souboru, například: `"zadani.pdf"`. Pokud je tento argument vynechán, bude
|
||||||
@@ -359,6 +403,30 @@ Při dalších použití bude vypadat takto: #abbr("ZK").
|
|||||||
Tedy zkratku _nepřidáváte_ přímo do seznamu zkratek, ale elegantně jí používáte přímo v textu.
|
Tedy zkratku _nepřidáváte_ přímo do seznamu zkratek, ale elegantně jí používáte přímo v textu.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
== Přílohy
|
||||||
|
|
||||||
|
V některých typech dokumentů budete chtít přidat přílohy. Přílohy se přikládají v různých podobách:
|
||||||
|
|
||||||
|
- Jako odkaz (URL/URI adresa)
|
||||||
|
- Zmínka externího souboru (například další soubor nahraný do systému)
|
||||||
|
- Přiložený obsah (vygenerovaný Typstem v tomto dokumentu -- je tedy součástí tohoto kódu)
|
||||||
|
- Externí PDF soubor přiložený jako obsah (jiný PDF dokument, vložený do příloh v kompletní
|
||||||
|
podobě -- to je dobré například do tisku, kde můžete přílohy vytisknout s dokumentem)
|
||||||
|
|
||||||
|
#highlight[
|
||||||
|
Přílohy lze definovat *pouze na jednom* místě v dokumentu, aby se zabránilo omylnému opakování
|
||||||
|
příloh. Přílohy doporučujeme definovat *na konci* souboru pro přehlednost.
|
||||||
|
]
|
||||||
|
|
||||||
|
Zde je ukázka definice příloh (je také použita na konci tohoto ukázkového souboru):
|
||||||
|
|
||||||
|
```typst
|
||||||
|
#attachments(
|
||||||
|
attach_link("Zdrojový kód této šablony", "https://git.zumepro.cz/tul/tultemplate2"),
|
||||||
|
attach_content("Testovací obsah vygenerovaný Typstem", [Sem lze psát _stylovaný_ obsah.]),
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
= Workflow a jak si zjednoduššit práci
|
= Workflow a jak si zjednoduššit práci
|
||||||
|
|
||||||
Tyhle věci používat _nemusíte_, aby vám šablona fungovala. Nicméně často jsou poměrně fajn.
|
Tyhle věci používat _nemusíte_, aby vám šablona fungovala. Nicméně často jsou poměrně fajn.
|
||||||
@@ -421,3 +489,8 @@ Takhle si můžete předpřipravit délku odstavců a vyzkoušet si, jestli se r
|
|||||||
do požadavků. Pak můžete postupně přepisovat/vyplňovat.
|
do požadavků. Pak můžete postupně přepisovat/vyplňovat.
|
||||||
|
|
||||||
Funkce `todo` vám zároveň zabrání v tom, aby se text Lorem Ipsum vyskytl ve výsledném dokumentu.
|
Funkce `todo` vám zároveň zabrání v tom, aby se text Lorem Ipsum vyskytl ve výsledném dokumentu.
|
||||||
|
|
||||||
|
#attachments(
|
||||||
|
attach_link("Zdrojový kód této šablony", "https://git.zumepro.cz/tul/tultemplate2"),
|
||||||
|
attach_content("Testovací obsah vygenerovaný Typstem", [Sem lze psát _stylovaný_ obsah.]),
|
||||||
|
)
|
||||||
|
171
template/attachments.typ
Normal file
171
template/attachments.typ
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
#import "utils.typ": assert_type_signature, is_none
|
||||||
|
#import "lang.typ": get_lang_item
|
||||||
|
|
||||||
|
#let attachment_data = state("attachment_data");
|
||||||
|
|
||||||
|
#let attach_link(name, link) = {
|
||||||
|
assert_type_signature(link, "string", "attach link argument");
|
||||||
|
assert_type_signature(name, "string", "attach link name argument");
|
||||||
|
("link", link, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#let attach_content(name, inner_content) = {
|
||||||
|
assert_type_signature(inner_content, "content", "attach content argument");
|
||||||
|
assert_type_signature(name, "string", "attach content name argument");
|
||||||
|
("content", inner_content, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#let attach_pdf(name, filepath) = {
|
||||||
|
assert_type_signature(filepath, "string", "attach pdf argument");
|
||||||
|
assert_type_signature(name, "string", "attach pdf name argument");
|
||||||
|
("pdf", filepath, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#let attach_file_reference(name, filename) = {
|
||||||
|
assert_type_signature(filename, "string", "attach file reference filename argument");
|
||||||
|
assert_type_signature(name, "string", "attach file reference name argument");
|
||||||
|
("ref", filename, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#let make_content_anchor(idx) = {
|
||||||
|
"attachment_" + str(idx + 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
#let generate_attachment_content(attachment, idx) = {
|
||||||
|
let attachment_type = attachment.at(0);
|
||||||
|
if attachment_type == "content" {
|
||||||
|
let anchor = make_content_anchor(idx);
|
||||||
|
[#metadata(attachment.at(1)) #label(anchor)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#let generate_attachment_info(attachment, idx) = {
|
||||||
|
let attachment_type = attachment.at(0);
|
||||||
|
if type(attachment_type) != str {
|
||||||
|
panic("invalid attachment - wrap the attach using: attach_content, attach_pdf, ...");
|
||||||
|
}
|
||||||
|
if attachment_type == "content" {
|
||||||
|
let anchor = make_content_anchor(idx);
|
||||||
|
"(\"content\",\"" + anchor + "\",\"" + attachment.at(2) + "\")"
|
||||||
|
} else if attachment_type == "pdf" {
|
||||||
|
"(\"pdf\",\"" + attachment.at(1) + "\",\"" + attachment.at(2) + "\")"
|
||||||
|
} else if (
|
||||||
|
attachment_type == "pdf" or
|
||||||
|
attachment_type == "link" or
|
||||||
|
attachment_type == "ref"
|
||||||
|
) {
|
||||||
|
"(" + attachment.map((v) => { "\"" + v + "\"" }).join(",") + ",)"
|
||||||
|
} else {
|
||||||
|
panic("unknown attachment type '" + attachment_type + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#let attachments(..attachments) = {
|
||||||
|
let attachments = attachments.pos();
|
||||||
|
assert_type_signature(
|
||||||
|
attachments, "array[array[string | content]] | array[string | content]", "attachments"
|
||||||
|
);
|
||||||
|
context {
|
||||||
|
if not is_none(attachment_data.get()) {
|
||||||
|
panic("re-definition of attachments - attachments must only be defined once");
|
||||||
|
}
|
||||||
|
if attachments.len() == 0 {
|
||||||
|
attachment_data.update("false");
|
||||||
|
} else {
|
||||||
|
attachment_data.update({
|
||||||
|
"(" + if type(attachments) == array and type(attachments.at(0)) == array {
|
||||||
|
for (idx, attachment) in attachments.enumerate() {
|
||||||
|
(generate_attachment_info(attachment, idx),)
|
||||||
|
}.join(", ")
|
||||||
|
} else {
|
||||||
|
generate_attachment_info(attachments, 0)
|
||||||
|
} + ",)"
|
||||||
|
})
|
||||||
|
if type(attachments) == array and type(attachments.at(0)) == array {
|
||||||
|
for (idx, attachment) in attachments.enumerate() {
|
||||||
|
generate_attachment_content(attachment, idx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
generate_attachment_content(attachments, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#let list_entry(language, entry, is_embedded) = {
|
||||||
|
let entry_type = entry.at(0);
|
||||||
|
entry.at(2);
|
||||||
|
if entry_type == "link" {
|
||||||
|
": ";
|
||||||
|
link(entry.at(1));
|
||||||
|
} else if entry_type == "ref" {
|
||||||
|
": soubor ";
|
||||||
|
raw(entry.at(1));
|
||||||
|
}
|
||||||
|
if is_embedded {
|
||||||
|
text(
|
||||||
|
" (" + get_lang_item(language, "attached_bellow") + ")",
|
||||||
|
style: "italic",
|
||||||
|
fill: black.lighten(50%),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#let attachment_list(language) = {
|
||||||
|
context {
|
||||||
|
let data = attachment_data.get();
|
||||||
|
if is_none(data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let data = eval(data);
|
||||||
|
if data == false {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
heading(get_lang_item(language, "attachments"), numbering: none);
|
||||||
|
|
||||||
|
// listing
|
||||||
|
let has_embedded = false;
|
||||||
|
let enum_items = ();
|
||||||
|
for attachment in data {
|
||||||
|
let attachment_type = attachment.at(0);
|
||||||
|
let is_embedded = false;
|
||||||
|
if attachment_type == "content" or attachment_type == "pdf" {
|
||||||
|
has_embedded = true;
|
||||||
|
is_embedded = true;
|
||||||
|
}
|
||||||
|
enum_items.push(list_entry(language, attachment, is_embedded));
|
||||||
|
}
|
||||||
|
enum(..enum_items.map((v) => { enum.item(v) }), spacing: 1em);
|
||||||
|
|
||||||
|
if has_embedded {
|
||||||
|
pagebreak(weak: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// embedded
|
||||||
|
set page(footer: none);
|
||||||
|
for (idx, attachment) in data.enumerate() {
|
||||||
|
let attachment_type = attachment.at(0);
|
||||||
|
if attachment_type == "content" {
|
||||||
|
heading(
|
||||||
|
level: 2,
|
||||||
|
get_lang_item(language, "attachment") + " " + str(idx + 1),
|
||||||
|
numbering: none,
|
||||||
|
outlined: false,
|
||||||
|
);
|
||||||
|
query(label(attachment.at(1))).at(0).value;
|
||||||
|
} else if attachment_type == "pdf" {
|
||||||
|
import "@preview/muchpdf:0.1.1": muchpdf
|
||||||
|
page(place(center + horizon, heading(
|
||||||
|
level: 2,
|
||||||
|
get_lang_item(language, "attachment") + " " +
|
||||||
|
str(idx + 1) + " " +
|
||||||
|
get_lang_item(language, "next_page_attachment"),
|
||||||
|
numbering: none,
|
||||||
|
outlined: false,
|
||||||
|
)), margin: 0em);
|
||||||
|
set page(margin: 0em);
|
||||||
|
muchpdf(read("../" + attachment.at(1), encoding: none), width: 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -5,41 +5,65 @@
|
|||||||
assignment,
|
assignment,
|
||||||
disclaimer,
|
disclaimer,
|
||||||
abstract,
|
abstract,
|
||||||
|
acknowledgement,
|
||||||
toc,
|
toc,
|
||||||
abbrlist,
|
abbrlist,
|
||||||
|
imagelist,
|
||||||
|
tablelist,
|
||||||
bibliogr
|
bibliogr
|
||||||
)
|
)
|
||||||
#import "../utils.typ": is_none, assert_dict_has, assert_not_none
|
#import "../attachments.typ": attachment_list
|
||||||
|
#import "../utils.typ": is_none, assert_dict_has, assert_not_none, assert_type_signature
|
||||||
|
|
||||||
#let bp(
|
#let bp(
|
||||||
// general settings
|
// general settings
|
||||||
faculty_id, faculty_color, language, assignment_document, citation_file,
|
faculty_id, faculty_color, language, assignment_document, citation_file,
|
||||||
|
|
||||||
// document info
|
// document info
|
||||||
title, author, author_gender, supervisor, study_programme, abstract_content, keywords,
|
title, author, author_gender, supervisor, consultant, study_programme, study_branch,
|
||||||
|
abstract_content, acknowledgement_content, keywords,
|
||||||
|
|
||||||
content
|
content
|
||||||
) = {
|
) = {
|
||||||
let force_langs = ("cs", "en");
|
let force_langs = ("cs", "en");
|
||||||
|
assert_not_none(title, "title");
|
||||||
assert_dict_has(force_langs, title, "title");
|
assert_dict_has(force_langs, title, "title");
|
||||||
|
|
||||||
|
assert_not_none(study_programme, "study programme");
|
||||||
|
assert_dict_has((language,), study_programme, "study programme");
|
||||||
|
assert_not_none(study_branch, "study branch");
|
||||||
|
assert_dict_has((language,), study_branch, "study branch");
|
||||||
|
|
||||||
assert_not_none(abstract_content, "abstract");
|
assert_not_none(abstract_content, "abstract");
|
||||||
assert_dict_has(force_langs, abstract_content, "abstract");
|
assert_dict_has(force_langs, abstract_content, "abstract");
|
||||||
if not is_none(keywords) {
|
if not is_none(keywords) {
|
||||||
assert_dict_has(force_langs, keywords, "keywords");
|
assert_dict_has(force_langs, keywords, "keywords");
|
||||||
}
|
}
|
||||||
|
assert_not_none(acknowledgement_content, "acknowledgement content");
|
||||||
if language == "cs" {
|
if language == "cs" {
|
||||||
assert_not_none(author_gender, "author gender");
|
assert_not_none(author_gender, "author gender");
|
||||||
}
|
}
|
||||||
|
|
||||||
mainpage(faculty_id, language, none, title, author, supervisor, study_programme);
|
assert_type_signature(supervisor, "string | none", "supervisor");
|
||||||
|
assert_type_signature(consultant, "string | none", "consultant");
|
||||||
|
|
||||||
|
mainpage(
|
||||||
|
faculty_id, language, "bp", title, author, supervisor, consultant, study_programme,
|
||||||
|
study_branch,
|
||||||
|
);
|
||||||
assignment(language, assignment_document);
|
assignment(language, assignment_document);
|
||||||
default_styling(false, faculty_color, {
|
default_styling(false, faculty_color, {
|
||||||
disclaimer(language, faculty_id, "bp", author, author_gender);
|
disclaimer(language, faculty_id, "bp", author, author_gender);
|
||||||
abstract("cs", title, abstract_content, keywords);
|
abstract("cs", title, abstract_content, keywords);
|
||||||
abstract("en", title, abstract_content, keywords);
|
abstract("en", title, abstract_content, keywords);
|
||||||
|
acknowledgement(language, author, acknowledgement_content);
|
||||||
toc(language);
|
toc(language);
|
||||||
|
tablelist(language);
|
||||||
|
imagelist(language);
|
||||||
abbrlist(language);
|
abbrlist(language);
|
||||||
content
|
pagebreak(weak: true);
|
||||||
bibliogr(citation_file);
|
content;
|
||||||
|
bibliogr(language, citation_file);
|
||||||
|
attachment_list(language);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// tools & utils
|
// tools & utils
|
||||||
#import "../theme.typ": faculty_logotype, tul_logomark, faculty_color
|
#import "../theme.typ": faculty_logotype, tul_logomark, faculty_color
|
||||||
#import "../lang.typ": lang_id, get_lang_item
|
#import "../lang.typ": lang_id, get_lang_item
|
||||||
#import "../utils.typ": assert_in_dict, assert_in_arr, map_none
|
#import "../utils.typ": assert_in_dict, assert_in_arr, map_none, assert_dict_has
|
||||||
|
|
||||||
// thesis types
|
// thesis types
|
||||||
#import "bp.typ": bp
|
#import "bp.typ": bp
|
||||||
@@ -12,29 +12,38 @@
|
|||||||
language, faculty_id, document_type, citation_file, assignment_document,
|
language, faculty_id, document_type, citation_file, assignment_document,
|
||||||
|
|
||||||
// document info
|
// document info
|
||||||
title, author, author_gender, supervisor, study_programme, abstract, keywords,
|
title, author, author_gender, supervisor, consultant, study_programme, study_branch, abstract,
|
||||||
|
acknowledgement, keywords,
|
||||||
|
|
||||||
// content
|
// content
|
||||||
content,
|
content,
|
||||||
) = {
|
) = {
|
||||||
|
// argument pre-checking
|
||||||
let document_types = (
|
let document_types = (
|
||||||
"bp": bp,
|
"bp": bp,
|
||||||
"other": other,
|
"other": other,
|
||||||
)
|
)
|
||||||
assert_in_dict(document_type, document_types, "document type");
|
assert_in_dict(document_type, document_types, "document type");
|
||||||
|
map_none(title, (v) => assert_dict_has((language,), v, "title"));
|
||||||
|
map_none(study_programme, (v) => assert_dict_has((language,), v, "study programme"));
|
||||||
|
map_none(study_branch, (v) => assert_dict_has((language,), v, "study branch"));
|
||||||
|
map_none(acknowledgement, (v) => assert_dict_has((language,), v, "acknowledgement content"));
|
||||||
|
|
||||||
document_types.at(document_type)(
|
document_types.at(document_type)(
|
||||||
faculty_id,
|
faculty_id,
|
||||||
faculty_color(faculty_id),
|
faculty_color(faculty_id),
|
||||||
language,
|
language,
|
||||||
assignment_document,
|
map_none(assignment_document, (v) => "../../" + v),
|
||||||
map_none(citation_file, (v) => "../../" + v),
|
map_none(citation_file, (v) => "../../" + v),
|
||||||
title,
|
title,
|
||||||
author,
|
author,
|
||||||
author_gender,
|
author_gender,
|
||||||
supervisor,
|
supervisor,
|
||||||
|
consultant,
|
||||||
study_programme,
|
study_programme,
|
||||||
|
study_branch,
|
||||||
abstract,
|
abstract,
|
||||||
|
acknowledgement,
|
||||||
keywords,
|
keywords,
|
||||||
content,
|
content,
|
||||||
);
|
);
|
||||||
|
@@ -1,12 +1,17 @@
|
|||||||
#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
|
||||||
#import "../utils.typ": is_none
|
#import "../utils.typ": is_none, assert_dict_has
|
||||||
|
|
||||||
#let base_font = "Inter";
|
#let base_font = "Inter";
|
||||||
#let mono_font = "Noto Sans Mono";
|
#let mono_font = "Noto Sans Mono";
|
||||||
#let serif_font = "Merriweather";
|
#let serif_font = "Merriweather";
|
||||||
#let tul_logomark_size = 6.5em;
|
#let tul_logomark_size = 6.5em;
|
||||||
|
|
||||||
|
// COUNTERS
|
||||||
|
|
||||||
|
#let image_count = counter("image_count");
|
||||||
|
#let table_count = counter("table_count");
|
||||||
|
|
||||||
// TYPST ELEMENT STYLING
|
// TYPST ELEMENT STYLING
|
||||||
|
|
||||||
#let default_styling(flip_bonding, faculty_color, content) = {
|
#let default_styling(flip_bonding, faculty_color, content) = {
|
||||||
@@ -32,6 +37,19 @@
|
|||||||
set text(font: serif_font);
|
set text(font: serif_font);
|
||||||
set par(justify: true);
|
set par(justify: true);
|
||||||
|
|
||||||
|
// figures
|
||||||
|
let figure_numbering(realcount, c) = {
|
||||||
|
context realcount.step();
|
||||||
|
context numbering("1. 1", counter(heading).get().at(0), c)
|
||||||
|
};
|
||||||
|
show figure.where(kind: image): set figure(numbering: figure_numbering.with(image_count));
|
||||||
|
show figure.where(kind: table): set figure(numbering: figure_numbering.with(table_count));
|
||||||
|
show figure.where(kind: table): set figure.caption(position: top);
|
||||||
|
show figure: it => {
|
||||||
|
block(it, above: 2em, below: 2em);
|
||||||
|
}
|
||||||
|
set image(width: 80%);
|
||||||
|
|
||||||
// heading
|
// heading
|
||||||
set heading(numbering: "1.1.1 ");
|
set heading(numbering: "1.1.1 ");
|
||||||
show heading: it => {
|
show heading: it => {
|
||||||
@@ -43,6 +61,10 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
show heading.where(level: 1): it => {
|
show heading.where(level: 1): it => {
|
||||||
|
// reset figure counters
|
||||||
|
context counter(figure.where(kind: image)).update(0);
|
||||||
|
context counter(figure.where(kind: table)).update(0);
|
||||||
|
|
||||||
pagebreak(weak: true);
|
pagebreak(weak: true);
|
||||||
v(2cm);
|
v(2cm);
|
||||||
it
|
it
|
||||||
@@ -54,7 +76,6 @@
|
|||||||
block(it, fill: rgb("#eee"), inset: 1em)
|
block(it, fill: rgb("#eee"), inset: 1em)
|
||||||
};
|
};
|
||||||
set highlight(fill: faculty_color.lighten(90%));
|
set highlight(fill: faculty_color.lighten(90%));
|
||||||
set image(width: 80%);
|
|
||||||
|
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
@@ -69,16 +90,40 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DOCUMENT INFO
|
// DOCUMENT INFO
|
||||||
|
|
||||||
|
#let person_info(record, item_name) = {
|
||||||
|
if is_none(record) {
|
||||||
|
none
|
||||||
|
} else if type(record) == str {
|
||||||
|
record
|
||||||
|
} else if type(record) == dictionary {
|
||||||
|
if "name" in record {
|
||||||
|
record.at("name");
|
||||||
|
if "institute" in record {
|
||||||
|
text("\n " + record.at("institute"), style: "italic")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let panic_message = (
|
||||||
|
item_name + " name is required (or try not specifying " + item_name + " at all)"
|
||||||
|
);
|
||||||
|
panic(panic_message);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let panic_message = "invalid " + item_name + " - expected a string or a dictionary";
|
||||||
|
panic(panic_message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#let info(
|
#let info(
|
||||||
faculty_id,
|
faculty_id,
|
||||||
language,
|
language,
|
||||||
document_type,
|
document_type,
|
||||||
title, author, supervisor, study_programme,
|
title, author, supervisor, consultant, study_programme, study_branch,
|
||||||
) = {
|
) = {
|
||||||
let info_name_value_padding = 5em;
|
let info_name_value_padding = 5em;
|
||||||
let info_name_min_width = 10em;
|
let info_name_min_width = 10em;
|
||||||
|
let gutter = .7em;
|
||||||
|
|
||||||
// document type
|
// document type
|
||||||
if type(document_type) != type(none) {
|
if type(document_type) != type(none) {
|
||||||
@@ -97,8 +142,10 @@
|
|||||||
// [field_name, field_value, bold]
|
// [field_name, field_value, bold]
|
||||||
let info_fields = (
|
let info_fields = (
|
||||||
("study_programme", study_programme, false),
|
("study_programme", study_programme, false),
|
||||||
(if author.contains(", ") { "authors" } else { "author" }, author, true),
|
("study_branch", study_branch, false),
|
||||||
("supervisor", supervisor, false),
|
("author", author, true),
|
||||||
|
("supervisor", person_info(supervisor, "supervisor"), false),
|
||||||
|
("consultant", person_info(consultant, "consultant"), false),
|
||||||
)
|
)
|
||||||
context {
|
context {
|
||||||
let max_field_name_width = calc.max(..info_fields.map((v) => {
|
let max_field_name_width = calc.max(..info_fields.map((v) => {
|
||||||
@@ -110,19 +157,19 @@
|
|||||||
}), info_name_min_width.to-absolute());
|
}), info_name_min_width.to-absolute());
|
||||||
grid(
|
grid(
|
||||||
columns: 2,
|
columns: 2,
|
||||||
rows: (auto, 1.2em),
|
gutter: gutter,
|
||||||
..info_fields.filter((v) => { type(v.at(1)) != type(none) }).map((v) => {
|
..info_fields.filter((v) => { type(v.at(1)) != type(none) }).map((v) => {
|
||||||
(
|
(
|
||||||
block(
|
align(top, block(
|
||||||
text(get_lang_item(language, v.at(0)) + ":", style: "italic", font: base_font),
|
text(get_lang_item(language, v.at(0)) + ":", style: "italic", font: base_font),
|
||||||
width: max_field_name_width + info_name_value_padding,
|
width: max_field_name_width + info_name_value_padding
|
||||||
),
|
)),
|
||||||
text(v.at(1), font: base_font, weight: if v.at(2) { "bold" } else { "regular" })
|
text(v.at(1), font: base_font, weight: if v.at(2) { "bold" } else { "regular" })
|
||||||
)
|
)
|
||||||
}).flatten(),
|
}).flatten(),
|
||||||
);
|
);
|
||||||
v(1em);
|
v(1em);
|
||||||
h(max_field_name_width + info_name_value_padding);
|
h(max_field_name_width + info_name_value_padding + gutter);
|
||||||
text(get_lang_item(language, "city") + " " + str(datetime.today().year()), font: base_font);
|
text(get_lang_item(language, "city") + " " + str(datetime.today().year()), font: base_font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,21 +180,22 @@
|
|||||||
faculty_id,
|
faculty_id,
|
||||||
language,
|
language,
|
||||||
document_type,
|
document_type,
|
||||||
title, author, supervisor, study_programme,
|
title, author, supervisor, consultant, study_programme, study_branch
|
||||||
) = {
|
) = {
|
||||||
import "../utils.typ": has_all_none
|
import "../utils.typ": has_all_none, map_none
|
||||||
let nonetype = type(none);
|
let nonetype = type(none);
|
||||||
page({
|
page({
|
||||||
if has_all_none((
|
if has_all_none((
|
||||||
document_type, title, author, supervisor, study_programme,
|
document_type, title, author, supervisor, consultant, study_programme,
|
||||||
)) {
|
)) {
|
||||||
place(center + horizon, align(left, faculty_logotype(faculty_id, language)));
|
place(center + horizon, align(left, faculty_logotype(faculty_id, language)));
|
||||||
} else {
|
} else {
|
||||||
header(faculty_id, language);
|
header(faculty_id, language);
|
||||||
align({
|
align({
|
||||||
info(
|
info(
|
||||||
faculty_id, language, document_type, title.at(language),
|
faculty_id, language, document_type, map_none(title, (v) => v.at(language)),
|
||||||
author, supervisor, study_programme,
|
author, supervisor, consultant, map_none(study_programme, (v) => v.at(language)),
|
||||||
|
map_none(study_branch, (v) => v.at(language)),
|
||||||
);
|
);
|
||||||
v(5em);
|
v(5em);
|
||||||
}, bottom);
|
}, bottom);
|
||||||
@@ -196,6 +244,18 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ACKNOWLEDGEMENT PAGE
|
||||||
|
|
||||||
|
#let acknowledgement(language, author, content) = {
|
||||||
|
if is_none(content) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
heading(get_lang_item(language, "acknowledgement"), numbering: none, outlined: false);
|
||||||
|
par(content.at(language));
|
||||||
|
v(2em);
|
||||||
|
align(right, author);
|
||||||
|
}
|
||||||
|
|
||||||
// ABSTRACT
|
// ABSTRACT
|
||||||
|
|
||||||
#let abstract(language, title, content, keywords) = {
|
#let abstract(language, title, content, keywords) = {
|
||||||
@@ -216,6 +276,61 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _ OUTLINE FIGURE INNER
|
||||||
|
#let _outline_figure_inner(selector, title, body_mapper) = {
|
||||||
|
let entry(selector, element) = {
|
||||||
|
link(
|
||||||
|
element.location(),
|
||||||
|
grid(
|
||||||
|
columns: 3,
|
||||||
|
gutter: .5em,
|
||||||
|
stack(
|
||||||
|
dir: ltr,
|
||||||
|
text(numbering(
|
||||||
|
"1.1",
|
||||||
|
counter(heading).at(element.location()).at(0),
|
||||||
|
counter(selector).at(element.location()).at(0),
|
||||||
|
)),
|
||||||
|
h(.5em),
|
||||||
|
text(body_mapper(element)),
|
||||||
|
),
|
||||||
|
box(repeat([.], gap: 0.15em)),
|
||||||
|
str(element.location().page()),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
heading(title, numbering: none);
|
||||||
|
for el in query(figure.where(kind: selector)) {
|
||||||
|
if is_none(el.caption) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
entry(figure.where(kind: selector), el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// _ FIGURE OUTLINE
|
||||||
|
|
||||||
|
#let _figure_outline(realcount, target, title) = {
|
||||||
|
context {
|
||||||
|
if realcount.final().at(0) == 0 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_outline_figure_inner(target, title, (it) => it.caption.body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IMAGE LIST
|
||||||
|
|
||||||
|
#let imagelist(language) = {
|
||||||
|
_figure_outline(image_count, image, get_lang_item(language, "image_list"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// TABLE LIST
|
||||||
|
|
||||||
|
#let tablelist(language) = {
|
||||||
|
_figure_outline(table_count, table, get_lang_item(language, "table_list"));
|
||||||
|
}
|
||||||
|
|
||||||
// ABBREVIATION LIST
|
// ABBREVIATION LIST
|
||||||
|
|
||||||
#let abbrlist(language) = {
|
#let abbrlist(language) = {
|
||||||
|
@@ -1,25 +1,40 @@
|
|||||||
#import "../lang.typ": get_lang_item
|
#import "../lang.typ": get_lang_item
|
||||||
#import "common.typ": mainpage, default_styling, assignment, disclaimer, abstract, toc, abbrlist
|
#import "common.typ": (
|
||||||
#import "../utils.typ": is_none
|
mainpage,
|
||||||
|
default_styling,
|
||||||
|
assignment,
|
||||||
|
disclaimer,
|
||||||
|
abstract,
|
||||||
|
toc,
|
||||||
|
abbrlist,
|
||||||
|
imagelist,
|
||||||
|
tablelist,
|
||||||
|
)
|
||||||
|
#import "../attachments.typ": attachment_list
|
||||||
|
#import "../utils.typ": is_none, assert_not_none, assert_dict_has, assert_in_arr
|
||||||
|
|
||||||
#let other(
|
#let other(
|
||||||
// general settings
|
// general settings
|
||||||
faculty_id, faculty_color, language, assignment_document, citation_file,
|
faculty_id, faculty_color, language, assignment_document, citation_file,
|
||||||
|
|
||||||
// document info
|
// document info
|
||||||
title, author, _, supervisor, study_programme, abstract_content, keywords,
|
title, author, _, supervisor, consultant, study_programme, study_branch, abstract_content,
|
||||||
|
_, keywords,
|
||||||
|
|
||||||
content
|
content
|
||||||
) = {
|
) = {
|
||||||
mainpage(faculty_id, language, none, title, author, supervisor, study_programme);
|
assert_not_none(title, "title");
|
||||||
|
assert_dict_has((language,), title, "title");
|
||||||
|
|
||||||
|
mainpage(faculty_id, language, none, title, author, supervisor, consultant, study_programme, study_branch);
|
||||||
default_styling(true, faculty_color, {
|
default_styling(true, faculty_color, {
|
||||||
toc(language);
|
toc(language);
|
||||||
|
tablelist(language);
|
||||||
|
imagelist(language);
|
||||||
abbrlist(language);
|
abbrlist(language);
|
||||||
|
|
||||||
pagebreak(to: "even", weak: true);
|
pagebreak(to: "even", weak: true);
|
||||||
content
|
content;
|
||||||
|
|
||||||
// bibliography
|
|
||||||
bibliography(citation_file, style: "../tul_citace.csl");
|
bibliography(citation_file, style: "../tul_citace.csl");
|
||||||
|
attachment_list(language);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -3,18 +3,18 @@
|
|||||||
"author": "Autor",
|
"author": "Autor",
|
||||||
"authors": "Autoři",
|
"authors": "Autoři",
|
||||||
"supervisor": "Vedoucí práce",
|
"supervisor": "Vedoucí práce",
|
||||||
|
"consultant": "Konzultant práce",
|
||||||
"study_programme": "Studijní program",
|
"study_programme": "Studijní program",
|
||||||
|
"study_branch": "Studijní obor",
|
||||||
|
|
||||||
"bp": "Bakalářská práce",
|
"bp": "Bakalářská práce",
|
||||||
"dp": "Diplomová práce",
|
|
||||||
"dis": "Disertační práce",
|
|
||||||
|
|
||||||
"city": "Liberec",
|
"city": "Liberec",
|
||||||
|
|
||||||
"toc": "Obsah",
|
"toc": "Obsah",
|
||||||
|
|
||||||
"disclaimer": "Prohlášení",
|
"disclaimer": "Prohlášení",
|
||||||
"disclaimer_content": "Prohlašuji, že {svůj} {práce:tu} jsem vypracoval{a} samostatně jako původní dílo s použitím uvedené literatury a na základě konzultací s vedoucím mé bakalářské práce a konzultantem.\n\nJsem si vědom{a} toho, že na {moji} {práce:tu} se plně vztahuje zákon č. 121/2000 Sb., o právu autorském, zejména § 60 – školní dílo.\n\nBeru na vědomí, že Technická univerzita v Liberci nezasahuje do mých autorských práv užitím {mé} {práce:té} pro vnitřní potřebu Technické univerzity v Liberci.\n\nUžiji-li {práce:tu} nebo poskytnu-li licenci k {jejímu} využití, jsem si vědom{a} povinnosti informovat o této skutečnosti Technickou univerzitu v Liberci; v tomto případě má Technická univerzita v Liberci právo ode mne požadovat úhradu nákladů, které vynaložila na vytvoření díla, až do jejich skutečné výše.\n\nSoučasně čestně prohlašuji, že text elektronické podoby práce vložený do IS/STAG se shoduje s textem tištěné podoby práce.\n\nBeru na vědomí, že {můj} {práce:ta} bude {zveřejněn} Technickou univerzitou v Liberci v souladu s § 47b zákona č. 111/1998 Sb., o vysokých školách a o změně a doplnění dalších zákonů (zákon o vysokých školách), ve znění pozdějších předpisů.\n\nJsem si vědom{a} následků, které podle zákona o vysokých školách mohou vyplývat z porušení tohoto prohlášení.",
|
"disclaimer_content": "Prohlašuj{g:i|i|eme}, že {svůj} {práce:tu} js{g:em|em|me} vypracoval{g:|a|i} samostatně jako původní dílo s použitím uvedené literatury a na základě konzultací s vedoucím {{g:mé|mé|naší}} bakalářské práce a konzultantem.\n\nJs{g:em|em|me} si vědom{g:|a|i} toho, že na {{g:moji|moji|naši}} {práce:tu} se plně vztahuje zákon č. 121/2000 Sb., o právu autorském, zejména § 60 – školní dílo.\n\nBer{g:u|u|eme} na vědomí, že Technická univerzita v Liberci nezasahuje do {g:mých|mých|našich} autorských práv užitím {{g:mé|mé|naší}} {práce:té} pro vnitřní potřebu Technické univerzity v Liberci.\n\nUžij{g:i|i|eme}-li {práce:tu} nebo poskytn{g:u|u|eme}-li licenci k {jejímu} využití, js{g:em|em|me} si vědom{g:|a|i} povinnosti informovat o této skutečnosti Technickou univerzitu v Liberci; v tomto případě má Technická univerzita v Liberci právo od{g:e|e|} {g:mne|mne|nás} požadovat úhradu nákladů, které vynaložila na vytvoření díla, až do jejich skutečné výše.\n\nSoučasně čestně prohlašuj{g:i|i|eme}, že text elektronické podoby práce vložený do IS/STAG se shoduje s textem tištěné podoby práce.\n\nBer{g:u|u|eme} na vědomí, že {{g:můj|můj|naše}} {práce:ta} bude {zveřejněn} Technickou univerzitou v Liberci v souladu s § 47b zákona č. 111/1998 Sb., o vysokých školách a o změně a doplnění dalších zákonů (zákon o vysokých školách), ve znění pozdějších předpisů.\n\nJs{g:em|em|me} si vědom{g:|a|i} následků, které podle zákona o vysokých školách mohou vyplývat z porušení tohoto prohlášení.",
|
||||||
|
|
||||||
"disclaimer_replace": {
|
"disclaimer_replace": {
|
||||||
"bp": {
|
"bp": {
|
||||||
@@ -22,6 +22,9 @@
|
|||||||
"práce:tu": "bakalářskou práci",
|
"práce:tu": "bakalářskou práci",
|
||||||
"práce:té": "bakalářské práce",
|
"práce:té": "bakalářské práce",
|
||||||
"moji": "moji",
|
"moji": "moji",
|
||||||
|
"naše": "naše",
|
||||||
|
"naši": "naši",
|
||||||
|
"naší": "naší",
|
||||||
"mé": "mé",
|
"mé": "mé",
|
||||||
"můj": "moje",
|
"můj": "moje",
|
||||||
"svůj": "svoji",
|
"svůj": "svoji",
|
||||||
@@ -33,8 +36,15 @@
|
|||||||
"date": "[day]. [month]. [year]",
|
"date": "[day]. [month]. [year]",
|
||||||
|
|
||||||
"abstract": "Abstrakt",
|
"abstract": "Abstrakt",
|
||||||
|
"acknowledgement": "Poděkování",
|
||||||
"keywords": "Klíčová slova",
|
"keywords": "Klíčová slova",
|
||||||
"abbrs": "Seznam zkratek",
|
"abbrs": "Seznam zkratek",
|
||||||
|
"image_list": "Seznam obrázků",
|
||||||
|
"table_list": "Seznam tabulek",
|
||||||
|
"attachments": "Přílohy",
|
||||||
|
"attachment": "Příloha",
|
||||||
|
"next_page_attachment": "začíná na další straně",
|
||||||
|
"attached_bellow": "dále přiloženo",
|
||||||
|
|
||||||
"place_assignment": "Sem vložte zadání"
|
"place_assignment": "Sem vložte zadání"
|
||||||
},
|
},
|
||||||
@@ -43,18 +53,18 @@
|
|||||||
"author": "Author",
|
"author": "Author",
|
||||||
"authors": "Authors",
|
"authors": "Authors",
|
||||||
"supervisor": "Supervisor",
|
"supervisor": "Supervisor",
|
||||||
|
"consultant": "Consultant",
|
||||||
"study_programme": "Study programme",
|
"study_programme": "Study programme",
|
||||||
|
"study_branch": "Study branch",
|
||||||
|
|
||||||
"bp": "Bachelor thesis",
|
"bp": "Bachelor thesis",
|
||||||
"dp": "Diploma thesis",
|
|
||||||
"dis": "Dissertation thesis",
|
|
||||||
|
|
||||||
"city": "Liberec",
|
"city": "Liberec",
|
||||||
|
|
||||||
"toc": "Contents",
|
"toc": "Contents",
|
||||||
|
|
||||||
"disclaimer": "Declaration",
|
"disclaimer": "Declaration",
|
||||||
"disclaimer_content": "I hereby certify, I, myself, have written my {thesis} as an original and primary work using the literature listed below and consulting it with my thesis supervisor and my thesis counsellor.\n\nI acknowledge that my {thesis} is fully governed by Act No. 121/2000 Coll., the Copyright Act, in particular Article 60 – School Work.\n\nI acknowledge that the Technical University of Liberec does not infringe my copyrights by using my {thesis} for internal purposes of the Technical University of Liberec.\n\nI am aware of my obligation to inform the Technical University of Liberec on having used or granted license to use the results of my {thesis}; in such a case the Technical University of Liberec may require reimbursement of the costs incurred for creating the result up to their actual amount.\n\nAt the same time, I honestly declare that the text of the printed version of my {thesis} is identical with the text of the electronic version uploaded into the IS STAG.\n\nI acknowledge that the Technical University of Liberec will make my {thesis} public in accordance with paragraph 47b of Act No. 111/1998 Coll., on Higher Education Institutions and on Amendment to Other Acts (the Higher Education Act), as amended.\n\nI am aware of the consequences which may under the Higher Education Act result from a breach of this declaration.",
|
"disclaimer_content": "{g:I|We} hereby certify, {g:I|we}, {g:myself|ourselves}, have written {g:my|our} {thesis} as an original and primary work using the literature listed below and consulting it with {g:my|our} thesis supervisor and {g:my|our} thesis counsellor.\n\n{g:I|We} acknowledge that {g:my|our} {thesis} is fully governed by Act No. 121/2000 Coll., the Copyright Act, in particular Article 60 – School Work.\n\n{g:I|We} acknowledge that the Technical University of Liberec does not infringe {g:my|our} copyrights by using {g:my|our} {thesis} for internal purposes of the Technical University of Liberec.\n\n{g:I|We} {g:am|are} aware of {g:my|our} obligation to inform the Technical University of Liberec on having used or granted license to use the results of {g:my|our} {thesis}; in such a case the Technical University of Liberec may require reimbursement of the costs incurred for creating the result up to their actual amount.\n\nAt the same time, {g:I|we} honestly declare that the text of the printed version of {g:my|our} {thesis} is identical with the text of the electronic version uploaded into the IS STAG.\n\n{g:I|We} acknowledge that the Technical University of Liberec will make {g:my|our} {thesis} public in accordance with paragraph 47b of Act No. 111/1998 Coll., on Higher Education Institutions and on Amendment to Other Acts (the Higher Education Act), as amended.\n\n{g:I|We} {g:am|are} aware of the consequences which may under the Higher Education Act result from a breach of this declaration.",
|
||||||
|
|
||||||
"disclaimer_replace": {
|
"disclaimer_replace": {
|
||||||
"bp": {
|
"bp": {
|
||||||
@@ -65,8 +75,15 @@
|
|||||||
"date": "[year]-[month]-[day]",
|
"date": "[year]-[month]-[day]",
|
||||||
|
|
||||||
"abstract": "Abstract",
|
"abstract": "Abstract",
|
||||||
|
"acknowledgement": "Acknowledgement",
|
||||||
"keywords": "Keywords",
|
"keywords": "Keywords",
|
||||||
"abbrs": "List of abbreviations",
|
"abbrs": "List of abbreviations",
|
||||||
|
"image_list": "List of images",
|
||||||
|
"table_list": "List of tables",
|
||||||
|
"attachments": "Attachments",
|
||||||
|
"attachment": "Attachment",
|
||||||
|
"next_page_attachment": "begins on the next page",
|
||||||
|
"attached_bellow": "attached bellow",
|
||||||
|
|
||||||
"place_assignment": "Insert your assignment here"
|
"place_assignment": "Insert your assignment here"
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#import "utils.typ": assert_in_dict
|
#import "utils.typ": assert_in_dict, assert_in_arr, map_none, ok_or
|
||||||
|
|
||||||
#let lang_ids = (
|
#let lang_ids = (
|
||||||
cs: 0,
|
cs: 0,
|
||||||
@@ -21,16 +21,37 @@
|
|||||||
return lang_items.at(lang_abbr).at(item_name);
|
return lang_items.at(lang_abbr).at(item_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#let replace_czech_gender(raw, gender) = {
|
||||||
|
let genders = (
|
||||||
|
feminine: 1,
|
||||||
|
masculine: 0,
|
||||||
|
we: 2,
|
||||||
|
);
|
||||||
|
assert_in_dict(gender, genders, "author gender");
|
||||||
|
raw.replace(regex("\{g:([^|]*)\|([^|]*)\|([^}]*)\}"), (match) => {
|
||||||
|
match.captures.at(genders.at(gender))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#let replace_english_pronounce(raw, pronounce) = {
|
||||||
|
let pronounce = ok_or(pronounce, "me");
|
||||||
|
let pronouns = (
|
||||||
|
me: 0,
|
||||||
|
we: 1,
|
||||||
|
);
|
||||||
|
assert_in_dict(pronounce, pronouns, "author gender");
|
||||||
|
raw.replace(regex("\{g:([^|]*)\|([^}]*)\}"), (match) => {
|
||||||
|
match.captures.at(pronouns.at(pronounce))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#let disclaimer(language, document_type, author_gender) = {
|
#let disclaimer(language, document_type, author_gender) = {
|
||||||
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);
|
||||||
if language == "cs" {
|
if language == "cs" {
|
||||||
let gender_transforms = (
|
disclaimer = replace_czech_gender(disclaimer, author_gender);
|
||||||
male: "",
|
} else if language == "en" {
|
||||||
female: "a",
|
disclaimer = replace_english_pronounce(disclaimer, author_gender);
|
||||||
);
|
|
||||||
assert_in_dict(author_gender, gender_transforms, "author gender");
|
|
||||||
disclaimer = disclaimer.replace("{a}", gender_transforms.at(author_gender));
|
|
||||||
}
|
}
|
||||||
for (key, value) in replacements.pairs() {
|
for (key, value) in replacements.pairs() {
|
||||||
disclaimer = disclaimer.replace("{" + key + "}", value);
|
disclaimer = disclaimer.replace("{" + key + "}", value);
|
||||||
|
@@ -7,6 +7,9 @@
|
|||||||
// Git: https://git.zumepro.cz/tul/tultemplate2
|
// Git: https://git.zumepro.cz/tul/tultemplate2
|
||||||
|
|
||||||
#import "prototyping.typ": todo, profile
|
#import "prototyping.typ": todo, profile
|
||||||
|
#import "attachments.typ": (
|
||||||
|
attachments, attach_content, attach_pdf, attach_link, attach_file_reference
|
||||||
|
)
|
||||||
|
|
||||||
// TUL Template 2
|
// TUL Template 2
|
||||||
//
|
//
|
||||||
@@ -23,13 +26,15 @@
|
|||||||
// - faculty (str): Factulty abbreviation. One of "fs", "ft", "fp", "ef", "fua", "fm", "fzs", "cxi".
|
// - faculty (str): Factulty abbreviation. One of "fs", "ft", "fp", "ef", "fua", "fm", "fzs", "cxi".
|
||||||
// - lang (str): Language code. This can be "cs" or "en".
|
// - lang (str): Language code. This can be "cs" or "en".
|
||||||
// - document (str): Type of document. This can be "bp" or "other".
|
// - document (str): Type of document. This can be "bp" or "other".
|
||||||
// - title (str): The title of the document.
|
// - title (dictionary): The title of the document.
|
||||||
// - author (str): The name of the document's author.
|
// - author (str): The name of the document's author.
|
||||||
// - author_gender (str): The gender of the document's author. Needed only for the `cs` language.
|
// - author_gender (str): The gender of the document's author. Needed only for the `cs` language.
|
||||||
// - supervisor (str): The name of the document's supervisor.
|
// - supervisor (str): The name of the document's supervisor.
|
||||||
// - programme (str): Study programme.
|
// - consultant (str): The name of the document's consultant.
|
||||||
// - abstract (content): The abstract.
|
// - programme (dictionary): Study programme.
|
||||||
// - keywords (array): The abstract keywords.
|
// - branch (disctionary): Study branch
|
||||||
|
// - abstract (dictionary): The abstract.
|
||||||
|
// - keywords (dictionary): The abstract keywords.
|
||||||
// - assignment (str): Filepath of the assignment document/page.
|
// - assignment (str): Filepath of the assignment document/page.
|
||||||
// - citations (str): The location of the citation file.
|
// - citations (str): The location of the citation file.
|
||||||
// - content (content): The content of the document
|
// - content (content): The content of the document
|
||||||
@@ -40,8 +45,8 @@
|
|||||||
style: "classic", faculty: "tul", lang: "cs", document: "other",
|
style: "classic", faculty: "tul", lang: "cs", document: "other",
|
||||||
|
|
||||||
// document info
|
// document info
|
||||||
title: none, keywords: none, abstract: none, author: none, author_gender: none,
|
title: none, keywords: none, abstract: none, acknowledgement: none, author: none,
|
||||||
supervisor: none, programme: none,
|
author_gender: none, supervisor: none, consultant: none, programme: none, branch: none,
|
||||||
|
|
||||||
// links
|
// links
|
||||||
assignment: none, citations: "citations.bib",
|
assignment: none, citations: "citations.bib",
|
||||||
@@ -58,13 +63,24 @@
|
|||||||
assert_type_signature(document, "string | none", "document kind argument");
|
assert_type_signature(document, "string | none", "document kind argument");
|
||||||
assert_type_signature(title, "dictionary[string : string] | none", "title argument");
|
assert_type_signature(title, "dictionary[string : string] | none", "title argument");
|
||||||
assert_type_signature(keywords, "dictionary[string : array[string]] | none", "keywords argument");
|
assert_type_signature(keywords, "dictionary[string : array[string]] | none", "keywords argument");
|
||||||
assert_type_signature(abstract, "dictionary[string : string] | none", "abstract argument");
|
assert_type_signature(
|
||||||
|
abstract, "dictionary[string : string | content] | none", "abstract argument"
|
||||||
|
);
|
||||||
|
assert_type_signature(
|
||||||
|
acknowledgement, "dictionary[string : string] | none", "acknowledgement content"
|
||||||
|
);
|
||||||
assert_type_signature(author, "string | none", "author argument");
|
assert_type_signature(author, "string | none", "author argument");
|
||||||
assert_type_signature(author_gender, "string | none", "author gender argument");
|
assert_type_signature(author_gender, "string | none", "author gender argument");
|
||||||
assert_type_signature(supervisor, "string | none", "supervisor argument");
|
assert_type_signature(
|
||||||
|
supervisor, "string | dictionary[string : string] | none", "supervisor argument"
|
||||||
|
);
|
||||||
|
assert_type_signature(
|
||||||
|
consultant, "string | dictionary[string : string] | none", "consultant argument"
|
||||||
|
);
|
||||||
assert_type_signature(
|
assert_type_signature(
|
||||||
programme, "dictionary[string : string] | none", "study programme argument"
|
programme, "dictionary[string : string] | none", "study programme argument"
|
||||||
);
|
);
|
||||||
|
assert_type_signature(branch, "dictionary[string : string] | none", "study branch argument");
|
||||||
assert_type_signature(assignment, "string | none", "assignment document argument");
|
assert_type_signature(assignment, "string | none", "assignment document argument");
|
||||||
assert_type_signature(citations, "string", "citations file argument");
|
assert_type_signature(citations, "string", "citations file argument");
|
||||||
|
|
||||||
@@ -83,8 +99,8 @@
|
|||||||
// template call
|
// template call
|
||||||
templates.at(style)(
|
templates.at(style)(
|
||||||
lang, faculty, document, citations, assignment,
|
lang, faculty, document, citations, assignment,
|
||||||
title, author, author_gender, supervisor, programme, abstract, keywords,
|
title, author, author_gender, supervisor, consultant,
|
||||||
content
|
programme, branch, abstract, acknowledgement, keywords, content
|
||||||
);
|
);
|
||||||
|
|
||||||
import "prototyping.typ": assert_release_ready
|
import "prototyping.typ": assert_release_ready
|
||||||
|
@@ -3,4 +3,4 @@
|
|||||||
@linux
|
@linux
|
||||||
@Satrapa2011
|
@Satrapa2011
|
||||||
|
|
||||||
#bibliography("citations.bib", title: "Bibliography - EN", style: "iso-690-author-date")
|
#bibliography("citations.bib", title: "Bibliography - EN", style: "iso-690-numeric")
|
||||||
|
Reference in New Issue
Block a user