Skip to content

Commit

Permalink
Add codeblock and footnotes (#4)
Browse files Browse the repository at this point in the history
* Add codeblock and footnotes

* temp solution for fsharp highlighting
  • Loading branch information
mrtz-j authored Sep 8, 2024
1 parent 9986c33 commit 1fe345a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
- [ ] Headings (chapter on odd, subsection on even)
- [ ] Font features
- [ ] Figures (captions etc)
- [ ] Code blocks (syntax highlights)
- [x] Code blocks (syntax highlights)
- [ ] Tables
- [ ] Footnotes (?)
- [x] Footnotes (?)
- [ ] Good examples
- [ ] Use of figures, tables, code blocks
- [ ] Side by side
Expand All @@ -24,5 +24,5 @@
- [x] CI/CD
- [x] Formatting
- [x] Build and Release pdf
- [/] Release as lib
- [ ] Release as lib (TODO: Add to local index)
- [ ] License
3 changes: 2 additions & 1 deletion lib.typ
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "@preview/subpar:0.1.1"
#import "@preview/physica:0.9.3": *
#import "@preview/codly:1.0.0": *

#import "modules/frontpage.typ": frontpage
#import "modules/backpage.typ": backpage
Expand Down Expand Up @@ -247,7 +248,7 @@
set par(leading: 0.7em, justify: true, linebreaks: "optimized")

// Default spacing is 1.2em.
show par: set block(spacing: 0.55em)
show par: set block(spacing: 1.35em)

show heading: it => {
v(2.5em, weak: true)
Expand Down
1 change: 1 addition & 0 deletions template/chapters/global.typ
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@

// See https://github.com/typst/packages/tree/main/packages/preview/glossarium
#import "@preview/glossarium:0.4.1": make-glossary, print-glossary, gls, glspl
#import "@preview/codly:1.0.0": *
13 changes: 9 additions & 4 deletions template/chapters/glossary.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

// Not listed in table of contents (the outline)
// Not numbered
// #heading(outlined: false, numbering: none)[
// Glossary
// ]
// #heading(numbering: none, outlined: false)[List of Abbreviations]
// #set page(numbering: "i")
// #counter(page).update(1)
// #set heading(numbering: none)
// #show heading.where(level: 1): it => {
// it
// v(6%, weak: true)
// }

// Add list of terms
// Usage within text will then be #gls(<key>) or plurals #glspl(<key>)
Expand All @@ -22,4 +27,4 @@
),
// show all term even if they are not referenced, default to true
show-all: true,
)
)
15 changes: 15 additions & 0 deletions template/chapters/introduction.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#import "global.typ": *
#show: make-glossary
#show: codly-init

This is a test for bibilography @QayyumY-sac2022. The introduction should be more in-depth than the abstract. The first time it's the long one @uit, but the second time it's the short one @uit.

```rust
pub fn main() {
println!("Hello, world!");
}
```

```fsi
let x = 10
let y = 20
let z = x + y
```

For more information take a look at the repo #footnote[see #link("https://github.com/mrtz-j/typst-thesis-template")]

#lorem(100)
12 changes: 12 additions & 0 deletions template/thesis.typ
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
bibliography: bibliography("refs.bib", title: "Bibliography", style: "ieee"),
)

// Code blocks
#codly(languages: (
rust: (
name: "Rust",
color: rgb("#CE412B"),
),
fs: (
name: "F#",
color: rgb("#6a0dad"),
),
))
#include "./chapters/glossary.typ"
#pagebreak()
Expand Down

0 comments on commit 1fe345a

Please sign in to comment.