67 Commits
v0.1 ... v0.9.2

Author SHA1 Message Date
d9ab5e8ab1 include citation examples for templategen 2025-10-08 08:30:37 +02:00
b8502b5466 fix naming for study specialization 2025-10-07 22:34:19 +02:00
ca46ff32a8 update bp and dp examples 2025-10-07 22:23:29 +02:00
f7737687db prepare for tultemplategen bundling 2025-10-07 21:54:18 +02:00
6850224e84 stop versioning pdfs directly in git 2025-10-07 21:30:43 +02:00
Matej-Zucha-TUL
08bcc0672b Develop templates 2025-10-07 21:09:04 +02:00
211bdc54db Made DP and BP lowercase 2025-10-07 19:13:30 +02:00
Matej-Zucha-TUL
f8ebdfe1f8 Add makeshift command to run BP and DP example using the --root hack 2025-10-07 18:19:39 +02:00
Matej-Zucha-TUL
b5e1f1d663 Add BP and DP example in Czech 2025-10-07 18:12:23 +02:00
d8dc47e3b0 improve compliance with guidelines 2025-10-07 17:52:31 +02:00
3beac874c1 add dp to documentation 2025-10-07 14:05:05 +02:00
0dc0ed4249 make study branch optional for dp 2025-10-07 14:03:24 +02:00
5d763827e8 chagne document identifier for dp 2025-10-07 14:01:06 +02:00
7b3831f5fb add language entries for dp 2025-10-07 13:59:50 +02:00
89c3be0bf0 add base for dp 2025-10-07 13:56:16 +02:00
6e17d96b8b improve building and add example watcher to bundle 2025-10-07 12:57:00 +02:00
6d27bd5df5 add non-zipped bundling for templategen 2025-10-07 12:25:52 +02:00
178be2e174 colorize external links 2025-10-06 18:32:36 +02:00
a90543cdbd compensate mono font size 2025-10-06 18:21:55 +02:00
aeb112f5a1 give example.typ a better name 2025-10-06 18:02:36 +02:00
bf63657df3 add font tip to readme 2025-10-06 17:34:42 +02:00
3f53ed89ba minify data files 2025-10-06 17:26:57 +02:00
da11cd88fa rename author gender to author pronouns 2025-10-06 13:16:01 +02:00
d915b8cf27 add year of study to document info 2025-10-06 11:52:28 +02:00
afc1ee372f add author to acknowledgement 2025-10-06 11:24:25 +02:00
d478d63812 implement acknowledgement 2025-10-06 11:12:00 +02:00
527534f885 update example.typ 2025-10-03 21:19:37 +02:00
5c35389dca add attachments to example.typ 2025-10-03 19:28:00 +02:00
f22b16a803 add optional institute for supervisor and consultant entries 2025-10-03 19:02:31 +02:00
Matej-Zucha-TUL
f66f36d560 Add missing argument describtions 2025-10-03 12:01:14 +02:00
011ef2c950 add absolute url for mirror repo 2025-10-03 11:34:14 +02:00
2787bed48d fix Matěj damage 2025-10-03 11:09:23 +02:00
a691d84e1b implement attachments 2025-10-03 11:07:22 +02:00
Matej-Zucha-TUL
a0c75deba0 Change example document signature to reflect reality better 2025-10-03 09:26:49 +02:00
Matej-Zucha-TUL
1a7418d2cd Add optional consultant parameter 2025-10-03 09:25:37 +02:00
2e300ded3c add pronouns picking for english 2025-10-02 23:28:07 +02:00
0e9fbcdc93 update doc comment for the tultemplate2 function 2025-10-02 23:27:43 +02:00
bfe08ac9b4 fix some image/table list problems 2025-10-02 23:26:48 +02:00
8a76ee9e1e update documentation 2025-10-02 20:57:37 +02:00
d954a0e687 classic template fixes 2025-10-02 20:57:22 +02:00
eba0ec7826 add image and table listings 2025-10-02 20:39:26 +02:00
768ba54856 classic template fixes 2025-10-02 15:26:55 +02:00
85a6ed8d44 add study branch to info page 2025-10-02 14:11:14 +02:00
afe325da0a fix error on no author 2025-10-02 13:45:22 +02:00
cc079dd87d fix no bp document type on info page 2025-10-02 13:40:56 +02:00
08c7123041 fix incorrect panic message on supported genders 2025-10-02 13:39:20 +02:00
c786ec2a4a allow content abstract type 2025-10-02 13:34:15 +02:00
5773e9785b expand czech disclaimer genders 2025-10-02 13:31:14 +02:00
f31bcaddec fix some build mistakes 2025-10-02 12:11:34 +02:00
26d861b72a improve bibliography a bit 2025-10-01 22:34:31 +02:00
6bebe41d6e add citation tests 2025-10-01 22:25:35 +02:00
4e634e6ff9 document other arguments 2025-10-01 21:31:57 +02:00
b03978a2c0 add disclaimer base and bachelor to english 2025-10-01 21:31:34 +02:00
c41ac4bc77 prepare for more thesis types 2025-10-01 19:19:17 +02:00
1f75a74f61 disable not yet supported document types 2025-10-01 13:11:50 +02:00
5d17fa8fe3 add assignment page 2025-10-01 13:08:55 +02:00
Matej-Zucha-TUL
9657f4b75b Fix typo in Makefile 2025-10-01 13:07:13 +02:00
Matej-Zucha-TUL
cae85646e6 Add all faculties, add watch_example target 2025-10-01 13:04:51 +02:00
a5be430777 add abstract and disclaimer page 2025-10-01 09:40:18 +02:00
fd397003ba tests: add base and font tests 2025-09-26 11:36:52 +02:00
35cc041d6e classic: add disclaimer for bp 2025-09-26 11:17:10 +02:00
4dd974278a docs: extend documentation 2025-09-26 09:09:43 +02:00
8ef9bfb7ef classic: improve abbreviation spacing 2025-09-26 09:09:23 +02:00
ae84cdaeac remove unnecessary parameters from example file 2025-09-26 08:25:50 +02:00
5347a16cf1 improve title page layout and extract natural language to separate file 2025-09-26 08:25:12 +02:00
1faa0c6c93 add merriweather font and fix ofl files 2025-09-26 08:23:11 +02:00
438ca6d5c3 make the latex template style a bit more correct 2025-09-25 12:45:17 +02:00
68 changed files with 2849 additions and 300 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
*.ttf filter=lfs diff=lfs merge=lfs -text
*.otf filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text

View File

@@ -1,38 +1,109 @@
.PHONY: view_example .PHONY: view_documentation
view_example: example.pdf view_documentation: documentation.pdf
xdg-open $< xdg-open $<
.PHONY: example .PHONY: watch_documentation
example: example.pdf watch_documentation:
typst watch --font-path template/fonts documentation.typ & xdg-open documentation.pdf
.PHONY: watch_bp_cs
watch_bp_cs: bp.pdf
xdg-open bp.pdf & typst watch --root . --font-path template/fonts theses/bp.typ bp.pdf
.PHONY: watch_dp_cs
watch_dp_cs: dp.pdf
xdg-open dp.pdf & typst watch --root . --font-path template/fonts theses/dp.typ dp.pdf
.PHONY: documentation
documentation: documentation.pdf
PACKDIR := pack/tultemplate2
BUNDLEDIR := pack/bundle
TO_PACK := $(shell find template -type f) template/LICENSE TO_PACK := $(shell find template -type f) template/LICENSE
PACK_TARGETS := $(TO_PACK:%=pack/tultemplate2/%) pack/tultemplate2/example.typ BUNDLE_TARGETS := $(TO_PACK:%=$(BUNDLEDIR)/%) $(BUNDLEDIR)/citations.bib $(BUNDLEDIR)/bp.typ \
$(BUNDLEDIR)/dp.typ $(BUNDLEDIR)/Makefile
PACK_TARGETS := $(TO_PACK:%=$(PACKDIR)/%) $(PACKDIR)/documentation.typ \
$(PACKDIR)/documentation.pdf $(PACKDIR)/citations.bib
.PHONY: pack .PHONY: pack
pack: pack/tultemplate2.zip pack: pack/tultemplate2.zip
.PHONY: bundle
bundle: $(BUNDLE_TARGETS)
@echo "!! Bundles are made for tultemplategen and not for direct use !!"
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf pack rm -rf pack
rm -f example.pdf rm -f documentation.pdf bp.pdf dp.pdf
pack/tultemplate2.zip: $(PACK_TARGETS) pack/tultemplate2.zip: $(PACK_TARGETS)
@mkdir -p $(@D) @mkdir -p $(@D)
rm -f $@ rm -f $@
cd pack && zip -r tultemplate2.zip tultemplate2 cd pack && zip -r tultemplate2.zip tultemplate2
pack/tultemplate2/example.typ: example.typ $(PACKDIR)/%: %
ln -f $< $@
pack/tultemplate2/template/LICENSE: LICENSE
@mkdir -p $(@D) @mkdir -p $(@D)
ln -f $< $@ ln -f $< $@
pack/tultemplate2/template/%: template/% $(BUNDLEDIR)/citations.bib: citations.bib
@mkdir -p $(@D)
ln -f $< $@
$(BUNDLEDIR)/bp.typ: theses/bp.typ
@mkdir -p $(@D)
awk 'BEGIN{RS=""; ORS="\n\n"} NR>2{print}' $< | sed 's/\.\.\/template\//template\//' > $@
$(BUNDLEDIR)/dp.typ: theses/dp.typ
@mkdir -p $(@D)
awk 'BEGIN{RS=""; ORS="\n\n"} NR>2{print}' $< | sed 's/\.\.\/template\//template\//' > $@
$(BUNDLEDIR)/Makefile: templategen.mk
@mkdir -p $(@D)
ln -f $< $@
$(PACKDIR)/template/LICENSE: LICENSE
@mkdir -p $(@D)
ln -f $< $@
$(BUNDLEDIR)/template/LICENSE: LICENSE
@mkdir -p $(@D)
ln -f $< $@
$(PACKDIR)/template/tul_citace.csl: template/tul_citace.csl
@mkdir -p $(@D)
cat $< | sed 's/^\s*\(.*\)$$/\1/' | tr -d '\n' > $@
$(BUNDLEDIR)/template/tul_citace.csl: template/tul_citace.csl
@mkdir -p $(@D)
cat $< | sed 's/^\s*\(.*\)$$/\1/' | tr -d '\n' > $@
$(PACKDIR)/template/lang.json: template/lang.json
@mkdir -p $(@D)
cat $< | jq -c > $@
$(BUNDLEDIR)/template/lang.json: template/lang.json
@mkdir -p $(@D)
cat $< | jq -c > $@
$(PACKDIR)/template/%: template/%
@mkdir -p $(@D)
ln -f $< $@
$(BUNDLEDIR)/template/%: template/%
@mkdir -p $(@D) @mkdir -p $(@D)
ln -f $< $@ ln -f $< $@
TEMPLATE_SRCS := $(shell find template -type f) TEMPLATE_SRCS := $(shell find template -type f)
%.pdf: %.typ $(TEMPLATE_SRCS) bp.pdf: theses/bp.typ
typst compile --font-path template/fonts --root . $< $@
dp.pdf: theses/dp.typ
typst compile --font-path template/fonts --root . $< $@
documentation.pdf: documentation.typ $(TEMPLATE_SRCS)
typst compile --font-path template/fonts $< typst compile --font-path template/fonts $<
include tests/make.mk

View File

