move to dictionary.at(layout)

This commit is contained in:
2026-01-17 18:22:47 +02:00
parent fa76185b7f
commit 3865c00ad9
3 changed files with 13 additions and 15 deletions

View File

@@ -11,8 +11,9 @@
mentors,
) = {
align(center)[
МІНІСТЕРСТВО ОСВІТИ І НАУКИ УКРАЇНИ \
#upper(uni.name)
#upper([
Міністерство освіти і науки України \
#uni.name])
\ \
Кафедра #uni.edu_programs.at(edu-program).department_gen

View File

@@ -338,8 +338,6 @@
style.appendices(appendices)
}
// #include "src/layouts.typ"
// Practice and Laboratory works template {{{1
/// DSTU 3008:2015 Template for NURE
@@ -355,7 +353,7 @@
/// - mentors ((name: str, degree: str, gender: ("m" | "f" | "p" | none)),): List of mentors. Optional.
#let pz-lb(
doc,
layout: "simple",
layout: "default",
university: "ХНУРЕ",
edu-program: none,
subject: none,
@@ -370,9 +368,7 @@
import "layouts/pz-lb/minimal.typ": *
import "layouts/pz-lb/complex.typ": *
let edu-program = if edu-program != none { edu-program } else if true {
authors.first().edu_program
}
let edu-program = if edu-program != none { edu-program } else { authors.first().edu_program }
let uni = universities.at(university)
set document(title: title, author: authors.map(c => c.name))
@@ -381,11 +377,11 @@
// page 1 {{{2
if layout == "complex" {
complex(uni, edu-program, subject, type, number, title, authors, mentors)
} else {
minimal(uni, edu-program, subject, type, number, title, authors, mentors)
}
(
"complex": complex(uni, edu-program, subject, type, number, title, authors, mentors),
"minimal": minimal(uni, edu-program, subject, type, number, title, authors, mentors),
"default": minimal(uni, edu-program, subject, type, number, title, authors, mentors),
).at(layout)
pagebreak(weak: true)

View File

@@ -8,12 +8,13 @@
full_name_gen: "Іванова Івана Івановича",
edu_program: "КУІБ",
group: "23-1",
gender: "m",
variant: 5,
),
)
#let mentors = (
(name: "Петров П.П.", degree: "доцент кафедри ІКІ"),
(name: "Петров П.П.", degree: "доцент кафедри ІКІ", gender: "m"),
)
// Тест default лейауту
@@ -32,7 +33,7 @@
// Тест simple лейауту
#show: pz-lb.with(
layout: "simple",
layout: "minimal",
subject: "БД",
type: "ЛБ",
number: 2,