3 Commits
6 changed files with 27 additions and 9 deletions

No files matched your search

+2 -2
View File
@@ -4,9 +4,9 @@ This repository contains a Typst template for academic papers at the Kaunas Univ
## Initiating the template ## Initiating the template
Install the downloaded template under the following directory: Install the downloaded template under the following directory:
- LINUX: `~/.local/share/typst/packages/local/ktu-paper/0.3.1/` - Linux: `~/.local/share/typst/packages/local/ktu-paper/0.3.2/`
And then initiate a new project: And then initiate a new project:
```sh ```sh
typst init @local/ktu-paper:0.3.1 typst init @local/ktu-paper:0.3.2
``` ```
+18 -4
View File
@@ -17,6 +17,7 @@
#let ktu-author-table( #let ktu-author-table(
authors: (), authors: (),
alignment: right, alignment: right,
namesFirst: true, // if false, roles will be displayed first
) = context { ) = context {
// The layout should be a list of lists whose elements are (name, role) pairs. // The layout should be a list of lists whose elements are (name, role) pairs.
assert(authors.len() > 0, message: "author table must have at least one author") assert(authors.len() > 0, message: "author table must have at least one author")
@@ -51,9 +52,13 @@
table.header([]), table.header([]),
..for author in authors { ..for author in authors {
let (name, role) = author let (name, role) = author
name = [*#name*]
if not namesFirst {
(role, name) = (name, role)
}
(align(center)[ (align(center)[
#set block(below: 8pt) #set block(below: 8pt)
#block[*#name*] #block[#name]
#block[#role] #block[#role]
], []) ], [])
@@ -67,9 +72,13 @@
), ),
..for author in authors { ..for author in authors {
let (name, role) = author let (name, role) = author
name = [*#name*]
if not namesFirst {
(role, name) = (name, role)
}
(align(left)[ (align(left)[
#set block(below: 8pt) #set block(below: 8pt)
#block[*#name*] #block[#name]
#block[#role] #block[#role]
], [], [], []) ], [], [], [])
@@ -140,6 +149,7 @@
place: highlight[Kaunas], place: highlight[Kaunas],
year: highlight[#datetime.today().year()], year: highlight[#datetime.today().year()],
centerAuthors: false, centerAuthors: false,
authorNamesFirst: true, // if false, roles will be displayed first
) = { ) = {
let subHeaders = (faculty,) let subHeaders = (faculty,)
if department != none { if department != none {
@@ -155,9 +165,9 @@
) )
v(94pt) v(94pt)
if centerAuthors { if centerAuthors {
ktu-author-table(authors: authors, alignment: center) ktu-author-table(authors: authors, namesFirst: authorNamesFirst, alignment: center)
} else { } else {
ktu-author-table(authors: authors) ktu-author-table(authors: authors, namesFirst: authorNamesFirst)
} }
align(center+bottom, block([*#place, #year*])) align(center+bottom, block([*#place, #year*]))
} }
@@ -171,6 +181,7 @@
(highlight[Vardenis Pavardenis], highlight[Projekto autorius]), (highlight[Vardenis Pavardenis], highlight[Projekto autorius]),
(highlight[Vardenis Pavardenis], highlight[Vadovas]), (highlight[Vardenis Pavardenis], highlight[Vadovas]),
), ),
authorNamesFirst: true, // if false, roles will be displayed first
place: highlight[Kaunas], place: highlight[Kaunas],
year: highlight[#datetime.today().year()], year: highlight[#datetime.today().year()],
) = { ) = {
@@ -183,6 +194,7 @@
place: place, place: place,
year: year, year: year,
centerAuthors: true, centerAuthors: true,
authorNamesFirst: authorNamesFirst,
) )
} }
@@ -195,6 +207,7 @@
(highlight[Vardenis Pavardenis], highlight[Projekto autorius]), (highlight[Vardenis Pavardenis], highlight[Projekto autorius]),
(highlight[Vardenis Pavardenis], highlight[Vadovas]), (highlight[Vardenis Pavardenis], highlight[Vadovas]),
), ),
authorNamesFirst: true, // if false, roles will be displayed first
place: highlight[Kaunas], place: highlight[Kaunas],
year: highlight[#datetime.today().year()], year: highlight[#datetime.today().year()],
) = { ) = {
@@ -207,6 +220,7 @@
place: place, place: place,
year: year, year: year,
centerAuthors: false, centerAuthors: false,
authorNamesFirst: authorNamesFirst,
) )
} }
+4
View File
@@ -2,6 +2,10 @@
#import "config.typ": debug-author-table, enable-heading-experiment, __HEADING_EXPERIMENT, __FIG_PER_SECTION, __UPPERCASE_SECTION_TITLES #import "config.typ": debug-author-table, enable-heading-experiment, __HEADING_EXPERIMENT, __FIG_PER_SECTION, __UPPERCASE_SECTION_TITLES
#import "fragments.typ": ( #import "fragments.typ": (
ktu-table, ktu-table,
// building blocks
ktu-author-table, ktu-title-header-block,
ktu-heading-page, ktu-heading-page-centered, ktu-heading-page-normal, ktu-heading-page, ktu-heading-page-centered, ktu-heading-page-normal,
ktu-academic-honestly-declaration-page ktu-academic-honestly-declaration-page
) )
+1 -1
View File
@@ -1,4 +1,4 @@
#import "@local/ktu-paper:0.3.1": ( #import "@local/ktu-paper:0.3.2": (
ktu-paper, setup-code, ktu-paper, setup-code,
ktu-table-of-contents, ktu-picture-list, ktu-table-list, ktu-table-of-contents, ktu-picture-list, ktu-table-list,
ktu-heading-page-normal, ktu-heading-page-normal,
+1 -1
View File
@@ -1,4 +1,4 @@
#import "@local/ktu-paper:0.3.1": ( #import "@local/ktu-paper:0.3.2": (
ktu-paper, setup-code, ktu-paper, setup-code,
ktu-table-of-contents, ktu-picture-list, ktu-table-list, ktu-table-of-contents, ktu-picture-list, ktu-table-list,
ktu-heading-page-normal, ktu-heading-page-normal,
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "ktu-paper" name = "ktu-paper"
version = "0.3.1" version = "0.3.2"
compiler = "0.15.0" compiler = "0.15.0"
entrypoint = "src/lib.typ" entrypoint = "src/lib.typ"
repository = "https://github.com/svetikas/ktu-paper" repository = "https://github.com/svetikas/ktu-paper"