@@ -6,6 +6,7 @@ Easy Typst template for TUL documents. Begin by compiling `example.typ` and read
It is recommended to use either: It is recommended to use either:
- The on-line Typst editor (https://typst.app/play/) - use some zip build from releases - The on-line Typst editor (https://typst.app/play/) - use some zip build from releases
(https://git.zumepro.cz/tul/tultemplate2/releases).
- The `typst` CLI tool (available in Arch repos and Snap) - The `typst` CLI tool (available in Arch repos and Snap)
On Linux, with the `typst` command available, you can just run: On Linux, with the `typst` command available, you can just run:
@@ -15,3 +16,10 @@ make
``` ```
That will compile the example document and view it. That will compile the example document and view it.
## Repo structure note
> [!IMPORTANT]
> This repo uses git lfs to pull fonts. Please set it up (or download a packed build from releases).
> When running in CLI - you'll want to include the embedded fonts:
> `typst compile --font-path template/fonts example.typ`

View File

@@ -1,9 +1,9 @@
#import "template/template.typ": * #import "template/template.typ": *
#show: tultemplate2.with( #show: tultemplate2.with(
"latex", "fm", "cs", title: (cs: "Návod na použití Typst TUL šablony"),
title: "Návod na použití Typst TUL šablony", author: "Ondřej Mekina, Matěj Žucha",
author: "Ondřej Mekina", supervisor: "Ondřej Mekina",
) )
= Lehký úvod do Typstu a této šablony = Lehký úvod do Typstu a této šablony
@@ -31,7 +31,6 @@ Pokud budete mít dotaz na fungování (vysvětlivky se snažím přidávat do t
návrh, nebo budete chtít nahlásit chybu, využijte jeden z následujících komunikačních kanálů: návrh, nebo budete chtít nahlásit chybu, využijte jeden z následujících komunikačních kanálů:
- Můj e-mail: #link("mailto:ondrej@mekina.cz", "ondrej@mekina.cz") - Můj e-mail: #link("mailto:ondrej@mekina.cz", "ondrej@mekina.cz")
- Issues na gitu šablony: https://git.zumepro.cz/tul/tultemplate2 - Issues na gitu šablony: https://git.zumepro.cz/tul/tultemplate2
- E-maily dalších maintainerů: #todo("přidat e-maily")
= První krůčky, aneb jak rozchodit šablonu = První krůčky, aneb jak rozchodit šablonu
@@ -72,7 +71,7 @@ ale i dodatečné funkce pro jednodušší práci se šablonou -- k těm se dost
Dále je potřeba funkci zavolat jako šablonu, abychom pod mohli psát obsah. Dále je potřeba funkci zavolat jako šablonu, abychom pod mohli psát obsah.
```typst ```typst
#show: tultemplate.with(<vzhled_sablony>, <fakulta>, <jazyk>) #show: tultemplate
``` ```
A to je vše. Absolutní minimum pro rozchození šablony. Nebojte se, pokud neznáte názvy A to je vše. Absolutní minimum pro rozchození šablony. Nebojte se, pokud neznáte názvy
vzhledů šablony, zkratku fakulty, nebo zkratku pro jazyk. Šablona vás navede pomocí chybových vzhledů šablony, zkratku fakulty, nebo zkratku pro jazyk. Šablona vás navede pomocí chybových
@@ -83,7 +82,7 @@ hlášek (nebo se můžete podívat do zdrojového souboru pro toto PDF `example
Nyní pojďme přidat nějaký obsah na titulní stránku. Jednoduše do volání šablony přidáme další Nyní pojďme přidat nějaký obsah na titulní stránku. Jednoduše do volání šablony přidáme další
parametry. parametry.
```typst ```typst
#show: tultemplate.with(..., title: "Můj úžasný dokument", author: "Já") #show: tultemplate.with(..., title: (cs: "Můj úžasný dokument"), author: "Já")
``` ```
Všechny možné parametry by vám měl našeptávat váš editor (nebo LSP) -- poslouchejte takové nápovědy, Všechny možné parametry by vám měl našeptávat váš editor (nebo LSP) -- poslouchejte takové nápovědy,
opravdu hodně vám to usnadní práci. opravdu hodně vám to usnadní práci.
@@ -92,7 +91,7 @@ opravdu hodně vám to usnadní práci.
// tohle je podnadpis :) // tohle je podnadpis :)
#heading( #heading(
level: 3, level: 2,
range(1, 6).map((v) => range(1, v).map((_) => "pod").join("") + "nadpisy").join(", ") + ", ..." range(1, 6).map((v) => range(1, v).map((_) => "pod").join("") + "nadpisy").join(", ") + ", ..."
)<chained_subheading> )<chained_subheading>
@@ -106,6 +105,10 @@ Velmi jednoduché. Stačí na začátek řádku dát znak `=` kolikrát chcete.
A pak obsah A pak obsah
``` ```
#highlight[
V rámci šablony classic lze použít nadpisy *maximálně* třetí úrovně -- jinak šablona vyhodí chybu.
]
== Zvýrazňování textu == Zvýrazňování textu
Syntaxe je velmi podobná například markdownu. Stačí: Syntaxe je velmi podobná například markdownu. Stačí:
@@ -169,8 +172,7 @@ A některé funkce berou klasický obsah -- v těch je možné psát obsah jako
== Obrázky == Obrázky
Obrázky je možné vkládat samotné i třeba s popiskem. Obrázky je možné vkládat samotné i třeba s popiskem.
Obrázek se vloží pomocí funkce `image`.
Obrázek se vloží pomocí funkce `image`:
Přidání popisku a zároveň zalistování obrázku v indexu (aby se na třeba dalo odkazovat) lze Přidání popisku a zároveň zalistování obrázku v indexu (aby se na třeba dalo odkazovat) lze
udělat pomocí funkce `figure`. udělat pomocí funkce `figure`.
@@ -192,6 +194,34 @@ Tady je praktická ukázka jednoduchého vložení obrázku s popiskem:
Logo *TUL* Logo *TUL*
]) ])
Obrázky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje).
== Tabulky
Tabulky lze vytvářet takto:
```typst
#figure(table(
columns: 3,
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
[*Řádek 1*], [a], [b],
[*Řádek 2*], [c], [d],
), caption: "Moje krásná tabulka")
```
#highlight[Hlavičku tabulky (první řádek) je dobré zabalit do funkce header (viz. výše)], to je
kvůli tomu, že Typst do vygenerovaného PDF souboru poté přidá metadata (například pro osoby se
zrakovým postižením).
#figure(table(
columns: 3,
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
[*Řádek 1*], [a], [b],
[*Řádek 2*], [c], [d],
), caption: "Moje krásná tabulka")
Tabulky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje).
== Citace == Citace
Šablona podporuje správu citací pomocí standardního BibTeX @bibtex souboru, stejně jako Šablona podporuje správu citací pomocí standardního BibTeX @bibtex souboru, stejně jako
@@ -246,6 +276,167 @@ Tyto pokročilejší funkce v drtivé většině dokumentů vůbec není potřeb
ty, kteří to chtějí vyzkoušet, nebo to opravdu potřebují: podívejte se buď do zdrojového kódu ty, kteří to chtějí vyzkoušet, nebo to opravdu potřebují: podívejte se buď do zdrojového kódu
této šablony nebo na dokumentaci Typstu https://typst.app/docs/. této šablony nebo na dokumentaci Typstu https://typst.app/docs/.
= Pracujeme se šablonou
V předchozí kapitole jsme se dozvěděli, jak pracovat s Typstem. Šablona je navržena tak, aby
co nejvíce využívala základních funkcí Typstu -- například:
- Když uděláte nadpis -- zobrazí se v tabulce obsahu
- Když zvýrazníte text pomocí funkce `highlight` -- zvýraznění bude v barvách vaší fakulty
- Když přidáte citaci, zobrazí se v bibliografii na konci dokumentu
- Nadpis první úrovně bude na nové stránce
- ...
V této kapitole se naučíme vymaxovat využití této šablony za pomocí dalších funkcí a syntaxe.
#pagebreak(weak: true)
== Parametry této šablony
Šablonu standardně použijete takto:
```typst
#show: tultemplate2.with(
<název_parametru>: <hodnota_parametru>,
<nazev_dalšího_parametru>: "<hodnota_dalšího_parametru>",
...
)
```
Funkce `tultemplate2` přijímá následující parametry.
Zvýrazněné hodnoty jsou základní -- pokud vynecháte parametr, pak bude použita tato hodnota.
#line()
- `style` (vizuální styl dokumentu)
- *`"classic"`* - Klasický vizuální styl. Tento styl je neblíže klasické formální
podobě dokumentů. _(doporučeno pro nováčky této šablony)_
#line()
- `faculty` (zkratka fakulty)
- *`"tul"`* - barvy a logomarky univerzity
- `"fs"` - fakulta strojní
- `"ft"` - fakulta textilní
- `"fp"` - fakulta přírodovědně-humanitní a pedagogická
- `"ef"` - ekonomická fakulta
- `"fua"` - fakulta umění a architektury
- `"fm"` - fakulta mechatroniky, informatiky a mezioborových studií
- `"fzs"` - fakulta zdravotnických studií
- `"cxi"` - ústav pro nanomateriály, pokročilé technologie a inovace
#line()
- `lang` (základní jazyk dokumentu)
- *`"cs"`* - čeština
- `"en"`
#line()
- `document` (typ dokumentu)
- *`"other"`* - nespecifikovaný (neformální) typ dokumentu
- `bp` - Bakalářská práce
- `dp` - Diplomová práce
#line()
- `title` (nadpis dokumentu)
- Ve formátu `(<zkratka_jazyka>: "<nadpis>")`, například `(cs: "Můj nadpis")`
- Pro většinu dokumentů (kromě `other`) jsou vyžadovány verze _cs_ a _en_ (kvůli abstraktu).
#line()
- `author` (autor/autoři dokumentu)
- Příklad: `"Pavel Novák"` nebo `"Petra Velká, Jindřich Peterka"`
#line()
- `author_pronouns` (jazykový rod autora - není potřeba pro angličtinu, která základní hodnotu)
- Pro vybraný jazyk _cs_:
- `"masculine"` - Mužský rod
- `"feminine"` - Ženský rod
- `"we"` - Množné číslo
- Pro vybraný jazyk _en_:
- *`"me"`* - První osoba jednotného čísla
- `"we"` - První osoba množného čísla
#line()
- `supervisor` (vedoucí práce) <arg_supervisor>
- V podobě textového řetězce, příklad: `"prof. Jindřich Jindřich"`
- Ve formátu `(name: "<jméno>", institute: "<institut>")` (toto lze využít například při DP)
#line()
- `consultant` (konzultant práce)
- Stejně jako u #link(<arg_supervisor>, [`supervisor`])
#line()
- `programme` (studijní program) <arg_programme>
- Ve formátu `(<zkratka_jazyka>: "<název_programu>")`
- Je vyžadován jazyk, který je vybrán pro celou šablonu -- tohle je pojistka, aby uživatel šablony
nevynechal vybraný jazyk
#line()
- `specialization` (specializace)
- Stejně jako #link(<arg_programme>, [`programme`])
#line()
- `abstract` (abstrakt)
- Ve formátu `(<zkratka_jazyka>: [<abstrakt>])`, například `(cs: [Můj *krásný* abstrakt.])`
- Dokumenty vyžadují _cs_ i _en_ abstrakt (kromě typu dokumentu `other`).
#line()
- `keywords` (klíčová slova zobrazovaná pod abstraktem)
- Ve formátu `(<zkratka_jazyka>: ("slovo1", "slovo2", ...))`
#line()
- `assignment` (PDF soubor se zadáním)
- Ve formě cesty k souboru, například: `"zadani.pdf"`. Pokud je tento argument vynechán, bude
vložena hláška "vložte zadání" na příslušné místo v dokumentu -- tu stranu můžete pak nahradit
originálem zadání.
#line()
- `citations` (BibTex soubor s citacemi)
- Ve formě cesty k souboru, například: `"citace.bib"`. Pokud není specifikován, bude použit
výchozí (`"citations.bib"`).
#pagebreak(weak: true)
== Zkratky
LaTeX TUL šablona k začátku dokumentu seznam zkratek. Proto jsme ho přidali i do této šablony.
Seznam zkratek je v této šabloně nastaven tak, aby se zobrazoval pouze pokud je v něm alespoň jedna
zkratka (přišlo nám to poměrně logické).
Zkratku #abbr("ABC", "Abeceda") vytvoříte (definujete) pomocí:
```typst
#abbr("ABC", "Abeceda")
```
Potom zkratku #abbr("ABC") můžete použít přímo (bez opakované definice):
```typst
#abbr("ABC")
```
Šablona zajistí následující věci:
- Zkratka se zobrazí v seznamu zkratek
- Při prvním použití zkratky vás šablona donutí zkratku definovat
- Definice zkratky bude použita právě jednou (poprvé)
Při prvním použití zkratky (při definici) bude zkratka v textu vypadat takto:
#abbr("ZK", "Zkratka").
Při dalších použití bude vypadat takto: #abbr("ZK").
#highlight[
Tedy zkratku _nepřidáváte_ přímo do seznamu zkratek, ale elegantně používáte přímo v textu.
]
== Přílohy
V některých typech dokumentů budete chtít přidat přílohy. Přílohy se přikládají v různých podobách:
- Jako odkaz (URL/URI adresa)
- Zmínka externího souboru (například další soubor nahraný do systému)
- Přiložený obsah (vygenerovaný Typstem v tomto dokumentu -- je tedy součástí tohoto kódu)
- Externí PDF soubor přiložený jako obsah (jiný PDF dokument, vložený do příloh v kompletní
podobě -- to je dobré například do tisku, kde můžete přílohy vytisknout s dokumentem)
#highlight[
Přílohy lze definovat *pouze na jednom* místě v dokumentu, aby se zabránilo omylnému opakování
příloh. Přílohy doporučujeme definovat *na konci* souboru pro přehlednost.
]
Zde je ukázka definice příloh (je také použita na konci tohoto ukázkového souboru):
```typst
#attachments(
attach_link(
"Zdrojový kód této šablony",
"https://git.zumepro.cz/tul/tultemplate2"
),
attach_content(
"Testovací obsah vygenerovaný Typstem",
[Sem lze psát _stylovaný_ obsah.]
),
)
```
= Workflow a jak si zjednoduššit práci = Workflow a jak si zjednoduššit práci
Tyhle věci používat _nemusíte_, aby vám šablona fungovala. Nicméně často jsou poměrně fajn. Tyhle věci používat _nemusíte_, aby vám šablona fungovala. Nicméně často jsou poměrně fajn.
@@ -273,11 +464,11 @@ Pokud funkci `profile` nezavoláte, pak šablone použije profil "debug".
=== Todo === Todo
Pomocí todo svému budoucímu můžete připomenout, že je něco potřeba dodělat. Funkce todo obsah Pomocí `todo` svému budoucímu můžete připomenout, že je něco potřeba dodělat. Funkce todo obsah
zvýrazní, a v případě, že je zvolený profil "release", při kompilaci vyhodí error. To vám zvýrazní, a v případě, že je zvolený profil "release", při kompilaci vyhodí error. To vám
vlastně zabrání použít funkci todo v profilu "release". vlastně zabrání použít funkci todo v profilu "release".
Zvýraznění také můžete vypnout (ale pak se vám todo bude hůř hledat - budete muset hledat v kódu). Zvýraznění také můžete vypnout (ale pak se vám `todo` bude hůř hledat - budete muset hledat v kódu).
Zde je ukázkové použití: Zde je ukázkové použití:
#block([ #block([
@@ -308,3 +499,8 @@ Takhle si můžete předpřipravit délku odstavců a vyzkoušet si, jestli se r
do požadavků. Pak můžete postupně přepisovat/vyplňovat. do požadavků. Pak můžete postupně přepisovat/vyplňovat.
Funkce `todo` vám zároveň zabrání v tom, aby se text Lorem Ipsum vyskytl ve výsledném dokumentu. Funkce `todo` vám zároveň zabrání v tom, aby se text Lorem Ipsum vyskytl ve výsledném dokumentu.
#attachments(
attach_link("Zdrojový kód této šablony", "https://git.zumepro.cz/tul/tultemplate2"),
attach_content("Testovací obsah vygenerovaný Typstem", [Sem lze psát _stylovaný_ obsah.]),
)

171
template/attachments.typ Normal file
View File

@@ -0,0 +1,171 @@
#import "utils.typ": assert_type_signature, is_none
#import "lang.typ": get_lang_item
#let attachment_data = state("attachment_data");
#let attach_link(name, link) = {
assert_type_signature(link, "string", "attach link argument");
assert_type_signature(name, "string", "attach link name argument");
("link", link, name)
}
#let attach_content(name, inner_content) = {
assert_type_signature(inner_content, "content", "attach content argument");
assert_type_signature(name, "string", "attach content name argument");
("content", inner_content, name)
}
#let attach_pdf(name, filepath) = {
assert_type_signature(filepath, "string", "attach pdf argument");
assert_type_signature(name, "string", "attach pdf name argument");
("pdf", filepath, name)
}
#let attach_file_reference(name, filename) = {
assert_type_signature(filename, "string", "attach file reference filename argument");
assert_type_signature(name, "string", "attach file reference name argument");
("ref", filename, name)
}
#let make_content_anchor(idx) = {
"attachment_" + str(idx + 1)
}
#let generate_attachment_content(attachment, idx) = {
let attachment_type = attachment.at(0);
if attachment_type == "content" {
let anchor = make_content_anchor(idx);
[#metadata(attachment.at(1)) #label(anchor)];
}
}
#let generate_attachment_info(attachment, idx) = {
let attachment_type = attachment.at(0);
if type(attachment_type) != str {
panic("invalid attachment - wrap the attach using: attach_content, attach_pdf, ...");
}
if attachment_type == "content" {
let anchor = make_content_anchor(idx);
"(\"content\",\"" + anchor + "\",\"" + attachment.at(2) + "\")"
} else if attachment_type == "pdf" {
"(\"pdf\",\"" + attachment.at(1) + "\",\"" + attachment.at(2) + "\")"
} else if (
attachment_type == "pdf" or
attachment_type == "link" or
attachment_type == "ref"
) {
"(" + attachment.map((v) => { "\"" + v + "\"" }).join(",") + ",)"
} else {
panic("unknown attachment type '" + attachment_type + "'");
}
}
#let attachments(..attachments) = {
let attachments = attachments.pos();
assert_type_signature(
attachments, "array[array[string | content]] | array[string | content]", "attachments"
);
context {
if not is_none(attachment_data.get()) {
panic("re-definition of attachments - attachments must only be defined once");
}
if attachments.len() == 0 {
attachment_data.update("false");
} else {
attachment_data.update({
"(" + if type(attachments) == array and type(attachments.at(0)) == array {
for (idx, attachment) in attachments.enumerate() {
(generate_attachment_info(attachment, idx),)
}.join(", ")
} else {
generate_attachment_info(attachments, 0)
} + ",)"
})
if type(attachments) == array and type(attachments.at(0)) == array {
for (idx, attachment) in attachments.enumerate() {
generate_attachment_content(attachment, idx);
}
} else {
generate_attachment_content(attachments, 0);
}
}
}
}
#let list_entry(language, entry, is_embedded) = {
let entry_type = entry.at(0);
entry.at(2);
if entry_type == "link" {
": ";
link(entry.at(1));
} else if entry_type == "ref" {
": soubor ";
raw(entry.at(1));
}
if is_embedded {
text(
" (" + get_lang_item(language, "attached_bellow") + ")",
style: "italic",
fill: black.lighten(50%),
);
}
}
#let attachment_list(language) = {
context {
let data = attachment_data.get();
if is_none(data) {
return;
}
let data = eval(data);
if data == false {
return;
}
heading(get_lang_item(language, "attachments"), numbering: none);
// listing
let has_embedded = false;
let enum_items = ();
for attachment in data {
let attachment_type = attachment.at(0);
let is_embedded = false;
if attachment_type == "content" or attachment_type == "pdf" {
has_embedded = true;
is_embedded = true;
}
enum_items.push(list_entry(language, attachment, is_embedded));
}
enum(..enum_items.map((v) => { enum.item(v) }), spacing: 1em);
if has_embedded {
pagebreak(weak: true);
}
// embedded
set page(footer: none);
for (idx, attachment) in data.enumerate() {
let attachment_type = attachment.at(0);
if attachment_type == "content" {
heading(
level: 2,
get_lang_item(language, "attachment") + " " + str(idx + 1),
numbering: none,
outlined: false,
);
query(label(attachment.at(1))).at(0).value;
} else if attachment_type == "pdf" {
import "@preview/muchpdf:0.1.1": muchpdf
page(place(center + horizon, heading(
level: 2,
get_lang_item(language, "attachment") + " " +
str(idx + 1) + " " +
get_lang_item(language, "next_page_attachment"),
numbering: none,
outlined: false,
)), margin: 0em);
set page(margin: 0em);
muchpdf(read("../" + attachment.at(1), encoding: none), width: 100%);
}
}
}
}

69
template/classic/bp.typ Normal file
View File

@@ -0,0 +1,69 @@
#import "../lang.typ": get_lang_item
#import "common.typ": (
mainpage,
default_styling,
assignment,
disclaimer,
abstract,
acknowledgement,
toc,
abbrlist,
imagelist,
tablelist,
bibliogr
)
#import "../attachments.typ": attachment_list
#import "../utils.typ": is_none, assert_dict_has, assert_not_none, assert_type_signature
#let bp(
// general settings
faculty_id, faculty_color, language, assignment_document, citation_file,
// document info
title, author, author_pronouns, supervisor, consultant, study_programme, study_specialization,
year_of_study, abstract_content, acknowledgement_content, keywords,
content
) = {
let force_langs = ("cs", "en");
assert_not_none(title, "title");
assert_dict_has(force_langs, title, "title");
assert_not_none(study_programme, "study programme");
assert_dict_has((language,), study_programme, "study programme");
assert_not_none(study_specialization, "study specialization");
assert_dict_has((language,), study_specialization, "study specialization");
assert_not_none(abstract_content, "abstract");
assert_dict_has(force_langs, abstract_content, "abstract");
if not is_none(keywords) {
assert_dict_has(force_langs, keywords, "keywords");
}
assert_not_none(acknowledgement_content, "acknowledgement content");
if language == "cs" {
assert_not_none(author_pronouns, "author gender");
}
assert_type_signature(supervisor, "string | none", "supervisor");
assert_type_signature(consultant, "string | none", "consultant");
mainpage(
faculty_id, language, "bp", title, author, supervisor, consultant, study_programme,
study_specialization, year_of_study,
);
assignment(language, assignment_document);
default_styling(false, faculty_color, {
disclaimer(language, faculty_id, "bp", author, author_pronouns);
abstract("cs", title, abstract_content, keywords);
abstract("en", title, abstract_content, keywords);
acknowledgement(language, author, acknowledgement_content);
toc(language);
tablelist(language);
imagelist(language);
abbrlist(language);
pagebreak(weak: true);
content;
bibliogr(language, citation_file);
attachment_list(language);
});
}

View File

@@ -0,0 +1,53 @@
// tools & utils
#import "../theme.typ": faculty_logotype, tul_logomark, faculty_color
#import "../lang.typ": lang_id, get_lang_item
#import "../utils.typ": assert_in_dict, assert_in_arr, map_none, assert_dict_has
// thesis types
#import "bp.typ": bp
#import "dp.typ": dp
#import "other.typ": other
#let template_classic(
// general settings
language, faculty_id, document_type, citation_file, assignment_document,
// document info
title, author, author_pronouns, supervisor, consultant, study_programme, study_specialization,
year_of_study, abstract, acknowledgement, keywords,
// content
content,
) = {
// argument pre-checking
let document_types = (
"bp": bp,
"dp": dp,
"other": other,
)
assert_in_dict(document_type, document_types, "document type");
map_none(title, (v) => assert_dict_has((language,), v, "title"));
map_none(study_programme, (v) => assert_dict_has((language,), v, "study programme"));
map_none(study_specialization, (v) => assert_dict_has((language,), v, "study specialization"));
map_none(acknowledgement, (v) => assert_dict_has((language,), v, "acknowledgement content"));
document_types.at(document_type)(
faculty_id,
faculty_color(faculty_id),
language,
map_none(assignment_document, (v) => "../../" + v),
map_none(citation_file, (v) => "../../" + v),
title,
author,
author_pronouns,
supervisor,
consultant,
study_programme,
study_specialization,
year_of_study,
abstract,
acknowledgement,
keywords,
content,
);
}

399
template/classic/common.typ Normal file
View File

@@ -0,0 +1,399 @@
#import "../theme.typ": faculty_logotype, tul_logomark, faculty_color
#import "../lang.typ": get_lang_item
#import "../utils.typ": is_none, assert_dict_has, map_none
#let base_font = "Inter";
#let mono_font = "Noto Sans Mono";
#let mono_font_compensation = 1.3em;
#let serif_font = "Merriweather";
#let tul_logomark_size = 6.5em;
// COUNTERS
#let image_count = counter("image_count");
#let table_count = counter("table_count");
// TYPST ELEMENT STYLING
#let default_styling(flip_bonding, faculty_color, content) = {
// page
set page(
margin: if flip_bonding {
(inside: 4cm, top: 3cm, bottom: 3cm)
} else {
(left: 4cm, top: 3cm, bottom: 3cm)
},
numbering: "1", footer: {
context {
let page = counter(page).get().at(0);
if flip_bonding {
align(str(page), if calc.rem(page, 2) == 1 { right } else { left });
} else {
align(str(page), right);
}
}
});
// text
set text(font: serif_font);
set par(justify: true, first-line-indent: 0.63cm);
// figures
let figure_numbering(realcount, c) = {
context realcount.step();
context numbering("1. 1", counter(heading).get().at(0), c)
};
show figure.where(kind: image): set figure(numbering: figure_numbering.with(image_count));
show figure.where(kind: table): set figure(numbering: figure_numbering.with(table_count));
show figure.where(kind: table): set figure.caption(position: top);
show figure: it => {
block(it, above: 2em, below: 2em);
}
set image(width: 80%);
// heading
set heading(numbering: "1.1.1 ");
show heading: it => {
set par(justify: false);
block(
above: 2em,
below: 2em,
text(it, faculty_color, font: "TUL Mono", size: 1.2em)
);
};
show heading.where(level: 1): it => {
// reset figure counters
context counter(figure.where(kind: image)).update(0);
context counter(figure.where(kind: table)).update(0);
pagebreak(weak: true);
v(2cm);
it
};
show heading.where(): it => {
if it.level > 3 {
panic("maximum allowed heading level is 3");
} else {
it
}
}
// other
show raw: set text(font: mono_font, size: mono_font_compensation);
show raw.where(block: true): it => {
block(it, fill: rgb("#eee"), inset: 1em)
};
show link: it => {
if type(it.dest) == label or type(it.dest) == location {
it;
} else {
text(it, fill: faculty_color);
}
}
set highlight(fill: faculty_color.lighten(90%));
set line(stroke: (paint: faculty_color, thickness: .7pt), length: 100%);
content
}
#let header(faculty_id, language) = {
let logotype = faculty_logotype(faculty_id, language);
grid(
block(logotype, width: 100%),
block(align(right, block(tul_logomark(faculty_id), height: tul_logomark_size))),
columns: 2
);
}
// DOCUMENT INFO
#let person_info(record, item_name) = {
if is_none(record) {
none
} else if type(record) == str {
record
} else if type(record) == dictionary {
if "name" in record {
record.at("name");
if "institute" in record {
text("\n " + record.at("institute"), style: "italic")
}
} else {
let panic_message = (
item_name + " name is required (or try not specifying " + item_name + " at all)"
);
panic(panic_message);
}
} else {
let panic_message = "invalid " + item_name + " - expected a string or a dictionary";
panic(panic_message);
}
}
#let info(
faculty_id,
language,
document_type,
title, author, supervisor, consultant, study_programme, study_specialization, year_of_study,
) = {
let info_name_value_padding = 5em;
let info_name_min_width = 10em;
let gutter = .7em;
// document type
if type(document_type) != type(none) {
text(get_lang_item(language, document_type), weight: "bold", font: base_font);
v(0em);
}
// title
text(
title, weight: "bold", size: 2em,
faculty_color(faculty_id), font: base_font,
);
v(0em);
// other info
// [field_name, field_value, bold]
let info_fields = (
("author", author, true),
("supervisor", person_info(supervisor, "supervisor"), false),
("consultant", person_info(consultant, "consultant"), false),
("study_programme", study_programme, false),
("study_specialization", study_specialization, false),
("year_of_study", map_none(year_of_study, (v) => str(v) + "."), false),
)
context {
let max_field_name_width = calc.max(..info_fields.map((v) => {
if type(v.at(1)) == type(none) {
0pt
} else {
measure(get_lang_item(language, v.at(0)) + ":").width
}
}), info_name_min_width.to-absolute());
grid(
columns: 2,
gutter: gutter,
..info_fields.filter((v) => { type(v.at(1)) != type(none) }).map((v) => {
(
align(top, block(
text(get_lang_item(language, v.at(0)) + ":", style: "italic", font: base_font),
width: max_field_name_width + info_name_value_padding
)),
text(v.at(1), font: base_font, weight: if v.at(2) { "bold" } else { "regular" })
)
}).flatten(),
);
v(1em);
h(max_field_name_width + info_name_value_padding + gutter);
text(get_lang_item(language, "city") + " " + str(datetime.today().year()), font: base_font);
}
}
// MAINPAGE
#let mainpage(
faculty_id,
language,
document_type,
title, author, supervisor, consultant, study_programme, study_specialization, year_of_study,
) = {
import "../utils.typ": has_all_none, map_none
let nonetype = type(none);
page({
if has_all_none((
document_type, title, author, supervisor, consultant, study_programme,
)) {
place(center + horizon, align(left, faculty_logotype(faculty_id, language)));
} else {
header(faculty_id, language);
align({
info(
faculty_id, language, document_type, map_none(title, (v) => v.at(language)),
author, supervisor, consultant, map_none(study_programme, (v) => v.at(language)),
map_none(study_specialization, (v) => v.at(language)), year_of_study,
);
v(5em);
}, bottom);
}
}, margin: 2cm);
}
// ASSIGNMENT PAGE
#let assignment(language, document) = {
if type(document) == type(none) {
page(
place(center + horizon, text(
get_lang_item(language, "place_assignment"),
fill: red,
size: 3em,
font: base_font,
weight: "bold",
)),
margin: 0em,
footer: none,
);
return;
}
import "@preview/muchpdf:0.1.1": muchpdf
set page(margin: 0em);
muchpdf(read(document, encoding: none));
}
// DISCLAIMER PAGE
#let disclaimer(language, faculty_id, disclaimer_type, author, author_pronouns) = {
import "../lang.typ": disclaimer
heading(get_lang_item(language, "disclaimer"), numbering: none, outlined: false);
par(
text(disclaimer(language, disclaimer_type, author_pronouns))
);
v(5em);
grid(
columns: 2,
gutter: 1em,
block(
text(datetime.today().display(get_lang_item(language, "date")), lang: "cs"), width: 100%
),
text(author),
);
}
// ACKNOWLEDGEMENT PAGE
#let acknowledgement(language, author, content) = {
if is_none(content) {
return;
}
heading(get_lang_item(language, "acknowledgement"), numbering: none, outlined: false);
par(content.at(language));
v(2em);
align(right, author);
}
// ABSTRACT
#let abstract(language, title, content, keywords) = {
heading(text(title.at(language), font: base_font), numbering: none, outlined: false);
v(2em);
heading(
level: 2,
get_lang_item(language, "abstract"),
numbering: none,
outlined: false,
);
text(content.at(language));
if not is_none(keywords) and type(keywords.at(language)) != type(none) {
linebreak();
linebreak();
text(get_lang_item(language, "keywords") + ": ", weight: "bold", font: base_font);
text(keywords.at(language).join(", "));
}
}
// _ OUTLINE FIGURE INNER
#let _outline_figure_inner(selector, title, body_mapper) = {
let entry(selector, element) = {
link(
element.location(),
grid(
columns: 3,
gutter: .5em,
stack(
dir: ltr,
text(numbering(
"1.1",
counter(heading).at(element.location()).at(0),
counter(selector).at(element.location()).at(0),
)),
h(.5em),
text(body_mapper(element)),
),
box(repeat([.], gap: 0.15em)),
str(element.location().page()),
),
)
}
heading(title, numbering: none);
for el in query(figure.where(kind: selector)) {
if is_none(el.caption) {
continue;
}
entry(figure.where(kind: selector), el);
}
}
// _ FIGURE OUTLINE
#let _figure_outline(realcount, target, title) = {
context {
if realcount.final().at(0) == 0 {
return;
}
_outline_figure_inner(target, title, (it) => it.caption.body);
}
}
// IMAGE LIST
#let imagelist(language) = {
_figure_outline(image_count, image, get_lang_item(language, "image_list"));
}
// TABLE LIST
#let tablelist(language) = {
_figure_outline(table_count, table, get_lang_item(language, "table_list"));
}
// ABBREVIATION LIST
#let abbrlist(language) = {
import "../abbreviations.typ": abbrlist
context {
let abbrs = abbrlist();
let max_abbr_width = if abbrs.len() > 0 {
calc.max(abbrs.keys().map((v) => measure(v).width)).at(0)
} else { return };
pagebreak(weak: true);
heading(get_lang_item(language, "abbrs"), numbering: none);
align(center, grid(
columns: 2,
gutter: 1em,
..abbrs.pairs().map((a) => {
(
align(left, block(text(a.at(0), weight: "bold"), width: max_abbr_width + 1em)),
text(a.at(1))
)
}).flatten()
));
}
}
// TABLE OF CONTENTS
#let toc(language) = {
show outline.entry.where(level: 1): it => {
show repeat: none;
block(text(it, weight: "bold", size: 1.2em), above: 1.5em);
};
outline(title: get_lang_item(language, "toc"));
}
// BIBLIOGRAPHY
#let bibliogr(language, citations_file) = {
if language == "cs" {
bibliography(
citations_file, style: "../tul_citace.csl", title: get_lang_item(language, "bibliography"),
);
} else if language == "en" {
bibliography(
citations_file, style: "iso-690-numeric", title: get_lang_item(language, "bibliography"),
);
} else {
panic("unknown language for bibliography '" + language + "'");
}
}

68
template/classic/dp.typ Normal file
View File

@@ -0,0 +1,68 @@
#import "../lang.typ": get_lang_item
#import "common.typ": (
mainpage,
default_styling,
assignment,
disclaimer,
abstract,
acknowledgement,
toc,
abbrlist,
imagelist,
tablelist,
bibliogr
)
#import "../attachments.typ": attachment_list
#import "../utils.typ": is_none, assert_dict_has, assert_not_none, assert_type_signature, map_none
#let dp(
// general settings
faculty_id, faculty_color, language, assignment_document, citation_file,
// document info
title, author, author_pronouns, supervisor, consultant, study_programme, study_specialization,
year_of_study, abstract_content, acknowledgement_content, keywords,
content
) = {
let force_langs = ("cs", "en");
assert_not_none(title, "title");
assert_dict_has(force_langs, title, "title");
assert_not_none(study_programme, "study programme");
assert_dict_has((language,), study_programme, "study programme");
map_none(study_specialization, (v) => assert_dict_has((language,), v, "study specialization"));
assert_not_none(abstract_content, "abstract");
assert_dict_has(force_langs, abstract_content, "abstract");
if not is_none(keywords) {
assert_dict_has(force_langs, keywords, "keywords");
}
assert_not_none(acknowledgement_content, "acknowledgement content");
if language == "cs" {
assert_not_none(author_pronouns, "author gender");
}
assert_type_signature(supervisor, "string | none", "supervisor");
assert_type_signature(consultant, "string | none", "consultant");
mainpage(
faculty_id, language, "dp", title, author, supervisor, consultant, study_programme,
study_specialization, year_of_study,
);
assignment(language, assignment_document);
default_styling(false, faculty_color, {
disclaimer(language, faculty_id, "dp", author, author_pronouns);
abstract("cs", title, abstract_content, keywords);
abstract("en", title, abstract_content, keywords);
acknowledgement(language, author, acknowledgement_content);
toc(language);
tablelist(language);
imagelist(language);
abbrlist(language);
pagebreak(weak: true);
content;
bibliogr(language, citation_file);
attachment_list(language);
});
}

View File

@@ -0,0 +1,44 @@
#import "../lang.typ": get_lang_item
#import "common.typ": (
mainpage,
default_styling,
assignment,
disclaimer,
abstract,
toc,
abbrlist,
imagelist,
tablelist,
bibliogr,
)
#import "../attachments.typ": attachment_list
#import "../utils.typ": is_none, assert_not_none, assert_dict_has, assert_in_arr
#let other(
// general settings
faculty_id, faculty_color, language, assignment_document, citation_file,
// document info
title, author, _, supervisor, consultant, study_programme, study_specialization, year_of_study,
abstract_content, _, keywords,
content
) = {
assert_not_none(title, "title");
assert_dict_has((language,), title, "title");
mainpage(
faculty_id, language, none, title, author, supervisor, consultant, study_programme,
study_specialization, year_of_study,
);
default_styling(true, faculty_color, {
toc(language);
tablelist(language);
imagelist(language);
abbrlist(language);
pagebreak(to: "even", weak: true);
content;
bibliogr(language, citation_file);
attachment_list(language);
});
}

Binary file not shown.

View File

@@ -1,93 +1,93 @@
Copyright 2018 The Cabin Project Authors (https://github.com/impallari/Cabin.git) Copyright 2018 The Cabin Project Authors (https://github.com/impallari/Cabin.git)
This Font Software is licensed under the SIL Open Font License, Version 1.1. This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org https://openfontlicense.org
----------------------------------------------------------- -----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
----------------------------------------------------------- -----------------------------------------------------------
PREAMBLE PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership open framework in which fonts may be shared and improved in partnership
with others. with others.
The OFL allows the licensed fonts to be used, studied, modified and The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded, fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives, names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives. to any document created using the fonts or their derivatives.
DEFINITIONS DEFINITIONS
"Font Software" refers to the set of files released by the Copyright "Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation. include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the "Reserved Font Name" refers to any names specified as such after the
copyright statement(s). copyright statement(s).
"Original Version" refers to the collection of Font Software components as "Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s). distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, "Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a Original Version, by changing formats or by porting the Font Software to a
new environment. new environment.
"Author" refers to any designer, engineer, programmer, technical "Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software. writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify, a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions: Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, 1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself. in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, 2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user. binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font 3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as Copyright Holder. This restriction only applies to the primary font name as
presented to the users. presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written Copyright Holder(s) and the Author(s) or with their explicit written
permission. permission.
5) The Font Software, modified or unmodified, in part or in whole, 5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created remain under this license does not apply to any document created
using the Font Software. using the Font Software.
TERMINATION TERMINATION
This license becomes null and void if any of the above conditions are This license becomes null and void if any of the above conditions are
not met. not met.
DISCLAIMER DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE. OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
template/fonts/inter/Inter-Black.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-BlackItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-Bold.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-BoldItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-ExtraBold.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-ExtraBoldItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-ExtraLight.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-ExtraLightItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-Italic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-Light.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-LightItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-Medium.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-MediumItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-Regular.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-SemiBold.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-SemiBoldItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-Thin.otf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/inter/Inter-ThinItalic.otf (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,93 @@
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
template/fonts/merriweather/Merriweather-Bold.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/merriweather/Merriweather-BoldIt.ttf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
template/fonts/merriweather/Merriweather-Italic.ttf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
template/fonts/merriweather/Merriweather-Light.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/merriweather/Merriweather-LightIt.ttf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
template/fonts/merriweather/Merriweather-Regular.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/merriweather/Merriweather-UltraBdIt.ttf (Stored with Git LFS) Executable file

Binary file not shown.

BIN
template/fonts/merriweather/Merriweather-UltraBold.ttf (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,48 @@
Copyright (c) 2010, 2011 by Eben Sorkin (eben@eyebytes.com),
with Reserved Font Name "Merriweather".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
template/fonts/noto_sans_mono/NotoSansMono-Black.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-Bold.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-ExtraBold.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-ExtraLight.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-Light.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-Medium.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-Regular.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-SemiBold.ttf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
template/fonts/noto_sans_mono/NotoSansMono-Thin.ttf (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,93 @@
Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

115
template/lang.json Normal file
View File

@@ -0,0 +1,115 @@
{
"cs": {
"author": "Autor",
"authors": "Autoři",
"supervisor": "Vedoucí práce",
"consultant": "Konzultant práce",
"study_programme": "Studijní program",
"study_specialization": "Specializace",
"year_of_study": "Ročník",
"bp": "Bakalářská práce",
"dp": "Diplomová práce",
"city": "Liberec",
"toc": "Obsah",
"bibliography": "Použitá literatura",
"disclaimer": "Prohlášení",
"disclaimer_content": "Prohlašuj{g:i|i|eme}, že {svůj} {práce:tu} js{g:em|em|me} vypracoval{g:|a|i} samostatně jako původní dílo s použitím uvedené literatury a na základě konzultací s vedoucím {{g:mé|mé|naší}} bakalářské práce a konzultantem.\n\nJs{g:em|em|me} si vědom{g:|a|i} toho, že na {{g:moji|moji|naši}} {práce:tu} se plně vztahuje zákon č. 121/2000 Sb., o právu autorském, zejména § 60 školní dílo.\n\nBer{g:u|u|eme} na vědomí, že Technická univerzita v Liberci nezasahuje do {g:mých|mých|našich} autorských práv užitím {{g:mé|mé|naší}} {práce:té} pro vnitřní potřebu Technické univerzity v Liberci.\n\nUžij{g:i|i|eme}-li {práce:tu} nebo poskytn{g:u|u|eme}-li licenci k {jejímu} využití, js{g:em|em|me} si vědom{g:|a|i} povinnosti informovat o této skutečnosti Technickou univerzitu v Liberci; v tomto případě má Technická univerzita v Liberci právo od{g:e|e|} {g:mne|mne|nás} požadovat úhradu nákladů, které vynaložila na vytvoření díla, až do jejich skutečné výše.\n\nSoučasně čestně prohlašuj{g:i|i|eme}, že text elektronické podoby práce vložený do IS/STAG se shoduje s textem tištěné podoby práce.\n\nBer{g:u|u|eme} na vědomí, že {{g:můj|můj|naše}} {práce:ta} bude {zveřejněn} Technickou univerzitou v Liberci v souladu s § 47b zákona č. 111/1998 Sb., o vysokých školách a o změně a doplnění dalších zákonů (zákon o vysokých školách), ve znění pozdějších předpisů.\n\nJs{g:em|em|me} si vědom{g:|a|i} následků, které podle zákona o vysokých školách mohou vyplývat z porušení tohoto prohlášení.",
"disclaimer_replace": {
"bp": {
"práce:ta": "bakalářská práce",
"práce:tu": "bakalářskou práci",
"práce:té": "bakalářské práce",
"moji": "moji",
"naše": "naše",
"naši": "naši",
"naší": "naší",
"mé": "mé",
"můj": "moje",
"svůj": "svoji",
"jejímu": "jejímu",
"zveřejněn": "zveřejněna"
},
"dp": {
"práce:ta": "diplomová práce",
"práce:tu": "diplomovou práci",
"práce:té": "diplomové práce",
"moji": "moji",
"naše": "naše",
"naši": "naši",
"naší": "naší",
"mé": "mé",
"můj": "moje",
"svůj": "svoji",
"jejímu": "jejímu",
"zveřejněn": "zveřejněna"
}
},
"date": "[day]. [month]. [year]",
"abstract": "Abstrakt",
"acknowledgement": "Poděkování",
"keywords": "Klíčová slova",
"abbrs": "Seznam zkratek",
"image_list": "Seznam obrázků",
"table_list": "Seznam tabulek",
"attachments": "Přílohy",
"attachment": "Příloha",
"next_page_attachment": "začíná na další straně",
"attached_bellow": "dále přiloženo",
"place_assignment": "Sem vložte zadání"
},
"en": {
"author": "Author",
"authors": "Authors",
"supervisor": "Supervisor",
"consultant": "Consultant",
"study_programme": "Study programme",
"study_specialization": "Specialization",
"year_of_study": "Year of study",
"bp": "Bachelor thesis",
"dp": "Diploma thesis",
"city": "Liberec",
"toc": "Contents",
"bibliography": "Bibliography",
"disclaimer": "Declaration",
"disclaimer_content": "{g:I|We} hereby certify, {g:I|we}, {g:myself|ourselves}, have written {g:my|our} {thesis} as an original and primary work using the literature listed below and consulting it with {g:my|our} thesis supervisor and {g:my|our} thesis counsellor.\n\n{g:I|We} acknowledge that {g:my|our} {thesis} is fully governed by Act No. 121/2000 Coll., the Copyright Act, in particular Article 60 School Work.\n\n{g:I|We} acknowledge that the Technical University of Liberec does not infringe {g:my|our} copyrights by using {g:my|our} {thesis} for internal purposes of the Technical University of Liberec.\n\n{g:I|We} {g:am|are} aware of {g:my|our} obligation to inform the Technical University of Liberec on having used or granted license to use the results of {g:my|our} {thesis}; in such a case the Technical University of Liberec may require reimbursement of the costs incurred for creating the result up to their actual amount.\n\nAt the same time, {g:I|we} honestly declare that the text of the printed version of {g:my|our} {thesis} is identical with the text of the electronic version uploaded into the IS STAG.\n\n{g:I|We} acknowledge that the Technical University of Liberec will make {g:my|our} {thesis} public in accordance with paragraph 47b of Act No. 111/1998 Coll., on Higher Education Institutions and on Amendment to Other Acts (the Higher Education Act), as amended.\n\n{g:I|We} {g:am|are} aware of the consequences which may under the Higher Education Act result from a breach of this declaration.",
"disclaimer_replace": {
"bp": {
"thesis": "bachelor thesis"
},
"dp": {
"thesis": "diploma thesis"
}
},
"date": "[year]-[month]-[day]",
"abstract": "Abstract",
"acknowledgement": "Acknowledgement",
"keywords": "Keywords",
"abbrs": "List of abbreviations",
"image_list": "List of images",
"table_list": "List of tables",
"attachments": "Attachments",
"attachment": "Attachment",
"next_page_attachment": "begins on the next page",
"attached_bellow": "attached bellow",
"place_assignment": "Insert your assignment here"
}
}

View File

@@ -1,4 +1,4 @@
#import "utils.typ": assert_in_dict #import "utils.typ": assert_in_dict, assert_in_arr, map_none, ok_or
#let lang_ids = ( #let lang_ids = (
cs: 0, cs: 0,
@@ -9,3 +9,55 @@
assert_in_dict(lang_abbr, lang_ids, "language abbreviation"); assert_in_dict(lang_abbr, lang_ids, "language abbreviation");
return lang_ids.at(lang_abbr); return lang_ids.at(lang_abbr);
}; };
// Typst will usually cache this - so we don't have to re-read the file each time
#let fetch_lang_items() = {
return json("lang.json");
}
#let get_lang_item(lang_abbr, item_name) = {
assert_in_dict(lang_abbr, lang_ids, "language abbreviation");
let lang_items = fetch_lang_items();
return lang_items.at(lang_abbr).at(item_name);
}
#let replace_czech_gender(raw, gender) = {
let genders = (
feminine: 1,
masculine: 0,
we: 2,
);
assert_in_dict(gender, genders, "author gender");
raw.replace(regex("\{g:([^|]*)\|([^|]*)\|([^}]*)\}"), (match) => {
match.captures.at(genders.at(gender))
});
}
#let replace_english_pronounce(raw, pronounce) = {
let pronounce = ok_or(pronounce, "me");
let pronouns = (
me: 0,
we: 1,
);
assert_in_dict(pronounce, pronouns, "author gender");
raw.replace(regex("\{g:([^|]*)\|([^}]*)\}"), (match) => {
match.captures.at(pronouns.at(pronounce))
});
}
#let disclaimer(language, document_type, author_pronouns) = {
let disclaimer = get_lang_item(language, "disclaimer_content");
let replacements = get_lang_item(language, "disclaimer_replace").at(document_type);
if language == "cs" {
disclaimer = replace_czech_gender(disclaimer, author_pronouns);
} else if language == "en" {
disclaimer = replace_english_pronounce(disclaimer, author_pronouns);
}
for (key, value) in replacements.pairs() {
disclaimer = disclaimer.replace("{" + key + "}", value);
}
if disclaimer.contains("{") or disclaimer.contains("}") {
panic("invalid language file");
}
disclaimer
}

View File

@@ -7,6 +7,9 @@
// Git: https://git.zumepro.cz/tul/tultemplate2 // Git: https://git.zumepro.cz/tul/tultemplate2
#import "prototyping.typ": todo, profile #import "prototyping.typ": todo, profile
#import "attachments.typ": (
attachments, attach_content, attach_pdf, attach_link, attach_file_reference
)
// TUL Template 2 // TUL Template 2
// //
@@ -19,43 +22,89 @@
// ) // )
// ``` // ```
// //
// - style (str): Visual style to use. This can be "latex". // - style (str): Visual style to use. This can be "classic".
// - faculty (str): Factulty abbreviation. One of "fs", "ft", "fp", "ef", "fua", "fm", "fzs", "cxi". // - faculty (str): Factulty abbreviation. One of "fs", "ft", "fp", "ef", "fua", "fm", "fzs", "cxi".
// - lang (str): Language code. This can be "cs" or "en". // - lang (str): Language code. This can be "cs" or "en".
// - document (str): Type of document. This can be "bp", "dp", "ds". // - document (str): Type of document. This can be "bp" or "other".
// - title (str): The title of the document. // - title (dictionary): The title of the document.
// - author (str): The name of the document's author. // - author (str): The name of the document's author.
// - author_pronouns (str): The gender of the document's author. Needed only for the `cs` language.
// - supervisor (str): The name of the document's supervisor. // - supervisor (str): The name of the document's supervisor.
// - programme (str): Study programme. // - consultant (str): The name of the document's consultant.
// - programme (dictionary): Study programme.
// - specialization (disctionary): Study specialization
// - abstract (dictionary): The abstract.
// - keywords (dictionary): The abstract keywords.
// - assignment (str): Filepath of the assignment document/page.
// - citations (str): The location of the citation file. // - citations (str): The location of the citation file.
// - content (content): The content of the document // - content (content): The content of the document
// //
//-> none //-> none
#let tultemplate2( #let tultemplate2(
style, // general settings
faculty, style: "classic", faculty: "tul", lang: "cs", document: "other",
lang,
document: none, // document info
title: none, author: none, supervisor: none, programme: none, title: none, keywords: none, abstract: none, acknowledgement: none, author: none,
citations: "citations.bib", author_pronouns: none, supervisor: none, consultant: none, programme: none,
specialization: none, year_of_study: none,
// links
assignment: none, citations: "citations.bib",
// content
content, content,
) = { ) = {
import "template_classic.typ": template_classic import "utils.typ": assert_in_dict, assert_type_signature
import "utils.typ": assert_in_dict
// argument checking
assert_type_signature(style, "string", "visual style argument");
assert_type_signature(faculty, "string", "faculty id argument");
assert_type_signature(lang, "string", "language abbreviation argument");
assert_type_signature(document, "string | none", "document kind argument");
assert_type_signature(title, "dictionary[string : string] | none", "title argument");
assert_type_signature(keywords, "dictionary[string : array[string]] | none", "keywords argument");
assert_type_signature(
abstract, "dictionary[string : string | content] | none", "abstract argument"
);
assert_type_signature(
acknowledgement, "dictionary[string : string] | none", "acknowledgement content"
);
assert_type_signature(author, "string | none", "author argument");
assert_type_signature(author_pronouns, "string | none", "author gender argument");
assert_type_signature(
supervisor, "string | dictionary[string : string] | none", "supervisor argument"
);
assert_type_signature(
consultant, "string | dictionary[string : string] | none", "consultant argument"
);
assert_type_signature(
programme, "dictionary[string : string] | none", "study programme argument"
);
assert_type_signature(
specialization, "dictionary[string : string] | none", "study specialization argument"
);
assert_type_signature(year_of_study, "integer | none", "year of study");
assert_type_signature(assignment, "string | none", "assignment document argument");
assert_type_signature(citations, "string", "citations file argument");
// templates
import "classic/classic.typ": template_classic
let templates = ( let templates = (
latex: template_classic, classic: template_classic,
); );
assert_in_dict(style, templates, "template name"); assert_in_dict(style, templates, "template name");
// global set-up // language set-up
import "lang.typ": lang_ids import "lang.typ": lang_ids
assert_in_dict(lang, lang_ids, "language abbreviation"); assert_in_dict(lang, lang_ids, "language abbreviation");
set text(lang: lang); set text(lang: lang);
// template call
templates.at(style)( templates.at(style)(
faculty, lang, document, lang, faculty, document, citations, assignment,
title, author, supervisor, programme, title, author, author_pronouns, supervisor, consultant,
"../" + citations, programme, specialization, year_of_study, abstract, acknowledgement, keywords, content
content
); );
import "prototyping.typ": assert_release_ready import "prototyping.typ": assert_release_ready

View File

@@ -1,155 +0,0 @@
#import "theme.typ": faculty_logotype, tul_logomark, faculty_color
#import "lang.typ": lang_id
#import "utils.typ": assert_in_dict
#let base_font = "Cabin";
#let classic_header(faculty_id, language) = {
let logotype = faculty_logotype(faculty_id, language);
grid(
logotype,
block(align(right, block(tul_logomark(faculty_id), height: 5em)), width: 100%),
columns: 2
);
}
#let classic_info(
faculty_id,
language,
document_type,
title, author, supervisor, study_programme,
) = {
let lang_id = lang_id(language);
// document type
if type(document_type) != type(none) {
let document_types = (
bp: ("Bakalářská práce", "Bachelor thesis"),
dp: ("Diplomová práce", "Diploma thesis"),
ds: ("Disertační práce", "Dissertation thesis"),
);
assert_in_dict(document_type, document_types, "document type abbreviation");
text(document_types.at(document_type).at(lang_id), weight: "bold", font: base_font);
v(0em);
}
// title
text(
title, weight: "bold", size: 2em,
faculty_color(faculty_id), font: base_font,
);
v(0em);
// other info
// [field_name, field_value, bold]
let info_fields = (
(("Studijní program", "Study programme"), study_programme, false),
(("Autor", "Author"), author, true),
(("Vedoucí práce", "Supervisor"), supervisor, false),
);
context {
let max_field_name_width = calc.max(..info_fields.map((v) => {
if type(v.at(1)) == type(none) {
0pt
} else {
measure(v.at(0).at(lang_id) + ":").width
}
}));
grid(
columns: 2,
rows: (auto, 1.2em),
..info_fields.filter((v) => { type(v.at(1)) != type(none) }).map((v) => {
(
block(
text(v.at(0).at(lang_id) + ":", style: "italic", font: base_font),
width: max_field_name_width + 5em,
),
text(v.at(1), font: base_font, weight: if v.at(2) { "bold" } else { "regular" })
)
}).flatten()
);
}
}
#let abbrlist(language) = {
import "abbreviations.typ": abbrlist
context {
let abbrs = abbrlist();
let max_abbr_width = if abbrs.len() > 0 {
calc.max(abbrs.keys().map((v) => measure(v).width)).at(0)
} else { return };
pagebreak(weak: true);
heading(("Seznam zkratek", "List of abbreviations").at(language), numbering: none);
align(center, grid(
columns: 2,
..abbrs.pairs().map((v) => {
(block(text(v.at(0), weight: "bold"), width: max_abbr_width + 1em), text(v.at(1)))
}).flatten()
));
}
}
#let template_classic(
faculty_id,
language,
document_type,
title, author, supervisor, study_programme,
citation_file,
content,
) = {
// intro page
page({
classic_header(faculty_id, language);
align({
classic_info(faculty_id, language, document_type, title, author, supervisor, study_programme);
v(5em);
}, bottom);
}, margin: 2cm);
// styling
let faculty_color = faculty_color(faculty_id);
set par(justify: true);
set heading(numbering: "1.1.1 ");
set page(margin: (outside: 4cm, top: 3cm, bottom: 3cm), numbering: "1", footer: {
context {
let page = counter(page).get().at(0);
align(str(page), if calc.rem(page, 2) == 0 { right } else { left })
}
});
show heading: it => {
set par(justify: false);
block(
above: 2em,
below: 2em,
text(it, faculty_color, font: "TUL Mono", size: 1.2em)
);
};
show heading.where(level: 1): it => {
pagebreak();
v(2cm);
it
};
show raw.where(block: true): it => {
block(it, fill: rgb("#eee"), inset: 1em)
}
set image(width: 80%);
let language = lang_id(language);
// toc
show outline.entry.where(level: 1): it => {
show repeat: none;
block(text(it, weight: "bold", size: 1.2em), above: 1.5em);
};
outline(title: ("Obsah", "Contents").at(language));
// abbreviation list
abbrlist(language);
// content
pagebreak(to: "even", weak: true);
content
// bibliography
bibliography(citation_file, style: "./tul_citace.csl")
}

