forked from pencelheimer/typst_nure_template
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c49e911aad | |||
| c1490ce893 | |||
| 79579208fa | |||
| 5bd47ac4c1 | |||
| 6cb71054cf | |||
| b28578be34 | |||
| 3ece994ced | |||
| 6e10c4ae2b | |||
| 3e6f3bf7c4 | |||
| 8dcbee291c | |||
| 4a78f8f3ee | |||
| 648824fd46 | |||
|
1d6412c60f
|
|||
|
3ba9990dc1
|
|||
|
2e65baae70
|
|||
| d338c21965 | |||
| 7e15ea09d4 | |||
|
3b3d62fd9b
|
|||
|
04c5b283e7
|
|||
|
3ca8409e58
|
|||
|
e0811afaae
|
|||
|
7ec79ee898
|
|||
|
47117749cf
|
|||
|
e214656166
|
|||
|
99234a73a9
|
|||
| 901d670a1c | |||
| 594e908bb1 | |||
|
32c6a1663c
|
|||
|
9cc7229851
|
|||
|
1646f5249b
|
|||
|
2de5cb4c58
|
|||
|
dec7c58db2
|
|||
|
2653e7dba2
|
|||
|
816d07f745
|
|||
| 7799435039 |
67
README.md
67
README.md
@@ -1,4 +1,5 @@
|
||||
# Typst Template for NURE Works
|
||||

