mirror of
https://github.com/kristoferssolo/LU-DF-Typst-Template.git
synced 2026-03-21 16:16:27 +00:00
Compare commits
2 Commits
c19dc32eb8
...
4c5b829df2
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c5b829df2 | |||
| a67fe5623a |
@@ -48,7 +48,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:
|
||||
|
||||
```typst
|
||||
#import "@preview/solo-lu-df:1.1.1": *
|
||||
#import "@preview/solo-lu-df:1.1.2": *
|
||||
|
||||
#show: ludf.with(
|
||||
title: "Darba Nosaukums",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#import "@preview/solo-lu-df:1.1.1": *
|
||||
#import "@preview/solo-lu-df:1.1.2": *
|
||||
|
||||
#show: ludf.with(
|
||||
title: "Bakalaura Darba Nosaukums",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#import "@preview/solo-lu-df:1.1.1": *
|
||||
#import "@preview/solo-lu-df:1.1.2": *
|
||||
|
||||
#show: ludf.with(
|
||||
title: "Kursa Darba Nosaukums",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#import "@preview/solo-lu-df:1.1.1": *
|
||||
#import "@preview/solo-lu-df:1.1.2": *
|
||||
|
||||
#show: ludf.with(
|
||||
title: "Maģistra Darba Nosaukums",
|
||||
|
||||
@@ -127,6 +127,32 @@
|
||||
]
|
||||
}
|
||||
|
||||
#let normalize-title(title) = {
|
||||
if type(title) != content or "children" not in title.fields() {
|
||||
return title
|
||||
}
|
||||
|
||||
let children = title
|
||||
.fields()
|
||||
.children
|
||||
.filter(it => it.func() != linebreak)
|
||||
.fold((), (acc, it) => {
|
||||
if it == [ ] and (acc.len() == 0 or acc.last() == [ ]) {
|
||||
acc
|
||||
} else {
|
||||
acc + (it,)
|
||||
}
|
||||
})
|
||||
|
||||
let children = if children.len() > 0 and children.last() == [ ] {
|
||||
children.slice(0, -1)
|
||||
} else {
|
||||
children
|
||||
}
|
||||
|
||||
children.join("")
|
||||
}
|
||||
|
||||
#let make-documentary-page(
|
||||
title,
|
||||
authors,
|
||||
@@ -137,11 +163,11 @@
|
||||
presentation-date,
|
||||
) = {
|
||||
set page(numbering: none)
|
||||
heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa")
|
||||
set par(spacing: 2em)
|
||||
heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa")
|
||||
|
||||
make-dokumentary(
|
||||
title,
|
||||
normalize-title(title),
|
||||
authors,
|
||||
advisors,
|
||||
reviewer,
|
||||
@@ -150,3 +176,4 @@
|
||||
fmt-date(presentation-date),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
19
src/lib.typ
19
src/lib.typ
@@ -293,26 +293,9 @@
|
||||
|
||||
make-attachments(attachment-title, attachments)
|
||||
|
||||
let title-text = if type(title) == content and "children" in title.fields() {
|
||||
title
|
||||
.fields()
|
||||
.children
|
||||
.filter(it => it.func() != linebreak)
|
||||
.fold((), (acc, it) => {
|
||||
if it == [ ] and acc.last() == [ ] {
|
||||
acc
|
||||
} else {
|
||||
acc + (it,)
|
||||
}
|
||||
})
|
||||
.join("")
|
||||
} else {
|
||||
title
|
||||
}
|
||||
|
||||
if display-documentary {
|
||||
make-documentary-page(
|
||||
title-text,
|
||||
title,
|
||||
authors,
|
||||
advisors,
|
||||
reviewer,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#import "documentary-page.typ": get-thesis-label, make-documentary-page
|
||||
|
||||
|
||||
#let merge(a, b) = {
|
||||
let result = a
|
||||
for (k, v) in b { result.at(k) = v }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#import "@preview/solo-lu-df:1.1.1": *
|
||||
#import "@preview/solo-lu-df:1.1.2": *
|
||||
|
||||
#show: ludf.with(
|
||||
title: "Darba Nosaukums",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solo-lu-df"
|
||||
version = "1.1.1"
|
||||
version = "1.1.2"
|
||||
entrypoint = "src/lib.typ"
|
||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||
license = "MIT-0"
|
||||
|
||||
Reference in New Issue
Block a user