Compare commits

..

No commits in common. "fe82dee5e49a23058e57cf018fcf3da8c4d7e8c6" and "8c1c86f71236711a68cd3af3aa1b4a2abdef6d53" have entirely different histories.

6 changed files with 80 additions and 101 deletions

View File

@ -33,7 +33,6 @@ configure the whole document and `attachment` helper function. Important argumen
`text` (content) and `keywords` (array) as well as `title`, `lang` and `keyword-title`. `text` (content) and `keywords` (array) as well as `title`, `lang` and `keyword-title`.
- `bibliography`: Result of `bibliography("path/to/file.yml")` or `none`. - `bibliography`: Result of `bibliography("path/to/file.yml")` or `none`.
- `attachments`: Tuple of `attachment(...)` items (tables, figures). - `attachments`: Tuple of `attachment(...)` items (tables, figures).
- `display-documentary`: Whether to display the documentary page at the end. Defaults to `true`.
- Positional argument: the document body follows the `ludf.with(...)` call. - Positional argument: the document body follows the `ludf.with(...)` call.
The function also accepts a single, positional argument for the body of the paper. The function also accepts a single, positional argument for the body of the paper.
@ -43,7 +42,7 @@ function in a show rule. If you want to change an existing project to use this
template, you can add a show rule like this at the top of your file: template, you can add a show rule like this at the top of your file:
```typst ```typst
#import "@preview/solo-lu-df:0.1.4": * #import "@preview/solo-lu-df:0.1.1": *
#show: ludf.with( #show: ludf.with(
title: "Darba Nosaukums", title: "Darba Nosaukums",
@ -68,8 +67,7 @@ template, you can add a show rule like this at the top of your file:
columns: (1fr, 1fr), columns: (1fr, 1fr),
[Column 1], [Column 2], [Column 1], [Column 2],
), ),
), ),
),
) )
// Your content goes below. // Your content goes below.

View File

@ -1,6 +1,6 @@
#import "@preview/fletcher:0.5.8" as fletcher: diagram, edge, node #import "@preview/fletcher:0.5.8" as fletcher: diagram, edge, node
#import fletcher.shapes: cylinder, ellipse #import fletcher.shapes: cylinder, ellipse
#import "@preview/solo-lu-df:0.1.4": * #import "@preview/solo-lu-df:0.1.1": *
#import "utils/tables.typ": function-table #import "utils/tables.typ": function-table
#import "utils/diagrams.typ": data-store, dpd-database, dpd-edge, process #import "utils/diagrams.typ": data-store, dpd-database, dpd-edge, process

View File

