-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from krestenlaust/make-demo-template
Make demo template
- Loading branch information
Showing
20 changed files
with
1,730 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
= Introduction | ||
Getting started with Typst shouldn't be that difficult. The language is pretty similar to JavaScript #footnote([A programming language which is known for its incredible type system!]). | ||
|
||
- This is a list item | ||
- This is also a list item | ||
|
||
+ This is an enumerated list item | ||
+ This is another one | ||
|
||
== Basic Math | ||
Math in Typst, is pretty similar to the way it's done in LaTeX. Here are some basic equations. | ||
|
||
The sum of the numbers from | ||
$1$ to $n$ is: | ||
|
||
$ sum_(k=1)^n k = (n(n+1))/2 $ | ||
|
||
This math isn't centered: | ||
|
||
// No spaces around the $-signs | ||
$x=123+123$ | ||
|
||
This is: | ||
|
||
#figure( | ||
rect[$ delta "if" x <= 5 $], | ||
caption: [This is an equation as a figure *with* a border] | ||
) <math:borderedEquation> | ||
|
||
#figure( | ||
[$ f(x) = (x + 1) / x $], | ||
caption: [This is an equation as a figure *without* a border] | ||
) <math:simpleEquation> | ||
|
||
The math in @math:simpleEquation is referenced right here. | ||
|
||
=== Matrices | ||
|
||
This is an example of a matrix: | ||
$ mat( | ||
1, 2, ..., 10; | ||
2, 2, ..., 10; | ||
dots.v, dots.v, dots.down, dots.v; | ||
10, 10, ..., 10; | ||
) $ | ||
|
||
|
||
== Sources & bibliography | ||
To add a source, you just have to reference your `.bib` file like the following anywhere in a document: | ||
```typst | ||
#bibliography("sources/sample.bib") | ||
``` | ||
|
||
In this project it's located in `main.typ`. Now it can be referred the same way a figure is referred: `@einstein` @einstein. A reference only shows up in the bibliography section if it has at least one mention. | ||
|
||
|
||
== Getting Started | ||
How do I start? | ||
|
||
=== Write Typst Collaboratively | ||
You can use #link("https://typst.app/")[Typst.app] to write collaboratively. Just download #link("https://github.com/krestenlaust/AAU-Typst-Template/")[this project] as zip, and upload the following to an empty typst project: | ||
|
||
- main.typ | ||
- template.typ | ||
- (folder) AAUgraphics | ||
- (folder) Chapters | ||
|
||
== Other Functions | ||
This is the lorem ipsum function: | ||
#lorem(20) | ||
|
||
=== Contributions | ||
#lorem(40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
= Using Various Technical Elements | ||
This section covers the following topics: | ||
- Code formatting | ||
- Some graphs | ||
|
||
== Representing Code | ||
The easiest way to represent code in a document is using the native Typst functionality. It uses the exact same syntax as regular extended markdown. | ||
|
||
This is an example of Scala. | ||
```scala | ||
@main def hello() = | ||
println("Hello world") | ||
``` | ||
|
||
Below is an example of how to make it a figure. | ||
|
||
#figure( | ||
rect( // The rectangle is optional. | ||
```scala | ||
@main def hello() = | ||
println("Hello world") | ||
```), | ||
caption: [The same snippet of Scala code, now as a figure#footnote([You will notice that Typst has automatically detected it as a Listing and is numbering it accordingly])] | ||
) <code:scala-snippet> | ||
|
||
|
||
@code:scala-snippet shows how to put a piece of code into a figure, and this text shows how to reference it. | ||
|
||
=== Line numbers | ||
So you want line numbers as well? This isn't natively supported#footnote([This is most likely because of the KISS-principle.]), but the community has developed a couple packages to solves this. | ||
|
||
// TODO: Write section about using line numbers. | ||
|
||
== Use of Packages | ||
This section refers to the packages located here: https://typst.app/docs/packages/. | ||
|
||
// TODO: Write short section about packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
= Command- and Markup-Mode | ||
Typst has two modes of text. This text right here is written directly in markup mode. The default mode of a document is always markup mode. To enter command mode for a single command, the \# is used. | ||
|
||
rect() | ||
#rect() | ||
|
||
To enter markup mode in a command context/mode, use [], previously shown, this can be thought of as similar to a string in a general-purpose programming language#footnote("Typst also has a concept of strings (using double quotes \"), used primarily in functions, like this one right here.")#footnote([This could've also been written using this mode. This way its easier to markup *things* than in a string.]). | ||
|
||
These two operators combined can be used for the following: | ||
#[This is exactly the same as] writing the text like this. | ||
|
||
|
||
To enter command-mode for multiple commands, use {}#footnote([This is generally only used in the template file, it's pretty rare to need to use multiple commands in a row, in documents like this one.]) | ||
|
||
== Further reading & Assistance | ||
The Typst documentation has, for the most part, matured enough to answer any question. The documentation is located at https://typst.app/docs. Furthermore, the documentation site often appears in Google search results. | ||
|
||
Typst has a very welcoming community, the easiest and fastest place to get help with an issue is their Discord server at https://typst.app/docs/community/. | ||
|
||
If you are a fellow student on AAU (Or any other university/high-school for that sake), and are experiencing issues with this Template (Or Typst in general) feel free to reach out at `kscker23[at]student.aau.dk`, and I'll do my best. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#import "template.typ": * | ||
|
||
// Take a look at the file `template.typ` in the file panel | ||
// to customize this template and discover how it works. | ||
#show: project.with( | ||
meta: ( | ||
title: "A demonstration of the features of Typst", | ||
theme: "Marvelous Theme", | ||
project_period: "Fall Semester 2023", | ||
project_group: "group 1", | ||
participants: ( | ||
(name: "Kresten", email: "kresten@gmail.com"), | ||
(name: "Laust", email: "laust@gmail.com"), | ||
), | ||
supervisor: ( | ||
(name: "Anders And", email: "abc@abc.com"), | ||
), | ||
date: "21. December 2023", | ||
), | ||
// Insert your abstract after the colon, wrapped in brackets. | ||
// Example: `abstract: [This is my abstract...]` | ||
abstract: lorem(59), | ||
department: "Computer Science", | ||
) | ||
|
||
// This is the primary file in the project. | ||
// Commonly referred to as 'master' in LaTeX, and wokenly called 'main' in Typst. | ||
|
||
#include "Chapters/introduction.typ" | ||
#pagebreak(weak: true) | ||
|
||
#include "Chapters/technical_elements.typ" | ||
#pagebreak(weak: true) | ||
|
||
#include "Chapters/understanding_typst.typ" | ||
#pagebreak(weak: true) | ||
|
||
#bibliography("sources/sample.bib") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@article{einstein, | ||
author = {Einstein, Albert}, | ||
title = {On the Electrodynamics of Moving Bodies}, | ||
journal = {Annalen der Physik}, | ||
volume = {322}, | ||
number = {10}, | ||
pages = {891--921}, | ||
year = {1905}, | ||
publisher = {Wiley-VCH}, | ||
doi = {10.1002/andp.19053221004} | ||
} |
File renamed without changes.
Oops, something went wrong.