kit-books

books of obscure KIT shit
git clone git://source.orangerot.dev/university/kit-books.git
Log | Files | Refs | LICENSE

commit 07b5af5a1702127dcbf3d59347ecf0508b99aba4
parent 1a3c60aed6d6f6a3b1c577b60f1ba12f418dad7e
Author: Orangerot <purple@orangerot.dev>
Date:   Sun, 29 Jun 2025 00:25:42 +0200

feat(ggg): flashcard formatting

Diffstat:
Mggg/ggg-cards.typ | 43++++++++++++++++++++++++++++++++++++++-----
1 file changed, 38 insertions(+), 5 deletions(-)

diff --git a/ggg/ggg-cards.typ b/ggg/ggg-cards.typ @@ -1,7 +1,24 @@ #import "@preview/cetz:0.4.0" -#set page(margin: 1cm, columns: 2) +/* +* How to use for anki +* ------------------- +* +* typst compile ggg-cards.typ output/{0p}ggg-cards.svg +* ls | while read -r a && read -r b; do +* echo "<img src='$a'/>, <img src='$b'/>"; +* done > geometrische-grundlagen-der-geometrieverarbeitung.csv +* +* put all images from ./output in your ankis collection.media directory +* +*/ + +// #set page(margin: 1cm, columns: 2) +#show heading: it => none #set heading(numbering: "1.1") +#set par(justify: true) + +#show math.equation.where(block: false): box #set math.mat(delim: "[") #set math.vec(delim: "[") @@ -13,13 +30,29 @@ output } +#let numberingH(c)={ + return numbering(c.numbering,..counter(heading).at(c.location())) +} + #let card( question: "", answer: "" -) = rect(width: 100%)[ - #strong(question) - - #answer +) = [ + // #rect(width: 100%)[ + #set page("a7", flipped: true, width: auto, header: [ + #context { + let h = query(selector(heading.where(level: 1)).before(here())).last() + let s = query(selector(heading.where(level: 2)).before(here())).last() + text(size: 7.8pt)[#smallcaps()[#numberingH(h) #h.body / #numberingH(s) #s.body]] + } + ]) + #page()[ + #strong(question) + ] + #page()[ + #answer + ] + // ] ]