View File

@@ -3,11 +3,19 @@
#let faculty_themes = ( #let faculty_themes = (
tul: (
cmyk(80%, 81%, 0%, 0%),
(
"TECHNICKÁ UNIVERZITA V LIBERCI&",
"TECHNICAL UNIVERSITY OF LIBEREC&",
),
),
fs: ( fs: (
cmyk(45%, 35%, 30%, 10%), cmyk(45%, 35%, 30%, 10%),
( (
"FAKULTA STROJNÍ TUL&", "FAKULTA STROJNÍ TUL&",
"FACULTY OF MECHANICAL ENGINEERING TUL&" "FACULTY OF MECHANICAL ENGINEERING TUL&",
), ),
), ),
@@ -38,8 +46,8 @@
fua: ( fua: (
cmyk(96%, 2%, 80%, 47%), cmyk(96%, 2%, 80%, 47%),
( (
"FUA\nTUL&", "FAKULTA UMĚNÍ A ARCHITEKTURY TUL&",
"FAA\nTUL&", "FACULTY OF ARTS AND ARCHITECTURE TUL&",
), ),
), ),

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="en-US"> <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="en-US">
<info> <info>
<title>ISO-690 (numeric, Czech)</title> <title>TUL ISO-690</title>
<id>-----</id> <id>-----</id>
<link href="" rel="self"/> <link href="" rel="self"/>
<link href="" rel="documentation"/> <link href="" rel="documentation"/>
@@ -264,7 +264,7 @@
<group> <group>
<text term="retrieved" suffix=" " text-case="capitalize-first"/> <text term="retrieved" suffix=" " text-case="capitalize-first"/>
<text term="from" suffix=": "/> <text term="from" suffix=": "/>
<text variable="URL"/> <text variable="URL" suffix=" "/>
</group> </group>
</if> </if>
</choose> </choose>

