Created title and chastotnie-methods lab templates

This commit is contained in:
Egor 2024-09-07 16:39:01 +03:00
parent 2e5a44e21d
commit d09088648f
4 changed files with 139 additions and 79 deletions

View file

@ -0,0 +1,71 @@
#let lab(
num: 0,
name: [],
doc
) = [
#set document(
title: [Частотные методы - Лабораторная работа №#num],
author: "Капралов Егор"
)
#set page(
paper: "a4",
margin: (left: 30mm, right: 15mm, top: 20mm, bottom: 20mm),
numbering: "1"
)
#set text(
font: "Liberation Serif",
size: 14pt,
lang: "ru",
region: "RU"
)
#set par(
justify: true,
leading: 1.5em,
first-line-indent: 1.25cm
)
// remove leading dot from the heading numbering
#set heading(
numbering: (..nums) => nums.pos().map(str).join(".")
)
#show heading: it => {
set text(weight: "bold")
// format non-numbered headings differently
if it.numbering == none {
set align(center)
set text(size: 16pt)
block(below: 2.5em, above: 2.5em, upper(it))
} else {
set text(size: 14pt)
block(below: 2em, above: 2em, it)
}
}
#show raw.where(lang: "matlab"): it => {
set text(size: 11pt, font: "Courier Prime")
set par(leading: 1.15em)
it
}
#import "../title.typ": itmo_title
#itmo_title(
type: [Лабораторная работа №#num],
name: name,
subject: [Частотные методы]
)
#outline(title: [Содержание])
#doc
]
#let chapter(title) = {
pagebreak(weak: true)
heading(numbering: none, title)
}

Binary file not shown.

View file

@ -1,85 +1,16 @@
#set document(
title: [Частотные методы - Лабораторная работа №1],
author: "Капралов Егор"
#import "../lab-template.typ"
#import lab-template: lab
#import lab-template: chapter
#show: doc => lab(
num: 1,
name: [Ряды Фурье],
doc
)
#set page(
paper: "a4",
margin: (left: 30mm, right: 15mm, top: 20mm, bottom: 20mm),
numbering: "1"
)
#chapter[wawwa]
#set text(
font: "Liberation Serif",
size: 14pt,
lang: "ru",
region: "RU"
)
#set par(
justify: true,
leading: 1.5em,
first-line-indent: 1.25cm
)
// remove leading dot from the heading numbering
#set heading(
numbering: (..nums) => nums.pos().map(str).join(".")
)
#show heading: it => {
set text(weight: "bold")
// format non-numbered headings differently
if it.numbering == none {
set align(center)
set text(size: 16pt)
block(below: 2.5em, above: 2.5em, upper(it))
} else {
set text(size: 14pt)
block(below: 2em, above: 2em, it)
}
}
#show raw.where(lang: "matlab"): it => {
set text(size: 11pt, font: "Courier Prime")
set par(leading: 1.15em)
it
}
#let chapter(title) = {
pagebreak(weak: true)
heading(numbering: none, title)
}
#let title() = {
set page(
)
}
#title()
#outline(title: "Содержание")
#chapter[Вступление]
= Первый заголовок
= АААААААА
#lorem(100)
#chapter[Основная часть]
= Второй заголовок
#lorem(100)
#chapter[Заключение]
= Третий заголовок
#lorem(50)
== Почти третий заголовок
#lorem(50)

58
title.typ Normal file
View file

@ -0,0 +1,58 @@
#let itmo_title(
year: datetime.today().year(),
type: [Тип работы №n],
subject: [Дисциплина],
name: [Название работы],
var: none,
authors: (
(
name: [Капралов Егор],
group: [R3340]
),
)
) = [
#set align(center)
#set page(
header-ascent: 0em,
header: [
#set text(size: 11pt)
#set par(leading: 1em)
Федеральное государственное автономное образовательное учереждение высшего образования
"Национальный исследовательский университет ИТМО"
],
footer: [
#set text(size: 11pt)
Санкт-Петербург, #year г.
]
)
#v(30%)
#image("itmo.png", width: 50%)
#type
"#name"
#[
#set text(size: 11pt)
по дисциплине
]
"#subject"
#if var != none {
[Вариант №#var]
}
#v(15%)
#{
set align(right)
[Работу выполнил(и):]
linebreak()
for author in authors {
author.name + " " + author.group
}
}
]