Dotfiles V1.5.2
This commit is contained in:
1 parent
1ec21e387a
commit
b5c9d585c1
51 files changed
+1356
-1082
No files matched your search
File renamed without changes.
@@ -0,0 +1,41 @@
|
||||
// TODO: Change Title and Author variables
|
||||
#let papertitle = [Title]
|
||||
#let paperauthor = "Jirayu Ruh"
|
||||
|
||||
// TODO: Change language
|
||||
#let is_german = false
|
||||
|
||||
#set page(
|
||||
paper: "a4",
|
||||
header: {
|
||||
grid(
|
||||
columns: (1fr, 1fr),
|
||||
align(left)[#context document.title], align(right)[#context document.author.at(0)],
|
||||
)
|
||||
line(length: 100%, stroke: 0.5pt)
|
||||
},
|
||||
numbering: "1",
|
||||
margin: (left: 2.5cm, right: 2.5cm, top: 2.5cm, bottom: 2cm),
|
||||
)
|
||||
|
||||
#set text(
|
||||
size: 11pt,
|
||||
lang: if is_german { "de" } else { "en" },
|
||||
region: if is_german { "ch" } else { "us" },
|
||||
)
|
||||
|
||||
#set document(
|
||||
title: papertitle,
|
||||
author: paperauthor,
|
||||
)
|
||||
|
||||
#set par(
|
||||
justify: true,
|
||||
leading: 0.75em,
|
||||
)
|
||||
|
||||
#set heading(numbering: "1.1.1.1.1")
|
||||
|
||||
= #context document.title
|
||||
|
||||
// TODO: Begin Title here
|
||||
@@ -0,0 +1,29 @@
|
||||
// TODO: Change language
|
||||
//ltex: language=de-ch
|
||||
|
||||
#import "../setup.typ": *
|
||||
#import "../preamble.typ": *
|
||||
|
||||
// TODO: Add Lecture Information
|
||||
|
||||
= DISCLAIMER
|
||||
|
||||
Diese Zusammenfassung basiert auf der Vorlesung "" von .
|
||||
|
||||
Ich übernehme keine Haftung für mögliche Fehler in der Zusammenfassung. Bitte beachten Sie, dass diese Zusammenfassung unter Zuhilfenahme von Gemini Notebook erstellt wurde. Obwohl KI ein leistungsstarkes Werkzeug ist, kann sie technische Ungenauigkeiten oder sogenannte „Halluzinationen“ erzeugen. Darüber hinaus habe ich Abschnitte paraphrasiert und eigene Beobachtungen hinzugefügt, was weitere Fehlerquellen darstellen kann.
|
||||
|
||||
*Urheberrecht & Inhaltlicher Hinweis:* Dies ist eine inoffizielle Ressource; sie steht in keiner Verbindung zur ZHAW und wird von dieser nicht unterstützt. Da diese Zusammenfassung mit Hilfe von KI erstellt wurden, kann ich nicht garantieren, dass alle Inhalte ausreichend umformuliert wurden. Einige Abschnitte können den ursprünglichen Präsentationsfolien oder Skripten stark ähneln oder diese direkt zitieren. Alle geistigen Eigentumsrechte am ursprünglichen Kursinhalt verbleiben bei den jeweiligen Autoren der ZHAW.
|
||||
|
||||
*Hinweis für Rechteinhaber:* Dieses Dokument wird ausschliesslich zu Bildungszwecken geteilt. Wenn Sie Rechteinhaber sind und der Aufnahme bestimmter Inhalte widersprechen, kontaktieren Sie mich bitte, und ich werde diese umgehend entfernen.
|
||||
|
||||
Sofern nicht anders angegeben, wurden alle Grafiken persönlich erstellt.
|
||||
|
||||
Fehler können per E-Mail an #link("mailto:ruhjir01@students.zhaw.ch") gemeldet werden.
|
||||
|
||||
Jirayu Ruh
|
||||
|
||||
#datetime.today().display("[day]. [month repr:long] [year]")
|
||||
|
||||
= Credits
|
||||
|
||||
#pagebreak()
|
||||
@@ -0,0 +1,32 @@
|
||||
//ltex: language=de-ch
|
||||
|
||||
#import "setup.typ": *
|
||||
#import "preamble.typ": *
|
||||
|
||||
#show: setup
|
||||
|
||||
#page(numbering: none)[
|
||||
#include "sections/disclaimer.typ"
|
||||
]
|
||||
|
||||
#align(
|
||||
center,
|
||||
[
|
||||
#set par(spacing: 0.4em)
|
||||
#text(
|
||||
size: 11pt,
|
||||
[
|
||||
#context document.title
|
||||
],
|
||||
)
|
||||
|
||||
#text(
|
||||
size: 7pt,
|
||||
[
|
||||
von #context paperauthor, Fehler bitte an #context email
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
#counter(page).update(1)
|
||||
@@ -0,0 +1,175 @@
|
||||
// TODO: Change ltex language
|
||||
//ltex: language=de-ch
|
||||
|
||||
//==============================
|
||||
// VARIABLE IMPORTS
|
||||
//==============================
|
||||
|
||||
#import "setup.typ": *
|
||||
|
||||
//==============================
|
||||
// PACKAGE IMPORTS
|
||||
//==============================
|
||||
|
||||
#import "@preview/catppuccin:1.1.0": catppuccin, flavors
|
||||
#import "@preview/cetz:0.5.2"
|
||||
#import "@preview/cetz-plot:0.1.4"
|
||||
#import "@preview/zap:0.6.0"
|
||||
|
||||
//==============================
|
||||
// COLORS
|
||||
//==============================
|
||||
|
||||
#let flavor = if is_dark_theme {
|
||||
flavors.macchiato
|
||||
} else {
|
||||
flavors.latte
|
||||
}
|
||||
|
||||
#let palette = flavor.colors
|
||||
|
||||
#let CtpRosewater = palette.rosewater.rgb
|
||||
#let CtpFlamingo = palette.flamingo.rgb
|
||||
#let CtpPink = palette.pink.rgb
|
||||
#let CtpMauve = palette.mauve.rgb
|
||||
#let CtpRed = palette.red.rgb
|
||||
#let CtpMaroon = palette.maroon.rgb
|
||||
#let CtpPeach = palette.peach.rgb
|
||||
#let CtpYellow = palette.yellow.rgb
|
||||
#let CtpGreen = palette.green.rgb
|
||||
#let CtpTeal = palette.teal.rgb
|
||||
#let CtpSky = palette.sky.rgb
|
||||
#let CtpSaphire = palette.sapphire.rgb
|
||||
#let CtpBlue = palette.blue.rgb
|
||||
#let CtpLavender = palette.lavender.rgb
|
||||
#let CtpText = palette.text.rgb
|
||||
#let CtpBase = palette.base.rgb
|
||||
#let CtpSurface0 = palette.surface0.rgb
|
||||
|
||||
// TODO: Change MainColor
|
||||
|
||||
#let MainColor = CtpPeach
|
||||
|
||||
|
||||
//==============================
|
||||
// Big Box & Equation Box
|
||||
//==============================
|
||||
|
||||
#let bigbox(body) = align(center)[
|
||||
#block(
|
||||
fill: none,
|
||||
stroke: 5pt + color.mix((MainColor, 20%), (CtpBase, 80%)),
|
||||
inset: 5pt,
|
||||
width: 100% - 5pt,
|
||||
align(left)[#body],
|
||||
)
|
||||
]
|
||||
|
||||
#let smallbox(body) = align(center)[
|
||||
#block(
|
||||
fill: none,
|
||||
stroke: 1pt + color.mix((MainColor, 20%), (CtpBase, 80%)),
|
||||
inset: 5pt,
|
||||
width: 100% - 1pt,
|
||||
align(left)[#body],
|
||||
)
|
||||
]
|
||||
|
||||
#let eqbox(body) = box(
|
||||
fill: color.mix((MainColor, 20%), (CtpBase, 80%)),
|
||||
stroke: 2pt + color.mix((MainColor, 40%), (CtpBase, 60%)),
|
||||
inset: 2pt,
|
||||
body,
|
||||
)
|
||||
|
||||
//==============================
|
||||
// SETUP
|
||||
//==============================
|
||||
|
||||
#let setup(body) = {
|
||||
show: catppuccin.with(flavor)
|
||||
|
||||
set columns(gutter: 7pt)
|
||||
|
||||
set page(
|
||||
paper: "a4",
|
||||
flipped: true,
|
||||
columns: 3,
|
||||
fill: if not is_dark_theme {
|
||||
none
|
||||
} else {
|
||||
CtpBase
|
||||
},
|
||||
margin: (left: 0.6cm, right: 0.6cm, top: 0.6cm, bottom: 0.9cm),
|
||||
numbering: "1",
|
||||
)
|
||||
|
||||
set text(
|
||||
size: 8pt,
|
||||
lang: if is_german { "de" } else { "en" },
|
||||
region: if is_german { "ch" } else { "us" },
|
||||
)
|
||||
|
||||
set document(
|
||||
title: papertitle,
|
||||
author: paperauthor,
|
||||
)
|
||||
|
||||
set par(
|
||||
justify: true,
|
||||
leading: 0.75em,
|
||||
)
|
||||
|
||||
show math.equation.where(block: false): it => {
|
||||
set text(top-edge: "bounds", bottom-edge: "bounds")
|
||||
math.display(it)
|
||||
}
|
||||
show math.equation.where(block: true): set block(above: 0.1em, below: 0.1em)
|
||||
|
||||
show heading.where(level: 1): it => {
|
||||
v(-6pt)
|
||||
block(
|
||||
width: 100%,
|
||||
fill: color.mix((MainColor, 60%), (CtpBase, 40%)),
|
||||
inset: (top: 2pt, bottom: 4pt, left: 2pt, right: 2pt),
|
||||
text(
|
||||
fill: CtpText,
|
||||
size: 11pt,
|
||||
weight: "bold",
|
||||
it.body,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
show heading.where(level: 2): it => {
|
||||
v(-9pt)
|
||||
block(
|
||||
width: 100%,
|
||||
fill: color.mix((MainColor, 40%), (CtpBase, 60%)),
|
||||
inset: (top: 2pt, bottom: 4pt, left: 2pt, right: 2pt),
|
||||
text(
|
||||
fill: CtpText,
|
||||
size: 8pt,
|
||||
weight: "bold",
|
||||
it.body,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
show heading.where(level: 3): it => {
|
||||
v(-9pt)
|
||||
block(
|
||||
width: 100%,
|
||||
fill: color.mix((MainColor, 20%), (CtpBase, 80%)),
|
||||
inset: (top: 2pt, bottom: 4pt, left: 2pt, right: 2pt),
|
||||
text(
|
||||
fill: CtpText,
|
||||
size: 8pt,
|
||||
weight: "bold",
|
||||
it.body,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
body
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//ltex: language=de-ch
|
||||
|
||||
//==============================
|
||||
// SETUP
|
||||
//==============================
|
||||
|
||||
// TODO: Change Title, Author, and email
|
||||
|
||||
#let papertitle = [Title]
|
||||
#let paperauthor = "J. Ruh"
|
||||
#let email = link("mailto:ruhjir01@students.zhaw.ch")
|
||||
|
||||
// TODO: Change language and theme
|
||||
|
||||
#let is_german = true
|
||||
#let is_dark_theme = false
|
||||
|
||||
#let pic_path = if is_dark_theme { "./fig/dark" } else { "./fig/light" }
|
||||
@@ -0,0 +1,25 @@
|
||||
// TODO: Change language
|
||||
//ltex: language=de-ch
|
||||
|
||||
#import "../setup.typ": *
|
||||
#import "../preamble.typ": *
|
||||
|
||||
= DISCLAIMER
|
||||
|
||||
Diese Notizen basiert auf der Vorlesung "" von .
|
||||
|
||||
Ich übernehme keine Haftung für mögliche Fehler in den Notizen. Bitte beachten Sie, dass diese Notizen unter Zuhilfenahme von Gemini Notebook erstellt wurde. Obwohl KI ein leistungsstarkes Werkzeug ist, kann sie technische Ungenauigkeiten oder sogenannte „Halluzinationen“ erzeugen. Darüber hinaus habe ich Abschnitte paraphrasiert und eigene Beobachtungen hinzugefügt, was weitere Fehlerquellen darstellen kann.
|
||||
|
||||
*Urheberrecht & Inhaltlicher Hinweis:* Dies ist eine inoffizielle Ressource; sie steht in keiner Verbindung zur ZHAW und wird von dieser nicht unterstützt. Da diese Notizen mit Hilfe von KI erstellt wurden, kann ich nicht garantieren, dass alle Inhalte ausreichend umformuliert wurden. Einige Abschnitte können den ursprünglichen Präsentationsfolien oder Skripten stark ähneln oder diese direkt zitieren. Alle geistigen Eigentumsrechte am ursprünglichen Kursinhalt verbleiben bei den jeweiligen Autoren der ZHAW.
|
||||
|
||||
*Hinweis für Rechteinhaber:* Dieses Dokument wird ausschliesslich zu Bildungszwecken geteilt. Wenn Sie Rechteinhaber sind und der Aufnahme bestimmter Inhalte widersprechen, kontaktieren Sie mich bitte, und ich werde diese umgehend entfernen.
|
||||
|
||||
Sofern nicht anders angegeben, wurden alle Grafiken persönlich erstellt.
|
||||
|
||||
Fehler können per E-Mail an #link("mailto:ruhjir01@students.zhaw.ch") gemeldet werden.
|
||||
|
||||
Jirayu Ruh
|
||||
|
||||
= Credits
|
||||
|
||||
#pagebreak()
|
||||
@@ -0,0 +1,31 @@
|
||||
#import "setup.typ": *
|
||||
#import "preamble.typ": *
|
||||
|
||||
#show: setup
|
||||
|
||||
#page(header: none, footer: none)[
|
||||
#set align(center)
|
||||
#title[#context document.title]
|
||||
#v(2cm)
|
||||
#text(size: 14pt, weight: "bold")[
|
||||
#context paperauthor
|
||||
]
|
||||
#v(0.5cm)
|
||||
#text(size: 14pt, weight: "bold")[
|
||||
#context paperdate
|
||||
]
|
||||
]
|
||||
|
||||
#page(numbering: none)[
|
||||
#include "sections/disclaimer.typ"
|
||||
]
|
||||
|
||||
#set page(numbering: "i")
|
||||
#counter(page).update(1)
|
||||
#customtoc()
|
||||
#pagebreak()
|
||||
|
||||
|
||||
#set page(numbering: "1")
|
||||
#counter(page).update(1)
|
||||
|
||||
@@ -0,0 +1,771 @@
|
||||
// TODO: Change ltex language
|
||||
//ltex: language=de-ch
|
||||
|
||||
//==============================
|
||||
// VARIABLE IMPORTS
|
||||
//==============================
|
||||
|
||||
#import "setup.typ": *
|
||||
|
||||
//==============================
|
||||
// PACKAGE IMPORTS
|
||||
//==============================
|
||||
|
||||
#import "@preview/catppuccin:1.1.0": catppuccin, flavors
|
||||
#import "@preview/cetz:0.5.2"
|
||||
|
||||
//==============================
|
||||
// COLORS
|
||||
//==============================
|
||||
|
||||
#let flavor = if is_dark_theme {
|
||||
flavors.macchiato
|
||||
} else {
|
||||
flavors.latte
|
||||
}
|
||||
|
||||
#let palette = flavor.colors
|
||||
|
||||
#let CtpRosewater = palette.rosewater.rgb
|
||||
#let CtpFlamingo = palette.flamingo.rgb
|
||||
#let CtpPink = palette.pink.rgb
|
||||
#let CtpMauve = palette.mauve.rgb
|
||||
#let CtpRed = palette.red.rgb
|
||||
#let CtpMaroon = palette.maroon.rgb
|
||||
#let CtpPeach = palette.peach.rgb
|
||||
#let CtpYellow = palette.yellow.rgb
|
||||
#let CtpGreen = palette.green.rgb
|
||||
#let CtpTeal = palette.teal.rgb
|
||||
#let CtpSky = palette.sky.rgb
|
||||
#let CtpSaphire = palette.sapphire.rgb
|
||||
#let CtpBlue = palette.blue.rgb
|
||||
#let CtpLavender = palette.lavender.rgb
|
||||
#let CtpText = palette.text.rgb
|
||||
#let CtpBase = palette.base.rgb
|
||||
#let CtpSurface0 = palette.surface0.rgb
|
||||
|
||||
// TODO: Define MainColor
|
||||
|
||||
// #let MainColor =
|
||||
|
||||
//==============================
|
||||
// COUNTERS
|
||||
//==============================
|
||||
|
||||
#let def-counter = counter("definition")
|
||||
#let thm-counter = counter("theorem")
|
||||
#let cor-counter = counter("corollary")
|
||||
#let lem-counter = counter("lemma")
|
||||
#let prop-counter = counter("proposition")
|
||||
#let claim-counter = counter("claim")
|
||||
#let q-counter = counter("question")
|
||||
#let exe-counter = counter("exercise")
|
||||
#let exa-counter = counter("example")
|
||||
|
||||
//==============================
|
||||
// CUSTOM TOC
|
||||
//==============================
|
||||
|
||||
#let customtoc() = {
|
||||
set page(numbering: none, header: none, footer: none)
|
||||
set par(spacing: 0em)
|
||||
|
||||
layout(size => {
|
||||
let text-size = 25pt
|
||||
let box-height = 1.75cm
|
||||
|
||||
let blue-bg-width = 8cm
|
||||
let right-margin = 2.5cm
|
||||
|
||||
let box-left-edge = (size.width - blue-bg-width) + right-margin
|
||||
|
||||
let shift = 0cm
|
||||
if is_german { shift = 4cm } else { shift = 2cm }
|
||||
let text-dx = box-left-edge - shift
|
||||
|
||||
let title-text(fill-color) = text(
|
||||
size: text-size,
|
||||
weight: "bold",
|
||||
font: "Libertinus Serif",
|
||||
fill: fill-color,
|
||||
)[#toctitle]
|
||||
|
||||
box(width: 100%, height: box-height)[
|
||||
#place(left + horizon, dx: text-dx, title-text(CtpBlue.lighten(40%)))
|
||||
|
||||
#place(right, dx: right-margin, box(
|
||||
width: blue-bg-width,
|
||||
height: 100%,
|
||||
fill: CtpBlue.lighten(40%),
|
||||
clip: true,
|
||||
radius: (left: 2pt),
|
||||
{
|
||||
let relative-dx = text-dx - box-left-edge
|
||||
place(left + horizon, dx: relative-dx, title-text(white))
|
||||
},
|
||||
))
|
||||
]
|
||||
})
|
||||
|
||||
v(1cm)
|
||||
|
||||
context {
|
||||
let headings = query(heading.where(outlined: true))
|
||||
|
||||
for (i, head) in headings.enumerate() {
|
||||
let parent_l2 = headings.slice(0, i + 1).rev().find(h => h.level == 2)
|
||||
|
||||
let ghost_spacing_section = if parent_l2 != none and parent_l2.numbering != none {
|
||||
hide(box(inset: (x: 5pt, y: 6pt), radius: 1pt)[
|
||||
#text(weight: "bold", size: 13pt)[
|
||||
#chaptertitle
|
||||
#let nums = counter(heading).at(parent_l2.location())
|
||||
#if nums.len() > 1 { numbering("1.1", ..nums.slice(1)) } else { numbering(parent_l2.numbering, ..nums) }
|
||||
]
|
||||
])
|
||||
h(0.8em)
|
||||
} else { none }
|
||||
|
||||
let ghost_spacing_sub = if parent_l2 != none and parent_l2.numbering != none {
|
||||
hide(box(inset: (x: 5pt, y: 3pt), radius: 1pt)[
|
||||
#text(weight: "bold", size: 13pt)[
|
||||
#chaptertitle
|
||||
#let nums = counter(heading).at(parent_l2.location())
|
||||
#if nums.len() > 1 { numbering("1.1", ..nums.slice(1)) } else { numbering(parent_l2.numbering, ..nums) }
|
||||
]
|
||||
])
|
||||
h(0.8em)
|
||||
} else { none }
|
||||
|
||||
if head.level == 1 {
|
||||
link(head.location())[
|
||||
#block(width: 100%, inset: (top: 20pt, bottom: 15pt))[
|
||||
#text(size: 16pt, weight: "bold", fill: CtpBlue)[
|
||||
#if head.numbering != none [
|
||||
#numbering(head.numbering, ..counter(heading).at(head.location()))
|
||||
#h(1.5em)
|
||||
]
|
||||
#head.body
|
||||
]
|
||||
#h(1fr)
|
||||
#text(size: 16pt, weight: "bold", fill: CtpText)[#head.location().page()]
|
||||
]
|
||||
]
|
||||
} else if head.level == 2 {
|
||||
link(head.location())[
|
||||
#block(width: 100%)[
|
||||
#box(width: 100%)[
|
||||
#set align(horizon)
|
||||
#box(fill: CtpBlue.lighten(40%), inset: (x: 5pt, y: 0pt), outset: (y: 6pt), radius: 1pt)[
|
||||
#text(fill: white, weight: "bold", size: 13pt)[
|
||||
#chaptertitle
|
||||
#let nums = counter(heading).at(head.location())
|
||||
#if nums.len() > 1 { numbering("1.1", ..nums.slice(1)) } else { numbering(head.numbering, ..nums) }
|
||||
]
|
||||
]
|
||||
#h(0.8em)
|
||||
#text(fill: CtpBlue, size: 13pt)[#head.body]
|
||||
#h(0.5em)
|
||||
#box(width: 1fr, height: 7pt, align(bottom, line(
|
||||
length: 100%,
|
||||
stroke: 0.3pt + CtpText,
|
||||
)))
|
||||
#h(0.5em)
|
||||
#box(
|
||||
text(fill: CtpText, size: 13pt)[
|
||||
#pagetitle
|
||||
#head.location().page()
|
||||
],
|
||||
)
|
||||
#let right-margin = 2.54cm
|
||||
#place(
|
||||
right,
|
||||
dx: right-margin,
|
||||
box(
|
||||
width: right-margin - 0.5em,
|
||||
height: 0pt,
|
||||
align(bottom, line(
|
||||
length: 100%,
|
||||
stroke: 0.3pt + CtpText,
|
||||
)),
|
||||
),
|
||||
)
|
||||
]
|
||||
]
|
||||
]
|
||||
} else if head.level == 3 {
|
||||
link(head.location())[
|
||||
#block(width: 100%)[
|
||||
#box(width: 100%)[
|
||||
#set align(horizon)
|
||||
#ghost_spacing_section
|
||||
#text(fill: CtpText, size: 10.5pt)[
|
||||
#if head.numbering != none [
|
||||
#let nums = counter(heading).at(head.location())
|
||||
#if nums.len() > 1 { numbering("1.1", ..nums.slice(1)) } else { numbering(head.numbering, ..nums) }
|
||||
#h(0.8em)
|
||||
]
|
||||
]
|
||||
#text(fill: CtpBlue, size: 10.5pt)[#head.body]
|
||||
#h(1fr)
|
||||
#text(fill: CtpText, size: 10.5pt)[
|
||||
#head.location().page()
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
} else if head.level == 4 {
|
||||
let is_first = i == 0 or headings.at(i - 1).level != 4
|
||||
let is_last = i == headings.len() - 1 or headings.at(i + 1).level != 4
|
||||
if is_first {
|
||||
ghost_spacing_sub
|
||||
}
|
||||
link(head.location())[
|
||||
#text(fill: CtpBlue, size: 10pt)[
|
||||
#head.body
|
||||
]
|
||||
#text(fill: CtpText, size: 10pt)[
|
||||
--- #head.location().page()
|
||||
]
|
||||
]
|
||||
if not is_last {
|
||||
text(fill: CtpText.lighten(20%), size: 10pt)[
|
||||
#h(0.5em) • #h(0.5em)
|
||||
]
|
||||
} else {
|
||||
parbreak()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==============================
|
||||
// BOXES
|
||||
//==============================
|
||||
|
||||
//------------------------------
|
||||
// DEFINITION
|
||||
//------------------------------
|
||||
|
||||
#let definition(title, body) = {
|
||||
let border-color = color.mix((CtpRed, 80%), (CtpText, 20%))
|
||||
let bg-color = CtpSurface0
|
||||
|
||||
let badge-edge = color.mix((CtpRed, 60%), (CtpText, 40%))
|
||||
let badge-mid = color.mix((CtpRed, 80%), (CtpText, 20%))
|
||||
let badge-bg = gradient.linear(badge-edge, badge-mid, badge-edge)
|
||||
|
||||
block(width: 100%, breakable: false)[
|
||||
#v(16pt)
|
||||
#def-counter.step()
|
||||
|
||||
#block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: 1.5pt + border-color,
|
||||
radius: 5pt,
|
||||
inset: (top: 24pt, bottom: 15pt, left: 15pt, right: 15pt),
|
||||
)[
|
||||
#set text(fill: CtpText)
|
||||
#body
|
||||
]
|
||||
|
||||
#place(
|
||||
top + left,
|
||||
dx: 25pt,
|
||||
dy: 4pt,
|
||||
box(fill: badge-bg, inset: (x: 12pt, y: 6pt), radius: 4pt)[
|
||||
#text(fill: white, weight: "bold", size: 11pt)[
|
||||
#context {
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + def-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
[Definition #numbering-string: #title]
|
||||
}
|
||||
]
|
||||
],
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// THEOREM
|
||||
//------------------------------
|
||||
|
||||
#let theorem(body) = {
|
||||
let border-color = CtpLavender
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: (left: 4pt + border-color),
|
||||
inset: (top: 12pt, bottom: 12pt, left: 16pt, right: 12pt),
|
||||
breakable: true,
|
||||
)[
|
||||
#thm-counter.step()
|
||||
|
||||
#context {
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + thm-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
|
||||
text(fill: border-color, weight: "bold", size: 11pt)[
|
||||
#theorytitle #numbering-string
|
||||
]
|
||||
}
|
||||
|
||||
#v(0.5em, weak: true)
|
||||
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// COROLLARY
|
||||
//------------------------------
|
||||
|
||||
#let corollary(body) = {
|
||||
let border-color = CtpMauve
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: (left: 4pt + border-color),
|
||||
inset: (top: 12pt, bottom: 12pt, left: 16pt, right: 12pt),
|
||||
breakable: true,
|
||||
)[
|
||||
#cor-counter.step()
|
||||
#context {
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + cor-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
|
||||
text(fill: border-color, weight: "bold", size: 11pt)[
|
||||
#corollarytitle #numbering-string
|
||||
]
|
||||
}
|
||||
#v(0.5em, weak: true)
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//-----------------------------
|
||||
// LEMMA
|
||||
//-----------------------------
|
||||
|
||||
#let lemma(body) = {
|
||||
let border-color = CtpPeach
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: (left: 4pt + border-color),
|
||||
inset: (top: 12pt, bottom: 12pt, left: 16pt, right: 12pt),
|
||||
breakable: true,
|
||||
)[
|
||||
#lem-counter.step()
|
||||
|
||||
#context {
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + lem-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
|
||||
text(fill: border-color, weight: "bold", size: 11pt)[
|
||||
Lemma #numbering-string
|
||||
]
|
||||
}
|
||||
|
||||
#v(0.5em, weak: true)
|
||||
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// PROPOSITION
|
||||
//------------------------------
|
||||
|
||||
#let proposition(body) = {
|
||||
let border-color = CtpSky
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: (left: 4pt + border-color),
|
||||
inset: (top: 12pt, bottom: 12pt, left: 16pt, right: 12pt),
|
||||
breakable: true,
|
||||
)[
|
||||
// Step the proposition counter
|
||||
#prop-counter.step()
|
||||
|
||||
// 1. The Dynamic Title
|
||||
#context {
|
||||
// Grab heading numbers up to level 2 and combine with proposition count
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + prop-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
|
||||
text(fill: border-color, weight: "bold", size: 11pt)[
|
||||
#proposaltitle #numbering-string
|
||||
]
|
||||
}
|
||||
|
||||
// 2. Spacing between title and body
|
||||
#v(0.5em, weak: true)
|
||||
|
||||
// 3. The Body Content
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// CLAIM
|
||||
//------------------------------
|
||||
|
||||
#let claim(title, body) = {
|
||||
let border-color = CtpGreen
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: (left: 4pt + border-color),
|
||||
inset: (top: 12pt, bottom: 12pt, left: 16pt, right: 12pt),
|
||||
breakable: true,
|
||||
)[
|
||||
#claim-counter.step()
|
||||
|
||||
#context {
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + claim-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
|
||||
text(fill: border-color)[
|
||||
#text(weight: "bold", size: 11pt)[#claimtitle #numbering-string]
|
||||
#if title != none [ #text(weight: "regular", size: 11pt)[#title] ]
|
||||
]
|
||||
}
|
||||
|
||||
#v(0.5em, weak: true)
|
||||
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// EXERCISE
|
||||
//------------------------------
|
||||
|
||||
#let exercise(title, body) = {
|
||||
let border-color = CtpBlue
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: (left: 4pt + border-color),
|
||||
inset: (top: 12pt, bottom: 12pt, left: 16pt, right: 12pt),
|
||||
breakable: true,
|
||||
)[
|
||||
#exe-counter.step()
|
||||
|
||||
#context {
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + exe-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
|
||||
text(fill: border-color)[
|
||||
#text(weight: "bold", size: 11pt)[Aufgabe #numbering-string]
|
||||
#if title != none [ #text(weight: "regular", size: 11pt)[ #title] ]
|
||||
]
|
||||
}
|
||||
|
||||
#v(0.5em, weak: true)
|
||||
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
//------------------------------
|
||||
// EXAMPLE
|
||||
//------------------------------
|
||||
|
||||
#let example(title, body) = {
|
||||
let border-color = CtpTeal
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: 1pt + border-color,
|
||||
inset: (top: 12pt, bottom: 12pt, left: 12pt, right: 12pt),
|
||||
breakable: true,
|
||||
)[
|
||||
#exa-counter.step()
|
||||
|
||||
#context {
|
||||
let h-nums = counter(heading).get().slice(0, 2)
|
||||
let all-nums = h-nums + exa-counter.get()
|
||||
let numbering-string = all-nums.map(str).join(".")
|
||||
|
||||
text(fill: border-color)[
|
||||
#text(weight: "bold", size: 11pt)[Example #numbering-string]
|
||||
#if title != none [ #text(weight: "regular", size: 11pt)[ (#title)] ]
|
||||
]
|
||||
}
|
||||
|
||||
#v(0.5em, weak: true)
|
||||
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// SOLUTION BOX
|
||||
//------------------------------
|
||||
|
||||
#let solution(body) = {
|
||||
block(
|
||||
width: 100%,
|
||||
breakable: true,
|
||||
above: 1.2em,
|
||||
below: 1.2em,
|
||||
)[
|
||||
_*#solutiontitle:*_ #body
|
||||
]
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// QUESTION
|
||||
//------------------------------
|
||||
|
||||
#let question(body) = {
|
||||
let border-color = CtpSaphire
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: 2pt + border-color,
|
||||
radius: 4pt,
|
||||
breakable: true,
|
||||
inset: (top: 0pt, bottom: 12pt, left: 12pt, right: 12pt),
|
||||
)[
|
||||
#q-counter.step()
|
||||
|
||||
#place(
|
||||
top + left,
|
||||
dx: -13pt,
|
||||
dy: 0pt,
|
||||
block(
|
||||
fill: border-color,
|
||||
radius: (bottom-right: 12pt, top-left: 4pt),
|
||||
inset: (top: 8pt, bottom: 8pt, left: 14pt, right: 16pt),
|
||||
)[
|
||||
#text(fill: white, weight: "bold", size: 11pt)[
|
||||
#context [
|
||||
#questiontitle #q-counter.display()
|
||||
]
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
#block(height: 28pt)
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//==============================
|
||||
// NOTE
|
||||
//==============================
|
||||
|
||||
#let note(body) = {
|
||||
let border-color = CtpText
|
||||
let bg-color = CtpSurface0
|
||||
let text-color = CtpText
|
||||
|
||||
block(
|
||||
width: 100%,
|
||||
fill: bg-color,
|
||||
stroke: 1pt + border-color,
|
||||
radius: 4pt,
|
||||
breakable: true,
|
||||
above: 2em,
|
||||
inset: (top: 18pt, bottom: 12pt, left: 12pt, right: 12pt),
|
||||
)[
|
||||
#place(
|
||||
top + left,
|
||||
dx: 16pt,
|
||||
dy: -28pt,
|
||||
box(
|
||||
fill: CtpBase,
|
||||
stroke: 1pt + border-color,
|
||||
radius: 4pt,
|
||||
inset: (x: 8pt, y: 4pt),
|
||||
)[
|
||||
#place(left + horizon, dx: -10pt)[
|
||||
#circle(radius: 2pt, fill: border-color)
|
||||
]
|
||||
|
||||
#place(right + horizon, dx: 10pt)[
|
||||
#circle(radius: 2pt, fill: border-color)
|
||||
]
|
||||
|
||||
#text(weight: "bold", size: 11pt)[Note:-]
|
||||
],
|
||||
)
|
||||
|
||||
#set text(fill: text-color)
|
||||
#body
|
||||
]
|
||||
}
|
||||
|
||||
//==============================
|
||||
// SHORTCODES
|
||||
//==============================
|
||||
|
||||
#let def(title, body) = definition(title, body)
|
||||
#let thm(body) = theorem(body)
|
||||
#let cor(body) = corollary(body)
|
||||
#let lem(body) = lemma(body)
|
||||
#let prop(body) = proposition(body)
|
||||
#let clm(title, body) = claim(title, body)
|
||||
#let exe(title, body) = exercise(title, body)
|
||||
#let qst(body) = question(body)
|
||||
#let exa(title, body) = example(title, body)
|
||||
#let sol(body) = solution(body)
|
||||
#let nt(body) = note(body)
|
||||
|
||||
//==============================
|
||||
// SETUP
|
||||
//==============================
|
||||
|
||||
#let setup(body) = {
|
||||
show: catppuccin.with(flavor)
|
||||
|
||||
set page(
|
||||
paper: "a4",
|
||||
fill: if not is_dark_theme {
|
||||
none
|
||||
} else {
|
||||
CtpBase
|
||||
},
|
||||
numbering: "1",
|
||||
)
|
||||
|
||||
set text(
|
||||
size: 11pt,
|
||||
lang: if is_german { "de" } else { "en" },
|
||||
region: if is_german { "ch" } else { "us" },
|
||||
)
|
||||
|
||||
set document(
|
||||
title: papertitle,
|
||||
author: paperauthor,
|
||||
)
|
||||
|
||||
set par(
|
||||
justify: true,
|
||||
leading: 0.75em,
|
||||
)
|
||||
|
||||
set heading(numbering: "I.1.1.1.1")
|
||||
|
||||
show math.equation.where(block: false): it => {
|
||||
math.display(it)
|
||||
}
|
||||
|
||||
//==============================
|
||||
// REPORT SETUP
|
||||
//==============================
|
||||
|
||||
//------------------------------
|
||||
// PART HEADING
|
||||
//------------------------------
|
||||
|
||||
show heading.where(level: 1): it => {
|
||||
pagebreak(weak: true)
|
||||
|
||||
align(center + horizon)[
|
||||
#text(size: 2.5em, weight: "regular")[
|
||||
Part #counter(heading).display()
|
||||
]
|
||||
#v(0em)
|
||||
#text(size: 2.5em, weight: "regular")[
|
||||
#it.body
|
||||
]
|
||||
]
|
||||
|
||||
pagebreak()
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// CHAPTER HEADING
|
||||
//------------------------------
|
||||
|
||||
show heading.where(level: 2): it => {
|
||||
def-counter.update(0)
|
||||
thm-counter.update(0)
|
||||
cor-counter.update(0)
|
||||
lem-counter.update(0)
|
||||
prop-counter.update(0)
|
||||
claim-counter.update(0)
|
||||
exe-counter.update(0)
|
||||
exa-counter.update(0)
|
||||
pagebreak(weak: true)
|
||||
v(5em)
|
||||
|
||||
// This block creates the large LaTeX-style header
|
||||
block(width: 100%)[
|
||||
#text(size: 2em, weight: "regular")[
|
||||
Chapter #counter(heading).display((..nums) => str(nums.pos().last()))
|
||||
]
|
||||
#v(0em)
|
||||
#text(size: 2.5em, weight: "regular")[
|
||||
#it.body
|
||||
]
|
||||
]
|
||||
|
||||
v(1.5em)
|
||||
}
|
||||
|
||||
|
||||
//------------------------------
|
||||
// HEADING NUMBERING
|
||||
//------------------------------
|
||||
|
||||
set heading(numbering: (..nums) => {
|
||||
let vals = nums.pos()
|
||||
|
||||
if vals.len() == 1 {
|
||||
numbering("I", ..vals)
|
||||
} else if vals.len() == 2 {
|
||||
numbering("1", ..vals.slice(1))
|
||||
} else {
|
||||
numbering("1.1", ..vals.slice(1))
|
||||
}
|
||||
})
|
||||
|
||||
body
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
//==============================
|
||||
// SETUP
|
||||
//==============================
|
||||
|
||||
// TODO: Change papertitle
|
||||
#let papertitle = []
|
||||
#let paperauthor = "J. Ruh"
|
||||
#let email = link("mailto:ruhjir01@students.zhaw.ch")
|
||||
|
||||
// TODO: Change language and theme
|
||||
#let is_german = true
|
||||
#let is_dark_theme = false
|
||||
|
||||
#let pic_path = if is_dark_theme { "./Bilder/dark" } else { "./Bilder/light" }
|
||||
Reference in new issue
Block a user