reformat example theses content
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#show: tultemplate2
|
||||
|
||||
= Co najdete v této šabloně
|
||||
= Úvod do této šablony
|
||||
|
||||
Tato šablona má sloužit jako ukázka práce typu `{{ta}}` v nástroji *Typst* a šabloně *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ů.
|
||||
@@ -16,7 +16,7 @@ Typst je profesionální sázecí nástroj podobný Markdownu, LaTeXu/TeXu, Grof
|
||||
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
|
||||
== Začínáme pracovat
|
||||
|
||||
Tuto šablonu jste si pravděpodobně stáhli z generátoru na webu https://tulsablona.zumepro.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.
|
||||
@@ -24,7 +24,37 @@ Jak už asi víte, hlavní rozdíl mezi tradičními textovými procesory jako M
|
||||
|
||||
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 má 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.
|
||||
Proto v tomto dokumentu najdete popis všech důležitých funkcí nikoliv jako galerii obrázků toho, na která tlačítka se má 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.
|
||||
|
||||
#rect[
|
||||
*TIP*:
|
||||
Uložte si tento dokument pro pozdější použití.
|
||||
Až budete hledat nějakou specifickou funkci, můžete se k ní prokliknout přes seznam obsahu nahoře.
|
||||
]
|
||||
|
||||
== Klikatelný obsah
|
||||
|
||||
Pokud používáte oficiální Typst online editor, můžete jednoduše klepnout na jakýkoliv text v pravé části (náhledové PDF), který se dá měnit, a editor podle toho automaticky přesune váš kurzor na správné místo.
|
||||
Je to sice drobná, ale zato velmi užitečná funkce.
|
||||
|
||||
#rect[
|
||||
*TIP*:
|
||||
Zkuste například dvakrát poklepat na obsah abstraktu (nebo název práce u projektů a semestrálních prací) a začít psát.
|
||||
]
|
||||
|
||||
== Kontrola šablony při kompilaci
|
||||
|
||||
Tato šablona je vytvořena tak, že když se ji pokusíte zkompilovat s nesprávnou syntaxí nebo s nějakou chybějící důležitou částí hlavičky, nenechá vás to provést.
|
||||
Vždy se podívejte na chybové hlášky, které šablona vypisuje, protože vás snadno navedou k opravě všech chyb.
|
||||
Můžete to vyzkoušet tak, že smažete něco z hlavičky nebo že např. použijete funkci, která není nikde definovaná.
|
||||
|
||||
Pokud jste hlavičku vygenerovali z generátoru -- neměli byste s ní mít žádné problémy.
|
||||
Generátor je nastaven tak, aby vás nenechal vygenerovat špatnou hlavičku.
|
||||
|
||||
= Základní formátování obsahu
|
||||
|
||||
Formátování (sázení) textu v Typstu je ve většině případů velice jednoduché.
|
||||
V této kapitole vám ukážeme nějaké základy, které budete běžně používat.
|
||||
|
||||
== Odstavce
|
||||
|
||||
@@ -52,11 +82,6 @@ Musí akorát ručně dbát na to, aby odstavce nebyly příliš krátké, ani p
|
||||
V 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, když už se na něj nevejdou.
|
||||
|
||||
== Klikatelný obsah
|
||||
|
||||
Pokud používáte oficiální Typst online editor, můžete jednoduše klepnout na jakýkoliv text v pravé části (náhledové PDF), který se dá měnit, a editor podle toho automaticky přesune váš kurzor na správné místo.
|
||||
Je to sice drobná, ale zato velmi užitečná funkce.
|
||||
|
||||
== Nadpisy
|
||||
|
||||
První důležitá funkce kromě psaní samotného textu, k čemuž není zapotřebí žádná černá magie, jsou nadpisy.
|
||||
@@ -80,24 +105,15 @@ A pak obsah
|
||||
|
||||
== Číslování kapitol
|
||||
|
||||
Asi jste si všimli, že každý nadpis začíná číslem dané kapitoly.
|
||||
Asi jste si všimli, že ve výstupu 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.
|
||||
|
||||
= Kontrola šablony při kompilaci
|
||||
|
||||
Tato šablona je vytvořena tak, že když se ji pokusíte zkompilovat s nesprávnou syntaxí nebo s nějakou chybějící důležitou částí hlavičky, nenechá vás to provést.
|
||||
Vždy se podívejte na chybové hlášky, které šablona vypisuje, protože vás snadno navedou k opravě všech chyb.
|
||||
Můžete to vyzkoušet tak, že smažete něco z hlavičky nebo že např. použijete funkci, která není nikde definovaná.
|
||||
|
||||
= 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.
|
||||
#rect[
|
||||
*TIP*:
|
||||
Schválně si zkuste napsat nadpis čtvrté úrovně.
|
||||
Alespoň se tak jednodušše seznámíte se způsobem, jakým vám tato šablona skrz Typst hlásí chyby.
|
||||
Pokud se při poklikání na error ocitnete v jiném souboru -- prostě se jednodušše vraťte přes menu souborů.
|
||||
]
|
||||
|
||||
== Zvýrazňování textu
|
||||
|
||||
@@ -141,6 +157,93 @@ Funkci link nejprve v kulatých závorkách dáte cíl odkazu (například URL a
|
||||
Dalši předpony (URI schémata) můžete najít třeba na Wikipedii
|
||||
https://en.wikipedia.org/wiki/List_of_URI_schemes.
|
||||
|
||||
== Citace
|
||||
|
||||
Šablona podporuje správu citací pomocí standardního BibLaTeX @bibtex souboru, stejně jako například LaTeX.
|
||||
Generování citací v BibLaTeX zápisu umí téměř každá stránka nebo program, které mají pro citace podporu -- doporučujeme použít buď #link("https://www.zotero.org/")[Zotero] nebo #link("https://www.citacepro.com/")[Citace.com].
|
||||
Kód takovéto citace ve vhodném formátu stačí přidat do souboru _citations.bib_, poté je možné se na ně 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 BibLaTeX -- 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 už 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 na zalistovaný obsah (například za nadpis nebo obrázek) a můžete na ní 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 má na 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) v textu například takto:
|
||||
|
||||
```typst
|
||||
Zkratka #abbr("ABC", "Abeceda") je zkratka pro abecedu písmen.
|
||||
```
|
||||
|
||||
Potom zkratku #abbr("ABC") už použijete přímo (bez opakované definice):
|
||||
|
||||
```typst
|
||||
První písmeno #abbr("ABC") je písmeno "A".
|
||||
```
|
||||
|
||||
Š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
|
||||
- Zkratka bude definována pouze jednou (poprvé), jinak na vás šablona začne červeně křičet
|
||||
|
||||
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ě jí používáte přímo v textu.
|
||||
]
|
||||
|
||||
= 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.
|
||||
|
||||
== Obrázky
|
||||
|
||||
Obrázky je možné vkládat samotné, nebo i s popiskem.
|
||||
@@ -202,84 +305,7 @@ Nakonec je zde opět parametr `caption` sloužící k zadání popisku tabulky.
|
||||
Tabulky se zobrazí na začátku dokumentu v seznamu (pokud to daný typ dokumentu vyžaduje).
|
||||
Jak už jste asi pochopili, i toto provede šablona automaticky.
|
||||
|
||||
== Citace
|
||||
|
||||
Šablona podporuje správu citací pomocí standardního BibLaTeX @bibtex souboru, stejně jako například LaTeX.
|
||||
Generování citací v BibLaTeX zápisu umí téměř každá stránka nebo program, které mají pro citace podporu -- doporučujeme použít buď #link("https://www.zotero.org/")[Zotero] nebo #link("https://www.citacepro.com/")[Citace.com].
|
||||
Kód takovéto citace ve vhodném formátu stačí přidat do souboru _citations.bib_, poté je možné se na ně 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 BibLaTeX -- 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 už 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 na zalistovaný obsah (například za nadpis nebo obrázek) a můžete na ní 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 má na 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") už 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
|
||||
- Zkratka bude definována pouze jednou (poprvé), jinak na vás šablona začne červeně křičet
|
||||
|
||||
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ě jí používáte přímo v textu.
|
||||
]
|
||||
|
||||
== Přílohy
|
||||
= Přílohy
|
||||
|
||||
Na konec souboru je také možné přidat seznam příloh.
|
||||
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 {{tou}}).
|
||||
@@ -289,4 +315,3 @@ Jako demonstrace by měla postačit praktická ukázka, která ve zdrojovém kó
|
||||
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.]),
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#show: tultemplate2
|
||||
|
||||
= A quick few words about this template
|
||||
= Introduction to this template
|
||||
|
||||
This template should serve as an example {{what}} written with the help of the tool *Typst* and the *tultemplate2* template.
|
||||
It can be used as a starting point for your own report, you just have to learn a few of its useful functions, e.g. how to insert images, tables, citacions or links.
|
||||
@@ -16,7 +16,7 @@ Typst is a professional typesetting language similar to Markdown, LaTeX/TeX, gro
|
||||
Typst is the modern equivalent of older typesetting tools, which often lack a lot of important features, such that make it next to impossible to work without today.
|
||||
The user must often import an incountable number of packages, which only provide only the most basic of functionalities --- for example proper UTF-8 character support, formatting of elements based on the set locale, etc.
|
||||
|
||||
= Getting Started with the Template
|
||||
== Getting started
|
||||
|
||||
You have probably downloaded this template from the generator on the website https://tulsablona.zumepro.cz and inserted it into the Typst online editor.
|
||||
Therefore, besides the source code, you can also see the resulting PDF file.
|
||||
@@ -24,7 +24,37 @@ As you probably know, the main difference between traditional word processors li
|
||||
|
||||
While Word users are used to changing the document directly using buttons and keyboard shortcuts, Typst (and also LaTeX) use a so-called source file, which is nothing more than an ordinary text file, and can then, on request, compile this source file -- i.e., turn it into the final document, for example in PDF format.
|
||||
|
||||
That's why here you will find a description of all the important functions not as a gallery of images showing which buttons to click, but rather as an example and guide to all the special text sequences that Typst supports and that the template interprets differently from the main content of the report.
|
||||
That's why in this document you'll find a description of all the important functions not as a gallery of images showing which buttons to click, but rather as an example and guide to all the special text sequences that Typst supports and that the template interprets differently from the main content of the report.
|
||||
|
||||
#rect[
|
||||
*TIP*:
|
||||
Save this document for later use.
|
||||
When you'll search for a specific function, you can jump right to it through the table of contents above.
|
||||
]
|
||||
|
||||
== Clickable content
|
||||
|
||||
When using the official Typst online editor, you can simply click on any text in the right side (the preview PDF), and your cursor will jump directly to that text in the source file.
|
||||
A small but very practical feature.
|
||||
|
||||
#rect[
|
||||
*TIP*:
|
||||
Try double-tapping the content of the abstract (or the thesis title for projects and term papers) and then start typing.
|
||||
]
|
||||
|
||||
== Template compile-time checks
|
||||
|
||||
This template is created in such a way that when you try to compile it with incorrect syntax or an imoportant part of the header missing, it won't let you.
|
||||
Always see the error messages the template provides, as they will simply guide you to fix your mistakes.
|
||||
You can try this by deleting something from the header, or by using e.g. a function that ins't defined anywhere.
|
||||
|
||||
If you generated the header from the generator -- you should have no problem with it.
|
||||
The generator is configured to only generate valid headers.
|
||||
|
||||
= Basic content formatting
|
||||
|
||||
Formatting (typesetting) text in Typst is very easy in the majority of cases.
|
||||
In this chapter we'll show you some basics that you'll use all the time.
|
||||
|
||||
== Paragraphs
|
||||
|
||||
@@ -54,11 +84,6 @@ The user has to manually watch out for the length of the paragraphs, so that the
|
||||
|
||||
In the context of paragraphs, it should be mentioned that Typst also manages the alignment of text and words into blocks and the division of words between lines when they don't fit.
|
||||
|
||||
== Clickable content
|
||||
|
||||
When using the official Typst online editor, you can simply click on any text in the right side (the preview PDF), and your cursor will jump directly to that text in the source file.
|
||||
A small but very practical feature.
|
||||
|
||||
== Headings
|
||||
|
||||
The first important feature, apart from writing the text itself (which requires no black magic), is the usage of headings.
|
||||
@@ -82,26 +107,14 @@ And then your content
|
||||
|
||||
== Chapter Numbering
|
||||
|
||||
You've probably noticed that each heading begins with the number of its respective chapter. Typst handles this numbering automatically, and it's also reflected in the *Contents* section at the start of the document, so you don't have to worry about it yourself.
|
||||
You've probably noticed that each heading begins with the number of its respective chapter in the output. Typst handles this numbering automatically, and it's also reflected in the *Contents* section at the start of the document, so you don't have to worry about it yourself.
|
||||
|
||||
== Template compile-time checks
|
||||
|
||||
This template is created in such a way that when you try to compile it with incorrect syntax or an imoportant part of the header missing, it won't let you.
|
||||
Always see the error messages the template provides, as they will simply guide you to fix your mistakes.
|
||||
You can try this by deleting something from the header, or by using e.g. a function that ins't defined anywhere.
|
||||
|
||||
= Using Functions
|
||||
|
||||
Most Typst features are used through what's called function calls.
|
||||
This is quite similar to the previous examples, except that instead of wrapping text with a single symbol or a simple marker, we wrap it with the name of the function.
|
||||
The syntax looks like this:
|
||||
|
||||
```typst
|
||||
#Function_name[text itself or other parameters]
|
||||
```
|
||||
|
||||
When you type the hashtag symbol in the editor, it will automatically start suggesting all available functions and their descriptions.
|
||||
Let's move on to some practical examples.
|
||||
#rect[
|
||||
*TIP*:
|
||||
As a test, try to write a heading with level four.
|
||||
At least you'll familiarize yourself with the way that this template gives you errors through Typst.
|
||||
If you'll find yourself in a different file after double-tapping the error --- just simply return to this file through the file menu.
|
||||
]
|
||||
|
||||
== Text Highlighting
|
||||
|
||||
@@ -144,6 +157,99 @@ First, you pass the link target (perhaps a URL address) in parentheses to the li
|
||||
You can find other prefixes (URI schemes) on Wikipedia:
|
||||
https://en.wikipedia.org/wiki/List_of_URI_schemes.
|
||||
|
||||
== Citations
|
||||
|
||||
The template supports citation management using a standard BibLaTeX file @bibtex, just like LaTeX.
|
||||
Almost every website or program that supports citations can generate BibLaTeX-formatted entries --- we recommend using either #link("https://www.zotero.org/")[Zotero] or #link("https://www.citacepro.com/")[Citace.com].
|
||||
You simply add the code for such a citation, in the proper format, to the file _citations.bib_.
|
||||
Once added, you can reference it using `@citation_name` or `#cite(<citation_name>)`.
|
||||
For example, I can reference the Typst citation as #cite(<typst>).
|
||||
|
||||
The format of the _citations.bib_ file is exactly the same as in LaTeX.
|
||||
You can even copy entries directly from sites like in BibLaTeX format --- Typst understands that format, too.
|
||||
If you open a `.bib` file, you'll see that it's simply a plain text file with a specific structure.
|
||||
The provided sample file already contains several citations --- for instance, the one named `typst`, which was already used above.
|
||||
|
||||
You can change the file from which citations are loaded using a template argument (i.e., in the structure at the beginning of your Typst document):
|
||||
|
||||
```typst
|
||||
#show: tultemplate2.with(
|
||||
...
|
||||
citations: "anotherfile.bib",
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
== Internal Links and Anchors<example_anchor>
|
||||
|
||||
Let's continue from the *Links* section (@links).
|
||||
|
||||
You can also create internal links --- for instance, to chapters, pages, or labeled images (those wrapped with the `figure` function).
|
||||
|
||||
```typst
|
||||
= A Good Chapter<good_chapter>
|
||||
|
||||
Let's take a look at A Good Chapter (@good_chapter).
|
||||
```
|
||||
|
||||
Here's what an anchor looks like:
|
||||
|
||||
```typst
|
||||
<anchor_name>
|
||||
```
|
||||
|
||||
You place the anchor on a listed item (after a heading or an image for example), and you can reference it the same way you reference citations:
|
||||
|
||||
```typst
|
||||
@anchor_name
|
||||
```
|
||||
|
||||
We can take a look at this illustrative reference (@example_anchor).
|
||||
|
||||
== Abbreviations
|
||||
|
||||
The LaTeX TUL template includes a list of abbreviations at the beginning of the document --- therefore, we've included one here as well.
|
||||
This list is configured to appear only if there is *at least one* abbreviation defined --- which seemed quite logical.
|
||||
|
||||
You can create (define) the abbreviation #abbr("ABC", "Alphabet") in a text like this:
|
||||
|
||||
```typst
|
||||
The shortcut #abbr("ABC", "Alphabet") is a shortcut for the alphabet of letters.
|
||||
```
|
||||
|
||||
After that, you'll you the abbreviation #abbr("ABC") directly without redefining it:
|
||||
|
||||
```typst
|
||||
The first letter of #abbr("ABC") is the letter "A".
|
||||
```
|
||||
|
||||
The template automatically ensures the following:
|
||||
- The abbreviation appears in the list of abbreviations
|
||||
- When you use an abbreviation for the first time, the template requires you to define it
|
||||
- The abbreviation is only defined once (the first time) or the template will scream in red at you
|
||||
|
||||
When used for the first time (definition), the abbreviation will look like this: #abbr("ABR", "Abbreviation")
|
||||
|
||||
In subsequent uses, it will appear as: #abbr("ABR")
|
||||
|
||||
#highlight[
|
||||
In other words, you do _not_ add abbreviations directly to the abbreviation list.
|
||||
You simply use them elegantly within the text itself.
|
||||
]
|
||||
|
||||
= Using Functions
|
||||
|
||||
Most Typst features are used through what's called function calls.
|
||||
This is quite similar to the previous examples, except that instead of wrapping text with a single symbol or a simple marker, we wrap it with the name of the function.
|
||||
The syntax looks like this:
|
||||
|
||||
```typst
|
||||
#function_name[text itself or other parameters]
|
||||
```
|
||||
|
||||
When you type the hashtag symbol in the editor, it will automatically start suggesting all available functions and their descriptions.
|
||||
Let's move on to some practical examples.
|
||||
|
||||
== Images
|
||||
|
||||
Images can be inserted either by themselves or with a caption.
|
||||
@@ -206,87 +312,7 @@ Finally, there's again a `caption` parameter, used to provide a caption for the
|
||||
Tables also appear at the beginning of the document in a list (if required by the document type).
|
||||
As you've probably noticed by now, this template takes care of this automatically too.
|
||||
|
||||
== Citations
|
||||
|
||||
The template supports citation management using a standard BibLaTeX file @bibtex, just like LaTeX.
|
||||
Almost every website or program that supports citations can generate BibLaTeX-formatted entries --- we recommend using either #link("https://www.zotero.org/")[Zotero] or #link("https://www.citacepro.com/")[Citace.com].
|
||||
You simply add the code for such a citation, in the proper format, to the file _citations.bib_.
|
||||
Once added, you can reference it using `@citation_name` or `#cite(<citation_name>)`.
|
||||
For example, I can reference the Typst citation as #cite(<typst>).
|
||||
|
||||
The format of the _citations.bib_ file is exactly the same as in LaTeX.
|
||||
You can even copy entries directly from sites like in BibLaTeX format --- Typst understands that format, too.
|
||||
If you open a `.bib` file, you'll see that it's simply a plain text file with a specific structure.
|
||||
The provided sample file already contains several citations --- for instance, the one named `typst`, which was already used above.
|
||||
|
||||
You can change the file from which citations are loaded using a template argument (i.e., in the structure at the beginning of your Typst document):
|
||||
|
||||
```typst
|
||||
#show: tultemplate2.with(
|
||||
...
|
||||
citations: "anotherfile.bib",
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
== Internal Links and Anchors<example_anchor>
|
||||
|
||||
Let's continue from the *Links* section (@links).
|
||||
|
||||
You can also create internal links --- for instance, to chapters, pages, or labeled images (those wrapped with the `figure` function).
|
||||
|
||||
```typst
|
||||
= A Good Chapter<good_chapter>
|
||||
|
||||
Let's take a look at A Good Chapter (@good_chapter).
|
||||
```
|
||||
|
||||
Here's what an anchor looks like:
|
||||
|
||||
```typst
|
||||
<anchor_name>
|
||||
```
|
||||
|
||||
You place the anchor on a listed item (after a heading or an image for example), and you can reference it the same way you reference citations:
|
||||
|
||||
```typst
|
||||
@anchor_name
|
||||
```
|
||||
|
||||
We can take a look at this illustrative reference (@example_anchor).
|
||||
|
||||
== Abbreviations
|
||||
|
||||
The LaTeX TUL template includes a list of abbreviations at the beginning of the document --- therefore, we've included one here as well.
|
||||
This list is configured to appear only if there is *at least one* abbreviation defined --- which seemed quite logical.
|
||||
|
||||
You can create (define) the abbreviation #abbr("ABC", "Alphabet") like this:
|
||||
|
||||
```typst
|
||||
#abbr("ABC", "Alphabet")
|
||||
```
|
||||
|
||||
After that, you can use the abbreviation #abbr("ABC") directly without redefining it:
|
||||
|
||||
```typst
|
||||
#abbr("ABC")
|
||||
```
|
||||
|
||||
The template automatically ensures the following:
|
||||
- The abbreviation appears in the list of abbreviations
|
||||
- When you use an abbreviation for the first time, the template requires you to define it
|
||||
- The abbreviation is only defined once (the first time) or the template will scream in red at you
|
||||
|
||||
When used for the first time (definition), the abbreviation will look like this: #abbr("ABR", "Abbreviation")
|
||||
|
||||
In subsequent uses, it will appear as: #abbr("ABR")
|
||||
|
||||
#highlight[
|
||||
In other words, you do _not_ add abbreviations directly to the abbreviation list.
|
||||
You simply use them elegantly within the text itself.
|
||||
]
|
||||
|
||||
== Attachments
|
||||
= Attachments
|
||||
|
||||
At the end of the file, you can add the list of attachments.
|
||||
Currently, we support four types of attachments: links, content, PDF file attached at the end of the document and a reference to an external file (perhaps attached to the system with your {{what}}).
|
||||
|
||||
Reference in New Issue
Block a user