3 Commits

5 changed files with 42 additions and 29 deletions

View File

@@ -51,6 +51,7 @@
abbrlist(language); abbrlist(language);
imagelist(language); imagelist(language);
tablelist(language); tablelist(language);
pagebreak(weak: true);
content content
bibliogr(language, citation_file); bibliogr(language, citation_file);
}); });

View File

@@ -239,11 +239,11 @@
} }
} }
// _ OUTLINE // _ OUTLINE FIGURE INNER
#let _outline_figure_inner(selector, title, body_mapper) = { #let _outline_figure_inner(selector, title, body_mapper) = {
show outline.entry: it => { let entry(selector, element) = {
link( link(
it.element.location(), element.location(),
grid( grid(
columns: 3, columns: 3,
gutter: .5em, gutter: .5em,
@@ -251,21 +251,23 @@
dir: ltr, dir: ltr,
text(numbering( text(numbering(
"1. 1", "1. 1",
counter(heading).at(it.element.location()).at(0), counter(heading).at(element.location()).at(0),
counter(selector).at(it.element.location()).at(0), counter(selector).at(element.location()).at(0),
)), )),
h(.5em), h(.5em),
text(body_mapper(it)), text(body_mapper(element)),
), ),
box(repeat([.], gap: 0.15em)), box(repeat([.], gap: 0.15em)),
str(it.element.location().page()), str(element.location().page()),
), ),
) )
} }
if not is_none(selector) { heading(title, numbering: none, outlined: false);
outline(target: selector, title: title); for el in query(figure.where(kind: selector)) {
} else { if is_none(el.caption) {
outline(title: title); continue;
}
entry(figure.where(kind: selector), el);
} }
} }
@@ -276,7 +278,7 @@
if realcount.final().at(0) == 0 { if realcount.final().at(0) == 0 {
return; return;
} }
_outline_figure_inner(figure.where(kind: target), title, (it) => it.element.caption.body); _outline_figure_inner(target, title, (it) => it.caption.body);
} }
} }

View File

@@ -57,7 +57,7 @@
"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": {

View File

@@ -1,4 +1,4 @@
#import "utils.typ": assert_in_dict, assert_in_arr #import "utils.typ": assert_in_dict, assert_in_arr, map_none, ok_or
#let lang_ids = ( #let lang_ids = (
cs: 0, cs: 0,
@@ -22,16 +22,26 @@
} }
#let replace_czech_gender(raw, gender) = { #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) => { raw.replace(regex("\{g:([^|]*)\|([^|]*)\|([^}]*)\}"), (match) => {
if gender == "masculine" { match.captures.at(genders.at(gender))
match.captures.at(0) });
} else if gender == "feminine" { }
match.captures.at(1)
} else if gender == "we" { #let replace_english_pronounce(raw, pronounce) = {
match.captures.at(2) let pronounce = ok_or(pronounce, "me");
} else { let pronouns = (
panic(); me: 0,
} we: 1,
);
assert_in_dict(pronounce, pronouns, "author gender");
raw.replace(regex("\{g:([^|]*)\|([^}]*)\}"), (match) => {
match.captures.at(pronouns.at(pronounce))
}); });
} }
@@ -39,9 +49,9 @@
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 language_genders = ("feminine", "masculine", "we");
assert_in_arr(author_gender, language_genders, "author gender");
disclaimer = replace_czech_gender(disclaimer, author_gender); disclaimer = replace_czech_gender(disclaimer, author_gender);
} else if language == "en" {
disclaimer = replace_english_pronounce(disclaimer, author_gender);
} }
for (key, value) in replacements.pairs() { for (key, value) in replacements.pairs() {
disclaimer = disclaimer.replace("{" + key + "}", value); disclaimer = disclaimer.replace("{" + key + "}", value);

View File

@@ -23,13 +23,13 @@
// - 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. // - programme (dictionary): Study programme.
// - abstract (content): The abstract. // - abstract (dictionary): The abstract.
// - keywords (array): The abstract keywords. // - 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