forked from pencelheimer/typst_nure_template
Compare commits
32 Commits
b3214e2150
...
0.1.0
Author | SHA1 | Date | |
---|---|---|---|
2e65baae70
|
|||
d338c21965 | |||
7e15ea09d4
|
|||
3b3d62fd9b
|
|||
04c5b283e7
|
|||
3ca8409e58
|
|||
e0811afaae
|
|||
7ec79ee898
|
|||
47117749cf
|
|||
e214656166
|
|||
99234a73a9
|
|||
901d670a1c | |||
594e908bb1 | |||
32c6a1663c
|
|||
9cc7229851
|
|||
1646f5249b
|
|||
2de5cb4c58
|
|||
dec7c58db2
|
|||
2653e7dba2
|
|||
816d07f745
|
|||
7799435039 | |||
5be6cea4fb | |||
5bc79a196e | |||
c1ad952c7c | |||
dc3358d986 | |||
6bf37099b4 | |||
bf00b3de5d | |||
c049a9a3ce | |||
22fb1de736 | |||
1db499dad4 | |||
41dcbeb1ec | |||
429f632841 |
49
README.md
49
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;
|
||||
@ -29,11 +30,11 @@ This template:
|
||||
### As a local typst package
|
||||
1. Clone this repository into ~/.local/share/typst/packages/:
|
||||
```bash
|
||||
git clone https://gitea.linerds.us/pencelheimer/typst_nure_template.git ~/.local/share/typst/packages/local/nure/0.0.0
|
||||
git clone -b 0.1.0 https://gitea.linerds.us/pencelheimer/typst_nure_template.git ~/.local/share/typst/packages/local/nure/0.1.0
|
||||
```
|
||||
2. Init your project with Typst:
|
||||
```bash
|
||||
typst init @local/nure:0.0.0 project-name
|
||||
typst init @local/nure:0.1.0 project-name
|
||||
```
|
||||
|
||||
### As a standalone file
|
||||
@ -42,37 +43,59 @@ Copy `lib.typ` to your project's root directory.
|
||||
### In your project
|
||||
```typst
|
||||
// Import the template either from a local package...
|
||||
#import "@local/nure:0.0.0": *
|
||||
#import "@local/nure:0.1.0": *
|
||||
// ...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 config/doc.yaml file
|
||||
#show: pz-lb.with(..yaml("config/doc.yaml"))
|
||||
|
||||
// this template automatically inserts a `=title`
|
||||
|
||||
// Write your content...
|
||||
// Write your content
|
||||
#v(-spacing) // remove spacing between headings
|
||||
== Purpose
|
||||
Some text
|
||||
|
||||
// ...or include your modules
|
||||
// NOTE: you have to import a package or a lib.typ in each module.
|
||||
#include "src/intro.typ"
|
||||
#include "src/chapter1.typ"
|
||||
#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.
|
||||
]
|
||||
```
|
||||
|
||||
### 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/
|
||||
├── main.typ -- for importing, configuration and boilerplate
|
||||
├── 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/
|
||||
│ ├── intro.typ
|
||||
│ ├── chapter1.typ
|
||||
|
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 |
58
config/universities.yaml
Normal file
58
config/universities.yaml
Normal file
@ -0,0 +1,58 @@
|
||||
ХНУРЕ:
|
||||
name: Харківський національний університет радіоелектроніки
|
||||
edu_programs:
|
||||
ПЗПІ:
|
||||
name_long: Інженерія програмного забезпечення
|
||||
department_gen: Програмної інженерії
|
||||
code: 121 # TODO: change to F2?
|
||||
КУІБ:
|
||||
name_long: Управління інформаційною безпекою
|
||||
department_gen: Інфокомунікаційної інженерії ім. В. В. Поповського
|
||||
code: 125
|
||||
КНТ:
|
||||
name_long: Комп'ютерні науки та технології
|
||||
department_gen: Системотехніки
|
||||
code: 122
|
||||
subjects:
|
||||
ODS: Основи Dаtа Sсіеnсе # NOTE: Eng O here
|
||||
ІМ: Іноземна мова
|
||||
АКтаК: Архітектура комп'ютера та комп'ютерних мереж
|
||||
АТСД: Алгоритми та структури даних
|
||||
БД: Бази даних
|
||||
БЖД: Безпека життєдіяльності
|
||||
ВДІТБ: Введення до ІТ-бізнесу # NOTE: all in UA
|
||||
ВМ: Вища математика
|
||||
ГТГ: Гіпертекст та гіпермедіа
|
||||
ДМ: Дискретна математика
|
||||
КДМА: Комп'ютерна дискретна математика
|
||||
КМ: Комп`ютерні мережі
|
||||
КЗВШ: Креативність з використанням штучного інтелекту
|
||||
ЛМВ: Людино-машинна взаємодія
|
||||
МОТДО: Методи оптимізаціі та дослідження операцій
|
||||
МС: Моделювання систем
|
||||
ОІМ: Основи IP-мереж
|
||||
ООП: Об'єктно-орієнтоване програмування
|
||||
ОП: Основи права
|
||||
ОПІ: Основи програмноі інженеріі
|
||||
ОПНJ: Основи програмування на Java
|
||||
ОПр: Основи програмування
|
||||
ОС: Операційні системи
|
||||
ОТК: Основи теорії кіл
|
||||
ПНП: Програмування на платформі .NЕТ
|
||||
ПП: Проектний практикум
|
||||
ПРОГ: Програмування
|
||||
СМП: Скриптові мови програмування
|
||||
ТЙтаМ: Теорія ймовірностей та математична # TODO: what?
|
||||
ТКП: Технології комп`ютерного проєктування
|
||||
УФМ: Українське фахове мовлення
|
||||
ФІЗ: Фізика
|
||||
ФІЛ: Філософія
|
||||
ФВС: Фізичне виховання та спорт
|
||||
# Oleksii 6th semester
|
||||
ХТ: Хмарні технології
|
||||
ООАПС: Об'єктно-орієнтований аналіз в проектуванні систем
|
||||
СА: Системний аналіз
|
||||
МППС: Методології проектування програмних систем
|
||||
ТЗІ: Технології захисту інформації
|
||||
АДан: Аналітика даних
|
||||
DMT: Decision making theory
|
393
lib.typ
393
lib.typ
@ -1,31 +1,7 @@
|
||||
|
||||
// Academic aliases {{{1
|
||||
|
||||
/// subject abbreviations to full names
|
||||
#let subjects = (
|
||||
"БД": "Бази даних",
|
||||
"ОТК": "Основи теорії кіл",
|
||||
"ОПНJ": "Основи програмування на Java",
|
||||
"ОС": "Операційні системи",
|
||||
"ПП": "Проектний практикум",
|
||||
"СПМ": "Скриптові мови програмування",
|
||||
"Ф": "Філософія",
|
||||
"ФІЗ": "Фізика",
|
||||
)
|
||||
|
||||
/// education program abbreviations to name & number
|
||||
#let edu_programs = (
|
||||
"ПЗПІ": (
|
||||
name-long: "Інженерія програмного забезпечення",
|
||||
department_gen: "Програмної інженерії",
|
||||
code: 121, // TODO: ПЗПІ is "F2" now
|
||||
),
|
||||
"КУІБ": (
|
||||
name-long: "Управління інформаційною безпекою",
|
||||
department_gen: "Інфокомунікацій",
|
||||
code: 125,
|
||||
),
|
||||
)
|
||||
#let universities = yaml("config/universities.yaml")
|
||||
|
||||
// Template formatting functions {{{1
|
||||
|
||||
@ -90,64 +66,75 @@
|
||||
}.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())]
|
||||
}
|
||||
|
||||
[#figure(image(path, ..sink.named()), caption: caption) #label(label_string)]
|
||||
[#figure(
|
||||
image(path, ..sink.named()),
|
||||
caption: caption,
|
||||
) #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
|
||||
@ -158,100 +145,53 @@
|
||||
show figure.where(kind: table): set figure.caption(position: top)
|
||||
show figure.caption.where(kind: table): 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 math.equation(
|
||||
numbering: (..num) => 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(),
|
||||
),
|
||||
)
|
||||
set figure(numbering: i => numbering("1.1", counter(heading).get().at(0), i))
|
||||
set math.equation(numbering: i => numbering(
|
||||
"(1.1)",
|
||||
counter(heading).get().at(0),
|
||||
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)
|
||||
}
|
||||
|
||||
show heading.where(level: 3): 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)
|
||||
}
|
||||
|
||||
// listings {{{2
|
||||
// Listings {{{1
|
||||
show raw: it => {
|
||||
let new_spacing = 0.5em
|
||||
set block(spacing: new_spacing)
|
||||
set par(
|
||||
spacing: new_spacing,
|
||||
leading: new_spacing,
|
||||
let raw-spacing = 0.5em
|
||||
set block(spacing: raw-spacing)
|
||||
set par(spacing: raw-spacing, leading: raw-spacing)
|
||||
set text(
|
||||
size: 11pt,
|
||||
weight: "semibold",
|
||||
font: ("Courier New", "Liberation Mono"),
|
||||
)
|
||||
set text(size: 11pt, font: "Courier New", weight: "semibold")
|
||||
|
||||
v(spacing * 2.5, weak: true)
|
||||
pad(it, left: 1.25cm)
|
||||
@ -259,8 +199,47 @@
|
||||
}
|
||||
|
||||
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)])
|
||||
|
||||
// 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
|
||||
@ -268,30 +247,31 @@
|
||||
/// - doc (content): Content to apply the template to.
|
||||
/// - title (str): Title of the document.
|
||||
/// - subject (str): Subject short name.
|
||||
/// - authors ((name: str, full_name_gen: str, variant: int, group: str, gender: str),): List of Authors dicts.
|
||||
/// - mentors ((name: str, gender: str, degree: str),): List of mentors dicts.
|
||||
/// - 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: (),
|
||||
mentors: (),
|
||||
edu_program: none,
|
||||
task_list: (),
|
||||
calendar_plan: (),
|
||||
abstract: (),
|
||||
bib_path: "bibl.yml",
|
||||
bib_path: none,
|
||||
appendices: (),
|
||||
) = {
|
||||
set document(title: title, author: author.name)
|
||||
|
||||
show: style
|
||||
show: dstu-style.with(skip: 1)
|
||||
|
||||
let bib-count = state("citation-counter", ())
|
||||
show cite: it => {
|
||||
@ -305,14 +285,14 @@
|
||||
|
||||
|
||||
let head_mentor = mentors.at(0)
|
||||
let edu_prog = edu_programs.at(edu_program)
|
||||
let uni = universities.at(university)
|
||||
let edu_prog = uni.edu_programs.at(edu_program)
|
||||
|
||||
// page 1 {{{2
|
||||
[
|
||||
#set align(center)
|
||||
МІНІСТЕРСТВО ОСВІТИ І НАУКИ УКРАЇНИ
|
||||
|
||||
ХАРКІВСЬКИЙ НАЦІОНАЛЬНИЙ УНІВЕРСИТЕТ РАДІОЕЛЕКТРОНІКИ
|
||||
МІНІСТЕРСТВО ОСВІТИ І НАУКИ УКРАЇНИ\
|
||||
#upper(uni.name)
|
||||
|
||||
\
|
||||
|
||||
@ -320,12 +300,9 @@
|
||||
|
||||
\
|
||||
|
||||
ПОЯСНЮВАЛЬНА ЗАПИСКА
|
||||
|
||||
ДО КУРСОВОЇ РОБОТИ
|
||||
|
||||
з дисципліни: "#subjects.at(subject, default: "NONE")"
|
||||
|
||||
ПОЯСНЮВАЛЬНА ЗАПИСКА\
|
||||
ДО КУРСОВОЇ РОБОТИ\
|
||||
з дисципліни: "#uni.subjects.at(subject, default: "NONE")"\
|
||||
Тема роботи: "#title"
|
||||
|
||||
\ \ \
|
||||
@ -333,7 +310,7 @@
|
||||
#columns(2, gutter: 4cm)[
|
||||
#set align(left)
|
||||
|
||||
#if author.gender == "m" { [Виконав\ ] } else { [Виконала\ ] } ст. гр. #author.group
|
||||
#if author.gender == "m" { [Виконав\ ] } else { [Виконала\ ] } ст. гр. #edu_program\-#author.group
|
||||
|
||||
\
|
||||
Керівник:\
|
||||
@ -377,7 +354,7 @@
|
||||
|
||||
// page 2 {{{2
|
||||
{
|
||||
uline[Харківський національний університет радіоелектроніки]
|
||||
uline[#uni.name]
|
||||
|
||||
linebreak()
|
||||
linebreak()
|
||||
@ -392,15 +369,15 @@
|
||||
{
|
||||
uline(align: left, edu_prog.department_gen)
|
||||
linebreak()
|
||||
uline(align: left, subjects.at(subject))
|
||||
uline(align: left, uni.subjects.at(subject))
|
||||
linebreak()
|
||||
uline(align: left, [#edu_prog.code #edu_prog.name-long])
|
||||
uline(align: left, [#edu_prog.code #edu_prog.name_long])
|
||||
},
|
||||
)
|
||||
grid(
|
||||
columns: (1fr, 1fr, 1fr),
|
||||
gutter: 0.3fr,
|
||||
[#bold[Курс] #uline(2)], [#bold[Група] #uline(author.group)], [#bold[Семестр] #uline(3)],
|
||||
[#bold[Курс] #uline(author.course)], [#bold[Група] #uline([#edu_program\-#author.group])], [#bold[Семестр] #uline(author.semester)],
|
||||
)
|
||||
|
||||
linebreak()
|
||||
@ -617,92 +594,68 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 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.
|
||||
/// - doctype ("ЛБ" | "ПЗ" | str): Document type.
|
||||
/// - title (str or none): Title of the document. Optional.
|
||||
/// - 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(
|
||||
/// - 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. Optional.
|
||||
/// - chapters (): List of file names in chapters/ subdirectory. Optional.
|
||||
#let pz-lb(
|
||||
doc,
|
||||
doctype: none,
|
||||
university: "ХНУРЕ",
|
||||
edu_program: none,
|
||||
doctype: none,
|
||||
title: none,
|
||||
subject: none,
|
||||
worknumber: none,
|
||||
authors: (),
|
||||
mentors: (),
|
||||
chapters: (),
|
||||
) = {
|
||||
assert.ne(edu_program, none, message: "Missing argument: \"edu_program\"")
|
||||
assert.ne(doctype, none, message: "Missing argument: \"doctype\"")
|
||||
assert.ne(subject, none, message: "Missing argument: \"subject\"")
|
||||
|
||||
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_programs.at(edu_program).department_gen
|
||||
Кафедра #edu_prog.department_gen
|
||||
|
||||
\ \ \
|
||||
Звіт \
|
||||
з
|
||||
#if doctype == "ЛБ" [лабораторної роботи] else [практичної роботи]
|
||||
#if doctype == "ЛБ" [Звіт \ з лабораторної роботи] else if (
|
||||
doctype == "ПЗ"
|
||||
) [Звіт \ з практичної роботи] else [#doctype]
|
||||
#if worknumber != none {
|
||||
context counter(heading).update(worknumber - 1)
|
||||
context counter(heading).update(
|
||||
worknumber - if title == none { 0 } else { 1 },
|
||||
)
|
||||
[№#worknumber]
|
||||
} else if title != none and worknumber != none {
|
||||
context counter(heading).update(1)
|
||||
}
|
||||
|
||||
з дисципліни: "#subjects.at(subject, default: "UNKNOWN SUBJECT, PLEASE OPEN AN ISSUE")"
|
||||
з дисципліни: "#uni.subjects.at(subject)"
|
||||
|
||||
з теми: "#title"
|
||||
#if title != none [з теми: "#title"]
|
||||
|
||||
\ \ \ \
|
||||
|
||||
@ -716,34 +669,40 @@
|
||||
ст. гр. #edu_program\-#author.group\
|
||||
#author.name\
|
||||
]
|
||||
if author.variant != none [Варіант: №#author.variant]
|
||||
} else [
|
||||
if (
|
||||
"variant" in author.keys() and author.variant != none
|
||||
) [Варіант: №#author.variant]
|
||||
} else if authors.len() > 1 [
|
||||
Виконали:\
|
||||
ст. гр. #authors.at(0).group\
|
||||
#authors.map(a => [ #a.name\ ])
|
||||
ст. гр. #edu_program\-#authors.at(0).group\
|
||||
#for author in authors [#author.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\
|
||||
#if type(mentors) == array {
|
||||
if mentors.len() == 1 {
|
||||
let mentor = mentors.at(0)
|
||||
if "gender" in mentor.keys() {
|
||||
if mentor.gender == "m" [Перевірив:\ ] else if (
|
||||
mentor.gender == "f"
|
||||
) [Перевірила:\ ]
|
||||
} else [Перевірили:\ ]
|
||||
if (
|
||||
"degree" in mentor.keys() and mentor.degree != none
|
||||
) [#mentor.degree\ ]
|
||||
[#mentor.name\ ]
|
||||
} else if mentors.len() > 1 [
|
||||
Перевірили:\
|
||||
#for mentor in mentors {
|
||||
[
|
||||
#mentor.degree\
|
||||
#mentor.name\
|
||||
]
|
||||
}
|
||||
]
|
||||
} else [
|
||||
Перевірили:\
|
||||
#for mentor in mentors {
|
||||
[
|
||||
#mentor.degree\
|
||||
#mentor.name\
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
#v(1fr)
|
||||
@ -753,8 +712,10 @@
|
||||
|
||||
pagebreak(weak: true)
|
||||
|
||||
heading(title)
|
||||
if title != none [#heading(title)]
|
||||
|
||||
doc
|
||||
chapters.map(chapter => include "/chapters/" + str(chapter) + ".typ").join()
|
||||
}
|
||||
|
||||
// vim:sts=2:sw=2:fdl=0:fdm=marker:cms=/*%s*/
|
||||
|
22
template/config/doc.yaml
Normal file
22
template/config/doc.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
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,17 +1,19 @@
|
||||
#import "@local/nure:0.0.0": *
|
||||
#import "@local/nure:0.1.0": *
|
||||
|
||||
#let author = (
|
||||
name: "Ситник Є. С.",
|
||||
full_name_gen: "Ситника Єгора Сергійовича",
|
||||
course: 2,
|
||||
semester: 3,
|
||||
variant: 13,
|
||||
group: "23-2",
|
||||
gender: "m",
|
||||
)
|
||||
|
||||
#let mentors = (
|
||||
(name: "Черепанова Ю. Ю.", gender: "f", degree: "Ст. викл. каф. ПІ"),
|
||||
(name: "Русакова Н. Є.", gender: "f", degree: "Доц. каф. ПІ"),
|
||||
(name: "Широкопетлєва М. С.", gender: "f", degree: "Ст. викл. каф. ПІ"),
|
||||
(name: "Черепанова Ю. Ю.", degree: "Ст. викл. каф. ПІ"),
|
||||
(name: "Русакова Н. Є.", degree: "Доц. каф. ПІ"),
|
||||
(name: "Широкопетлєва М. С.", degree: "Ст. викл. каф. ПІ"),
|
||||
)
|
||||
|
||||
#let task_list = (
|
||||
@ -95,16 +97,16 @@
|
||||
#lorem(200)
|
||||
]
|
||||
|
||||
#show: cw-template.with(
|
||||
#show: coursework.with(
|
||||
title: "Інформаційна система «Помічник класного керівника». Керування класом",
|
||||
subject_short: "БД",
|
||||
edu_program_short: "ПЗПІ",
|
||||
subject: "БД",
|
||||
edu_program: "ПЗПІ",
|
||||
author: author,
|
||||
mentors: mentors,
|
||||
task_list: task_list,
|
||||
calendar_plan: calendar_plan,
|
||||
abstract: abstract,
|
||||
bib_path: "bibl.yml",
|
||||
bib_path: bytes("bibl.yml"), // NOTE: use `bytes` as typst looks in template dir when using just filename
|
||||
appendices: appendices,
|
||||
)
|
||||
|
||||
|
@ -1,24 +1,6 @@
|
||||
#import "@local/nure:0.0.0": *
|
||||
#import "@local/nure:0.1.0": *
|
||||
|
||||
#show: pz-lb-template.with(
|
||||
doctype: "ЛБ",
|
||||
edu_program_short: "ПЗПІ",
|
||||
title: "Інформаційна система «Помічник класного керівника». Керування класом",
|
||||
subject_short: "БД",
|
||||
authors: (
|
||||
(
|
||||
name: "Ситник Є. С.",
|
||||
full_name_gen: "Ситника Єгора Сергійовича",
|
||||
variant: 13,
|
||||
group: "ПЗПІ-23-2",
|
||||
gender: "m",
|
||||
),
|
||||
),
|
||||
mentors: (
|
||||
(name: "Черепанова Ю. Ю.", gender: "f", degree: "Ст. викл. каф. ПІ"),
|
||||
),
|
||||
worknumber: 1,
|
||||
)
|
||||
#show: pz-lb.with(..yaml("config/doc.yaml"))
|
||||
|
||||
#v(-spacing)
|
||||
|
||||
@ -47,3 +29,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)
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nure"
|
||||
version = "0.0.0"
|
||||
version = "0.1.0"
|
||||
entrypoint = "lib.typ"
|
||||
authors = ["linerds"]
|
||||
license = "GPL-3.0"
|
||||
|
Reference in New Issue
Block a user