|
||||
|
||||
## General Info
|
||||
|
||||
@@ -6,12 +7,12 @@ This project contains two template functions and some utilities for writing NURE
|
||||
|
||||
### Templates
|
||||
|
||||
#### `pz-lb-template` - For Laboratory and Practical Works
|
||||
#### `pz-lb` - For Practice and Laboratory Works
|
||||
This template:
|
||||
- Sets up document styles;
|
||||
- Formats the title page according to NURE/DSTU guidelines.
|
||||
|
||||
#### `cw-template` - For Course Works
|
||||
#### `coursework` - For Course Works
|
||||
This template:
|
||||
- Sets up document styles;
|
||||
- Formats the title, task, calendar plan, and abstract pages;
|
||||
@@ -46,15 +47,19 @@ Copy `lib.typ` to your project's root directory.
|
||||
// ...or by importing a lib.typ directly
|
||||
// #import "/lib.typ": *
|
||||
|
||||
// Setup the document
|
||||
#show: pz-lb-template.with(
|
||||
title: "Some title",
|
||||
// etc: "and so on",
|
||||
// ...
|
||||
// 1. Setup the document
|
||||
// by setting values directly...
|
||||
#show: pz-lb.with(
|
||||
title: "Some title",
|
||||
// etc: "and so on",
|
||||
// ...
|
||||
)
|
||||
// ...or using a yaml/toml file
|
||||
#show: pz-lb.with(..toml("/doc.toml"))
|
||||
|
||||
// this template automatically inserts a `=title`
|
||||
|
||||
// Write your content...
|
||||
// Write your content
|
||||
#v(-spacing) // remove spacing between headings
|
||||
== Purpose
|
||||
Some text
|
||||
@@ -65,17 +70,61 @@ Some text
|
||||
#include "src/chapter2.typ"
|
||||
// NOTE: if you want to use variables or utils provided by the package,
|
||||
// you have to import the package or a lib.typ inside a module.
|
||||
|
||||
|
||||
// If you ever need appendices in pz-lb template use the show rule
|
||||
// WARNING: when using coursework template use its own argument,
|
||||
// so it can put bibliography before appendices
|
||||
#show: appendices-style
|
||||
|
||||
= Quote
|
||||
#link("https://youtu.be/bJQj1uKtnus")[
|
||||
The art isn't the art, the art is never the art,
|
||||
the art is the thing that happens inside you when you make it and the feeling in the heart of the beholder.
|
||||
]
|
||||
```
|
||||
|
||||
And a TOML file would look like this:
|
||||
```toml
|
||||
title = "Потiк керування та алгоритмічні структури Bash"
|
||||
subject = "СМП"
|
||||
doctype = "ЛБ"
|
||||
worknumber = 2
|
||||
|
||||
[[mentors]]
|
||||
name = "Шевченко Т. Г."
|
||||
degree = "Доцент кафедри ПІ"
|
||||
gender = "m"
|
||||
|
||||
[[mentors]]
|
||||
name = "Франко І. Я."
|
||||
degree = "Асистент кафедри ПІ"
|
||||
gender = "m"
|
||||
|
||||
edu_program = "ПЗПІ"
|
||||
university = "ХНУРЕ"
|
||||
|
||||
[[authors]]
|
||||
name = "Косач Л. П."
|
||||
full_name_gen = "Косач Лариси Петрівни"
|
||||
course = 2
|
||||
edu = "ПЗПІ"
|
||||
gender = "f"
|
||||
group = "23-2"
|
||||
semester = 4
|
||||
variant = 8
|
||||
```
|
||||
|
||||
### Notes:
|
||||
1. Use `#v(-spacing)` to remove vertical spacing between titles (this cannot be automatically handled by the template). Variable `spacing` used here is imported from the template.
|
||||
2. When importing `@local/nure:0.1.0` and specifying file paths in functions handled by the package, the path will relative to package's root directory, e.g. setting `#show: coursework.with(bib_path: "bibl.yml")` will evaluate to `~/.local/share/typst/packages/local/nure/0.1.0/bibl.yml`, the same is for `#img` function, which makes it quite annoying and forces one to import `lib.typ` file. Please open an issue or contact us in any other way if you have any advice.
|
||||
|
||||
### Example Project Structure
|
||||
```
|
||||
project/
|
||||
├── doc.toml -- for things that don't change across works, i.e. author and mentor metadata
|
||||
├── main.typ -- for boilerplate code and importing everything
|
||||
├── config/
|
||||
│ ├── doc.yaml -- for things that don't change across works, i.e. author and mentor metadata
|
||||
│ ├── universities.yaml -- for user-specific configuration, i.e. education programs and disciplines
|
||||
│ └── ...
|
||||
├── src/
|
||||
|
||||
BIN
assets/pz-lb_title_page.png
Normal file
BIN
assets/pz-lb_title_page.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
@@ -1,24 +1,77 @@
|
||||
ХНУРЕ:
|
||||
name: "Харківський національний університет радіоелектроніки"
|
||||
name: Харківський національний університет радіоелектроніки
|
||||
name_en: Kharkiv National University of Radioelectronics
|
||||
edu_programs:
|
||||
ПЗПІ:
|
||||
name_long: "Інженерія програмного забезпечення"
|
||||
department_gen: "Програмної інженерії"
|
||||
code: 121 # TODO = ПЗПІ is "F2" now
|
||||
name_long: Інженерія програмного забезпечення
|
||||
department_gen: Програмної інженерії
|
||||
code: 121 # TODO: change to F2?
|
||||
КУІБ:
|
||||
name_long: "Управління інформаційною безпекою"
|
||||
department_gen: "Інфокомунікацій"
|
||||
code: 125
|
||||
name_long: Управління інформаційною безпекою
|
||||
department_gen: Інфокомунікаційної інженерії ім. В. В. Поповського
|
||||
code: 125 # TODO: change to F5?
|
||||
КНТ:
|
||||
name_en: CST # computer sciences and technologies
|
||||
name_long: Комп'ютерні науки та технології
|
||||
department_gen: Системотехніки
|
||||
department_en: ST
|
||||
code: 122
|
||||
subjects:
|
||||
БД: "Бази даних"
|
||||
БЖД: "Безпека життєдіяльності"
|
||||
ОІМ: "Основи IP-мереж"
|
||||
"ОПНJ": "Основи програмування на Java"
|
||||
ОС: "Операційні системи"
|
||||
ОТК: "Основи теорії кіл"
|
||||
ПП: "Проектний практикум"
|
||||
ПРОГ: "Програмування"
|
||||
СПМ: "Скриптові мови програмування"
|
||||
УФМ: "Українське фахове мовлення"
|
||||
Ф: "Філософія"
|
||||
ФІЗ: "Фізика"
|
||||
DMT: Decision making theory
|
||||
ODS: Основи Dаtа Sсіеnсе # NOTE: Eng O here
|
||||
ІМ: Іноземна мова
|
||||
ІТР: Information Technologies of Reengineering
|
||||
ІТРОІ: Інтернет-технології Розподіленої Обробки Інформації
|
||||
АВпЗ: Аналіз вимог до програмного забезпечення
|
||||
АДан: Аналітика даних
|
||||
АКтаК: Архітектура комп'ютера та комп'ютерних мереж
|
||||
АТСД: Алгоритми та структури даних
|
||||
АтаРК: Аналіз та рефакторинг коду
|
||||
БД: Бази даних
|
||||
БЖД: Безпека життєдіяльності
|
||||
ВДІТБ: Введення до ІТ-бізнесу # NOTE: all in UA
|
||||
ВМ: Вища математика
|
||||
ГТГ: Гіпертекст та гіпермедіа
|
||||
ДМ: Дискретна математика
|
||||
ДПК: Динаміка Проектних Команд
|
||||
ЕРВ: Електрорадіовимірювання
|
||||
КДМА: Комп'ютерна дискретна математика
|
||||
КЗВШ: Креативність з використанням штучного інтелекту
|
||||
КМ: Комп`ютерні мережі
|
||||
ЛМВ: Людино-машинна взаємодія
|
||||
ЛМтБ: Локальні мережі та їх безпека # бидло не знає що українською "їхня"
|
||||
МОКр: Математичні основи криптології
|
||||
МОТДО: Методи оптимізаціі та дослідження операцій
|
||||
МППС: Methodologies of designing software systems
|
||||
МС: Моделювання систем
|
||||
ОІМ: Основи IP-мереж
|
||||
ООАПС: Об'єктно-орієнтований аналіз в проектуванні систем
|
||||
ООП: Об'єктно-орієнтоване програмування
|
||||
ОП: Основи права
|
||||
ОПІ: Основи програмноі інженеріі
|
||||
ОПНJ: Основи програмування на Java
|
||||
ОПр: Основи програмування
|
||||
ОРвІТ: Оцінка Ризиків в IT-проектах
|
||||
ОС: Операційні системи
|
||||
ОТК: Основи теорії кіл
|
||||
ПБІП: Проектування та балансування ігрового процесу
|
||||
ПВJ: Поглиблене вивчення Java
|
||||
ПЕСЕ: Психологія екстремальних стосунків та ефективної адаптації
|
||||
ПНП: Програмування на платформі .NЕТ
|
||||
ПП: Проектний практикум
|
||||
ПРОГ: Програмування
|
||||
ПарП: Параллельне програмування
|
||||
СА: Системний аналіз
|
||||
СМП: Скриптові мови програмування
|
||||
СОАПЗ: Сервіс-Орієнтована Архітектура Програмного Забезпечення
|
||||
СРБД: Серверні рішення баз даних
|
||||
СхТ: Схемотехніка
|
||||
ТВО: Технології Високопродуктивних Обчислень
|
||||
ТЗІ: Технології захисту інформації
|
||||
ТЙтаМ: Теорія ймовірностей та математична # TODO: what?
|
||||
ТКП: Технології комп`ютерного проєктування
|
||||
УФМ: Українське фахове мовлення
|
||||
ФІЗ: Фізика
|
||||
ФІЛ: Філософія
|
||||
ФВС: Фізичне виховання та спорт
|
||||
ХТ: Хмарні технології
|
||||
|
||||
445
lib.typ
445
lib.typ
@@ -5,6 +5,9 @@
|
||||
|
||||
// Template formatting functions {{{1
|
||||
|
||||
/// bold text
|
||||
#let bold(content) = text(weight: "bold")[#content]
|
||||
|
||||
/// numberless heading
|
||||
#let nheading(title) = heading(depth: 1, numbering: none, title)
|
||||
|
||||
@@ -21,9 +24,6 @@
|
||||
#if align != right { hfill(1fr) }
|
||||
]
|
||||
|
||||
/// bold text
|
||||
#let bold(content) = text(weight: "bold")[#content]
|
||||
|
||||
/// month name from its number
|
||||
#let month_gen(month) = (
|
||||
"січня",
|
||||
@@ -40,6 +40,27 @@
|
||||
"грудня",
|
||||
).at(month - 1)
|
||||
|
||||
#let is-cyr(c) = regex("[\p{Cyrillic}]") in c
|
||||
|
||||
#let gender-form(verb, gender: "p") = {
|
||||
(
|
||||
"author": ("m": "Виконав", "f": "Виконала", "p": "Виконали"),
|
||||
"mentor": ("m": "Перевірив", "f": "Перевірила", "p": "Перевірили"),
|
||||
)
|
||||
.at(verb)
|
||||
.at(if gender == "m" or gender == "f" { gender } else { "p" }, default: "p")
|
||||
}
|
||||
|
||||
#let pz-lb-title(type, number: none) = {
|
||||
let type-title = (
|
||||
"ЛБ": [Звіт \ з лабораторної роботи],
|
||||
"ПЗ": [Звіт \ з практичної роботи],
|
||||
"КР": [Контрольна робота],
|
||||
"РФ": [Реферат], // зрада
|
||||
).at(type, default: type)
|
||||
if number != none { [#type-title №#number] } else { [#type-title] }
|
||||
}
|
||||
|
||||
// Helper functions {{{1
|
||||
|
||||
/// captioned image with label derived from path:
|
||||
@@ -66,9 +87,9 @@
|
||||
}.replace(" ", "_")
|
||||
|
||||
let caption = if sink.pos().len() == 0 {
|
||||
caption + " (рисунок виконано самостійно)"
|
||||
} else if sink.pos().first() == none {
|
||||
caption
|
||||
} else if sink.pos().first() == none {
|
||||
caption + " (рисунок виконано самостійно)"
|
||||
} else {
|
||||
[#caption (за даними #sink.pos().first())]
|
||||
}
|
||||
@@ -79,54 +100,62 @@
|
||||
) #label(label_string)]
|
||||
}
|
||||
|
||||
// Styling {{{1
|
||||
/// NOTE: may be wrong
|
||||
#let ua_alpha_numbering = "абвгдежиклмнпрстуфхцшщюя".split("") // 0 = "", 1 = "а"
|
||||
#let spacing = 0.95em // spacing between lines
|
||||
#let num-to-alpha = "абвгдежиклмнпрстуфхцшщюя".split("") // 0 = "", 1 = "а"
|
||||
|
||||
// general outlook {{{2
|
||||
// spacing between lines
|
||||
#let spacing = 0.95em
|
||||
|
||||
#let style(it) = {
|
||||
/// DSTU 3008:2015 Style
|
||||
/// -> content
|
||||
/// - it (content): Content to apply the style to.
|
||||
/// - skip (int): Do not show page number for this number of pages.
|
||||
/// - offset (int): Adjust all page numbers by this amount.
|
||||
#let dstu-style(
|
||||
it,
|
||||
skip: 0,
|
||||
offset: 0,
|
||||
) = {
|
||||
// General Styling {{{1
|
||||
set page(
|
||||
paper: "a4",
|
||||
margin: (top: 20mm, right: 10mm, bottom: 20mm, left: 25mm),
|
||||
number-align: top + right,
|
||||
numbering: (..numbers) => {
|
||||
if numbers.pos().at(0) != 1 {
|
||||
numbering("1", numbers.pos().at(0))
|
||||
}
|
||||
},
|
||||
margin: (top: 20mm, right: 10mm, bottom: 20mm, left: 25mm),
|
||||
numbering: (i, ..) => if i > skip { numbering("1", i + offset) },
|
||||
)
|
||||
|
||||
set text(
|
||||
font: ("Times New Roman", "Liberation Serif"),
|
||||
lang: "uk",
|
||||
size: 14pt,
|
||||
hyphenate: false,
|
||||
lang: "uk",
|
||||
font: ("Times New Roman", "Liberation Serif"),
|
||||
)
|
||||
set par(justify: true, first-line-indent: (amount: 1.25cm, all: true))
|
||||
|
||||
set par(
|
||||
justify: true,
|
||||
spacing: spacing,
|
||||
leading: spacing,
|
||||
first-line-indent: (amount: 1.25cm, all: true),
|
||||
)
|
||||
|
||||
set block(spacing: spacing)
|
||||
set underline(evade: false)
|
||||
|
||||
// set 1.5 line spacing
|
||||
set block(spacing: spacing)
|
||||
set par(spacing: spacing)
|
||||
set par(leading: spacing)
|
||||
|
||||
// enums and lists {{{2
|
||||
// Enums & Lists {{{1
|
||||
// First level
|
||||
set enum(
|
||||
numbering: i => { ua_alpha_numbering.at(i) + ")" },
|
||||
indent: 1.25cm,
|
||||
body-indent: 0.5cm,
|
||||
numbering: i => { num-to-alpha.at(i) + ")" },
|
||||
)
|
||||
|
||||
// Second level and further nesting
|
||||
show enum: it => {
|
||||
set enum(indent: 0em, numbering: "1)")
|
||||
it
|
||||
}
|
||||
|
||||
// Lists are not intended for multiple levels, use `enum`
|
||||
set list(indent: 1.35cm, body-indent: 0.5cm, marker: [--])
|
||||
|
||||
// figures {{{2
|
||||
// Figures {{{1
|
||||
show figure: it => {
|
||||
v(spacing * 2, weak: true)
|
||||
it
|
||||
@@ -136,75 +165,43 @@
|
||||
set figure.caption(separator: [ -- ])
|
||||
show figure.where(kind: table): set figure.caption(position: top)
|
||||
show figure.caption.where(kind: table): set align(left)
|
||||
show figure.where(kind: raw): set figure.caption(position: top)
|
||||
show figure.where(kind: raw): set align(left)
|
||||
|
||||
// figure numbering
|
||||
// Numbering {{{1
|
||||
show heading.where(level: 1): it => {
|
||||
counter(math.equation).update(0)
|
||||
counter(figure.where(kind: raw)).update(0)
|
||||
counter(figure.where(kind: image)).update(0)
|
||||
counter(figure.where(kind: table)).update(0)
|
||||
counter(figure.where(kind: raw)).update(0)
|
||||
it
|
||||
}
|
||||
set figure(numbering: i => numbering("1.1", counter(heading).get().at(0), i))
|
||||
set math.equation(
|
||||
numbering: (..num) => numbering(
|
||||
numbering: i => numbering(
|
||||
"(1.1)",
|
||||
counter(heading).get().at(0),
|
||||
num.pos().first(),
|
||||
),
|
||||
)
|
||||
set figure(
|
||||
numbering: (..num) => numbering(
|
||||
"1.1",
|
||||
counter(heading).get().at(0),
|
||||
num.pos().first(),
|
||||
i,
|
||||
),
|
||||
)
|
||||
|
||||
// appearance of references to images and tables {{{2
|
||||
set ref(
|
||||
supplement: it => {
|
||||
if it == none or not it.has("kind") {
|
||||
it
|
||||
} else if it.kind == image {
|
||||
"див. рис."
|
||||
} else if it.kind == table {
|
||||
"див. таблицю"
|
||||
} else {
|
||||
it
|
||||
}
|
||||
},
|
||||
)
|
||||
show ref: it => {
|
||||
let el = it.element
|
||||
|
||||
if el == none or not el.has("kind") {
|
||||
return it
|
||||
}
|
||||
if el.kind != image and el.kind != table {
|
||||
return it
|
||||
}
|
||||
|
||||
[(#it)]
|
||||
}
|
||||
|
||||
// headings {{{2
|
||||
// Headings {{{1
|
||||
set heading(numbering: "1.1")
|
||||
|
||||
show heading.where(level: 1): it => {
|
||||
show heading: it => if it.level == 1 {
|
||||
set align(center)
|
||||
set text(size: 14pt, weight: "semibold")
|
||||
|
||||
pagebreak(weak: true)
|
||||
upper(it)
|
||||
v(spacing * 2, weak: true)
|
||||
}
|
||||
show heading.where(level: 2): it => {
|
||||
} else {
|
||||
set text(size: 14pt, weight: "regular")
|
||||
|
||||
v(spacing * 2, weak: true)
|
||||
block(width: 100%, spacing: 0em)[
|
||||
#h(1.25cm)
|
||||
#counter(heading).display(it.numbering)
|
||||
#counter(heading).display(auto)
|
||||
#it.body
|
||||
]
|
||||
v(spacing * 2, weak: true)
|
||||
@@ -222,18 +219,15 @@
|
||||
v(spacing * 2, weak: true)
|
||||
}
|
||||
|
||||
// listings {{{2
|
||||
show raw: it => {
|
||||
// listings {{{3
|
||||
show raw.where(block: true): it => {
|
||||
let new_spacing = 0.5em
|
||||
set block(spacing: new_spacing)
|
||||
set par(
|
||||
spacing: new_spacing,
|
||||
leading: new_spacing,
|
||||
)
|
||||
set par(spacing: new_spacing, leading: new_spacing)
|
||||
set text(
|
||||
size: 11pt,
|
||||
font: ("Iosevka NFM", "Courier New"),
|
||||
weight: "semibold",
|
||||
font: ("Courier New", "Liberation Mono"),
|
||||
)
|
||||
|
||||
v(spacing * 2.5, weak: true)
|
||||
@@ -242,8 +236,55 @@
|
||||
}
|
||||
|
||||
it
|
||||
// }}}
|
||||
}
|
||||
|
||||
/// DSTU 3008:2015 Appendices Style
|
||||
/// -> content
|
||||
/// - it (content): Content to apply the style to.
|
||||
#let appendices-style(it) = /* {{{ */ {
|
||||
// Numbering
|
||||
counter(heading).update(0)
|
||||
set heading(
|
||||
numbering: (i, ..n) => (
|
||||
upper(num-to-alpha.at(i)) + numbering(".1.1", ..n)
|
||||
),
|
||||
)
|
||||
set figure(
|
||||
numbering: i => [#upper(num-to-alpha.at(counter(heading).get().at(0))).#i],
|
||||
)
|
||||
set math.equation(
|
||||
numbering: i => [(#upper(num-to-alpha.at(counter(heading).get().at(0))).#i)],
|
||||
)
|
||||
|
||||
// Heading supplement (Heading name shown when citing with @ref)
|
||||
set heading(supplement: [Додаток])
|
||||
|
||||
// Headings
|
||||
show heading: it => if it.level == 1 {
|
||||
set align(center)
|
||||
set text(size: 14pt, weight: "regular")
|
||||
|
||||
pagebreak(weak: true)
|
||||
text(weight: "bold")[ДОДАТОК #counter(heading).display(auto)]
|
||||
linebreak()
|
||||
it.body
|
||||
v(spacing * 2, weak: true)
|
||||
} else {
|
||||
set text(size: 14pt, weight: "regular")
|
||||
|
||||
v(spacing * 2, weak: true)
|
||||
block(width: 100%, spacing: 0em)[
|
||||
#h(1.25cm)
|
||||
#counter(heading).display(auto)
|
||||
#it.body
|
||||
]
|
||||
v(spacing * 2, weak: true)
|
||||
}
|
||||
|
||||
it
|
||||
} // }}}
|
||||
|
||||
// Coursework template {{{1
|
||||
|
||||
/// DSTU 3008:2015 Template for NURE
|
||||
@@ -253,29 +294,27 @@
|
||||
/// - subject (str): Subject short name.
|
||||
/// - authors ((name: str, full_name_gen: str, variant: int, course: int, semester: int, group: str, gender: str),): List of authors.
|
||||
/// - mentors ((name: str, degree: str),): List of mentors.
|
||||
/// - edu_program (str): Education program shorthand.
|
||||
/// - task_list (done_date: datetime, initial_date: datetime, source: (content | str), content: (content | str), graphics: (content | str)): Task list object.
|
||||
/// - calendar_plan ( plan_table: (content | str), approval_date: datetime): Calendar plan object.
|
||||
/// - abstract (keywords: (str, ), text: (content | str)): Abstract object.
|
||||
/// - bib_path path: Path to the bibliography yaml file.
|
||||
/// - appendices (content): Content with appendices.
|
||||
#let cw-template(
|
||||
#let coursework(
|
||||
doc,
|
||||
title: none,
|
||||
subject: none,
|
||||
university: "ХНУРЕ",
|
||||
author: (),
|
||||
subject: none,
|
||||
title: none,
|
||||
authors: (),
|
||||
mentors: (),
|
||||
edu_program: none,
|
||||
task_list: (),
|
||||
calendar_plan: (),
|
||||
abstract: (),
|
||||
bib_path: none,
|
||||
appendices: (),
|
||||
) = {
|
||||
set document(title: title, author: author.name)
|
||||
set document(title: title, author: authors.at(0).name)
|
||||
|
||||
show: style
|
||||
show: dstu-style.with(skip: 1)
|
||||
|
||||
let bib-count = state("citation-counter", ())
|
||||
show cite: it => {
|
||||
@@ -287,10 +326,10 @@
|
||||
it
|
||||
}
|
||||
|
||||
|
||||
let author = authors.at(0)
|
||||
let head_mentor = mentors.at(0)
|
||||
let uni = universities.at(university)
|
||||
let edu_prog = uni.edu_programs.at(edu_program)
|
||||
let edu_prog = uni.edu_programs.at(author.edu_program)
|
||||
|
||||
// page 1 {{{2
|
||||
[
|
||||
@@ -306,15 +345,16 @@
|
||||
|
||||
ПОЯСНЮВАЛЬНА ЗАПИСКА\
|
||||
ДО КУРСОВОЇ РОБОТИ\
|
||||
з дисципліни: "#uni.subjects.at(subject, default: "NONE")"\
|
||||
з дисципліни: "#uni.subjects.at(subject, default: subject)"\
|
||||
Тема роботи: "#title"
|
||||
|
||||
\ \ \
|
||||
|
||||
#columns(2, gutter: 4cm)[
|
||||
#set align(left)
|
||||
#set par(first-line-indent: 0pt)
|
||||
|
||||
#if author.gender == "m" { [Виконав\ ] } else { [Виконала\ ] } ст. гр. #edu_program\-#author.group
|
||||
#gender-form("author", gender: author.gender) ст. гр. #author.edu_program\-#author.group
|
||||
|
||||
\
|
||||
Керівник:\
|
||||
@@ -325,15 +365,12 @@
|
||||
|
||||
\
|
||||
Комісія:\
|
||||
#for mentor in mentors {
|
||||
[#mentor.degree\
|
||||
]
|
||||
}
|
||||
#for m in mentors { [#m.degree\ ] }
|
||||
|
||||
#colbreak()
|
||||
#set align(left)
|
||||
|
||||
\
|
||||
|
||||
#author.name
|
||||
|
||||
\ \
|
||||
@@ -343,10 +380,7 @@
|
||||
#underline(" " * 35)
|
||||
|
||||
\ \
|
||||
#for mentor in mentors {
|
||||
[#mentor.name\
|
||||
]
|
||||
}
|
||||
#for m in mentors { [#m.name\ ] }
|
||||
]
|
||||
|
||||
#v(1fr)
|
||||
@@ -373,7 +407,7 @@
|
||||
{
|
||||
uline(align: left, edu_prog.department_gen)
|
||||
linebreak()
|
||||
uline(align: left, uni.subjects.at(subject))
|
||||
uline(align: left, uni.subjects.at(subject, default: subject))
|
||||
linebreak()
|
||||
uline(align: left, [#edu_prog.code #edu_prog.name_long])
|
||||
},
|
||||
@@ -382,7 +416,7 @@
|
||||
columns: (1fr, 1fr, 1fr),
|
||||
gutter: 0.3fr,
|
||||
[#bold[Курс] #uline(author.course)],
|
||||
[#bold[Група] #uline([#edu_program\-#author.group])],
|
||||
[#bold[Група] #uline([#author.edu_program\-#author.group])],
|
||||
[#bold[Семестр] #uline(author.semester)],
|
||||
)
|
||||
|
||||
@@ -502,31 +536,16 @@
|
||||
|
||||
\
|
||||
|
||||
#{
|
||||
let keywords = abstract.keywords.map(upper)
|
||||
let is_cyrillic = word => word.split("").any(char => ("А" <= char and char <= "я"))
|
||||
#(
|
||||
abstract
|
||||
.keywords
|
||||
.map(upper)
|
||||
.sorted(by: (a, b) => {
|
||||
if is-cyr(a) != is-cyr(b) { true } else { a < b }
|
||||
})
|
||||
.join(", ")
|
||||
)
|
||||
|
||||
let n = keywords.len()
|
||||
for i in range(n) {
|
||||
for j in range(0, n - i - 1) {
|
||||
if (
|
||||
(
|
||||
not is_cyrillic(keywords.at(j)) and is_cyrillic(keywords.at(j + 1))
|
||||
)
|
||||
or (
|
||||
is_cyrillic(keywords.at(j)) == is_cyrillic(keywords.at(j + 1)) and keywords.at(j) > keywords.at(j + 1)
|
||||
)
|
||||
) {
|
||||
(keywords.at(j), keywords.at(j + 1)) = (
|
||||
keywords.at(j + 1),
|
||||
keywords.at(j),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keywords.join(", ")
|
||||
}
|
||||
|
||||
\
|
||||
|
||||
@@ -558,26 +577,18 @@
|
||||
|
||||
let bib_data = yaml(bib_path)
|
||||
|
||||
let format-entry(citation) = {
|
||||
if (citation.type == "Web") {
|
||||
let date_array = citation.url.date.split("-")
|
||||
let format-entry(c) = {
|
||||
if (c.type == "Web") {
|
||||
let date_array = c.url.date.split("-")
|
||||
let date = datetime(
|
||||
year: int(date_array.at(0)),
|
||||
month: int(date_array.at(1)),
|
||||
day: int(date_array.at(2)),
|
||||
)
|
||||
[
|
||||
#citation.title.
|
||||
#citation.author.
|
||||
URL: #citation.url.value (дата звернення: #date.display("[day].[month].[year]")).
|
||||
]
|
||||
} else if citation.type == "Book" [
|
||||
#citation.author
|
||||
#citation.title.
|
||||
#citation.publisher,
|
||||
#citation.date.
|
||||
#citation.page-total c.
|
||||
] else [
|
||||
[#c.title. #c.author. URL: #c.url.value (дата звернення: #date.display("[day].[month].[year]")).]
|
||||
} else if (
|
||||
c.type == "Book"
|
||||
) [#c.author #c.title. #c.publisher, #c.date. #c.page-total c. ] else [
|
||||
UNSUPPORTED BIBLIOGRAPHY ENTRY TYPE, PLEASE OPEN AN ISSUE
|
||||
]
|
||||
}
|
||||
@@ -591,7 +602,10 @@
|
||||
}
|
||||
|
||||
context {
|
||||
for (i, citation) in query(ref.where(element: none)).map(r => str(r.target)).dedup().enumerate() {
|
||||
for (i, citation) in query(ref.where(element: none))
|
||||
.map(r => str(r.target))
|
||||
.dedup()
|
||||
.enumerate() {
|
||||
enum.item(
|
||||
i + 1,
|
||||
format-entry(bib_data.at(citation)),
|
||||
@@ -600,136 +614,82 @@
|
||||
}
|
||||
}
|
||||
|
||||
// appendices {{{2
|
||||
{
|
||||
counter(heading).update(0)
|
||||
|
||||
set heading(
|
||||
numbering: (i, ..nums) => {
|
||||
let char = upper(ua_alpha_numbering.at(i))
|
||||
if nums.pos().len() == 0 { char } else {
|
||||
char + "." + nums.pos().map(str).join(".")
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
show heading.where(level: 1): it => {
|
||||
set align(center)
|
||||
set text(size: 14pt, weight: "regular")
|
||||
|
||||
pagebreak(weak: true)
|
||||
bold[ДОДАТОК #counter(heading).display(it.numbering)]
|
||||
linebreak()
|
||||
it.body
|
||||
v(spacing * 2, weak: true)
|
||||
}
|
||||
|
||||
show heading.where(level: 2): it => {
|
||||
set text(size: 14pt, weight: "regular")
|
||||
|
||||
v(spacing * 2, weak: true)
|
||||
block(width: 100%, spacing: 0em)[
|
||||
#h(1.25cm)
|
||||
#counter(heading).display(it.numbering)
|
||||
#it.body
|
||||
]
|
||||
v(spacing * 2, weak: true)
|
||||
}
|
||||
|
||||
appendices
|
||||
}
|
||||
appendices-style(appendices)
|
||||
}
|
||||
|
||||
// Laboratory work template {{{1
|
||||
// Practice and Laboratory works template {{{1
|
||||
|
||||
/// DSTU 3008:2015 Template for NURE
|
||||
/// -> content
|
||||
/// - doc (content): Content to apply the template to.
|
||||
/// - doctype ("ЛБ" | "ПЗ"): Document type.
|
||||
/// - edu_program (str): Education program shorthand.
|
||||
/// - title (str): Title of the document.
|
||||
/// - subject (str): Subject shorthand.
|
||||
/// - authors ((name: str, full_name_gen: str, group: str, gender: str, variant: int or none),): List of authors.
|
||||
/// - mentors ((name: str, degree: str, gender: str or none),): List of mentors.
|
||||
/// - worknumber (int or none): Number of the work. Optional.
|
||||
#let pz-lb-template(
|
||||
/// - university: "ХНУРЕ": University metadata. Optional.
|
||||
/// - subject: str: Subject shortcode.
|
||||
/// - type: ("ЛБ" | "ПЗ" | "КР" | "РФ" | str): Work type.
|
||||
/// - number: int or none: Work number. Optional.
|
||||
/// - title: str or none: Work title. Optional.
|
||||
/// - authors ((name: str, full_name_gen: str or none, edu_program: str, group: str, gender: str, variant: int or none),): List of authors.
|
||||
/// - mentors ((name: str, degree: str, gender: ("m" | "f" | "p" | none)),): List of mentors. Optional.
|
||||
#let pz-lb(
|
||||
doc,
|
||||
doctype: none,
|
||||
university: "ХНУРЕ",
|
||||
edu_program: none,
|
||||
title: none,
|
||||
subject: none,
|
||||
worknumber: none,
|
||||
type: none,
|
||||
number: none,
|
||||
title: none,
|
||||
authors: (),
|
||||
mentors: (),
|
||||
) = {
|
||||
// TODO: add actually relevant asserts
|
||||
|
||||
let edu_program = authors.at(0).edu_program
|
||||
let uni = universities.at(university)
|
||||
|
||||
set document(title: title, author: authors.at(0).name)
|
||||
|
||||
show: style
|
||||
show: dstu-style.with(skip: 1)
|
||||
|
||||
let uni = universities.at(university)
|
||||
let edu_prog = uni.edu_programs.at(edu_program)
|
||||
// page 1 {{{2
|
||||
|
||||
align(center)[
|
||||
МІНІСТЕРСТВО ОСВІТИ І НАУКИ УКРАЇНИ \
|
||||
#upper(uni.name)
|
||||
|
||||
\ \
|
||||
Кафедра #edu_prog.department_gen
|
||||
Кафедра #uni.edu_programs.at(edu_program).department_gen
|
||||
|
||||
\ \ \
|
||||
Звіт \
|
||||
з
|
||||
#if doctype == "ЛБ" [лабораторної роботи] else [практичної роботи]
|
||||
#if worknumber != none {
|
||||
context counter(heading).update(worknumber - 1)
|
||||
[№#worknumber]
|
||||
}
|
||||
#pz-lb-title(type, number: number)
|
||||
|
||||
з дисципліни: "#uni.subjects.at(subject, default: "UNKNOWN SUBJECT, PLEASE OPEN AN ISSUE")"
|
||||
з дисципліни: "#uni.subjects.at(subject, default: subject)"
|
||||
#if title != none [\ з теми: "#eval(title, mode: "markup")"]
|
||||
|
||||
з теми: "#title"
|
||||
|
||||
\ \ \ \
|
||||
|
||||
#columns(2)[
|
||||
#set align(left)
|
||||
#set par(first-line-indent: 0pt)
|
||||
|
||||
#if authors.len() == 1 {
|
||||
let author = authors.at(0)
|
||||
if author.gender == "m" [Виконав:\ ] else [Виконала:\ ]
|
||||
[
|
||||
ст. гр. #edu_program\-#author.group\
|
||||
#author.name\
|
||||
]
|
||||
if author.variant != none [Варіант: №#author.variant]
|
||||
} else [
|
||||
Виконали:\
|
||||
ст. гр. #edu_program\-#authors.at(0).group\
|
||||
#for author in authors [#author.name\ ]
|
||||
let a = authors.at(0)
|
||||
[#gender-form("author", gender: if "gender" in a.keys() { a.gender } else { none }):\ ]
|
||||
[ст. гр. #a.edu_program\-#a.group\ #a.name\ ]
|
||||
if a.variant != none [Варіант: №#a.variant]
|
||||
} else if authors.len() > 1 [
|
||||
#gender-form("author"):\
|
||||
#for a in authors [ст. гр. #a.edu_program\-#a.group\ #a.name\ ]
|
||||
]
|
||||
|
||||
#colbreak()
|
||||
#set align(right)
|
||||
|
||||
#if mentors.len() == 1 {
|
||||
let mentor = mentors.at(0)
|
||||
if mentor.gender == none [Перевірили:\ ] else if (
|
||||
mentor.gender == "m"
|
||||
) [Перевірив:\ ] else [Перевірилa:\ ]
|
||||
[
|
||||
#mentor.degree\
|
||||
#mentor.name\
|
||||
]
|
||||
} else [
|
||||
Перевірили:\
|
||||
#for mentor in mentors {
|
||||
[
|
||||
#mentor.degree\
|
||||
#mentor.name\
|
||||
]
|
||||
}
|
||||
]
|
||||
let m = mentors.at(0)
|
||||
[#gender-form("mentor", gender: if "gender" in m.keys() { m.gender } else { none }):\ ]
|
||||
if "degree" in m.keys() and m.degree != none [#m.degree\ ]
|
||||
[#m.name\ ]
|
||||
} else if mentors.len() > 1 [
|
||||
#gender-form("mentor"):\
|
||||
#for mentor in mentors { [#mentor.degree\ #mentor.name\ ] }]
|
||||
]
|
||||
|
||||
#v(1fr)
|
||||
@@ -739,8 +699,17 @@
|
||||
|
||||
pagebreak(weak: true)
|
||||
|
||||
heading(title)
|
||||
// TODO(unexplrd): wrap my head around the old way
|
||||
if title == none {
|
||||
if number == none { context counter(heading).update(1) } else {
|
||||
context counter(heading).update(number)
|
||||
}
|
||||
} else {
|
||||
if number != none { context counter(heading).update(number - 1) }
|
||||
heading(eval(title, mode: "markup"))
|
||||
}
|
||||
|
||||
doc
|
||||
}
|
||||
|
||||
// vim:sts=2:sw=2:fdl=0:fdm=marker:cms=/*%s*/
|
||||
// vim:sts=2:sw=2:fdm=marker:cms=/*%s*/
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
title: Потiк керування та алгоритмічні структури Bash
|
||||
subject: СПМ
|
||||
doctype: ЛБ
|
||||
worknumber: 2
|
||||
mentors:
|
||||
- name: Шевченко Т. Г.
|
||||
degree: Доцент кафедри ПІ
|
||||
gender: m
|
||||
- name: Франко І. Я.
|
||||
degree: Асистент кафедри ПІ
|
||||
gender: m
|
||||
edu_program: &EDU ПЗПІ
|
||||
university: ХНУРЕ
|
||||
authors:
|
||||
- name: Косач Л. П.
|
||||
full_name_gen: Косач Лариси Петрівни
|
||||
course: 2
|
||||
edu: *EDU
|
||||
gender: f
|
||||
group: 23-2
|
||||
semester: 4
|
||||
variant: 8
|
||||
@@ -1,13 +1,16 @@
|
||||
#import "@local/nure:0.1.0": *
|
||||
#import "lib.typ": *
|
||||
|
||||
#let author = (
|
||||
name: "Ситник Є. С.",
|
||||
full_name_gen: "Ситника Єгора Сергійовича",
|
||||
course: 2,
|
||||
semester: 3,
|
||||
variant: 13,
|
||||
group: "23-2",
|
||||
gender: "m",
|
||||
#let authors = (
|
||||
(
|
||||
name: "Ситник Є. С.",
|
||||
full_name_gen: "Ситника Єгора Сергійовича",
|
||||
edu_program: "ПЗПІ",
|
||||
group: "23-2",
|
||||
gender: "m",
|
||||
course: 2,
|
||||
semester: 3,
|
||||
variant: 13,
|
||||
)
|
||||
)
|
||||
|
||||
#let mentors = (
|
||||
@@ -28,19 +31,39 @@
|
||||
plan_table: table(
|
||||
columns: 4,
|
||||
align: (center, left, center, center),
|
||||
[Номер], [Назва етапів курсової роботи], [Строк виконання етапів роботи], [Примітки],
|
||||
[Номер],
|
||||
[Назва етапів курсової роботи],
|
||||
[Строк виконання етапів роботи],
|
||||
[Примітки],
|
||||
|
||||
[1], [Аналіз предметної області], [15.09.24 – 24.09.24], [Виконано],
|
||||
[2], [Концептуальне моделювання], [24.09.24-30.09.24], [~],
|
||||
[2], [Постановка задачі], [28.09.24 – 2.10.24], [Виконано],
|
||||
[3], [Побудова ER-діаграми та схеми БД], [2.10.24 – 18.10.24], [Виконано],
|
||||
[4], [Оформлення розділів 1, 2 та 3.1, 3.2 пояснювальної записки], [10.10.24 - 18.10.24], [Виконано],
|
||||
[4],
|
||||
[Оформлення розділів 1, 2 та 3.1, 3.2 пояснювальної записки],
|
||||
[10.10.24 - 18.10.24],
|
||||
[Виконано],
|
||||
|
||||
[5], [Перша контрольна точка з курсової роботи], [20.10.24], [Виконано],
|
||||
[6], [Нормалізація бази даних], [20.10.24 - 15.11.24], [Виконано],
|
||||
[7], [Створення програми], [20.10.24 – 20.11.24], [Виконано],
|
||||
[8], [Тестування програми, наповнення бази даних], [20.11.24 - 5.12.24], [Виконано],
|
||||
[8],
|
||||
[Тестування програми, наповнення бази даних],
|
||||
[20.11.24 - 5.12.24],
|
||||
[Виконано],
|
||||
|
||||
[9], [Друга контрольна точка з курсової роботи], [7.12.24], [Виконано],
|
||||
[10], [Реалізація остаточної версії програми], [7.12.24-15.12.24], [Виконано],
|
||||
[11], [Оформлення інших розділів пояснювальної записки], [1.11.24 – 25.12.24], [Виконано],
|
||||
[10],
|
||||
[Реалізація остаточної версії програми],
|
||||
[7.12.24-15.12.24],
|
||||
[Виконано],
|
||||
|
||||
[11],
|
||||
[Оформлення інших розділів пояснювальної записки],
|
||||
[1.11.24 – 25.12.24],
|
||||
[Виконано],
|
||||
|
||||
[12], [Третя контрольна точка з курсової роботи], [27.12.24], [Виконано],
|
||||
),
|
||||
approval_date: datetime(year: 2024, month: 12, day: 27),
|
||||
@@ -97,16 +120,15 @@
|
||||
#lorem(200)
|
||||
]
|
||||
|
||||
#show: cw-template.with(
|
||||
#show: coursework.with(
|
||||
title: "Інформаційна система «Помічник класного керівника». Керування класом",
|
||||
subject_short: "БД",
|
||||
edu_program_short: "ПЗПІ",
|
||||
author: author,
|
||||
subject: "БД",
|
||||
authors: authors,
|
||||
mentors: mentors,
|
||||
task_list: task_list,
|
||||
calendar_plan: calendar_plan,
|
||||
abstract: abstract,
|
||||
bib_path: "bibl.yml",
|
||||
bib_path: "bibl.yml", // NOTE: use `bytes("bibl.yml")` as typst looks in template dir when using just filename
|
||||
appendices: appendices,
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,28 @@
|
||||
#import "@local/nure:0.1.0": *
|
||||
#import "lib.typ": *
|
||||
|
||||
#show: pz-lb-template.with(..yaml("config/doc.yaml"))
|
||||
#show: pz-lb.with(
|
||||
university: "ХНУРЕ",
|
||||
subject: "СМП",
|
||||
type: "ЛБ",
|
||||
number: 2,
|
||||
title: "Потiк керування та алгоритмічні структури Bash",
|
||||
mentors: (
|
||||
(name: "Шевченко Т. Г.", degree: "Доцент кафедри ПІ", gender: "m"),
|
||||
(name: "Франко І. Я.", degree: "Асистент кафедри ПІ", gender: "m"),
|
||||
),
|
||||
authors: (
|
||||
(
|
||||
name: "Косач Л. П.",
|
||||
full_name_gen: "Косач Лариси Петрівни",
|
||||
edu_program: "ПЗПІ",
|
||||
group: "23-2",
|
||||
gender: "f",
|
||||
course: 2,
|
||||
semester: 4,
|
||||
variant: 8,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
#v(-spacing)
|
||||
|
||||
@@ -29,3 +51,25 @@
|
||||
- #lorem(25);
|
||||
- #lorem(42);
|
||||
- #lorem(27).
|
||||
|
||||
#show: appendices-style
|
||||
|
||||
= Quote
|
||||
#link("https://youtu.be/bJQj1uKtnus")[
|
||||
The art isn't the art, the art is never the art,
|
||||
the art is the thing that happens inside you when you make it and the feeling in the heart of the beholder.
|
||||
]
|
||||
|
||||
|
||||
= Приклад звіту 1
|
||||
#v(-spacing)
|
||||
== Частина 1
|
||||
#lorem(100)
|
||||
== Частина2
|
||||
#lorem(200)
|
||||
|
||||
= Приклад звіту 2
|
||||
#lorem(200)
|
||||
|
||||
= Приклад звіту 3
|
||||
#lorem(200)
|
||||
|
||||
Reference in New Issue
Block a user