add complex page

This commit is contained in:
2026-01-17 17:54:11 +02:00
parent 891d33b236
commit fa76185b7f
6 changed files with 96 additions and 79 deletions
+1
View File
@@ -10,6 +10,7 @@
name_long: Управління інформаційною безпекою
department_gen: Інфокомунікаційної інженерії ім. В. В. Поповського
code: 125 # TODO: change to F5?
description: Кібербезпека та захист інформації
КНТ:
name_en: CST # computer sciences and technologies
name_long: Комп'ютерні науки та технології
+81
View File
@@ -0,0 +1,81 @@
// Title page layouts for pz-lb {{{1
// This module provides different title page layouts for practice/lab work templates
#import "/src/helpers.typ": gender-form, gender-get, pz-lb-title, uline
/// Default DSTU title page layout (ministry + university header, 2-column author/mentor info)
/// Returns: content for the title page
/// Simple title page layout (university header only, single column layout)
/// Returns: content for the title page
#let complex(
uni,
edu_program,
subject,
type,
number,
title,
authors,
mentors,
) = {
align(center)[
Міністерство освіти і науки України\
#uni.name
\
#set par(first-line-indent: 0pt)
#align(left)[
#let edu = uni.edu_programs.at(edu_program)
Кафедра #underline(edu.department_gen)\
Спеціальність #underline([#edu.code #edu.description])\
Освітня програма #underline(edu.name_long)
]
\ \
#pz-lb-title(type, number: number)
з навчальної дисципліни "#uni.subjects.at(subject, default: subject)"
#if title != none [\ з теми "#eval(title, mode: "markup")"]
#if authors.first().variant != none [\ Варіант #authors.first().variant]
\ \ \
#align(right)[
#if authors.len() == 1 {
let a = authors.first()
[#gender-form("author", gender: gender-get(a)):\ ]
[студент групи #a.edu_program\-#a.group\ #a.name\ ]
text(size: 10pt, [(прізвище та ініціали)\ ])
} else if authors.len() > 1 [
#gender-form("author"):\
#for a in authors [студент групи #a.edu_program\-#a.group\ #a.name\ ]
#text(size: 10pt, [(прізвище та ініціали)\ ])
]
\
#if mentors.len() == 1 {
let m = mentors.first()
[#gender-form("mentor", gender: gender-get(m)):\ ]
if "degree" in m.keys() and m.degree != none [#m.degree\ ]
[#m.name\ ]
text(size: 10pt, [(прізвище та ініціали)\ ])
} else if mentors.len() > 1 [
#gender-form("mentor"):\
#for m in mentors {
if "degree" in m.keys() and m.degree != none [#m.degree\ ]
[#m.name\ ]
}
]
]
#v(1fr)
Харків\
#datetime.today().display("[year]")
]
}
// vim:sts=2:sw=2:fdm=marker:cms=/*%s*/
+2 -2
View File
@@ -2,7 +2,7 @@
#let minimal(
uni,
edu_program,
edu-program,
subject,
type,
number,
@@ -15,7 +15,7 @@
#upper(uni.name)
\ \
Кафедра #uni.edu_programs.at(edu_program).department_gen
Кафедра #uni.edu_programs.at(edu-program).department_gen
\ \ \
#pz-lb-title(type, number: number)
-66
View File
@@ -1,66 +0,0 @@
// Title page layouts for pz-lb {{{1
// This module provides different title page layouts for practice/lab work templates
#import "/src/helpers.typ": gender-form, gender-get, pz-lb-title
/// Default DSTU title page layout (ministry + university header, 2-column author/mentor info)
/// Returns: content for the title page
/// Simple title page layout (university header only, single column layout)
/// Returns: content for the title page
#let simple(
uni,
edu_program,
subject,
type,
number,
title,
authors,
mentors,
) = {
align(center)[
#upper(uni.name)
Кафедра #uni.edu_programs.at(edu_program).department_gen
\ \ \
#pz-lb-title(type, number: number)
з дисципліни: "#uni.subjects.at(subject, default: subject)"
#if title != none [\ з теми: "#eval(title, mode: "markup")"]
\ \ \
#if authors.len() == 1 {
let a = authors.first()
[#gender-form("author", gender: gender-get(a)):\ #a.name]
[ст. гр. #a.edu_program\-#a.group]
if a.variant != none [Варіант: #a.variant]
} else if authors.len() > 1 [
#gender-form("author"):\
#for a in authors [#a.name (ст. гр. #a.edu_program\-#a.group)\ ]
]
\
#if mentors.len() == 1 {
let m = mentors.first()
[#gender-form("mentor", gender: gender-get(m)):\ ]
if "degree" in m.keys() and m.degree != none [#m.degree ]
[#m.name]
} else if mentors.len() > 1 [
#gender-form("mentor"):\
#for m in mentors {
if "degree" in m.keys() and m.degree != none [#m.degree\ ]
[#m.name\ ]
}
]
#v(1fr)
#datetime.today().display("[year]")
]
}
// vim:sts=2:sw=2:fdm=marker:cms=/*%s*/
+4 -4
View File
@@ -368,10 +368,10 @@
// TODO: add actually relevant asserts
import "layouts/pz-lb/minimal.typ": *
import "layouts/pz-lb/simple.typ": *
import "layouts/pz-lb/complex.typ": *
let edu-program = if edu-program != none { edu-program } else if true {
authors.first().edu-program
authors.first().edu_program
}
let uni = universities.at(university)
@@ -381,8 +381,8 @@
// page 1 {{{2
if layout == "simple" {
simple(uni, edu-program, subject, type, number, title, authors, mentors)
if layout == "complex" {
complex(uni, edu-program, subject, type, number, title, authors, mentors)
} else {
minimal(uni, edu-program, subject, type, number, title, authors, mentors)
}
+8 -7
View File
@@ -1,28 +1,29 @@
#import "lib.typ": *
#import "/src/lib.typ": *
#set document(title: "Тест лейаутів", author: "Іванов І.І.")
// #set document(title: "Тест лейаутів", author: "Іванов І.І.")
#let authors = (
(
name: "Іванов І.І.",
full_name_gen: "Іванова Івана Івановича",
edu_program: "ПЗПІ",
edu_program: "КУІБ",
group: "23-1",
variant: 5,
),
)
#let mentors = (
(name: "Петров П.П.", degree: "доц."),
(name: "Петров П.П.", degree: "доцент кафедри ІКІ"),
)
// Тест default лейауту
#show: pz-lb.with(
layout: "default",
layout: "complex",
subject: "БД",
edu-program: "КУІБ",
type: "ЛБ",
number: 2,
// title: "SQL запити",
title: "SQL запити",
authors: authors,
mentors: mentors,
)
@@ -35,7 +36,7 @@
subject: "БД",
type: "ЛБ",
number: 2,
// title: "SQL запити",
title: "SQL запити",
authors: authors,
mentors: mentors,
)