View File

@@ -1,8 +1,311 @@
#let assert_in_dict(needle, dict, item_name) = { #let join(a, b) = {
if str(needle) not in dict { let res = ();
panic( if type(a) == array {
"unknown " + item_name + " '" + str(needle) + for a in a {
"', expected one of: " + dict.keys().map((k) => { "'" + str(k) + "'" }).join(", ") res.push(a);
}
} else {
res.push(a);
}
if type(b) == array {
for b in b {
res.push(b);
}
} else {
res.push(b);
}
res
}
#let serialize_array(arr) = {
arr.map((v) => { "'" + str(v) + "'" }).join(", ")
}
// Assumes a valid type signature
#let decompose_type_signature(signature) = {
let parse_variants(raw) = {
let tmp = "";
let res = ();
for char in raw {
if char == ":" {
let trimmed = tmp.trim();
tmp = "";
if trimmed.len() != 0 {
res.push(trimmed);
}
res.push(":");
} else if char == "|" {
let trimmed = tmp.trim();
tmp = "";
if trimmed.len() != 0 {
res.push(trimmed);
}
} else {
tmp += char;
}
}
if tmp.len() != 0 {
res.push(tmp.trim());
}
res
};
let parse_groups(raw) = {
let tmp = "";
let groups = ();
let found_nested = false;
let nested = 0;
for char in raw {
if nested == 2 {
found_nested = true;
}
if char == "[" {
if nested > 0 {
tmp += char;
} else {
groups = join(groups, parse_variants(tmp));
tmp = "";
found_nested = false;
}
nested += 1;
} else if char == "]" {
if nested > 1 {
tmp += char;
} else {
groups.push(if found_nested { parse_groups(tmp) } else { parse_variants(tmp) });
tmp = "";
found_nested = false;
}
nested -= 1;
} else {
tmp += char;
}
}
if tmp.len() != 0 {
groups = join(groups, parse_variants(tmp));
}
groups
};
let parse_nested(grouped) = {
if type(grouped) != array or grouped.len() == 0 {
return grouped;
}
let first = grouped.at(0);
if type(first) == str and first == "dictionary" {
let body = grouped.at(1);
let key = ();
for group in body {
if group == ":" {
break;
}
key.push(group);
}
let val = body.slice(key.len() + 1);
join((("dictionary", parse_nested(key), parse_nested(val)),), parse_nested(grouped.slice(2)))
} else if type(first) == str and first == "array" {
join((("array", parse_nested(grouped.at(1))),), parse_nested(grouped.slice(2)))
} else {
join(parse_nested(first), parse_nested(grouped.slice(1)))
}
};
let grouped = parse_groups(signature);
parse_nested(grouped)
}
#let serialize_type_signature(value) = {
let serialize_type(value, array_serializer, dict_serializer) = {
if type(value) == dictionary {
dict_serializer(value, array_serializer)
} else if type(value) == array {
array_serializer(value)
} else {
str(type(value))
}
}
let serialize_multi_type(values, array_serializer, dict_serializer) = {
let signatures = ().to-dict();
for value in values {
signatures.insert(serialize_type(value, array_serializer, dict_serializer), none);
}
signatures.keys().join(" | ")
}
let serialize_dict_type(dict, array_serializer) = {
(
"dictionary[" +
serialize_multi_type(dict.keys(), array_serializer, serialize_dict_type) +
" : " +
serialize_multi_type(dict.values(), array_serializer, serialize_dict_type) +
"]"
)
}
let serialize_array_type(arr) = {
"array[" + serialize_multi_type(arr, serialize_array_type, serialize_dict_type) + "]"
}
serialize_type(value, serialize_array_type, serialize_dict_type);
}
#let is_subset_of(subset, of) = {
let has_value(value, target, matcher) = {
for target in target {
if matcher(value, target) {
return true;
}
}
false
};
let is_subset(subset, of, matcher) = {
for item in subset {
if not has_value(item, of, matcher) {
return false;
}
}
true
};
let matches(a, b) = {
if type(a) == array {
if a.at(0) != b.at(0) {
return false;
}
let a_type = a.at(0);
if a_type == "dictionary" {
is_subset(a.at(1), b.at(1), matches) and is_subset(a.at(2), b.at(2), matches)
} else if a_type == "array" {
is_subset(a.at(1), b.at(1), matches)
} else {
panic("invalid signature");
}
} else if type(a) != array and type(b) != array {
a == b
} else {
false
}
};
is_subset(subset, of, matches)
}
#let assert_in_arr(needle, arr, item_name) = {
if str(needle) not in arr {
let panic_message = (
"unknown " + item_name + " '" + str(needle) + "', expected one of: " + serialize_array(arr)
); );
panic(panic_message);
} }
} }
#let assert_in_dict(needle, dict, item_name) = {
assert_in_arr(needle, dict.keys(), item_name);
}
#let assert_dict_has(needles, dict, item_name) = {
for needle in needles {
if not needle in dict {
let panic_message = item_name + " does not contain an entry for '" + needle + "'";
panic(panic_message);
}
}
}
#let matches_type(value, expected_types) = {
return type(value) in expected_types;
}
#let assert_type(value, expected_types, value_name) = {
if not matches_type(value, expected_types) {
let panic_message = (
"unexpected type for " + value_name + " '" + str(type(value)) + "', expected one of: " +
serialize_array(expected_types)
);
panic(panic_message);
}
}
#let matches_array_type(arr, expected_item_types) = {
for item in arr {
if not matches_type(item, expected_item_types) { return false; }
}
true
}
#let assert_array_type(arr, expected_types, array_name) = {
assert_type(arr, (array), array_name);
for item in arr {
assert_type(item, expected_types, array_name + " item");
}
}
#let matches_dict_type(dict, expected_key_types, expected_value_types) = {
if type(dict) != dictionary {
return false;
}
for (key, value) in dict.pairs() {
if not (matches_type(key, expected_key_types) and matches_type(value, expected_value_types)) {
return false;
}
}
true
}
#let assert_dict_type(dict, expected_key_types, expected_value_types, dict_name) = {
assert_type(dict, (dictionary), dict_name);
for (key, value) in dict.items() {
assert_type(key, expected_key_types, dict_name + " key");
assert_type(value, expected_value_types, dict_name + " value");
}
}
#let assert_type_signature(value, expected_type_signature, value_name) = {
let type_signature = serialize_type_signature(value);
if not is_subset_of(
decompose_type_signature(type_signature),
decompose_type_signature(expected_type_signature)
) {
let panic_message = (
"unexpected " + value_name + " type '" + type_signature +
"' expected at least a subset of '" + expected_type_signature + "'"
);
panic(panic_message);
}
}
#let is_none(thing) = {
if type(thing) == type(none) {
true
} else {
false
}
}
#let assert_not_none(thing, item_name) = {
if is_none(thing) {
let panic_message = "missing " + item_name;
panic(panic_message);
}
}
#let ok_or(thing, fallback) = {
if is_none(thing) {
fallback
} else {
thing
}
}
#let has_all_none(arr) = {
for item in arr {
if not is_none(item) {
return false;
}
}
true
}
#let map_none(value, mapper) = {
if is_none(value) {
return none;
}
mapper(value)
}

