Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make demo template #15

Merged
merged 27 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5662dfe
Initial file added
krestenlaust Dec 4, 2023
5862b4f
Customized template
krestenlaust Dec 4, 2023
3bd773a
Started introductino
krestenlaust Dec 4, 2023
b5e7d8f
Modified Github action to build demo as well
krestenlaust Dec 5, 2023
379e47e
Updated github action
krestenlaust Dec 5, 2023
e2c160a
Restructured project and updated readme
krestenlaust Dec 17, 2023
6a8aa0c
Changed demo
krestenlaust Dec 17, 2023
a9ad5ce
Tried to resolve GitHub Action issue
krestenlaust Dec 17, 2023
543b461
Debug action
krestenlaust Dec 18, 2023
b547d0b
Merge branch 'main' into make-demo-template
krestenlaust Dec 19, 2023
2f59811
Removed new action and restored old action
krestenlaust Dec 19, 2023
45c5854
Added math examples to the demo
krestenlaust Dec 20, 2023
95030b0
Added section about command- and contentmode
krestenlaust Dec 20, 2023
98d2ce9
Refactored and moved around in template
krestenlaust Dec 20, 2023
6ea179e
fixup! Added section about command- and contentmode
krestenlaust Dec 20, 2023
4d73c10
Added small chapter about using typst.app
krestenlaust Dec 20, 2023
b4ff98e
Merge branch 'main' into make-demo-template
krestenlaust Dec 21, 2023
e6062e6
Added section 'Further reading & assistance'
krestenlaust Jan 13, 2024
5918e71
Wrote chapter 'Technical Elements'
krestenlaust Jan 13, 2024
9eed315
Added soft pagebreaks between chapters.
krestenlaust Jan 13, 2024
ced359f
Added sources.
krestenlaust Jan 19, 2024
e9f4b20
Reorganized templates into folders.
krestenlaust Jan 23, 2024
962ce31
Modified Github action, and reorganized some more.
krestenlaust Jan 23, 2024
a2a882e
fixup! Modified Github action, and reorganized some more.
krestenlaust Jan 23, 2024
f6a0932
Improved readme
krestenlaust Jan 23, 2024
561a5fc
Disabled report-template compilation
krestenlaust Jan 23, 2024
a1b5403
Fixed upload target
krestenlaust Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Typst
- name: Compile singlefile-template
uses: lvignoli/typst-action@main
with:
source_file: main.typ
source_file: singlefile-template/main.typ

#- name: Compile report-template
# uses: lvignoli/typst-action@main
# with:
# source_file: report-template/main.typ

- name: Upload PDF file
uses: actions/upload-artifact@v3
with:
name: PDF
path: main.pdf
path: |
singlefile-template/main.pdf
#report-template/main.pdf
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# AAU Typst Template
The widely used AAU LaTeX report template, rewritten in Typst

## Project Structure
This is an overview of the folders/files in the root of this repository:

Each template contains the following:

- `AAUgraphics`
Contains the graphics used in the template.

- `main.typ`
This is the main source, it includes any other files, and this file is the sole target for the compiler, if you want to compile locally, run `typst compile main.typ`.

- `template.typ`
The main template file. This file is located in `report-template` (and a copy is stored in `singlefile-template`).
This file uses the graphics located in `AAUgraphics`.


## Inspiration
Typst looks pretty cool: [https://typst.app/home](https://typst.app/home)

Expand Down
File renamed without changes
73 changes: 73 additions & 0 deletions report-template/chapters/introduction.typ
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)
37 changes: 37 additions & 0 deletions report-template/chapters/technical_elements.typ
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.
20 changes: 20 additions & 0 deletions report-template/chapters/understanding_typst.typ
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.
38 changes: 38 additions & 0 deletions report-template/main.typ
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")
11 changes: 11 additions & 0 deletions report-template/sources/sample.bib
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.
Loading