typst-itmo/chastotnie-methods/lab-template.typ

72 lines
1.5 KiB
Text
Raw Normal View History

#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)
}