13
templategen.mk Normal file
View File

@@ -0,0 +1,13 @@
THESIS_FILE := thesis
TYPST_FONTPATH := --font-path template/fonts
.PHONY: watch
watch: $(THESIS_FILE).pdf
xdg-open $< & typst watch $(TYPST_FONTPATH) $(THESIS_FILE).typ
.PHONY: view
view: $(THESIS_FILE).pdf
xdg-open $<
%.pdf: %.typ
typst compile $(TYPST_FONTPATH) $<

40
tests/citations.bib Normal file
View File

@@ -0,0 +1,40 @@
@article{Wang2025,
author = {Wang, Erming and Yu, Kaiwen and Cao, Jiqing and Wang, Minghui and Katsel, Pavel and Song, Won-min and Wang, Zhen and Li, Yuxin and Wang, Xusheng and Wang, Qian and Xu, Peng and Yu, Gefei and Zhu, Li and Geng, Jia and Habibi, Parnian and Qian, Lu and Tuck, Tony and Li, Aiqun and TCW, Julia and Roussos, Panos and Brennand, Kristen J. and Haroutunian, Vahram and Johnson, Erik C.B. and Seyfried, Nicholas T. and Levey, Allan I. and Bennett, David A. and Peng, Junmin and Cai, Dongming and Zhang, Bin},
title = {Multiscale proteomic modeling reveals protein networks driving Alzheimers disease pathogenesis},
journal = {Cell},
year = {2025},
volume = {},
number = {},
pages = {},
publisher = {Elsevier},
doi = {10.1016/j.cell.2025.08.038},
url = {https://doi.org/10.1016/j.cell.2025.08.038},
issn = {0092-8674}
}
@misc{csl,
title = {Citation Style Language},
year = {2025},
medium = {online},
accessed = {2025-06-10},
URL = {https://citationstyles.org/},
}
@misc{linux,
journal = {Blog | Linux Foundation},
title = {Classic SysAdmin: Vim 101: A Beginners Guide to Vim},
year = {2025},
medium = {online},
accessed = {2025-06-10},
URL = {https://www.linuxfoundation.org/blog/blog/classic-sysadmin-vim-101-a-beginners-guide-to-vim},
}
@book{Satrapa2011,
author = {Pavel Satrapa},
title = {IPv6},
publisher = {Edice CZ.NIC},
year = {2011},
edition = {3. vydání},
ISBN = {978-80-904248-4-9},
URL = {https://www.bookport.cz/kniha/ipv6-treti-vydani-5999/},
}

7
tests/citations_cs.typ Normal file
View File

@@ -0,0 +1,7 @@
@Wang2025
@csl
@linux
@Satrapa2011
#set text(lang: "cs")
#bibliography("citations.bib", title: "Bibliography - CZ", style: "../template/tul_citace.csl")

6
tests/citations_en.typ Normal file
View File

@@ -0,0 +1,6 @@
@Wang2025
@csl
@linux
@Satrapa2011
#bibliography("citations.bib", title: "Bibliography - EN", style: "iso-690-numeric")

59
tests/fonts.typ Normal file
View File

@@ -0,0 +1,59 @@
#let display_font(family, weight) = {
if type(family) == type(none) {
block(
spacing: 2em,
text("Příšerně žluťoučký kůn úpěl ďábelské ódy. " + lorem(25), weight: weight)
)
} else {
block(
spacing: 2em,
text("Příšerně žluťoučký kůn úpěl ďábelské ódy. " + lorem(25), font: family, weight: weight)
)
}
}
#show heading.where(level: 1): it => {
v(3em);
it;
}
= #highlight[TUL Mono]
== Regular
#display_font("tul mono", "regular")
= #highlight[Inter]
== Regular
#display_font("inter", "regular")
== Light
#display_font("inter", "light")
== Bold
#display_font("inter", "bold")
#pagebreak()
= #highlight[Default]
== Regular
#display_font(none, "regular")
= #highlight[Merriweather]
== Regular
#display_font("merriweather", "regular")
== Light
#display_font("merriweather", "light")
== Bold
#display_font("merriweather", "bold")

6
tests/make.mk Normal file
View File

@@ -0,0 +1,6 @@
.PHONY: test_%
test_%: tests/%.pdf
xdg-open $<
tests/%.pdf: tests/%.typ
typst compile --root . --font-path template/fonts $<

313
theses/bp.typ Normal file
View File

@@ -0,0 +1,313 @@
#import "../template/template.typ": *
#show: tultemplate2.with(
style: "classic",
faculty: "fm",
lang: "cs",
document: "bp",
title: (
cs: "Ukázka dokumentu typu Bakalářská práce pro FM TUL v češtině",
en: "Example document for a Bachelor's thesis for FM TUL in Czech",
),
author: "Matěj Žucha",
author_pronouns: "masculine",
supervisor: "Ondřej Mekina",
consultant: "Michal Procházka (nepovinný údaj)",
programme: (cs: "Můj krásný studijní program"),
specialization: (cs: "Moje krásná studijní specializace"),
abstract: (
cs: [
Tento dokument slouží jako praktická ukázka všech důležitcýh funkcí šablony _tultemplate2_,
s názornými příklady použítí a jejich podrobným popisem.
],
en: [
This document serves as a practical demonstration of all the important features of the
_tultemplate2_ template, with useful examples and their respective descriptions.
],
),
keywords: (
cs: ("Ukázka", "Klíčových", "Slov", "Česky"),
en: ("Example", "Keywords", "In", "English"),
),
acknowledgement: (cs: "Lorem ipsum dolor sit amet."),
citations: "citations.bib",
)
= Co najdete v této šabloně
Tato šablona sloužit jako ukázková bakalářská práce napsaná pomocí jazyka *Typst* a šablony
*tultemplate2*. Může posloužit jako jednoduchý základ i pro vaši práci, stačí se naučit používat
pár užitečných funkcí, jako např. vkládání obrázků, tabulek, citací nebo odkazů.
Na rozdíl od souboru _example.typ_, který je dostupný ke stažení na stránkách projektu, obsahuje
tento dokument jenom to nejpotřebnější ze znalostí, co postačí k úspěšnému napsání práce. Jen pro
úplnost je zde ve zkratce něco málo o jazyce typst a motivaci k tvorbě této šablony:
Typst je profesionální sázecí nástroj podobný markdownu, LaTeXu/TeXu, groffu, atd.
Typst je moderní obdobou starších nástrojů, které postrádají spoustu důležitých funkcí, bez kterých
se v dnešní době prakticky nedá fungovat. Uživatel často musí importovat nepřeberné množství
balíčků, které poskytují (podle mě) naprosto základní funkcionalitu - jako například správná podpora
UTF-8 znaků, formátování prvků na základě jazykového lokálu, apod.
= Začínáme se šablonou
Tuto šablonu jste si pravděpodobně stáhli z generátoru na webu www.tulsablona.cz a vložili ji do Typst
online editoru. Tím pádem vidíte kromě zdrojového kódu také výsledný PDF soubor. Jak asi víte, hlavní
rozdíl mezi tradičními textovými procesory jako Microsoft Word nebo LibreOffice Writer a mezi sázecími
programy jako LaTeX nebo Typst je právě způsob, kterým se upravuje vzhled a obsah dokumentu.
Zatímco ve Wordu jsou uživatelé zvyklí, že pomocí tlačítek a klávesových zkratek mění dokument napřímo,
Typst (a i LaTeX) používají tzv. zdrojový soubor, který není ničím jiným než obyčejným textovým souborem,
a následně na vyžádání umí tento zdrojový soubor zkompilovat tj. proměnit na výsledný dokument, např. ve formátu PDF.
Proto zde najdete popis všech důležitých funkcí nikoliv jako galerii obrázků toho, na která tlačítka se
klikat, nýbrž jako ukázka a návod všech speciálních sekvencí textu, které Typst podporuje a které šablona vyhodnocuje jinak než obsah zprávy.
== Odstavce
Jak jsou někteří z vás možná zvyklí z Markdownu, odstavce, nadpisy a vlastně pro přehlednost všechny
logicky oddělené bloky se oddělují prázným řádkem. Toho jste si jistě mohli při prohlížení tohoto souboru
všimnout. Můžete si vyzkoušet, co se stane, když
použijete jenom ukončení řádku enterem,
nebo když použijete zmíněný prázdný řádek,
anebo co se stane při použití dvou a více prázdných řádků. (spoiler: 1 a více prázdných řádků mají identické
chování, pouze ukončení řádku je interpretováno stejně jako např. mezerník)
Uživatel tím pádem svobodu v tom, jestli ve zdrojovém souboru používá dlouhé řádky plné textu,
nebo
raději
přehlednější
formátování
a sám si obsah dělí na řádky, protože ve výsledném PDF souboru se stejně spojí do jednoho celistvého odstavce.
Musí akorát ručně dbát na to, aby odstavce nebyly příliš krátké, ani příliš dlouhé.
S souvislosti s odstavci bych ještě zmínil, že Typst se za vás stará také o zarovnávání písma a slov do bloků
a dělení slov mezi řádky. Chováním odpovídá pravidlům českého pravopisu a typografie, takže se o to nemusíte vůbec starat.
== Nadpisy
První důležitá funkce kromě psaní samotného textu, k čemuž není zapotřebí žádná speciální syntax, jsou nadpisy.
Stejně jako v jiných programech, i Typst podporuje nadpisy více úrovní. Pro nadpis první úrovně se používá znaménko
rovná se a mezera na začátku řádku, čili ve zdrojovém souboru Typstu je používán takto:
```typst
= Můj nadpis první úrovně
```
Pro nadpis druhé úrovně pak použijeme dvě rovná se, pro nadpis třetí úrovně tři rovná se.
Šablona *tultemplate2* Vám ovšem bohužel nedovolí nadpis čtvrté a další úrovně, protože by takový
nadpis porušoval směrnice TUL o formátování dokumentů. Ale nemusíte se bát. Pokud takový nadpis
uděláte -- šablona vyhodí chybu, aby vás na to upozornila.
```typst
= Nadpis
== Podnadpis
=== Podpodnadpis
A pak obsah
```
== Číslování kapitol
Asi jste si všimli, že každý nadpis začíná číslem dané kapitoly. Toto číslování provádí Typst automaticky, promítne se následně i v sekci Obsah na začátku souboru, nemusíte se tak opět o nic starat.
= Používání funkcí
Používání většiny funkcionalit Typstu je prováděno pomocí tzv. volání funkce. Je to velmi podobné předchozím ukázkám,
akorát místo toho, aby se text obalil pouze jedním symbolem či podobnou jednoduchou značkou, obalíme text jménem dané funkce. Syntaxe vypadá nějak takto:
```typst
#Název_funkce[samotný text nebo jiné parametry]
```
Pokud v editoru napíšete symbol hashtagu, začne vám automaticky našeptávat všechny možné funkce a jejich popisy. Přejdeme rovnou k dalším praktickým příkladům.
== Zvýrazňování textu
Syntaxe základního zvýraznění je velmi podobná například Markdownu. Stačí použít následující symboly:
```typst
*tučně*
_kurzívou_
```
Další stylování lze dělat právě přes funkce, viz třeba:
```typst
#underline[podtrženo]
#strike[přeškrtnuto]
#highlight[zvýrazněno]
```
Pro úplnost a ukázku je zde přímo v textu *tučný text*, _text kurzívou_, #underline[podtržený text], #strike[přeškrtnutý text] a #highlight[text zvýrazněný podle barvy příslušící vaší fakultě].
== Odkazy<links>
Odkazy je možné dělat na URL/URI zdroje, e-maily, telefony, atd...
Odkázat URL (URI) je možné bez zavolání funkce, odkaz stačí prostě a jednodušše napsat:
https://git.zumepro.cz/tul/tultemplate2
```typst
https://git.zumepro.cz/tul/tultemplate2
```
Tohle interně volá funkci `link`.
Pokud odkazujeme na méně časté věci (jako e-maily), můžeme použít funkci `link` přímo.
```typst
#link("mailto:ondrej@mekina.cz")
```
Dalši předpony (URI schémata) můžete najít třeba na Wikipedii
https://en.wikipedia.org/wiki/List_of_URI_schemes.
== Obrázky
Obrázky je možné vkládat samotné, nebo i s popiskem.
Obrázek se vloží pomocí funkce `image`.
Přidání popisku a zároveň zalistování obrázku v indexu (aby se na ně třeba dalo odkazovat) lze
udělat pomocí funkce `figure`.
#block([
```typst
#figure(
image("mujobrazek.jpg"),
caption: [
*Krásný* obrázek, který vypadá jako obrázek.
]
)
```
], breakable: false)
Tady je praktická ukázka jednoduchého vložení obrázku s popiskem:
#figure(image("../template/assets/tul_logo.svg", width: 25%), caption: [
Logo *TUL*
])
První parametr funkce je zobrazovaný obsah, v našem případě zmíněný `image`. K němu můžeme psát různé parametry, v příkladu máme třeba nastavení šířky obrázku v procentech. Jako poslední je parametr `caption`, s jehož pomocí můžeme nastavit popisek obrázku/figury.
Obrázky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje). I toto za vás Typst dělá automaticky, vám tak stačí do textu přidávat obrázky, jak se to hodí, a všechny se poté korektně zobrazí v Seznamu obrázků s odkazem i správně uvedenou stránkou, na které se obrázek nachází. Obrázky jsou také automaticky číslovány podle předepsaného způsobu, podobně jako kapitoly.
== Tabulky
Tabulky lze vytvářet takto:
```typst
#figure(table(
columns: 3,
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
[*Řádek 1*], [a], [b],
[*Řádek 2*], [c], [d],
), caption: "Moje krásná tabulka")
```
Parametr `columns` udává počet sloupců tabulky. Poté následuje libovolný počet buněk tabulky, pro lepší přehlednost jsou v příkladu jednotlivé řádky oddělené. Nakonec je zde opět parametr `caption` sloužící k zadání popisku tabulky.
#highlight[Hlavičku tabulky (první řádek) je dobré zabalit do funkce header (viz. výše)], to je
kvůli tomu, že Typst do vygenerovaného PDF souboru poté přidá metadata (například pro osoby se
zrakovým postižením).
#figure(table(
columns: 3,
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
[*Řádek 1*], [a], [b],
[*Řádek 2*], [c], [d],
), caption: "Moje krásná tabulka")
Tabulky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje). Jak jste asi pochopili, i toto provede šablona automaticky.
== Citace
Šablona podporuje správu citací pomocí standardního BibTeX @bibtex souboru, stejně jako
například LaTeX. Generování citací v BibTeX zápisu umí téměř každá stránka nebo program, které mají pro citace podporu.
Kód takovéto citace ve vhodném formátu stačí přidat do souboru _citations.bib_, poté je možné se
na odkazovat pomocí `@jmeno_citace`, nebo `#cite(<jmeno_citace>)`. Můžu se tak třeba odkázat na
citaci Typstu #cite(<typst>).
Formát souboru _citations.bib_ je naprosto stejný jako pro LaTeX. Tyto citace lze přímo vložit
třeba z webu https://www.citace.com ve formátu BibTeX -- Typst tento formát také umí přečíst.
Můžete se do souboru s příponou .bib podívat, zjistíte, že je to opravdu jen obyčejný textový soubor se specifickou strukturou.
V přiloženém ukázkovém souboru nějaké citace jsou - např. již použitá citace se jménem `typst`.
Soubor, ze kterého se načtou citace lze změnit pomocí argumentu šablony (tj. struktura na začátku souboru):
```typst
#show: tultemplate2.with(
...
citations: "jinysoubor.bib",
...
)
```
== Vnitřní odkazy a kotvy<ukazka_odkazu>
Trochu navážeme na Odkazy (@links).
Můžete dělat i vnitřní odkazy třeba na kapitoly, stránky nebo obrázky s popiskem (zabalené ve
`figure`).
```typst
= Dobrá kapitola<dobra_kapitola>
Podívejme se na Dobrou kapitolu (@dobra_kapitola).
```
Takhle vypadá kotva:
```typst
<nazev_kotvy>
```
Kotvu dáte někam do souboru a můžete na odkazovat stejně jako na citace:
```typst
@nazev_kotvy
```
Můžeme se podívat na názornou ukázku odkazu (@ukazka_odkazu).
== Zkratky
LaTeX TUL šablona k začátku dokumentu seznam zkratek. Proto jsme ho přidali i do této šablony.
Seznam zkratek je v této šabloně nastaven tak, aby se zobrazoval pouze pokud je v něm alespoň jedna
zkratka (přišlo nám to poměrně logické).
Zkratku #abbr("ABC", "Abeceda") vytvoříte (definujete) pomocí:
```typst
#abbr("ABC", "Abeceda")
```
Potom zkratku #abbr("ABC") můžete použít přímo (bez opakované definice):
```typst
#abbr("ABC")
```
Šablona zajistí následující věci:
- Zkratka se zobrazí v seznamu zkratek
- Při prvním použití zkratky vás šablona donutí zkratku definovat
- Definice zkratky bude použita právě jednou (poprvé)
Při prvním použití zkratky (při definici) bude zkratka v textu vypadat takto:
#abbr("ZK", "Zkratka").
Při dalších použití bude vypadat takto: #abbr("ZK").
#highlight[
Tedy zkratku _nepřidáváte_ přímo do seznamu zkratek, ale elegantně používáte přímo v textu.
]
== Přílohy
Na konec souboru (nebo klidně doprostřed či na začátek, hlavní je, že pouze jednou) je také možné dát strukturu generující přílohy. Momentálně jsou podporované čtyři typy příloh: odkaz, obsah, PDF soubor vložený na konec dokumentu a odkaz na externí soubor (například přiložený do systému s bakalářskou prací).
Jako demonstrace by měla postačit praktická ukázka, která ve zdrojovém kódu následuje hned za tímto odstavcem, a která generuje přílohy tohoto dokumentu.
#attachments(
attach_link("Zdrojový kód této šablony", "https://git.zumepro.cz/tul/tultemplate2"),
attach_content("Testovací obsah vygenerovaný Typstem", [Sem lze psát _stylovaný_ obsah.]),
)