@ -2,6 +2,8 @@
make-abstract, make-attachments, make-documentary-page, make-title, make-abstract, make-attachments, make-documentary-page, make-title,
) )
#let indent = 1cm
#let attachment(caption: none, label: none, body) = { #let attachment(caption: none, label: none, body) = {
( (
content: body, content: body,
@ -47,7 +49,6 @@
outline-title: "Saturs", outline-title: "Saturs",
attachments: (), attachments: (),
attachment-title: "Pielikumi", attachment-title: "Pielikumi",
display-documentary: true,
body, body,
) = { ) = {
// Set document metadata. // Set document metadata.
@ -71,14 +72,16 @@
paper: "a4", paper: "a4",
) )
// Main body. // Main body.
set par( set par(
justify: true, justify: true,
leading: 0.65em * 1.5, leading: 1.5em,
spacing: 0.65em * 1.5, spacing: 1.5em,
first-line-indent: (amount: 1cm, all: true), first-line-indent: (amount: indent, all: true),
) )
// Configure equation numbering and spacing. // Configure equation numbering and spacing.
set math.equation(numbering: "(1)") set math.equation(numbering: "(1)")
show math.equation: set block(spacing: 0.65em) show math.equation: set block(spacing: 0.65em)
@ -92,10 +95,10 @@
// Headings // Headings
set heading(numbering: "1.1.") set heading(numbering: "1.1.")
show heading: set block(spacing: 0.65em * 2, sticky: true) show heading: set block(spacing: 2em)
show heading: it => { show heading: it => {
if it.level == 1 { if it.level == 1 {
pagebreak() pagebreak(weak: true)
text(14pt, align(center, upper(it))) text(14pt, align(center, upper(it)))
} else { } else {
text(12pt, it) text(12pt, it)
@ -117,16 +120,12 @@
it it
} }
set figure( set figure(numbering: it => {
numbering: it => {
let count = counter(heading).get() let count = counter(heading).get()
numbering("1.1.", count.first(), it) numbering("1.1.", count.first(), it)
}, })
)
show figure: set block( show figure: set block(breakable: true) // allow for tables to span to next pages mid sentence
breakable: true,
) // allow for tables to span to next pages mid sentence
show figure: set par(justify: false) // disable justify for figures (tables) show figure: set par(justify: false) // disable justify for figures (tables)
show figure.caption: set align(end) show figure.caption: set align(end)
show table.cell.where(y: 0): strong show table.cell.where(y: 0): strong
@ -137,7 +136,6 @@
show figure.where(kind: image): set figure(supplement: "att") show figure.where(kind: image): set figure(supplement: "att")
show figure.caption.where(kind: image): set align(start) show figure.caption.where(kind: image): set align(start)
show figure.caption: set block(sticky: true)
show figure.caption: set text(size: 11pt) show figure.caption: set text(size: 11pt)
show figure.where(kind: image): set figure.caption( show figure.where(kind: image): set figure.caption(
position: bottom, position: bottom,
@ -268,7 +266,7 @@
outline( outline(
depth: 3, depth: 3,
indent: 1cm, indent: indent,
title: text(size: 14pt, outline-title), title: text(size: 14pt, outline-title),
) )
@ -280,23 +278,12 @@
make-attachments(attachment-title, attachments) make-attachments(attachment-title, attachments)
if display-documentary {
make-documentary-page( make-documentary-page(
if type(title) == content { title,
title
.fields()
.values()
.at(0)
.filter(it => it.func() != linebreak and it != [ ])
.join(" ")
} else {
title
},
authors, authors,
advisors, advisors,
reviewer, reviewer,
thesis-type, thesis-type,
date, date,
) )
}
} }

View File

@ -60,31 +60,14 @@
place, place,
logo, logo,
) = { ) = {
align( align(center, upper(text(size: 14pt, [
center,
upper(
text(
size: 14pt,
[
#university\ #university\
#faculty #faculty
], ])))
),
),
)
v(1fr) v(1fr)
align( align(center, upper(text(16pt, weight: "bold", title)))
center,
upper(
text(
16pt,
weight: "bold",
title,
),
),
)
v(0.2fr) v(0.2fr)
@ -119,50 +102,61 @@
reviewer, reviewer,
thesis-type, thesis-type,
date, date,
) = [ ) = {
#set page(numbering: none) let vspace = 1fr
#let formatted-date = strong(date.display("[day].[month].[year].")) set page(numbering: none)
#heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa") let formatted-date = strong(date.display("[day].[month].[year]."))
#set par(spacing: 2em)
heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa")
[
#thesis-type "*#title*" ir #thesis-type "*#title*" ir
izstrādāts Latvijas Universitātes Eksakto zinātņu un tehnoloģiju fakultātē, izstrādāts Latvijas Universitātes Eksakto zinātņu un tehnoloģiju fakultātē,
Datorikas nodaļā. Datorikas nodaļā.
Ar savu parakstu apliecinu, ka darbs izstrādāts patstāvīgi, izmantoti tikai #v(vspace / 3)
tajā norādītie informācijas avoti un iesniegtā darba elektroniskā kopija Ar savu parakstu apliecinu, ka darbs izstrādāts patstāvīgi, izmantoti tikai tajā
atbilst izdrukai un/vai recenzentam uzrādītajai darba versijai. norādītie informācijas avoti un iesniegtā darba elektroniskā kopija atbilst
#set par(hanging-indent: 1cm) izdrukai un/vai recenzentam uzrādītajai darba versijai.
]
#v(0.5fr) context {
set par(
first-line-indent: 1cm,
hanging-indent: 1cm,
)
v(vspace / 2)
[
#if authors.len() > 1 { "Autori: " } else { "Autors: " } #if authors.len() > 1 { "Autori: " } else { "Autors: " }
#( #authors.map(author => [*#author.name, #author.code*]).join(", ")
authors.map(author => [*#author.name, #author.code*]).join(", ") ~ #formatted-date
) ~ #formatted-date ]
#v(1fr) v(vspace)
[
Rekomendēju darbu aizstāvēšanai\ Rekomendēju darbu aizstāvēšanai\
#if advisors.len() > 0 [ #if advisors.len() > 0 [
Darba #if advisors.len() > 1 { "vadītāji:" } else { "vadītājs:" } Darba #if advisors.len() > 1 { "vadītāji:" } else { "vadītājs:" }
#( #advisors.map(advisor => [*#advisor.title #advisor.name*]).join("\n")
advisors.map(advisor => [*#advisor.title #advisor.name*]).join("\n") ~ #formatted-date
) ~ #formatted-date ]
] ]
#v(1fr) v(vspace)
[Recenzents: *#reviewer.name*]
Recenzents: *#reviewer.name*
#v(1fr) v(vspace)
[
Darbs iesniegts #formatted-date\
Kvalifikācijas darbu pārbaudījumu komisijas sekretārs (elektronisks paraksts)
]
Darbs iesniegts #formatted-date \ v(vspace)
#thesis-type.replace("darbs", "darbu") pārbaudīja komisijas sekretārs (elektronisks paraksts) }
}
#v(1fr)
]
#let make-attachments(title, attachments) = { #let make-attachments(title, attachments) = {
if attachments == () { if attachments == () {

View File

@ -1,4 +1,4 @@
#import "@preview/solo-lu-df:0.1.4": * #import "@preview/solo-lu-df:0.1.1": *
#show: ludf.with( #show: ludf.with(
title: "Darba Nosaukums", title: "Darba Nosaukums",

View File

@ -1,9 +1,9 @@
[package] [package]
name = "solo-lu-df" name = "solo-lu-df"
version = "0.1.4" version = "0.1.1"
entrypoint = "src/lib.typ" entrypoint = "src/lib.typ"
authors = ["Kristofers Solo <dev@kristofers.xyz>"] authors = ["Kristofers Solo <dev@kristofers.xyz>"]
license = "MIT-0" license = "MIT"
description = "Write qualification papers, bachelors theses, and masters theses for University of Latvia, Computer Science programme." description = "Write qualification papers, bachelors theses, and masters theses for University of Latvia, Computer Science programme."
repository = "https://github.com/kristoferssolo/LU-DF-Typst-Template" repository = "https://github.com/kristoferssolo/LU-DF-Typst-Template"
keywords = [ keywords = [