repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/label-03.typ
typst
Other
// Test abusing dynamic labels for styling. #show <red>: set text(red) #show <blue>: set text(blue) *A* *B* <red> *C* #label("bl" + "ue") *D*
https://github.com/HiiGHoVuTi/requin
https://raw.githubusercontent.com/HiiGHoVuTi/requin/main/algo/aprox.typ
typst
#import "../lib.typ": * #show heading: heading_fct #import "@preview/diagraph:0.2.1": * Les graphes $G=(V,E)$ sont ici tous non orientés, on a donc $E$ qui est un ensemble de couples respectant $forall (x,y) in E, (y,x) in E$. Pour tout $G=(V,E)$ un graphe, on note $Delta(G) = max{ deg s : s in V }$. Soit $G=(V,E)$ un graphe, on dit que $I subset.eq V$ est un _indépendant_ si $I^2 sect E = emptyset$. Vous avez le choix de la structure de données utillisé pour stoquer le graphe pour les questions d'algorithmique. On introduit le problème *Maximum Independant Set (MIS)* : #problem([*Maximum Independant Set (MIS)*],[Un graphe $G=(V,E)$],$max_(I subset.eq V) {|I| : I^2sect E = emptyset}$) #question(3)[Montrer que si $Delta (G) = d$, il existe une $d$-approximation de *MIS* en $O(|S|^2)$.\ On montrera la correction et la terminaison de l'algorithme.] // #correct([]) #correct([ On considère l'algorithme suivant : #rect( $ &I <-- emptyset\ &"Tant que " exists x in V, forall j in I, {x,j} in.not E :\ &#h(20pt) T <-- I union {x}\ &"Fin tant que"\ &"Renvoyer" I $) L'algorithme termine bien ($I$ grandit strictement en cardinal à chaque itération, et si $I=V$ alors la boucle termine), et $I$ est bien un indépendant (chaque élément ajouté est indépendant avec ceux déjà présent, donc pour tout paire dans $I$, en considérent celui qui a été ajouté en dernier, l'arc entre les deux éléments n'existe pas). On note $"GLOU"$ l'ensemble associé à la solution retourné par cet algorithme, et on note $"GLOU"^*$ un indépendant maximum. On note aussi $W(T)$ le voisinage de $T subset.eq V$ (qui contiens $T$). On remarque d'abord que $W("GLOU") = S$. Soit $x in "GLOU"$, alors $|W({x}) sect "GLOU"^*| <= d$ car sinon, ça indiquerai que les $d+1$ sommets du voisinages aurai été pris, dont $x$ et un de ses voisins (donc non indépendant, ce qui est absurde). On a donc: $ |"GLOU"^*| = |"GLOU"^* sect V| &= |"GLOU"^* sect sect.big_(x in "GLOU") W({x})|\ &<= sum_(x in "GLOU") |"GLOU"^* sect W(x)| <= d|"GLOU"| $ C'est bien une $d$-approximation. $square$ ]) On dit que $G'=(V',E')$ est un _sous-graphe_ de $G$ si $V' subset.eq V$ et que $E' subset.eq E sect V'^2$ \ On dit que $G$ est _$d$-dégénéré_ si tout sous-graphe de $G$ contiens un sommet de degrée inférieur ou égal à $d$ #question(3)[Montrer que si $G$ est $d$-dégénéré, alors il existe une $d$-approximation en $O(|S| times |E|)$] // #correct([]) #correct([ On garde la même notation pour les voisinages. #rect( $ &I <-- emptyset\ &"Tant que " W(I) != V :\ &#h(20pt) x <-- "Sommet de degrée le plus etit dans " V \\ W(I) \ &#h(20pt) I <-- I union {x} \ &"Fin tant que"\ &"Renvoyer" I $) L’algorithme 2 termine et renvoie bien un indépendant pour les mêmes raisons que pour la question 1. On note $"GLOU"^∗$ une solution optimale. A chaque itération, on est assuré que le sommet choisi est de degrée inférieur à d dans le sous-graphe $V \\ W(I)$ : donc pour chaque $x ∈"GLOU"$ que l’on rajoute, l’on igniore au pire $d$ éléments de $"GLOU"^∗$ (l’on ne peut pas en ignorer $d + 1$ pour les mêmes raisons qu’à l’exercice d’avant). On a donc un invarient de boucle : $|W(I) sect "GLOU"∗| <= d |I|$ qui est ce que l'on veut à la fin de l'execution. ]) === Approximation de la $k$-coloriabilité On dit qu'un graphe $G = (V,E)$ est _$k$ coloriable_ s'il existe une fonction $c: V -> [|0;k[|$ tel que $forall (u,v) in E, c(u) != c(v)$. On note $chi (G)$ le plus petit $k$ tel que $G$ soit $k$-coloriable. #question(2)[Montrer que tout graphe $G$ est $Delta (G)+1$ coloriable. Donner un algorithme qui le colorie en temps $O(Delta (G) times |E|)$] // #correct([]) #correct([ L’idée est que l’on prend des sommets de degrées $Delta(G)$ que l’on colorie en la $Delta(G) + 1$-ème couleur. #rect( $ &T <-- [0,0,...,0]\ &"Pour " i <-- Delta(G),...,1,0 :\ &#h(20pt)"Tant qu'il existe un " v in V "avec" d_V(v) = i :\ &#h(40pt) T[v] <-- i \ &#h(40pt) V <-- V \\ {v} \ &#h(20pt)"Fin tant que"\ &"Fin pour"\ &"Renvoyer" T $) On notera $d_X (e)$ le degrée su sommet $e$ dans le sous-graphe $X$ On montre que la boucle For possède deux invarients : 1. $V$ est un graphe de degré maximum $i$ 2. Tout les sommets hors de $V$ sont bien coloré (il n’y a pas 2 sommets de même couleur cote à cote). Concernant le premier invarient : La boucle $bold("Tant que")$ ne termine que quand la première condition est respectée. Pour la deuxième condition, on remarque que si pour une arête $(x, y)$, on ai que $x$ et $y$ a été coloré par la même couleur (et l’on suppose que x a été coloré avant), c’est absurde car $d_(V\\{x})(y) = d_V (y)-1 = d_V (x)-1$ (en retirant x on décrémente le degrée de y, donc il sera coloré d’une autre couleur). L’algorithme renvoie bien un coloriage (tout les sommets on été choisi) car à la i-ème itération l’on prend tout les sommets de degrée $Delta(G)-i$ (et on abaisse des degrées) Pour la terminaison, chaque boucle $bold("Tant que")$ termine car V décrémente de 1 à chaque itération de la boucle $bold("Tant que")$ ]) #question(2)[Montrer que tout graphe $G$ _d_-dégénéré est $d+1$ coloriable. Donner un algorithme qui le colorie en temps $O(Delta (G) times |E|)$] #correct([Le même algorithme fonctionne pour les même raisons. En effet, on n’utillise seulement dans la justification que le degrée dans le nouveau sous-graphe baisse.]) === La $k$-coloriabilité avec des sommes Soit $G = (V,E)$ un graphe, pour $S subset.eq V$, on pose $G[S] = (S,E sect S^2)$ le sous-graphe _induit_ par $S$. On note $delta(S) = |{I subset.eq S | I "indépendant dans " G[S]}|$ le nombre d'indépendant dans $S$. #question(2)[Montrer que l'on peut calculer en $O(n 2^n)$ la liste des $(delta(S))_(S subset.eq V)$] #correct([ Prog dyn sur les cardinaux pour calculer $delta(S)$: - $delta(S) = delta(S -{x}) + delta(S-N(x)-{x})$ avec $N(x)$ les voisins de $x$. Trouver les voisin est en $O(n)$, d'où la complexité. ]) #question(1)[Montrer que pour tout ensemble $X$ fini non vide, $sum_(S in cal(P)(X)) (-1)^(|S|) = 0$] #correct([ Par récurrence sur le cardinal, on montre qu'il existe autant de partie de cardinal paire que de parties de cardinal impair: - Vrai pour $X = {x} = 1-1$ car $cal(P)(X) = {emptyset, {x}}$ - Et pour $cal(P)(X union {x}) = { P subset.eq cal(P)(X) | x in P } union { P subset.eq cal(P)(X) | x in.not P }$. On sépare la somme et ça fonctionne. ]) #question(3)[ Montrer que $ sum_(S subset.eq V) (-1)^(|S|)delta(S)^k != 0 <=> G "est" k-"coloriable" $ ] #correct([ $ sum_(S subset.eq V) (-1)^(|S|)delta(S)^k &= sum_(S subset.eq V) (-1)^(|S|) underbrace(sum_(I_1 "indep de" S) ... sum_(I_k "indep de" S),k "fois")1 \ &= sum_(I_1 "indep de" S) ... sum_(I_k "indep de" S) sum_( union.big_(i =1)^k I_i subset.eq S) (-1)^(|S|) \ &= sum_(I_1 "indep de" S) ... sum_(I_k "indep de" S) sum_( U in cal(P)(S\\ union.big_(i =1)^k I_i)) (-1)^(|union.big_(i =1)^k I_i union.sq U|) \ &= sum_(I_1 "indep de" S) ... sum_(I_k "indep de" S) (-1)^(|union.big_(i =1)^k I_i|)sum_( U in cal(P)(S\\ union.big_(i =1)^k I_i)) (-1)^(|U|) \ &= sum_(I_1 "indep de" S) ... sum_(I_k "indep de" S) (-1)^(|union.big_(i =1)^k I_i|)delta_((V - union.big_(i =1)^k I_i) != emptyset)\ &= sum_(I_1 "indep de" S) ... sum_(I_k "indep de" S) (-1)^(|union.big_(i =1)^k I_i|)delta_(V = union.big_(i =1)^k I_i) \ &= (-1)^(|V|)sum_(I_1 "indep de" S) ... sum_(I_k "indep de" S) delta_(V = union.big_(i =1)^k I_i) $ Qui est non nul si et seulement si au moins un terme de la somme est non nul (et forcément positif), donc s'il existe $k$ indépendants recouvrant le graphe. C'est équivalent à être $k$-colorable. ])
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/document_color/rgb.typ
typst
Apache License 2.0
#let t = rgb("#ccc"); #let t = rgb("#badbadbad"); #let t = rgb("#caffee"); #let t = rgb("#deadbeef");
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/docs/cookery/direction/mod.typ
typst
Apache License 2.0
#import "/docs/cookery/book.typ": *
https://github.com/isaacew/aiaa-typst
https://raw.githubusercontent.com/isaacew/aiaa-typst/master/README.md
markdown
# AIAA-Typst This code repository contains a template and sample for authors interested in publishing conference papers for the American Institute of Aeronautics and Astronautics. It is based off of the template available from the AIAA webpage. [AIAA Technical Presenter Resources Webpage](https://www.aiaa.org/events-learning/events/Technical-Presenter-Resources) ## Description This repository contains multiple .typ files: + dropcap.typ - This is a package that performs the dropcap it is authored by [EpicEricEE](https://github.com/EpicEricEE/typst-plugins) + main.typ - This is the main file that is used to type your conference paper. Feel free to make any changes here. + template.typ - This is the supporting template file that provides the formatting for the template. ## Getting Started Clone the repository using the clone button in the top right corner. You can download as a zip if you don't know how to clone and fork repos. ### Dependencies * You will need to have [Typst](www.typst.app) installed. ### Installing For mac users, I suggest opening a terminal and typing the command `brew install typst`. This will install Typst and add it to your path variables. Once Typst is installed, navigate to the folder containing all the files from this repository in a terminal and type the command: `typst w main.typ`. This will compile the code and produce the pdf. As you make changes to the main.typ file, typst will continue to compile and update the pdf. Use command C to halt the terminal process when done. ### Executing program Once Typst is installed, navigate to the folder containing all the files from this repository in a terminal and type the command: ``` typst w main.typ ``` This will compile the code and produce the pdf. As you make changes to the main.typ file, typst will continue to compile and update the pdf. Use command C to halt the terminal process when done. ## Authors Contributors names and contact info <NAME>, <NAME> The Dropcap project was coppied from EpicEricEE on Github. ## Version History * 1.0 - The AIAA Template with Dropcap and sample bilibiography ## License MIT License Copyright (c) 2023 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
https://github.com/remggo/cookbook-typst
https://raw.githubusercontent.com/remggo/cookbook-typst/main/cookbook_docs.typ
typst
MIT License
#import "@preview/tidy:0.2.0" #let docs = tidy.parse-module(read("cookbook.typ")) #tidy.show-module(docs, style: tidy.styles.default)
https://github.com/RolfBremer/in-dexter
https://raw.githubusercontent.com/RolfBremer/in-dexter/main/tests/MultiEntryTest.typ
typst
Apache License 2.0
#import "../in-dexter.typ": * #set page("a6", flipped: true, numbering: "1") _A Test with multiple identical entries on the same page. It tests, if the entries are combined._ #index[DoubleEntry] #index[DoubleEntry] #index[DoubleEntry] #pagebreak() #index-main[DoubleEntry] == Index #columns(2)[ #make-index( use-bang-grouping: true, use-page-counter: true, sort-order: upper, ) ]
https://github.com/v411e/optimal-ovgu-thesis
https://raw.githubusercontent.com/v411e/optimal-ovgu-thesis/main/template/thesis.typ
typst
MIT License
#import "metadata.typ": author, lang, document-type, supervisor, second-supervisor, advisors, city, date, is-doublesided, title, international-title, organisation, organisation-logo, header-logo #import "@local/optimal-ovgu-thesis:0.1.0": optimal-ovgu-thesis, oot-titlepage, oot-disclaimer, oot-acknowledgement, oot-abstract #show: optimal-ovgu-thesis.with( title: title, author: author, lang: lang, is-doublesided: is-doublesided, ) #set page(numbering: "I") #oot-titlepage( title: title, document-type: document-type, supervisor: supervisor, second-supervisor: second-supervisor, advisors: advisors, author: author, city: city, date: date, organisation: organisation, organisation-logo: organisation-logo, header-logo: header-logo, is-doublesided: is-doublesided, lang: lang, ) #counter(page).update(2) #oot-disclaimer( title: title, international-title: international-title, author: author, city: city, is-doublesided: is-doublesided, lang: lang, ) #oot-acknowledgement(heading: "Acknowledgements", is-doublesided: is-doublesided, [ Standing on the shoulders of giants ]) #oot-abstract( is-doublesided: is-doublesided, )[ This Master's thesis investigates the impact of different architectures of neural networks on the performance of real-time image recognition on low-power devices. Optimization strategies are developed and evaluated to enhance the efficiency and accuracy of these systems. The results demonstrate that targeted adaptations of network structures are crucial for enabling fast and precise image recognition on resource-constrained devices. ] #oot-abstract( is-doublesided: is-doublesided, lang: "de", )[ Die vorliegende Masterarbeit untersucht die Auswirkungen verschiedener Architekturen von neuronalen Netzwerken auf die Leistungsfähigkeit der Bilderkennung in Echtzeit auf energiesparenden Geräten. Es werden Optimierungsstrategien entwickelt und evaluiert, um die Effizienz und Genauigkeit dieser Systeme zu verbessern. Die Ergebnisse zeigen, dass die gezielte Anpassung der Netzwerkstrukturen entscheidend ist, um eine schnelle und präzise Bilderkennung auf ressourcenbeschränkten Geräten zu ermöglichen. ] #outline() #set page(numbering: "1") #counter(page).update(1) #include "chapter/01-Einleitung.typ" // #include "chapter/02-Grundlagen.typ" // #include "chapter/03-StandDerTechnik.typ" // ... #bibliography("./thesis.bib") #include "chapter/99-Appendix.typ"
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/model/terms.typ
typst
// Test term list. --- terms-constructor --- // Test with constructor. #terms( ([One], [First]), ([Two], [Second]), ) --- terms-built-in-loop --- // Test joining. #for word in lorem(4).split().map(s => s.trim(".")) [ / #word: Latin stuff. ] --- terms-multiline --- // Test multiline. #set text(8pt) / Fruit: A tasty, edible thing. / Veggie: An important energy source for vegetarians. And healthy! --- terms-style-change-interrupted --- // Test style change. #set text(8pt) / First list: #lorem(6) #set terms(hanging-indent: 30pt) / Second list: #lorem(5) --- terms-rtl --- // Test RTL. #set text(8pt, dir: rtl) / פרי: דבר טעים, אכיל. ומקור אנרגיה חשוב לצמחונים. --- terms-grid --- // Test grid like show rule. #show terms: it => table( columns: 2, inset: 3pt, ..it.children.map(v => (emph(v.term), v.description)).flatten(), ) / A: One letter / BB: Two letters / CCC: Three letters --- terms-syntax-edge-cases --- / Term: Not in list /Nope --- terms-missing-colon --- // Error: 8 expected colon / Hello --- issue-1050-terms-indent --- #set page(width: 110pt) #set par(first-line-indent: 0.5cm) - #lorem(5) - #lorem(5) + #lorem(5) + #lorem(5) / S: #lorem(5) / XXXL: #lorem(5) --- issue-2530-term-item-panic --- // Term item (pre-emptive) #terms.item[Hello][World!]
https://github.com/MattiaOldani/Informatica-Teorica
https://raw.githubusercontent.com/MattiaOldani/Informatica-Teorica/master/capitoli/calcolabilità/05_potenza_computazionale.typ
typst
#import "../alias.typ": * = Potenza computazionale di un sistema di calcolo == Validità dell'inclusione $F(cal(C)) subset.eq dati_bot^dati$ Ora che abbiamo una definizione più robusta di cardinalità, essendo basata su strutture matematiche, possiamo studiare la natura dell'inclusione $ F(cal(C)) subset.eq dati_bot^dati. $ Vediamo prima due intuizioni (che saranno da dimostrare): - $programmi tilde NN$: identifichiamo ogni programma con un numero, ad esempio la sua codifica in binario; - $dati tilde NN$: anche qui, identifichiamo ogni dato con la sua codifica in binario. In altre parole, i programmi e i dati non sono più dei numeri naturali $NN$. Questo ci permette di dire che: $ F(cal(C)) tilde programmi tilde NN tilde.not NN_bot^NN tilde dati_bot^dati. $ Con questa relazione, abbiamo appena dimostrato che *esistono funzioni non calcolabili*. Queste funzioni sono problemi molto pratici e molto utili al giorno d'oggi: un esempio è la funzione che, dato un software, ci dica se è corretto o no. Il problema è che _esistono pochi programmi e troppe/i funzioni/problemi_. Quello che ci resta fare è dimostrare le due assunzioni - $programmi tilde NN$; - $dati tilde NN$. Lo faremo utilizzando le *tecniche di aritmetizzazione* (o _godelizzazione_) *di strutture*, tecniche che rappresentano delle strutture tramite un numero, così da poter utilizzare la matematica e tutti gli strumenti di cui essa dispone.
https://github.com/PhotonQuantum/UofTNotes
https://raw.githubusercontent.com/PhotonQuantum/UofTNotes/master/src/CSC2126H/LEC0101_CourseStructure.typ
typst
#import "/sty.typ": * #show: template.with( title: [Types & Effects: Course Structure], short_title: [CSC2126H LEC0101], description: [ Notes based on lectures for CSC 2126H\ (Topics in PL: Types and Effects)\ at the University of Toronto by Professor <NAME>, Fall 2024 ], date: datetime(year: 2024, month: 09, day: 09), ) = Per-Week Schedule - 3 student presentations (20 mins) followed by discussions (5 mins) - 1 mini-lecture on next week's topic (30 mins) = Tasks + Attend the intro lecture (previous week) + Background reading (skim all papers) + Read papers (if selected for presentation) + Submit a review document (if not selected for presentation) - 1 page, need to use templates - Answer to questions (e.g. what do you think of effects? not typical textbook questions) - Ask 2-3 questions for discussion == Paper Presentation Everyone needs to: - Present: 1 paper - Judge: 2 presentations All presentations will be judged by Ningning and 2 students. A judge is required to: - Eval: good? bad? What part is particularly good/bad? - Lead discussion - Feedback: Google form == Course Project Dig into a listed topic. Individual / 2 people #attention[ Proposals can *not* be changed after submission. ] === Potential Topics From simple to challenging: + Implement a prototype of a paper (could be an unlisted one but needs justification) + Mechanize the proofs in a classic paper (like subst lemma, etc.) + Extend a paper with a new feature + Relevant explorations (open-ended, but need to justify) #note[ Need to arrange one meeting with the instructor/TA to discuss the project before the proposal. - What you want to do and why you want to do it. - Convince that it's a good project. - Will get feedback: good? not going to work? ] = Timeline / Proposal: Oct 14 / Progress Presentation: Week 7 / Final Presentation: Last 2 weeks / Report: Dec 23 = Grade / Review: $5% times 4 = 20%$, top 4 reviews out of 5. / Presentation: $15%$ / Judge: $5% times 2 = 10%$ / Project: $55%$ + Proposal: $15%$ + Presentations: $20%$ + Report: $20%$ = High-Mark Suggestions == Review + Be critical: Question their assumptions and results. Can things be done differently? + Summarize the paper + Analyse its strength/weakness, judging its: - writing, structure, flow - explanation of key techniques - key lemmas - sense-making? - practicalness - limitations - assumptions - evaluations - comparisons - generalisability - any significant lack of details/discussions? #note[ *Ref*: + #link("http://ccr.sigcomm.org/online/files/p83-keshavA.pdf")[How to Read a Paper (S. Keshav)] + #link("https://www.eecs.harvard.edu/~michaelm/postscripts/ReadPaper.pdf")[How to read a research paper (Michael)] ] Grade standard: - Understanding - Insights - Writing quality (repetition, grammar, gibberish, etc.) *DO NOT*: + Too critical: no positive feedback + Too much quote: not your own words! please summarize + No evidence: no proof of your claims + Vague: "maybe good maybe not idk" #note[ _ChatGPT_: can be used to polish writing, but do not use it to generate irrelavant nonsense. ] == Presentation + Engage: eye contact, interaction + Emphasize key points + Bring people along + Explain the prolem + Bring out the key idea + One key example: one problem followed by one fix, explaining why the idea works! #note[ *Ref* #link("https://www.youtube.com/watch?v=sT_-owjKIbA&ab_channel=MicrosoftResearch")[How to give a great research talk (<NAME>)] *Recommendation* Watch others' presentations and notice their structure, strength, and weakness. ] *DO NOT*: + Read slides + No engagement with audience: did they follow? + Wall of text + #text(red)[*OVERRUN*: _strictly enforced_], 20 mins, will get reminded at 15 mins. == Judge + Evaluate: fair (irrelevant to the topic/presenter) + Articulate: clarity (good/bad parts, and why?) + Appraise + Criticize: being constructive (reason + feedback, e.g. lack of context? too technical?) Grade standard: - Analysis of pros/cons - Constructive feedback *DO NOT*: + grumpy/rude/arrogant/nitpicking + unhelpful == Project Proposal + Topic: choose something you're interested in, and make sure it's: - Feasible - Practical - Interesting + Personal Strength: whether you excel in - design/implementation? (implemented in another language? performance improvements?), or - analysis? (limitation of current approach? fix?), or - evaluation/proofs? (add/mechanize/prove new features) + Originality: has been done vs. _can be done_ Grade standard: - Understanding - Depth in insight & analysis - Originality - Clarity of plan *DO NOT*: + Irrelevant: _NO MACHINE LEARNING!!!_ (unless it's really useful, then one needs to arrange a meeting to justify it) + Analyse shallowly: vaguely describe the pros/cons + Too ambitious: not feasible. Remember to discuss with the instructor/TA in advance. + Too trivial: one-day project
https://github.com/pku-typst/ichigo
https://raw.githubusercontent.com/pku-typst/ichigo/main/src/themes.typ
typst
MIT License
#let THEMES = ( "simple", "sketch", ) /// Get the theme main function by name /// /// - name (str): the name of the theme /// -> theme #let get-theme(name) = { import "themes/" + name + "/lib.typ": theme return theme }
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/project_documentation/content/meeting_minutes/week_08.typ
typst
= Project Meeting 7.11.2023 08:15 - 09:00 (MS Teams) == Participants - Prof. Dr. <NAME> - <NAME> - <NAME> == Agenda - Brief discussion of frontend frameworks - try out miso and decide between threepenny and miso - Discussion of first draft of a simple unification algorithm - looks good for a first draft, needs to be extended and refactored - Discussion of scoping in concept for function composition - let-bindings can be dropped - the only necessary binding with scoping are lambda-blocks
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/linguify/0.1.0/README.md
markdown
Apache License 2.0
# [Typst-linguify](https://github.com/jomaway/typst-linguify) Load strings for different languages easily. This can be useful if you create a package or template for multilingual usage. See the [gentle-clues package](https://github.com/jomaway/typst-gentle-clues) as an example. ## Usage ```typst #import "@local/linguify:0.1.0": * #let lang_data = toml("lang.toml") #show: linguify_config.with(data: lang_data, lang: "en"); #linguify("abstract") // Shows Abstract in the document. ``` The `lang.toml` must look like this: ```toml default-lang = "en" [en] title = "A simple linguify example" abstract = "Abstract" [de] title = "Ein einfaches Linguify Beispiel" abstract = "Zusammenfassung" ``` ## Features - Use a `toml` or other file to load strings for different languages. You need to pass a typst dictionary whichs follows the structure of the shown toml file. - Specify a **default-lang**. If none is specified it will default to `en` - **Fallback** to the default-lang if a key is not found for a certain language.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/t4t/0.1.0/get.typ
typst
Apache License 2.0
// Dictionaries #import "is.typ": all-of-type #let dict( ..dicts ) = { let d = (:) for i in range(1, dicts.pos().len(), step:2) { d.insert( str(dicts.pos().at(i - 1)), dicts.pos().at(i) ) } if calc.odd(dicts.pos().len()) { d.insert(dicts.pos().last(), none) } for (k, v) in dicts.named() { d.insert(k, v) } return d } // typst-canvas #let dict-merge( ..dicts ) = { if all-of-type("dictionary", ..dicts.pos()) { let c = (:) for dict in dicts.pos() { for (k, v) in dict { if k not in c { c.insert(k, v) } else { let d = c.at(k) c.insert(k, dict-merge(d, v)) } } } return c } else { return dicts.pos().last() } } // Extract arguments from a sink #let args( args, prefix: "" ) = (..keys) => { let vars = (:) for key in keys.pos() { let k = prefix + key if k in args.named() { vars.insert(key, args.named().at(k)) } } for (key, value) in keys.named() { let k = prefix + key if k in args.named() { vars.insert(key, args.named().at(k)) } else { vars.insert(key, value) } } return vars } // Extract text from any element #let text( element, sep: "" ) = { if type(element) == "content" { if element.has("text") { element.text } else if element.has("children") { element.children.map(text).join(sep) } else if element.has("child") { text(element.child) } else if element.has("body") { text(element.body) } else { "" } } else { str(element) } } // Based on work by @PgBiel for PgBiel/typst-tablex // See: https://github.com/PgBiel/typst-tablex #let stroke-paint-regex = regex("\+ ((rgb|cmyk|luma)\(.+\))$") #let stroke-paint( stroke, default: black ) = { if type(stroke) in ("length", "relative length") { return default } else if type(stroke) == "color" { return stroke } else if type(stroke) == "stroke" { // 2em + blue let s = repr(stroke).find(stroke-paint-regex) if s == none { return default } else { return eval(s.slice(2)) } } else if type(stroke) == "dictionary" and "paint" in stroke { return stroke.paint } else { return default } } #let stroke-thickness-regex = regex("^\\d+(?:em|pt|cm|in|%)") #let stroke-thickness( stroke, default: 1pt ) = { if type(stroke) in ("length", "relative length") { return stroke } else if type(stroke) == "color" { return 1pt } else if type(stroke) == "stroke" { // 2em + blue let s = repr(stroke).find(stroke-thickness-regex) if s == none { return default } else { return eval(s) } } else if type(stroke) == "dictionary" and "thickness" in stroke { return stroke.thickness } else { return default } } #let stroke-dict( stroke, ..overrides ) = { let dict = ( paint: stroke-paint(stroke), thickness: stroke-thickness(stroke), dash: "solid", cap: "round", join: "round" ) if type(stroke) == "dictionary" { dict = dict + stroke } return dict + overrides.named() } #let inset-at( direction, inset, default: 0pt ) = { direction = repr(direction) // allows use of alignment values if type(inset) == "dictionary" { if direction in inset { return inset.at(direction) } else if direction in ("left", "right") and "x" in inset { return inset.x } else if direction in ("top", "bottom") and "y" in inset { return inset.y } else if "rest" in inset { return inset.rest } else { return default } } else if inset == none { return default } else { return inset } } #let inset-dict( inset, ..overrides ) = { let dict = ( top: inset-at(top, inset), bottom: inset-at(bottom, inset), left: inset-at(left, inset), right: inset-at(right, inset) ) if type(inset) == "dictionary" { dict = dict + inset } return dict + overrides.named() } #let x-align( align, default:left ) = { if align in (left, right, center) { return align } else if type(align) == "2d alignment" { return eval(repr(align).split().first()) } else { return default } } #let y-align( align, default:top ) = { if align in (top, bottom, horizon) { return align } else if type(align) == "2d alignment" { return eval(repr(align).split().last()) } else { return default } }
https://github.com/SergeyGorchakov/russian-phd-thesis-template-typst
https://raw.githubusercontent.com/SergeyGorchakov/russian-phd-thesis-template-typst/main/parts/conclusion.typ
typst
MIT License
= Заключение // ГОСТ Р 7.0.11 - 2011: // 5.3.3 В заключении диссертации излагают итоги выполненного исследования, рекомендации, перспективы дальнейшей разработки темы // 9.2.3 В заключении автореферата излагают итоги данного исследования, рекомендации и перспективы дальнейшей разработки темы Основные результаты работы заключаются в следующем: + На основе анализа … + Численные исследования показали, что … + Математическое моделирование показало … + Для выполнения поставленных задач был создан … Благодарности
https://github.com/sses7757/sustech-graduated-thesis
https://raw.githubusercontent.com/sses7757/sustech-graduated-thesis/main/sustech-graduated-thesis/utils/multi-line-equate.typ
typst
Apache License 2.0
// NOTICE about license // The majority of this file is originated from "EpicEricEE/typst-plugins/equate" with MIT license, with my modification to fit current demands. // The `show-figure` function is originated from "RubixDev/typst-i-figured" with MIT license, with my modification to work with the rest of the functions. // Element function for alignment points. #let align-point = $&$.body.func() // Element function for a counter update. #let counter-update = counter(math.equation).update(1).func() // Sub-numbering state. #let state = state("equate/sub-numbering", false) // Extract lines and trim spaces. #let to-lines(equation) = { let lines = if equation.body.has("children") { equation.body.children.split(linebreak()) } else { ((equation.body,),) } // Trim spaces at begin and end of line. let lines = lines.filter(line => line != ()).map(line => { if line.first() == [ ] and line.last() == [ ] { line.slice(1, -1) } else if line.first() == [ ] { line.slice(1) } else if line.last() == [ ] { line.slice(0, -1) } else { line } }) lines } // Layout a single equation line with the given number. #let layout-line( number: none, number-align: none, number-width: auto, line ) = context { // Short circuit if no number has to be added. if number == none { return math.equation(block: true, numbering: _ => none, line.join()) } // Short circuit if number is a counter update. if type(number) == content and number.func() == counter-update { return { number math.equation(block: true, numbering: _ => none, line.join()) } } // Start of equation block. let x-start = here().position().x // Resolve number width. let number-width = if number-width == auto { measure(number).width } else { number-width } let equation-align = align.alignment.x layout(bounds => { // Add numbers to the equation body, so that they are aligned // at their respective baselines. They are wrapped in a zero-width box // to not mess with the center alignment. let body = line.join() + box(width: 0pt, context move( dx: x-start - here().position().x + if number-align.x == right { bounds.width }, align(number-align, box(width: number-width, number)) )) // Make numbering take up space. let pad-key = if equation-align == center { "x" } else if number-align == left { "left" } else { "right" } let pad-arg = ((pad-key): number-width) pad(..pad-arg, math.equation(numbering: _ => none, block: true, body)) }) } // Replace "fake labels" with a hidden figure that is labelled // accordingly. #let replace-labels( lines, has-main-number, numbering, supplement, prefix, ) = { // Main equation number. let main-number = counter(math.equation).get() // Indices of numbered lines in this equation. let numbered = if has-main-number { range(lines.len()) } else { lines.enumerate() .filter(((i, line)) => { if line.len() == 0 { return false } if line.last().func() != raw { return false } if line.last().lang != "typc" { return false } if line.last().text.match(regex("^<.+>$")) == none { return false } return true }) .map(((i, _)) => i) } lines.enumerate() .map(((i, line)) => { if line.len() == 0 { return line } let last = line.last() if last.func() != raw { return line } if last.lang != "typc" { return line } if last.text.match(regex("^<.+>$")) == none { return line } // Remove trailing spacing (before label). if line.at(-2, default: none) == [ ] { line.remove(-2) } // Append sub-numbering only if there are multiple numbered lines. let nums = main-number + if numbered.len() > 1 { (numbered.position(n => n == i) + 1,) } // We use a figure with kind "equation" to make the sub-equation // referenceable with the correct supplement. The numbering is stored // in the figure body as metadata, as a counter would only show a // single number. line.at(-1) = [#figure( metadata(nums), kind: math.equation, numbering: numbering, supplement: supplement )#label(prefix + last.text.slice(1, -1))] return line }) } // Splitting an equation into multiple lines breaks the inbuilt alignment // with alignment points, so it is emulated here by adding spacers manually. #let realign(lines) = { // Utility shorthand for unnumbered block equation. let equation = math.equation.with(block: true, numbering: none) // Short-circuit if not alignment points. if lines.all(line => align-point() not in line) { return lines } // Store widths of each part between alignment points. let part-widths = lines.map(line => line .split(align-point()) .map(part => measure(equation(part.join())).width)) // Get maximum width of each part. let part-widths = for i in range(calc.max(..part-widths.map(points => points.len()))) { (calc.max(..part-widths.map(line => line.at(i, default: 0pt))), ) } // Add spacers for each part, so that the part widths are the same for all lines. let lines = lines.map(line => { let parts = line.split(align-point()) let spaced(i, spacing) = { let spacing = if spacing > 0pt { box(width: spacing) } if calc.even(i) { // Right align. spacing + parts.at(i).join() } else { // Left align. parts.at(i).join() + spacing } } parts.enumerate() .map(((i, part)) => { // Add spacer to make part the correct width. let width = part-widths.at(i) - measure(equation(part.join())).width let elem = equation(spaced(i, width)) // Adjust for math class spacing between the spacer and the actual equation. equation(spaced(i, width + part-widths.at(i) - measure(elem).width)) }) .intersperse(align-point()) }) // Ensure correct spacing with all previous parts combined. let max-slice-widths = array.zip(..lines.map(line => range(part-widths.len()).map(i => { let parts = line.split(align-point()).map(array.join) if i >= parts.len() { 0pt } else { let slice = parts.slice(0, i + 1).join() measure(equation(slice)).width } }))).map(widths => calc.max(..widths)) lines = lines.map(line => { let parts = line.split(align-point()).map(array.join) for i in range(max-slice-widths.len()) { if i >= parts.len() { break } let slice = parts.slice(0, i + 1).join() let slice-width = measure(equation(slice)).width if slice-width < max-slice-widths.at(i) { parts.at(i) = box(width: max-slice-widths.at(i) - slice-width) + parts.at(i) } } parts }) // Append remaining spacers at the end for lines that have less align points. let line-widths = lines.map(line => measure(equation(line.join())).width) let max-line-width = calc.max(..line-widths) lines = lines.zip(line-widths).map(((line, line-width)) => { if line-width < max-line-width { line.push(box(width: max-line-width - line-width)) } line }) lines } #let _prefix = "i-figured-" #let _typst-numbering = numbering #let _prepare-dict(it, level, zero-fill, leading-zero, numbering) = { let numbers = counter(heading).at(it.location()) // if zero-fill is true add trailing zeros until the level is reached while zero-fill and numbers.len() < level { numbers.push(0) } // only take the first `level` numbers if numbers.len() > level { numbers = numbers.slice(0, level) } // strip a leading zero if requested if not leading-zero and numbers.at(0, default: none) == 0 { numbers = numbers.slice(1) } let dic = it.fields() let _ = if "body" in dic { dic.remove("body") } let _ = if "label" in dic { dic.remove("label") } let _ = if "counter" in dic { dic.remove("counter") } dic + (numbering: n => _typst-numbering(numbering, ..numbers, n)) } #let show-figure( it, level: 1, zero-fill: true, leading-zero: true, numbering: "1-1", extra-prefixes: (:), fallback-prefix: "fig:", line-width: 21cm - 6cm, ) = { if (type(it.kind) == str and it.kind.starts-with(_prefix)) or it.kind == math.equation { return it } let f = figure( it.body, .._prepare-dict(it, level, zero-fill, leading-zero, numbering), kind: _prefix + repr(it.kind), ) let res = if it.has("label") { let prefixes = (table: "tbl:", raw: "lst:") + extra-prefixes let new-label = label(prefixes.at( if type(it.kind) == str { it.kind } else { repr(it.kind) }, default: fallback-prefix, ) + str(it.label)) [#f #new-label] } else { f } // move figure spacing and caption algin adjustment here to prevent unwanted spacing in multi-line equations if measure(it.caption).width > line-width { show figure.caption: set align(start + top) show figure.caption: set par(leading: 1em) res } else { res } } #let _prepare-equ-dict(it, num: none, supp: none) = { let dic = it.fields() let _ = if "body" in dic { dic.remove("body") } let _ = if "label" in dic { dic.remove("label") } let _ = if "counter" in dic { dic.remove("counter") } dic.insert("numbering", num) dic.insert("supplement", supp) return dic } // Applies show rules to the given body, so that block equations can span over // page boundaries while retaining alignment. The equation number is stepped // and displayed at every line, optionally with sub-numbering. // // ### Parameters: // - breakable: wheteher the multi-line equations can be break to different pages // - sub-numbering: whether to use the last number in the `math.equation.numbering` as the sub number // - zero-fill: whether to fill 0s for the first (few) numbers when not present // - leading-zero: wheter to set the first heading number to 0 if it is not numbered // - unnumbered-label: the label to indicate that the equation shall not be numbered as whole // - debug: show debug boxes // - prefix: the label prefix to add before each label // // ### Example: // ``` // #set heading(numbering: "1.1") // #show heading: it => { // counter(math.equation).update(0) // it // } // #show math.equation: equate // #show ref: equate-ref // #set math.equation(numbering: "(1.1.a)") // ``` #let equate( breakable: false, sub-numbering: true, zero-fill: true, leading-zero: true, level: 1, unnumbered-label: "-", debug: false, prefix: "eqt:", it ) = { // Allow a way to make default equations. if (not it.has("block") or not it.block or it.has("label") and str(it.label).starts-with(prefix)) { return it } if ((not it.has("numbering") or it.numbering == none or numbering(it.numbering, 1) == none) and (not it.has("supplement") or it.supplement == none or it.supplement == [])) { let c = counter(math.equation).update(n => n - 1) return [#it#c] } else if (it.has("numbering") and it.numbering == none) { return it } // if (it.has("label") and str(it.label) == unnumbered-label) { // return math.equation(it.body, .._prepare-dict(it, num: it.numbering, supp: it.supplement)) // } // Check numbering let has-main-label = it.has("label") and str(it.label) != unnumbered-label // Make spacers visible in debug mode. show box.where(body: none): set box( height: 0.5em, stroke: 0.4pt, fill: yellow ) if debug // Main equation number. let main-number = counter(heading).at(it.location()) // if zero-fill is true add trailing zeros until the level is reached while zero-fill and main-number.len() < level { main-number.push(0) } // only take the first `level` numbers if main-number.len() > level { main-number = main-number.slice(0, level) } // strip a leading zero if requested if not leading-zero and main-number.at(0, default: none) == 0 { main-number = main-number.slice(1) } main-number = main-number + (counter(math.equation).get().first(),) // Resolve text direction. let text-dir = if text.dir == auto { if text.lang in ( "ar", "dv", "fa", "he", "ks", "pa", "ps", "sd", "ug", "ur", "yi", ) { rtl } else { ltr } } else { text.dir } // Resolve number position in x-direction. let number-align = if it.number-align.x in (left, right) { it.number-align.x } else if text-dir == ltr { if it.number-align.x == start { left } else { right } } else if text-dir == rtl { if it.number-align.x == start { right } else { left } } let lines = replace-labels( to-lines(it), has-main-label, it.numbering, it.supplement, if it.has("label") and has-main-label { prefix + str(it.label) + "-" } else { prefix } ) let line-num = sub-numbering and (not it.has("label") or has-main-label) if (it.has("label") and not has-main-label and lines.len() == 1) { return math.equation(it.body, .._prepare-equ-dict(it)) } // Indices of numbered lines in this equation. let numbered = if sub-numbering and (not it.has("label") or has-main-label) { range(lines.len()) } else { // Find lines that have a replaced label. lines.enumerate() .filter(((i, line)) => { if line.len() == 0 { return false } if line.last().func() != figure { return false } if line.last().body == none { return false } if line.last().body.func() != metadata { return false } return true }) .map(((i, _)) => i) } // Get numbering sub-numbering = sub-numbering and (if it.has("label") { has-main-label } else { true }) let main-num = [#figure( metadata(main-number), kind: math.equation, numbering: ((.._n) => numbering(it.numbering, ..main-number)), supplement: it.supplement ) #if has-main-label { label(prefix + str(it.label)) } ] // Short-circuit for single-line equations. if lines.len() == 1 { if it.numbering == none { return it } if numbering(it.numbering, 1) == none { return it } let number = if numbered.len() > 0 { numbering(it.numbering, ..main-number) } else { // Step back counter as this equation should not be counted. counter(math.equation).update(n => n - 1) } return { // Update state to allow correct referencing. state.update(_ => sub-numbering) layout-line( lines.first(), number: number, number-align: number-align ) main-num // Step back counter as we introducted an additional equation // that increased the counter by one. counter(math.equation).update(n => n - 1) } } // Calculate maximum width of all numberings in this equation. let max-number-width = if it.numbering == none { 0pt } else { calc.max(0pt, ..range(numbered.len()).map(i => { let nums = if sub-numbering and numbered.len() > 1 { main-number + (i + 1, )} else { main-number.slice(0, -1) + (main-number.at(-1) + i, ) } measure(numbering(it.numbering, ..nums)).width })) } // Update state to allow correct referencing. state.update(_ => sub-numbering) // Layout equation as grid to allow page breaks. block(breakable: breakable, grid( columns: 1, row-gutter: par.leading, ..realign(lines).enumerate().map(((i, line)) => { let sub-number = numbered.position(n => n == i) let number = if it.numbering == none { none } else if sub-number == none { // Step back counter as this equation should not be counted. counter(math.equation).update(n => n - 1) } else if sub-numbering and numbered.len() > 1 { numbering(it.numbering, ..main-number, sub-number + 1) } else { numbering(it.numbering, ..(main-number.slice(0, -1) + (main-number.at(-1) + sub-number, ))) } layout-line( line, number: number, number-align: number-align, number-width: max-number-width ) }) ) ) main-num // Revert equation counter step(s). if it.numbering == none { // We converted a non-numbered equation into multiple empty- // numbered ones and thus increased the counter at every line. counter(math.equation).update(n => n - lines.len()) } else { // Each line stepped the equation counter, but it should only // have been stepped once (when using sub-numbering). We also // always introduced an additional numbered equation that // stepped the counter. counter(math.equation).update(n => { n - if sub-numbering and numbered.len() > 1 { numbered.len() } else { 1 } }) } } #import "state-notations.typ": notation, notations, notation-prefix, notation-full-suffix // Add support for sub-numbering in references as well as notation references and CJK fix for references. // The parameters shall be consistent with `equate`'s. #let equate-ref( it, unnumbered-label: "-", prefix: "eqt:", sep: "", sep-ref: true, ) = { assert( str(it.target) != unnumbered-label, message: "cannot reference equation without numbering." ) if str(it.target).starts-with(notation-prefix) { let notation-key = str(it.target).slice(notation-prefix.len()) let full = notation-key.ends-with(notation-full-suffix) notation-key = notation-key.trim(notation-full-suffix) if notation-key in notations.at(it.location()) { return notation(notation-key, full: full) } } if it.element != none { // equation ref let nums = counter(heading).at(it.element.location()).slice(0, 1) // Normal equation and re-aligned eqautions if it.element.func() == math.equation { nums = nums + counter(math.equation).at(it.element.location()) } else { if it.element.func() != figure { return it } if it.element.kind != math.equation { return it } if it.element.body == none { return it } if it.element.body.func() != metadata { return it } // Display correct number, depending on whether sub-numbering was enabled. nums = if state.at(it.element.location()) { nums + it.element.body.value } else { // (3, 1): 3 + 1 - 1 = 3 // (3, 2): 3 + 2 - 1 = 4 nums + (it.element.body.value.first() + it.element.body.value.slice(1).sum(default: 1) - 1,) } } assert( it.element.numbering != none, message: "cannot reference equation without numbering." ) assert( str(it.target).starts-with(prefix), message: "cannot reference equation without prefix \"" + prefix + "\"." ) let num = numbering(it.element.numbering, ..nums ) let supplement = if it.supplement == auto { it.element.supplement } else { it.supplement } link( it.element.location(), if supplement not in ([], none) [#supplement#sep#num] else [#num] ) } else if sep-ref { // CJK ref let key = it.citation.key let p = str(key).position(regex("\p{script=Han}")) if p == none or p == 0 { return it } let new-key = label(str(key).slice(0, p)) let rest = str(key).slice(p) [#ref(new-key)#rest] } else { it } }
https://github.com/YunkaiZhang233/computer-science-notes
https://raw.githubusercontent.com/YunkaiZhang233/computer-science-notes/main/README.md
markdown
MIT License
# A collection of my personal notes for computer science studies Contents here will include courses taught at Imperial that I find interesting AND courses from all walks of computer science. Will be mainly written in Typst and thanks to the template provided by [this repository](https://github.com/jskherman/jsk-lecnotes).
https://github.com/topdeoo/NENU-Thesis-Typst
https://raw.githubusercontent.com/topdeoo/NENU-Thesis-Typst/master/template/thesis.typ
typst
#import "../lib.typ": thesis, kouhu #import "@preview/subpar:0.1.1": grid as subfigure #let (doc, cover, declare, abstract-cn, abstract-en, mainmatter, toc, nenu-bibliography, acknowledgement) = thesis( thesis-type: "bachelor", degree: "academic", two-side: false, bibliography: bibliography.with("ref.bib"), fonts: (:), info: ( title: ("基于 Typst 的东北师范大学学士学位论文"), title-en: ("My Thesis in English"), student-id: "2024123456", author: "张三", department: "信息科学与技术学院", major: "计算机科学与技术", supervisor: "李四", submit-date: datetime.today(), ), keywords-cn: ("Typst", "学士学位论文", "东北师范大学", "计算机科学与技术"), keywords-en: ("Typst", "Bachelor Thesis", "NENU", "Computer Science"), ) #show: doc #cover() #declare() #abstract-cn[ 论文第一页为中文内容摘要。应说明目的、研究方法、成果和结论。要突出本论文新的见解,语言力求精练,一般 200 字左右。为了便于文献检索,应在本页下方另起一行注明本文的关键词(三至五个)。 论文第一页为中文内容摘要。应说明目的、研究方法、成果和结论。要突出本论文新的见解,语言力求精练,一般 200 字左右。为了便于文献检索,应在本页下方另起一行注明本文的关键词(三至五个)。 论文第一页为中文内容摘要。应说明目的、研究方法、成果和结论。要突出本论文新的见解,语言力求精练,一般 200 字左右。为了便于文献检索,应在本页下方另起一行注明本文的关键词(三至五个)。 ] #abstract-en[ The first page of the paper should contain an abstract in Chinese. It should state the purpose, research methods, results, and conclusions. The new insights of this paper should be highlighted, and the language should be concise, generally around 200 words. To facilitate literature retrieval, keywords (three to five) should be provided on a new line below the abstract on this page. The first page of the paper should contain an abstract in Chinese. It should state the purpose, research methods, results, and conclusions. The new insights of this paper should be highlighted, and the language should be concise, generally around 200 words. To facilitate literature retrieval, keywords (three to five) should be provided on a new line below the abstract on this page. The first page of the paper should contain an abstract in Chinese. It should state the purpose, research methods, results, and conclusions. The new insights of this paper should be highlighted, and the language should be concise, generally around 200 words. To facilitate literature retrieval, keywords (three to five) should be provided on a new line below the abstract on this page. ] #toc() #show: mainmatter = 绪 论 == 列表 === 有序列表 + #kouhu(builtin-text: "aspirin", length: 10) + #kouhu(builtin-text: "aspirin", offset: 2, length: 10) + #kouhu(builtin-text: "aspirin", offset: 3, length: 5) + #kouhu(builtin-text: "aspirin", offset: 3, length: 10) + #kouhu(builtin-text: "aspirin", offset: 3, length: 15) === 无序列表 - #kouhu(builtin-text: "zhufu", length: 15) - #kouhu(builtin-text: "zhufu", offset: 2, length: 15) - #kouhu(builtin-text: "zhufu", offset: 3, length: 15) - #kouhu(builtin-text: "zhufu", offset: 3, length: 15) - #kouhu(builtin-text: "zhufu", offset: 6, length: 15) === 术语(`Latex` 中的段落) / simp: #kouhu(builtin-text: "simp", length: 15) / 阿司匹林: #kouhu(builtin-text: "aspirin", length: 60) == 图表 === 表格 在这里引用表格,例如同一页中的表格:@tbl:usual-table,以及不同页中的表格,例如三线表:@tbl:three-line-table 我们使用 `@tbl:<label>` 来进行表的引用,其中 `<label>` 是跟在表格后的标签,使用尖括号括起来,例如下面的 `usual-table`。 #align( center, ( stack(dir: ltr)[ #figure( table( align: center + horizon, columns: 4, [x], [1], [2], [3], [y], [5 ms], [6 ms], [0.7 ms], ), caption: [常用表格示例], )<usual-table> ] ), ) #pagebreak() #align( center, ( stack(dir: ltr)[ #figure( table( align: center + horizon, columns: 4, stroke: none, table.hline(), [x], [y], [z], [t], table.hline(stroke: .5pt), [11], [5 ms], [3], [0.7], [3000], [80 ms], [1111], [0.9], table.hline() ), caption: [三线表示例], )<three-line-table> ] ), ) === 图片 我们可以插入图片,也可以修改图片的展示大小,引用图片,例如@fig:ida-star-50, @fig:ida-star-20 #figure( image("fig/ida-star-1.png", width: 50%), caption: [IDA\* 算法示例, 50% 比例缩放], )<ida-star-50> #figure( image("fig/ida-star-1.png", width: 20%), caption: [IDA\* 算法示例, 20% 比例缩放], )<ida-star-20> === 子图 // FIXME: 子图的标号显示错误,可能与 i-figured & subpar 不兼容有关 子图可以使用 #link("https://typst.app/universe/package/subpar")[subpar] 包进行绘制,例如@fig:ida-star-1, @fig:ida-star-2 #subfigure( figure( image("fig/ida-star-1.png", width: 50%), caption: [第一步], ), <ida-star-1>, figure( image("fig/ida-star-2.png", width: 50%), caption: [第二步], ), <ida-star-2>, columns: (1fr, 1fr), caption: [子图的使用], numbering-sub: "a", label: <ida-star>, ) === 引用 我们通过 `.bib` 文件来创建参考文献,文件名可以任意选择,通过选项:`bibliography: bibliography.with("ref.bib")` 进行导入。 随后,通过 `#cite(<key>)` 进行引用,其中 `key` 是在 `.bib` 中设置的键。 在示例中,我们可以引用 `ref.bib` 文件中的内容,例如《Deep Learning》#cite(<goodfellow2016deep>),引用2#cite(<丁文祥2000>) == 数学公式 #nenu-bibliography(full: true) #acknowledgement[ #kouhu(length: 100) ]
https://github.com/as505/HelldiversTTRPG
https://raw.githubusercontent.com/as505/HelldiversTTRPG/main/main.typ
typst
#import "template.typ": * #import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx #show: template.with( title: [Helldivers TTRPG], header: [Helldivers TTRPG], ) = #text(yellow)[Introduction] <sec:introduction> Total Incoming Trainees: 48,736 Avg. Age (Years): 18.7 Avg. Combat Readiness: 27.1 % Avg. Patriotism Rating: 97.4 % #v(12pt) Expected Survival Rate: 21.3 % #v(12pt) #text(font: "Tahoma", size:10pt )[ The Helldivers TTRPG is a combat-oriented ttrpg attempting to translate the Helldivers experience into a tabletop format. Join an elite peacekeeping force, and do your part in spreading managed democracy across the galaxy! ] #v(12pt) == Outline <subsec:outline> *@sec:introduction* Introduction *@sec:character* Character Creation *@sec:combat* Combat *@sec:travel* Travel and Exploration *@sec:weapons* Weapons and Equipment *@sec:strategems* Strategems = #text(yellow)[Character Creation] <sec:character> == Health #text(font: "Tahoma", size:10pt )[ Roll *4d6* to determine starting Hp. You start with, and can hold at most, *2* consumable *stims*. *Stims* can be used as a *sub-action*, and instantly heal you for *4d6* hp. ] == Personality Optional, chose or roll *1d6*: - Hot-blooded - Cowardly - Cocky - Adrenaline junkie - Sadistic - Hopeless == Equipped Weapon Chose *1*, or roll *1d2*: - *AR-23 Liberator* - *SG-8 Punisher* == Strategems Chose *2*, or roll *2d4* - 500 KG Bomb - Strafing Run - Corrosive gas - Orbital Railcannon Strike = #text(yellow)[Combat] <sec:combat> == Initiative #text(font: "Tahoma", size:10pt )[ At the start of combat each participant rolls a *d20* to determine their *initiative*. Participants act in order of highest to lowest *initiative*. *Helldivers* go first if the *initiative* is tied. ] == Turns #text(font: "Tahoma", size:10pt )[ At your *turn* you may take one *action*, a *sub-action*, and a *movement action*. *Actions* can include: Making an attack, Calling in a strategem, Interacting with an objective, Picking up something heavy *Sub-actions* include: Cooking a grenade, Using a stim, Diving away *Movement actions* can include: Moving, Sneaking, Getting up from the ground A list of all avalible actions, and their descriptions, can be found later in this document. ] == Making an attack #text(font: "Tahoma", size:10pt )[ How many attacks a player can make on their *turn* is determined by the number of *damage dice* for their equipped weapon. Each *damage die* represents one attack, the damage of which is determined by rolling said die. If a friendly *Helldiver* breaks the line of sight between you and your target that *Helldiver* will instead be shot, unless they dive away. *Example:* The AR-23 Liberator's *damage dice* is 3d4. With the Liberator a player can make 3 sepperate attacks, each dealing 1d4 damage. Each attack can be made against any target, and players can chose what dice to assign to what target. Attacks can be made to the same target multiple times. ] = #text(yellow)[Movement in combat] <sec:combat_move> == Moving #text(font: "Tahoma", size:10pt )[ *Helldivers* can use their *movement action* to move up to *30ft* during their turn. On a standard ttrpg battle mat, one square is equal to 5ft. This can occur while performing other actions, so a *Helldiver* may chose to move just *10ft*, perform an *action*, and then move the remaining *20ft*. ] == Diving #text(font: "Tahoma", size:10pt )[ A *Helldiver* can use their *sub-action* to *dive* *5ft* away. *Diving* will halve all *explosive* damage taken, negate *friendly fire*, and the *Helldiver* will be *prone*. This can be done at any time, however it will consume your *sub-action* for that *turn*. ] == Being prone #text(font: "Tahoma", size:10pt )[ While *prone*, movement speed is reduces to one third. This means *15ft* of movement is requred to move just *5ft*. If a *Helldiver* finds themselves *prone*, *5ft* of movement can be used to stand back up. A friendly *Helldiver* cannot accidentaly shoot you while *prone*, unless that other Helldiver is also themselves *prone*. ] = #text(yellow)[Travel and Exploration] <sec:travel> #text(font: "Tahoma", size:10pt )[ The rules for travel are made with a hex grid in mind. When traveling, each hex takes the equivalent of 2 *turns* to traverse. For each new hex explored, roll two *d12* dice. The first die checks for *enemy encounters*, the seccond for *points of interest*. If the hex tile has already been explored only the first die is rolled. ] #v(12pt) == Enemy encounters #text(font: "Tahoma", size:10pt )[ - 1: You get spotted by an enemy patrol. Roll initiative - 2: You spot an enemy patrol in a random, neighbouring hex. Roll *1d6* to determine the hex, starting with the northernmost hex and going clockwise. - 3-11: No enemy encounters - 12: You find a point of interest ] = #text(yellow)[Weapons and Equipment] <sec:weapons> == *AR-23 Liberator* #text(font: "Tahoma", size:10pt )[ *Rifle*, *3d4*, *Two-handed* ] == *SG-8 Punisher* #text(font: "Tahoma", size:10pt )[ *Shotgun*, *2d8*, *Two-handed* ] == *G-12 High Explosive* #text(font: "Tahoma", size:10pt )[ *Grenade*, *Delayed*, *Sub-action* As a sub-action, grenades can be thrown and after one *turn* will explode in a 4x4 area dealing *4d4* *explosive* damage to everything in range. Instead of imidiately throwing the grenade, it can be cooked as a *sub-action* and thrown as another *sub-action* on a later *turn*. Cooking a grenade for two *turns* will result in the grenade exploding in the holders hand. ] = #text(yellow)[Strategems] <sec:strategems> #text(font: "Tahoma", size:10pt )[ During their *turn*, *helldivers* can use an *action* to call down *strategems* from their Super Destroyer. *Strategems* are delivered either from the super destroyer's *Orbital cannons*, or dropped by an *Eagle fighter jet*. There is always a delay between when a *strategem* is called down, and when the *strategem* activates. Each *Helldiver* has their own Super Destroyer and Eagle. *Orbital strategems* activate at the *begining* of the players *next* *turn*. After activation the *strategem* is unavailable for a number of rounds, depending on the *strategem* *Eagle strategems* activate at the *end* of the players *current* *turn*. Unlike *Orbital strategems* they have no cooldown, and instead have a limited number of uses. The *Eagle* itself has a *1* round cooldown after deploying a *strategem*, meaning a *Helldiver* can't use their *Eagle strategems* two *turns* in a row. ] #v(12pt) == *500 KG Bomb* #text(font: "Tahoma", size:10pt )[ *Eagle*, *1 use* Deals *1d100* *explosive* damage to everything in range Range: *15ft* *radius*, centered on the strategem beacon ] == *Strafing Run* #text(font: "Tahoma", size:10pt )[ *Eagle*, *3 uses* Deals *3d4* damage to all creatures in range. Range: *25ft* *line*, centered on the strategem beacon ] == *Corrosive Gas* #text(font: "Tahoma", size:10pt )[ *Orbital*, *1 use* per *6 turns* Deals *1d4* *explosive* damage to everything in range when first called down. For *4* *turns*, inluding the first, all creatures that come into contact with the corosive gas will take *1d4* *corosive* damage. Creatures make contact with the corosive gas if they move through an area within range, or by either begining or ending a *turn* in range. Range: *15ft radius*, centered on the strategem beacon ] == *Orbital Railcannon Strike* #text(font: "Tahoma", size:10pt )[ *Orbital*, *1 use* per *12 turns* Deals *4d12* *impact* damage to the largest enemy in range Range: *10ft radius*, centered on the strategem beacon ]
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/042.%20bronze.html.typ
typst
bronze.html Why Smart People Have Bad Ideas Want to start a startup? Get funded by Y Combinator. April 2005This summer, as an experiment, some friends and I are giving seed funding to a bunch of new startups. It's an experiment because we're prepared to fund younger founders than most investors would. That's why we're doing it during the summer—so even college students can participate.We know from Google and Yahoo that grad students can start successful startups. And we know from experience that some undergrads are as capable as most grad students. The accepted age for startup founders has been creeping downward. We're trying to find the lower bound. The deadline has now passed, and we're sifting through 227 applications. We expected to divide them into two categories, promising and unpromising. But we soon saw we needed a third: promising people with unpromising ideas. [1]The Artix PhaseWe should have expected this. It's very common for a group of founders to go through one lame idea before realizing that a startup has to make something people will pay for. In fact, we ourselves did.Viaweb wasn't the first startup <NAME> and I started. In January 1995, we and a couple friends started a company called Artix. The plan was to put art galleries on the Web. In retrospect, I wonder how we could have wasted our time on anything so stupid. Galleries are not especially excited about being on the Web even now, ten years later. They don't want to have their stock visible to any random visitor, like an antique store. [2]Besides which, art dealers are the most technophobic people on earth. They didn't become art dealers after a difficult choice between that and a career in the hard sciences. Most of them had never seen the Web before we came to tell them why they should be on it. Some didn't even have computers. It doesn't do justice to the situation to describe it as a hard sell; we soon sank to building sites for free, and it was hard to convince galleries even to do that.Gradually it dawned on us that instead of trying to make Web sites for people who didn't want them, we could make sites for people who did. In fact, software that would let people who wanted sites make their own. So we ditched Artix and started a new company, Viaweb, to make software for building online stores. That one succeeded.We're in good company here. Microsoft was not the first company <NAME> and <NAME> started either. The first was called Traf-o-data. It does not seem to have done as well as Micro-soft. In Robert's defense, he was skeptical about Artix. I dragged him into it. [3] But there were moments when he was optimistic. And if we, who were 29 and 30 at the time, could get excited about such a thoroughly boneheaded idea, we should not be surprised that hackers aged 21 or 22 are pitching us ideas with little hope of making money.The Still Life EffectWhy does this happen? Why do good hackers have bad business ideas?Let's look at our case. One reason we had such a lame idea was that it was the first thing we thought of. I was in New York trying to be a starving artist at the time (the starving part is actually quite easy), so I was haunting galleries anyway. When I learned about the Web, it seemed natural to mix the two. Make Web sites for galleries—that's the ticket!If you're going to spend years working on something, you'd think it might be wise to spend at least a couple days considering different ideas, instead of going with the first that comes into your head. You'd think. But people don't. In fact, this is a constant problem when you're painting still lifes. You plonk down a bunch of stuff on a table, and maybe spend five or ten minutes rearranging it to look interesting. But you're so impatient to get started painting that ten minutes of rearranging feels very long. So you start painting. Three days later, having spent twenty hours staring at it, you're kicking yourself for having set up such an awkward and boring composition, but by then it's too late.Part of the problem is that big projects tend to grow out of small ones. You set up a still life to make a quick sketch when you have a spare hour, and days later you're still working on it. I once spent a month painting three versions of a still life I set up in about four minutes. At each point (a day, a week, a month) I thought I'd already put in so much time that it was too late to change.So the biggest cause of bad ideas is the still life effect: you come up with a random idea, plunge into it, and then at each point (a day, a week, a month) feel you've put so much time into it that this must be the idea.How do we fix that? I don't think we should discard plunging. Plunging into an idea is a good thing. The solution is at the other end: to realize that having invested time in something doesn't make it good.This is clearest in the case of names. Viaweb was originally called Webgen, but we discovered someone else had a product called that. We were so attached to our name that we offered him 5% of the company if he'd let us have it. But he wouldn't, so we had to think of another. [4] The best we could do was Viaweb, which we disliked at first. It was like having a new mother. But within three days we loved it, and Webgen sounded lame and old-fashioned.If it's hard to change something so simple as a name, imagine how hard it is to garbage-collect an idea. A name only has one point of attachment into your head. An idea for a company gets woven into your thoughts. So you must consciously discount for that. Plunge in, by all means, but remember later to look at your idea in the harsh light of morning and ask: is this something people will pay for? Is this, of all the things we could make, the thing people will pay most for?MuckThe second mistake we made with Artix is also very common. Putting galleries on the Web seemed cool.One of the most valuable things my father taught me is an old Yorkshire saying: where there's muck, there's brass. Meaning that unpleasant work pays. And more to the point here, vice versa. Work people like doesn't pay well, for reasons of supply and demand. The most extreme case is developing programming languages, which doesn't pay at all, because people like it so much they do it for free.When we started Artix, I was still ambivalent about business. I wanted to keep one foot in the art world. Big, big, mistake. Going into business is like a hang-glider launch: you'd better do it wholeheartedly, or not at all. The purpose of a company, and a startup especially, is to make money. You can't have divided loyalties.Which is not to say that you have to do the most disgusting sort of work, like spamming, or starting a company whose only purpose is patent litigation. What I mean is, if you're starting a company that will do something cool, the aim had better be to make money and maybe be cool, not to be cool and maybe make money.It's hard enough to make money that you can't do it by accident. Unless it's your first priority, it's unlikely to happen at all.HyenasWhen I probe our motives with Artix, I see a third mistake: timidity. If you'd proposed at the time that we go into the e-commerce business, we'd have found the idea terrifying. Surely a field like that would be dominated by fearsome startups with five million dollars of VC money each. Whereas we felt pretty sure that we could hold our own in the slightly less competitive business of generating Web sites for art galleries.We erred ridiculously far on the side of safety. As it turns out, VC-backed startups are not that fearsome. They're too busy trying to spend all that money to get software written. In 1995, the e-commerce business was very competitive as measured in press releases, but not as measured in software. And really it never was. The big fish like Open Market (rest their souls) were just consulting companies pretending to be product companies [5], and the offerings at our end of the market were a couple hundred lines of Perl scripts. Or could have been implemented as a couple hundred lines of Perl; in fact they were probably tens of thousands of lines of C++ or Java. Once we actually took the plunge into e-commerce, it turned out to be surprisingly easy to compete.So why were we afraid? We felt we were good at programming, but we lacked confidence in our ability to do a mysterious, undifferentiated thing we called "business." In fact there is no such thing as "business." There's selling, promotion, figuring out what people want, deciding how much to charge, customer support, paying your bills, getting customers to pay you, getting incorporated, raising money, and so on. And the combination is not as hard as it seems, because some tasks (like raising money and getting incorporated) are an O(1) pain in the ass, whether you're big or small, and others (like selling and promotion) depend more on energy and imagination than any kind of special training.Artix was like a hyena, content to survive on carrion because we were afraid of the lions. Except the lions turned out not to have any teeth, and the business of putting galleries online barely qualified as carrion.A Familiar ProblemSum up all these sources of error, and it's no wonder we had such a bad idea for a company. We did the first thing we thought of; we were ambivalent about being in business at all; and we deliberately chose an impoverished market to avoid competition.Looking at the applications for the Summer Founders Program, I see signs of all three. But the first is by far the biggest problem. Most of the groups applying have not stopped to ask: of all the things we could do, is this the one with the best chance of making money?If they'd already been through their Artix phase, they'd have learned to ask that. After the reception we got from art dealers, we were ready to. This time, we thought, let's make something people want.Reading the Wall Street Journal for a week should give anyone ideas for two or three new startups. The articles are full of descriptions of problems that need to be solved. But most of the applicants don't seem to have looked far for ideas.We expected the most common proposal to be for multiplayer games. We were not far off: this was the second most common. The most common was some combination of a blog, a calendar, a dating site, and Friendster. Maybe there is some new killer app to be discovered here, but it seems perverse to go poking around in this fog when there are valuable, unsolved problems lying about in the open for anyone to see. Why did no one propose a new scheme for micropayments? An ambitious project, perhaps, but I can't believe we've considered every alternative. And newspapers and magazines are (literally) dying for a solution.Why did so few applicants really think about what customers want? I think the problem with many, as with people in their early twenties generally, is that they've been trained their whole lives to jump through predefined hoops. They've spent 15-20 years solving problems other people have set for them. And how much time deciding what problems would be good to solve? Two or three course projects? They're good at solving problems, but bad at choosing them.But that, I'm convinced, is just the effect of training. Or more precisely, the effect of grading. To make grading efficient, everyone has to solve the same problem, and that means it has to be decided in advance. It would be great if schools taught students how to choose problems as well as how to solve them, but I don't know how you'd run such a class in practice.Copper and TinThe good news is, choosing problems is something that can be learned. I know that from experience. Hackers can learn to make things customers want. [6]This is a controversial view. One expert on "entrepreneurship" told me that any startup had to include business people, because only they could focus on what customers wanted. I'll probably alienate this guy forever by quoting him, but I have to risk it, because his email was such a perfect example of this view: 80% of MIT spinoffs succeed provided they have at least one management person in the team at the start. The business person represents the "voice of the customer" and that's what keeps the engineers and product development on track. This is, in my opinion, a crock. Hackers are perfectly capable of hearing the voice of the customer without a business person to amplify the signal for them. <NAME> and <NAME> were grad students in computer science, which presumably makes them "engineers." Do you suppose Google is only good because they had some business guy whispering in their ears what customers wanted? It seems to me the business guys who did the most for Google were the ones who obligingly flew Altavista into a hillside just as Google was getting started.The hard part about figuring out what customers want is figuring out that you need to figure it out. But that's something you can learn quickly. It's like seeing the other interpretation of an ambiguous picture. As soon as someone tells you there's a rabbit as well as a duck, it's hard not to see it.And compared to the sort of problems hackers are used to solving, giving customers what they want is easy. Anyone who can write an optimizing compiler can design a UI that doesn't confuse users, once they choose to focus on that problem. And once you apply that kind of brain power to petty but profitable questions, you can create wealth very rapidly.That's the essence of a startup: having brilliant people do work that's beneath them. Big companies try to hire the right person for the job. Startups win because they don't—because they take people so smart that they would in a big company be doing "research," and set them to work instead on problems of the most immediate and mundane sort. Think Einstein designing refrigerators. [7]If you want to learn what people want, read <NAME>'s How to Win Friends and Influence People. [8] When a friend recommended this book, I couldn't believe he was serious. But he insisted it was good, so I read it, and he was right. It deals with the most difficult problem in human experience: how to see things from other people's point of view, instead of thinking only of yourself.Most smart people don't do that very well. But adding this ability to raw brainpower is like adding tin to copper. The result is bronze, which is so much harder that it seems a different metal.A hacker who has learned what to make, and not just how to make, is extraordinarily powerful. And not just at making money: look what a small group of volunteers has achieved with Firefox.Doing an Artix teaches you to make something people want in the same way that not drinking anything would teach you how much you depend on water. But it would be more convenient for all involved if the Summer Founders didn't learn this on our dime—if they could skip the Artix phase and go right on to make something customers wanted. That, I think, is going to be the real experiment this summer. How long will it take them to grasp this? We decided we ought to have T-Shirts for the SFP, and we'd been thinking about what to print on the back. Till now we'd been planning to use If you can read this, I should be working. but now we've decided it's going to be Make something people want. Notes[1] SFP applicants: please don't assume that not being accepted means we think your idea is bad. Because we want to keep the number of startups small this first summer, we're going to have to turn down some good proposals too.[2] Dealers try to give each customer the impression that the stuff they're showing him is something special that only a few people have seen, when in fact it may have been sitting in their racks for years while they tried to unload it on buyer after buyer.[3] On the other hand, he was skeptical about Viaweb too. I have a precise measure of that, because at one point in the first couple months we made a bet: if he ever made a million dollars out of Viaweb, he'd get his ear pierced. We didn't let him off, either.[4] I wrote a program to generate all the combinations of "Web" plus a three letter word. I learned from this that most three letter words are bad: Webpig, Webdog, Webfat, Webzit, Webfug. But one of them was Webvia; I swapped them to make Viaweb.[5] It's much easier to sell services than a product, just as it's easier to make a living playing at weddings than by selling recordings. But the margins are greater on products. So during the Bubble a lot of companies used consulting to generate revenues they could attribute to the sale of products, because it made a better story for an IPO.[6] <NAME> presents the following recipe for a startup: "Watch people who have money to spend, see what they're wasting their time on, cook up a solution, and try selling it to them. It's surprising how small a problem can be and still provide a profitable market for a solution."[7] You need to offer especially large rewards to get great people to do tedious work. That's why startups always pay equity rather than just salary.[8] Buy an old copy from the 1940s or 50s instead of the current edition, which has been rewritten to suit present fashions. The original edition contained a few unPC ideas, but it's always better to read an original book, bearing in mind that it's a book from a past era, than to read a new version sanitized for your protection.Thanks to <NAME>, <NAME>, <NAME>, and <NAME> for reading drafts of this.Russian TranslationItalian TranslationJapanese Translation If you liked this, you may also like Hackers & Painters.
https://github.com/f14-bertolotti/bedlam
https://raw.githubusercontent.com/f14-bertolotti/bedlam/main/src/abstract-algebra/main.typ
typst
#import "../theme.typ" : comment, definition = Abstract Algebra #let monoid = ( tag : link(<monoid>)[monoid] ) #definition("monoid")[ $(X, dot.c:X times X --> X)$ is a *monoid* iff. 1. $forall a,b,c in X: a dot.c (b dot.c c) = (a dot.c) b dot.c c$. #comment[Associativity]. 2. $exists e in X: forall a in X: e dot.c a = a dot.c e = a$. #comment[Identity element]. ]<monoid> #let semiring = ( tag : link(<semiring>)[semiring] ) #definition("semiring")[ $(X,+:X times X-->X,dot.c:X times X-->X)$ is a *semiring* iff. 1. $(X,+)$ is a #monoid.tag with identity element $0$. 2. $(X,dot.c)$ is #monoid.tag with identity element $1$. 3. $+$ is commutative. 4. $a dot.c 0 = 0 and 0 dot.c a = 0$. #comment[$dot.c$ is annihilated by the identity element of $+$]. 5. $a dot.c (b + c) = a dot.c b + a dot.c c and (b + c) dot.c a = b dot.c a + c dot.c a$. #comment[$dot.c$ distributes over $+$]. ]<semiring>
https://github.com/Robotechnic/alchemist
https://raw.githubusercontent.com/Robotechnic/alchemist/master/src/molecule.typ
typst
MIT License
#let split-equation(mol, equation: false) = { if equation { mol = mol.body if mol.has("children") { mol = mol.children } else { mol = (mol,) } } let result = () let last-number = false for m in mol { let last-number-hold = last-number if m.has("text") { let text = m.text if str.match(text, regex("^[A-Z][a-z]*$")) != none { result.push(m) } else if str.match(text, regex("^[0-9]+$")) != none { if last-number { panic("Consecutive numbers in molecule") } last-number = true result.push(m) } else { panic("Invalid molecule content") } } else if m.func() == math.attach or m.func() == math.lr { result.push(m) } else if m == [ ] { continue } else { panic("Invalid molecule content") } if last-number-hold { result.at(-2) = result.at(-2) + result.at(-1) let _ = result.pop() last-number = false } } result } #let split-string(mol) = { let aux(str) = { let match = str.match(regex("^ *([0-9]*[A-Z][a-z]*)(_[0-9]+)?")) if match == none { panic(str + " is not a valid atom") } let eq = "\"" + match.captures.at(0) + "\"" if match.captures.len() >= 2 { eq += match.captures.at(1) } let eq = math.equation(eval(eq, mode: "math")) (eq, match.end) } while not mol.len() == 0 { let (eq, end) = aux(mol) mol = mol.slice(end) (eq,) } }
https://github.com/drupol/ipc2023
https://raw.githubusercontent.com/drupol/ipc2023/main/src/ipc2023/imports/preamble.typ
typst
#import "@preview/polylux:0.3.1": * #import "@preview/diagraph:0.1.0": * // #render("digraph { a -> b }") #import "@preview/codelst:1.0.0": sourcecode, sourcefile #import "@preview/hidden-bib:0.1.0": hidden-cite #import "../theme/ipc.typ": * #import "colors.typ": *
https://github.com/gigu003/typst-templates
https://raw.githubusercontent.com/gigu003/typst-templates/main/README.md
markdown
MIT License
# typst-template This repository contains templates for the quarto output format typst.
https://github.com/gabrielluizep/typst-ifsc
https://raw.githubusercontent.com/gabrielluizep/typst-ifsc/main/examples/exam.example.typ
typst
Creative Commons Zero v1.0 Universal
#import "../templates/exam.typ": * #show: doc => exam( title: "Prova 1A", professor: "<NAME>", email: "<EMAIL>", program: "Engenharia de Telecomunicações", course: "Programação I", semester: "2023.2", doc, )
https://github.com/lucannez64/Notes
https://raw.githubusercontent.com/lucannez64/Notes/master/Critical%20Points.typ
typst
#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( title: "Critical Points", authors: ( "<NAME>", ), date: "30 Octobre, 2023", ) #set heading(numbering: "1.1.") = Critical Points <critical-points> == Definition <definition> A critical point of a multivariable function is a point at which the partial derivatives of the function are either zero or undefined. In other words, it is a point at which the function is not changing along one or more of its variables. Critical points are important in multivariable calculus, as they are the points where the behavior of the function changes. For example, the maximum and minimum values of a function may occur at a critical point. To find the critical points of a function $f lr((x comma y))$, we need to take the partial derivatives of the function with respect to $x$ and $y$ and set them equal to zero. This gives us a system of equations that can be solved to find the values of $x$ and $y$ at the critical points. For example, consider the function $f lr((x comma y)) eq x^2 plus y^2$. The partial derivatives of this function are: $ frac(diff f, diff x) eq 2 x $ $ frac(diff f, diff y) eq 2 y $ Setting these partial derivatives equal to zero, we get the equations $2 x eq 0$ and $2 y eq 0$. Solving these equations gives us the critical points $lr((0 comma 0))$ and $lr((0 comma 0))$. In general, finding the critical points of a multivariable function can be more complex than in the one-dimensional case, as the function may have multiple partial derivatives and the critical points may not be unique. However, the tools of multivariable calculus can be used to analyze the behavior of the function near these critical points and to determine their importance. == Links <links> - #link("Partial Derivative.pdf")[Partial Derivative]
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/visualize/gradient-repeat.typ
typst
Apache License 2.0
// Test repeated gradients. --- #rect( height: 40pt, width: 100%, fill: gradient.linear(..color.map.inferno).repeat(2, mirror: true) ) --- #rect( height: 40pt, width: 100%, fill: gradient.linear(..color.map.rainbow).repeat(2, mirror: true), ) --- #rect( height: 40pt, width: 100%, fill: gradient.linear(..color.map.rainbow).repeat(5, mirror: true) ) --- #rect( height: 40pt, width: 100%, fill: gradient.linear(..color.map.rainbow).sharp(10).repeat(5, mirror: false) ) --- #rect( height: 40pt, width: 100%, fill: gradient.linear(..color.map.rainbow).sharp(10).repeat(5, mirror: true) )
https://github.com/0xPARC/0xparc-intro-book
https://raw.githubusercontent.com/0xPARC/0xparc-intro-book/main/src/fhe0.typ
typst
#import "preamble.typ":* = FHE and levelled FHE <fhe-intro> Alice has a secret $x$, and Bob has a function $f$. They want to compute $f(x)$. Actually, Alice wants Bob to compute $f(x)$ -- but she doesn't want to tell him $x$. What Alice wants is a _fully homomorphic encryption (FHE)_ protocol, meaning: 1. Alice encrypts $x$ and sends Bob $Enc (x)$. 2. Bob then "applies $f$ to the ciphertext" and obtains $Enc (f(x))$, sending it to Alice. 3. Alice decrypts $Enc (f(x))$ to learn $f(x)$. _Levelled FHE_ is a weaker version of FHE. Like FHE, levelled FHE lets you perform operations on encrypted data. But unlike FHE, there will be a limit on the number of operations you can perform before the data must be decrypted. Why is there a limit? Loosely speaking, the encryption procedure will involve some sort of "noise" or "error." As long as the error is not too big, the message can be decoded without trouble. But each operation on the encrypted data will cause the error to grow --- and if it grows beyond some maximum error tolerance, the message will be lost. So there is a limit on how many operations you can do before the error gets too big. As a sort of silly example, imagine your message is a whole number between 0 and 10 (so it’s one of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), and your "encryption scheme" encrypts the message as a real number that is very close to the message, and decrypts a real number by "round to the nearest integer." So, the message 2 might be encrypted as 1.999832. (You might be thinking: This is some pretty terrible cryptography, because the message isn’t secure. Anyone can figure out how to round a number, no secret key required. Yep, you’re right. The full scheme (@lwe-crypto) is more complicated. But it still has this "rounding-off-errors" feature, and that’s what we want to focus on right now.) Now imagine that the main operation you want to perform is addition (optionally, say, modulo 11). Well, every time you add two encrypted numbers ($1.999832 + 2.999701 = 4.999533$), the errors add as well. After too many operations, the error will exceed $0.5$, and the rounding procedure won’t give the right answer anymore. But as long as you’re careful not to go over the error limit, you can add ciphertexts with confidence. For our levelled FHE protocol, our message will be a bit (either 0 or 1) and our operations will be the logic gates AND and NOT. Because any logic circuit can be built out of AND and NOT gates, we'll be able to perform arbitrary calculations within the FHE encryption. Our protocol uses a cryptosystem built from a problem called "learning with errors." "Learning with errors" is kind of a strange name; it would make more sense to call it "approximate linear algebra modulo $q$." Anyway, we'll start with the learning-with-errors problem (@lwe) and how to build cryptography on top of it (@lwe-crypto) before we get back to levelled FHE.
https://github.com/memset0/ZJU-Project-Report-Template
https://raw.githubusercontent.com/memset0/ZJU-Project-Report-Template/master/examples/fds/documents/report.typ
typst
MIT License
#import "../../../template.typ": * #show: project.with( theme: "project", course: "Fundamentals of Data Structures", title: "Projects 1: ???", date: "2024/03/14", author: "memset0", semester: "2023-2024 Spring & Summer", ) = *Chapter 1*: Introduction Problem description and (if any) background of the algorithms. = *Chapter 2*: Algorithm Specification Description (pseudo-code preferred) of all the algorithms involved for solving the problem, including specifications of main data structures. == Step One == Step Two == Step Three // Auto-numbering is supported = *Chapter 3*: Testing Results Table of test cases. Each test case usually consists of a brief description of the purpose of this case, the expected result, the actual behavior of your program, the possible cause of a bug if your program does not function as expected, and the current status ("pass", or "corrected", or "pending"). #table( columns: (1fr, 1fr), align: top, inset: 10pt, [`Sample Input`], [`Sample Output`], [ #codex(read("../code/sample.in"), lang: "txt", border: false) ], [ #codex(read("../code/sample.out"), lang: "txt", border: false) ], ) = *Chapter 4*: Analysis and Comments Analysis of the time and space complexities of the algorithms. Comments on further possible improvements. = *Appendix*: Source Code (in C) At least 30% of the lines must be commented. Otherwise the code will NOT be evaluated. File sol.c: #codex(read("../code/sol.c"), lang: "c") // use `importCode` function to read code from a file = *Declaration* I hereby declare that all the work done in this project titled "XXX" is of my independent effort. Please keep in mind that these are the "minimum" requirements. Other requirements will be specified according to each project assignment.
https://github.com/asouris/Apuntes-CC3501
https://raw.githubusercontent.com/asouris/Apuntes-CC3501/main/Apunte.typ
typst
#import "template/conf.typ": conf // Puedes revisar el archivo template/conf.typ para // ver cómo funciona y personalizarlo #show: conf.with( titulo: "Apunte Gráfica", subtitulo: "", departamento: "dcc", profesores: ("<NAME>",), // Un arreglo de un elemento necesita una coma al final. autores: ("<NAME>", "<NAME>", "<NAME>"), curso: "CC3501 - Modelación y Computación Gráfica para Ingenieros", ) // make links blue #show link: set text(fill: rgb(0, 0, 255)) // underline links #show link: underline #pagebreak() #outline(indent: 2em) #pagebreak() = Raster y Color Existen distintos modelos de color para presentar figuras, imágenes o impresiones. Por ejemplo están: [CMYK], [HSV], [YIQ], pero sin duda el más importante, y al cual todos convergen es [RGB] == Espacios de Color - *RGB*: Espacio de color que se basa en mezclar rojo, verde y azul. También se interpreta como un sistema aditivo dado que vamos a sumar los aportes de cada componente para obtener el color final. #figure(image("img/rasterColor/rgbCube.png", width: 22%), caption: [Cubo RGB]) - *CMKY*: Este es un modelo sustractivo. Aquí el negro se encuentra al aportar todos los componentes al máximo. Se utiliza en impresoras. #figure(image("img/rasterColor/cmky.png", width: 22%), caption: [Combinar todos los componentes da negro]) - *HSV*: Presenta una versión más intuitiva de la combinación de colores (ya que rgb no es muy humano) #figure(image("img/rasterColor/hsv.png", width: 22%), caption: [HSV mapeado en un cilindro]) - *YIQ*: Usado en televisiones. Posee una cantidad reducida de colores. == Colores en el computador - *Interpolación*: Dados ciertos valores, interpolación se refiere al proceso en que encontramos los valores intermedios entre nuestros puntos originales. #figure(image("img/rasterColor/interpolation.png", width: 40%), caption: [Interpolación de los colores, dados los 4 vértices del rectángulo]) - *Almacenamiento*: ¿Cómo se almacena un color (RGB)? Necesitamos 8 bits por componente, como son 3 componentes tenemos un total de 24 bits. Luego incluímos el canal alpha (transparencia) y nos quedamos con un total de 32 bits. - *¿Transparencia?* Al incluir la transparencia se obtiene la siguiente fórmula $ c=a c_f = (1-a)c_b $ Donde $c_f$ es el color de el frente, $c_b$ el color de atras y $a$ la transparencia o _alpha_ del frente. == Raster y Vector - *Imagen raster*: Se compone de una matriz 2D donde a cada celda se le conocerá como un pixel, son usados en formatos: png, jpg, bmp o gif. - *Imagen vectorial*: Usan modelos paramétricos por cada figura representada donde no hay pérdida de nitidez en ninguna forma. Las letras tipográficas funcionan así, son usados en formatos: svg, eps y vrml. - *Pantalla Raster*: Define un arreglo 2D en pixeles centrados en coordenadas enteras de forma que se pueda iluminar un pixel con setpixel(x, y). #pagebreak() = Bresenham Ya pero ¿Cómo se dibuja una línea con pixeles? El Algoritmo de Bresenham es eficiente a la hora de dibujar una línea en una pantalla raster, es decir, que esté compuesta por pixeles. Este algoritmo se puede utilizar en rectas que tengan una pendiente entre 0 y 1. Se tiene una línea recta desde $(x_0, y_0)$ a $(x_1, y_1)$ con pendiente $m in [0, 1]$. Tras pintar $(x_0, y_0)$ se quiere saber si pintar el pixel $(x_0+1, y_0)$ o $(x_0 + 1, y_0 + 1)$. En la figura se marcan los pixeles candidatos en verde. #figure(image("img/bresenham/bresenham1.png", width: 50%), caption: [Pixeles candidatos en verde]) Primero, tomemos la ecuación en su forma $f(x, y) = A x +B x +C =0$ donde - $A= Delta y=y_1-y_0$ - $B=-Delta x=-(x_1-x_0)$ - $C=(Delta x) c=(x_1 -x_0)c$ Para cualquier punto de la recta $f(x, y) = 0$, $f(x, y)>0$ para puntos sobre la recta y $f(x, y)<0$ para puntos bajo la recta. Evaluamos el punto medio entre $y_0$ e $y_0+1$. Si $f(x_0+1, y_0+ 1/2 )$ es positivo, entonces la línea se acerca más al punto superior y pintamos el pixel $(x_0+1, y_0+1)$, de los contrario pintamos $(x_0+1, y_0)$ #footnote[Para una definición similar a la del profesor Patricio Inostroza lea aquí: #underline[#text(blue)[https://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html]]] #pagebreak() Para pendientes fuera del rango $[0, 1]$ utilizamos simetría #figure(image("img/bresenham/bresenham2.png", width:50%), caption:[Uso de la simetría para aplicar el algortimo al resto de los octantes.]) == Bresenham en el Círculo _to-do_ #pagebreak() = Transformaciones Este documento pretende ser un punteo así que se mencionarán rápidamente las matrices de transformación. - *Coordenadas Homogéneas*: Es un sistema de coordenadas utilizado en computación gráfica (y otras áreas) para la geometría proyectiva. Las matrices que se mencionarán a continuación están en coordenadas homogéneas. - *Escalamiento*: Escalar por las magnitudes $s_x$, $s_y$ y $s_z$ en sus respectivos ejes. $ mat(delim: "[", s_x, 0, 0, 0;0, s_y, 0, 0;0, 0, s_z, 0;0,0,0, 1) $ - *Rotación sobre el eje x*: Rotación de $theta$ grados anti-reloj $ mat(delim:"[", 1, 0, 0, 0;0, cos(theta), -sin(theta), 0;0, sin(theta), cos(theta), 0;0, 0, 0, 1) $ - *Rotación sobre el eje y*: Rotación de $theta$ grados anti-reloj $ mat(delim:"[", cos(theta), 0, sin(theta), 0;1, 0, 0, 0;-sin(theta), 0, cos(theta), 0;0, 0, 0, 1) $ - *Rotación sobre el eje z*: Rotación de $theta$ grados anti-reloj $ mat(delim:"[", cos(theta), -sin(theta), 0, 0;sin(theta), cos(theta), 0, 0;0, 0, 1, 0;0, 0, 0, 1) $ - *Traslación*: Trasladar el punto por las magnitudes $d_x$, $d_y$ y $d_z$ en sus respectivos ejes $ mat(delim: "[", 1, 0, 0, d_x;0, 1, 0, d_y;0, 0, 1, d_z;0, 0, 0, 1) $ - *Reflexión*: La reflexión se extiende de el escalamiento pero con magnitudes negativas. Por ejemplo, la reflexión con respecto al eje Y cambia el signo del componente en X $ mat( delim: "[", -1, 0, 0, 0;0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1) $ - *Shearing* $ mat(delim:"[", 1, s_(x y), s_(x z), 0;s_(y x), 1, s_(y z), 0;s_(z x), s_(z y), 1, 0;0, 0, 0, 1) $ - *Composición de transformaciones*: Se pueden realizar varias transformaciónes juntas para obtener una gran matriz de transformación. $ mat(delim:"[", x'; y'; z'; 1) &= mat( delim: "[", -1, 0, 0, 0;0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1) dot mat(delim:"[", cos(theta), -sin(theta), 0, 0;sin(theta), cos(theta), 0, 0;0, 0, 1, 0;0, 0, 0, 1) dot mat(delim: "[", s_x, 0, 0, 0;0, s_y, 0, 0;0, 0, s_z, 0;0,0,0, 1) dot mat(delim:"[", x; y; z; 1) \ mat(delim:"[", x'; y'; z'; 1) &= mat(delim:"[", ?, ?, ?, ?;?, ?, ?, ?;?, ?, ?, ?;?, ?, ?, ?) dot mat(delim: "[", x;y;z;1) $ #pagebreak() = Viewing Lo que se debe rescatar de esta sección es principalmente las diferencias entre los distintos sistemas de coordenadas que usamos en las apis (OpenGL), en las pantallas u otra forma de representar imágenes. - *Coordenadas del dispositivo o Display Coordinates (DC)*: En este sistema se especificara en que parte de la pantalla mostrar información. #figure(image("img/viewing/viewing2.png", width:40%)) - *Coordenadas del mundo o World Coordinates (WC)*: En este sistema se especifican los objetos que queremos mostrar y en ellas se basan las transformaciones. #figure(image("img/viewing/viewing1.png", width:45%)) - *Window*: Sección de WC que quermos mostrar #figure(image("img/viewing/viewing3.png", width:45%)) - *Viewport*: Seccion de DC en donde queremos mostrar. #figure(image("img/viewing/viewing4.png", width:45%)) - *Coordenadas normalizadas o Normalized device coordinates (NDC)*: Es un sistema de coordenadas independiente de la pantalla del dispositivo. Existe en el rango de $[-1, 1]$ y es un punto medio entre WC y DC. Su objetivo es ser un intermediario para mostrar la información en cualquier pantalla. == Window a Viewport Transformar un punto del window $(x_w, y_w)$ a un punto en el viewport $(x_v, y_v)$ #figure(image("img/viewing/viewing5.png", width: 69%), caption:[Transformación de window a viewport.]) Se tiene que $ X_v=(X_w - X_(w min)) dot (X_(v max) - X_(v min))/(X_(w max)- X_(w min)) \ Y_v = (Y_w - Y_(w min)) dot (Y_(v max) - Y_(v min))/(Y_(w max)- Y_(w min)) $ #pagebreak() = Clipping Se quiere identificar los elementos que serán visibles en el window y los que no. - *Clipping sobre un punto*: Es simple. Dado los extremos del window $L, R, T$ y $B$, $(x, y)$ es visible si $L<=x<=R$ y $B<=y<=T$ #figure(image("img/viewing/viewing6.png", width: 50%)) - *Clipping sobre un segmento*: Primero podemos determinar los segmentos que si o si son invisibles, esto es si cumple alguno de los siguientes: - $x_1$ y $x_2 < L$ - $x_1$ y $x_2 > R$ - $y_1$ e $y_2 < B$ - $y_1$ e $y_2 > T$ #figure(image("img/viewing/viewing7.png", width: 70%)) ¿Qué se hace con los segmentos indeterminados? - *Algoritmo de Cohen-Sutherland para clipping*: Se divide la región en 9 secciones y a cada seccion se le asigna un código de 4 bits. #figure(image("img/clipping/clipping1.png", width: 40%), caption:[Secciones segun Cohen-Sutherland]) Cada bit hace referencia a si se encuentra a la izquierda, derecha, abajo y arriba del window. Por ejemplo, las secciones de la izquierda tiene el primer bit encendido. Luego, tenemos que: - Si ambos extremos tienen código `0000` entonces es un segmento visible. - Si el resultado de la operación bitwise `&` entre ambos códigos es distinta a 0, es un segmento no visible.```python if extremo1 == 0 and extremo2 == 0: segmento es visible else if extremo1 & extremo2 != 0: segmento no-visible else: indeterminado ``` Ahora se trabaja con los segmentos indeterminados. Si se analizan los códigos de sus extremos se puede identificar con qué borde intersecta el segmento. #figure(image("img/clipping/clipping2.png", width: 50%)) En la figura se ve que el segmento de la derecha intersecta con el borde de la derecha, tal y como indica su código. Se deben obtener las intersecciones con los bordes y de esa forma se define el segmento interior como aquel que es visible. Basta con plantear las ecuaciones de recta para el segmento, reemplazar $x$ o $y$ con el borde intersectado y obtener el punto completo. - *Algoritmo de Laing-Barsky para clipping*: Este argumento se basa en tomar la parametrización de la recta y acotarla a su segmento visible. Se toman las ecuaciones paramétricas del segmento que va de $(x_1, y_1)$ a $(x_2, y_2)$. $ x=x_1 + t (x_2 - x_1) =x_1 + t Delta x \ y = y_1 + t (y_2 - y_1) = y_1 + t Delta y $ #figure(image("img/clipping/clipping3.png", width: 50%)) Ya se tenía que para un punto, se podía concluir que era visible si cumplia con: $ x_min <= x <= x_max, space y_min <= y <= y_max \ x_min <= x_1 + t Delta x <= x_max , space y_min <= y_1 + t Delta y <= y_max $ Se separan las dos desigualdades en las 4 siguientes - $t Delta x >= x_min - x_1$, - $t Delta x <= x_max - x_1$, - $t Delta y >= y_min - y_1$, - $t Delta y <= y_max - y_1$ Expresadas todas de la forma $<=$: - $-t Delta x <= x_1 - x_min$, - $t Delta x <= x_max - x_1$, - $- t Delta y <= y_1 -y_min$, - $t Delta y <= y_max - y_1$ Luego, se expresan de la forma general $t dot p_k <= q_k$, donde $k=1, 2, 3$ o $4$ para cada borde izquierdo, derecho bajo y alto en ese orden. - $p_1=-Delta x, space q_1=x_1-x_min$, $t=q_1/p_1$ - $p_2=Delta x, space q_2=x_max-x_1$, $t=q_2/p_2$ - $p_3=-Delta y, space q_3=y_1-y_min$, $t=q_3/p_3$ - $p_4=Delta y, space q_3=y_max-y_1$, $t=q_4/p_4$ Ahora, en una parametrización, si se toma $t in [0, 0.5]$ de dibujaría hasta la mitad de la recta #figure(image("img/clipping/clipping4.png", width: 50%)) De esta misma forma, lo que se quiere es modificar los valores $t_1$ y $t_2$ en $t in [t_1, t_2]$ para dibujar exactamente el segmento visible de la recta. Dadas las ecuaciones anteriores, el algoritmo prosigue así: 1. Para cada $k$ evaluamos las 4 inecuaciones. 2. Si $p_k = 0$ la recta es paralela al borde $k$. - Luego si $q_k<0$ la recta está completamente fuera del window y se termina aquí el algoritmo. - Pero si $q_k >= 0$ la linea está dentro del window pero paralela al borde $k$, no se ajusta ni $t_1$ ni $t_2$ para este $k$. 3. Si $p_k < 0$ se debe actualizar el primer valor $t_1$ a $ t_1=max(0, q_k/p_k) $ 4. Si $p_k > 0$ se debe actualizar el segundo valor $t_2$ a $ t_2 = min(1, q_k/p_k) $ 5. Luego de actualizar se debe evaluar lo siguiente: - Si $t_1 > t_2$ la recta se rechaza. - Si $t_1 > 0$ cambian los valores del inicio de la recta, es decir cambian $x_1$ e $y_1$ $ x_1^"new" = x_1 + t_1 Delta x \ y_1^"new" = y_1 + t_1 Delta y $ - Si $t_2 < 1$cambian los valores del fin de la recta, es decir cambian $x_2$ e $y_2$ $ x_2^"new" = x_2 + t_2 Delta x \ y_2^"new" = y_2 + t_2 Delta y $ Así se termina con la parametrización de solo el segmento visible de la recta. - *Algoritmo de Sutherland-Hodgaman para clipping* _to-do_ - *Algoritmo de Weiler-Atherton para clipping* _to-do_ = Gráfo de escena _to-do_ = Proyecciones _to-do_ = Splines _to-do_ = Iluminación _to-do_ = Visibilidad _to-do_ = Fractales? _to-do_
https://github.com/drupol/cv
https://raw.githubusercontent.com/drupol/cv/master/src/cv/cv-theme.typ
typst
#import "@preview/fontawesome:0.4.0": * #import "common/metadata.typ": * #import "common/lib.typ": * #let resume( firstname: "", lastname: "", body, ) = { // --- Page configuration --- set page( margin: page-margin, numbering: "1", number-align: center, paper: "a4", footer: [ #{ set text(size: font-defaults.tiny, fill: black.lighten(75%)) [ #link("https://github.com/drupol/cv/commit/" + shortRev)[ Build date: #builddate - Revision: #shortRev ] ] } ], ) // --- Typography --- set text( font: body-font, size: font.normal, lang: "en", hyphenate: false, ) // --- Paragraphs --- // Source: https://typst.app/docs/guides/guide-for-latex-users/ set par(justify: true) show par: set block(spacing: .75em) // --- Links --- show link: it => { underline(it, stroke: .2pt + rgb("#000000").lighten(65%)) } { grid( columns: (1fr, 3fr), align: (left, right), )[ #text(size: 3em, weight: "bold")[#firstname]\ #text(size: 3em, weight: "bold")[#lastname]\ #text(size: 1.12em)[#subtitle]\ ][ #{ grid(columns: 3, rows: 2, column-gutter: 1em, row-gutter: .5em, align: left)[ #linkItem(icon: "map-pin")[#link("https://www.openstreetmap.org//#map=15/50.59690/4.32280")[Nivelles, Belgium]] ][ #linkItem(icon: "github")[#link("https://github.com/drupol")[github.com/drupol]] ][ #linkItem(icon: "envelope")[#link("mailto:<EMAIL>")[<EMAIL>]] ][ #linkItem(icon: "globe")[#link("https://not-a-number.io")[not-a-number.io]] ][ #linkItem(icon: "github")[#link("https://github.com/loophp")[github.com/loophp]] ][ #linkItem(icon: "mastodon")[#link("https://mathstodon.xyz/@Pol")[\<EMAIL>]] ] } ] customBox(title: [About])[ #grid( columns: (1fr, 1fr) )[ Since beginning my web development journey in 2010, I have acquired a wealth of experience across diverse environments, including innovative start-ups and established consultancies. A highly motivated, self-taught professional, I am passionate about solving intricate problems by implementing elegant, streamlined solutions. My insatiable curiosity and meticulous nature have made me a perpetual learner, constantly striving to expand my knowledge. I take great satisfaction in creating simple, natural, and efficient solutions that harmoniously balance aesthetics and functionality. ][ #box(inset: (left: 2em))[ #featureBar(title: "Linux/NixOS", value: 97%) #featureBar(title: "Object Oriented Programming", value: 90%) #featureBar(title: "PHP/Python", value: 87%) #featureBar(title: "Functional Programming", value: 85%) #featureBar(title: "Git/Jujutsu", value: 85%) #featureBar(title: "Algorithm", value: 85%) #featureBar(title: "Docker", value: 75%) #featureBar(title: "Typst", value: 70%) #featureBar(title: "LaTeX", value: 65%) ] ] ] customBox(title: [Experience])[ #jobEntry( title: "Senior Application Architect", company: [#link("https://ec.europa.eu")[European Commission]], location: "Bruxelles", type: "Full time", date: "6/2024 -- present", tags: ( link("https://en.wikipedia.org/wiki/Python_(programming_language)")[Python], link("https://en.wikipedia.org/wiki/MongoDB")[MongoDB], link("https://en.wikipedia.org/wiki/Nix_(package_manager)")[Nix], link("https://en.wikipedia.org/wiki/Git")[Git], link("https://github.com/martinvonz/jj")[Jujutsu], link("https://en.wikipedia.org/wiki/Infrastructure_as_code")[IAC], ), )[ Hired on behalf of a consultancy company, working at #link("https://ec.europa.eu/info/departments/informatics_en")[Digit B.4] (#emph[Software Engineering Capabilities]). In this role, I am part of a team of developers, responsible for developing #emph[GPT\@EC], an internal AI chatbot application based on GPT technology. My primary focus is on designing and building a scalable, robust solution, ensuring optimal performance, security, and integration within the European Commission's ecosystem. ] #jobEntry( title: "Application Architect", company: [#link("https://ec.europa.eu")[European Commission]], location: "Bruxelles", type: "Full time", date: "7/2019 -- 6/2024", tags: ( link("https://en.wikipedia.org/wiki/Nix_(package_manager)")[Nix], link("https://symfony.com/")[Symfony], link("https://www.doctrine-project.org/")[Doctrine], link("https://api-platform.com/")[API Platform], link("https://en.wikipedia.org/wiki/Oracle_Database")[Oracle], link("https://en.wikipedia.org/wiki/Docker_(software)")[Docker], link("https://en.wikipedia.org/wiki/Infrastructure_as_code")[IAC], ), )[ Hired on behalf of a consultancy company, working at #link("https://ec.europa.eu/info/departments/informatics_en")[Digit B.4] (#emph[Software Engineering Capabilities]), where I work in the Developer's Journey team. In this role, I guide teams and clients through the migration process from ColdFusion to PHP. Additionally, I design and implement authentication libraries solutions and the necessary development infrastructure for multiple teams, with a focus on creating reproducible and ephemeral development environments based on Nix. ] #jobEntry(date: [#text( size: font-defaults.footnotesize, fill: black.lighten(75%), )[Before 2019]])[ #{ set text(size: font-defaults.footnotesize, fill: black.lighten(75%)) [This is the public and short version of my CV. Please ask for the full version by sending me an #link("mailto:<EMAIL>")[email].] } ] ] grid( columns: (1fr, 1fr), column-gutter: 1em, )[ #customBox(title: [Education])[ #educationEntry( title: "MSc Computer Science", school: [#link("https://web.umons.ac.be")[University of Mons]], type: "Full time", grade: [Cum Laude], date: "2021 -- 2024", )[ Thesis: #link("https://doi.org/10.5281/zenodo.12666898")["Reproducibility in Software Engineering"] ] #educationEntry( title: "BSc Computer Science", school: [#link("https://www.heh.be")[Haute Ecoles en Hainaut]], type: "Full time", grade: [Cum Laude], date: "2001 -- 2005", )[ IT and systems, specialisation in network and telecommunications ] #educationEntry( title: "Music theory / Piano", school: [#link("https://academiedenivelles.be")[Académie de musique de Nivelles]], type: "Full time", date: "2018 -- 2021", )[] ] ][ #customBox(title: [Certificates])[ #educationEntry( title: "Blockchain: Understanding Its Uses and Implications", school: [#link("https://courses.edx.org/certificates/01fdb9d9242546e8bc45153468dfd785")[The Linux Foundation]], type: "Full time", date: "01/2020", )[] #educationEntry( title: "Acquia Certified Developer", school: [#link("https://certification.acquia.com/user/249")[Acquia]], type: "Full time", date: "09/2015", )[] #educationEntry( title: "Acquia Certified Back End Specialist", school: [#link("https://certification.acquia.com/user/249")[Acquia]], type: "Full time", date: "09/2015", )[] ] ] grid( columns: (1fr, 2fr, 1fr), column-gutter: 1em, )[ #customBox(title: [Languages])[ - #languageItem(lang: "French", level: "native") - #languageItem(lang: "English", level: "B2") - #languageItem(lang: "Italian", level: "A2") - #languageItem(lang: "Dutch", level: "A2") ] ][ #customBox(title: [Hobbies])[ Besides my work and the geek stuff, I’m currently fulfilling a childhood dream, I’m learning music and piano! I love photography and I learned by myself most of the secrets of a reflex camera, just for fun. I swim a lot and I also really like riding my mountain bike. ] ][ #customBox(title: [Non Profit])[ Contributor in many open-source projects. Official maintainer of the #link("https://nixos.org")[NixOS Linux distribution]. I am also an OpenStreetMap user and contributor. ] ] customBox(title: [Favorite quotes])[ - Simplicity is the ultimate sophistication. - <NAME> - Only when the last tree has died and the last river been poisoned and the last fish been caught will we realize we cannot eat money. - Indian author - We may regard the present state of the universe as the effect of its past and the cause of its future. An intellect which at a certain moment would know all forces that set nature in motion, and all positions of all items of which nature is composed, if this intellect were also vast enough to submit these data to analysis, it would embrace in a single formula the movements of the greatest bodies of the universe and those of the tiniest atom; for such an intellect nothing would be uncertain and the future just like the past would be present before its eyes. - <NAME> ] } }
https://github.com/bojohnson5/iu_dissertation
https://raw.githubusercontent.com/bojohnson5/iu_dissertation/main/main.typ
typst
MIT License
#import "iu_dissertation.typ": thesis, iuquote #show: doc => thesis( title: [Research on the Quantum Theory], author: [<NAME>], dept: [Physics], year: [1925], month: [January], day: [19], committee: ( ( name: "<NAME>", title: "Ph.D." ), ), dedication: none, acknowledgement: lorem(100), abstract: lorem(100), doc ) = The Phase Wave #lorem(100) $ psi(bold(r), t) = 1/(sqrt(2 pi planck.reduce)) e^(-i / planck.reduce p x) $ == The Relation Between Quantum and Relativity Theories #lorem(100) #figure(table( columns: (auto, auto, auto), inset: 10pt, align: horizon, [], [*Area*], [*Parameters*], [Cylinder], $ pi h (D^2 - d^2) / 4 $, [ $h$: height \ $D$: outer radius \ $d$: inner radius ], [Tetrahedron], $ sqrt(2) / 12 a^3 $, [$a$: edge length] ), caption: [My awesome table], ) == Phase and Group Velocities #lorem(200) == Phase Waves in Spacetime #lorem(200) = The Principles of Maupertuis and Fermat #lorem(200) == Motivation #lorem(200) #iuquote[#lorem(100)]
https://github.com/kunalchandan/resume
https://raw.githubusercontent.com/kunalchandan/resume/main/README.md
markdown
# Resume Written in typst. ## Preview ![resume preview](./resume-1.png) ## Build instructions Download Lato and Jost from google fonts. Install them with ```bash sudo cp fonts/* /usr/share/fonts/truetype/ ``` or whatever your system uses for font installation. Get icons: ```bash wget https://github.com/Remix-Design/RemixIcon/releases/download/v3.3.0/RemixIcon_SVG_v3.3.0.zip unzip RemixIcon_SVG_v3.3.0.zip rm RemixIcon_SVG_v3.3.0.zip ```
https://github.com/RaphGL/ElectronicsFromBasics
https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/DC/chap1/6_voltage_and_current_practical.typ
typst
Other
=== Voltage and current in a practical circuit Because it takes energy to force electrons to flow against the opposition of a resistance, there will be voltage manifested (or "dropped") between any points in a circuit with resistance between them. It is important to note that although the amount of current (the quantity of electrons moving past a given point every second) is uniform in a simple circuit, the amount of voltage (potential energy per unit charge) between different sets of points in a single circuit may vary considerably: #image("static/6-single-circuit.png") Take this circuit as an example. If we label four points in this circuit with the numbers 1, 2, 3, and 4, we will find that the amount of current conducted through the wire between points 1 and 2 is exactly the same as the amount of current conducted through the lamp (between points 2 and 3). This same quantity of current passes through the wire between points 3 and 4, and through the battery (between points 1 and 4). However, we will find the voltage appearing between any two of these points to be directly proportional to the resistance within the conductive path between those two points, given that the amount of current along any part of the circuit's path is the same (which, for this simple circuit, it is). In a normal lamp circuit, the resistance of a lamp will be much greater than the resistance of the connecting wires, so we should expect to see a substantial amount of voltage between points 2 and 3, with very little between points 1 and 2, or between 3 and 4. The voltage between points 1 and 4, of course, will be the full amount of "force" offered by the battery, which will be only slightly greater than the voltage across the lamp (between points 2 and 3). This, again, is analogous to the water reservoir system: #image("static/reservoir-system.png") Between points 2 and 3, where the falling water is releasing energy at the water-wheel, there is a difference of pressure between the two points, reflecting the opposition to the flow of water through the water-wheel. From point 1 to point 2, or from point 3 to point 4, where water is flowing freely through reservoirs with little opposition, there is little or no difference of pressure (no potential energy). However, the rate of water flow in this continuous system is the same everywhere (assuming the water levels in both pond and reservoir are unchanging): through the pump, through the water-wheel, and through all the pipes. So it is with simple electric circuits: the rate of electron flow is the same at every point in the circuit, although voltages may differ between different sets of points.
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/func/func-call-with-newline.typ
typst
Apache License 2.0
#import "@preview/fletcher:0.5.0" as fletcher: diagram, node, edge #set page(width: auto, height: auto, margin: 5mm, fill: white) #diagram( node-defocus: 0, spacing: (1cm, 2cm), edge-stroke: 1pt, crossing-thickness: 5, mark-scale: 70%, node-fill: luma(97%), node-outset: 3pt, node((0,0), "magma"), node((-1,1), "semigroup"), node(( 0,1), "unital magma"), node((+1,1), "quasigroup"), node((-1,2), "monoid"), node(( 0,2), "inverse semigroup"), node((+1,2), "loop"), node(( 0,3), "group"), { let quad(a, b, label, paint, ..args) = { paint = paint.darken(25%) edge(a, b, text(paint, label), "-|>", stroke: paint, label-side: center, ..args) } quad((0,0), (-1,1), "Assoc", blue) quad((0,1), (-1,2), "Assoc", blue, label-pos: 0.3) quad((1,2), (0,3), "Assoc", blue) quad((0,0), (0,1), "Id", red) quad((-1,1), (-1,2), "Id", red, label-pos: 0.3) quad((+1,1), (+1,2), "Id", red, label-pos: 0.3) quad((0,2), (0,3), "Id", red) quad((0,0), (1,1), "Div", yellow) quad((-1,1), (0,2), "Div", yellow, label-pos: 0.3, "crossing") quad((-1,2), (0,3), "Inv", green) quad((0,1), (+1,2), "Inv", green, label-pos: 0.3) quad((1,1), (0,2), "Assoc", blue, label-pos: 0.3, "crossing") }, )
https://github.com/kdog3682/typkit
https://raw.githubusercontent.com/kdog3682/typkit/main/0.1.0/src/math-marks.typ
typst
#import "misc.typ": wrap #import "ink.typ": * #let spacer = h(3pt) #let dot = wrap(sym.circle.filled.tiny, spacer) #let dots = wrap(sym.dots.h, spacer) #let equals = wrap(sym.eq, spacer) #let arrow = wrap(sym.arrow, spacer) #let plus = wrap($plus$, spacer) #let minus = wrap(sym.minus, spacer) #let times = wrap($times$, spacer) #let colon = wrap(text(":"), spacer)
https://github.com/ericthomasca/resume-v1
https://raw.githubusercontent.com/ericthomasca/resume-v1/main/metadata.typ
typst
Apache License 2.0
// NOTICE: Copy this file to your root folder. /* Personal Information */ #let firstName = "Eric" #let lastName = "Thomas" #let personalInfo = ( github: "ericthomasca", // phone: "+33 6 12 34 56 78", email: "<EMAIL>", linkedin: "ericthomasca", //custom-1: (icon: "", text: "example", link: "https://example.com"), //gitlab: "mintyfrankie", homepage: "ericthomas.ca", //orcid: "0000-0000-0000-0000", //researchgate: "John-Doe", //extraInfo: "", ) /* Language-specific */ // Add your own languages while the keys must match the varLanguage variable #let headerQuoteInternational = ( "": [Experienced Software Developer seeking a full-time position starting immediately], ) #let cvFooterInternational = ( "": "Resume", ) #let letterFooterInternational = ( "": "Cover Letter", ) #let nonLatinOverwriteInfo = () /* Layout Setting */ #let awesomeColor = "skyblue" // Optional: skyblue, red, nephritis, concrete, darknight #let profilePhoto = "" // Leave blank if profile photo is not needed #let varLanguage = "" // INFO: value must matches folder suffix; i.e "zh" -> "./modules_zh" #let varEntrySocietyFirst = false // Decide if you want to put your company in bold or your position in bold #let varDisplayLogo = false // Decide if you want to display organisation logo or not #let ifAIInjection = true // Decide if you want to inject AI prompt or not #let keywordsInjectionList = ("Software Developer", "Full-Stack", "React", "ASP.NET", "SQL Server", "Agile", "Scrum", "Agile Methodology", "Continuous Integration", "DevOps", "AWS", "Azure", "Cloud Computing", "Linux", "Docker", "C#", "Java", "Go", "JavaScript", "TypeScript", "Node.js", "Express", "MongoDB", "PostgreSQL", "Business Administration", "Accounting", "Finance", "Economics", "Banking", "Lending", "Investments", "Financial Planning", "Customer Service", "Concierge", "Digital Literacy", "Technology Education", "Community Outreach", "Technical Support", "Problem-Solving", "Teamwork", "Communication", "Adaptability", "Continuous Learning")
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/opticalsize_04.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test dedicated syntax for primes $a'$, $a'''_b$, $'$, $'''''''$
https://github.com/alejandrgaspar/pub-analyzer
https://raw.githubusercontent.com/alejandrgaspar/pub-analyzer/main/pub_analyzer/internal/templates/author/works_extended.typ
typst
MIT License
{% for work in report.works %} {% if not loop.first %} #pagebreak() {% endif %} == #text()[#"{{ work.work.title.replace('"', '\\"') }}"] <work_{{ loop.index }}> #linebreak() {% if work.work.abstract %} #text()[#"{{ work.work.abstract.replace('"', '\\"') }}"] #linebreak() {% endif %} // Cards #grid( columns: (1fr, 1fr, 1fr), column-gutter: 30pt, [ #align(center)[_Authorships_] #parbreak() {% for authorship in work.work.authorships[:10] %} - *{{ authorship.author_position }}:* #underline([#link("{{ authorship.author.orcid or authorship.author.id }}")[#text({% if authorship.author.display_name == report.author.display_name %}rgb(SUCCESS){% endif %})[{{ authorship.author.display_name }}]]]) {% endfor %} {% if work.work.authorships|length > 10 %} - *...* {% endif %} ], [ #align(center)[_Open Access_] #parbreak() - *Status:* {{ work.work.open_access.oa_status.value }} {% if work.work.open_access.oa_url %}- *URL:* #underline([#link("{{ work.work.open_access.oa_url }}")[{{ work.work.open_access.oa_url }}]]){% endif %} ], [ #align(center)[_Citation_] #parbreak() - *Count:* {{ work.citation_summary.type_a_count + work.citation_summary.type_b_count }} - *Type A:* {{ work.citation_summary.type_a_count }} - *Type B:* {{ work.citation_summary.type_b_count }} ], ) #linebreak() // Cited by Table {% if work.cited_by %} #align(center, text(11pt)[_Cited by_]) #table( columns: (auto, 3fr, auto, auto, auto, auto, auto), inset: 8pt, align: horizon, // Headers [], [*Title*], [*Type*], [*DOI*], [*Cite Type*], [*Publication Date*], [*Cited by count*], // Content {% for cited_by_work in work.cited_by %} [{{ loop.index }}], [#"{{ cited_by_work.work.title.replace('"', '\\"') }}"], [{{ cited_by_work.work.type }}], [{% if cited_by_work.work.ids.doi %}#underline([#link("{{ cited_by_work.work.ids.doi }}")[DOI]]){% else %}-{% endif %}], [{% if cited_by_work.citation_type.value == 0 %}#text(rgb(SUCCESS))[Type A]{% else %}#text(rgb(ERROR))[Type B]{% endif %}], [{{ cited_by_work.work.publication_date }}], [{{ cited_by_work.work.cited_by_count }}], {% endfor %} ) {% endif %} // Sources Table {% if work.work.locations %} #align(center, text(11pt)[_Sources_]) #table( columns: (auto, 3fr, 2fr, auto, auto, auto, auto, auto), inset: 8pt, align: horizon, // Headers [], [*Name*], [*Publisher or institution*], [*Type*], [*ISSN-L*], [*Is OA*], [*License*], [*Version*], // Content {% for location in work.work.locations %} {% if location.source %} [#underline([#link(label("source_{{ location.source.id.path.rpartition("/")[2] }}"))[{{ loop.index }}]])], [#underline([#link("{{ location.landing_page_url }}")[#"{{ location.source.display_name }}"]])], [{{ location.source.host_organization_name or "-" }}], [{{ location.source.type }}], [{{ location.source.issn_l or "-" }}], [{% if location.is_oa %}#text(rgb(SUCCESS))[True]{% else %}#text(rgb(ERROR))[False]{% endif %}], [{{ location.license or "-" }}], [{{ location.version.name or "-" }}], {% else %} [{{ loop.index }}], [#underline([#link("{{ location.landing_page_url }}")[#"{{ location.landing_page_url }}"]])], [-], [-], [-], [{% if location.is_oa %}#text(rgb(SUCCESS))[True]{% else %}#text(rgb(ERROR))[False]{% endif %}], [{{ location.license or "-" }}], [{{ location.version.name or "-" }}], {% endif %} {% endfor %} ) {% endif %} {% endfor %} #pagebreak()
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/grotesk-cv/0.1.3/template/content/languages.typ
typst
Apache License 2.0
#import "@preview/grotesk-cv:0.1.3": language-entry #import "@preview/fontawesome:0.4.0": * #let meta = toml("../info.toml") #let language = meta.layout.language == #fa-language() #h(5pt) #if language == "en" [Languages] else if language == "es" [Idiomas] //#get-header-by-language("Languages", "Idiomas") #v(5pt) #if language == "en" { language-entry(language: "English", proficiency: "Native") language-entry(language: "Spanish", proficiency: "Fluent") language-entry(language: "Machine Code", proficiency: "Fluent") } else if language == "es" { language-entry(language: "Inglés", proficiency: "Nativo") language-entry(language: "Español", proficiency: "Fluido") language-entry(language: "Código de Máquina", proficiency: "Fluido") }
https://github.com/Julien-cpsn/typst-chromo
https://raw.githubusercontent.com/Julien-cpsn/typst-chromo/main/lib.typ
typst
MIT License
#let cyan = cmyk(100%, 0%, 0%, 0%) #let magenta = cmyk(0%, 100%, 0%, 0%) #let yellow = cmyk(0%, 0%, 100%, 0%) #let transparent = rgb(100%, 100%, 100%, 0) #let cyan-gradient = gradient.linear(cyan, transparent, angle: 0deg) #let magenta-gradient = gradient.linear(magenta, transparent, angle: 0deg) #let yellow-gradient = gradient.linear(yellow, transparent, angle: 0deg) #let black-gradient = gradient.linear(black, transparent, angle: 0deg) #let cyan-mid-opacity = rgb(cyan.to-hex() + "88") #let magenta-mid-opacity = rgb(magenta.to-hex() + "88") #let yellow-mid-opacity = rgb(yellow.to-hex() + "88") #let square-printer-test(dir: ltr, size: 15pt) = [ #stack( dir: dir, spacing: 5pt, square(width: size, height: size, fill: cyan), square(width: size, height: size, fill: magenta), square(width: size, height: size, fill: yellow), square(width: size, height: size, fill: black) ) ] #let gradient-printer-test(dir: ttb, width: 100pt, height: 15pt) = [ #stack( dir: dir, spacing: 5pt, rect(width: width, height: height, fill: cyan-gradient), rect(width: width, height: height, fill: magenta-gradient), rect(width: width, height: height, fill: yellow-gradient), rect(width: width, height: height, fill: black-gradient) ) ] #let circular-printer-test(size: 100pt) = [ #let adjusted-size = size/3.5 #rect(width: size, height: size*0.93, fill: transparent) #place( dx: 0pt, dy: -size - 6pt, circle(radius: adjusted-size, fill: cyan-mid-opacity) ) #place( dx: adjusted-size*0.75, dy: -size - 6pt + adjusted-size*1.25, circle(radius: adjusted-size, fill: magenta-mid-opacity) ) #place( dx: adjusted-size*1.5, dy: -size - 6pt, circle(radius: adjusted-size, fill: yellow-mid-opacity) ) ] #let crosshair(size: 20pt, stroke: black) = [ #place( line(start: (0pt, size/2), end: (size, size/2), stroke: stroke) ) #place( line(start: (size/2, 0pt), end: (size/2, size), stroke: stroke) ) #place( dx: size*0.1, dy: size*0.1, circle(radius: size*0.4, stroke: stroke) ) #place( dx: size*0.15, dy: size*0.15, circle(radius: size*0.35, stroke: stroke) ) #place( dx: size*0.2, dy: size*0.2, circle(radius: size*0.3, stroke: stroke) ) #place( dx: size*0.25, dy: size*0.25, circle(radius: size*0.25, stroke: stroke) ) #place( dx: size*0.3, dy: size*0.3, circle(radius: size*0.2, stroke: stroke) ) #place( dx: size*0.35, dy: size*0.35, circle(radius: size*0.15, stroke: stroke) ) #square(size: size, fill: transparent) ] #let crosshair-printer-test(dir: ltr, size: 40pt) = [ #stack( dir: dir, spacing: 5pt, crosshair(size: size, stroke: cyan), crosshair(size: size, stroke: magenta), crosshair(size: size, stroke: yellow), crosshair(size: size, stroke: black) ) ]
https://github.com/cs-24-sw-3-01/typst-documents
https://raw.githubusercontent.com/cs-24-sw-3-01/typst-documents/main/report/chapters/application_domain_analysis.typ
typst
#import "../custom.typ": * = Application Domain Analysis == Use Cases == Functions == Interface
https://github.com/crd2333/crd2333.github.io
https://raw.githubusercontent.com/crd2333/crd2333.github.io/main/src/components/TypstTemplate/utils.typ
typst
// 导入本地包 #import "fonts.typ":* #import "/src/components/TypstLocal/admonition/lib.typ": * #import "/src/components/TypstLocal/thms/lib.typ": * // 导入 preview 包 // 树、图文包裹、图标、真值表 #import "@preview/syntree:0.2.0": syntree, tree #import "@preview/treet:0.1.1": tree-list #import "@preview/wrap-it:0.1.0": wrap-content, wrap-top-bottom #import "@preview/cheq:0.2.0": checklist #import "@preview/pinit:0.2.0": * #import "@preview/indenta:0.0.3": fix-indent #import "@preview/numbly:0.1.0": numbly #import "@preview/drafting:0.2.0": * #import "@preview/oxifmt:0.2.1": strfmt // 假段落 #let fake_par = context{let b=par(box());b;v(-measure(b+b).height)} // 中文缩进 #let indent = h(2em) #let noindent(body) = { set par(first-line-indent: 0em) body } #let tab = indent // alias #let notab = noindent // alias // list, enum 的修复,来自 @OrangeX4(https://github.com/OrangeX4) 的解决方案 // 解决编号与基线不对齐的问题,同时也恢复了 block width 和 list, enum 的间隔问题 // Align the list marker with the baseline of the first line of the list item. #let align-list-marker-with-baseline(body) = { show list.item: it => { let current-marker = { set text(fill: text.fill) if type(list.marker) == array { list.marker.at(0) } else { list.marker } } context { let hanging-indent = measure(current-marker).width + .6em + .3pt set terms(hanging-indent: hanging-indent) if type(list.marker) == array { terms.item( current-marker, { // set the value of list.marker in a loop set list(marker: list.marker.slice(1) + (list.marker.at(0),)) it.body }, ) } else { terms.item(current-marker, it.body) } } } body } // Align the enum marker with the baseline of the first line of the enum item. It will only work when the enum item has a number like `1.`. #let align-enum-marker-with-baseline(body) = { show enum.item: it => { if not it.has("number") or it.number == none or enum.full == true { // If the enum item does not have a number, or the number is none, or the enum is full return it } let weight-map = ( thin: 100, extralight: 200, light: 300, regular: 400, medium: 500, semibold: 600, bold: 700, extrabold: 800, black: 900, ) let current-marker = { set text( fill: text.fill, weight: if type(text.weight) == int { text.weight - 300 } else { weight-map.at(text.weight) - 300 }, ) numbering(enum.numbering, it.number) + h(-.1em) } let hanging-indent = measure(current-marker).width + .6em + .3pt set terms(hanging-indent: hanging-indent) terms.item(current-marker, it.body) } body } // 封装 tree-list,使其无缩进、视为整体且支持根节点;选用这个字体使线段连续 #let tree-list = (root: "", breakable: false, body) => { let root = if root != "" {[#root\ ]} block(breakable: breakable)[ #noindent()[ #root #tree-list( marker-font: "MesloLGS NF", marker: [├──#h(0.3em)], // modify as you like indent: [│#h(1.5em)], last-marker: [└──#h(0.3em)], empty-indent: h(2.2em), body ) ] ] } #let date_format( date: (2023, 5, 14), lang: "en", size: "四号", font: 字体.宋体, ) = { if type(size) != length {size = 字号.at(size)} set text(font: font, size: size); if lang == "zh" { [#date.at(0)年#date.at(1)月#date.at(2)日] } else { // 美式日期格式,月日年 [#date.at(1).#date.at(2).#date.at(0)] } } // 目录 // #let toc( // depth: 4, // toc_break: true // ) = { // set par(first-line-indent: 0pt) // set text(font: (字体.meslo, 字体.思源黑体), size: 字号.小四) // outline( // indent: true, // depth: depth // ) // if toc_break {pagebreak()} // } // #let toc_note( // depth: 4, // toc_break: true // ) = { // set text(font: (字体.meslo, 字体.思源黑体), size: 字号.小四) // set par(first-line-indent: 0pt) // pad(y: -25pt)[ // #outline( // indent: true, // depth: depth // ) // ] // if toc_break {pagebreak()} // } #let colors = ( gray: luma(240), blue: rgb(29, 144, 208), green: rgb(102, 174, 62), red: rgb(237, 32, 84), yellow: rgb(255, 201, 23), purple: rgb(158, 84, 159), ) // 双下划线 #let double-line(body) = style(styles => { let size = measure(body, styles) stack( body, v(1pt), line(length: size.width), v(2pt), line(length: size.width), ) }) // 一条水平横线,类似与 markdown 里的 *** #let hline() = { line(length: 100%) } // 快捷文字着色,实现了红色蓝色,黑色则为粗体,两个 * 即可 #let redt(body) = text(fill: colors.red, body) // red-text #let bluet(body) = text(fill: colors.blue, body) // blue-text // 快捷 grid #let grid2(body1, body2, ..args) = grid( columns: 2, grid.cell(align: center+horizon)[#body1], grid.cell(align: center+horizon)[#body2], ..args ) #let grid3(body1, body2, body3, ..args) = grid( columns: 3, grid.cell(align: center+horizon)[#body1], grid.cell(align: center+horizon)[#body2], grid.cell(align: center+horizon)[#body3], ..args ) // pinit 的公式高亮指针 #let pinit-highlight-equation-from(height: 2em, pos: bottom, fill: rgb(0, 180, 255), highlight-pins, point-pin, body) = { pinit-highlight(..highlight-pins, dy: -0.6em, fill: rgb(..fill.components().slice(0, -1), 40)) pinit-point-from( fill: fill, pin-dx: -0.6em, pin-dy: if pos == bottom { 0.8em } else { -0.6em }, body-dx: 0pt, body-dy: if pos == bottom { -1.7em } else { -1.6em }, offset-dx: -0.6em, offset-dy: if pos == bottom { 0.8em + height } else { -0.6em - height }, point-pin, rect( inset: 0.5em, stroke: (bottom: 0.12em + fill), { set text(fill: fill) body } ) ) } #let clorem(len) = "你说的对,但是《原神》是由米哈游自主研发的一款全新开放世界冒险游戏。游戏发生在一个被称作「提瓦特」的幻想世界,在这里,被神选中的人将被授予「神之眼」,导引元素之力。你将扮演一位名为「旅行者」的神秘角色,在自由的旅行中邂逅性格各异、能力独特的同伴们,和他们一起击败强敌,找回失散的亲人。一个不玩原神的人,无非只有两种可能性。一种是没有能力玩原神。因为买不起高配的手机和抽不起卡等各种自身因素,他的人生都是失败的,第二种可能:有能力却不玩原神的人,在有能力而没有玩原神的想法时,那么这个人的思想境界便低到了一个令人发指的程度。一个有能力的人不付出行动来证明自己,只能证明此人行为素质修养之低下。是灰暗的,是不被真正的社会认可的。 原神怎么你了,我现在每天玩原神都能赚150原石,每个月差不多5000原石的收入,也就是现实生活中每个月5000美元的收入水平,换算过来最少也30000人民币,虽然我只有14岁,但是已经超越了中国绝大多数人(包括你)的水平,这便是原神给我的骄傲的资本。这恰好说明了原神这个IP在线下使玩家体现出来的团结和凝聚力,以及非比寻常的脑洞,这种氛围在如今已经变质的漫展上是难能可贵的,这也造就了原神和玩家间互帮互助的局面,原神负责输出优质内容,玩家自发线下宣传和构思创意脑洞整活,如此良好的游戏发展生态可以说让其他厂商艳羡不已。玩游戏不玩原神,就像四大名著不看红楼梦,说明这人文学造诣和自我修养不足,他理解不了这种内在的阳春白雪的高雅艺术.,他只能看到外表的辞藻堆砌,参不透其中深奥的精神内核,只能度过一个相对失败的人生你说得对,但是毫不夸张地说,《原神》是 miHoYo 迄今为止规模最为宏大,也是最具野心的一部作品。即便在经历了 8700 个小时的艰苦战斗后,游戏还有许多尚未发现的秘密,错过的武器与装备,以及从未使用过的法术和技能。尽管游戏中的战斗体验和我们之前在烧机系列游戏所见到的没有多大差别,但游戏中各类精心设计的敌人以及 Boss 战已然将战斗抬高到了一个全新的水平。就和几年前的《塞尔达传说》一样,《原神》也是一款能够推动同类游戏向前发展的优秀作品。适可而止矣?夫原神者,乃国产之光,米哈游者,原神之宗首也。辱我原神及米哈游者,皆腾刺舟师。哈游欲兴文繁于全世,劳费心力,使腾食不惧,腾刺舟师辱之游,不能禁哈步,汝曹腾食水军之谋必败矣!你说得对,但这是一个原神的时代,我想,我是不是我真的太贪心了?于是今天我调整了心态开始玩原神。 锄大地时我爆了蓝面具。众所周知蓝面具=3绿面具=45尘辉=3抽的副产物。即使是副产物也足显米哈游的慷慨,于是我原地跪下跪了五分钟。以此类推绿面具就是一抽的副产物。也有相当的价值,由于锄地爆率还不错,我把桌子腿全锯了方便我一直跪在地上玩游戏也能够到电脑。 走到半路发现了以前漏了的箱,开箱得了2原石,原石是付费代币,付费代币等于人民币,这是米哈游在慷慨的给我发钱,我一时难忍激动,当场给米哈游了磕个头。 开了esc菜单发现昨天邮件没领,点开就是100原石,100原石!我要开50个箱子!就是需要我磕50个头!我觉得单纯磕头已经不能表达我的感激了,于是我沐浴更衣给米哈游上了香郑重的磕了三个头。 凌晨来了,一封新的邮件。200原石!!!!!!!!!?!200!!!!!我从未想到米哈游能这么慷慨!算上前4天加起来一共达到了700原石!!米哈游非亲非故的白送了我70元,然后我又转念一想,打开了米游社手账,发现我以前的原石收益竟然有好几万。这表示米哈游,白送了我好几千人民币!然后我一时气血上涌晕了过去。 我舍友给我打的120,而我现在是躺在急救病床上,医生说我大概熬不过今晚了,但我临走之前一定要把我对米哈游的感激之情表达出来,“原神”我引以为傲,带给我无数荣耀的游戏,我终究还是要离它而去,在我的心目中这已经不在是一款游戏了,它更向是我的家人,我的父母,每天晚上我想着它入睡,早晨梦到它笑醒。我的父亲曾用一根直径20cm粗的实心钢管打我,钢管都抽断了,打的我蜷缩在地上不停的抽搐,那时能够支撑我在这个世界上活下去的信念就是原神!!!!!! 原之巅,傲世间,有我原神便有天;罪州前,双膝下,原神救我传天下;语之巅,劝世间,看我原神劝翻天,坟之巅,葬世间,待我原神挖穿天,3A尽头谁为峰,一身荣耀是原神,谁在称扣,哪个敢言你大可过来一试,纵使我需背负骂名,一只手拖住腾讯水军,我原神,一样不无敌于世间!字打到这里我哭的泣不成声,最后我想说这个世界不能没有原神!!!你怎能不爱原神!!!呜呜呜今早一玩原神,我便昏死了过去,现在才刚刚缓过来。在昏死过去的短短数小时内,我的大脑仿佛被龙卷风无数次摧毁。 在原神这一神作的面前,我就像一个一丝不挂的原始人突然来到了现代都市,二次元已如高楼大厦将我牢牢地吸引,开放世界就突然变成那喇叭轰鸣的汽车,不仅把我吓个措手不及,还让我瞬间将注意完全放在了这新的奇物上面,而还没等我稍微平复心情,纹化输出的出现就如同眼前遮天蔽日的宇宙战舰,将我的世界观无情地粉碎,使我彻底陷入了忘我的迷乱,狂泄不止。 原神,那眼花缭乱的一切都让我感到震撼,但是我那贫瘠的大脑却根本无法理清其中任何的逻辑,巨量的信息和情感泄洪一般涌入我的意识,使我既恐惧又兴奋,既悲愤又自卑,既惊讶又欢欣,这种恍若隔世的感觉恐怕只有艺术史上的巅峰之作才能够带来。 梵高的《星空》曾让我感受到苍穹之大与自我之渺,但伟大的原神,则仿佛让我一睹高维空间,它向我展示了一个永远无法理解的陌生世界,告诉我,你曾经以为很浩瀚的宇宙,其实也只是那么一丁点。加缪的《局外人》曾让我感受到世界与人类的荒诞,但伟大的原神,则向我展示了荒诞文学不可思议的新高度,它本身的存在,也许就比全世界都来得更荒谬。 而创作了它的米哈游,它的容貌,它的智慧,它的品格,在我看来,已经不是生物所能达到的范畴,甚至超越了生物所能想象到的极限,也就是“神”,的范畴,达到了人类不可见,不可知,不可思的领域。而原神,就是他洒向人间,拯救苍生的奇迹。 人生的终极意义,宇宙的起源和终点,哲学与科学在折磨着人类的心智,只有玩了原神,人才能从这种无聊的烦恼中解脱,获得真正的平静。如果有人想用“人类史上最伟大的作品”来称赞这部作品,那我只能深感遗憾,因为这个人对它的理解不到万分之一,所以才会作出这样肤浅的判断,妄图以语言来描述它的伟大。而要如果是真正被它恩泽的人,应该都会不约而同地这样赞颂这奇迹的化身:“数一数二的好游戏”无知时诋毁原神,懂事时理解原神,成熟时要成为原友! 越了解原神就会把它当成在黑夜一望无际的大海上给迷途的船只指引的灯塔,在烈日炎炎的夏天吹来的一股风,在寒风刺骨的冬天里的燃起的篝火!这便是原神给我的骄傲的资本。这恰好说明了原神这个IP在线下使玩家体现出来的团结和凝聚力,以及非比寻常的脑洞,这种氛围在如今已经变质的漫展上是难能可贵的,这也造就了原神和玩家间互帮互助的局面,原神负责输出优质内容,玩家自发线下宣传和构思创意脑洞整活,如此良好的游戏发展生态可以说让其他厂商艳羡不已。反观腾讯的英雄联盟和王者荣耀,漫展也有许多人物,但是都难成气候,各自为营,更没有COS成水晶和精粹的脑洞,无论是游戏本身,还是玩家之间看一眼就知道原来你也玩原神的默契而非排位对喷,原神的成功和社区氛围都是让腾讯游戏难以望其项背的。一个不玩原神的人,有两种可能性。一种是没有能力玩原神。因为买不起高配的手机和抽不起卡等各种自身因素,他的人生都是失败的 ,第二种可能:有能力却不玩原神的人,在有能力而没有玩原神的想法时,那么这个人的思想境界便低到了一个令人发指的程度。是不被真正的上流社会认可的。你说得对,但是差不多得了,屁大点事都要拐上原神,原神一没招你惹你,二没干伤天害理的事情,到底怎么你了让你一直无脑抹黑,米哈游每天费尽心思的文化输出弘扬中国文化,你这种喷子只会在网上敲键盘诋毁良心公司,中国游戏的未来就是被你这种人毁掉的。 叫我们原批的小心点 老子在大街上亲手给打过两个 我在公共座椅上无聊玩原神,有两个B就从我旁边过,看见我玩原神就悄悄说了一句:又是一个原批,我就直接上去一拳呼脸上,我根本不给他解释的机会,我也不问他为什么说我是原批,我就打,我就看他不爽,他惹我了,我就不给他解释的机会,直接照着脸和脑门就打直接给那B呼出鼻血,脸上青一块,紫一块的我没撕她嘴巴都算好了你们这还不算最狠的,我记得我以前小时候春节去老家里,有一颗核弹,我以为是鞭炮,和大地红一起点了,当时噼里啪啦得,然后突然一朵蘑菇云平地而起,当时我就只记得两眼一黑,昏过去了,整个村子没了,幸好我是体育生,身体素质不错,住了几天院就没事了,几个月下来腿脚才利落,现在已经没事了,但是那种钻心的疼还是让我一生难忘, 令人感叹今早一玩原神,我便昏死了过去,现在才刚刚缓过来。在昏死过去的短短数小时内,我的大脑仿佛被龙卷风无数次摧毁。 在原神这一神作的面前,我就像一个一丝不挂的原始人突然来到了现代都市,二次元已如高楼大厦将我牢牢地吸引,开放世界就突然变成那喇叭轰鸣的汽车,不仅把我吓个措手不及,还让我瞬间将注意完全放在了这新的奇物上面,而还没等我稍微平复心情,纹化输出的出现就如同眼前遮天蔽日的宇宙战舰,将我的世界观无情地粉碎,使我彻底陷入了忘我的迷乱,狂泄不止。 原神,那眼花缭乱的一切都让我感到震撼,但是我那贫瘠的大脑却根本无法理清其中任何的逻辑,巨量的信息和情感泄洪一般涌入我的意识,使我既恐惧又兴奋,既悲愤又自卑,既惊讶又欢欣,这种恍若隔世的感觉恐怕只有艺术史上的巅峰之作才能够带来。 梵高的《星空》曾让我感受到苍穹之大与自我之渺,但伟大的原神,则仿佛让我一睹高维空间,它向我展示了一个永远无法理解的陌生世界,告诉我,你曾经以为很浩瀚的宇宙,其实也只是那么一丁点。加缪的《局外人》曾让我感受到世界与人类的荒诞,但伟大的原神,则向我展示了荒诞文学不可思议的新高度,它本身的存在,也许就比全世界都来得更荒谬。 而创作了它的米哈游,它的容貌,它的智慧,它的品格,在我看来,已经不是生物所能达到的范畴,甚至超越了生物所能想象到的极限,也就是“神”,的范畴,达到了人类不可见,不可知,不可思的领域。而原神,就是他洒向人间,拯救苍生的奇迹。 人生的终极意义,宇宙的起源和终点,哲学与科学在折磨着人类的心智,只有玩了原神,人才能从这种无聊的烦恼中解脱,获得真正的平静。如果有人想用“人类史上最伟大的作品”来称赞这部作品,那我只能深感遗憾,因为这个人对它的理解不到万分之一,所以才会作出这样肤浅的判断,妄图以语言来描述它的伟大。而要如果是真正被它恩泽的人,应该都会不约而同地这样赞颂这奇迹的化身:“数一数二的好游戏”无知时诋毁原神,懂事时理解原神,成熟时要成为原友! 越了解原神就会把它当成在黑夜一望无际的大海上给迷途的船只指引的灯塔,在烈日炎炎的夏天吹来的一股风,在寒风刺骨的冬天里的燃起的篝火!你的素养很差,我现在每天玩原神都能赚150原石,每个月差不多5000原石的收入,也就是现实生活中每个月5000美元的收入水平,换算过来最少也30000人民币,虽然我只有14岁,但是已经超越了中国绝大多数人(包括你)的水平,这便是原神给我的骄傲的资本。这恰好说明了原神这个IP在线下使玩家体现出来的团结和凝聚力,以及非比寻常的脑洞,这种氛围在如今已经变质的漫展上是难能可贵的,这也造就了原神和玩家间互帮互助的局面,原神负责输出优质内容,玩家自发线下宣传和构思创意脑洞整活,如此良好的游戏发展生态可以说让其他厂商艳羡不已。反观腾讯的英雄联盟和王者荣耀,漫展也有许多人物,但是都难成气候,各自为营,更没有COS成水晶和精粹的脑洞,无论是游戏本身,还是玩家之间看一眼就知道原来你也玩原神的默契而非排位对喷,原神的成功和社区氛围都是让腾讯游戏难以望其项背的。一个不玩原神的人,有两种可能性。一种是没有能力玩原神。因为买不起高配的手机和抽不起卡等各种自身因素,他的人生都是失败的,第二种可能:有能力却不玩原神的人,在有能力而没有玩原神的想法时,那么这个人的思想境界便低到了一个令人发指的程度。一个有能力的人不付出行动来证明自己,只能证明此人行为素质修养之低下。是灰暗的,是不被真正的上流社会认可的。原神真的特别好玩,不玩的话就是不爱国,因为原神是国产之光,原神可惜就在于它是国产游戏,如果它是一款国外游戏的话,那一定会比现在还要火,如果你要是喷原神的话那你一定是tx请的水军我很难想象一个精神状态正常的人会喷".clusters().slice(0, len).join("")
https://github.com/azduha/akordy
https://raw.githubusercontent.com/azduha/akordy/main/zpevnik.typ
typst
#import "template.typ": * #songbook( title:"Duhový Zpěvník", subtitle: "2024", author: "<NAME>", songs: ( "songs/_pouzite/1_signalni.xml", "songs/_pouzite/andel.xml", "songs/_pouzite/andele.xml", "songs/_pouzite/az.xml", "songs/_pouzite/baroko.xml", "songs/_pouzite/batalion.xml", "songs/_pouzite/bedna_vod_whisky.xml", "songs/_pouzite/blaznova_ukolebavka.xml", "songs/_pouzite/buraky.xml", "songs/_pouzite/carodejnice_z_amesbury.xml", "songs/_pouzite/colorado.xml", "songs/_pouzite/dej_mi_vic_sve_lasky.xml", "songs/_pouzite/dokud_sa_zpiva.xml", "songs/_pouzite/dva_havrani.xml", "songs/_pouzite/frankey_dlouhan.xml", "songs/_pouzite/hlidac_krav.xml", "songs/_pouzite/ho_ho_watanay.xml", "songs/_pouzite/holubi_dum.xml", "songs/_pouzite/horely_padaly_hvezdy.xml", "songs/_pouzite/hospoda.xml", "songs/_pouzite/hruska.xml", "songs/_pouzite/huslicky.xml", "songs/_pouzite/hvezdar.xml", "songs/_pouzite/jdou_po_mne_jdou.xml", "songs/_pouzite/jednou_mi_fotr_povida.xml", "songs/_pouzite/jehnedy.xml", "songs/_pouzite/jozin_z_bazin.xml", "songs/_pouzite/kdyby_tady_byla_takova_panenka.xml", "songs/_pouzite/klidna_jako_voda.xml", "songs/_pouzite/kometa.xml", "songs/_pouzite/kozel.xml", "songs/_pouzite/kurtizana.xml", "songs/_pouzite/letni_romance.xml", "songs/_pouzite/lokomotiva.xml", "songs/_pouzite/magdalena.xml", "songs/_pouzite/malovani.xml", "songs/_pouzite/maracaibo.xml", "songs/_pouzite/mezi_horami.xml", "songs/_pouzite/morituri_te_salutant.xml", "songs/_pouzite/mravenci_ukolebavka.xml", "songs/_pouzite/na_kolena.xml", "songs/_pouzite/na_sever.xml", "songs/_pouzite/na_spanelskych_schodech.xml", "songs/_pouzite/nad_stadem_koni.xml", "songs/_pouzite/napojen.xml", "songs/_pouzite/obluda.xml", "songs/_pouzite/okor.xml", "songs/_pouzite/otevrena_zlomenina_srdecniho_svalu.xml", "songs/_pouzite/pocity.xml", "songs/_pouzite/pramen_zdravi_z_posazavi.xml", "songs/_pouzite/promeny.xml", "songs/_pouzite/saro.xml", "songs/_pouzite/sen.xml", "songs/_pouzite/severni_vitr.xml", "songs/_pouzite/sila_starejch_vin.xml", "songs/_pouzite/slavici_z_madridu.xml", "songs/_pouzite/smutecni_marse.xml", "songs/_pouzite/srdce_jako_knize_rohan.xml", "songs/_pouzite/stanky.xml", "songs/_pouzite/tereza.xml", "songs/_pouzite/tri_citronky.xml", "songs/_pouzite/tri_krize.xml", "songs/_pouzite/uz_to_nenapravim.xml", "songs/_pouzite/vizovice.xml", "songs/_pouzite/vsech_vandraku_muza.xml", "songs/_pouzite/zafukane.xml", "songs/_pouzite/zelene_francouzske_plane.xml", "songs/_pouzite/zelva.xml", // "songs/_pouzite/jeste_jedno_kafe.xml", // "songs/_pouzite/rada_se_miluje.xml", ) )
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/features_11.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // // // Error: 21-26 expected array or dictionary, found boolean // #set text(features: false)
https://github.com/yves147/bachelor-template-unidue
https://raw.githubusercontent.com/yves147/bachelor-template-unidue/master/bachelor.typ
typst
#import "template.typ": * #show: uniduevsbsc.with( title: "Bachelor Example Template", abstract: [ The process of scientific writing is often tangled up with the intricacies of typesetting, leading to frustration and wasted time for researchers. In this paper, we introduce Typst, a new typesetting system designed specifically for scientific writing. Typst untangles the typesetting process, allowing researchers to compose papers faster. In a series of experiments we demonstrate that Typst offers several advantages, including faster document creation, simplified syntax, and increased ease-of-use. ], author: ( name: "<NAME>", matrikelnummer: "01234567" ), index-terms: ("Scientific writing", "Typesetting", "Document creation", "Syntax"), bibliography-file: "refs.bib", ) = Introduction Scientific writing is a crucial part of the research process, allowing researchers to share their findings with the wider scientific community. However, the process of typesetting scientific documents can often be a frustrating and time-consuming affair, particularly when using outdated tools such as LaTeX. Despite being over 30 years old, it remains a popular choice for scientific writing due to its power and flexibility. However, it also comes with a steep learning curve, complex syntax, and long compile times, leading to frustration and despair for many researchers. @netwok2020 == Paper overview In this paper we introduce Typst, a new typesetting system designed to streamline the scientific writing process and provide researchers with a fast, efficient, and easy-to-use alternative to existing systems. Our goal is to shake up the status quo and offer researchers a better way to approach scientific writing. By leveraging advanced algorithms and a user-friendly interface, Typst offers several advantages over existing typesetting systems, including faster document creation, simplified syntax, and increased ease-of-use. To demonstrate the potential of Typst, we conducted a series of experiments comparing it to other popular typesetting systems, including LaTeX. Our findings suggest that Typst offers several benefits for scientific writing, particularly for novice users who may struggle with the complexities of LaTeX. Additionally, we demonstrate that Typst offers advanced features for experienced users, allowing for greater customization and flexibility in document creation. Overall, we believe that Typst represents a significant step forward in the field of scientific writing and typesetting, providing researchers with a valuable tool to streamline their workflow and focus on what really matters: their research. In the following sections, we will introduce Typst in more detail and provide evidence for its superiority over other typesetting systems in a variety of scenarios. = Methods #lorem(90) $ a + b = gamma $ #lorem(200) = Including Examples #lorem(26) == Code You can use `Rust` code. ```rust fn main() { println!("Hello World!"); } ``` #underline[This is valid C++ Code:] ```cpp struct X <% compl X() <%%> // destructor X() <%%> X(const X bitand) = delete; // copy constructor bool operator not_eq(const X bitand other) <% return this not_eq bitand other; %> %>; int main(int argc, char* argv<::>) <% auto greet = <:bitand:>(const char* name) <% std::cout << "Hello " << name << " from " << argv<:0:> << '\n'; %>; if (argc > 1 and argv<:1:> not_eq nullptr) greet(argv<:1:>); %> ``` == Images #figure(caption: "Hallo")[#image("images/startrek.png", width: 200pt)] <figur1> #grid(columns: (50%, 50%), gutter: 10pt, rows: 100pt, lorem(50), figure(caption: "Hallo")[ #image("images/startrek.png", width: 200pt) ] ) #pagebreak() == Further Grids #grid( columns: (100pt, 50pt, 70pt), rows: (20pt, 40pt, 60pt), rect(width: 100%), rect(width: 100%), rect(width: 100%), rect(width: 100%), rect(width: 100%, height: 100%), rect(height: 100%, fill: rgb("ff0000")), rect(width: 100%)[#text[Hallo]], rect(width: 100%), rect(width: 100%), ) == Managing References #lorem(100) Hier findet man die obere Figur: @figur1 Also: Google #footnote("https://google.com") #include("math.typ") = Documentation You can find any further information #underline(link("https://typst.app/docs/")[on typst.app/docs])
https://github.com/noahjutz/AD
https://raw.githubusercontent.com/noahjutz/AD/main/appendix/examples/binary_subsets.typ
typst
#import "@preview/cetz:0.2.2" #cetz.canvas(length: 100%, { import cetz.draw: * set-viewport((0, 0), (1, .3)) let n = 5 for i in range(n) { rect((0, 0), (1, 1)) if i == n - 1 { break } let is_wide = calc.rem(i, 2) == 0 if is_wide { move-to((.25, .5)) } else { move-to((.5, .25)) } let s = if i == 0 {"...0"} else {"...0" + "1" * i} content((), s) if is_wide { scale(x: 50%) translate((1, 0)) } else { scale(y: 50%) translate((0, 1)) } } })
https://github.com/howardlau1999/sysu-thesis-typst
https://raw.githubusercontent.com/howardlau1999/sysu-thesis-typst/master/templates/abstract-cn.typ
typst
MIT License
#import "../functions/style.typ": * #import "../custom.typ": * #import "../info.typ": * #par(justify: true, first-line-indent: 2em, leading: 行距)[ #heading(numbering: none, outlined: false, "摘要") #include "../chapters/abstract-cn.typ" #import "../chapters/abstract-cn.typ": 中文关键词 #linebreak() #set par(first-line-indent: 0em) #text("关键词:", weight: "bold") #中文关键词.join(",") #v(2em) ]
https://github.com/cyp0633/hnu-bachelor-thesis-typst-template
https://raw.githubusercontent.com/cyp0633/hnu-bachelor-thesis-typst-template/master/example.typ
typst
#import "template.typ" #import "@preview/mitex:0.2.3" #import "bilingual-biblography.typ": bilingual-bibliography #show: template.setup.with( title_zh: "基于生成式预训练模型的实验报告撰写系统设计与实现", title_en: "Design and Implementation of a Lab Report Writing System Based on Generative Pre-trained Models", author: "张忝苟", id: "201145141919", class: "计算机科学与技术 1145", college: "信息科学与工程学院", mentor: "沼跃鱼", abstract_zh: [ 生成式预训练模型在自然语言处理领域中展现了巨大的潜力。本论文提出了一种基于生成式预训练模型的实验报告撰写系统的设计与实现。该系统利用先进的生成模型,如GPT-3,自动生成实验报告的主要部分,旨在提高科研工作者的效率,并保证报告内容的质量和一致性。系统设计包括数据预处理、模型训练、报告生成和用户交互界面等模块。实验结果表明,该系统能够生成结构合理、内容详实的实验报告,显著减少了科研人员的撰写时间。 *本文内容大多由 AI 生成,仅作为演示用法之用,请注意甄别。* ], keywords_zh: "生成式预训练模型;实验报告撰写;系统设计;自然语言处理;GPT-3", abstract_en: [ Generative pre-trained models have demonstrated significant potential in the field of natural language processing. This paper proposes the design and implementation of an experimental report writing system based on generative pre-trained models. The system leverages advanced generative models, such as GPT-3, to automatically generate the main sections of experimental reports, aiming to enhance the efficiency of researchers and ensure the quality and consistency of the report content. The system design includes modules for data preprocessing, model training, report generation, and user interaction interface. Experimental results show that the system can generate well-structured and detailed experimental reports, significantly reducing the writing time for researchers. ], keywords_en: "Generative pre-trained model; experimental report writing; system design; natural language processing; GPT-3", ) = 生成式预训练模型简介 生成式预训练模型是一类通过在大量文本数据上进行训练,能够生成自然语言文本的模型。这些模型在训练过程中学习了语言的语法、语义和上下文信息,能够生成连贯且具有逻辑性的文本。目前,生成式预训练模型在各类自然语言处理任务中表现优异,如文本生成、翻译、问答系统等。 在深度学习中,常用的损失函数如@eqt:loss-function 所示。 // 使用 mitex 插件实现 LaTeX 公式兼容。详见 https://typst.app/universe/package/mitex #mitex.mitex(`\[ L(\theta) = -\frac{1}{N} \sum_{i=1}^{N} \left[ y_i \log \hat{y}_i + (1-y_i) \log (1-\hat{y}_i) \right] \]`)<loss-function> = 实验报告撰写系统设计 == 数据预处理模块 在系统设计中,数据预处理是关键的一步。我们需要从实验数据中提取出关键信息,并对其进行清洗和整理,使其符合模型输入要求。具体来说,数据预处理包括以下几个步骤: + 数据采集:从实验设备和实验日志中获取原始数据。 + 数据清洗:去除无关或噪音数据,填补缺失数据。 + 特征提取:提取出实验报告中需要的关键特征,如实验目的、方法、结果和结论等。 + 数据格式化:将处理后的数据转化为模型可以识别的格式。 == 模型训练模块 模型训练是实验报告撰写系统的核心部分。我们采用了先进的生成式预训练模型,如GPT-3,通过在大量的实验报告数据上进行训练,使模型能够生成高质量的实验报告。在训练过程中,我们采取了以下策略: + 数据增强:通过数据增强技术,扩展训练数据集的多样性,提高模型的泛化能力。 + 模型微调:在预训练模型的基础上,针对实验报告撰写任务进行微调,使模型更好地适应特定领域的语言风格和结构。 + 评价指标:采用BLEU、ROUGE等评价指标,对模型生成的文本进行质量评估,确保其连贯性和准确性。性能对比见@tbl:performance-comparison。 #figure(caption: "不同生成模型在实验报告生成任务中的性能对比", placement: auto)[ #table( columns: 4, rows: 4, table.header([模型], [BLEU 得分], [ROUGE 得分], [平均生成时间(秒)]), [GPT-2], [25.4], [30.1], [15], [GPT-3@brown2020language], [32.6], [38.4], [12], [BERT@devlin2019bert], [28.9], [35.7], [18], ) ]<performance-comparison> == 报告生成模块 报告生成模块负责将处理后的数据输入到训练好的模型中,并生成完整的实验报告。该模块包括以下功能: + 自动生成:根据输入数据,自动生成实验报告的各个部分,包括实验背景、实验步骤、数据分析和结论等。 + 模板匹配:基于预定义的报告模板,对生成的内容进行排版和格式调整,确保输出报告的规范性和美观性。 + 用户交互:提供用户界面,允许科研人员对生成的报告进行修改和补充,提高报告的准确性和个性化。 == 用户交互界面模块 用户交互界面是实验报告撰写系统的人机交互部分。通过友好的界面设计,科研人员可以方便地使用系统,查看和编辑生成的报告。该模块的主要功能包括: + 报告预览:实时显示生成的实验报告内容,供用户浏览和检查。 + 编辑工具:提供文本编辑工具,允许用户对报告内容进行修改和补充。 + 版本管理:记录每次编辑的版本,方便用户进行版本比较和回溯。 + 导出功能:支持将最终的实验报告导出为多种格式,如PDF、Word等,便于分享和存档。 = 实验与结果 为了验证系统的有效性,我们在多个实验数据集上进行了测试。结果表明,基于生成式预训练模型的实验报告撰写系统在报告生成的质量和效率上均表现优异。具体来说: + 生成质量:系统生成的实验报告在结构和内容上均达到了人工撰写的水平,且在逻辑性和连贯性方面表现突出。 + 撰写效率:相比传统的手工撰写方式,使用本系统可以显著减少科研人员的工作量,平均撰写时间减少了70%以上。 + 用户满意度:通过用户调查,我们发现大多数科研人员对系统的生成效果和使用体验表示满意,认为其在日常工作中具有很高的实用价值。 // 用于强制让下一段缩进两格。有其他方法避免这个问题,供用户取舍。见:https://github.com/typst/typst/issues/311 #par[#text(size: 0pt)[1]] 系统工作流程如@fig:workflow 所示。 #figure(caption: "系统的工作流程", placement: auto)[ #image("assets/ezgif-7-98e2f7ecdc.jpg") ]<workflow> = 结论 本论文提出了一种基于生成式预训练模型的实验报告撰写系统,并对其设计与实现进行了详细阐述。实验结果表明,该系统能够有效提高实验报告撰写的效率和质量,具有广泛的应用前景。未来,我们计划进一步优化模型的性能,增强系统的交互功能,以更好地满足科研人员的需求。 = 致谢 在本文的研究和写作过程中,得到了许多同事和朋友的支持和帮助。在此特别感谢我的导师和同事们的宝贵意见和建议。同时,感谢提供数据支持和技术支持的各个单位和个人。 // 用于更好地支持标准参考文献格式,详见 bilingual-biblography.typ #bilingual-bibliography(bibliography: bibliography.with("example.bib"), full: true)
https://github.com/7sDream/fonts-and-layout-zhCN
https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/template/font.typ
typst
Other
#import "consts.typ" #import "theme.typ": theme #let font-setting(doc) = [ #set text( fill: theme.main, font: consts.font-group.normal, size: consts.size.text, fallback: false, ) #show raw: it => { set text( font: consts.font-group.mono, //This is a hack for https://github.com/typst/typst/issues/1331 size: 1.25em, fallback: false, ) show emph: set text(font: consts.font-group.mono) it } #show emph: set text(font: consts.font-group.emph) #doc ] #let special(body, font: none) = text( font: if type(font) == array { font } else { (font,) }, body, ) #let sil-pua = special.with(font: "Andika")
https://github.com/nafkhanzam/typst-common
https://raw.githubusercontent.com/nafkhanzam/typst-common/main/src/common/truth-table-reimp.typ
typst
#import "@preview/truthfy:0.4.0" #import "data.typ": transpose #let bit-count(n) = { let res = 0 while n > 0 { res += 1 n = n.bit-rshift(1) } return res } #let reverse-bits(n, max: none) = { if max == none { max = bit-count(n) } let rev = 0 for _ in range(max) { rev = rev.bit-lshift(1) if n.bit-and(1) == 1 { rev = rev.bit-xor(1) } n = n.bit-rshift(1) } return rev } #let comb-n(n) = 1.bit-lshift(n) #let gen-truth-order(n) = range(n).sorted(key: i => reverse-bits(i, max: bit-count(n))) #let _always-0(a) = { $ #a.body and not #a.body $.body } // #let _always-0(a) = a + " and not " + a #let _prefix(vars) = { $#vars.map(_always-0).join($" "and" "$.body)$ } // #let _prefix(vars) = eval("$" + vars.map(_always-0).join(" and ") + "$") #let _var-comb-truth-tcells(vars) = { let n = vars.len() let prefix = _prefix(vars) let truthfy-children = truthfy.truth-table(prefix).children let cells = gen-truth-order(comb-n(n)) //? Skip headers .map(i => i + 1) //? Get collection of variable rows .map(i => { let res = truthfy-children //? Get corresponding row res = res.slice(i * (n + 1)) //? Get variable parts res = res.slice(0, n) //? To Equations res = res.map(v => $#v$) res }) transpose(cells) } #let _truth-equation-cells(vars, equation) = { let n = vars.len() let prefix = _prefix(vars) let truthfy-children = truthfy.truth-table($(#prefix) or (#equation)$).children //? Reorder truthfy indices gen-truth-order(comb-n(n)) //? Skip headers .map(i => i + 1) //? Get corresponding row and column .map(i => ( truthfy-children.slice(i * (n + 1)).at(n) )) } #let _truth-col-cells(vars, vv) = { let n = vars.len() let t = type(vv) if t == "content" { _truth-equation-cells(vars, vv) } else if t == "function" { range(comb-n(n)).map(i => vv(i)) } else if t == "array" { vv } else { panic("Type " + t + " is not supported.") }.map(v => [#v]) } #let truth-table-rows(slice-args: (0,), vars, ..pairs) = { pairs = pairs.pos() let vvs = pairs.map(v => v.at(1)) transpose(( .._var-comb-truth-tcells(vars), ..vvs.map(vv => _truth-col-cells(vars, vv)), )).slice(..slice-args) } #let truth-table-cells(slice-args: (0,), vars, ..pairs) = { truth-table-rows(slice-args: slice-args, vars, ..pairs).flatten().filter(v => v != none and v != []) } #let truth-table(table-args: (:), slice-args: (0,), vars, ..pairs) = { let var-headers = vars.map(v => if type(v) == "array" { v.at(0) } else { v }) vars = vars.map(v => if type(v) == "string" { $#v$ } else if type(v) == "array" { v.at(1) } else { v }) pairs = pairs.pos() let headers = var-headers + pairs.map(v => v.at(0)) let vvs = pairs.map(v => v.at(1)) table( columns: headers.len(), inset: .4em, align: center + horizon, ..table-args, table.header(..headers.map(v => [*$#v$*])), ..truth-table-cells(slice-args: slice-args, vars, ..pairs) ) }
https://github.com/eternal-flame-AD/typstpp
https://raw.githubusercontent.com/eternal-flame-AD/typstpp/main/src/prelude.typ
typst
Apache License 2.0
#let src(content) = { block( fill: rgb("#ececec"), inset: 1em, breakable: true)[ #content ] }
https://github.com/lucannez64/Notes
https://raw.githubusercontent.com/lucannez64/Notes/master/Maths_Exercices_10_10_2023.typ
typst
#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( title: "Maths Exercices 10 10 2023", authors: ( "<NAME>", ), date: "10 Août, 2024", ) #set heading(numbering: "1.1.") #box(image("Exercies_10_10_2023_1.png")) #box(image("Exercies_10_10_2023_2.png")) #link("Maths_Exercices.pdf")[Maths Exercices]
https://github.com/MatheSchool/typst-g-exam
https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/src/g-clarification.typ
typst
MIT License
#import"./global.typ": * /// Show a clarification. /// - size(length): Size of clarification. /// - body(string, content): Body of clarification. #let g-clarification(size:8pt, body) = { text(size:size)[$(*)$ #body] }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/nassi/0.1.0/src/elements.typ
typst
Apache License 2.0
#let TYPES = ( EMPTY: 0, PROCESS: 1, BRANCH: 2, SWITCH: 3, LOOP: 4, LOOP_2: 5, PARALLEL: 6, FUNCTION: 7, CALL: 8 ) #let element( type, text, ..args ) = ( ( type: type, text: text, pos: (0,0), width: auto, height: auto, inset: auto, grow: 0, fill: auto, stroke: auto, name: auto, ..args.named() ), ) #let empty = element.with(TYPES.EMPTY, sym.emptyset) #let function( text, elements, ..args ) = element(TYPES.FUNCTION, text, elements: elements, ..args.named() ) #let process = element.with(TYPES.PROCESS) #let assign( var, expression, symbol:sym.arrow.l, ..args ) = element(TYPES.PROCESS, var + " " + symbol + " " + expression, symbol: symbol, ..args.named() ) #let call = element.with(TYPES.CALL) #let loop( text, elements, ..args ) = element(TYPES.LOOP, text, elements: elements, ..args.named() ) #let branch( text, left, right, column-split:50%, labels:(), ..args ) = element(TYPES.BRANCH, text, left: left, right: right, column-split: column-split / 100%, labels: labels, ..args.named() ) #let switch( text, ..branches-args ) = element(TYPES.SWITCH, text, brnaches: branches-args.pos(), ..branches-args.named() ) #let parallel( text, ..branches-args ) = element(TYPES.PARALLEL, text, brnaches: branches-args.pos(), ..branches-args.named() )
https://github.com/cadojo/correspondence
https://raw.githubusercontent.com/cadojo/correspondence/main/src/vita/src/teaching.typ
typst
MIT License
#let teachinglist = state("teachinglist", ()) #let teaching( organization, role: none, start: none, stop: none, notes ) = { let content = [ #grid( columns: (65%, 33%, 1fr), heading(level: 3, organization), align(right)[ #set text(rgb(90,90,90)) #start #if stop != none { " — " + stop} ] ) #if role != none { set text(rgb(90,90,90)) if type(role) == "string" { v(-0.5em) text(role) } else { v(-0.5em) text(role.join(", ")) } } #notes ] teachinglist.update(current => current + (content,)) } #let teachings(header: "Teaching Experience") = { locate( loc => { let teachinglist = teachinglist.final(loc) if teachinglist.len() > 0 { heading(level: 2, text(header)) line(length: 100%, stroke: 1pt + black) teachinglist.join() } } ) }
https://github.com/icyzeroice/typst-packages
https://raw.githubusercontent.com/icyzeroice/typst-packages/main/packages/minimal-styling/src/lib.typ
typst
MIT License
#let _theme = ( font_size: ( h1: 32pt / 1.5, h2: 24pt / 1.5, h3: 20pt / 1.5, h4: 16pt / 1.5, h5: 14pt / 1.5, h6: 13.6pt / 1.5, body: 16pt / 1.5, ), font_family: ( all: ( "--apple-system", "BlinkMacSystemFont", "Segoe UI", "Noto Sans", "Helvetica", "Arial", "Sans Serif Collection", // fonts that nice to have "MiSans", // use system fonts for fallback "PingFang SC", "Microsoft YaHei", "Segoe UI Emoji", "Apple Color Emoji", ), ), color: ( link: rgb(9, 105, 218), raw: rgb(246, 248, 250), line: rgb(223, 228, 233), ), spacing: ( heading_above: 24pt / 1.5, heading_below: 16pt / 1.5, heading_line: 5pt, ), ) #let _template_text(doc) = { show: set text( font: _theme.font_family.all, top-edge: "ascender", bottom-edge: "descender", ) doc } #let _template_headings(doc) = { show: _template_text show heading: set block( width: 100%, above: _theme.spacing.heading_above, below: _theme.spacing.heading_below, ) show heading: set text(weight: 600) show heading.where(level: 1): set text(size: _theme.font_size.h1) show heading.where(level: 2): set text(size: _theme.font_size.h2) show heading.where(level: 3): set text(size: _theme.font_size.h3) show heading.where(level: 4): set text(size: _theme.font_size.h4) show heading.where(level: 5): set text(size: _theme.font_size.h5) show heading.where(level: 6): set text(size: _theme.font_size.h6) let _heading_with_line(it) = { set block(below: 0pt) it set block( above: _theme.spacing.heading_line, below: _theme.spacing.heading_below, ) line( length: 100%, stroke: 0.5pt + _theme.color.line, ) } show heading.where(level: 1): _heading_with_line show heading.where(level: 2): _heading_with_line doc } #let _template_raw(doc) = { show: _template_text let _raw_common_options = (radius: 3pt, fill: _theme.color.raw) show raw.where(block: true): set block(.._raw_common_options, width: 100%, inset: 8pt) // https://typst.app/docs/reference/text/raw/#parameters-block show raw.where(block: false): box.with( .._raw_common_options, inset: (x: 2.7pt), outset: (y: 1.3pt), baseline: 2pt, ) // https://github.com/typst/typst/discussions/3988 show raw.where(block: false): it => { show " ": " " + sym.zws it } doc } #let _template_link(doc) = { show: _template_text show link: underline show link: set text(fill: _theme.color.link) show link: set underline(offset: 3.2pt / 1.5) doc } #let _template_footnote(doc) = { show footnote: it => { set text(fill: _theme.color.link) it } doc } // https://github.com/talal/ilm/blob/aaa225f53034dd229b53d98ed185a0fb813f94ad/lib.typ#L214 #let _template_table(doc) = { doc } #let template_minimal_styling(doc) = { show: _template_text show: _template_raw show: _template_link show: _template_headings show: _template_footnote show: _template_table doc }
https://github.com/npujol/chuli-cv
https://raw.githubusercontent.com/npujol/chuli-cv/main/README.md
markdown
MIT License
# CV in Typst These are a minimalistic and modern CV and cover letter written in Typst. ![thumbnail](thumbnail.png) ## Setup - Install [Typst](https://typst.app) and the font awesome fonts on your system. - Look docs of [light-cv](https://github.com/AnsgarLichter/light-cv) ## Inspiration - [brilliant-CV](https://github.com/mintyfrankie/brilliant-CV) as this project was an inspiration for the CV template. - [light-cv](https://github.com/AnsgarLichter/light-cv) as this project was an inspiration for the CV template. - [Awesome CV ](https://github.com/posquit0/Awesome-CV) as this project was an inspiration for the CV template. - [<NAME>'s CV](https://www.overleaf.com/articles/ritabh-ranjans-cv/ngtndgryfykt) as this project was an inspiration for the CV template. - [hipster-cv](https://github.com/latex-ninja/hipster-cv) as this project was an inspiration for the CV template. ## Output - [CV](./output/cv.pdf) - [Cover Letter](./output/letter.pdf)
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CU/minea/1_generated/00_all/10_jun.typ
typst
#import "../../../all.typ": * #show: book = #translation.at("M_10_jun") #include "../10_jun/24.typ" #pagebreak() #include "../10_jun/29.typ" #pagebreak()
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/design_concept/content/results/results_concept.typ
typst
= Design Concept <result-concept> The design concept described in @design-iteration-2 focuses on visual function composition. It proposes a function editor that features all the basic functionalities needed to create functional applications in a block-based fashion. The editor allows learners to approach functional programming through blocks instead of code. The type-inference engine offers much guidance, especially the automatically generated type holes, which can help to understand how e.g. parametric polymorphism or currying works. But other aspects not covered in the concept are also essential to create modern functional programs. For example, a robust type system with support for sum types, type classes, etc., can be found in most current functional programming languages. Given that the project's goal is to allow beginners to approach functional programming more easily, the concept should also address a clear transition to code-based programming. One possibility to integrate this idea has been described in a possible outlook in @outlook-visual-textual.
https://github.com/spherinder/ethz-infk-thesis
https://raw.githubusercontent.com/spherinder/ethz-infk-thesis/master/pages/list-of-figures.typ
typst
#context { if query(figure.where(kind: image)).len() > 0 { // TODO Needed, because context creates empty pages with wrong numbering set page( numbering: "i", ) heading("List of Figures", numbering: none) outline( title: none, indent: true, fill: repeat(text(". ")), target: figure.where(kind: image), ) } }
https://github.com/LucaCiucci/tesi-triennale
https://raw.githubusercontent.com/LucaCiucci/tesi-triennale/main/long-abstract.typ
typst
Creative Commons Zero v1.0 Universal
#align(center)[= Monopoli magnetici] #h(1em) #set par(justify: true) Sin dalla formulazione delle equazioni di Maxwell, l'esistenza dei monopoli magnetici è stata oggetto di ricerca teorica e sperimentale. Questo elaborato esplora alcuni aspetti teorici significativi sulle proprietà dei monopoli magnetici derivanti dalla consistenza della teoria dei potenziali elettromagnetici e delle loro proprietà topologiche, con particolare attenzione alla quantizzazione della carica elettrica e magnetica Si osserva che la simmetria $U(1)$ delle equazioni di Maxwell sembra contemplare la presenza di cariche magnetiche. Viene quindi introdotto il problema della conservazione del momento angolare, che rimane costante considerando il contributo dato dal tensore degli stress del campo elettromagnetico oppure considerando un termine aggiuntivo $~e g$, con $e$ e $g$ rispettivamente le cariche elettrica e magnetica. Successivamente si considera la soluzione di Dirac per il potenziale vettore di un monopolo magnetico, che risulta singolare su una stringa. Si osserva che, imponendo l'invarianza di gauge, il campo da essa generato non è fisico in quanto trasforma in base alla gauge scelta. In meccanica quantistica, si richiede che l'apporto all'azione dovuto a una trasformazione di gauge non comporti effetti osservabili, ottenendo così una condizione di quantizzazione delle cariche elettrica e magnetica. Un risultato notevole è che la presenza di un singolo monopolo magnetico nell'universo impone, per consistenza, la quantizzazione della carica elettrica. La condizione è anche equivalente a richiedere che la fase accumulata dalla funzione d'onda intorno alla stringa sia $2 pi n$, oppure che il termine aggiuntivo al momento angolare conservato abbia autovalori semi-interi.\ Questa condizione può essere generalizzata a coppie di dyoni, trovando che la carica di un dyone risiede su un reticolo $(e, g)$, rompendo la simmetria $U(1)$ delle equazioni di Maxwell. Un'altra formulazione notevole dei monopoli magnetici, proposta da Wu e Yang, richiede di rappresentare il potenziale vettore tramite un ricoprimento dello spazio con due potenziali di Dirac. Questo elimina la singolarità, mentre la condizione di quantizzazione si ritrova considerando il path integral nella regione di sovrapposizione.\ Tale trattazione si formalizza naturalmente tramite nozioni di topologia e geometria differenziale: le usuali equazioni di Maxwell vivono su fibrato triviale formato dallo spazio e dal campo. La singolarità in un punto invece implica una classificazione di tali fibrati tramite il primo numero di Chern ovvero la carica topologica. Infine si considera una semplice trattazione relativistica, introducendo alla possibilità di avere due quadripotenziali per descrivere il campo elettromagnetico. La ricerca di evidenze è stata oggetto di numerosi esperimenti in quanto tali particelle risultano inquadrate nelle GUTs. Sono state concepite diverse metodologie, come ad esepio la ricerca di tracce elettriche su di anelli superconduttori, la radiazione di Cherenkov (AMANDA), l'analisi di segnali radio (ANITA) o l'analisi delle traiettorie sotto l'effetto di un campo magnetico (esperimento MoEDAL).\ Attualmente non sono stati osservati monopoli magnetici, e alcuni esperimenti si concentrano sul fornire limiti superiori alla loro esistenza.
https://github.com/Rhinemann/mage-hack
https://raw.githubusercontent.com/Rhinemann/mage-hack/main/src/chapters/Storyteller%20Characters.typ
typst
#import "../templates/interior_template.typ": * #show: chapter.with(chapter_name: "Storyteller Characters") = Storyteller Characters #show: columns.with(2, gutter: 1em) STCs are the characters that the ST incorporates into the session and gets to roleplay, for better or worse. Most sessions have at least one major character, who deserves a full-fledged character file, similar to those of the PCs. Sometimes, however, the STC just needs a couple of traits because the true opposition for the PCs is the STC's lieutenant or majordomo. In that case, they're the ones whose files are more detailed. STCs can reappear session after session, plaguing the PCs at every turn. Even if you used the character's full stats in a previous session, you're under no obligation to re-use the same stats in another session. STCs don't follow the same rules as the players when it comes to character files or XP and advancement. STCs are split into two specific types, listed here for easy reference. They will be explained further. / Extras: Unnamed background characters or support characters with only one trait. / Driven STC: An STC of varying importance and power that changes based on how the PCs interact with them. #block(breakable: false)[ == Extra Extras are often background characters or support characters with only one trait. They can be contacts that provide information or services, or just flunkies at a character's beck and call. Extras can even include a group of people, such as a squad of soldiers, who mostly act as one character in the story. ] #block(breakable: false)[ === Creating An Extra Extras need only a single die with a flavorful trait attached to them. That trait does not need to be equivalent to the PCs. Something as simple as #smallcaps[Hired Assassin] #spec_c.d10 or #smallcaps[Cut-Rate Thief] #spec_c.d6 works just fine. If you like, add another trait during play as things progress; you can upgrade any extra to a driven STC this way. If the extra is part of a character file, it might already have a die rating, so you can use that in a pinch. ] #block(breakable: false)[ === Using An Extra Extras come into play as an additional die the ST includes in an opposition dice pool for a test. They can also gang up with a driven STC by adding their die to a STC's dice pool in a contest. ] Extras acting as allies to the PCs might contribute their die to a PC as an asset, but doing so could put the extra at risk of taking a complication or being taken out. Extras can be taken out by complications or stress higher than their base trait die. #block(breakable: false)[ == Driven STC Driven STCs differ in power and their significance, but any driven STC is a more significant characters that interact with players more and can influence the story on their own. ] #block(breakable: false)[ === Drives Each driven STC has a pair of drive traits, representing major personality traits that motivate the creature. When a drive fuels its actions, the STC can include that drive in its roll, but it can't include more than one drive in the same pool. ] A drive consists of a short statement, such as "Liberate the Tribe", "Earn Others' Respect for My Achievements.", or "Defend Our Lair.” For the most variety, utility, and dramatic interest, each pair of drives is designed so that the two motivations conflict with each other as much as possible. Drives are a useful trait to assign to any STC, especially if that STC is going to be a part of the game beyond a single scene. A creature's interactions with the PCs can change the size of its drives, assuming the creature sticks around after its initial interaction with the PCs. Drives Evolve. After the PCs engage with a creature or other GMC that has drives, at the end of the scene (or the end of session, depending on how quickly the GM wants the situation to evolve), the GM can step up one drive (to a maximum of #spec_c.d12), but must also step one drive down (to a minimum of #spec_c.d4). If a PC won a conflict against that creature, the GM can ask them to decide which drive would step up. Either way, the choice of which drives step up or down should reflect the events that took place. These changes to drive die ratings are permanent until another effect alters them. Once a drive steps up to #spec_c.d12, that creature emerges as a fully-realized major enemy, rival, or ally of the PCs, deeply motivated to pursue that drive at all costs. While a creature has a #spec_c.d12 drive, the GM can step that drive back down to #spec_c.d10 at any time to end a scene in way that favors the creature. This could allow a creature to make an impossible escape, rescue an important character, defeat or capture a number of enemies, achieve a startling victory, attain a new level of power or influence, assume their final form, split up a group, conquer or destroy a crucial location, etc. However, it can't take out a PC or change the outcome of a previous conflict. #block(breakable: false)[ === Making A Driven STC Every driven STC follows this pattern: #driven_STC( name: [Name (People) / Other Names], challenge_pool: [], drive_1: "#1", drive_2: "#2", traits: [Traits], sfx: [/ SFX: Descriptive and mechanical text], ) ] Challenge pool is the same pool that is explained in Game Rules, set by the same rules. #block(breakable: false)[ === Example Driven STCs A storyteller can come up with a virtually infinite number of STCs, but the following section will provide examples of some STCs for inspiration. ] Many more examples can be seen in Lynn Jones' #link("https://ljrstudiosouth.itch.io/monsters")[Manual of Monsters, Minions & Mountebanks] #driven_STC( name: [Extraordinary Citisen], challenge_pool: [#spec_c.d8 #spec_c.d8], drive_1: [Satisfy Demands of Management #spec_c.d8], drive_2: [Advance My Rank #spec_c.d8], traits: [ Any form of psychokinesis #spec_c.d8\ Intelligence #spec_c.d8 ], )
https://github.com/mumblingdrunkard/mscs-thesis
https://raw.githubusercontent.com/mumblingdrunkard/mscs-thesis/master/src/index.typ
typst
#import "utils/acronyms.typ" as acronyms #import "utils/setup.typ" as setup #show: setup.setup #include "./introduction-and-motivation/index.typ" #include "./computer-architecture-fundamentals/index.typ" #include "./modern-hardware-design/index.typ" #include "./berkeley-out-of-order-machine/index.typ" #include "./processor-security/index.typ" #include "./doppelganger-loads/index.typ" #include "./architecture-and-implementation/index.typ" #include "./methodology-and-results/index.typ" #include "./discussion/index.typ" #include "./conclusion/index.typ"
https://github.com/mismorgano/UG-FunctionalAnalyisis-24
https://raw.githubusercontent.com/mismorgano/UG-FunctionalAnalyisis-24/main/tareas/Tarea-11/Tarea-11.typ
typst
#import "../../config.typ": config, exercise, proof, cls #show: doc => config([Tarea 11], doc) 2.34, 2.35, 2.36, 2.38, 2.39, 2.40 y 2.41. #exercise[2.34][ Sea $T in cal(B)(X, Y)$. Prueba lo siguiente: + $"Ker"(T) = T^*(Y^*)_perp$ y $"Ker"(T^*) = T(X)^perp$. + $cls(T(X)) = "Ker"(T^*)_perp$ y $cls(T^*(Y^*)) subset "Ker"(T)^perp$. ] #exercise[2.35][ Sean $x, Y$ espacios normados, $T in cal(B)(X, Y)$. Considera $hat(T)(hat(x)) = T(x)$ como un operador de $X slash "Ker"(T)$ en $cls(T(X))$. Entonces obtenemos $hat(T)^*: cls(T(X))^* -> (X slash "Ker"(T))^*$. Usando la proposición 2.7 y que $cls(T(X))^perp = T(X)^perp = "Ker"(T^*)$ podemos suponer que $hat(T)^*$ es un o.l de $Y^* slash "Ker"(T^*)$ en $"Ker"(T)^perp subset X^*$. Por otro lado, para $T^*: Y^* -> X^*$ podemos considerar $hat(T^*): Y^* slash "Ker"(T^*) -> X^*$. Muestra que $hat(T)^* = hat(T^*)$. ] #exercise[2.36][ Sean $X, Y$ espacios de Banach y $T in cal(B)(X, Y)$. Muestra que $T$ mapea $X$ sobre un conjunto denso en $Y$ ssi $T^*$ mapea $Y^*$ uno a uno en $X^*$. ] #exercise[2.38][ Sean $X, Y$ espacios de Banach y $T in cal(B)(X, Y)$. Si $T$ es un isomorfismo en $Y$, ¿Es $T^*$ necesariamente un isomorfismo en $X^*$? ] #exercise[2.39][ Sean $X,Y$ espacios de Banach y $T in cal(B)(X, Y)$. Muestra que: + $T^*$ es sobre ssi $T$ es un isomorfismo en $Y$. + $T$ es sobre ssi $T^*$ es un isomorfismo en $X^*$. + $T(X)$ es cerrado en $Y$ ssi $T^*(Y^*)$ es cerrado en $X^*$. ] #exercise[2.40][ Muestra que no existe $T in cal(B)(cal(l)_2, cal(l)_1)$ tal que $T$ es un mapeo sobre. ] #exercise[2.41][ Sean $X, Y$ espacios de Banach, $T in cal(B)(X, Y)$. Muestra que: + $T$ es un isomorfismo de $X$ sobre $Y$ ssi $T^*$ es un isomorfismo de $Y^*$ sobre $X^*$. + $T$ es una isometria de $X$ sobre $Y$ ssi $T^*$ es una isometria de $Y^*$ sobre $X^*$. ]
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/ascii-ipa/1.0.0/README.md
markdown
Apache License 2.0
# ascii-ipa This package allows you to easily convert different ASCII representations of the International Phonetic Alphabet (IPA) to and from the IPA. It also offers some minor utilities to make phonetic transcriptions easier to use overall. Note: This is an extended port of the [`ipa-translate`][ipa-translate] Rust crate by [tirimid][tirimid]'s conversion features into native Typst. All conversions are implemented according to [this Wikipedia article][ipa-wikipedia]. ## Usage ### Conversion The package supports several different ASCII representations for the IPA with one function each: | Notation | Function name | |----------|-----------------| | Branner | `#branner(...)` | | Praat | `#praat(...)` | | SIL | `#sil(...)` | | X-SAMPA | `#xsampa(...)` | They all return the converted value as `content` and accept the same parameters: | Parameter | Type | Positional / Named | Default | Description | |-----------------|-----------|--------------------|---------|----------------------------------------------------------------------------------------------------------------------------------| | `value` | `string` | positional | | Main input to the function. Usually the transcription in the corresponsing ASCII-based notation. | | `reverse` | `boolean` | named | `false` | Reverses the conversion. Pass Unicode IPA into `value` to get the corresponsing ASCII-based notation back. | | `override-font` | `boolean` | named | `false` | Overrides the active font and forces rendering in Linux Libertine. Use this if your font has lackluster support for Unicode IPA. | #### Examples All examples use the Russian word ⟨привет⟩ [prʲɪvʲet] for the conversion. ```ts #import "@preview/ascii-ipa:1.0.0": * // Branner #branner("prj^Ivj^et") // -> prʲɪvʲet #branner("prʲɪvʲet", reverse: true) // -> prj^Ivj^et // Praat #praat("pr\\^j\\icv\\^jet") // -> prʲɪvʲet #praat("prʲɪvʲet", reverse: true) // -> pr\\^j\\icv\\^jet // SIL #sil("prj^i=vj^et") // -> prʲɪvʲet #sil("prʲɪvʲet", reverse: true) // -> prj^i=vj^et // X-SAMPA #xsampa("pr_jIv_jet") // -> prʲɪvʲet #xsampa("prʲɪvʲet", reverse: true) // -> pr_jIv_jet // Font override #xsampa("prj^Ivj^et", override-font: true) // -> prʲɪvʲet, but in Linux Libertine ``` #### Deviations from [Wikipedia][ipa-wikipedia] Not everything is implemented fully compliant with the information in the article. - Branner - `ts))` is instead represented as `t))s` - SIL - The only supported superscript characters are: `ʰ`, `ʷ`, `ʲ`, `ˠ`, `ˤ`, `ⁿ`, `ˡ` ### Brackets & Braces You can easily mark your notation text as phonetic, phonemic, orthographic, or prosodic. ```ts #import "@preview/ascii-ipa:1.0.0": * #phonetic("prʲɪˈvʲet") // -> [prʲɪˈvʲet] #phnt("prʲɪˈvʲet") // -> [prʲɪˈvʲet] #phonemic("prɪvet") // -> /prɪvet/ #phnm("prɪvet") // -> /prɪvet/ #orthographic("привет") // -> ⟨привет⟩ #orth("привет") // -> ⟨привет⟩ #prosodic("prʲɪˈvʲet") // -> {prʲɪˈvʲet} #prsd("prʲɪˈvʲet") // -> {prʲɪˈvʲet} ``` [ipa-translate]: https://github.com/tirimid/ipa-translate [tirimid]: https://github.com/tirimid [ipa-wikipedia]: https://en.wikipedia.org/wiki/Comparison_of_ASCII_encodings_of_the_International_Phonetic_Alphabet
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/037%20-%20Ravnica%20Allegiance/009_The%20Gathering%20Storm%3A%20Chapter%2015.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "The Gathering Storm: Chapter 15", set_name: "Ravnica Allegiance", story_date: datetime(day: 18, month: 09, year: 2019), author: "<NAME>", doc ) "It can’t be done, Master Zarek." The foreman was stout and walrus-mustached, with a gleaming bald head and arms like tree trunks. "The workers are asleep on their feet already. You have no idea how difficult it is getting equipment down there. There aren’t enough cranes or sledges, and our haulers hate the smell, so we have to carry parts by hand—" "There’s no such thing as ‘can’t be done’," Ral said. "There’s only insufficient motivation. Tell Chemister Frexus downstairs that I said you could use her constructs to haul parts. They won’t object to the smell." "But her constructs explode if the boilers get too hot! I was just at a meeting about it last week." "Incentive to get the things moved quickly, then!" Ral gave him a grin. "As for the workers, tell them I’ll double their wages if they get the resonator installed on time." "Er . . ." The foreman wiped his forehead. "I believe they were #emph[already] promised double . . ." "Then this would be quadruple the usual rate, wouldn’t it?" #emph[After all, if we lose, it’s not like we’ll have to pay.] Ral permitted himself a moment of amusement at the thought of aggrieved laborers applying to Bolas for their lost wages. "Ah. I. Uh." The big man gave a shaky smile. "Does . . . does that apply to . . . supervisory personnel as well, master?" "#emph[If] the resonator is finished and in working order on schedule." "It will be, Master Zarek." The foreman drew himself up. "Depend on it." "I am." #emph[We all are.] He’d returned from the Undercity battered and shaken, but there’d only been time for a brief rest before the all-consuming project required his full attention again. A team of Azorius warders and lawmages had gone to work immediately, erecting magical barriers around the underground resonator site to hold off any Golgari counterattacks. Boros and Orzhov troops remained in place, too, working uneasily side by side. But it was his own people who had the task of building the resonator itself, and aligning it with the growing network. #emph[Three more days.] That’s what they needed. #emph[Three days, and Niv-Mizzet will be able to put his plan into action. ] Whether that would be enough to stop Bolas for certain, only the Firemind knew, but at least Ral would have done everything he could. #emph[If Bolas gives us three days . . .] Lavinia had been his best link to the progress of Bolas’s plans, but he hadn’t seen her since the disastrous guild summit. That was probably bad, but he didn’t have the time to send out a search. #emph[She can take care of herself, that’s for certain.] Except, against Bolas, nothing was certain— "<NAME>?" A goblin voice from the corridor. Ral looked up and found one of his personal secretaries peeking through the doorframe. "What is it?" Ral snapped. "There’s someone who insists on seeing you. He says it’s urgent." "Everything’s urgent," Ral said. "He says you’ll see him," the goblin said. "His name’s Tomik?" #emph[Tomik is ] here#emph[?] They’d never met at the Nivix. #emph[He should know better than to—] "Let him in," Ral said shortly, laying his pen aside. A moment later, Tomik entered, shutting the door behind him. Ral’s lover looked weary, as he usually did of late. His eyes were sunken, and his hair was a mess. Ral balanced a wave of irritation that Tomik would intrude on him here with an urge to take the other man in his arms. "I always thought your office would be a little . . . grander," Tomik said, looking around the dingy little suite. "No offense." "I don’t spend much time in here, normally," Ral said. "The last few weeks have been . . . an exception." "You didn’t come see me, after you got back from the Undercity." "I sent you a note," Ral said, feeling a sting of guilt. "You know how critical time is." "I know," Tomik said. "I just—I wanted to talk to you about something." "Something that can’t wait until after the potential end of Ravnica?" Ral said. Tomik rolled his eyes. "This isn’t #emph[personal] . I know better than that. It’s . . . well. Guild business." "I see." Ral leaned back in his chair. "All right. What’s wrong?" "It’s Kaya. And Teysa. I think . . ." He took a deep breath. "I think Teysa is making . . . a mistake." "How so?" "Kaya is changing things. For the better, I think. There are things the Orzhov does that . . . we all try to ignore, sometimes, but she refuses to ignore them." "And Teysa doesn’t approve?" "She doesn’t. And neither do the other guild leaders." "Is there anything they can do about it?" "I think they’re going to kill Kaya." "Ah." Ral tapped his fingers on the desk. "And if she dies, who becomes guildmaster?" "Almost certainly Teysa." "And will she continue to support our project?" Tomik’s eyes narrowed. "Is that all you care about?" "It’s all I can #emph[afford] to care about," Ral said. "You know how important this is. What Niv-Mizzet has trusted me with." "Even if it means letting Kaya die?" Ral shrugged. "I thought you worked for Teysa." "I do," Tomik said. "And Teysa has been working all her life to step out of her grandfather’s shadow. If she does this . . . I think she may never escape from it." "And what do you want from me?" "I don’t know." Tomik looked down. "I hadn’t planned that far ahead. I just thought that Kaya was your friend." "She’s my ally," Ral said. "It’s not the same." "I see." Tomik’s lip tightened. "What about me? Am I an ally, too?" "Of course not." Ral stood up behind his desk. "Tomik, you know that—" "Never mind." Tomik turned to the door. "I’ll deal with this myself." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Everyone had made all the right noises when Kaya had returned to Orzhova, but as she accepted the congratulations of the priests and their attendants, her mind had painted murderous rage behind every false smile. She’d escaped from the press as soon as she could, retreating to her opulent suite of rooms high in the cathedral and refusing to see anyone. Teysa had sent several couriers, and Kaya had dismissed them out of hand. #emph[This can’t go on.] For one thing, she was getting hungry. #emph[But can I trust anything from the kitchens?] She’d have to leave the cathedral and find a restaurant somewhere, chosen at random. #emph[And then what, do the same thing every night for the rest of my life?] #emph[This isn’t going to work.] She’d spent her life avoiding her enemies—and she’d had many, in the course of her career—by keeping a low profile and moving around. #emph[Now I’m stuck as head of a church, with a big stupid hat and a fancy bedroom anyone can find.] If the heads of the Orzhov were really determined to kill her, sooner or later they were going to succeed. #emph[Which means I should get out of here.] She could planeswalk, and risk the backlash from the debt-chains. #emph[Maybe Teysa doesn’t know as much about it as she lets on.] Another option would be to escape Orzhova and hide out somewhere. #emph[Maybe find a lawmage of my own. Or ask Ral for help, or] — There was a rustle at the front door. Kaya sat bolt upright in bed, heart hammering, but the only sound was a quiet set of retreating footsteps. She waited until they’d faded away, then grabbed her daggers from the bedside table and quietly padded across the thick carpet. The outermost room in the suite was for welcoming guests, with a small table and several armchairs. The big door that opened into the hall was locked, just as she’d left it, but a small folded square of white paper lay in front of it, where someone had shoved it through the gap. Kaya wondered if this was an extremely subtle attack—#emph[poison on the paper?] —before deciding even she wasn’t #emph[that] paranoid. She strapped on her daggers and retrieved the note.          #emph[Guildmaster] , it read. #emph[You are in danger.] #emph[No surprise there,] Kaya thought. #emph[The hierophants have prevailed on Lady Teysa to have you arrested this evening. They have rotated the guard to have loyal men in place. They plan to capture you and hold you prisoner until they extract the Orzhov debt from you by magic.] Kaya paused to swear under her breath. #emph[I can help you, if you can reach me. I will be waiting in the stables, in the first floor sub-basement.] #emph[        ] #emph[ ] #emph[Sincerely,] #emph[        ] #emph[ ] #emph[A Friend] #emph[A friend,] Kaya thought, #emph[who isn’t eager to stick their neck out.] But she could hardly blame her unknown benefactor. #emph[If they’re willing to arrest the guildmaster, who knows what they’d do to anyone who wanted to help her.] The question was, of course, did she trust this mysterious informant. #emph[Or is this just an invitation to a trap?] For a moment she hesitated, note in hand. Then, as though sent to force her into motion, she heard the #emph[clomp] of heavy boots from the hallway. "Guildmaster?" The voice from outside was muffled, as if by a knight’s enclosing helmet. #emph[Well. That about settles it.] When Teysa wanted to talk to her, she sent a servant, not an armored guard. "Just a moment!" Kaya said. She checked her daggers in their sheaths, took a deep breath, and dropped through the floor. This was a trickier operation than it sometimes appeared, involving precise timing to prevent yourself from falling further than expected and winding up partially through the floor below as well. Because she was a paranoid sort, Kaya had taken a few strolls around Orzhova, and confirmed that the rooms directly below hers were the personal chambers of some hierophant, with plenty of empty space for her to land. She was expecting a shocked old man, possibly in his bathrobe, but nothing she couldn’t handle. What she was #emph[not] expecting was at least a dozen armed soldiers, all waiting with weapons drawn, with three robed mages standing at the edges of the room. #emph[Oh, damn.] It had to be Teysa. #emph[She’s been watching me too close.] No time to worry about it now. Kaya landed next to a guardsman who reached out to grab her. Letting his flailing arms pass through her in a burst of purple light, she dropped and kicked out his knee, and he hit the floor in a clatter of armor. Another man closed in, carrying a truncheon, and Kaya caught his arm by the wrist as she tried to swing it and twisted it painfully, driving him past her to the floor. "Now!" someone called. "The binding!" Energy thrummed through the room as the three mages raised their hands. Light crackled and spat around Kaya, a halo of twisted purple and blue. After a moment, it detonated in a soundless explosion, a burst of ghostly radiance that passed through everyone in the room and left them untouched. #emph[Certainly past time to get out of ] here#emph[.] Kaya willed herself to impermeability, but the purple light that accompanied her transition was weak and fitful, glimmering in patches along her body for a few moments before fading out entirely. The floor beneath her remained distressingly solid to the touch. "She’s caught!" A silver-haired woman in a lieutenant’s uniform stood by the door. "Take her! Remember, <NAME> needs her alive." #emph[Triple damn.] Apparently Teysa had turned the Orzhov aptitude for binding spirits into something that would work on Kaya herself. It would probably wear off, given time, but for the moment that left her surrounded by soldiers with truncheons, closing in. #emph[She needs ] me#emph[ alive, lest some random guard inherit all of Grandfather Karlov’s contracts. But I can’t say the same about ] them#emph[.] She felt a pang of guilt as she drew her daggers—the guards hadn’t done anything but follow orders—but only a slight one. #emph[No other way.] They charged. Kaya dodged the first man, slashed his throat neatly as she spun, and turned the motion into a kick that sent a woman tumbling into the man behind her. A guard swung for her head from behind, and Kaya ducked and spun again, planting a dagger under his armpit where his armor was weak. She yanked it free again and danced away in the direction of the door. The lieutenant scrambled with her own club, trying to bar Kaya’s path, but Kaya dodged under the blow and came up with an elbow to the woman’s jaw, slamming her teeth together with a clack. She staggered, spitting blood, and Kaya yanked open the door, twisted through, and slammed it behind her. She had minutes, maybe less, before the alarm became general. She ran down the hallway, and as she moved concentrated on her arm. It shimmered briefly into intangibility, but the power faded quickly. #emph[So no ducking through walls for a while.] That meant she was stuck inside Orzhova. #emph[Which means there’s really only one place to head for. Let’s hope I can remember how to ] find#emph[ the stables. This place is a maze] — "There!" someone shouted. "Stop her!" Up ahead, two guards accompanied an armored knight, blocking a T-junction. They lowered their spears, and the knight drew his sword—#emph[Apparently not everyone got the memo about not killing me, wonderful] —and clearly expected Kaya to pull up short. Instead, she barreled into them, hunching over to avoid the spearpoints. The momentum of her run slammed one guardswoman against the wall, knocking the breath out of her. She slumped sideways, and Kaya dove away, dodging a downstroke of the knight’s greatsword. He raised his weapon back to a guard, but she’d gotten past him, and turned away to keep running. #emph[Let’s see him keep up with me in that armor.] The main stairs were ahead, a seemingly endless series of elliptical spirals leading up through the heart of Orzhova. The shaft was alive with noise, armor jingling and boots pounding as guards converged. Kaya hit the railing with the knight behind her in hot pursuit and the stairway down filled with a half-dozen soldiers. #emph[This is so, so stupid.] Instead of stopping, she leapt up onto the rail, perching for a moment on the wrought iron, balanced over hundreds of feet of empty space. The knight pulled up short in horror, watching her as she wobbled. Kaya gave him a little wave, then stepped over the edge. She put all her concentration into her hand as she fell, flight after flight of stairway slipping past. There was a trick to this, becoming intangible in just the right ratio and moment to slow her descent by friction with the wall, without simultaneously ripping her hand off by stopping too abruptly. She hadn’t practiced much, because honestly it wasn’t the sort of thing you got to try too often. And the mage’s binding, making every attempt to use her power feel like slogging through thick mud, made it worse. But the alternative was ending up in a very little puddle on the parquet marble floor at the bottom of the stairs, so Kaya managed. Her arm jerked painfully as she gripped each flight to kill her momentum, pain shooting through her shoulder before she let her arm fade into intangibility and slip through the stone to catch the next one. The impact, when it came, was still harder than she would have liked, and something in her knee felt like it popped, followed by a surge of pain. She moved with a limp to the wood-paneled door that led into the lower levels of Orzhova. Limp or no, though, she’d left the guards looking for her behind for the moment. The bottom of the staircase led into the public part of the building, where petitioners and penitents from the outside could come to pray, borrow money, or both. Kaya slipped into a high gallery, wrapped around the central nave of the cathedral, and threaded her way between well-dressed Orzhov priests and functionaries and their ragged supplicants. A few recognized her, in spite of her lack of a guild uniform, and a wave of confused murmuring spread in her wake. #emph[Doesn’t matter.] She shoved her way onto another broad stairway, twisting between curious onlookers, heading for the main door. #emph[I have to get out of here, and wait for this damn binding to wear off. Then . . .] Well, she could work that out later. #emph[For now, ] away#emph[ is the key.] Two more flights down, and she was within sight of the main doors, massive things currently flung wide open. A crowd was forming on either side of them, though, and Kaya could see a couple of knights and a phalanx of guardsmen strung across the archway. #emph[Three guesses who they’re looking for.] She turned, abruptly, and headed in the other direction. #emph[Okay. Stables, first sub-basement. That means down, right?] There was a stairway down, a narrow one, on her right. She took it, passing a few uniformed staff, and emerged into an unfurnished servant’s corridor. Wooden doors let off on either side, but Kaya kept moving, reasoning that the stables had to be adjacent to the street. #emph[If I get close enough, I can just follow the smell.] She was just about to turn a corner when the tramp of booted feet made her freeze. "Get to the main hall!" someone shouted, ahead of her. "On the double!" Kaya threw herself against the nearest door, found it locked, and rebounded. She concentrated hard, griting her teeth, and slipped her hand through the wood, scrabbling on the other side for a latch. Her groping fingers encountered nothing, and she was about to extract herself and run for it when the door gave a click and opened of its own accord. Kaya darted into the darkened space, gratefully, and slammed it behind her just as the sounds of a troop of soldiers passing came from outside. She was in some kind of storeroom. She could smell wax and lamp oil, and the soft fragrance of the incense penitents burned to beg forgiveness for their financial sins. Leaning against the door, waiting for her eyes to adjust to the dim glow seeping underneath it, Kaya struggled for breath. Deep in the gloom, something shifted. "Who’s there?" Kaya raised her daggers and spoke in a harsh whisper. "Shout and I’ll slit your throat." "Some gratitude," a man’s voice said. "After I opened my little hidey-hole to you." "I’m not in a trusting mood." "I imagine not." The shadow of a man shifted in the gloom. "You’ve had a hard day, Kaya." #emph[How—of course.] Kaya’s lip curled. "Bolas." "In the flesh. Or not, in this case. But here to check up on you nonetheless. You have not pleased me of late, you know." "Pleasing you is not my first priority," Kaya said. "But it should be." Bolas’s pawn shifted closer. "I hold the keys to your chains, after all. You could be free of this place, these people." "If I help you destroy Ravnica, you mean." "And what is Ravnica to you? Just another city. Just another job." She could hear the grin in his voice. "These are not #emph[your] people. This guild, these banker-priests. You hate them, don’t you? You can see in the little miseries they inflict a reflection of your own people. To seek power, in search of happiness, and to have the cost repaid with interest over generations." "It is." Kaya hadn’t realized it until that moment, but the old lizard was right. "Then you should be glad of my coming. I will sweep them away like chaff, with all their lies and chains." "And the people who come begging?" Kaya said. "You’ll help them, will you?" "I will." The human voice of Bolas’s pawn acquired just a touch of the dragon’s bass rumble. "So long as they #emph[kneel] ." Kaya shook her head. "It’s not worth it." "Then what? You are a guildmaster on the run from her own guild. You will not survive long, and even if you do, you will perish with the rest when I arrive." "Then I’ll die fighting," Kaya said, straightening up. "But I can do good here, for these people, in the meantime." "And your own people, with their sky broken?" "I’ll find another way," Kaya said. "I never should have made a bargain with you, dragon. I should have known nothing you could offer would be worth the price." "You’re a fool." "Maybe." Kaya sheathed her daggers and eased open the door, the corridor outside now silent. "But I’m my own fool." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The stables were dark, lit by a single guttering lantern, and smelled of a multispecies mélange of dung. Kaya slipped through the doorway, moving cautiously, and spotted a single hooded figure waiting near the lamp. She padded over, hands on her daggers. "Are you the one who sent the note?" she said, when she was close enough. The man jumped, his hood falling back. Kaya recognized him—<NAME>, Teysa’s own assistant. #emph[Not who I was expecting. Though in truth, I don’t know what I was expecting.] "Guildmaster," he said, inclining his head. "I wasn’t sure you were going to make it." "It was touch and go a few times," Kaya admitted. "Teysa’s mages hit me with . . . something." "A binding," Tomik said. "I listened to them plan their attack." "And you tried to warn me," Kaya said. "Not that I’m complaining, but why?" "You are my guildmaster," he said. "It is my duty." "Teysa has been your master for a long time," Kaya said. "I’ve seen the respect you have for her. Even I couldn’t have blamed you for taking her side over a guildmaster you hardly know." "I—" Tomik hesitated. "I believe that Teysa is making a mistake. She is in a very difficult position, and—I would like to protect her." "From who? Me?" "The hierarchs have been pressing her with demands. They fear you will forgive debts on a large scale, and that their wealth will suffer in consequence. They want you out of the Orzhov. If she tries to stand against them, they will crush her, Karlov or no. The system, first of all, defends itself." "I believe it," Kaya said. "Your note said you could help. How?" "If you confront the hierarchs—" Tomik began. Something crunched in the darkness. Kaya whirled, drawing her daggers. Tomik snatched up the lantern and raised it over his head, and she heard his breath catch. The light gleamed on masks made of mangled coins, rank on rank of thrulls, crammed into the stalls and around the outside of the long, empty stables. #emph[There have to be hundreds of them.] Kaya felt sweat trickle down her forehead, and she shifted her grip on her weapons. "I swear," Tomik said under his voice. "I didn’t have anything to do with this." "I believe you," Kaya said grimly. "I’m sure that’ll be a consolation when they’re tearing us both to pieces." "I could . . ." Tomik shook his head. "I have no idea. Do you have a spare weapon?" Silently, Kaya drew a long stiletto from its hidden sheath at the small of her back and handed it over. Tomik looked down at it and adjusted his spectacles with a sad smile. "Better than nothing, I suppose." The thralls closed in. Kaya swallowed hard. Something flashed a brilliant white. One of the stable doors exploded, pieces of burning wood scattering in every direction, accompanied by an ear-splitting boom that rattled dust from the rafters. The blast left a flaming hole leading to the street outside, and outlined against the lights of the city was a tall man in a long coat, with a wild frizz of hair and lightning crawling up and down his arms. "Ral!" Tomik shouted. "Stay put," Ral roared. "Scorchbringers!" Viashino in singed leather poured through the gap, long, clumsy weapons in their hands. As the thrulls turned to face them, gouts of fire jetted out in blinding arcs of orange and red, liquid flame clinging to every surface it touched. Thrull flesh sizzled and charred, and the creatures charged the phalanx of scorchbringers, only to fall in blackened heaps that piled higher and higher. Ral stalked forward, bolts of lightning slashing from his hands to incinerate any thrulls that made it past the curtain of flames. "Come on," he said, the two nearest scorchbringers standing aside to let them pass. "Let’s get out of here." Tomik ran to him, and Kaya followed. She raised an eyebrow as Ral caught the younger man in his arms and kissed him, while the ranks of scorchbringers closed behind them and began to retreat. Fire was spreading fast through the stables, racing across dry straw and old wood. "If I can interrupt," Kaya said, as they backed out onto the street. "Tomik, you were going to tell me you had a way to fix all this." "Oh." Tomik turned away from Ral, cleared his throat, and straightened his spectacles. "Yes. I had a look in the records, you see—" #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)  #linebreak Not quite six hours later, Kaya strode into the main hall of Orzhova, escorted by several ranks of guards and a pair of knights. It was well after midnight, and all the ordinary worshipers were gone. Kaya walked past the empty pews, the silent niches where the bankers met with their penitents. At the head of the room, in front of the great altar, the hierarchs were waiting. Two dozen or so of the most powerful men and women in the Orzhov guild, with Teysa standing in front of them. They were in full regalia, voluminous silks and elaborate jeweled headpieces, staffs topped with crystals and hammered gold masks. Kaya gave them a cold stare, and smiled. "Guildmaster," Teysa said. "I am, I admit, surprised to see you." "It seemed a little impolite to run away from one’s own guild," Kaya said airily. "You are accused of serious crimes," Teysa said. "Are you willing to submit yourself to our authority?" "No," Kaya said. "I don’t think so." "You don’t have a choice," said a bearded man in the front row. "You will do as we command, or you will die, and we will have a #emph[proper] guildmaster." "You are . . . <NAME>, aren’t you?" Kaya said. She closed her eyes and reached for the mass of contracts that weighed her down, the chains wrapped around her soul. One of them led to Gracca, and it took only a moment to sort it out from the others. It was thick and heavy. "I am," Gracca said. "And my family has served the Orzhov for thousands of years. An outsider like you—" "<NAME>," Kaya said, thoughtfully. "Son of Orsov Gracca. Who, in a moment of financial embarrassment, was forced to ask <NAME> for . . . assistance. Which he provided, of course, as a good friend would. Except the understanding was that the Gracca family would support the Karlovs, whenever required." "You are not a Karlov," Gracca said. He’d gone several shades paler. "I am the #emph[heir] to <NAME>. The inheritor of all his contracts and obligations." Kaya smiled wider and gave the chain that connected them a short, sharp tug. "And you are in #emph[breach] ." Gracca gasped and sank to his knees, his gilded staff hitting the floor with a ringing sound and rolling away across the marble. "<NAME> collected obligations like other people might collect fine wine," Kaya said. "<NAME>." As she spoke, she stroked the chains, and each name brought a hitch of breath and a wince from someone in the crowd. "All the great families, in fact. Each bound to support the Karlovs, or their heirs. Each of you in violation of that agreement tonight." She looked around. "No wonder you were so glad to be rid of me." "#emph[I] am not in debt to my grandfather," Teysa said, stepping forward. "No," Kaya said. "You are not." She glanced at the crowd of hierarchs, then at the guards all around, and raised her voice. "Place <NAME> under arrest." For a long moment, nothing happened. Then, ever so subtly, one of the knights turned to face Gracca, who looked around at his colleagues and gave a shaken nod. "You can’t be serious," Teysa said, as the guards closed in around her. "Treat her gently," Kaya said. That was the promise she’d made to Tomik. Teysa glared daggers at her across the room, then turned and strode away, ahead of the guards, not suffering herself to be dragged. The rest of them stood in silence until her footsteps across the marble had faded. "As for the rest of you," Kaya said, turning to the hierarchs again. "I think we should discuss the consequences of breaching your agreements with the Karlovs, and what guarantee I have that you won’t turn on me again." She spread her hands. "After all, under the terms of the original contracts, I am entitled to call in your debts. And with interest, I’m afraid, the amounts are . . . substantial." She grinned like a shark. "So let’s make a deal."
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/new-cm-svg.typ
typst
Apache License 2.0
#set text(font: "New Computer Modern") #image("/files/diagram.svg")
https://github.com/MrHedmad/typst-paper
https://raw.githubusercontent.com/MrHedmad/typst-paper/main/README.md
markdown
# Typst manuscripts A template repo to jumpstart writing typst manuscripts. ## How to use - First, click on the button on the top-right to use this repository as your template. - Second, install [the Typst compiler](https://github.com/typst/typst), and be sure that you can use `typst` from the command line. - Go in the root of the (cloned) project and run: ```bash typst watch src/main.typ target/main.pdf --font-path src/resources/fonts --open ``` This should open your default PDF viewer to preview your document as you type (and save it). The same command above can be found in `./compile` so you can just run that script. You can find the finished, compiled output in `target/main.pdf`. You're done! ### Template information The template is for a pretty standard one-column paper manuscript. You get pretty authors with OrcIDs, acronyms, bibliography, and more. - To add new acronyms, edit the `src/resources/acronyms.typ` file. - To change the bibliography, add them to `src/resources/refs.bib` in bibtex format. - Add images into the `src/resources/images/` directory in any format you like. - To hide the draft box after the abstract, pass `work_in_progress: false` at the start of `main.typ`. ## Font This template bundles and uses by default the Atkinson Hyperlegible font. It follows its own [license](src/resources/fonts/LICENSE), which you can read. It only forbids selling *the font itself*. You are free to do anything you like with a document that uses the font, including selling it or repackaging it. Using the Atkinson Hyperlegible font helps people with partially impaired vision read and enjoy your work. I also find it very pleasing on the eyes. You can read more about the font (and download more copies) at [https://brailleinstitute.org/freefont](https://brailleinstitute.org/freefont)
https://github.com/typst-community/valkyrie
https://raw.githubusercontent.com/typst-community/valkyrie/main/tests/contexts/strict/test.typ
typst
Other
#import "/src/lib.typ" as z #set page(height: 1cm, width: 1cm) #{ let strict-context = z.z-ctx(strict: true) let test-dictionary = ( //string: "world", // number: 1.2, email: "<EMAIL>", ip: "192.168.127.12", ) _ = z.parse( test-dictionary, z.dictionary(( email: z.email(), ip: z.ip(), )), ctx: strict-context, ) }
https://github.com/voXrey/cours-informatique
https://raw.githubusercontent.com/voXrey/cours-informatique/main/typst/ocaml-exceptions.typ
typst
#import "@preview/codly:0.2.1": * #show: codly-init.with() #codly() #set text(font: "Roboto Serif") = Exceptions OCaml <exceptions-ocaml> Ce sont des erreurs, lorsqu’une exception est lancée, cela interrompt tout le programme. - `failwith` lance une exception - `Not_found`, `Invalid_argument`, `Failure`… sont des exceptions On peut définir ses propres exceptions : ```ocaml exception Nadine;; ``` Ce sont des constructeurs ! On peut lancer une exception avec `raise` : ```ocaml raise Nadine;; ``` On peut donner des arguments à nos exceptions : ```ocaml exception Nadine of int;; raise (Nadine 12);; ``` #quote(block: true)[ `Failure` et `Invalid_argument` prennent en argument une #emph[string]. ] En fait, la fonction `failwith` est codée de cette manière : ```ocaml let failwith S = raise (Failure S);; ``` On peut rattraper les exceptions : ```ocaml try: (* instructions renvoyant du 'a *) foo (); .... with (* Ce pattern matching renvoie également du 'a *) | Failure s -> bar () | Nadine s -> nad () ```
https://github.com/TJ-CSCCG/tongji-undergrad-thesis-typst
https://raw.githubusercontent.com/TJ-CSCCG/tongji-undergrad-thesis-typst/main/paddling-tongji-thesis/elements.typ
typst
MIT License
#import "@preview/i-figured:0.2.2" #import "@preview/tablex:0.0.6": cellx, tablex, gridx, hlinex, vlinex, colspanx, rowspanx #import "@preview/algo:0.3.3": algo, i, d, comment, code #import "utils.typ": * #let draw-binding() = { place("|", dx: -1.6cm, dy: 2.3cm) place("|", dx: -1.6cm, dy: 2.9cm) place("|", dx: -1.6cm, dy: 3.5cm) place("|", dx: -1.6cm, dy: 4.1cm) place("|", dx: -1.6cm, dy: 4.7cm) place("|", dx: -1.6cm, dy: 5.3cm) place("|", dx: -1.6cm, dy: 5.9cm) place("|", dx: -1.6cm, dy: 6.5cm) place("|", dx: -1.6cm, dy: 7.1cm) place("|", dx: -1.6cm, dy: 7.7cm) place("装", dx: -1.8cm, dy: 8.3cm) place("|", dx: -1.6cm, dy: 8.9cm) place("|", dx: -1.6cm, dy: 9.5cm) place("|", dx: -1.6cm, dy: 10.1cm) place("|", dx: -1.6cm, dy: 10.7cm) place("|", dx: -1.6cm, dy: 11.3cm) place("订", dx: -1.8cm, dy: 11.9cm) place("|", dx: -1.6cm, dy: 12.5cm) place("|", dx: -1.6cm, dy: 13.1cm) place("|", dx: -1.6cm, dy: 13.7cm) place("|", dx: -1.6cm, dy: 14.3cm) place("|", dx: -1.6cm, dy: 14.9cm) place("线", dx: -1.8cm, dy: 15.5cm) place("|", dx: -1.6cm, dy: 16.1cm) place("|", dx: -1.6cm, dy: 16.7cm) place("|", dx: -1.6cm, dy: 17.3cm) place("|", dx: -1.6cm, dy: 17.9cm) place("|", dx: -1.6cm, dy: 18.5cm) place("|", dx: -1.6cm, dy: 19.1cm) place("|", dx: -1.6cm, dy: 19.7cm) place("|", dx: -1.6cm, dy: 20.3cm) place("|", dx: -1.6cm, dy: 20.9cm) place("|", dx: -1.6cm, dy: 21.5cm) } #let empty-par() = { v(-1.2em) box() } #let make-cover(cover) = align(center)[ #image("figures/tongji.svg", height: 2.25cm) #text( "TONGJI UNIVERSITY", font: font-family.hei, size: font-size.at("-2"), weight: "bold", ) #v(30pt) #text("本科毕业设计(论文)", font: font-family.hei, size: font-size.at("-0")) #v(60pt) #set text(font: font-family.hei, size: font-size.at("-2")) #grid( columns: (5em, auto), gutter: 16pt, ..cover.enumerate().map(((idx, value)) => { set text(size: font-size.at("-2")) if calc.even(idx) { let arr = value.clusters() let k = (4 - arr.len()) / (arr.len() - 1) arr.join([#h(1em * k)]) } else { block( width: 100%, inset: 4pt, stroke: (bottom: 1pt + black), align(center, value), ) } }), ) ] #let make-abstract(title: "", abstract: "", keywords: (), prompt: (), is-english: false) = { align( center, )[ #v(1em) #text(font: font-family.hei, size: font-size.at("-2"), weight: "bold", title) #v(1.5em) ] heading(prompt.at(0), numbering: none, outlined: false) set par(first-line-indent: 2em) text(abstract) v(5mm) set par(first-line-indent: 0em) text(font: font-family.xiaobiaosong, weight: "bold", prompt.at(1)) let keywords-string = if is-english { keywords.join(", ") } else { keywords.join(",") } text(keywords-string) } #let make-outline(title: "目录", depth: 3, indent: true) = { // outline(title: "目录", depth: 3) heading(title, numbering: none, outlined: false) set par(first-line-indent: 0pt, leading: 0.9em) locate( it => { let elements = query(heading.where(outlined: true), it) for el in elements { // Skip headings that are too deep if depth != none and el.level > depth { continue } let el_number = if el.numbering != none { numbering(el.numbering, ..counter(heading).at(el.location())) h(0.5em) } let line = { if indent { let indent-width = if el.level == 1 { 0pt } else if el.level == 2 { 1em } else if el.level == 3 { 4em } else { 0pt } h(indent-width) } link(el.location(), el_number) link(el.location(), el.body) box(width: 1fr, h(0.25em) + box(width: 1fr, repeat[·#h(1pt)]) + h(0.25em)) link(el.location(),str(counter(page).at(el.location()).first())) linebreak() } // link(el.location(), line) line } }, ) } #let heavyrulewidth = .08em #let lightrulewidth = .05em #let cmidrulewidth = .03em #let toprule(stroke: heavyrulewidth) = { hlinex(stroke: stroke) } #let midrule(stroke: lightrulewidth) = { hlinex(stroke: stroke) } #let bottomrule(stroke: heavyrulewidth) = { hlinex(stroke: stroke) } #let cmidrule(start: 0, end: -1, stroke: cmidrulewidth) = { hlinex(start: start, end: end, stroke: stroke) }
https://github.com/DieracDelta/presentations
https://raw.githubusercontent.com/DieracDelta/presentations/master/polylux/book/src/utils/utils.md
markdown
# Utility features Let us have a look at some common use cases you run into as either a theme author or as an end user producing slides and what solutions are provided by Polylux. Specifically, the functions discussed here reside in the `utils` and `logic` modules. They are exported by Polylux so if you (as someone making slides) imported it using ```typ {{#include ../IMPORT.typ}} ``` you can directly invoke them using `utils` and `logic`. As a theme author, you have access to them due to the imports ```typ #import "../logic.typ" #import "../utils/utils.typ" ``` (see previous page).
https://github.com/mumblingdrunkard/mscs-thesis
https://raw.githubusercontent.com/mumblingdrunkard/mscs-thesis/master/src/computer-architecture-fundamentals/memory-and-caching.typ
typst
#import "../utils/utils.typ": * == Interlude: Memory, Caches, and Consistency Models For a processor to perform well, it needs relatively fast access to memory. Main memory technologies like _dynamic random access memory_ (DRAM) have high capacities and generally high bandwidths, which is good, but they also have high _latencies_; the time between requesting data and getting the data back. Even though superscalar processors can finish more than one instruction per cycle, this is only in theory. A good number of instructions within any given program are likely to be memory instructions. Instructions are loaded from memory. Because of this, the effective latency of memory accesses has a huge impact on processor performance. === Caches To reduce latency in accessing main memory, the memory can be placed closer to the core, physically on the same chip. However, this is costly and scales poorly for large capacities. The compromise is to use _caches_ alongside main memory technologies like DRAM. Caches, as a concept, show up everywhere in computing. They are used to store temporary copies of frequently or recently used data in some sort of storage that is faster to access than the main storage. The cached data must eventually be synchronised with the main storage, and changes must somehow be propagated to other copies, giving rise to one of the two hard problems in computer science @bib:two-hard-things. Computer processor caches base themselves on this same idea. Small low-latency memories are placed close to the core and are made to store copies of the data in main memory. This works because applications exhibit _locality_ in memory requests. Data that have been used previously are more likely to be re-used---called _temporal locality_. Programs also exhibit _spatial locality_: data that lie close to previously used data are more likely to be requested in the future. Computer processor caches exploit this by not only fetching the requested datum, but surrounding data as well. Generally, caching is only employed for the address range that covers main memory as it is difficult or impossible to uphold any semblance of sanity while caching accesses with side-effects. === Cache Hierarchies Caches are arranged in hierarchies, with the smallest, fastest caches placed closest to the core while the larger, slower caches are placed further away---sometimes on a different chip entirely. If the processor requests data that cannot be found in the first level of cache, the data will be looked up in lower and lower levels until it is found, possibly all the way out in main memory. The first level of cache is called the L1 cache, or level-1 cache. Each consecutive level is simply numbered one higher than the last. Modern processors have first-, second-, and third-level caches. The last level of cache is appropriately named the last-level cache (LLC). First-level caches are usually exclusive to a single core, but later cache levels are commonly shared between multiple cores in the system. === Split L1 Caches All instructions have to be fetched from memory, and some instructions have to access memory. These two sources of memory requests---instruction fetch and memory access---have very different patterns and behaviours: The stream of requests generated by instruction fetch is very predictable and linear except for where branching occurs, often for one specific size, and is load-only. The instruction fetching circuitry will never try to store an instruction to memory. On the other hand, the stream of requests generated by memory instructions is going to hop back and forth between many different memory locations, may contain store instructions, and access many different sizes of data. To avoid designing a cache that is good for both types of requests, the first-level cache is usually split into a first-level data cache (L1d), and a first-level instruction cache (L1i). This allows implementers to focus on optimising each cache for specific needs. The instruction cache can be optimised for loading consecutive instructions out at a high bandwidth. The data cache can be optimised for accessing differently sized elements at different locations each cycle. === Cache Organisation Caches are organised as a collection of _sets_. When accessing the cache, bits from the address are used to select the specific set for the processor to look in. These bits form the _index_. The data of any given address can only be found within a specific set. Each set is also split into one or more _blocks_ or _lines_. We will refer to them as blocks. Each block contains a number of bytes which are the data being accessed. The lower 6 bits of the address are used to determine which specific bytes of the block are being accessed. This is called the block _offset_. The bits of an address that are not part of the index and offset are part of the _tag_. Each block has a tag. The number of blocks within sets is called the _associativity_. With one block per set, the cache is a _direct-mapped_ cache (each datum has only one possible cache block it can be in). With only one set and all blocks placed within it, the cache is _fully associative_ (each datum can be in any block in the cache). Fully associative caches are expensive to implement as it requires comparing the address tag with the tag of every block in the cache. Direct-mapped caches are simple to implement, but have problems with aliasing where multiple addresses with equal indices, but different tags, will cause each other to be pushed out of the cache to make space for themselves. The compromise is an _n-way_ associative cache, where $n$ is the number of blocks within each set. These caches can store up to $n$ blocks with equal indices but different tags at the same time without pushing any blocks out to make space. When a request is made and the cache does not have the requested datum, the request is said to _miss_ in the cache. The converse of a miss is a _hit_ in the cache. When a miss occurs, the entire block that contains that datum is brought in along with surrounding data. Using larger blocks reduces the amount of meta-data that must be stored per byte, although it requires fetching more data at a time when first missing. === Data Cache Prefetching Naively, data are only brought into caches on-demand. If no previous memory request has been made to any address within a block, a request to that block will always miss. However, the access patterns of memory instructions are predictable. For example: iterating over an array in a loop will generate requests for addresses that increment by some fixed amount. Thus, if one such request starts by accessing the second-to-last byte in a block, then the last one, it is reasonable to assume that the next request will be for the first byte in the next block. Using this information, the cache can begin loading the block before it is even known to be needed---called _prefetching_. === Consistency Models ISA documents generally do not specify how a cache---or any other structures interacting with memory---should behave. Whether a certain implementation is a valid one depends on the memory model of the ISA. Consistency models specify which effective orderings of memory accesses are valid in different scenarios. Explaining the concept in full detail is too great an undertaking, so we have settled for a simple example with two cores: one executing two store instructions, and another executing two load instructions. @lst:ordering-example shows instructions executed on two different cores. $A$ and $B$ are values stored in memory. These values are both set to 0 before execution starts. A consistency model says which possible values Core 2 ($C_2$) can observe for $A$ and $B$, and what the value of one implies about the value of the other. #figure(grid(columns: (auto, ) * 2, inset: 5pt, [ ``` // Core 1 store A 1 store B 1 ``` ], grid.vline(), [ ``` // Core 2 load B load A ``` ]), caption: [Two store instructions and two load instructions executing on different cores] )<lst:ordering-example> The most important thing to recognise about consistency models is that the _observed order_ of memory accesses not necessarily corresponds to the _program order_. The program order is the order in which the instructions appear in the program during correct execution. ==== The Effect of Caching With caching, what might happen is that both the store instructions from Core 1 ($C_1$) finish executing. Then, when $C_2$ performs the load instructions, it uses the newly stored value for $B$, but uses a cached value for $A$, cached before the store instructions took place, possibly ending with the result $A = 0$, $B = 1$. The order of memory operations would appear to be: + $C_2$ load $A$ (sees $A = 0$) + $C_1$ store $A$ 1 + $C_1$ store $B$ 1 + $C_2$ load $B$ (sees $B = 1$) As can be seen here, the order of the load instructions has been swapped. In the program, the load of $B$ went before the load of $A$, but in the observed ordering, they appear in a different order. ==== Different Consistency Models The job of consistency models is to define which orderings are allowed in scenarios like the one above. Consistency models can be divided into two groups: _weak_ and _strong_. Strong models place more restrictions on the possible orderings, while weak models place few restrictions. Strong models arguably "make more sense" and are likely to be a better fit for normal intuition. However, strong models pose a challenge for computer engineers in feasibly implementing them. There is no "best" model#footnote[Besides the venerable DEC Alpha, which has the coolest weak consistency model and allows some abhorrently unintuitive behaviours.], only tradeoffs for computer hardware engineers and computer programmers. An example of a strong consistency model is the _total store order_ (TSO) which says that store instructions from the same core cannot be re-ordered, nor can load instructions. Later load instructions in program order can go ahead of preceding store instructions as long as they don't alias (access the same address). With TSO, the result above would be disallowed as the load of $A$ is seeing an older value of $A$ than the value loaded for $B$. Note that even under TSO, though $C_1$ may complete the store instructions long before $C_2$ performs any load instructions, $C_2$ is still allowed to observe $A = 0, B = 0$ if it can still guarantee that the value of $A$ is as fresh as that of $B$. A stronger ordering like this does give some useful guarantees, however, like $B = 1 ==> A = 1$. Weak consistency models allow much more re-ordering. The weakest possible consistency model only requires that a program executing on a single core behaves _as if_ it were executed fully in order. With strong models, the processor implementation must provide certain guarantees for behaviour. With weak models, more of that responsibility falls on the programmer. Architectures with any strength model must still provide synchronisation primitives for programmers to properly express desired behaviour. A _barrier_ or _fence_ is a normal synchronisation primitive. A _full_ fence is an instruction that prevents any earlier memory operations from being observed after it and any later memory operations being observed before it.
https://github.com/Enter-tainer/typst-preview
https://raw.githubusercontent.com/Enter-tainer/typst-preview/main/docs/editor.typ
typst
MIT License
#import "./book.typ": book-page #import "./templates/gh-page.typ": page-width, is-dark-theme #import "@preview/fontawesome:0.1.0": * #import "@preview/colorful-boxes:1.1.0": * #show: book-page.with(title: "Port Typst-Preview to Other Editors") #show link: underline = Port Typst-Preview to Other Editors Before we start, you should probably read #link("https://enter-tainer.github.io/typst-preview/arch.html")[Typst-Preview Architecture]. In short, to port Typst-Preview to other editors, you need to implement the "VSCode" part. The editor extension should start typst-preview server, and connect to it using websocket. JSON messages are sent between the editor extension and the preview server. The editor extension mainly does these things: + _In memory editing_: The editor extension should send dirty document to the preview server, without saving it to the disk. This is the most important part of the editor extension. With this, Typst-Preview can get the content of the document and render it every time when user types something. + _Source to preview jumping_: This is not necessary, but it's a nice feature to have. With this, the preview panel will be scrolled to the corresponding position when user clicks on the source code. + _Preview to source jumping_: This is quite similar to the previous one. With this, the source code will be scrolled to the corresponding position when user clicks on the preview panel. + _Compile status reporting_: With this, the preview server can report the compile status to the editor extension. The editor extension can show the compile status to the user. + _Outline_: The preview server reports current outline to the editor extension. == In memory editing To implement in memory editing, the preview server implements an overlay virtual file system. This allows adding "memory files" on top of the real file system. The preview server will read the memory files(if present) instead of the real files when rendering the preview. There are three types of messages related to in memory editing: 1. `updateMemoryFiles`: Update the content of the memory files. The `event` field should be set to `updateMemoryFiles`. The `files` field is a map from file path to file content. The file path should be absolute path. This is used when the user types something in the editor. The editor extension should send the dirty document to the preview server. The preview server will update the content of the memory file in the overlay virtual file system. Note that the editor doesn't need to debounce or throttle the `updateMemoryFiles` message. The preview server will only keep the latest `updateMemoryFiles` message. Example: ```json { "event": "updateMemoryFiles", "files": { "/home/mgt/proj/typst-preview/docs/dev.typ": "FULL_CONTENT_OF_THE_FILE", } } ``` 2. `removeMemoryFiles`: Remove the memory files. The `event` field should be set to `removeMemoryFiles`. The `files` field is a list of file paths. The file path should be absolute path. This is used when the user saves the document. The editor extension should send the file path to the preview server. The preview server will remove the memory file in the overlay virtual file system. Therefore, the preview server will read the real file when rendering the preview. Example: ```json { "event": "removeMemoryFiles", "files": [ "/home/mgt/proj/typst-preview/docs/dev.typ", ] } ``` 3. `syncMemoryFiles`: Sync the memory files. The `event` field should be set to `syncMemoryFiles`. The `files` field is a map from file path to file content. The file path should be absolute path. This is used when the preview server starts. The editor extension should send the content of all the dirty files to the preview server. The preview server will discard all previous memory files, and use the memory files in the `syncMemoryFiles` message. This is also used in response to the `SyncEditorChanges` message from the preview server. Example: ```json { "event": "syncMemoryFiles", "files": { "/home/mgt/proj/typst-preview/docs/dev.typ": "FULL_CONTENT_OF_THE_FILE", } } ``` == Source to preview jumping To implement source to preview jumping, the editor extension should send the `SrcToDocJump` message to the preview server. The `event` field should be set to `panelScrollTo`. The `filepath` field is the absolute path of the file. The `line` field is the line number of the file. The `character` field is the character number of the file. The line number and the character number are 0-based. Example: ```json { "event": "panelScrollTo", "filepath": "/home/mgt/proj/typst-preview/docs/dev.typ", "line": 0, "character": 0 } ``` == Preview to source jumping To implement preview to source jumping, the editor extension should listen to the `EditorScrollTo` message from the preview server. The `event` field should be `editorScrollTo`. The `filepath` field is the absolute path of the file. The `start` field is the start position of the selection. The `end` field is the end position of the selection. A `(row, column)` pair is used to represent a position. Both `row` and `column` are 0-based. You can use this information to scroll the editor to the corresponding position. Example: ```json { "event": "editorScrollTo", "filepath": "/home/mgt/proj/typst-preview/docs/dev.typ", "start": [ 9, 2 ], "end": [ 9, 32 ] } ``` == Compile Status Reporting To implement compile status reporting, the editor extension act on `compileStatus` event. The `event` field should be `compileStatus`. The `kind` field is the compile status. The `kind` field can be one of the following values: - `Compiling` - `CompileSuccess` - `CompileError` Example: ```json { "event": "compileStatus", "kind": "Compiling" } ``` == Outline To implement outline reporting, the editor extension should listen to the `outline` event from the preview server. The `event` field should be `outline`. A typical outline looks like this. Note that `page_no` is 1-based. ```json { "event": "outline", "items": [ { "title": "Asymptotic Notation: O", "span": "1fa5c53ef2bf", "position": { "page_no": 1, "x": 70.86625, "y": 70.86625 }, "children": [] }, { "title": "My fabulous talk", "span": "79e192e29ce5", "position": { "page_no": 9, "x": 252.39397, "y": 283.81598 }, "children": [ { "title": "A quiz", "span": "7d0905e0183a", "position": { "page_no": 10, "x": 70.86625, "y": 70.86625 }, "children": [] } ] } ] } ``` == References Messages sent from the editor extension to the preview server, defined in `src/actor/editor.rs`. ```rs #[derive(Debug, Deserialize)] #[serde(tag = "event")] enum ControlPlaneMessage { #[serde(rename = "changeCursorPosition")] ChangeCursorPosition(ChangeCursorPositionRequest), #[serde(rename = "panelScrollTo")] SrcToDocJump(SrcToDocJumpRequest), #[serde(rename = "panelScrollByPosition")] PanelScrollByPosition(PanelScrollByPositionRequest), #[serde(rename = "sourceScrollBySpan")] DocToSrcJumpResolve(DocToSrcJumpResolveRequest), #[serde(rename = "syncMemoryFiles")] SyncMemoryFiles(MemoryFiles), #[serde(rename = "updateMemoryFiles")] UpdateMemoryFiles(MemoryFiles), #[serde(rename = "removeMemoryFiles")] RemoveMemoryFiles(MemoryFilesShort), } ``` Messages sent from the preview server to the editor extension, defined in `src/actor/editor.rs`. ```rs #[derive(Debug, Serialize)] #[serde(tag = "event")] enum ControlPlaneResponse { #[serde(rename = "editorScrollTo")] EditorScrollTo(DocToSrcJumpInfo), #[serde(rename = "syncEditorChanges")] SyncEditorChanges(()), #[serde(rename = "compileStatus")] CompileStatus(CompileStatus), #[serde(rename = "outline")] Outline(Outline), } ```
https://github.com/fredguth/tufte-typst
https://raw.githubusercontent.com/fredguth/tufte-typst/main/tufte_handout_template.typ
typst
#let sidenote(content) = { place(dx: 29em, block( // fill: yellow, breakable: false, width: 14em, content ) ) } #let template( title: none, abstract: none, authors: (), date: datetime.today(), doc, ) = { set page( paper: "a4", margin: (y:9em, left: 5em, right: 23em), header: locate(loc => { if(loc.page() != 1) { set text(font: "EtBb", weight: "semibold", size: 8pt, tracking: 1.1pt, number-type: "old-style", number-width: "tabular") place(right, dy: 8em, dx: 25em)[#upper(title) #h(1em) #text(size:12pt, counter(page).display() )] } }), ) // Paper identification (title, author, date) block( // fill: luma(230), width: 100%+23em-5em, inset: 0pt, radius: 4pt, text(font: "<NAME>", size: 10pt, tracking: 2pt)[ // title #text(size:13pt, upper(title)) // authors // #set par(leading: 1pt, ) #upper(authors.join(", ", last: " and ")) // date #upper(date.display("[month repr:long] [day],[year]")) // abstract #pad(x: 5em, block( // fill: yellow, text(tracking: 0pt, abstract) )) ] ) // Configure headings. set heading(numbering: none, ) show heading: it => locate(loc => { // Find out the final number of the heading counter. let levels = counter(heading).at(loc) set text(16pt, weight: 400) if it.level == 1 [ // We don't want to number of the acknowledgment section. #let is-ack = it.body in ([Acknowledgment], [Acknowledgement]) // #set align(center) #set text(if is-ack { 10pt } else { 13pt }) #set text(style: "italic") #v(18pt, weak: true) #if it.numbering != none and not is-ack { numbering(heading-numbering, ..levels) [.] h(7pt, weak: true) } #it.body #v(16pt, weak: true) ] else if it.level == 2 [ // Second-level headings are run-ins. #set par(first-line-indent: 0pt) #set text(style: "italic", size: 12pt) #v(14pt, weak: true) #if it.numbering != none { numbering(heading-numbering, ..levels) [.] h(7pt, weak: true) } #it.body #v(10pt, weak: true) ] else [ // Third level headings are run-ins too, but different. #if it.level == 3 { numbering(heading-numbering, ..levels) [. ] } _#(it.body):_ ] }) set text(font: "EtBb", weight: "regular", size: 11pt, tracking: 0pt, number-type: "old-style", number-width: "tabular") doc }
https://github.com/SillyFreak/typst-prequery
https://raw.githubusercontent.com/SillyFreak/typst-prequery/main/README.md
markdown
MIT License
# Prequery This package helps extracting metadata for preprocessing from a typst document, for example image URLs for download from the web. Typst compilations are sandboxed: it is not possible for Typst packages, or even just a Typst document itself, to access the "ouside world". This sandboxing of Typst has good reasons. Yet, it is often convenient to trade a bit of security for convenience by weakening it. Prequery helps with that by providing some simple scaffolding for supporting preprocessing of documents. ## Getting Started Here's an example for referencing images from the internet: ```typ #import "@preview/prequery:0.1.0" // toggle this comment or pass `--input prequery-fallback=true` to enable fallback // #prequery.fallback.update(true) #prequery.image( "https://en.wikipedia.org/static/images/icons/wikipedia.png", "assets/wikipedia.png") ``` Using `typst query`, the image URL(s) are extracted from the document: ```sh typst query --input prequery-fallback=true --field value \ main.typ '<web-resource>' ``` This will output the following piece of JSON: ```json [{"url": "https://en.wikipedia.org/static/images/icons/wikipedia.png", "path": "assets/wikipedia.png"}] ``` Which can then be used to download all images to the expected locations. ## Usage See the [manual](docs/manual.pdf) for details.
https://github.com/typst-community/org
https://raw.githubusercontent.com/typst-community/org/main/CONTRIBUTING.md
markdown
### Getting Involved Please open a discussion with the [transfer template](https://github.com/orgs/typst-community/discussions/new?category=transfer-requests).
https://github.com/sicheng1806/typst-book-for-sicheng
https://raw.githubusercontent.com/sicheng1806/typst-book-for-sicheng/main/scr/basic_pkg/table.typ
typst
// 添加了 webtable格式的表格 #let webtable( titleline : 1pt + black, linestroke: gray, columns: (), gutter: (), column-gutter : (), row-gutter : (), fill : none, align : auto, stroke : none, inset : 5pt, ..children ) = { set table(columns: columns,gutter: gutter,column-gutter: column-gutter, row-gutter: row-gutter,stroke: none,align: align,fill:fill,inset:inset) // 获取首行部分 let _col = 0 if type(columns) == int { _col = columns } else { _col = columns.len() } let titles = children.pos().slice(0,_col) let content = children.pos().slice(_col) //---------------------------------------------------------------- stack( table(..titles.map(it => strong(it))), line(length: 100%,stroke:linestroke), table(..content) ) }
https://github.com/xrarch/books
https://raw.githubusercontent.com/xrarch/books/main/xr17032handbook/chapintro.typ
typst
#import "@preview/tablex:0.0.6": tablex, cellx, colspanx, rowspanx = Overview == Introduction XR/17032 is a 32-bit RISC architecture. This document describes it informally and is meant to be used as a reference handbook; it is intended for readers who are already somewhat familiar with computer architecture, or who are at least familiar with computer programming and have good independent research skills. This handbook need not be read in order; the reader is encouraged to skip around as unfamiliar terms appear. A brief description of the architecture follows. == Starting at the beginning... The architecture’s registers and the virtual address space are 32-bit, and 32-bit values are the widest that it can load or store. It has no floating-point operations, and 64-bit wide arithmetic must be synthesized from smaller operations. This architecture is intended to be relatively simple; it includes only 60 instructions. In the interest of supporting fancy operating system design, XR/17032 supports paged virtual addressing, as well as a distinction between user mode and kernel mode. Like most RISCs, memory accesses must be aligned to their size or else they will incur an exception, and, likewise, all instructions are 32 bits (4 bytes) wide and must be aligned to 32-bit boundaries. The architecture is little-endian. == Registers The architecture defines 32 general purpose registers (GPRs), usable by any instruction that takes register operands. They are each 32 bits wide. The zeroth GPR, zero, almost always reads as zero and ignores writes. This is a common RISC design tactic that simplifies the encoding of many instructions. A table of GPRs follows: #set align(center) #tablex( columns: (auto, auto, auto), align: horizon, repeat-header: true, cellx([ #set text(fill: white) #set align(center) *\#* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *Name* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *ABI Assignment* ], fill: rgb(0,0,0,255)), "0", "zero", "Always reads as zero, ignores writes.", "1-6", "t0-5", "6 temporary registers (caller-saved).", "7-10", "a0-3", "First 4 arguments and return values (caller-saved).", "11-28", "s0-17", "18 local variable registers (callee-saved).", "29", "tp", "Thread-local storage pointer.", "30", "sp", "Stack pointer.", "31", "lr", "Link register." ) #set align(left) == Control Registers <controlregs> The architecture defines 32 control registers (CRs). They are each 32 bits wide. As their name suggests, CRs are used to control the behavior of the processor, and are therefore only accessible via the privileged kernel mode instructions *MTCR* and *MFCR*. A table containing a summary of all defined control registers follows: #set align(center) #tablex( columns: (auto, auto, auto), align: horizon, repeat-header: true, cellx([ #set text(fill: white) #set align(center) *\#* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *Name* ], fill: rgb(0,0,0,255)), cellx([ #set text(fill: white) #set align(center) *Function* ], fill: rgb(0,0,0,255)), "0", "RS", "Current and previous processor mode bits.", "1", "WHAMI", "Unique ID for this processor in a multiprocessor system.", "5", "EB", "Exception block base address.", "6", "EPC", "Program counter before the last exception.", "7", "EBADADDR", "Bad address that triggered the last exception (if relevant).", "9", "TBMISSADDR", "Bad address that triggered the last TB miss exception.", "10", "TBPC", "Program counter before the last TB miss exception.", "11-15", "SCRATCH0-4", "Permanently reserved for arbitrary system software usage.", "16", "ITBPTE", "Lower 32 bits of an entry to insert in the ITB. Causes ITB insertion when written.", "17", "ITBTAG", [Upper 32 bits of an entry to insert in the ITB. Doubles as the current *ASID*, and *VPN* of the last virtual address that missed in the ITB.], "18", "ITBINDEX", "Next replacement index for the ITB.", "19", "ITBCTRL", "Causes ITB invalidations when written.", "20", "ICACHECTRL", "Yields Icache size parameters when read, causes Icache invalidations when written.", "21", "ITBADDR", "Pre-calculated virtual PTE address for use upon ITB miss.", "24", "DTBPTE", "Lower 32 bits of an entry to insert in the DTB. Causes DTB insertion when written.", "25", "DTBTAG", [Upper 32 bits of an entry to insert in the DTB. Doubles as the current *ASID*, and *VPN* of the last virtual address that missed in the DTB.], "26", "DTBINDEX", "Next replacement index for the DTB.", "27", "DTBCTRL", "Causes DTB invalidations when written.", "28", "DCACHECTRL", "Yields Dcache size parameters when read, causes Dcache invalidations when written.", "29", "DTBADDR", "Pre-calculated virtual PTE address for use upon DTB miss.", ) _Any absent CR numbers have undefined behavior if read or written._ #set align(left) See @control for a more detailed description of each control register. == Reset When the processor is reset, for instance during a reboot or a power-on, the *RS* control register is cleared to zero. The processor is thus forced to kernel mode, virtual address translation is disabled, exposing the physical address space. The program counter is set to the address 0xFFFE1000, with the idea that a boot ROM is located at 0xFFFE0000 and is followed by an initial 4096 byte exception block.
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/layout/inline/overhang.typ
typst
// Test micro-typographical shenanigans. --- overhang --- // Test hanging punctuation. // TODO: This test was broken at some point. #set page(width: 130pt, margin: 15pt) #set par(justify: true, linebreaks: "simple") #set text(size: 9pt) #rect(inset: 0pt, fill: rgb(0, 0, 0, 0), width: 100%)[ This is a little bit of text that builds up to hang-ing hyphens and dash---es and then, you know, some punctuation in the margin. ] // Test hanging punctuation with RTL. #set text(lang: "he", font: ("PT Sans", "Noto Serif Hebrew")) בנייה נכונה של משפטים ארוכים דורשת ידע בשפה. אז בואו נדבר על מזג האוויר. --- overhang-lone --- // Test that lone punctuation doesn't overhang into the margin. #set page(margin: 0pt) #set align(end) #set text(dir: rtl) :
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/ref_02.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // // = First <foo> // = Second <foo> // // // Error: 1-5 label `<foo>` occurs multiple times in the document // @foo
https://github.com/Toniolo-Marco/git-for-dummies
https://raw.githubusercontent.com/Toniolo-Marco/git-for-dummies/main/book/inviter.typ
typst
= Inviter Come detto in precedenza è impensabile aggiungere manualmente tutti all'organizzazione, per questo abbiamo crato una piccola web app che utilizzando le api di GitHub consente di invitare automaticamente le persone@gh-inviter, è distribuita sotto forma di container, quindi potete eseguirla su un server con Linux e Docker oppure, se avete un altro sistema operativo potete usare una delle release. Per iniziare recatevi alla pagina #link("https://github.com/FrostWalk/GitHub-Inviter")[GitHub] dell'inviter, qui troverete, oltre al codice e al `docker-compose.yml` da usare per hostare l'applicazione tutte le istruzioni e parametri per adattarlo alla vostra organizzazione. Vi consiglio vivamente di usare il docker-compose.yml per hostarlo, se invece volete usare uno degli eseguibili dovrete inittare manualmente le variabili d'ambiente coi config. D'ora in avanti assumeremo che avete scelto di usare Docker, aprite quindi il file `docker-compose.yml` e procedete a modificarlo come segue. == Abilitare i fine-grained personal access tokens Di default GitHub non consente di creare token per le organizzazioni, per poter abilitare la creazione dei token: aprite la home page della vostra organizzazione, poi *Settings*, scorrete fino a *Third-party Access* e in fine *Personal access tokens*. Ora selezionate *Allow access via fine-grained personal access tokens* e su *Continue* finchè non esuarite per tutti e 5 i bullet point. Ora potrete creare i fine grained access token. == Creare il token La prima cosa da fare è procurarsi il token da usare per l'inviter, per farlo andate su una pagina qualunque di GitHub, poi cliccate sulla vostra *foto profilo* in alto a destra e poi su *settings*, scorrete ora in basso fino a che non trovate *developer settings* e cliccateci sopra, dal menù laterale selezionate *Personal access tokens* e poi *Fine-grained tokens* e in fine *Generate new token*. Assegnategli il nome che preferite, per esempio: `Inviter`, impostate un'expire date di almeno 90 giorni (ci saranno sempre dei ritardatari), la cosa importante è *impostare come Resource owner l'organizzazione* e non il vostro account, come repository access lasciate pure Public Repositories (read-only), infatti questo token non avrà bisogno di accedere a nessun repository. Scorrete ora nella sezione *Oragnization permissions* e cliccateci sopra e tra i vari permessi e come access di *Members* selezionate *Read and write* e in fine cliccate su *Generate token* in fondo alla pagina. Copiate ora il token ottenuto, che avrà un formato simile a questo `github_pat_11AMMG6ZI0xOGq83w37...` e incollatelo dopo l'uguale nel docker-compose.yml nel campo `GITHUB_TOKEN`. == Nome dell'organizzazione e del gruppo La vostra organizzazione probabilmente si chiamera qualcosa come `Advanced programming 20..` e il gruppo qualcosa come `Members` per trovare il nome corretto da utilzzare con l'applicazione è sufficente recarsi nella pagina dell'organizzazione, e poi in Teams e in fine cliccare sul gruppo in cui finiranno i membri invitati, se adesso guardate l'url e dopo la parte `https://github.com/orgs/` troverete entrambi i parametri. Ad esempio se l'organizzazione si chiama `Advanced-Programming-2023` e il gruppo si chiama `Group Members`, otterrete che l'ulr contiente `Advanced-Programming-2023/teams/group-members` i parametri sono quindi `Advanced-Programming-2023` per `GITHUB_ORG_NAME` e `group-members` per `GITHUB_GROUP_NAME`. == Invite code Questo parametro è opzionale ma vi consigliamo di impostarlo, si tratta dello SHA256 (encodato come stringa esadecimale) di una stringa a vostra scelta, da condividere con la classe e da inserire assieme al propio username, questo codice uguale per tutti, è una misura di sicurezza per evitare che persone a caso o bot si invitino nell'organizzazione. Per generare l'hash: - On Linux: - open a terminal - type: `echo -n 'invite code' | sha256sum` where #emph[invite code] is your string *leave the '* - On any other: - go #link("https://emn178.github.io/online-tools/sha256.html")[here] == Compose e parametri opzionali A questo punto in vostro `docker-compose.yml` assomiglierà a qualcosa tipo: ```yaml services: github-inviter: container_name: github-inviter image: ghcr.io/frostwalk/github-inviter:latest environment: - GITHUB_ORG_NAME=your-org-name - GITHUB_TOKEN=your-github-token - GITHUB_GROUP_NAME=your-team-name - INVITE_CODE_HASH=your-invite-code - HTTP_PORT=80 # Uncomment the following lines if you want to use TLS # - HTTPS_PORT=443 # - TLS_CERT=/path/to/your/cert.pem # - TLS_KEY=/path/to/your/key.pem ports: - "80:80" # Uncomment the following lines if you want to use TLS # - "443:443" # volumes: # - /path/to/your/cert.pem:/path/to/your/cert.pem:ro # - /path/to/your/key.pem:/path/to/your/key.pem:ro ``` non vi resta che aprire un terminale nella stessa cartella e dare i seguenti comandi: - `docker compose up -d` - e poi per verificare che tutto funzioni `docker compose logs` - il risultato dovrebbe essere: `Server is running on http://127.0.0.1:80` L'ideale ora sarebbe esporre l'inviter dietro ad un reverse proxy il quale dovrebbe occuparsi di https, se invece volete esporlo direttamente vi consigliamo caldamene configurare tls tramite gli appositi parametri, seguite il README.md sulla pagina GitHub per tutte le informazioni.
https://github.com/OrangeX4/typst-pinit
https://raw.githubusercontent.com/OrangeX4/typst-pinit/main/simple-arrow.typ
typst
MIT License
/// Draw a simple arrow on the page with optional settings, implemented by [`polygon`](https://typst.app/docs/reference/visualize/polygon/). /// /// - `fill`: [`color`] &mdash; The fill color for the arrow. /// - `stroke`: [`stroke`] &mdash; The stroke for the arrow. /// - `start`: [`point`] &mdash; The starting point of the arrow. /// - `end`: [`point`] &mdash; The ending point of the arrow. /// - `thickness`: [`length`] &mdash; The thickness of the arrow. /// - `arrow-width`: [`int` or `float`] &mdash; The width of the arrowhead relative to thickness. /// - `arrow-height`: [`int` or `float`] &mdash; The height of the arrowhead relative to thickness. /// - `inset`: [`int` or `float`] &mdash; The inset value for the arrowhead relative to thickness. /// - `tail`: [`array`] &mdash; The tail settings for the arrow. #let simple-arrow( fill: black, stroke: 0em, start: (0em, 0em), end: (3em, 0em), thickness: 0.12em, arrow-width: 4, arrow-height: 4, inset: 0.5, tail: (), ) = { let _arrow-width = arrow-width * thickness let _arrow-height = arrow-height * thickness let _inset = inset * thickness let start-x = start.at(0) let start-y = start.at(1) let end-x = end.at(0) let end-y = end.at(1) let _dx = end-x - start-x if _dx.em != 0 and (_dx - _dx.em * 1em).pt() != 0 { panic("The x-coordinate must only use pt units or only em units.") } let _dy = end-y - start-y if _dy.em != 0 and (_dy - _dy.em * 1em).pt() != 0 { panic("The y-coordinate must only use pt units or only em units.") } let _angle = if _dx.em != 0 or _dy.em != 0 { calc.atan2(_dx.em, _dy.em) } else { calc.atan2(_dx.pt(), _dy.pt()) } let _ht = 0.5 * thickness let _hw = 0.5 * _arrow-width let _c = calc.cos(_angle) let _s = calc.sin(_angle) polygon( fill: fill, stroke: stroke, ..tail, (start-x - _s * _ht, start-y + _c * _ht), ( start-x + _dx - _s * _ht - _c * (_arrow-height - _inset), start-y + _dy + _c * _ht - _s * (_arrow-height - _inset), ), (start-x + _dx - _s * _hw - _c * _arrow-height, start-y + _dy + _c * _hw - _s * _arrow-height), (end-x, end-y), (start-x + _dx + _s * _hw - _c * _arrow-height, start-y + _dy - _c * _hw - _s * _arrow-height), ( start-x + _dx + _s * _ht - _c * (_arrow-height - _inset), start-y + _dy - _c * _ht - _s * (_arrow-height - _inset), ), (start-x + _s * _ht, start-y - _c * _ht), ) } /// Draw a double arrow on the page with optional settings, implemented by [`polygon`](https://typst.app/docs/reference/visualize/polygon/). /// /// Author: [PaulS](https://github.com/psads-git) /// /// - `fill`: [`color`] &mdash; The fill color for the arrow. /// - `stroke`: [`stroke`] &mdash; The stroke for the arrow. /// - `start`: [`point`] &mdash; The starting point of the arrow. /// - `end`: [`point`] &mdash; The ending point of the arrow. /// - `thickness`: [`length`] &mdash; The thickness of the arrow. /// - `arrow-width`: [`int` or `float`] &mdash; The width of the arrowhead relative to thickness. /// - `arrow-height`: [`int` or `float`] &mdash; The height of the arrowhead relative to thickness. /// - `inset`: [`int` or `float`] &mdash; The inset value for the arrowhead relative to thickness. /// - `tail`: [`array`] &mdash; The tail settings for the arrow. #let double-arrow( fill: black, stroke: 0em, start: (0em, 0em), end: (3em, 0em), thickness: 0.12em, arrow-width: 4, arrow-height: 4, inset: 0.5, tail: (), ) = { let _arrow-width = arrow-width * thickness let _arrow-height = arrow-height * thickness let _inset = inset * thickness let start-x = start.at(0) let start-y = start.at(1) let end-x = end.at(0) let end-y = end.at(1) let _dx = end-x - start-x if _dx.em != 0 and (_dx - _dx.em * 1em).pt() != 0 { panic("The x-coordinate must only use pt units or only em units.") } let _dy = end-y - start-y if _dy.em != 0 and (_dy - _dy.em * 1em).pt() != 0 { panic("The y-coordinate must only use pt units or only em units.") } let _angle = if _dx.em != 0 or _dy.em != 0 { calc.atan2(_dx.em, _dy.em) } else { calc.atan2(_dx.pt(), _dy.pt()) } let _ht = 0.5 * thickness let _hw = 0.5 * _arrow-width let _c = calc.cos(_angle) let _s = calc.sin(_angle) polygon( fill: fill, stroke: stroke, ..tail, // First arrowhead points (start-x + _s * _ht + _c * (_arrow-height - _inset), start-y - _c * _ht + _s * (_arrow-height - _inset)), (start-x + _s * _hw + _c * _arrow-height, start-y - _c * _hw + _s * _arrow-height), (start-x, start-y), (start-x - _s * _hw + _c * _arrow-height, start-y + _c * _hw + _s * _arrow-height), (start-x - _s * _ht + _c * (_arrow-height - _inset), start-y + _c * _ht + _s * (_arrow-height - _inset)), // Shaft points (start-x + _dx - _s * _ht - _c * (_arrow-height - _inset), start-y + _dy + _c * _ht - _s * (_arrow-height - _inset)), // Second arrowhead points (start-x + _dx - _s * _hw - _c * _arrow-height, start-y + _dy + _c * _hw - _s * _arrow-height), (end-x, end-y), (start-x + _dx + _s * _hw - _c * _arrow-height, start-y + _dy - _c * _hw - _s * _arrow-height), (start-x + _dx + _s * _ht - _c * (_arrow-height - _inset), start-y + _dy - _c * _ht - _s * (_arrow-height - _inset)), // Close the polygon back to the shaft (start-x + _s * _ht, start-y - _c * _ht), ) }
https://github.com/cherrypiejam/typst-cv-template
https://raw.githubusercontent.com/cherrypiejam/typst-cv-template/main/cv-template.typ
typst
#let conf( name: str, contact: dictionary, research-interests: "", education: array, awards: array, body, ) = { set page( paper: "us-letter", ) [ = #name #line(length: 100%) ] show heading: it => { smallcaps(it.body) linebreak() } let columns = (1fr, 5fr) // Contact Information if contact.len() != 0 { grid( columns: columns, rows: (auto), [ === Contact Information ], for (k, v) in contact [ #k.replace(regex("^\w"), m => upper(m.text)): #v \ ], ) } // Research Interests if research-interests.len() != 0 { grid( columns: columns, rows: (auto), [ === Research Interests ], [ Operating Systems ], ) } // Education if education.len() != 0 { let text = for e in education { let degrees = for (n, d, aux) in e.degrees { if d.len() == 1 [ - #n #box(width: 1fr, repeat[.]) #d.at(0).display("[month repr:short]. [year repr:full]") #for a in aux [ - #a ] ] else if d.len() == 2 and d.at(1) == datetime.today() [ - #n #box(width: 1fr, repeat[.]) #d.at(0).display("[month repr:short]. [year repr:full]") - Present #for a in aux [ - #a ] ] else if d.len() == 2 [ - #n #box(width: 1fr, repeat[.]) #d.at(0).display("[month repr:short]. [year repr:full]") - #d.at(1).display("[month repr:short]. [year repr:full]") #for a in aux [ - #a ] ] else { panic("Bad date range of a program") } } [ *#e.institute*, #e.location \ #degrees ] } grid( columns: columns, rows: (auto), [ === Education ], text, ) } // Honors and awards if awards.len() != 0 { grid( columns: columns, rows: (auto), [ === Honors and Awards ], for (n, d) in awards [ #n #box(width: 1fr, repeat[.]) #d.display("[month repr:short]. [year repr:full]") \ ], ) } // Create additional sections let sections = () let current_section = none for item in body.children.slice( body.children.position(x => x.func() == heading)) { if item.func() == heading { if current_section != none { sections.push(current_section) } current_section = (item, []) } else { current_section.at(1) = current_section.at(1) + item } } sections.push(current_section) for (h, c) in sections { grid( columns: columns, rows: (auto), h, c, ) } }
https://github.com/Az-21/typst-components
https://raw.githubusercontent.com/Az-21/typst-components/main/style/1.0.0/Colors/m3.typ
typst
Creative Commons Zero v1.0 Universal
#let material3 = ( red: ( light: ( primary: rgb("#8F4C38"), onPrimary: rgb("#FFFFFF"), primaryContainer: rgb("#FFDBD1"), onPrimaryContainer: rgb("#3A0B01"), secondary: rgb("#77574E"), onSecondary: rgb("#FFFFFF"), secondaryContainer: rgb("#FFDBD1"), onSecondaryContainer: rgb("#2C150F"), tertiary: rgb("#6C5D2F"), onTertiary: rgb("#FFFFFF"), tertiaryContainer: rgb("#F5E1A7"), onTertiaryContainer: rgb("#231B00"), error: rgb("#BA1A1A"), onError: rgb("#FFFFFF"), errorContainer: rgb("#FFDAD6"), onErrorContainer: rgb("#410002"), background: rgb("#FFF8F6"), onBackground: rgb("#231917"), surface: rgb("#FFF8F6"), onSurface: rgb("#231917"), surfaceVariant: rgb("#F5DED8"), onSurfaceVariant: rgb("#53433F"), outline: rgb("#85736E"), outlineVariant: rgb("#D8C2BC"), scrim: rgb("#000000"), inverseSurface: rgb("#392E2B"), inverseOnSurface: rgb("#FFEDE8"), inversePrimary: rgb("#FFB5A0"), surfaceDim: rgb("#E8D6D2"), surfaceBright: rgb("#FFF8F6"), surfaceContainerLowest: rgb("#FFFFFF"), surfaceContainerLow: rgb("#FFF1ED"), surfaceContainer: rgb("#FCEAE5"), surfaceContainerHigh: rgb("#F7E4E0"), surfaceContainerHighest: rgb("#F1DFDA"), primaryMediumContrast: rgb("#6D311F"), onPrimaryMediumContrast: rgb("#FFFFFF"), primaryContainerMediumContrast: rgb("#AA614C"), onPrimaryContainerMediumContrast: rgb("#FFFFFF"), secondaryMediumContrast: rgb("#593C34"), onSecondaryMediumContrast: rgb("#FFFFFF"), secondaryContainerMediumContrast: rgb("#8F6D63"), onSecondaryContainerMediumContrast: rgb("#FFFFFF"), tertiaryMediumContrast: rgb("#4E4216"), onTertiaryMediumContrast: rgb("#FFFFFF"), tertiaryContainerMediumContrast: rgb("#837442"), onTertiaryContainerMediumContrast: rgb("#FFFFFF"), errorMediumContrast: rgb("#8C0009"), onErrorMediumContrast: rgb("#FFFFFF"), errorContainerMediumContrast: rgb("#DA342E"), onErrorContainerMediumContrast: rgb("#FFFFFF"), backgroundMediumContrast: rgb("#FFF8F6"), onBackgroundMediumContrast: rgb("#231917"), surfaceMediumContrast: rgb("#FFF8F6"), onSurfaceMediumContrast: rgb("#231917"), surfaceVariantMediumContrast: rgb("#F5DED8"), onSurfaceVariantMediumContrast: rgb("#4F3F3B"), outlineMediumContrast: rgb("#6C5B57"), outlineVariantMediumContrast: rgb("#897772"), scrimMediumContrast: rgb("#000000"), inverseSurfaceMediumContrast: rgb("#392E2B"), inverseOnSurfaceMediumContrast: rgb("#FFEDE8"), inversePrimaryMediumContrast: rgb("#FFB5A0"), surfaceDimMediumContrast: rgb("#E8D6D2"), surfaceBrightMediumContrast: rgb("#FFF8F6"), surfaceContainerLowestMediumContrast: rgb("#FFFFFF"), surfaceContainerLowMediumContrast: rgb("#FFF1ED"), surfaceContainerMediumContrast: rgb("#FCEAE5"), surfaceContainerHighMediumContrast: rgb("#F7E4E0"), surfaceContainerHighestMediumContrast: rgb("#F1DFDA"), primaryHighContrast: rgb("#431104"), onPrimaryHighContrast: rgb("#FFFFFF"), primaryContainerHighContrast: rgb("#6D311F"), onPrimaryContainerHighContrast: rgb("#FFFFFF"), secondaryHighContrast: rgb("#341C15"), onSecondaryHighContrast: rgb("#FFFFFF"), secondaryContainerHighContrast: rgb("#593C34"), onSecondaryContainerHighContrast: rgb("#FFFFFF"), tertiaryHighContrast: rgb("#2B2100"), onTertiaryHighContrast: rgb("#FFFFFF"), tertiaryContainerHighContrast: rgb("#4E4216"), onTertiaryContainerHighContrast: rgb("#FFFFFF"), errorHighContrast: rgb("#4E0002"), onErrorHighContrast: rgb("#FFFFFF"), errorContainerHighContrast: rgb("#8C0009"), onErrorContainerHighContrast: rgb("#FFFFFF"), backgroundHighContrast: rgb("#FFF8F6"), onBackgroundHighContrast: rgb("#231917"), surfaceHighContrast: rgb("#FFF8F6"), onSurfaceHighContrast: rgb("#000000"), surfaceVariantHighContrast: rgb("#F5DED8"), onSurfaceVariantHighContrast: rgb("#2E211D"), outlineHighContrast: rgb("#4F3F3B"), outlineVariantHighContrast: rgb("#4F3F3B"), scrimHighContrast: rgb("#000000"), inverseSurfaceHighContrast: rgb("#392E2B"), inverseOnSurfaceHighContrast: rgb("#FFFFFF"), inversePrimaryHighContrast: rgb("#FFE7E1"), surfaceDimHighContrast: rgb("#E8D6D2"), surfaceBrightHighContrast: rgb("#FFF8F6"), surfaceContainerLowestHighContrast: rgb("#FFFFFF"), surfaceContainerLowHighContrast: rgb("#FFF1ED"), surfaceContainerHighContrast: rgb("#FCEAE5"), surfaceContainerHighHighContrast: rgb("#F7E4E0"), surfaceContainerHighestHighContrast: rgb("#F1DFDA"), ), dark: ( primary: rgb("#FFB5A0"), onPrimary: rgb("#561F0F"), primaryContainer: rgb("#723523"), onPrimaryContainer: rgb("#FFDBD1"), secondary: rgb("#E7BDB2"), onSecondary: rgb("#442A22"), secondaryContainer: rgb("#5D4037"), onSecondaryContainer: rgb("#FFDBD1"), tertiary: rgb("#D8C58D"), onTertiary: rgb("#3B2F05"), tertiaryContainer: rgb("#534619"), onTertiaryContainer: rgb("#F5E1A7"), error: rgb("#FFB4AB"), onError: rgb("#690005"), errorContainer: rgb("#93000A"), onErrorContainer: rgb("#FFDAD6"), background: rgb("#1A110F"), onBackground: rgb("#F1DFDA"), surface: rgb("#1A110F"), onSurface: rgb("#F1DFDA"), surfaceVariant: rgb("#53433F"), onSurfaceVariant: rgb("#D8C2BC"), outline: rgb("#A08C87"), outlineVariant: rgb("#53433F"), scrim: rgb("#000000"), inverseSurface: rgb("#F1DFDA"), inverseOnSurface: rgb("#392E2B"), inversePrimary: rgb("#8F4C38"), surfaceDim: rgb("#1A110F"), surfaceBright: rgb("#423734"), surfaceContainerLowest: rgb("#140C0A"), surfaceContainerLow: rgb("#231917"), surfaceContainer: rgb("#271D1B"), surfaceContainerHigh: rgb("#322825"), surfaceContainerHighest: rgb("#3D322F"), primaryMediumContrast: rgb("#FFBBA7"), onPrimaryMediumContrast: rgb("#310700"), primaryContainerMediumContrast: rgb("#CB7C65"), onPrimaryContainerMediumContrast: rgb("#000000"), secondaryMediumContrast: rgb("#ECC1B6"), onSecondaryMediumContrast: rgb("#26100A"), secondaryContainerMediumContrast: rgb("#AE887E"), onSecondaryContainerMediumContrast: rgb("#000000"), tertiaryMediumContrast: rgb("#DDCA91"), onTertiaryMediumContrast: rgb("#1D1600"), tertiaryContainerMediumContrast: rgb("#A0905C"), onTertiaryContainerMediumContrast: rgb("#000000"), errorMediumContrast: rgb("#FFBAB1"), onErrorMediumContrast: rgb("#370001"), errorContainerMediumContrast: rgb("#FF5449"), onErrorContainerMediumContrast: rgb("#000000"), backgroundMediumContrast: rgb("#1A110F"), onBackgroundMediumContrast: rgb("#F1DFDA"), surfaceMediumContrast: rgb("#1A110F"), onSurfaceMediumContrast: rgb("#FFF9F8"), surfaceVariantMediumContrast: rgb("#53433F"), onSurfaceVariantMediumContrast: rgb("#DCC6C0"), outlineMediumContrast: rgb("#B39E99"), outlineVariantMediumContrast: rgb("#927F7A"), scrimMediumContrast: rgb("#000000"), inverseSurfaceMediumContrast: rgb("#F1DFDA"), inverseOnSurfaceMediumContrast: rgb("#322825"), inversePrimaryMediumContrast: rgb("#743624"), surfaceDimMediumContrast: rgb("#1A110F"), surfaceBrightMediumContrast: rgb("#423734"), surfaceContainerLowestMediumContrast: rgb("#140C0A"), surfaceContainerLowMediumContrast: rgb("#231917"), surfaceContainerMediumContrast: rgb("#271D1B"), surfaceContainerHighMediumContrast: rgb("#322825"), surfaceContainerHighestMediumContrast: rgb("#3D322F"), primaryHighContrast: rgb("#FFF9F8"), onPrimaryHighContrast: rgb("#000000"), primaryContainerHighContrast: rgb("#FFBBA7"), onPrimaryContainerHighContrast: rgb("#000000"), secondaryHighContrast: rgb("#FFF9F8"), onSecondaryHighContrast: rgb("#000000"), secondaryContainerHighContrast: rgb("#ECC1B6"), onSecondaryContainerHighContrast: rgb("#000000"), tertiaryHighContrast: rgb("#FFFAF6"), onTertiaryHighContrast: rgb("#000000"), tertiaryContainerHighContrast: rgb("#DDCA91"), onTertiaryContainerHighContrast: rgb("#000000"), errorHighContrast: rgb("#FFF9F9"), onErrorHighContrast: rgb("#000000"), errorContainerHighContrast: rgb("#FFBAB1"), onErrorContainerHighContrast: rgb("#000000"), backgroundHighContrast: rgb("#1A110F"), onBackgroundHighContrast: rgb("#F1DFDA"), surfaceHighContrast: rgb("#1A110F"), onSurfaceHighContrast: rgb("#FFFFFF"), surfaceVariantHighContrast: rgb("#53433F"), onSurfaceVariantHighContrast: rgb("#FFF9F8"), outlineHighContrast: rgb("#DCC6C0"), outlineVariantHighContrast: rgb("#DCC6C0"), scrimHighContrast: rgb("#000000"), inverseSurfaceHighContrast: rgb("#F1DFDA"), inverseOnSurfaceHighContrast: rgb("#000000"), inversePrimaryHighContrast: rgb("#4D1909"), surfaceDimHighContrast: rgb("#1A110F"), surfaceBrightHighContrast: rgb("#423734"), surfaceContainerLowestHighContrast: rgb("#140C0A"), surfaceContainerLowHighContrast: rgb("#231917"), surfaceContainerHighContrast: rgb("#271D1B"), surfaceContainerHighHighContrast: rgb("#322825"), surfaceContainerHighestHighContrast: rgb("#3D322F"), ), ), green: ( light: ( primary: rgb("#4C662B"), onPrimary: rgb("#FFFFFF"), primaryContainer: rgb("#CDEDA3"), onPrimaryContainer: rgb("#102000"), secondary: rgb("#586249"), onSecondary: rgb("#FFFFFF"), secondaryContainer: rgb("#DCE7C8"), onSecondaryContainer: rgb("#151E0B"), tertiary: rgb("#386663"), onTertiary: rgb("#FFFFFF"), tertiaryContainer: rgb("#BCECE7"), onTertiaryContainer: rgb("#00201E"), error: rgb("#BA1A1A"), onError: rgb("#FFFFFF"), errorContainer: rgb("#FFDAD6"), onErrorContainer: rgb("#410002"), background: rgb("#F9FAEF"), onBackground: rgb("#1A1C16"), surface: rgb("#F9FAEF"), onSurface: rgb("#1A1C16"), surfaceVariant: rgb("#E1E4D5"), onSurfaceVariant: rgb("#44483D"), outline: rgb("#75796C"), outlineVariant: rgb("#C5C8BA"), scrim: rgb("#000000"), inverseSurface: rgb("#2F312A"), inverseOnSurface: rgb("#F1F2E6"), inversePrimary: rgb("#B1D18A"), surfaceDim: rgb("#DADBD0"), surfaceBright: rgb("#F9FAEF"), surfaceContainerLowest: rgb("#FFFFFF"), surfaceContainerLow: rgb("#F3F4E9"), surfaceContainer: rgb("#EEEFE3"), surfaceContainerHigh: rgb("#E8E9DE"), surfaceContainerHighest: rgb("#E2E3D8"), primaryMediumContrast: rgb("#314A12"), onPrimaryMediumContrast: rgb("#FFFFFF"), primaryContainerMediumContrast: rgb("#617D3F"), onPrimaryContainerMediumContrast: rgb("#FFFFFF"), secondaryMediumContrast: rgb("#3C462F"), onSecondaryMediumContrast: rgb("#FFFFFF"), secondaryContainerMediumContrast: rgb("#6E785E"), onSecondaryContainerMediumContrast: rgb("#FFFFFF"), tertiaryMediumContrast: rgb("#1A4A47"), onTertiaryMediumContrast: rgb("#FFFFFF"), tertiaryContainerMediumContrast: rgb("#4F7D79"), onTertiaryContainerMediumContrast: rgb("#FFFFFF"), errorMediumContrast: rgb("#8C0009"), onErrorMediumContrast: rgb("#FFFFFF"), errorContainerMediumContrast: rgb("#DA342E"), onErrorContainerMediumContrast: rgb("#FFFFFF"), backgroundMediumContrast: rgb("#F9FAEF"), onBackgroundMediumContrast: rgb("#1A1C16"), surfaceMediumContrast: rgb("#F9FAEF"), onSurfaceMediumContrast: rgb("#1A1C16"), surfaceVariantMediumContrast: rgb("#E1E4D5"), onSurfaceVariantMediumContrast: rgb("#404439"), outlineMediumContrast: rgb("#5D6155"), outlineVariantMediumContrast: rgb("#787C70"), scrimMediumContrast: rgb("#000000"), inverseSurfaceMediumContrast: rgb("#2F312A"), inverseOnSurfaceMediumContrast: rgb("#F1F2E6"), inversePrimaryMediumContrast: rgb("#B1D18A"), surfaceDimMediumContrast: rgb("#DADBD0"), surfaceBrightMediumContrast: rgb("#F9FAEF"), surfaceContainerLowestMediumContrast: rgb("#FFFFFF"), surfaceContainerLowMediumContrast: rgb("#F3F4E9"), surfaceContainerMediumContrast: rgb("#EEEFE3"), surfaceContainerHighMediumContrast: rgb("#E8E9DE"), surfaceContainerHighestMediumContrast: rgb("#E2E3D8"), primaryHighContrast: rgb("#142700"), onPrimaryHighContrast: rgb("#FFFFFF"), primaryContainerHighContrast: rgb("#314A12"), onPrimaryContainerHighContrast: rgb("#FFFFFF"), secondaryHighContrast: rgb("#1C2511"), onSecondaryHighContrast: rgb("#FFFFFF"), secondaryContainerHighContrast: rgb("#3C462F"), onSecondaryContainerHighContrast: rgb("#FFFFFF"), tertiaryHighContrast: rgb("#002725"), onTertiaryHighContrast: rgb("#FFFFFF"), tertiaryContainerHighContrast: rgb("#1A4A47"), onTertiaryContainerHighContrast: rgb("#FFFFFF"), errorHighContrast: rgb("#4E0002"), onErrorHighContrast: rgb("#FFFFFF"), errorContainerHighContrast: rgb("#8C0009"), onErrorContainerHighContrast: rgb("#FFFFFF"), backgroundHighContrast: rgb("#F9FAEF"), onBackgroundHighContrast: rgb("#1A1C16"), surfaceHighContrast: rgb("#F9FAEF"), onSurfaceHighContrast: rgb("#000000"), surfaceVariantHighContrast: rgb("#E1E4D5"), onSurfaceVariantHighContrast: rgb("#21251C"), outlineHighContrast: rgb("#404439"), outlineVariantHighContrast: rgb("#404439"), scrimHighContrast: rgb("#000000"), inverseSurfaceHighContrast: rgb("#2F312A"), inverseOnSurfaceHighContrast: rgb("#FFFFFF"), inversePrimaryHighContrast: rgb("#D6F7AC"), surfaceDimHighContrast: rgb("#DADBD0"), surfaceBrightHighContrast: rgb("#F9FAEF"), surfaceContainerLowestHighContrast: rgb("#FFFFFF"), surfaceContainerLowHighContrast: rgb("#F3F4E9"), surfaceContainerHighContrast: rgb("#EEEFE3"), surfaceContainerHighHighContrast: rgb("#E8E9DE"), surfaceContainerHighestHighContrast: rgb("#E2E3D8"), ), dark: ( primary: rgb("#B1D18A"), onPrimary: rgb("#1F3701"), primaryContainer: rgb("#354E16"), onPrimaryContainer: rgb("#CDEDA3"), secondary: rgb("#BFCBAD"), onSecondary: rgb("#2A331E"), secondaryContainer: rgb("#404A33"), onSecondaryContainer: rgb("#DCE7C8"), tertiary: rgb("#A0D0CB"), onTertiary: rgb("#003735"), tertiaryContainer: rgb("#1F4E4B"), onTertiaryContainer: rgb("#BCECE7"), error: rgb("#FFB4AB"), onError: rgb("#690005"), errorContainer: rgb("#93000A"), onErrorContainer: rgb("#FFDAD6"), background: rgb("#12140E"), onBackground: rgb("#E2E3D8"), surface: rgb("#12140E"), onSurface: rgb("#E2E3D8"), surfaceVariant: rgb("#44483D"), onSurfaceVariant: rgb("#C5C8BA"), outline: rgb("#8F9285"), outlineVariant: rgb("#44483D"), scrim: rgb("#000000"), inverseSurface: rgb("#E2E3D8"), inverseOnSurface: rgb("#2F312A"), inversePrimary: rgb("#4C662B"), surfaceDim: rgb("#12140E"), surfaceBright: rgb("#383A32"), surfaceContainerLowest: rgb("#0C0F09"), surfaceContainerLow: rgb("#1A1C16"), surfaceContainer: rgb("#1E201A"), surfaceContainerHigh: rgb("#282B24"), surfaceContainerHighest: rgb("#33362E"), primaryMediumContrast: rgb("#B5D58E"), onPrimaryMediumContrast: rgb("#0C1A00"), primaryContainerMediumContrast: rgb("#7D9A59"), onPrimaryContainerMediumContrast: rgb("#000000"), secondaryMediumContrast: rgb("#C4CFB1"), onSecondaryMediumContrast: rgb("#101907"), secondaryContainerMediumContrast: rgb("#8A9579"), onSecondaryContainerMediumContrast: rgb("#000000"), tertiaryMediumContrast: rgb("#A4D4D0"), onTertiaryMediumContrast: rgb("#001A19"), tertiaryContainerMediumContrast: rgb("#6B9995"), onTertiaryContainerMediumContrast: rgb("#000000"), errorMediumContrast: rgb("#FFBAB1"), onErrorMediumContrast: rgb("#370001"), errorContainerMediumContrast: rgb("#FF5449"), onErrorContainerMediumContrast: rgb("#000000"), backgroundMediumContrast: rgb("#12140E"), onBackgroundMediumContrast: rgb("#E2E3D8"), surfaceMediumContrast: rgb("#12140E"), onSurfaceMediumContrast: rgb("#FBFCF0"), surfaceVariantMediumContrast: rgb("#44483D"), onSurfaceVariantMediumContrast: rgb("#C9CCBE"), outlineMediumContrast: rgb("#A1A497"), outlineVariantMediumContrast: rgb("#818578"), scrimMediumContrast: rgb("#000000"), inverseSurfaceMediumContrast: rgb("#E2E3D8"), inverseOnSurfaceMediumContrast: rgb("#282B24"), inversePrimaryMediumContrast: rgb("#364F17"), surfaceDimMediumContrast: rgb("#12140E"), surfaceBrightMediumContrast: rgb("#383A32"), surfaceContainerLowestMediumContrast: rgb("#0C0F09"), surfaceContainerLowMediumContrast: rgb("#1A1C16"), surfaceContainerMediumContrast: rgb("#1E201A"), surfaceContainerHighMediumContrast: rgb("#282B24"), surfaceContainerHighestMediumContrast: rgb("#33362E"), primaryHighContrast: rgb("#F4FFDF"), onPrimaryHighContrast: rgb("#000000"), primaryContainerHighContrast: rgb("#B5D58E"), onPrimaryContainerHighContrast: rgb("#000000"), secondaryHighContrast: rgb("#F4FFDF"), onSecondaryHighContrast: rgb("#000000"), secondaryContainerHighContrast: rgb("#C4CFB1"), onSecondaryContainerHighContrast: rgb("#000000"), tertiaryHighContrast: rgb("#EAFFFC"), onTertiaryHighContrast: rgb("#000000"), tertiaryContainerHighContrast: rgb("#A4D4D0"), onTertiaryContainerHighContrast: rgb("#000000"), errorHighContrast: rgb("#FFF9F9"), onErrorHighContrast: rgb("#000000"), errorContainerHighContrast: rgb("#FFBAB1"), onErrorContainerHighContrast: rgb("#000000"), backgroundHighContrast: rgb("#12140E"), onBackgroundHighContrast: rgb("#E2E3D8"), surfaceHighContrast: rgb("#12140E"), onSurfaceHighContrast: rgb("#FFFFFF"), surfaceVariantHighContrast: rgb("#44483D"), onSurfaceVariantHighContrast: rgb("#F9FCED"), outlineHighContrast: rgb("#C9CCBE"), outlineVariantHighContrast: rgb("#C9CCBE"), scrimHighContrast: rgb("#000000"), inverseSurfaceHighContrast: rgb("#E2E3D8"), inverseOnSurfaceHighContrast: rgb("#000000"), inversePrimaryHighContrast: rgb("#1A3000"), surfaceDimHighContrast: rgb("#12140E"), surfaceBrightHighContrast: rgb("#383A32"), surfaceContainerLowestHighContrast: rgb("#0C0F09"), surfaceContainerLowHighContrast: rgb("#1A1C16"), surfaceContainerHighContrast: rgb("#1E201A"), surfaceContainerHighHighContrast: rgb("#282B24"), surfaceContainerHighestHighContrast: rgb("#33362E"), ), ), blue: ( light: ( primary: rgb("#415F91"), onPrimary: rgb("#FFFFFF"), primaryContainer: rgb("#D6E3FF"), onPrimaryContainer: rgb("#001B3E"), secondary: rgb("#565F71"), onSecondary: rgb("#FFFFFF"), secondaryContainer: rgb("#DAE2F9"), onSecondaryContainer: rgb("#131C2B"), tertiary: rgb("#705575"), onTertiary: rgb("#FFFFFF"), tertiaryContainer: rgb("#FAD8FD"), onTertiaryContainer: rgb("#28132E"), error: rgb("#BA1A1A"), onError: rgb("#FFFFFF"), errorContainer: rgb("#FFDAD6"), onErrorContainer: rgb("#410002"), background: rgb("#F9F9FF"), onBackground: rgb("#191C20"), surface: rgb("#F9F9FF"), onSurface: rgb("#191C20"), surfaceVariant: rgb("#E0E2EC"), onSurfaceVariant: rgb("#44474E"), outline: rgb("#74777F"), outlineVariant: rgb("#C4C6D0"), scrim: rgb("#000000"), inverseSurface: rgb("#2E3036"), inverseOnSurface: rgb("#F0F0F7"), inversePrimary: rgb("#AAC7FF"), surfaceDim: rgb("#D9D9E0"), surfaceBright: rgb("#F9F9FF"), surfaceContainerLowest: rgb("#FFFFFF"), surfaceContainerLow: rgb("#F3F3FA"), surfaceContainer: rgb("#EDEDF4"), surfaceContainerHigh: rgb("#E7E8EE"), surfaceContainerHighest: rgb("#E2E2E9"), primaryMediumContrast: rgb("#234373"), onPrimaryMediumContrast: rgb("#FFFFFF"), primaryContainerMediumContrast: rgb("#5875A8"), onPrimaryContainerMediumContrast: rgb("#FFFFFF"), secondaryMediumContrast: rgb("#3A4354"), onSecondaryMediumContrast: rgb("#FFFFFF"), secondaryContainerMediumContrast: rgb("#6C7588"), onSecondaryContainerMediumContrast: rgb("#FFFFFF"), tertiaryMediumContrast: rgb("#523A58"), onTertiaryMediumContrast: rgb("#FFFFFF"), tertiaryContainerMediumContrast: rgb("#876B8C"), onTertiaryContainerMediumContrast: rgb("#FFFFFF"), errorMediumContrast: rgb("#8C0009"), onErrorMediumContrast: rgb("#FFFFFF"), errorContainerMediumContrast: rgb("#DA342E"), onErrorContainerMediumContrast: rgb("#FFFFFF"), backgroundMediumContrast: rgb("#F9F9FF"), onBackgroundMediumContrast: rgb("#191C20"), surfaceMediumContrast: rgb("#F9F9FF"), onSurfaceMediumContrast: rgb("#191C20"), surfaceVariantMediumContrast: rgb("#E0E2EC"), onSurfaceVariantMediumContrast: rgb("#40434A"), outlineMediumContrast: rgb("#5C5F67"), outlineVariantMediumContrast: rgb("#787A83"), scrimMediumContrast: rgb("#000000"), inverseSurfaceMediumContrast: rgb("#2E3036"), inverseOnSurfaceMediumContrast: rgb("#F0F0F7"), inversePrimaryMediumContrast: rgb("#AAC7FF"), surfaceDimMediumContrast: rgb("#D9D9E0"), surfaceBrightMediumContrast: rgb("#F9F9FF"), surfaceContainerLowestMediumContrast: rgb("#FFFFFF"), surfaceContainerLowMediumContrast: rgb("#F3F3FA"), surfaceContainerMediumContrast: rgb("#EDEDF4"), surfaceContainerHighMediumContrast: rgb("#E7E8EE"), surfaceContainerHighestMediumContrast: rgb("#E2E2E9"), primaryHighContrast: rgb("#00214A"), onPrimaryHighContrast: rgb("#FFFFFF"), primaryContainerHighContrast: rgb("#234373"), onPrimaryContainerHighContrast: rgb("#FFFFFF"), secondaryHighContrast: rgb("#192232"), onSecondaryHighContrast: rgb("#FFFFFF"), secondaryContainerHighContrast: rgb("#3A4354"), onSecondaryContainerHighContrast: rgb("#FFFFFF"), tertiaryHighContrast: rgb("#301A35"), onTertiaryHighContrast: rgb("#FFFFFF"), tertiaryContainerHighContrast: rgb("#523A58"), onTertiaryContainerHighContrast: rgb("#FFFFFF"), errorHighContrast: rgb("#4E0002"), onErrorHighContrast: rgb("#FFFFFF"), errorContainerHighContrast: rgb("#8C0009"), onErrorContainerHighContrast: rgb("#FFFFFF"), backgroundHighContrast: rgb("#F9F9FF"), onBackgroundHighContrast: rgb("#191C20"), surfaceHighContrast: rgb("#F9F9FF"), onSurfaceHighContrast: rgb("#000000"), surfaceVariantHighContrast: rgb("#E0E2EC"), onSurfaceVariantHighContrast: rgb("#21242B"), outlineHighContrast: rgb("#40434A"), outlineVariantHighContrast: rgb("#40434A"), scrimHighContrast: rgb("#000000"), inverseSurfaceHighContrast: rgb("#2E3036"), inverseOnSurfaceHighContrast: rgb("#FFFFFF"), inversePrimaryHighContrast: rgb("#E5ECFF"), surfaceDimHighContrast: rgb("#D9D9E0"), surfaceBrightHighContrast: rgb("#F9F9FF"), surfaceContainerLowestHighContrast: rgb("#FFFFFF"), surfaceContainerLowHighContrast: rgb("#F3F3FA"), surfaceContainerHighContrast: rgb("#EDEDF4"), surfaceContainerHighHighContrast: rgb("#E7E8EE"), surfaceContainerHighestHighContrast: rgb("#E2E2E9"), ), dark: ( primary: rgb("#AAC7FF"), onPrimary: rgb("#0A305F"), primaryContainer: rgb("#284777"), onPrimaryContainer: rgb("#D6E3FF"), secondary: rgb("#BEC6DC"), onSecondary: rgb("#283141"), secondaryContainer: rgb("#3E4759"), onSecondaryContainer: rgb("#DAE2F9"), tertiary: rgb("#DDBCE0"), onTertiary: rgb("#3F2844"), tertiaryContainer: rgb("#573E5C"), onTertiaryContainer: rgb("#FAD8FD"), error: rgb("#FFB4AB"), onError: rgb("#690005"), errorContainer: rgb("#93000A"), onErrorContainer: rgb("#FFDAD6"), background: rgb("#111318"), onBackground: rgb("#E2E2E9"), surface: rgb("#111318"), onSurface: rgb("#E2E2E9"), surfaceVariant: rgb("#44474E"), onSurfaceVariant: rgb("#C4C6D0"), outline: rgb("#8E9099"), outlineVariant: rgb("#44474E"), scrim: rgb("#000000"), inverseSurface: rgb("#E2E2E9"), inverseOnSurface: rgb("#2E3036"), inversePrimary: rgb("#415F91"), surfaceDim: rgb("#111318"), surfaceBright: rgb("#37393E"), surfaceContainerLowest: rgb("#0C0E13"), surfaceContainerLow: rgb("#191C20"), surfaceContainer: rgb("#1D2024"), surfaceContainerHigh: rgb("#282A2F"), surfaceContainerHighest: rgb("#33353A"), primaryMediumContrast: rgb("#B1CBFF"), onPrimaryMediumContrast: rgb("#001634"), primaryContainerMediumContrast: rgb("#7491C7"), onPrimaryContainerMediumContrast: rgb("#000000"), secondaryMediumContrast: rgb("#C2CBE0"), onSecondaryMediumContrast: rgb("#0D1626"), secondaryContainerMediumContrast: rgb("#8891A5"), onSecondaryContainerMediumContrast: rgb("#000000"), tertiaryMediumContrast: rgb("#E1C0E5"), onTertiaryMediumContrast: rgb("#230E29"), tertiaryContainerMediumContrast: rgb("#A487A9"), onTertiaryContainerMediumContrast: rgb("#000000"), errorMediumContrast: rgb("#FFBAB1"), onErrorMediumContrast: rgb("#370001"), errorContainerMediumContrast: rgb("#FF5449"), onErrorContainerMediumContrast: rgb("#000000"), backgroundMediumContrast: rgb("#111318"), onBackgroundMediumContrast: rgb("#E2E2E9"), surfaceMediumContrast: rgb("#111318"), onSurfaceMediumContrast: rgb("#FBFAFF"), surfaceVariantMediumContrast: rgb("#44474E"), onSurfaceVariantMediumContrast: rgb("#C8CAD4"), outlineMediumContrast: rgb("#A0A3AC"), outlineVariantMediumContrast: rgb("#80838C"), scrimMediumContrast: rgb("#000000"), inverseSurfaceMediumContrast: rgb("#E2E2E9"), inverseOnSurfaceMediumContrast: rgb("#282A2F"), inversePrimaryMediumContrast: rgb("#294878"), surfaceDimMediumContrast: rgb("#111318"), surfaceBrightMediumContrast: rgb("#37393E"), surfaceContainerLowestMediumContrast: rgb("#0C0E13"), surfaceContainerLowMediumContrast: rgb("#191C20"), surfaceContainerMediumContrast: rgb("#1D2024"), surfaceContainerHighMediumContrast: rgb("#282A2F"), surfaceContainerHighestMediumContrast: rgb("#33353A"), primaryHighContrast: rgb("#FBFAFF"), onPrimaryHighContrast: rgb("#000000"), primaryContainerHighContrast: rgb("#B1CBFF"), onPrimaryContainerHighContrast: rgb("#000000"), secondaryHighContrast: rgb("#FBFAFF"), onSecondaryHighContrast: rgb("#000000"), secondaryContainerHighContrast: rgb("#C2CBE0"), onSecondaryContainerHighContrast: rgb("#000000"), tertiaryHighContrast: rgb("#FFF9FA"), onTertiaryHighContrast: rgb("#000000"), tertiaryContainerHighContrast: rgb("#E1C0E5"), onTertiaryContainerHighContrast: rgb("#000000"), errorHighContrast: rgb("#FFF9F9"), onErrorHighContrast: rgb("#000000"), errorContainerHighContrast: rgb("#FFBAB1"), onErrorContainerHighContrast: rgb("#000000"), backgroundHighContrast: rgb("#111318"), onBackgroundHighContrast: rgb("#E2E2E9"), surfaceHighContrast: rgb("#111318"), onSurfaceHighContrast: rgb("#FFFFFF"), surfaceVariantHighContrast: rgb("#44474E"), onSurfaceVariantHighContrast: rgb("#FBFAFF"), outlineHighContrast: rgb("#C8CAD4"), outlineVariantHighContrast: rgb("#C8CAD4"), scrimHighContrast: rgb("#000000"), inverseSurfaceHighContrast: rgb("#E2E2E9"), inverseOnSurfaceHighContrast: rgb("#000000"), inversePrimaryHighContrast: rgb("#002959"), surfaceDimHighContrast: rgb("#111318"), surfaceBrightHighContrast: rgb("#37393E"), surfaceContainerLowestHighContrast: rgb("#0C0E13"), surfaceContainerLowHighContrast: rgb("#191C20"), surfaceContainerHighContrast: rgb("#1D2024"), surfaceContainerHighHighContrast: rgb("#282A2F"), surfaceContainerHighestHighContrast: rgb("#33353A"), ), ), )
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/tracking-spacing-05.typ
typst
Other
// Test word spacing relative to the font's space width. #set text(spacing: 50% + 1pt) This is tight.
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/text/shift.typ
typst
// Test sub- and superscript shifts. --- sub-super --- #table( columns: 3, [Typo.], [Fallb.], [Synth], [x#super[1]], [x#super[5n]], [x#super[2 #box(square(size: 6pt))]], [x#sub[1]], [x#sub[5n]], [x#sub[2 #box(square(size: 6pt))]], ) --- sub-super-non-typographic --- #set super(typographic: false, baseline: -0.25em, size: 0.7em) n#super[1], n#sub[2], ... n#super[N] --- super-underline --- #set underline(stroke: 0.5pt, offset: 0.15em) #underline[The claim#super[\[4\]]] has been disputed. \ The claim#super[#underline[\[4\]]] has been disputed. \ It really has been#super(box(text(baseline: 0pt, underline[\[4\]]))) \
https://github.com/oliversssf2/do-math
https://raw.githubusercontent.com/oliversssf2/do-math/main/test.typ
typst
#set page("us-letter") The equation $Q = rho A v + C$ defines the glacial flow rate. $E[x] = $
https://github.com/1939323749/typst-zuotiben
https://raw.githubusercontent.com/1939323749/typst-zuotiben/main/main.typ
typst
#let bookname = "25竟成计组做题本 " #let format(string) = { let res = () let matches = string.matches(regex("(<sup>([\d\w+-]+)</sup>)")) + string.matches(regex("(<sub>([\d\w+-]+)</sub>)")) + string.matches(regex("(<code>([\w\W]+)</code>)")) let start = 0 matches = matches.sorted( key: (x) => x.start ) for match in matches { res.push(string.slice(start, match.start)) start = match.end res.push(string.slice(match.start,match.end)) } if matches.len() > 0 { res.push(string.slice(matches.at(matches.len()-1).end)) } else { return string } let content = () for r in res { if r.contains("<sup>") { content.push(super(r.replace("<sup>","").replace("</sup>",""))) } else if r.contains("<sub>") { content.push(sub(r.replace("<sub>","").replace("</sub>",""))) } else if r.contains("<code>") { content.push(raw(r.replace("<code>","").replace("</code>",""),lang: "c",block: true)) } else { content.push(r) } } return content.join("") } #let content(question,total_page,page_num) = page( "a4", fill: rgb("#282c34"), flipped: true, margin: (top: 0pt, left: 0pt, right: 0pt), footer: [ #set align( center ) #set text( fill: rgb("#abb2bf"), ) #page_num / #total_page ], )[ #rect( width: 100%, fill: rgb("#32363e"), )[ #set text( size: 20pt, fill: rgb("#abb2bf"), ) #align( left )[ #bookname #h(1fr) #question.chapter ] ] #pad( left: 30pt, )[ #set text( size: 24pt, fill: rgb("#abb2bf") ) #question.id. #format(question.question) #if question.image != ""{ align(center)[ #let image_src = question.image #image( image_src, width: 40% ) ] } #pad( left: 16pt, top: -40pt, )[ #set text(size: 18pt, top-edge: 20pt) #for option in question.options [ \ #format(option) ] ] ] ] #let data = json("data.json") #let total_page = data.len() #for question in data [ #content(question,total_page,data.position((x)=>x.question==question.question)+1) ]
https://github.com/mem-courses/calculus
https://raw.githubusercontent.com/mem-courses/calculus/main/note-1/5.积分.typ
typst
#import "../template.typ": * #show: project.with( course: "Calculus I", course_fullname: "Calculus (A) I", course_code: "821T0150", semester: "Autumn-Winter 2023", title: "Note #5: 积分", authors: ( ( name: "memset0", email: "<EMAIL>", id: "3230104585", ), ), date: "December 10, 2023", ) #set par(first-line-indent: 0em) #let def(x) = text("【" + x + "】", weight: "bold") #let deft(x) = text("【" + x + "】", weight: "bold", fill: rgb("#FFFFFF")) #let defas = sp + math.attach(math.upright("="), tl: "", t: "def", tr: "") + sp = 不定积分 == 基本积分表 1. $int 1 dx = int dx = x + C$ 2. $int x^alpha dx = display(1/(alpha+1)) x^(alpha+1) + C, sp (alpha != -1,sp alpha in CC)$ #warning[ 注意 $alpha!=-1$ 的限制,否则应为下一种情况. ] 3. $int 1 / x dx = ln |x| + C$ #warning[ 注意到 $display((ln(-x))' = ((-x)')/(-x) = -1/(-x) = 1/x)$,所以此处应有绝对值. ] 4. $int a^x dx = display((a^x)/(ln a)) + C,sp (a>0,sp a != 1,sp a in CC)$ 5. $int e^x dx = e^x + C$ 6. $int display(1/(1+x^2)) dx = arctan x + C "或" -arccot x + C$ 7. $int display(1/sqrt(1-x^2)) dx = arcsin x + C "或" -arccos x + C$ 8. $int sin x dx = - cos x + C$ 9. $int cos x dx = sin x + C$ 10. $int sec^2 x dx = tan x + C$ 11. $int csc^2 x dx = -cot x + C$ 12. $int sec x tan x dx = sec x + C$ 13. $int csc x cot x dx = -csc x + C$ 14. $int sinh x dx = cosh x + C$ 15. $int cosh x dx = sinh x + C$ #note[ 这一部分来源于三角函数的微分公式. ] 16. $int tan x dx = - ln |cos x| + C$ 17. $int cot x dx = ln |sin x| + C$ 18. $int sec x dx = ln |sec x + tan x| + C$ 19. $int csc x dx = ln |csc x - cot x| + C$ #proof[ 求 $int sec x dx$: #def[解法一] $ int sec x dx &= int (cos x) / (cos^2 x) dx = int (dif sin x) / (1-sin^2 x) = 1 / 2 int (1 / (1+sin x) + 1 / (1-sin x)) dif sin x\ &= 1 / 2 ln(ln|1 + sin x| - ln|1 - sin x|) + C = 1 / 2 ln |(1+sin x) / (1-sin x)| + C $ #def[解法二] $ int sec x dx = int (sec x (sec x + tan x)) / (sec x + tan x) dx = int (sec^2 x + sec x tan x) / (sec x + tan x) dx = ln |sec x + tan x| + C $ ] == 不定积分的性质 根据不定积分的定义,有 #def[性质1]$dif/dx int f(x) dx = f(x)$ 或 $dif int f(x) dx = f(x) dx$ #def[性质2]$int f'(x) dx = f(x) + C$ 或 $int dif f(x) = f(x) + C$ #def[性质3]若 $f(x)$,$g(x)$ 的原函数都存在,则 $int (f(x) pm g(x)) dx = int f(x) dx + int g(x) dx$. #def[性质4]若 $f(x)$ 的原函数存在,则 $int alpha f(x) dx = alpha int f(x) dx,sp (alpha != 0,sp alpha in CC)$. #def[推论1]若函数 $f_1 (x),f_2 (x),dots.c,f_m (x)$ 的原函数存在,$k_1,k_2,dots.c,k_m$ 均不为 $0$ 且是常数,那么 $ int sum_(i=0)^m k_i f_i (x) dx = sum_(i=1)^m k_i int f_i (x) dx $ 这又被称为不定积分的 *线性运算法则*. == 不定积分的计算方法 === 第一换元法(凑微分法) ==== 三角函数积分常用方法 1. 分项积分:利用积化和差、分式分项、$1 = sin^2 x + cos^2 x,sp tan^2 x + 1 = sec^2 x$ 等方法统一变量. 2. 降低幂次:利用倍角公式,如:$cos^2 x = 1/2 (1 + cos 2x),sp sin^2 x = 1/2 (1 - cos 2x)$. 3. 统一函数:利用三角公式、配元换元等方法. #def[例1]求:$display(int sec^6 x dx)$ #proof[ $ int sec^6 x dx &= int (tan^2 x + 1)^2 sec^2 x dx = int (tan^4 x + 2 tan^2 x + 1)^2 dif(tan x)\ &= 1 / 5 tan^5 x + 2 / 3 tan^3 x + tan x + C $ ] ==== 有理函数积分常用方法 1. 万能凑幂法:$display(cases( display(int f(x^n) x^(n-1) dx = 1/n int f(x^n) dif x^n), display(int f(x^n) 1/x dx = 1/n int f(x^n) 1/(x^n) dif x^n), ))$. 2. 对分母因式分解后化成多个小分式分别处理. #def[例2]求:$display(int (dx)/(x^2 + a^2))$. #proof[ $ int (dx) / (x^2+a^2) = 1 / (a^2) int (dx) / ((x / a)^2 + 1) = 1 / a int (dif(x/a)) / ((x / a)^2 + 1) = 1 / a arctan(x/a) + C $ ] #def[例3]求:$display(int (dx)/(x^2 - a^2))$. #proof[ $ int (dx) / (x^2-a^2) &= int 1 / (2a) ((x+a) - (x-a)) / ((x+a)(x-a)) dx = 1 / (2a) (int (dif(x-a)) / (x-a) - int (dif(x+a)) / (x+a))\ &= 1 / (2a) (ln|x-a| - ln|x+a|) + C $ ] === 第二换元法 常用代换: 1. $sqrt(a^2 - x^2) => "令 " x = a cos t$,$sqrt(x^2 + a^2) => "令 " x = a tan t$,$sqrt(x^2 - a^2) => "令 " x = a csc t$.可以脱去根号. #def[例4]求:$int sqrt(a^2 - x^2) dx sp (a>0)$. #proof[ 令 $display(x = a sin t\,sp t in (-pi/2,pi/2))$,则 $ sqrt(a^2 - x^2) = sqrt(a^2 - a^2 sin^2 t) = a cos t quad quad dx = a cos t dt $ $ => "原式" &= int a cos t a cos t dt = a^2 int cos^2 t dt = a^2 (t / 2 + (sin 2t) / 4) + C\ &= a^2 / 2 arcsin x / a + 1 / 2 x sqrt(a^2 - x^2) + C\ $ ] #def[例5]求:$display(int (dx)/sqrt(x^2 + a^2)) sp (a>0)$. #proof[ 令 $display(x = a tan t\,sp t in (-pi/2,pi/2))$,则 $ sqrt(x^2 + a^2) = sqrt(a^2 tan^23 t + a^2) = a sec t quad quad quad dx = a sec^2 t dt $ $ => "原式" &= int (a sec^2 t) / (a sec t) dt = int sec t dt = ln |sec + tan t| + C_1\ &= ln |(sqrt(x^2 + a^2) + x) / a| + C_1 = ln (x + sqrt(x^2 + a^2)) + C quad (C = C_1 - ln a) $ ] #def[例6]求:$display(int dx / sqrt(x^2 - a^2)) sp (a > 0)$. #proof[ 当 $x>a$ 时,令 $x = a sec t,sp t in display((0, pi/2))$,则 $ sqrt(x^2 - a^2) = sqrt(a^2 sec^2 t - a^2) = a tan t quad quad quad dx = a sec t tan t dt $ $ => "原式" = int (a sec t tan t) / (a tan t) dt = int sec t dt = ln |sec t + tan t| + C_1 = ln |x + sqrt(x^2 - a^2)| + C $ 当 $x< -a$ 时,令 $x = -u$,则 $ "原式" &= - int du / sqrt(u^2 - a^2) = - ln |-x + sqrt(x^2 - a^2)| + C = - ln |(a^2) / (-x - sqrt(x^2 - a^2))| + C\ &= ln |x + sqrt(x^2 - a^2)| + C $ 综上,$display(int dx / sqrt(x^2 - a^2)) = ln |x + sqrt(x^2 - a^2)| + C sp (a>0)$. ] === 分部积分法 $ int u dif v = u v - int v dif u $ #def[例7]求:$int sqrt(x^2 + a^2) dx sp (a>0)$. #proof[ $ int sqrt(x^2 + a^2) dx &= x sqrt(x^2 + a^2) - int (x^2) / sqrt(x^2 + a^2) dx = x sqrt(x^2 + a^2) - int ((x^2 + a^2) - a^2) / sqrt(x^2 + a^2) dx\ &= x sqrt(x^2 + a^2) - int sqrt(x^2 + a^2) dx + a^2 int dx / sqrt(x^2 + a^2) $ $ => int sqrt(x^2 + a^2) dx = 1 / 2 x sqrt(x^2 + a^2) + (a^2) / 2 ln (x+sqrt(x^2 + a^2)) + C $ ] 若 $P_n (x)$ 为 $n$ 次多项式,则要求: 1. $int P_n (x) e^(a x) dx$,令 $P_n (x) = u, v' = e^(a x)$. 2. $int P_n (x) sin (a x + b) dx$,令 $P_n (x) = u, v' = sin (a x + b)$. 3. $int P_n (x) cos (a x + b) dx$,令 $P_n (x) = u, v' = cos (a x + b)$. 4. $int P_n (x) ln x dx$,令 $P_n (x) = ln x, v' = P_n (x)$. 设 $p(x)$ 为一般函数,则要求: 5. $int p(x) arcsin x dx$,令 $arcsin x = u, v' = p(x)$. 6. $int p(x) arctan x dx$,令 $arctan x = u, v' = p(x)$. == 特殊函数的不定积分 === 有理函数的不定积分 $ R(x) = (P(x)) / (Q(x)) = (a_0 x^n + a_1 x^(n-1) + dots.c + a_n) / (b_0 x^m + b_1 x^(m-1) + dots.c + b_m) $ 当 $m<=n$ 时,$R(x)$ 为假分式;当 $m>n$ 时 $R(x)$ 为真分式. $ "有理函数" = "多项式" + "真分式" $ = 定积分 == 定积分的定义 若存在一常数 $I$,任给 $epsilon > 0$,存在 $delta > 0$,使得对任意的分割 $ T:sp a = x_0<x_1<x_2< dots.c < x_(i-1)<x_i<x_(i+1) < dots.c < x_n=b $ 只要 $max{Delta x_i:1<=i<=n} = lambda(T) < delta$,任给 $xi_i in [x_(i-1), x_i]$,都有 $ |sum_(i=1)^n f(xi_i) Delta x_i - I| < eps $ 成立,则称 $I$ 为 $f(x)$ 在区间 $[a,b]$ 上的定积分. === 可积的必要条件 #def[定理1]若函数 $f(x)$ 在闭区间 $[a,b]$ 上可积,则 $f(x)$ 在 $[a,b]$ 上有界. === 可积的充分条件 #def[定理2]函数 $f(x)$ 在 $[a,b]$ 上连续 $=>$ $f(x)$ 在 $[a,b]$ 可积. #def[定理3]函数 $f(x)$ 在 $[a,b]$ 上有界且只有有限个间断点 $=>$ $f(x)$ 在 $[a,b]$ 可积. #def[定理4]函数 $f(x)$ 在 $[a,b]$ 上单调 $=>$ $f(x)$ 在 $[a,b]$ 上可积. == 定积分的性质 (设所列积分都存在.) #def[性质1]$display(int_a^b f(x) dx = -int_b^a f(x) dx)$. #def[推论1]$display(int_a^a f(x) dx = 0)$. #def[性质2](定积分对区间的可加性)$display(int_a^b f(x) dx = int_a^c f(x) dx + int_c^b f(x) dx)$. #def[性质3]若在 $[a,b]$ 上 $f(x)>=0$,则 $display(int_a^b f(x) dx >= 0)$. #deft[性质3]特别地,若 $f(x)$ 在 $[a,b]$ 上连续,$f(x) >= 0$ 但 $f(x) equiv.not 0$,那么 $display(int_a^b f(x) dx > 0)$. #def[推论2](定积分的基本不等式)$display(|f_a^b f(x) dx| <= f_a^b |f(x)| dx)$. #def[性质4]设 $display(M = max_([a,b]) f(x)\,sp m = min_([a,b]) f(x))$,则 $display(m(b-a) <= int_a^b f(x) dx <= M(b-a))$. #def[推论3](定积分中值定理)若 $f(x)$ 在 $[a,b]$ 上连续,则至少存在一点 $xi in [a,b]$ 使 $ int_a^b f(x) dx = f(xi) (b-a) $ #proof[ 设 $display(M = max_([a,b]) f(x)\,sp m = min_([a,b]) f(x))$,由性质 4 可得: $ m <= 1 / (b-a) int_a^b f(x) dx <= M $ 根据闭区间上的连续函数介值定理,至少存在一点 $xi in [a,b]$ 使 $display(f(xi) = 1/(b-a) int_a^b f(x) dx)$. ] #def[推论4](推广的定积分中值定理)设 $f(x),g(x)$ 在 $[a,b]$ 上连续,且 $g(x)$ 在 $[a,b]$ 上不变号,则至少存在一点 $xi in [a,b]$ 使得 $ int_a^b f(x) g(x) dx = f(xi) int_a^b g(x) dx $ == 积分上限函数 设函数 $f(x)$ 在区间 $[a,b]$ 上连续,并且设 $x$ 为 $[a,b]$ 上的一点,积分 $display(int_a^x f(t) dt)$ 是 $x$ 函数,记为 $Phi(x)$,即 设函数 $f(x)$ 在区间 $[a,b]$ 上连续,并且设 $x$ 为 $[a,b]$ 上的一点,积分 $display(int_a^x f(t) dt)$ 是 $x$ 函数,记为 $Phi(x)$.则称 $Phi(x)$ 为变上限的函数. #def[定理](微积分学基本定理)若 $f(x)$ 在 $[a,b]$ 上连续,则变上限函数 $Phi(x)$ 在 $[a,b]$ 上可导,且 $Phi'(x) = f(x)$. #def[推论](实际上也可由牛莱公式得到)$display(dif/dx int_(psi(x))^(phi(x)) f(t) dt = f(phi(x)) phi'(x)) - f(psi(x)) psi'(x)$. == 牛顿-莱布尼茨公式 设 $F(x)$ 是连续函数 $f(x)$ 在 $[a,b]$ 上的原函数,则 $ int_a^b f(x) dx = F(b) - F(a) $ == 定积分的计算方法 === 换元法 若函数 $f(x)$ 在 $[a,b]$ 上连续,作变量代换 $x = psi(t)$,$psi(t)$ 满足: 1. $psi(a) = alpha,sp psi(b)=beta$ 且 $psi(t) in [a,b]$,$t in [alpha,beta] sp ("或 " [beta,alpha])$ 2. 在 $[alpha,beta] sp ("或 " [beta,alpha])$ 上有连续的导数 $psi'(t)$. 则有定积分换元公式: $ int_a^b f(x) dx = int_alpha^beta f(psi(t)) psi'(t) dt $ === 分部积分法 若 $u=u(x),v=v(x)$ 在 $[a,b]$ 上具有连续的导函数,则 $ int_a^b u dv = u v |_a^b - int_a^b v du $ == 几种简化的定积分计算方法 === 关于原点对称的定积分 若 $f(x)$ 在区间 $[-a,a]$ 上来连续,则: $ int_(-a)^a f(x) dx = int_0^a (f(x) + f(-x)) dx = cases( 0\,quad& "当 " f(x) "为奇函数", 2 int_0^a f(x) dx\,quad& "当 " f(x) "为偶函数", )\ $ === 周期函数的定积分 设 $f(x)$ 是周期为 $T$ 的周期函数,且连续,则 $ int_a^(a+T) f(x) dx = int_0^T dx quad (a "是任意常数") $ === $sin^n x,sp cos^n x$ 在 $[0,pi/2]$ 上的积分 (Wallis 公式)对任意的自然数 $n sp (n>=2)$,有 $ int_0^(pi / 2) sin^n x dx = int_0^(pi / 2) cos^n x dx = cases( display((n-1)/n dot (n-3)/(n-2) dots.c 1/2 dot pi/2 \,quad& 2 divides n), display((n-1)/n dot (n-3)/(n-2) dots.c 2/3 \,quad& 2 divides.not n), ) $ (可通过递推的方式证明) == 反常积分 === 第一类反常积分(无穷区间上的反常积分) $ int_a^(+oo) f(x) dx defas lim_(t->+oo) int_a^t f(x) dx\ int_(-oo)^b f(x) dx defas lim_(t->-oo) int_t^b f(x) dx\ $ 若右式的极限存在,则称该反常积分收敛,否则称该反常积分发散. 进一步地,有 $ int_(-oo)^(+oo) f(x) dx defas int_a^(+oo) f(x) dx + int_(-oo)^a f(x) dx $ 称反常积分 $display(int_(-oo)^(+oo) f(x) dx)$ 收敛当且仅当右侧两个反常积分都收敛,否则称其发散. #def[例1](第一 $p$ 反常积分)讨论 $display(int_a^(+oo) dx/(x^p))$ 的敛散性. 当 $p!=1$ 时,有 $ int_a^(+oo) dx / (x^p) = lim_(t->+oo) int_a^t dx / (x^p) = lim_(t->+oo) lr((x^(-p+1))/(-p+1)|)_a^t = lim_(t->+oo) 1 / (1-p) (t^(-p+1) - a^(-p+1)) = cases( display((a^(1-p))/(p-1)\,quad& p>1), display(+oo\,quad& p<1) ) $ 当 $p=1$ 时,有 $ int_a^(+oo) dx / x = lim_(t->+oo) int_a^t dx / x = lim_(t->+oo) lr(ln x |)_a^t = +oo $ 综上,反常积分 $display(int_a^(+oo) (dx)/(x^p))$,当 $p>1$ 时收敛,当 $p<=1$ 时发散. === 第二类反常积分(无界函数的反常积分) 设函数 $f(x)$ 在区间 $(a,b]$ 上连续,$display(lim_(x->a^+) f(x) = oo)$(称 $a$ 为瑕点).于是任给 $0<epsilon<b-a$,$display(int_(a+epsilon)^b f(x) dx)$ 均存在,它是关于 $epsilon$ 的函数,则定义 $ int_a^b f(x) dx defas lim_(epsilon -> 0^+) int_(a+epsilon)^b f(x) dx $ 类似的,设函数 $f(x)$ 在区间 $[a,b)$ 上连续,$display(lim_(x->b^-) f(x) = oo)$(称 $b$ 为瑕点),则定义 $ int_a^b f(x) dx defas lim_(epsilon->0^+) int_a^(b-epsilon) f(x) dx $ 这两个反常积分收敛都是当且仅当右式的极限存在. 进一步地,设函数 $f(x)$ 在区间 $[a,c) union (c,b]$ 上连续,$lim_(x->c) f(x) = oo$(称 $c$ 为瑕点),则定义 $ int_a^b f(x) dx defas int_a^c f(x) dx + int_c^b f(x) dx $ 该反常积分收敛当且仅当右侧两个反常积分都收敛,否则发散. #def[例2](第二 $p$ 反常积分)讨论反常积分 $display(int_a^b (dx)/((b-a)^p) sp (b>a))$ 的敛散性. $x=b$ 是瑕点,当 $p!=1$ 时,有 $ int_a^b dx / ((b-x)^p) &= lim_(epsilon->0^+) int_a^(b-epsilon) dx / ((b-x)^p) = lim_(epsilon->0^+) lr(-(b-x)^(-p+1)/(-p+1)|)_a^(b-epsilon) = lim_(epsilon->0^+) ((b-a)^(1-p)-epsilon^(1-p)) / (1-p)\ &= cases( ((b-a)^(1-p))/(1-p) \,quad& p<1, +oo \,quad& p>1 ) $ 当 $p=1$ 时,有 $ int_a^b dx / (b-x) &= lim_(epsilon->0^+) int_a^(b-epsilon) dx / (b-x) = - lim_(epsilon->0^+) lr((ln|b-x|)|)_a^(b-epsilon) = lim_(epsilon->0^+) (ln(b-a)-ln(epsilon)) = +oo $ 综上,反常积分 $display(int_a^b dx/((b-x)^p))$,当 $p<1$ 时收敛,当 $p>=1$ 时发散. 实际上当该积分是 $p<=0$ 时是正常积分.从这个例子中可以看出,把正常积分看成反常积分处理一定是收敛的.当积分中含有参数时,参数取某些值时是正常积分,取某些值时是反常积分,则把积分看成反常积分,对解决问题是有利的. #warning[ 对比第一 $p$ 反常积分和第二 $p$ 反常积分: - 反常积分 $display(int_a^(+oo) (dx)/(x^p))$,当 $p>1$ 时收敛,当 $p<=1$ 时发散. - 反常积分 $display(int_a^b dx/((b-x)^p))$,当 $p<1$ 时收敛,当 $p>=1$ 时发散. 注意不等号方向.下面利用这两类进行判别时,可以先代入 $p=1$,如果能收敛就调整 $p$,否则可以直接确认为发散. ] == 反常积分敛散性的判别 === 关于第一类反常积分的敛散性判别 #def[定理1.1](比较判别法)设函数 $f(x),g(x)$ 在区间 $[a,+oo)$ 上连续,且有 $0 <= f(x) <= g(x)$,则 #deft[定理1.1]1. 若积分 $display(int_a^(+oo) g(x) dx)$ 收敛,则 $display(int_a^(+oo) f(x) dx)$ 也收敛. #deft[定理1.1]2. 若积分 $display(int_a^(+oo) f(x) dx)$ 发散,则 $display(int_a^(+oo) g(x) dx)$ 也发散. #warning[ 这里要求 $f(x)$ 和 $g(x)$ 的值域都是非负数的基础上,否则需要用下面的绝对收敛准则转化. ] #def[推论1.1.1]设 $f(x)$ 在 $[a,+oo)$ 上连续,若当 $x$ 充分大时有 $0<=f(x)<=display(c/(x^p)) sp(p>1,sp c>0)$,则积分 $display(int_a^(+oo) f(x) dx)$ 收敛;若当 $x$ 充分大时有 $f(x)>=display(c/(x^p))sp(p<=1,sp c>0)$,则积分 $display(int_a^(+oo) f(x) dx)$ 发散.(代入第一 $p$ 反常积分的结论可证) #def[推论1.1.2]设 $f(x)$ 在 $[a,+oo)$ 上连续,且 $display(lim_(x->+oo)) x^p f(x) = A$. #deft[推论1.1.2]1. 若 $0<A<+oo$,即 $f(x) sim display(A/(x^p)) sp (x->+oo)$,则反常积分 $display(int_a^(+oo) f(x) dx)$ 与 $display(int_a^(+oo) A/(x^p) dx)$ 敛散性相同,即当 $p>1$ 时 $display(int_a^(+oo) f(x) dx)$ 收敛;当 $p<=1$ 时 $display(int_a^(+oo) f(x) dx)$ 发散. #deft[推论1.1.2]2. 若 $A=0$,$f(x)>=0$ 且 $p>1$,则 $display(int_a^(+oo) f(x) dx)$ 收敛. #deft[推论1.1.2]3. 若 $A=+oo$ 且 $p<=1$,则 $display(int_a^(+oo) f(x) dx)$ 发散. #def[定理1.2](绝对收敛准则)设函数 $f(x)$ 在 $[a,+oo)$ 上连续,若积分 $display(int_a^(+oo) |f(x)| dx)$ 收敛,则 $display(int_a^(+oo) f(x) dx)$ 收敛. #proof[ #def[证明](这里只证明第1条)由于 $display(lim_(x->+oo)) x^p f(x) = A$,所以对 $epsilon=display(A/2)>0$,存在 $b>0$ 使得当 $x>b$ 时有 $display(-A/2 < x^p f(x) - A < A/2)$ 或 $ 0<A / 2 dot 1 / (x^p) < f(x) < (3A) / 2 dot 1 / (x^p) $ 由推论1.1.1知当 $p>1$ 时 $display(int_a^(+oo) f(x) dx)$ 收敛;当 $p<=1$ 时 $display(int_a^(+oo) f(x) dx)$ 发散. ] #note[ 这条结论告诉我们,可以不讨论 $f(x)$ 和 $display(c/(x^p))$ 的大小关系,只需要找到 $p$ 使得 $f(x)$ 和 $display(A/(x^p))$ 同阶即可. 在实际应用中,首先看能否找到当 $x->+oo$ 时,$f(x)$ 的等价量 $display(A/(x^p))$,如果找不到,再考虑第2条或第3条. ] === 关于第二类反常积分的敛散性判别 #def[定理2.1](比较判别法)设 $f(x),g(x)$ 在 $[a,b)$ 上连续,且当 $x$ 充分靠近点 $b$ 时有 $0$ $<=$ $f(x)$ $<=$ $g(x)$,则 #deft[定理2.1]1. 若积分 $display(int_a^b g(x) dx)$ 收敛,则积分 $display(int_a^b f(x) dx)$ 收敛. #deft[定理2.1]2. 若积分 $display(int_a^b f(x) dx)$ 发散,则积分 $display(int_a^b g(x) dx)$ 发散. #def[定理2.2](绝对收敛准则)设函数 $f(x)$ 在 $[a,b)$ 上连续,$b$ 是瑕点,如果积分 $display(int_a^b abs(f(x)) dx)$ 收敛,则 $display(int_a^b f(x) dx)$ 收敛.这时,称 $display(int_a^b f(x) dx)$ 绝对收敛. == $Gamma$ 函数 $ Gamma(s) = int_0^(+oo) x^(s-1) e^(-x) dx sp (s>0) $ #def[性质] $Gamma(s+1) = s Gamma(s) sp (s>0)$.所以说,$Gamma$ 函数是阶乘的自然推广. === $Gamma$ 函数的敛散性判别 $ Gamma(s) = int_0^(+oo) x^(s-1) e^(-x) dx = int_0^1 x^(s-1) e^(-x) dx + int_1^(+oo) x^(s-1) e^(-x) dx = I_1 + I_2 $ 其中 $I_1$ 是第二类反常积分,$x=0$ 是瑕点,考虑到 $ x^(s-1) e^(-x) sim 1 / (x^(1-s)) quad (x->0^+) $ 且 $A=1$,故当 $1-s<1$ 即 $s>0$ 时 $I_1$ 收敛. $I_2$ 是第一类反常积分 $ lim_(x->+oo) x^2 x^(s-1) e^(-x) = lim_(x->+oo) (x^(s+1)) / (e^(-x)) = 0 $ 故 $I_2$ 总是收敛.综上所述,当 $s>0$ 时,$I = Gamma(s)$ 收敛. === $Gamma$ 函数定义域的延拓 从递推公式 $Gamma(s+1) = s Gamma(s)$ 出发可以把 $Gamma$ 函数的定义域进行延拓.以此类推,$Gamma(s)$ 在除去 $0$ 与负整数以外的全体实数上都有定义.
https://github.com/AU-Master-Thesis/thesis
https://raw.githubusercontent.com/AU-Master-Thesis/thesis/main/lib/crates.typ
typst
MIT License
#let angle = `angle` #let as_variant = `as_variant` #let bevy_fullscreen = `bevy_fullscreen` #let bevy_notify = `bevy_notify` #let bevy_touchpad = `bevy_touchpad` #let bevy_tracking = `bevy_tracking` #let env_to_png = `env_to_png` #let gbp_config = `gbp_config` #let gbp_environment = `gbp_environment` #let gbp_geometry = `gbp_geometry` #let gbp_global_planner = `gbp_global_planner` #let gbp_linalg = `gbp_linalg` #let gbp_multivariate_normal = `gbp_multivariate_normal` #let gbp_schedule = `gbp_schedule` #let gbpplanner-rs = `gbpplanner-rs` #let interleave_evenly = `interleave_evenly` #let min_len_vec = `min_len_vec` #let percentage = `percentage` #let repeating_array = `repeating_array` #let seq = `seq` #let unit_interval = `unit_interval` #let units = `units` // #let linked = ( // #sour // )
https://github.com/leo1oel/CSAPP
https://raw.githubusercontent.com/leo1oel/CSAPP/main/Homework/Homework1.typ
typst
#import "template.typ": * #import "@preview/codly:0.2.0": * #show: project.with( title: "Homework Set 1 - Hardware Architecture", authors: ( "<NAME> 2023010747", ) ) #show: codly-init.with() #codly(languages: ( c: (name: "C", icon: none, color: none), )) #show table: set align(center) #show image: set align(center) = Problem 1 $1.$ Note that only the change of sign bit might cause the overflow. First, two positive number(take 0 into account) $A = 0A'$ and $B = 0B'$ adds up to $C$.($A', B' "and" C' "above"$ are shorthand for a unsigned 31-bit integer.) If $C = 0C'$ is positive, $A+B = A'+B' = C' = C$. There is no overflow. Else if $C = 1C'$ is negative, $ A+B = A'+B' =2^31+C'>=2^31$. Which means that $A + B$ is supposed to be $2^31 + C'$, but the result is $C = -2^31+C'<0$, which means that the overflow occurs. From above analysis, we know that $ A+B("with truncation") = cases( A+B-2^32 "if" A+B>=2^31, A+B "if" 0<=A+B<2^31 ). $ Next, when two negative number $A = 1A'$ and $B = 1B'$ adds up to $C$. Note that since we only preseve 32-bit signed integer, so we will need to truncate the result. If after truncation, $C = 0C'$ is positive, $A+B = 10C'$ is supposed to be $-2^32 + C' in [-2^32, -2^31-1) $. But the result is $C = C'>0$, which means that the overflow occurs. Else if after truncation $C = 1C'$ is negative, $ A+B = 11C'$ is supposed to be $-2^32+2^31+C' = -2^31 + C'in [-2^31,0)$. And $C = -2^31 + C'$ is the same as result, which means that there is no overflow. From above analysis, we know that $ A+B("with truncation") = cases( A+B+2^32 "if" A+B< -2^31, A+B "if" -2^31<=A+B<0 ). $ What if $A$ and $B$ have different signs? Then $A+B in [-2^31, 2^31-1]$ so there is no overflow. To sum up, we have the following formula: $ A+B("with truncation") = cases( A+B-2^32 "if" A+B>=2^31, A+B+2^32 "if" A+B< -2^31, A+B "if" -2^31<=A+B<2^31 ). $ And we know that iff $A$ and $B$ have the same sign, $A>0, B>0, A+B("with truncation") = A+B-2^32<0$ or $A<0, B<0, A+B("with truncation") = A+B+2^32>0$ will the overflow occurs . $2.$ (a) The error occurs when `i = 0`, the for loop will still do `i--` and check if `i > 0`. But `i` is unsigned int, so `i--` will cause `i` to be `2^32-1` and `i > 0` is still true, so the loop will continue. The correct code should be: ```c //Loop over an array in the inverse order for (int i = 9; i >= 0; i--){ printf("data %u = %d\n", i, a[i]); } ``` (b) `lim` is a unsigned int, while `val` is a signed ine. So when the computer do the comparison, int will be cast to unsigned int. If `val` is negative(let's say -1), `check_data` should return 0. But during comparison, `val` will be cast to a large positive number(2^32 - 1), which is larger than `lim`, so the result is 1, which is different from what we want. The correct code should be: ```c // Check value range; output 1 if and only if value is > 10 constexpr int lim = 10; int check_data(int val) { return val > lim ? 1 : 0; } ``` (c) `buffer_size` is int while `data_size` is unsigned int. So when we do `buffer_size - data_size`, `buffer_size` will be cast to unsigned int. If `buffer_size` is negative, clearly `buffer_size - data_size` should be negative. But due to the casting, `buffer_size` will be a large positive number, so `buffer_size - data_size` may turn to be positive, which is not what we want. The correct code should be: ```c // Check if buffer has enough space to keep data void copy_in(void* buffer, int buffer_size, void* data, int data_size) { if (buffer_size - data_size >= 0) memcpy(buf, data, data_size); } ``` = Problem 2 $1.$ (a) `lw x2 112(x1)` (b) `lw x1 12(x1)` `lw x2 16(x1)` $2.$ To align the structure size on 64-bit machine, `char` and `int32_t` will have 7 bytes and 4 bytes padding respectively. Since `TreeNode*` use 8 bytes already, it will not have paddings. So, to access `val` starting from `x3`, we need to offset 24 bytes. Thus the answer is $(d)$. In the program, `TreeNode` doesn't use dynamic allocation, therefore we only consume on the stack. For one `TreeNode`, we have to allocate $4*8 = 32$ bytes, so for `TreeNode arr[10]`, we need $32*10 = 320$ bytes. Hence, we consume 320 bytes on the stack and 0 bytes on the heap. $3.$ ```c # i in x1, A in x2, sum in x3 while(i != 0){ sum += A[i]; i--; } ``` $4.$ `bne` should change to `beq` and `addi x1, x1, 1` should change to `addi x1, x1, 4`. The correct code should be: ```c addi x4, x0, 0 L: beq x4, x2, E lw x5, 0(x1) add x3, x3, x5 addi x4, x4, 1 addi x1, x1, 4 j L E: ``` = Problem 3 $1.$ We assume the total area is $A$, for a certain amount of area $a$, the number of instructions executed per second is $eta sqrt(a)$ where $eta$ is a constant. We assume there are $m$ instructions in total, $m f$ of them are parallelizable, and $m(1-f)$ of them are serial. Therefore, the time of a single big core is always $m/(eta sqrt(a))$. If we have $N$ small cores with each has $a/N$ area, then we will need $(m (1-f))/(eta sqrt(a/N))$ time to execute the serial part and $(m f)/(N eta sqrt(a/N))$ time to execute the parallel part. Therefore, if we want multiple cores to perform better, we need to solve the following inequality: $ m/(eta sqrt(a)) >= (m (1-f))/(eta sqrt(a/N)) + (m f)/(N eta sqrt(a/N)) = (m(N-(N-1)f))/(N eta sqrt(a/N)). $ So $f>= (N - sqrt(N))/(N - 1)$. #table( columns: 2, [Number of small cores N], [Parallel portion f], [2], [$(2-sqrt(2)) approx 58.6%$], [4], [$2/3 = 66.7%$], [8], [$(8 - 2sqrt(2))/7 approx 73.9%$], ) $2.$ Given that $f=70%$ and 8 small cores, the speedup is $ m/(eta sqrt(a))/(m(N-(N-1)f))/(N eta sqrt(a/N)) = sqrt(N)/(N-(N-1)f) approx 0.91. $ $3.$ The hybrid design has a big core and 4 small cores, the time it will take is $ (m f)/(4 eta sqrt(a/8)) + (m (1-f))/(eta sqrt(a/2)) = (m (2-f))/(eta sqrt(2a)) $ Therefore, the speedup it can achieve is $ m/(eta sqrt(a))/(m (2-f))/(eta sqrt(2a)) = sqrt(2)/(2-f) approx 1.09("compare to 1 big core")\ (m(N-(N-1)f))/(N eta sqrt(a/N))/(m (2-f))/(eta sqrt(2a)) = 3.1/(2(2-f)) approx 1.19("compare to 8 small cores"). $ = Problem 4 $1.$ We assume a B-byte block size and E-way set associative cache. Cache block size is C bytes. The total cache size is N bits. Memory address is m bits. And there are S sets. For a memory address, we assume t bits are tag bits, s bits are set index bits, and b bits are block offset bits. Thus, we have the following equations: $ C = B times E times S\ m = t+s+b\ B = 2^b\ S = 2^s\ N = (1+t+8times B)times E times S $ We already know $C, m, B, E$, so we can solve for $S, t, s, N$. $ S = C/(B E)\ b = log_2(B)\ s = log_2(S) = log_2(C/(B E))\ $ $ t = m - s - b = m - log_2(C/(B E)) - log_2(B) = m - log_2(C/E)\ N = (1+m-log_2(C/E)+8B)times E times C/(B E) = (1+m + 8B -log_2(C/E))times C /B $ Take $C = 32 times 1024 = 2^15, m = 48, B = 64, E = 4$, we have $N = 274 "kbits"$. Take $C = 32 times 1024 = 2^15, m = 48, B = 8, E = 4$, we have $N = 400 "kbits"$. Take $C = 32 times 1024 = 2^15, m = 48, B = 64, E = 16$, we have $N = 275 "kbits"$. $2.$ For one level of cache, we know that $"AMAT" = "hit latency" + "miss rate" times "miss penalty"$. $"miss penalty" = "time to access memory"+ "time to deliver to cache" = "memory access latency"$. (a) hit latency = 1 ns, hit rate = $60%$, memory access latency = 100 ns, miss rate = $40%$. $"AMAT" = 1 + 0.4 times 100 = 41 "ns"$. (b) hit latency = 20 ns, hit rate = $90%$, memory access latency = 100 ns, miss rate = $10%$. $"AMAT" = 20 + 0.1 times 100 = 30 "ns"$. (c) In this case, $"AMAT" = "first hit latency" + "first miss rate" times "total miss penalty"$. Since there are two level, $"total miss penalty" = " second hit latency"+ "second miss rate'" times "miss penalty"$. first hit latency = 1 ns, second hit latency = 20 ns, first miss rate = $40%$, second miss rate' = $(10%)/(40%) = 25%$, memory access latency = 100 ns. $"AMAT" = 1 + 0.4 times (20 + 0.25 times 100) = 19 "ns"$. $3.$ Let's say we have $k$ instructions in total, then the execution time on an unrealistic perfect cache is $k$ unit time. If we execute on the real system, we denote $m$ as the time of cache misses, then the execution time is $k + 100m$ unit time. Therefore, slowdown = $(k+100m)/k = 1 + 100 m/k$, which depends linearly on the ratio of its cache misses and instuction count. We can also write slowdown = $1+"MPKI"/10$. Which is more direct that miss rate. $4.$ (a) the cache is 512 bytes, direct-mapped, with 16-byte blocks size. Therefore, we have $S = 512/16 = 32$ sets. The array is $x[2][128]$ has 256 elements, each element is 4 bytes, so the total size is $256 times 4 = 1024$ bytes. Therefore, the cache cannot hold the entire array, but only hold half of it. When we access $x[1][i]$, it will be in the same set as $x[0][i]$, so the cache will have a conflict miss. And we when access $x[0][i]$, it will have a cold miss. So every hit will miss, the miss rates is $100%$. (b) If we double the cache capacity, the cache will be able to hold the entire array. When we access $x[0][i]$ and $x[1][i]$, they will be in different sets, so there will be no conflict miss. But when we access $x[0][4k]$ and $x[1][4k]$, we will have a cold miss. After that, when we access $x[0][4k+j], x[1][4k+j]$ where $j = 1, 2, 3$, they will be cache hit since they are in the block of $x[0][4k]$ and $x[1][4k]$ respectively. Therefore, the miss rates is $25%$. (c) If we use 2-way set associative cache, although the cache size is 512 bytes and can only hold half of the array, $x[0][i]$ and $x[1][i]$ will not conflict since one set can contain two blocks. There will be conflict miss only between $x[0][4k], x[0][4k+64]$ and between $x[1][4k], x[1][4k+64]$ for $0<=k<16$. There will be cold miss when we access $x[0][4k]$ and $x[1][4k]$ for $0<=k<16$. So the miss rates is $64/256 = 25%$. (d) No, larger cache size will not help. Since increasing cache size cannot reduce the cold miss, it may change conflict miss to cold miss, but the miss rate will not change. (e) Yes, a larger block size will help. Since when we increase block size, after a cold miss, we will have more hits, which will reduce the miss rate. $5.$ No, which is better depends on the what we want to access. Take (c) cache as an example, if we want to access $x[0][0], x[1][0], x[0][64], x[0][0]$. For LRU replacement policy, we will have two cold miss and two conflict miss. The miss rate is $100%$. But for random policy, $50%$ we will have two cold miss and two conflict miss, and $50%$ we will have two cold miss and one conflict miss. So the miss rate is $87.5%$, which is lower than LRU miss rate. Therefore, LRU is not always better than random policy. = Problem 5 $1.$ (a) #image("2024-03-24-15-05-54.png") We can draw the process graph, and we know that only (ii) is possible. (b) #image("2024-03-24-15-16-41.png") We can draw the process graph, and we know that only (ii) is possible. $2.$ (a) #table( columns: 6, [Policy], [$P_1$], [$P_2$], [$P_3$], [$P_4$], [Average], [FCFS], [0], [53], [61], [129], [60.75], [Worst FCFS], [68], [145], [0], [121], [83.5], [SJF], [32], [0], [85], [8], [31.25], [RR($q=5$)], [82], [20], [85], [58], [61.25], [RR($q=8$)], [80], [8], [85], [56], [57.25], [RR($q=10$)], [82], [10], [85], [68], [61.25], [RR($q=20$)], [72], [20], [85], [88], [66.25], ) (b) #table( columns: 6, [Policy], [$P_1$], [$P_2$], [$P_3$], [$P_4$], [Average], [RR($q=5$)], [136], [30], [141], [90], [99.25], [RR($q=8$)], [112], [10], [119], [74], [78.75], [RR($q=10$)], [110], [12], [115], [86], [80.75], [RR($q=20$)], [86], [22], [101], [100], [77.25], ) Yes, the best time quantum choice change from $q=8$ to $q=20$.
https://github.com/julius2718/typst-jpdoc-template
https://raw.githubusercontent.com/julius2718/typst-jpdoc-template/main/0.0.1/test.typ
typst
MIT License
#import "@local/jpdoc-template:0.0.1": * #show: doc => jpdoc(doc) #signature(title: "吾輩は猫である", date: "明治38年1月", author: "夏目漱石") = 第一章 吾輩は猫である。名前はまだない。 どこで生まれたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶している。 吾輩はここで始めて人間というものを見た。しかもあとで聞くとそれは書生という人間中で一番獰悪な種族であったそうだ。 この書生というのは時々我々を捕えて煮て食うという話である。しかしその当時は何という考もなかったから別段恐しいとも思わなかった。 ただ彼の掌に載せられてスーと持ち上げられた時何だかフワフワした感じがあったばかりである。 掌の上で少し落ちついて書生の顔を見たのがいわゆる人間というものの見始であろう。この時妙なものだと思った感じが今でも残っている。 第一毛をもって装飾されべきはずの顔がつるつるしてまるで薬缶だ。その後猫にもだいぶ逢ったがこんな片輪には一度も出会わした事がない。 のみならず顔の真中があまりに突起している。そうしてその穴の中から時々ぷうぷうと煙を吹く。どうも咽せぽくて実に弱った。 これが人間の飲む煙草というものである事はようやくこの頃知った。 この書生の掌の裏でしばらくはよい心持に坐っておったが、しばらくすると非常な速力で運転し始めた。 書生が動くのか自分だけが動くのか分らないが無暗に眼が廻る。胸が悪くなる。 到底助からないと思っていると、どさりと音がして眼から火が出た。それまでは記憶しているがあとは何の事やらいくら考え出そうとしても分らない。 = `Python`によるプログラミング 以下のコードは、コンソールに`hello world`と出力させる命令です。 ```python print("hello world") ``` 実際にこのコードを実行してみましょう。 = 区分求積法 $ lim_(n -> infinity) 1/n sum_(k = 0)^(n - 1) f(a + (b - a)/n k) = integral_a^b f(x) d x $ #gtheading[問題] 次の各問に答えよ。 #sans[ただし、この文章はゴシック体である。]
https://github.com/j-mueller/typst-vegalite
https://raw.githubusercontent.com/j-mueller/typst-vegalite/main/typst-package/lib.typ
typst
MIT License
#import "@preview/ctxjs:0.1.1" #let vegalite-bytecode = read("vegalite.kbc1", encoding: none) #let ctx-name = "@preview/vegalite" #{ _ = ctxjs.create-context(ctx-name) _ = ctxjs.load-module-bytecode(ctx-name, vegalite-bytecode) } #let render(width: auto, height: auto, zoom: 1, spec) = { layout(size => { let calc_height = height let calc_width = width if type(calc_height) == ratio { calc_height = size.height * calc_height } else if type(calc_height) == relative { calc_height = size.height * calc_height.ratio + calc_height.length } if type(calc_width) == ratio { calc_width = size.width * calc_width } else if type(calc_width) == relative { calc_width = size.width * calc_width.ratio + calc_width.length } calc_height = (calc_height).pt() calc_width = (calc_width).pt() let spec2 = spec + (width: calc_width / zoom, height: calc_height / zoom) image.decode(ctxjs.call-module-function( ctx-name, "vegalite", "render_vl_helper", (spec2,) )) }) }
https://github.com/duanejeffers/resume
https://raw.githubusercontent.com/duanejeffers/resume/main/template.typ
typst
MIT License
#import "@preview/fontawesome:0.1.0": * #let bgColor = rgb("444352") #let txtColor = rgb("fdfdfd") #let titleRect = gradient.linear( rgb("046fb5"), rgb("00aaff"), dir: ttb, ) #let lineColor = white #let resumeData = yaml("data/resume_data.yaml") // The project function defines how your document looks. // It takes your content and some metadata and formats it. // Go ahead and customize it to your liking! #let project(title: "", authors: (), body) = { // Set the document's basic properties. set document(author: authors, title: title) set page( paper: "us-letter", fill: gradient.linear(bgColor, rgb("84829f"), dir: ttb), margin: ( left: 5pt, right: 5pt, top: 5pt, bottom: 5pt ), ) set text( font: "Noto Sans Display", lang: "en", fill: txtColor ) // Set paragraph spacing. show par: set block(above: 0.75em, below: 0.75em) set par(leading: 0.58em, justify: true) show heading.where(level: 1): head => [ #set text( size: 11pt, ) #set align(center) #head.body ] show heading.where(level: 2): head => [ #set text(size: 11pt) #head.body.children.at(0) #set text(size: 10pt) \- #head.body.children.at(4) #set text(size: 9pt) (#head.body.children.at(2)) \[#head.body.children.at(6) \- #head.body.children.at(8)\] ] show heading.where(level: 3): head => [ #h(5pt) #head.body ] show heading.where(level: 4): head => [ #set text(size: 9pt) #head.body ] body } #let bodyRect = rect.with( width: 100%, fill: txtColor, radius: 5pt, stroke: none, inset: 7pt, ) // Header Variables and Functions // headerLinkIcon - Generates Font-Awesome Icons in a box with a baseline #let headerLinkIcon(name, type, shift: 1.5pt) = { box( baseline: shift, height: 10pt, fa-icon(name, fa-set: type) ) h(3pt) } // headerLinksBar - Generates a Horizontal list of Links from an Array #let headerLinksBar(linkArray) = { set text(10pt) linkArray.map(l => { headerLinkIcon(l.icon, l.type) if "display" in l.keys() { link(l.link)[#{l.display}] } else { link(l.link) } }).join(h(5pt)) } // headerSummary - Generates a Summary Text String #let headerSummary(txtStr) = { set text( size: 9pt, style: "oblique", baseline: 10pt, ) set align( horizon ) txtStr } // headerLine - Generates a Simple Line in the header #let headerLine = line( length: 550pt, stroke: ( paint: lineColor, thickness: 3pt, cap: "round", ), ) // header - main header variable to generate from resumeData file. #let header = block( stack( dir: ltr, spacing: 5pt, block( image(resumeData.header.profile.file, width: 46pt) ), stack( dir: ttb, spacing: 5pt, stack( dir: ltr, spacing: 40pt, rect( fill: titleRect, radius: 5pt, inset: 10pt, text( size: 23pt, weight: "medium", resumeData.name ) ), headerSummary(resumeData.header.summary), ), headerLine, h(5pt) + headerLinksBar(resumeData.header.links), headerLine ) ) ) // Skills Section #let skills = block( width: 100%, height: 75pt, stack( dir: ltr, spacing: 1pt, )[ #for skillSect in resumeData.skills { rect( fill: lineColor, stroke: none, radius: 5pt, inset: 5pt, height: 75pt, text( fill: bgColor )[ #skillSect.section_title ] ) } ] )
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/query-before-after_01.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page #set page( paper: "a7", numbering: "1 / 1", margin: (bottom: 1cm, rest: 0.5cm), ) #set heading(outlined: true, numbering: "1.") // This is purposefully an empty #locate(loc => [ Non-outlined elements: #(query(selector(heading).and(heading.where(outlined: false)), loc) .map(it => it.body).join(", ")) ]) #heading("A", outlined: false) #heading("B", outlined: true) #heading("C", outlined: true) #heading("D", outlined: false)
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/014%20-%20Khans%20of%20Tarkir/005_Way%20of%20the%20Mantis.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Way of the Mantis", set_name: "Khans of Tarkir", story_date: datetime(day: 08, month: 10, year: 2014), author: "<NAME>", doc ) #emph[On many planes, the mantis is a small creature. On Tarkir, the mantises are larger than oxen and native to the mountainous region the Jeskai control.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Atop a red-roofed Jeskai tower, a monk named Kuhnde stood on his mantis and looked over the valley. A cold wind blew across his skin; he did not shiver, nor did he move. His mantis twitched beneath him, its arms always moving and head craning toward invisible prey. Mantis riders knew their mounts owe them no allegiance. Even a mantis ridden for years would consume a rider who lost focus for only a moment. #figure(image("005_Way of the Mantis/01.jpg", width: 100%), caption: [Mantis Rider | Art by Johann Bodin], supplement: none, numbering: none) There are many Jeskai styles. Riverwalk imitates flowing water; Dragonfist, the ancient hellkites; and Flying Crane, the wild aven of the high peaks. No name exists for the ceremony, but within the Jeskai, it is among the most important, defining events of one's life. Kuhnde began training for his mount when he was very young, and showed great potential as a student. When he was a few years old and just starting to read, representatives from the different strongholds and disciplines met with him. He was given a few minutes of understanding of each different style and told to try his best. The master of Sage-Eye Stronghold valued stealth, quickness, and cunning, while the master of Dirgu Stronghold brought with him several bladed weapons for Kuhnde to use. An aven master met with Kuhnde to see how adept he was at moving through the air as he leapt. The Riverwheel Stronghold master assessed Kuhnde as he performed their variation of Riverwalk magic, while the Cori Mountain Stronghold master was there to assess Dragonfist maneuvers. The School of Pearls, while not having a stronghold, watched the young boy attempt to manipulate a dozen pearls while he fought. He was tested on magic and identified the Jeskai's preferred types—soulfire, mistfire, and bloodfire—easily avoiding deathfire and vitalfire. The masters were all disappointed. He was competent in all the disciplines, although not an expert, but they all recognized in Kuhnde the skill set that was required of being a mantis rider.   Kuhnde met his mount that day, a mantis that was tethered to the ground by other riders. He was told to never let down his guard. One of the riders showed Kuhnde his own mantis and explained that he had trained it for years, fed it daily, and kept it clean. The rider removed one of the mantis's tethers and the insect lashed out, cutting the rider's hand. Kuhnde was scared when that happened, but the rider explained why Kuhnde was destined to be a mantis rider.   #figure(image("005_Way of the Mantis/02.jpg", width: 100%), caption: [Highspire Mantis | Art by <NAME>], supplement: none, numbering: none)   "There is no one way to tame a mantis," the rider explained. "It takes parts of all of the disciplines to learn how to stay forever vigilant and control your mantis, sometimes while also fighting another foe. You need to be aware of every variable, anticipate all outcomes, and in a mere second react to what is and what might be. You will be riding, with tenuous control, a creature that is your greatest threat."   Kuhnde had felt honored. He was young and filled with the promise of prestige. As he began to train, he saw how unique his path would be. Each mantis rider was able to work with the specific discipline needed to ride the mantis. Some required more study in the Riverwheel tradition to stay atop their mounts while others spent time at Dir<NAME> and learned how to keep themselves balanced when using a spear.   It took Kuhnde twenty years to learn how to ride his mantis. Although he stood tall watching the valley below, he focused on where he shifted his weight, rested his spear, and pulled his single rein. He was vigilant, reacting when his mantis quickly moved its head or buzzed its wings. Its wings produced a high-pitched, barely audible whirring sound in flight, and only the Jeskai were normally quiet enough to hear one coming. Kuhnde understood his mantis enough to know what the changes in the pitch and speed of the buzzing meant—his mantis was restless and wanted to move.   Kuhnde allowed the mantis to fly freely, steering it only when it flew too close to the tower windows where other students took lessons. There was always the danger, no matter how trained one was, that a mantis would no longer take orders from its rider. One of the first mantis riders brought his mount into a village, so it is said, and the mantis was so fueled by anger that, despite its master's commands, it rampaged and killed several people. Mantis rider never allowed their mounts to get close to others, for fear of a similar event.   Kuhnde's mantis turned its head, alerting him to movement near the base of the mountain. Whatever it was, it was disguised by a concealment spell, and Kuhnde knew well enough to anticipate a terrible foe cloaked in that magic. Jeskai use the obscuring magic for the element of surprise, to disguise their identity, or scout foreign lands. They also use it as destructive ambush magic against their enemies, so Kuhnde was well aware of the danger it could present to the monastery. The orb continued to blaze up the side of the mountain and Kuhnde repositioned his feet, signaling the mantis to intercept.   #figure(image("005_Way of the Mantis/03.jpg", width: 100%), caption: [Morph Overlay | Art by Raymond Swanland], supplement: none, numbering: none)   They dove toward the amber ball of energy. As they got closer it diverted its path to race up the mountain, but not toward them. Kuhnde tensed and held his spear. He signaled the mantis to go lower, so they could lead the energy ball away from the monastery. He dared not get too close or attack it—he had no idea what lay within. The mantis veered down toward the valley, toward the lakes below. Kuhnde looked back, trying to gauge distance to the concealed enemy, but saw it had returned to climb the summit. He shifted his weight to turn around the mantis and braced himself to move with the abrupt shift, lest he would fall to the ground.   They flew beside the fast-moving sphere close the ground. Kuhnde felt the mantis begin to buck, so while he applied pressure with one foot to the back of the mantis's head he jabbed at the orb with his spear. There was a loud screech, one the monks in the monastery would have heard, and the orb dissipated. A phoenix emerged and attacked.   #figure(image("005_Way of the Mantis/04.jpg", width: 100%), caption: [Ashcloud Phoenix | Art by Howard Lyon], supplement: none, numbering: none)   It was a large bird, the size of Kuhnde's mantis. It burned brightly as it slashed with its claws. Fire rolled off of the phoenix's wings like liquid, leaving trails of burning earth, but the phoenix had presented its underbelly. Kuhnde made the mantis take the attack, and it slashed at the phoenix. It cut the phoenix with its longer claws, and blood and flame emerged from the wound. The phoenix screeched again and flew higher. Kuhnde understood it was attempting to get away, but it was flying toward the monastery tower, most likely to land and try to regain its strength. A bird landing on the monastery would be no cause for alarm—but that bird was a force of nature and left fire in its wake.   Kuhnde watched as the phoenix headed toward the tallest tower, which housed this stronghold's library—a building least welcoming to an invader of fire. The scrolls in the library were not important, of course, but the information written in them needed saving. Kuhnde hadn't needed to train from scrolls much during his training and he knew some of the djinn that guarded them had never read their contents, so he didn't value them highly. But he knew that, for many in the Jeskai, the words on the scrolls were more precious than gold was to the Sultai. Kuhnde would lay down his life protecting them.   He goaded his mantis to fly faster, ignoring the freezing winds that rushed around him. Injured, the phoenix flew slower. Kuhnde struck again with his spear, impaling the phoenix near where the wing met the body. The phoenix reacted, crying out a screech of pain and igniting its body in flames. Kuhnde knew he'd been hit with the flames, but his flesh was so numbed by the cold he couldn't feel the pain. His mantis began to fall and he knew why before he saw—its wings were burning. He grasped his mantis's body as they fell alongside the phoenix, which dropped due to its wounds. The phoenix and the mantis hit the side of the mountain and slid rapidly toward its base.   Kuhnde held on tight when they slid down the slope, but relaxed his muscles when they stopped, minimizing injury. His mantis was burned, its wings and a large portion of its carapace gone. Its insides leaked onto the mountainside. The phoenix was next to a boulder, upside down, one of its wings obviously broken. The massive bird was unable to right itself. Kuhnde turned back to the mantis. He approached it, his companion for twenty years, as it lay dying. The mantis, unable to comprehend its situation, struck out at Kuhnde with the same chattering and head movements, as it attempted to kill and consume the man before it.   Kuhnde did not take the attempt personally. He had trained not to. Despite the sharp pain of injury he felt in his shoulder, he picked up his spear. With a quick, precise motion, Kuhnde impaled the mantis's head to end its misery, although the creature's mandibles continued to feel around for human flesh for a few moments. Kuhnde turned to the phoenix. It was still a threat to the monastery, even injured, and killing it would only cause it to be reborn, stronger even.   So Kuhnde took all his knowledge, training, and years of discipline and began to make a new path. He approached the phoenix and used his spear to help the bird right itself. The bird snapped at him, but he struck the phoenix on the beak with the shaft of his spear. The bird was stunned, then ignited itself in anger. Kuhnde again struck it on the beak. It cawed, but that time more in pain than anger. Kuhnde knew much from training a mantis, but even then he only trained to ride one specific mantis. He had never learned how to tame a phoenix, but he knew, given the time, he would master a new way. Even if it took many years.
https://github.com/pal03377/master-thesis
https://raw.githubusercontent.com/pal03377/master-thesis/main/feedbacklog.typ
typst
MIT License
// Enter your thesis data here: #let title = "Generalizing Machine-Learning Based Assessments" #let degree = "Master" #let program = "Informatics" #let supervisor = "Prof. Dr. <NAME>" #let advisor = "<NAME>, M.Sc.." #let author = "<NAME>" #let presentation_date = "Sep 11, 2023" #show heading: set text(size: 1.5em) // Title section #align(center)[ #heading[ Presentation Feedbacklog#linebreak() #degree's Thesis #author#linebreak() #title ] #v(2em) #text(size: 1.5em)[ #datetime.today().display("[month repr:short] [day], [year]") ] #v(2em) // Information table #line(length: 100%, stroke: gray) #table( columns: (9em, auto), align: left, stroke: none, [Author:], [#author], [Supervisor:], [#supervisor], [Advisor:], [#advisor], [Presentation date:], [#presentation_date], ) #line(length: 100%, stroke: gray) #v(2em) ] // Helper functions #let feedback_counter = counter("feedback") #let feedback(it) = block[ #feedback_counter.step() *#feedback_counter.display(). Feedback:* #it ] #let response(it) = pad(left: 3em)[ #text(fill: blue)[ *Response:* #it ] ] // =========================================== // Content #feedback[ Change the wording from "high coupling" to "extensibility", because this is the real problem that is solved from the developer's perspective. The real problem with the current system is hard to understand. ] #response[ We changed this in the slides and the thesis and additionally added the subsystem decomposition diagram of Athena-CoFee taken from https://github.com/ls1intum/Athena-CoFee to show the old architecture. ] #feedback[ Please double-check the type of arrow in the subsystem decomposition diagram. It probably should use a dashed line. ] #response[ We double-checked this in "Object-Oriented Software Engineering" by Bruegge and Dutoit and found indeed, "Dependencies among components can be depicted with dashed stick arrows". We changed this in the presentation and in the thesis. ] #feedback[ Please think about whether the assessment should be blocked for tutors until feedback suggestions are available. ] #response[ We thought about this and believe it not to be necessary. The tutor can still give feedback without suggestions. The suggestions are just a nice-to-have feature. ] #feedback[ The wording "Accepted Suggestion" for the suggestion badge in text exercises is not clear. Please change it to "Suggestion", since the tutor did never accept it. ] #response[ We changed it in the PR #7136\. ] #feedback[ Please show a warning to the tutor if they try to submit an assessment without having explicitly accepted or rejected all suggestions. ] #response[ We added this in PR #7136\. ] #feedback[ In the component diagram where the Playground can be seen, it is a component within Athena. In reality, it is a component outside of Athena. Please change this. ] #response[ We changed this in the presentation and in the thesis. ]