add fullpage heading support for presentation
This commit is contained in:
@@ -39,6 +39,8 @@
|
|||||||
|
|
||||||
#let presentation_structure = (
|
#let presentation_structure = (
|
||||||
append_thanks: "boolean",
|
append_thanks: "boolean",
|
||||||
|
wide: "boolean",
|
||||||
|
first_heading_is_fullpage: "boolean",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,15 @@
|
|||||||
#import "../lang.typ": get_lang_item
|
#import "../lang.typ": get_lang_item
|
||||||
#import "common.typ": common_styling, bibliogr, base_font
|
#import "common.typ": common_styling, bibliogr, base_font
|
||||||
|
|
||||||
|
#let header_margin = 20pt
|
||||||
|
#let footer_margin = header_margin
|
||||||
|
|
||||||
#let set_page_style(lang, faculty, faculty_color, content, paper) = {
|
#let set_page_style(lang, faculty, faculty_color, paper, content) = {
|
||||||
context {
|
context {
|
||||||
let footer_margin = 20pt
|
let footer_logotype = faculty_logotype(faculty, lang, long: false)
|
||||||
let footer_logotype = faculty_logotype(faculty, lang)
|
|
||||||
let footer_height = measure(footer_logotype).height + footer_margin
|
let footer_height = measure(footer_logotype).height + footer_margin
|
||||||
set page(paper: paper, margin: (bottom: footer_height, rest: 1cm), footer-descent: 0%, footer: {
|
set page(paper: paper, margin: (bottom: footer_height, rest: 1cm), footer-descent: 0%, footer: {
|
||||||
box(outset: (top: footer_margin, bottom: footer_margin), {
|
text(box(outset: (top: footer_margin, bottom: footer_margin), {
|
||||||
footer_logotype
|
footer_logotype
|
||||||
h(1fr)
|
h(1fr)
|
||||||
context text(
|
context text(
|
||||||
@@ -19,24 +20,42 @@
|
|||||||
font: "TUL Mono",
|
font: "TUL Mono",
|
||||||
faculty_color,
|
faculty_color,
|
||||||
)
|
)
|
||||||
})
|
}), size: 11pt)
|
||||||
})
|
})
|
||||||
|
set text(size: 1.3em)
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#let set_heading_styles(content) = {
|
#let set_heading_styles(first_heading_is_fullpage, faculty_color, content) = {
|
||||||
show heading.where(level: 1): it => {
|
let slide_title = (it) => {
|
||||||
pagebreak(weak: true)
|
pagebreak(weak: true)
|
||||||
box(text(it, size: 1.25em), inset: (top: 2em, bottom: 2em))
|
box(it, inset: (top: 1em, bottom: 1em))
|
||||||
|
}
|
||||||
|
show heading.where(level: 1): it => {
|
||||||
|
if first_heading_is_fullpage {
|
||||||
|
page(place(center + horizon, it), header: none, margin: (top: 0em))
|
||||||
|
} else {
|
||||||
|
slide_title(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if first_heading_is_fullpage {
|
||||||
|
show heading.where(level: 2): it => {
|
||||||
|
slide_title(it)
|
||||||
|
}
|
||||||
|
content
|
||||||
|
} else {
|
||||||
|
content
|
||||||
}
|
}
|
||||||
content
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#let apply_style(language, faculty, faculty_color, content, paper) = {
|
#let apply_style(language, faculty, faculty_color, paper, first_heading_fullpage, content) = {
|
||||||
common_styling(
|
common_styling(
|
||||||
faculty_color, language,
|
faculty_color, language,
|
||||||
set_page_style(language, faculty, faculty_color, set_heading_styles(content), paper)
|
set_page_style(
|
||||||
|
language, faculty, faculty_color, paper,
|
||||||
|
set_heading_styles(first_heading_fullpage, faculty_color, content)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,20 +101,23 @@
|
|||||||
let faculty_color = faculty_color(faculty)
|
let faculty_color = faculty_color(faculty)
|
||||||
let presentation_args = req_arg(args, "presentation_info")
|
let presentation_args = req_arg(args, "presentation_info")
|
||||||
let author = req_arg(args, "author.name")
|
let author = req_arg(args, "author.name")
|
||||||
let paper = "presentation-4-3"
|
let paper = if presentation_args.at("wide") {
|
||||||
|
"presentation-16-9"
|
||||||
if presentation_args.at("aspect_16-9") {
|
} else {
|
||||||
paper = "presentation-16-9"
|
"presentation-4-3"
|
||||||
}
|
}
|
||||||
|
|
||||||
mainpage(
|
mainpage(
|
||||||
language, faculty, faculty_color,
|
language, faculty, faculty_color,
|
||||||
req_arg(args, "title").at(language), author, paper,
|
req_arg(args, "title").at(language), author, paper,
|
||||||
)
|
)
|
||||||
apply_style(language, faculty, faculty_color, {
|
apply_style(language, faculty, faculty_color, paper,
|
||||||
content
|
presentation_args.at("first_heading_is_fullpage"), {
|
||||||
bibliogr(args)
|
content
|
||||||
}, paper)
|
bibliogr(args)
|
||||||
|
},
|
||||||
|
)
|
||||||
if presentation_args.at("append_thanks") {
|
if presentation_args.at("append_thanks") {
|
||||||
thankspage(language, faculty, faculty_color, author, paper,)
|
thankspage(language, faculty, faculty_color, author, paper)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
"TECHNICKÁ UNIVERZITA V LIBERCI&",
|
"TECHNICKÁ UNIVERZITA V LIBERCI&",
|
||||||
"TECHNICAL UNIVERSITY OF LIBEREC&",
|
"TECHNICAL UNIVERSITY OF LIBEREC&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"TUL&",
|
||||||
|
"TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
fs: (
|
fs: (
|
||||||
@@ -17,6 +21,10 @@
|
|||||||
"FAKULTA STROJNÍ TUL&",
|
"FAKULTA STROJNÍ TUL&",
|
||||||
"FACULTY OF MECHANICAL ENGINEERING TUL&",
|
"FACULTY OF MECHANICAL ENGINEERING TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"FS TUL&",
|
||||||
|
"FME TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
ft: (
|
ft: (
|
||||||
@@ -25,6 +33,10 @@
|
|||||||
"FAKULTA TEXTILNÍ TUL&",
|
"FAKULTA TEXTILNÍ TUL&",
|
||||||
"FACULTY OF TEXTILE ENGINEERING TUL&",
|
"FACULTY OF TEXTILE ENGINEERING TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"FT TUL&",
|
||||||
|
"FT TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
fp: (
|
fp: (
|
||||||
@@ -33,6 +45,10 @@
|
|||||||
"FAKULTA\nPŘÍRODOVĚDNĚ-HUMANITNÍ\nA PEDAGOGICKÁ TUL&",
|
"FAKULTA\nPŘÍRODOVĚDNĚ-HUMANITNÍ\nA PEDAGOGICKÁ TUL&",
|
||||||
"FACULTY OF SCIENCE,\nHUMANITIES AND\nEDUCATION TUL&",
|
"FACULTY OF SCIENCE,\nHUMANITIES AND\nEDUCATION TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"FP TUL&",
|
||||||
|
"FED TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
ef: (
|
ef: (
|
||||||
@@ -41,6 +57,10 @@
|
|||||||
"EKONOMICKÁ FAKULTA TUL&",
|
"EKONOMICKÁ FAKULTA TUL&",
|
||||||
"FACULTY OF ECONOMICS TUL&",
|
"FACULTY OF ECONOMICS TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"EF TUL&",
|
||||||
|
"FE TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
fua: (
|
fua: (
|
||||||
@@ -49,6 +69,10 @@
|
|||||||
"FAKULTA UMĚNÍ A ARCHITEKTURY TUL&",
|
"FAKULTA UMĚNÍ A ARCHITEKTURY TUL&",
|
||||||
"FACULTY OF ARTS AND ARCHITECTURE TUL&",
|
"FACULTY OF ARTS AND ARCHITECTURE TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"FUA TUL&",
|
||||||
|
"FAA TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
fm: (
|
fm: (
|
||||||
@@ -57,6 +81,10 @@
|
|||||||
"FAKULTA MECHATRONIKY,\nINFORMATIKY A MEZIOBOROVÝCH\nSTUDIÍ TUL&",
|
"FAKULTA MECHATRONIKY,\nINFORMATIKY A MEZIOBOROVÝCH\nSTUDIÍ TUL&",
|
||||||
"FACULTY OF MECHATRONICS,\nINFORMATICS AND\nINTERDISCIPLINARY STUDIES TUL&",
|
"FACULTY OF MECHATRONICS,\nINFORMATICS AND\nINTERDISCIPLINARY STUDIES TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"FM TUL&",
|
||||||
|
"FM TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
fzs: (
|
fzs: (
|
||||||
@@ -65,6 +93,10 @@
|
|||||||
"FAKULTA ZDRAVOTNICKÝCH STUDIÍ TUL&",
|
"FAKULTA ZDRAVOTNICKÝCH STUDIÍ TUL&",
|
||||||
"FACULTY OF HEALTH STUDIES TUL&",
|
"FACULTY OF HEALTH STUDIES TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"FZS TUL&",
|
||||||
|
"FHS TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
cxi: (
|
cxi: (
|
||||||
@@ -73,6 +105,10 @@
|
|||||||
"ÚSTAV PRO NANOMATERIÁLY,\nPOKROČILÉ TECHNOLOGIE\nA INOVACE TUL&",
|
"ÚSTAV PRO NANOMATERIÁLY,\nPOKROČILÉ TECHNOLOGIE\nA INOVACE TUL&",
|
||||||
"INSTITUTE FOR NANOMATERIALS,\nADVANCED TECHNOLOGY\nAND INNOVATION TUL&",
|
"INSTITUTE FOR NANOMATERIALS,\nADVANCED TECHNOLOGY\nAND INNOVATION TUL&",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"CXI TUL&",
|
||||||
|
"CXI TUL&",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
);
|
);
|
||||||
@@ -89,20 +125,20 @@
|
|||||||
return theme_color;
|
return theme_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
#let faculty_logotype_text(faculty_id, lang) = {
|
#let faculty_logotype_text(faculty_id, lang, long: true) = {
|
||||||
let theme = faculty_theme(faculty_id);
|
let theme = faculty_theme(faculty_id);
|
||||||
let logotype_text = theme.at(1).at(lang_id(lang));
|
let logotype_text = theme.at(if long { 1 } else { 2 }).at(lang_id(lang));
|
||||||
assert(type(logotype_text) == str);
|
assert(type(logotype_text) == str);
|
||||||
return logotype_text;
|
return logotype_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
#let faculty_logotype(faculty_id, lang, color: none) = {
|
#let faculty_logotype(faculty_id, lang, color: none, long: true) = {
|
||||||
let theme_color = if type(color) == type(none) {
|
let theme_color = if type(color) == type(none) {
|
||||||
faculty_color(faculty_id)
|
faculty_color(faculty_id)
|
||||||
} else {
|
} else {
|
||||||
color
|
color
|
||||||
};
|
};
|
||||||
let logotype_text = faculty_logotype_text(faculty_id, lang);
|
let logotype_text = faculty_logotype_text(faculty_id, lang, long: long);
|
||||||
text(logotype_text, font: "TUL Mono", theme_color, weight: "black");
|
text(logotype_text, font: "TUL Mono", theme_color, weight: "black");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
),
|
),
|
||||||
presentation: (
|
presentation: (
|
||||||
append_thanks: true,
|
append_thanks: true,
|
||||||
aspect_16-9: true,
|
wide: true,
|
||||||
|
first_heading_is_fullpage: true,
|
||||||
),
|
),
|
||||||
citations: "citations.bib",
|
citations: "citations.bib",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user