make bp and dp definitions cleaner
This commit is contained in:
@@ -1,21 +1,7 @@
|
|||||||
#import "../lang.typ": get_lang_item
|
#import "../arguments.typ": req_arg, get_arg
|
||||||
#import "common.typ": (
|
#import "../utils.typ": assert_dict_has, is_none
|
||||||
mainpage,
|
#import "common.typ": mainpage, assignment, external_title_pages
|
||||||
default_styling,
|
#import "thesis_base.typ": thesis_base
|
||||||
assignment,
|
|
||||||
disclaimer,
|
|
||||||
abstract,
|
|
||||||
acknowledgement,
|
|
||||||
toc,
|
|
||||||
abbrlist,
|
|
||||||
imagelist,
|
|
||||||
tablelist,
|
|
||||||
bibliogr
|
|
||||||
)
|
|
||||||
#import "../attachments.typ": attachment_list
|
|
||||||
#import "../utils.typ": is_none, assert_dict_has, assert_not_none, assert_type_signature, map_none
|
|
||||||
#import "../arguments.typ": req_arg, get_arg, map_arg
|
|
||||||
#import "../theme.typ": faculty_color
|
|
||||||
|
|
||||||
#let bp(args, content) = {
|
#let bp(args, content) = {
|
||||||
let force_langs = ("cs", "en");
|
let force_langs = ("cs", "en");
|
||||||
@@ -45,21 +31,9 @@
|
|||||||
if is_none(title_pages) {
|
if is_none(title_pages) {
|
||||||
mainpage(args);
|
mainpage(args);
|
||||||
assignment(args);
|
assignment(args);
|
||||||
|
} else {
|
||||||
|
external_title_pages(title_pages);
|
||||||
}
|
}
|
||||||
default_styling(false, faculty_color(req_arg(args, "document.faculty")), {
|
|
||||||
if is_none(title_pages) {
|
thesis_base(args, content);
|
||||||
disclaimer(args);
|
|
||||||
}
|
|
||||||
abstract("cs", args);
|
|
||||||
abstract("en", args);
|
|
||||||
acknowledgement(args);
|
|
||||||
toc(language);
|
|
||||||
tablelist(language);
|
|
||||||
imagelist(language);
|
|
||||||
abbrlist(language);
|
|
||||||
pagebreak(weak: true);
|
|
||||||
content;
|
|
||||||
bibliogr(args);
|
|
||||||
attachment_list(language);
|
|
||||||
}, language);
|
|
||||||
}
|
}
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
args.assignment = map_arg(args, "assignment", (v) => "../../" + v);
|
args.assignment = map_arg(args, "assignment", (v) => "../../" + v);
|
||||||
args.citations = map_arg(args, "citations", (v) => "../../" + v);
|
args.citations = map_arg(args, "citations", (v) => "../../" + v);
|
||||||
|
args.title_pages = map_arg(args, "title_pages", (v) => "../../" + v);
|
||||||
|
|
||||||
document_types.at(req_arg(args, "document.type"))(args, content);
|
document_types.at(req_arg(args, "document.type"))(args, content);
|
||||||
}
|
}
|
||||||
|
@@ -232,6 +232,14 @@
|
|||||||
}, margin: 2cm);
|
}, margin: 2cm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _ EMBEDDED
|
||||||
|
|
||||||
|
#let pdfembed(path) = {
|
||||||
|
import "@preview/muchpdf:0.1.1": muchpdf
|
||||||
|
set page(margin: 0em);
|
||||||
|
muchpdf(read(path, encoding: none));
|
||||||
|
}
|
||||||
|
|
||||||
// ASSIGNMENT PAGE
|
// ASSIGNMENT PAGE
|
||||||
|
|
||||||
#let assignment(args) = {
|
#let assignment(args) = {
|
||||||
@@ -249,9 +257,13 @@
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
import "@preview/muchpdf:0.1.1": muchpdf
|
pdfembed(req_arg(args, "assignment"))
|
||||||
set page(margin: 0em);
|
}
|
||||||
muchpdf(read(document, encoding: none));
|
|
||||||
|
// EXTERNAL TITLE PAGES
|
||||||
|
|
||||||
|
#let external_title_pages(path) = {
|
||||||
|
pdfembed(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DISCLAIMER PAGE
|
// DISCLAIMER PAGE
|
||||||
|
@@ -1,21 +1,7 @@
|
|||||||
#import "../lang.typ": get_lang_item
|
|
||||||
#import "common.typ": (
|
|
||||||
mainpage,
|
|
||||||
default_styling,
|
|
||||||
assignment,
|
|
||||||
disclaimer,
|
|
||||||
abstract,
|
|
||||||
acknowledgement,
|
|
||||||
toc,
|
|
||||||
abbrlist,
|
|
||||||
imagelist,
|
|
||||||
tablelist,
|
|
||||||
bibliogr
|
|
||||||
)
|
|
||||||
#import "../attachments.typ": attachment_list
|
|
||||||
#import "../utils.typ": is_none, assert_dict_has, assert_not_none, assert_type_signature, map_none
|
|
||||||
#import "../arguments.typ": req_arg, get_arg, map_arg
|
#import "../arguments.typ": req_arg, get_arg, map_arg
|
||||||
#import "../theme.typ": faculty_color
|
#import "../utils.typ": assert_dict_has, is_none
|
||||||
|
#import "common.typ": mainpage, assignment, external_title_pages
|
||||||
|
#import "thesis_base.typ": thesis_base
|
||||||
|
|
||||||
#let dp(args, content) = {
|
#let dp(args, content) = {
|
||||||
let force_langs = ("cs", "en");
|
let force_langs = ("cs", "en");
|
||||||
@@ -35,9 +21,9 @@
|
|||||||
if is_none(title_pages) {
|
if is_none(title_pages) {
|
||||||
let programme = req_arg(args, "author.programme");
|
let programme = req_arg(args, "author.programme");
|
||||||
assert_dict_has((language,), programme, "study programme");
|
assert_dict_has((language,), programme, "study programme");
|
||||||
let _ = map_arg(
|
map_arg(args, "author.specialization", (v) => {
|
||||||
args, "author.specialization", (v) => assert_dict_has((language,), v, "study specialization")
|
assert_dict_has((language,), v, "study specialization");
|
||||||
);
|
});
|
||||||
if language == "cs" {
|
if language == "cs" {
|
||||||
let _ = req_arg(args, "author.pronouns");
|
let _ = req_arg(args, "author.pronouns");
|
||||||
}
|
}
|
||||||
@@ -46,21 +32,9 @@
|
|||||||
if is_none(title_pages) {
|
if is_none(title_pages) {
|
||||||
mainpage(args);
|
mainpage(args);
|
||||||
assignment(args);
|
assignment(args);
|
||||||
|
} else {
|
||||||
|
external_title_pages(title_pages);
|
||||||
}
|
}
|
||||||
default_styling(false, faculty_color(req_arg(args, "document.faculty")), {
|
|
||||||
if is_none(title_pages) {
|
thesis_base(args, content);
|
||||||
disclaimer(args);
|
|
||||||
}
|
|
||||||
abstract("cs", args);
|
|
||||||
abstract("en", args);
|
|
||||||
acknowledgement(args);
|
|
||||||
toc(language);
|
|
||||||
tablelist(language);
|
|
||||||
imagelist(language);
|
|
||||||
abbrlist(language);
|
|
||||||
pagebreak(weak: true);
|
|
||||||
content;
|
|
||||||
bibliogr(args);
|
|
||||||
attachment_list(language);
|
|
||||||
}, language);
|
|
||||||
}
|
}
|
||||||
|
35
template/classic/thesis_base.typ
Normal file
35
template/classic/thesis_base.typ
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#import "../theme.typ": faculty_color
|
||||||
|
#import "../arguments.typ": get_arg, req_arg
|
||||||
|
#import "../utils.typ": is_none
|
||||||
|
#import "common.typ": (
|
||||||
|
default_styling,
|
||||||
|
disclaimer,
|
||||||
|
abstract,
|
||||||
|
acknowledgement,
|
||||||
|
toc,
|
||||||
|
tablelist,
|
||||||
|
imagelist,
|
||||||
|
abbrlist,
|
||||||
|
bibliogr,
|
||||||
|
)
|
||||||
|
#import "../attachments.typ": attachment_list
|
||||||
|
|
||||||
|
#let thesis_base(args, content) = {
|
||||||
|
let language = req_arg(args, "document.language");
|
||||||
|
default_styling(false, faculty_color(req_arg(args, "document.faculty")), {
|
||||||
|
if is_none(get_arg(args, "title_pages")) {
|
||||||
|
disclaimer(args);
|
||||||
|
}
|
||||||
|
abstract("cs", args);
|
||||||
|
abstract("en", args);
|
||||||
|
acknowledgement(args);
|
||||||
|
toc(language);
|
||||||
|
tablelist(language);
|
||||||
|
imagelist(language);
|
||||||
|
abbrlist(language);
|
||||||
|
pagebreak(weak: true);
|
||||||
|
content;
|
||||||
|
bibliogr(args);
|
||||||
|
attachment_list(language);
|
||||||
|
}, language);
|
||||||
|
}
|
Reference in New Issue
Block a user