312
theses/dp.typ Normal file
View File

@@ -0,0 +1,312 @@
#import "../template/template.typ": *
#show: tultemplate2.with(
style: "classic",
faculty: "fm",
lang: "cs",
document: "dp",
title: (
cs: "Ukázka dokumentu typu Diplomová práce pro FM TUL v češtině",
en: "Example document for a Master's thesis for FM TUL in Czech",
),
author: "Matěj Žucha",
author_pronouns: "masculine",
supervisor: "Ondřej Mekina",
consultant: "Michal Procházka (nepovinný údaj)",
programme: (cs: "Můj krásný studijní program"),
abstract: (
cs: [
Tento dokument slouží jako praktická ukázka všech důležitcýh funkcí šablony _tultemplate2_,
s názornými příklady použítí a jejich podrobným popisem.
],
en: [
This document serves as a practical demonstration of all the important features of the
_tultemplate2_ template, with useful examples and their respective descriptions.
]
),
keywords: (
cs: ("Ukázka", "Klíčových", "Slov", "Česky"),
en: ("Example", "Keywords", "In", "English"),
),
acknowledgement: (cs: "Lorem ipsum dolor sit amet."),
citations: "citations.bib",
)
= Co najdete v této šabloně
Tato šablona sloužit jako ukázková bakalářská práce napsaná pomocí jazyka *Typst* a šablony
*tultemplate2*. Může posloužit jako jednoduchý základ i pro vaši práci, stačí se naučit používat
pár užitečných funkcí, jako např. vkládání obrázků, tabulek, citací nebo odkazů.
Na rozdíl od souboru _example.typ_, který je dostupný ke stažení na stránkách projektu, obsahuje
tento dokument jenom to nejpotřebnější ze znalostí, co postačí k úspěšnému napsání práce. Jen pro
úplnost je zde ve zkratce něco málo o jazyce typst a motivaci k tvorbě této šablony:
Typst je profesionální sázecí nástroj podobný markdownu, LaTeXu/TeXu, groffu, atd.
Typst je moderní obdobou starších nástrojů, které postrádají spoustu důležitých funkcí, bez kterých
se v dnešní době prakticky nedá fungovat. Uživatel často musí importovat nepřeberné množství
balíčků, které poskytují (podle mě) naprosto základní funkcionalitu - jako například správná podpora
UTF-8 znaků, formátování prvků na základě jazykového lokálu, apod.
= Začínáme se šablonou
Tuto šablonu jste si pravděpodobně stáhli z generátoru na webu www.tulsablona.cz a vložili ji do Typst
online editoru. Tím pádem vidíte kromě zdrojového kódu také výsledný PDF soubor. Jak asi víte, hlavní
rozdíl mezi tradičními textovými procesory jako Microsoft Word nebo LibreOffice Writer a mezi sázecími
programy jako LaTeX nebo Typst je právě způsob, kterým se upravuje vzhled a obsah dokumentu.
Zatímco ve Wordu jsou uživatelé zvyklí, že pomocí tlačítek a klávesových zkratek mění dokument napřímo,
Typst (a i LaTeX) používají tzv. zdrojový soubor, který není ničím jiným než obyčejným textovým souborem,
a následně na vyžádání umí tento zdrojový soubor zkompilovat tj. proměnit na výsledný dokument, např. ve formátu PDF.
Proto zde najdete popis všech důležitých funkcí nikoliv jako galerii obrázků toho, na která tlačítka se
klikat, nýbrž jako ukázka a návod všech speciálních sekvencí textu, které Typst podporuje a které šablona vyhodnocuje jinak než obsah zprávy.
== Odstavce
Jak jsou někteří z vás možná zvyklí z Markdownu, odstavce, nadpisy a vlastně pro přehlednost všechny
logicky oddělené bloky se oddělují prázným řádkem. Toho jste si jistě mohli při prohlížení tohoto souboru
všimnout. Můžete si vyzkoušet, co se stane, když
použijete jenom ukončení řádku enterem,
nebo když použijete zmíněný prázdný řádek,
anebo co se stane při použití dvou a více prázdných řádků. (spoiler: 1 a více prázdných řádků mají identické
chování, pouze ukončení řádku je interpretováno stejně jako např. mezerník)
Uživatel tím pádem svobodu v tom, jestli ve zdrojovém souboru používá dlouhé řádky plné textu,
nebo
raději
přehlednější
formátování
a sám si obsah dělí na řádky, protože ve výsledném PDF souboru se stejně spojí do jednoho celistvého odstavce.
Musí akorát ručně dbát na to, aby odstavce nebyly příliš krátké, ani příliš dlouhé.
S souvislosti s odstavci bych ještě zmínil, že Typst se za vás stará také o zarovnávání písma a slov do bloků
a dělení slov mezi řádky. Chováním odpovídá pravidlům českého pravopisu a typografie, takže se o to nemusíte vůbec starat.
== Nadpisy
První důležitá funkce kromě psaní samotného textu, k čemuž není zapotřebí žádná speciální syntax, jsou nadpisy.
Stejně jako v jiných programech, i Typst podporuje nadpisy více úrovní. Pro nadpis první úrovně se používá znaménko
rovná se a mezera na začátku řádku, čili ve zdrojovém souboru Typstu je používán takto:
```typst
= Můj nadpis první úrovně
```
Pro nadpis druhé úrovně pak použijeme dvě rovná se, pro nadpis třetí úrovně tři rovná se.
Šablona *tultemplate2* Vám ovšem bohužel nedovolí nadpis čtvrté a další úrovně, protože by takový
nadpis porušoval směrnice TUL o formátování dokumentů. Ale nemusíte se bát. Pokud takový nadpis
uděláte -- šablona vyhodí chybu, aby vás na to upozornila.
```typst
= Nadpis
== Podnadpis
=== Podpodnadpis
A pak obsah
```
== Číslování kapitol
Asi jste si všimli, že každý nadpis začíná číslem dané kapitoly. Toto číslování provádí Typst automaticky, promítne se následně i v sekci Obsah na začátku souboru, nemusíte se tak opět o nic starat.
= Používání funkcí
Používání většiny funkcionalit Typstu je prováděno pomocí tzv. volání funkce. Je to velmi podobné předchozím ukázkám,
akorát místo toho, aby se text obalil pouze jedním symbolem či podobnou jednoduchou značkou, obalíme text jménem dané funkce. Syntaxe vypadá nějak takto:
```typst
#Název_funkce[samotný text nebo jiné parametry]
```
Pokud v editoru napíšete symbol hashtagu, začne vám automaticky našeptávat všechny možné funkce a jejich popisy. Přejdeme rovnou k dalším praktickým příkladům.
== Zvýrazňování textu
Syntaxe základního zvýraznění je velmi podobná například Markdownu. Stačí použít následující symboly:
```typst
*tučně*
_kurzívou_
```
Další stylování lze dělat právě přes funkce, viz třeba:
```typst
#underline[podtrženo]
#strike[přeškrtnuto]
#highlight[zvýrazněno]
```
Pro úplnost a ukázku je zde přímo v textu *tučný text*, _text kurzívou_, #underline[podtržený text], #strike[přeškrtnutý text] a #highlight[text zvýrazněný podle barvy příslušící vaší fakultě].
== Odkazy<links>
Odkazy je možné dělat na URL/URI zdroje, e-maily, telefony, atd...
Odkázat URL (URI) je možné bez zavolání funkce, odkaz stačí prostě a jednodušše napsat:
https://git.zumepro.cz/tul/tultemplate2
```typst
https://git.zumepro.cz/tul/tultemplate2
```
Tohle interně volá funkci `link`.
Pokud odkazujeme na méně časté věci (jako e-maily), můžeme použít funkci `link` přímo.
```typst
#link("mailto:ondrej@mekina.cz")
```
Dalši předpony (URI schémata) můžete najít třeba na Wikipedii
https://en.wikipedia.org/wiki/List_of_URI_schemes.
== Obrázky
Obrázky je možné vkládat samotné, nebo i s popiskem.
Obrázek se vloží pomocí funkce `image`.
Přidání popisku a zároveň zalistování obrázku v indexu (aby se na ně třeba dalo odkazovat) lze
udělat pomocí funkce `figure`.
#block([
```typst
#figure(
image("mujobrazek.jpg"),
caption: [
*Krásný* obrázek, který vypadá jako obrázek.
]
)
```
], breakable: false)
Tady je praktická ukázka jednoduchého vložení obrázku s popiskem:
#figure(image("../template/assets/tul_logo.svg", width: 25%), caption: [
Logo *TUL*
])
První parametr funkce je zobrazovaný obsah, v našem případě zmíněný `image`. K němu můžeme psát různé parametry, v příkladu máme třeba nastavení šířky obrázku v procentech. Jako poslední je parametr `caption`, s jehož pomocí můžeme nastavit popisek obrázku/figury.
Obrázky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje). I toto za vás Typst dělá automaticky, vám tak stačí do textu přidávat obrázky, jak se to hodí, a všechny se poté korektně zobrazí v Seznamu obrázků s odkazem i správně uvedenou stránkou, na které se obrázek nachází. Obrázky jsou také automaticky číslovány podle předepsaného způsobu, podobně jako kapitoly.
== Tabulky
Tabulky lze vytvářet takto:
```typst
#figure(table(
columns: 3,
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
[*Řádek 1*], [a], [b],
[*Řádek 2*], [c], [d],
), caption: "Moje krásná tabulka")
```
Parametr `columns` udává počet sloupců tabulky. Poté následuje libovolný počet buněk tabulky, pro lepší přehlednost jsou v příkladu jednotlivé řádky oddělené. Nakonec je zde opět parametr `caption` sloužící k zadání popisku tabulky.
#highlight[Hlavičku tabulky (první řádek) je dobré zabalit do funkce header (viz. výše)], to je
kvůli tomu, že Typst do vygenerovaného PDF souboru poté přidá metadata (například pro osoby se
zrakovým postižením).
#figure(table(
columns: 3,
table.header([], [*Sloupec 1*], [*Sloupec 2*]),
[*Řádek 1*], [a], [b],
[*Řádek 2*], [c], [d],
), caption: "Moje krásná tabulka")
Tabulky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje). Jak jste asi pochopili, i toto provede šablona automaticky.
== Citace
Šablona podporuje správu citací pomocí standardního BibTeX @bibtex souboru, stejně jako
například LaTeX. Generování citací v BibTeX zápisu umí téměř každá stránka nebo program, které mají pro citace podporu.
Kód takovéto citace ve vhodném formátu stačí přidat do souboru _citations.bib_, poté je možné se
na odkazovat pomocí `@jmeno_citace`, nebo `#cite(<jmeno_citace>)`. Můžu se tak třeba odkázat na
citaci Typstu #cite(<typst>).
Formát souboru _citations.bib_ je naprosto stejný jako pro LaTeX. Tyto citace lze přímo vložit
třeba z webu https://www.citace.com ve formátu BibTeX -- Typst tento formát také umí přečíst.
Můžete se do souboru s příponou .bib podívat, zjistíte, že je to opravdu jen obyčejný textový soubor se specifickou strukturou.
V přiloženém ukázkovém souboru nějaké citace jsou - např. již použitá citace se jménem `typst`.
Soubor, ze kterého se načtou citace lze změnit pomocí argumentu šablony (tj. struktura na začátku souboru):
```typst
#show: tultemplate2.with(
...
citations: "jinysoubor.bib",
...
)
```
== Vnitřní odkazy a kotvy<ukazka_odkazu>
Trochu navážeme na Odkazy (@links).
Můžete dělat i vnitřní odkazy třeba na kapitoly, stránky nebo obrázky s popiskem (zabalené ve
`figure`).
```typst
= Dobrá kapitola<dobra_kapitola>
Podívejme se na Dobrou kapitolu (@dobra_kapitola).
```
Takhle vypadá kotva:
```typst
<nazev_kotvy>
```
Kotvu dáte někam do souboru a můžete na odkazovat stejně jako na citace:
```typst
@nazev_kotvy
```
Můžeme se podívat na názornou ukázku odkazu (@ukazka_odkazu).
== Zkratky
LaTeX TUL šablona k začátku dokumentu seznam zkratek. Proto jsme ho přidali i do této šablony.
Seznam zkratek je v této šabloně nastaven tak, aby se zobrazoval pouze pokud je v něm alespoň jedna
zkratka (přišlo nám to poměrně logické).
Zkratku #abbr("ABC", "Abeceda") vytvoříte (definujete) pomocí:
```typst
#abbr("ABC", "Abeceda")
```
Potom zkratku #abbr("ABC") můžete použít přímo (bez opakované definice):
```typst
#abbr("ABC")
```
Šablona zajistí následující věci:
- Zkratka se zobrazí v seznamu zkratek
- Při prvním použití zkratky vás šablona donutí zkratku definovat
- Definice zkratky bude použita právě jednou (poprvé)
Při prvním použití zkratky (při definici) bude zkratka v textu vypadat takto:
#abbr("ZK", "Zkratka").
Při dalších použití bude vypadat takto: #abbr("ZK").
#highlight[
Tedy zkratku _nepřidáváte_ přímo do seznamu zkratek, ale elegantně používáte přímo v textu.
]
== Přílohy
Na konec souboru (nebo klidně doprostřed či na začátek, hlavní je, že pouze jednou) je také možné dát strukturu generující přílohy. Momentálně jsou podporované čtyři typy příloh: odkaz, obsah, PDF soubor vložený na konec dokumentu a odkaz na externí soubor (například přiložený do systému s diplomovou prací).
Jako demonstrace by měla postačit praktická ukázka, která ve zdrojovém kódu následuje hned za tímto odstavcem, a která generuje přílohy tohoto dokumentu.
#attachments(
attach_link("Zdrojový kód této šablony", "https://git.zumepro.cz/tul/tultemplate2"),
attach_content("Testovací obsah vygenerovaný Typstem", [Sem lze psát _stylovaný_ obsah.]),
)