Compare commits
8 Commits
v0.5
...
768ba54856
Author | SHA1 | Date | |
---|---|---|---|
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
|
||||||
|
@@ -303,8 +303,9 @@ Zvýrazněné hodnoty jsou základní -- pokud vynecháte parametr, pak bude pou
|
|||||||
- 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"` (oddělujte jména `", "`)
|
||||||
#line()
|
#line()
|
||||||
- `author_gender` (rod autora v českém jazyce - není potřeba pro angličtinu)
|
- `author_gender` (rod autora v českém jazyce - není potřeba pro angličtinu)
|
||||||
- `"male"` - Mužský rod
|
- `"masculine"` - Mužský rod
|
||||||
- `"female"` - Ženský rod
|
- `"feminine"` - Ženský rod
|
||||||
|
- `"we"` - Množné číslo
|
||||||
#line()
|
#line()
|
||||||
- `supervisor` (vedoucí práce)
|
- `supervisor` (vedoucí práce)
|
||||||
- Příklad: `"prof. Jindřich Jindřich"`
|
- Příklad: `"prof. Jindřich Jindřich"`
|
||||||
|
@@ -16,12 +16,20 @@
|
|||||||
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, study_programme, study_branch, abstract_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) {
|
||||||
@@ -31,7 +39,7 @@
|
|||||||
assert_not_none(author_gender, "author gender");
|
assert_not_none(author_gender, "author gender");
|
||||||
}
|
}
|
||||||
|
|
||||||
mainpage(faculty_id, language, none, title, author, supervisor, study_programme);
|
mainpage(faculty_id, language, "bp", title, author, supervisor, 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);
|
||||||
@@ -40,6 +48,6 @@
|
|||||||
toc(language);
|
toc(language);
|
||||||
abbrlist(language);
|
abbrlist(language);
|
||||||
content
|
content
|
||||||
bibliogr(citation_file);
|
bibliogr(language, citation_file);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -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,16 +12,21 @@
|
|||||||
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, study_programme, study_branch, abstract, 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"));
|
||||||
|
|
||||||
|
|
||||||
document_types.at(document_type)(
|
document_types.at(document_type)(
|
||||||
faculty_id,
|
faculty_id,
|
||||||
@@ -34,6 +39,7 @@
|
|||||||
author_gender,
|
author_gender,
|
||||||
supervisor,
|
supervisor,
|
||||||
study_programme,
|
study_programme,
|
||||||
|
study_branch,
|
||||||
abstract,
|
abstract,
|
||||||
keywords,
|
keywords,
|
||||||
content,
|
content,
|
||||||
|
@@ -75,7 +75,7 @@
|
|||||||
faculty_id,
|
faculty_id,
|
||||||
language,
|
language,
|
||||||
document_type,
|
document_type,
|
||||||
title, author, supervisor, study_programme,
|
title, author, supervisor, 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;
|
||||||
@@ -97,7 +97,8 @@
|
|||||||
// [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),
|
||||||
|
("author", author, true),
|
||||||
("supervisor", supervisor, false),
|
("supervisor", supervisor, false),
|
||||||
)
|
)
|
||||||
context {
|
context {
|
||||||
@@ -133,9 +134,9 @@
|
|||||||
faculty_id,
|
faculty_id,
|
||||||
language,
|
language,
|
||||||
document_type,
|
document_type,
|
||||||
title, author, supervisor, study_programme,
|
title, author, supervisor, 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((
|
||||||
@@ -146,8 +147,9 @@
|
|||||||
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, map_none(study_programme, (v) => v.at(language)),
|
||||||
|
map_none(study_branch, (v) => v.at(language)),
|
||||||
);
|
);
|
||||||
v(5em);
|
v(5em);
|
||||||
}, bottom);
|
}, bottom);
|
||||||
|
@@ -1,17 +1,20 @@
|
|||||||
#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": mainpage, default_styling, assignment, disclaimer, abstract, toc, abbrlist
|
||||||
#import "../utils.typ": is_none
|
#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, 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, study_programme, study_branch);
|
||||||
default_styling(true, faculty_color, {
|
default_styling(true, faculty_color, {
|
||||||
toc(language);
|
toc(language);
|
||||||
abbrlist(language);
|
abbrlist(language);
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
"authors": "Autoři",
|
"authors": "Autoři",
|
||||||
"supervisor": "Vedoucí práce",
|
"supervisor": "Vedoucí 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",
|
"dp": "Diplomová práce",
|
||||||
@@ -14,7 +15,7 @@
|
|||||||
"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 +23,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",
|
||||||
@@ -44,6 +48,7 @@
|
|||||||
"authors": "Authors",
|
"authors": "Authors",
|
||||||
"supervisor": "Supervisor",
|
"supervisor": "Supervisor",
|
||||||
"study_programme": "Study programme",
|
"study_programme": "Study programme",
|
||||||
|
"study_branch": "Study branch",
|
||||||
|
|
||||||
"bp": "Bachelor thesis",
|
"bp": "Bachelor thesis",
|
||||||
"dp": "Diploma thesis",
|
"dp": "Diploma thesis",
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#import "utils.typ": assert_in_dict
|
#import "utils.typ": assert_in_dict, assert_in_arr
|
||||||
|
|
||||||
#let lang_ids = (
|
#let lang_ids = (
|
||||||
cs: 0,
|
cs: 0,
|
||||||
@@ -21,16 +21,27 @@
|
|||||||
return lang_items.at(lang_abbr).at(item_name);
|
return lang_items.at(lang_abbr).at(item_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#let replace_czech_gender(raw, gender) = {
|
||||||
|
raw.replace(regex("\{g:([^|]*)\|([^|]*)\|([^}]*)\}"), (match) => {
|
||||||
|
if gender == "masculine" {
|
||||||
|
match.captures.at(0)
|
||||||
|
} else if gender == "feminine" {
|
||||||
|
match.captures.at(1)
|
||||||
|
} else if gender == "we" {
|
||||||
|
match.captures.at(2)
|
||||||
|
} else {
|
||||||
|
panic();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#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 = (
|
let language_genders = ("feminine", "masculine", "we");
|
||||||
male: "",
|
assert_in_arr(author_gender, language_genders, "author gender");
|
||||||
female: "a",
|
disclaimer = replace_czech_gender(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);
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
// document info
|
// document info
|
||||||
title: none, keywords: none, abstract: none, author: none, author_gender: none,
|
title: none, keywords: none, abstract: none, author: none, author_gender: none,
|
||||||
supervisor: none, programme: none,
|
supervisor: none, programme: none, branch: none,
|
||||||
|
|
||||||
// links
|
// links
|
||||||
assignment: none, citations: "citations.bib",
|
assignment: none, citations: "citations.bib",
|
||||||
@@ -58,13 +58,16 @@
|
|||||||
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(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 | none", "supervisor 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,7 +86,7 @@
|
|||||||
// 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, programme, branch, abstract, keywords,
|
||||||
content
|
content
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -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