repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/jaapgeurts/typst-templates
https://raw.githubusercontent.com/jaapgeurts/typst-templates/master/README.md
markdown
These are templates for [typst](http://typst.app). to install copy each folder to: `$HOME/.local/share/typst/packages/personal` In your typst file import as follows: ```typst #import "@personal/recipe:0.0.1": * ``` Where `recipe` is the folder and `0.0.1` is the version. See each subpackage for more information
https://github.com/taooceros/CV
https://raw.githubusercontent.com/taooceros/CV/main/modules_en/award.typ
typst
// Imports #import "@preview/brilliant-cv:2.0.2": cvSection, cvHonor #let metadata = toml("../metadata.toml") #let cvSection = cvSection.with(metadata: metadata) #let cvHonor = cvHonor.with(metadata: metadata) #cvSection("Awards") #cvHonor( date: [2024], title: [Hilldale Research Fellowship: \$3000], issuer: [University of Wisconsin Madison], ) #cvHonor( date: [2023], title: [<NAME> Undergraduate Scholarship (4 recipents/year): \$8000], issuer: [University of Wisconsin Madison], ) // #cvHonor( // date: [2021 Jan - 2023 Jun], // title: [Dean's List], // issuer: [University of Wisconsin Madison], // )
https://github.com/mattyoung101/uqthesis_eecs_hons
https://raw.githubusercontent.com/mattyoung101/uqthesis_eecs_hons/master/pages/chapters/intro.typ
typst
ISC License
= Introduction == Why use Typst? #lorem(100) Check out my citations: - Quaternions @Shoemake1985 - Phong shading @Phong1975IlluminationFC - Simplex noise @simplexNoise - FFT @Cooley1965AnAF === An overview of typesetting #lorem(200) === A novel approach to setting types #lorem(100)
https://github.com/AnsgarLichter/light-cv
https://raw.githubusercontent.com/AnsgarLichter/light-cv/main/template/cv-de.typ
typst
MIT License
#import "@preview/light-cv:0.1.0": * #import "@preview/fontawesome:0.1.0": * #show: cv #let icons = ( phone: fa-phone(), homepage: fa-home(fill: colors.accent), linkedin: fa-linkedin(fill: colors.accent), github: fa-github(fill: colors.accent), xing: fa-xing(), mail: fa-envelope(fill: colors.accent) ) #header( full-name: [<NAME>], job-title: [Softwareentwickler mit Leidenschaft für JavaScript], socials: ( ( icon: icons.github, text: [JohnDoe], link: "https://github.com" ), ( icon: icons.homepage, text: [johndoe.com], link: "johndoe.com" ), ( icon: icons.mail, text: [<EMAIL>], link: "mailto://<EMAIL>" ), ( icon: icons.linkedin, text: [<NAME>], link: "https://linkedin.com/" ) ), profile-picture: "../media/avatar.jpeg" ) #section("Berufserfahrung") #entry( title: "Datenanalyst", company-or-university: "BetaSoft Technologies", date: "2023 - Heute", location: "San Francisco, CA", logo: "media/ucla.png", description: list( [Analysierte große Datensätze mit SQL und Python, um handlungsrelevante Erkenntnisse zu gewinnen, was zu optimierten Marketingstrategien und erhöhten Einnahmen führte], [Entwickelte und implementierte Datenvisualisierungsdashboards mit Tableau, was die Datenzugänglichkeit und Entscheidungsprozesse verbesserte.], [Arbeitete mit Interessengruppen zusammen, um wichtige Leistungskennzahlen zu definieren und automatisierte Berichtslösungen zu entwickeln, die die Datenanalyseprozesse optimierten.] ) ) #entry( title: "Cybersecurity-Berater", company-or-university: "Gamma Systems Inc.", date: "2020 - 2022", location: " London, UK", logo: "media/ucla.png", description: list( [Führte Penetrationstests und Schwachstellenbewertungen für Client-Netzwerke durch, um Sicherheitsrisiken zu identifizieren und zu mindern], [Entwickelte und implementierte Cybersicherheitsrichtlinien und -verfahren, um die Einhaltung von Branchenstandards und -vorschriften sicherzustellen], [Bereitete Schulungen und Sensibilisierungsprogramme im Bereich Cybersicherheit für Mitarbeiter vor, um das Risiko von Sicherheitsvorfällen aufgrund menschlichen Versagens zu reduzieren] ) ) #section("Bildung") #entry( title: "Master of Science in Informatik", company-or-university: "Universität von Kalifornien", date: "09/2020 - 09/2022", location: "Los Angeles, USA", logo: "media/ucla.png", description: list( [Thesis: Erforschung von Deep-Learning-Techniken zur natürlichen Sprachverarbeitung in Chatbots], [Nebenfach: Mathematik], [Durchschnittsnote: 4.0] ) ) #entry( title: "Bachelor of Science in Informatik", company-or-university: "Universität von Kalifornien", date: "09/2017 - 09/2020", location: "Los Angeles, USA", logo: "media/ucla.png", description: list( [Thesis: Design und Implementierung eines sicheren Dateifreigabesystems unter Verwendung von Blockchain-Technologie], [Nebenfach: Mathematik], [Durchschnittsnote: 3.5] ) ) #section("Programmierkompetenz") #entry( title: "Chatbot für die psychische Gesundheitsunterstützung", company-or-university: "Persönliches Projekt", date: "2023 - 2024", location: "", logo: "media/ucla.png", description: list( [Entwickelte einen Chatbot unter Verwendung von Python und der TensorFlow-Bibliothek für die natürliche Sprachverarbeitung], [Implementierte Sentimentanalyse zur Bewertung des emotionalen Zustands der Benutzer während der Gespräche] ) ) #entry( title: "Intelligentes Heimautomatisierungssystem", company-or-university: "Persönliches Projekt", date: "2020", location: "", logo: "media/ucla.png", description: list( [Entwickelte ein intelligentes Heimautomatisierungssystem unter Verwendung von Raspberry Pi und Arduino-Mikrocontrollern], [Implementierte Sensoren zur Überwachung von Temperatur, Luftfeuchtigkeit und Bewegungserkennung in der häuslichen Umgebung] ) ) #pagebreak() #header( full-name: [<NAME>], job-title: [Softwareentwickler mit Leidenschaft für JavaScript], socials: ( ( icon: icons.github, text: [JohnDoe], link: "https://github.com" ), ( icon: icons.homepage, text: [johndoe.com], link: "johndoe.com" ), ( icon: icons.mail, text: [<EMAIL>], link: "mailto://<EMAIL>" ), ( icon: icons.linkedin, text: [<NAME>], link: "https://linkedin.com/" ) ), profile-picture: "../media/avatar.jpeg" ) #section("Fähigkeiten & Interessen") #skill( category: "Technologie", skills: ("Cybersicherheit", "Cloud-Computing", "Internet der Dinge", "Svelte") ) #skill( category: "Sprachen", skills: ("Englisch (Muttersprache)", "Französisch (fließend)", "Chinesisch (Grundlagen)") ) #skill( category: "Sport", skills: ("Fitnessstudio", "Baseball", "Cricket") ) #skill( category: "Interessen", skills: ("Fotografie", "Reisen", "Musik") )
https://github.com/WinstonMDP/knowledge
https://raw.githubusercontent.com/WinstonMDP/knowledge/master/Kripke_scale.typ
typst
#import "cfg.typ": cfg #show: cfg = Шкала Крипке Шкала Крипке $:=$ ограниченный ЧУМ по включению, элементами которого являются множества переменных. Мир $:=$ элемент. $w forces x := $ $x$ истинна в мире $w := x in w$. Индуктивное определение истинности формулы: - $w forces A -> w forces B -> w forces A and B$. - $cases(delim: "[", w forces A, w forces B) -> w forces A or B$. - $(forall s >= w space s forces A -> s forces B) -> w forces A => B$. - $(forall s >= w space s forces.not A) -> w forces not A$. $s >= w -> w forces A -> s forces A$. Корректность интуиционистского ИВ относительно шкал Крипке: $tack.r A -> w forces A$. Полнота интуиционистского ИВ относительно шкал Крипке: $tack.r.not A -> exists w forces.not A$.
https://github.com/WinstonMDP/knowledge
https://raw.githubusercontent.com/WinstonMDP/knowledge/master/determinants.typ
typst
#import "cfg.typ": cfg #show: cfg = Определители $mat(delim: "|", a_(1 1), a_(1 2); a_(2 1), a_(2 2)) = a_(1 1) a_(2 2) - a_(2 1) a_(1 2)$ Для системы из двух уравнений $mat(delim: "|", a_(1 1), a_(1 2); a_(2 1), a_(2 2)) != 0 -> x_1 = mat(delim: "|", b_1, a_(1 2); b_2, a_(2 2))/mat(delim: "|", a_(1 1), a_(1 2); a_(2 1), a_(2 2)), space x_2 = mat(delim: "|", a_(1 1), b_1; a_(2 1), b_2)/mat(delim: "|", a_(1 1), a_(1 2); a_(2 1), a_(2 2))$ $mat(delim: "|", a_(1 1), a_(1 2), a_(1 3); a_(2 1), a_(2 2), a_(2 3); a_(3 1), a_(3 2), a_(3 3)) = a_(1 1) mat(delim: "|", a_(2 2), a_(2 3); a_(3 2), a_(3 3)) - a_(2 1) mat(delim: "|", a_(1 2), a_(1 3); a_(3 2), a_(3 3)) + a_(3 1) mat(delim: "|", a_(1 2), a_(1 3); a_(2 2), a_(2 3))$
https://github.com/matbesancon/modern-cv-academics
https://raw.githubusercontent.com/matbesancon/modern-cv-academics/master/README.md
markdown
MIT License
# A modern CV for academics This is a CV template built in [Typst](https://typst.app) on top of the great [Modern CV](https://github.com/DeveloperPaul123/modern-cv) template. I adapted the base template to be more suited towards the expectations of academia and in particular generated anything that's a long enough list from TOML files. ## Installation You will need [modern-cv](https://github.com/DeveloperPaul123/modern-cv) accessible, and the [hayagriva](https://github.com/typst/hayagriva) CLI installed for the multi-bib version. After that, run `publications/convert_yaml.sh` to convert your bib publications to YAML, which will be imported by the CV. ## TOML files The data extracted from TOML files include in particular supervisions (at the Master's and doctoral levels, feel free to add anything suitable for your system), education curriculum, work experience, talks, teaching activities. I typically find the other entries small enough to be written in plain text and adapted. The ones moved out to TOML files are typically information required in various contexts in academia (grants, shorter and longer CV, etc), websites, activity reports, the format allows different documents to depend on a single data source with suitable filters. I use these data to generate some pages of my [website](https://matbesancon.xyz), reducing out-of-sync situations. ## Publications This template offers two modes, 'highlighted' with a single publication list from a single bib file, and the per-section publication. To use the single publication mode, just set `selectedpubsonly = true` at the appropriate spot in the text. Per-section publications is the only part where I had to work around. First, typst currently supports bibtex and [hayagriva](https://github.com/typst/hayagriva), a specific yaml format with more features, some of these like manipulating the list of entries is what we needed to go around the lack of multi-bibliographies. I was inspired by [avonmoll](https://gist.github.com/avonmoll/e62facc7040f781d9e9ca5d6def9dc82)'s tricks but replaced the automatic type detection with multiple bib files. Because YAML is more unusual, I considered bib files as the original data, with a script `publications/convert_yaml.sh` which you can run from the publications folder once hayagriva is installed. This will generate the YAML files used by the CV. The citation style can be changed, the default "american-physics-society" was chosen because it has numbers and the date shown (a surprisingly narrow intersection of requirements).
https://github.com/drupol/master-thesis
https://raw.githubusercontent.com/drupol/master-thesis/main/src/thesis/imports/preamble.typ
typst
Other
#import "@preview/diagraph:0.3.0": * #import "@preview/codelst:2.0.1": sourcecode, sourcefile #import "@preview/glossarium:0.5.0": make-glossary, register-glossary, print-glossary, gls, glspl #show: make-glossary #import "@preview/xarrow:0.3.1": xarrow, xarrowSquiggly, xarrowTwoHead #import "@preview/hydra:0.4.0": * #import "@preview/cetz:0.3.1" #import "colors.typ": * #import "workarounds.typ": *
https://github.com/warab1moch1/MathmaticalFinance
https://raw.githubusercontent.com/warab1moch1/MathmaticalFinance/main/20240706.typ
typst
#import "manual_template.typ": * #import "theorems.typ": * #show: thmrules // Define theorem environments #let theorem = thmbox( "theorem", "Theorem", fill: rgb("#e8e8f8") ) #let lemma = thmbox( "theorem", // Lemmas use the same counter as Theorems "Lemma", fill: rgb("#efe6ff") ) #let corollary = thmbox( "corollary", "Corollary", base: "theorem", // Corollaries are 'attached' to Theorems fill: rgb("#f8e8e8") ) #let definition = thmbox( "definition", // Definitions use their own counter "Definition", fill: rgb("#e8f8e8") ) #let exercise = thmbox( "exercise", "Exercise", stroke: rgb("#ffaaaa") + 1pt, base: none, // Unattached: count globally ).with(numbering: "I") // Use Roman numerals // Examples and remarks are not numbered #let example = thmplain("example", "Example").with(numbering: none) #let remark = thmplain( "remark", "Remark", inset: 0em ).with(numbering: none) // Proofs are attached to theorems, although they are not numbered #let proof = thmproof( "proof", "Proof", base: "theorem", ) #let solution = thmplain( "solution", "Solution", base: "exercise", inset: 0em, ).with(numbering: none) #let project(title: "", authors: (), url: "", body) = { set page(paper: "a4", numbering: "1", number-align: center) set document(author: authors, title: title) set text(font: "Linux Libertine", lang: "en") set heading(numbering: "1.1.") set par(justify: true) set list(marker: ([•], [--])) show heading: it => pad(bottom: 0.5em, it) show raw.where(block: true): it => pad(left: 4em, it) show link: it => underline(text(fill: blue, it)) align(center)[ #block(text(weight: 700, 1.75em, title)) ] pad( top: 0.5em, bottom: 2em, x: 2em, grid( columns: (1fr,) * calc.min(3, authors.len()), gutter: 1em, ..authors.map(author => align(center)[ #author \ #link(url) ]), ), ) outline(indent: true) v(2em) body } #show: project.with( title: "No.7", authors: ( "warab1moch1", ), url: "https://github.com/warab1moch1" ) #set math.equation(numbering: "(1)") = 測度変換 #theorem[ #h(1mm) Levyの定理\ $M$ : $cal(F)_t$ マルチンゲールで $M_0=0$\ $angle.l M angle.r_t = t$ $M$ : $(cal(F)_t)$ - BM ] #proof[ $f(t, x) := exp(i alpha x + 1/2 alpha^2 t) quad (alpha in.small RR)$ とおくと#footnote[連続セミマルチンゲールとして$t$を扱うことを明記] $ f_x = i alpha f $ $ f_(x x) = - alpha^2 f $ $ f_t = 1/2 alpha^2 f $ Ito fomula $ f(t, M_t) &= f(0, M_0) + integral_0^t f_t (s, M_s) d s \ &quad + integral_0^t f_x (s, M_s) d M_s + integral_0^t 1/2 f_(x x) (s, M_s) d s\ &= 1 + i alpha integral_0^t f_x (s, M_s) d M_s $ martingale. $ therefore #h(1mm) EE[e^(i alpha M_t + 1/2 alpha^2 t)|cal(F)_s] = e^(i alpha M_s + 1/2 alpha^2 s) $ 両辺に$e^(- i alpha M_s - 1/2 alpha^2 t)$ : $cal(F)_s$ 可測 $ EE[e^(i alpha (M_t - M_s))|cal(F)_s] = e^(- 1/2 alpha^2 (t-s)) $ Tower Law $ EE[e^(i alpha (M_t - M_s))] &= EE[e^(i alpha (M_t - M_s))|cal(F)_s]\ &= EE[e^(- 1/2 alpha^2 (t-s))]\ &= e^(- 1/2 alpha^2 (t-s)) $ <ref> $ therefore M_t - M_s tilde.op cal(N) (0, t-s) $ #footnote[$cal(N)(0, sigma^2)$の特性関数$EE[e^(i t X)] = e^(-1/2 sigma^2 t^2)$] next, $(cal(F)_t)$ - 独立増分性 $forall A in.small cal(F)_s quad C in.small BB(RR)$ $ PP({M_t - M_s in.small C} sect A) = PP({M_t - M_s in.small C}) PP(A) $ $PP(A) = 0$の時自明、$PP(A) > 0$に興味あり $ PP_A (B) := PP(A sect B) / PP(A) $ 新しい確率測度を導入する。 $ EE[bold(1)_A e^(i alpha (M_t - M_s))] &= EE[EE[bold(1)_A e^(i alpha (M_t - M_s))|cal(F)_s]]\ &= EE[bold(1)_A EE[e^(i alpha (M_t - M_s))|cal(F)_s]] quad #text(0.8em)[($because$ $A in.small cal(F)_s$)] \ &= EE[bold(1)_A e^(- 1/2 alpha^2 (t - s))] quad #text(0.8em)[($because$ @ref )]\ &= EE[bold(1)_A] e^(- 1/2 alpha^2 (t - s)) \ &= PP(A) e^(- 1/2 alpha^2 (t - s)) $ #lemma[$f$ : $PP$ - 可積分 $ EE^(P_A)[f] = EE[bold(1)_A f] / PP(A) $] #proof[ 簡単のため、指標関数の時のみ示す。以降は standard-machine に従うと考えればよい。 $f = bold(1)_B$ のとき、確率の定義から $ EE^(P_A)[bold(1)_B] &= integral_Omega bold(1)_B d PP_A (omega)\ &= integral_B 1 d PP_A (omega)\ &= PP_A (B)\ &= PP(A sect B) / PP(A) \ &= EE[bold(1)_A bold(1)_B] / PP(A) $ ] 上の補題より、次が従う。 $ EE^(P_A)[e^(i alpha (M_t - M_s))] = e^(- 1/2 alpha^2 (t - s)) $ すると、$M_t - M_s$ の分布は $PP$ 上でも $PP^(P_A)$ 上でも変わらないことがわかる。 これより、 $ therefore PP({M_t - M_s in.small C} sect A) / PP(A) = PP({M_t - M_s in.small C}) $ よって $ M_t - M_s bot cal(F)_s $ ] == Radon-Nikodym 微分 いま、$Omega$ 上に確率測度 $PP$、$QQ$ があり、同値とする#footnote[$ forall A in.small F quad PP(A) = 0 arrow.l.r.double QQ(A) = 0 $]。 このとき、ある $ D in.small L^1 (Omega, cal(F), PP) $ が存在して $ QQ(A) = EE^PP [D A] $ を満足する。 これを、$QQ$ の $PP$ による Radon-Nikodym 微分と言い、$(d QQ)/(d PP)$ で表す。 #example[ $Omega = [0, 1]$ $ PP([a, b]) = b - a $ $ QQ([a, b]) = b^2 - a^2 $ とする。このとき $x in.small Omega$ $ PP([x, x + Delta x]) = Delta x $ $ QQ([x, x + Delta x]) = Delta x^2 + 2 Delta x dot.op x $ $ therefore QQ([x, x + Delta x]) / PP([x, x + Delta x]) &= Delta x + 2 x\ &tilde.eq 2 x $ となっていることがわかる。これより、 $ EE^PP [2x, [a, b]] &= integral_a^b 2x d PP(x)\ &= [x^2]_a^b\ &= b^2 - a^2\ &= QQ([a, b]) $ $ therefore #h(1mm) (d QQ)/(d PP) (omega) = 2 omega $ であるから、$(d QQ)/(d PP)$ は測度が何倍の密度を持っているかを表現している。 ] いま、次のような確率過程 ( Density process ) を考える。 $ D_t := EE^PP [(d QQ)/(d PP)|cal(F)_t] $ 定義より、上の確率変数 $(d QQ)/(d PP)$ に対して、$PP$ における条件付期待値を考えていることがわかる。 fact [$D_t$ の性質 #v(1mm) -- マルチンゲール#v(1mm) 定義より、条件付期待値の Tower Law から従う。#v(1mm) -- $ attach(inf, b:t>=0) D_t >= 0 $ として $(PP $ - $a.s. #h(1mm) omega)$ にとれる、即ち $ PP(A) = 0 arrow.l.r.double QQ(A) = 0 $ でない点は可算個程度しかない。#v(1mm) -- もし、$D_t$ を連続過程としてとれるなら、 $L$ : 連続過程として $ D_t = cal(E) (L)_t $ として、stochastic exponential の形で表せる#footnote[次節では、この事実を逆引き的に用いる。]。 ]#v(1mm) これらの性質と定義から、次が従う。#v(1mm) #enum( enum.item()[$EE^QQ [X] = EE^PP [X D]$#v(1mm) $ because #h(1mm) EE^QQ [X] &= integral_Omega X(omega) d QQ(omega)\ &= integral_Omega X(omega) (d QQ)/(d PP) d PP(omega)\ &= EE^PP [X (d QQ)/(d PP)] $ ], enum.item()[$X_t$ : $cal(F)_t$ 可測であるとき、 $EE^QQ [X_t] = EE^PP [X_t D_t]$ #v(1mm) $ because #h(1mm) EE^QQ [X_t] &= EE^PP [X_t D]\ &= EE^PP [EE^PP [X_t D|cal(F)_t]] quad #text(0.8em)[($because$ Tower Law)]\ &= EE^PP [X_t EE^PP [D|cal(F)_t]]\ &= EE^PP [X_t D_t] quad #text(0.8em)[($because$ $D_t$ のマルチンゲール性)] $], enum.item()[$X_t$ : $cal(F)_t$ 可測であるとき、$EE^QQ [X_t|cal(F)_s] = D_s^(-1) EE^PP [X_t D_t|cal(F)_s] quad (s<= t)$#v(1mm) $because$ 右辺が、(左辺を条件付期待値たらしめる)部分平均の性質を満たしていればよく、\ $forall A in.small cal(F)_s$ に対し、 $ integral_A D_s^(-1) EE^PP [X_t D_t|cal(F)_s] &= integral_Omega bold(1)_A EE^PP [X_t D_t|cal(F)_s] D_s^(-1) d QQ\ &quad #text(0.8em)[上の2より、#h(1mm) $EE^QQ [X_t / D_t] = EE^PP [X_t] $]\ &= integral_Omega underbrace(bold(1)_A EE^PP [X_t D_t|cal(F)_s], cal(F)_s "可測") d PP\ &= EE^PP [EE^PP [bold(1)_A X_t D_t|cal(F)_s]]\ &= EE^PP [bold(1)_A X_t D_t]\ &quad #text(0.8em)[$bold(1)_A X_t D_t$ は $cal(F)_t$ 可測であることに注意すれば、]\ &= EE^QQ [bold(1)_A X_t] quad #text(0.8em)[($because$ 2より、#h(1mm) $ EE^PP [X_t D_t] = EE^QQ [X_t]$)]\ &= EE^QQ [X_t, A] $ これより、右辺は正に $QQ$ の下での部分平均となっており、所望の結果である。] ) == Gilsanov の定理 いま、次のような確率過程を考える。 $ L_t := integral_0^t theta_s d W_s $ この $L_t$ を用いた次のような stochastic exponential を考えると、伊藤の等長性から $ cal(E) (-L)_t &= exp(-L_t - 1/2 angle.l L angle.r_t)\ &= exp(-integral_0^t theta_s d W_s - 1/2integral_0^t theta_s^2 d s) $ このとき、Radon-Nykodim微分における fact(後で上手く引用する形で記述する) から、この $cal(E)(-L)_t$ を Density Process に持つような $QQ$ について考える。\ 実際、$forall A in.small cal(F)$ について $ QQ(A) = integral_A cal(E)(-L)_infinity d PP $ とすればよい#footnote[ #theorem[ $M$ : 一様可積分マルチンゲールであるとき、\ $M_t$ から $M_infinity$ ( $L^1$ 収束かつ概収束) かつ $EE[M_infinity|cal(F)_t] = M_t$ なる $M_infinity$ の存在が言える。\ マルチンゲール収束定理*(要調査)* ] 一般に、$L^2$ 有界マルチンゲール ($attach(sup, b:t>0) EE[M_t^2] < infinity$) $arrow.r.double$ 一様可積分マルチンゲール $arrow.r.double$ $L^1$ 有界マルチンゲール という関係性が成立している。\ ブラウン運動 $W$ は $sup EE[W_t^2] = t arrow.r infinity$ であることに注意。 ]。 #pagebreak() すなわち、 $ (d QQ)/(d PP) = cal(E)(-L)_infinity $ であり、Density Process $D_t$ の一般形は $ D_t &= EE^PP [(d QQ)/(d PP)|cal(F)_t]\ &= EE^PP [cal(E)(L)_infinity|cal(F)_t]\ &= cal(E)(-L)_t $ とすればよい。このとき、$cal(E)(-L)_infinity$ が存在するための十分条件は $ EE^PP [e^(1/2integral_0^T theta_s^2 d s)] < infinity $ であり、これを Novikov 条件という。これは、$cal(E)(-L)_t$ の指数部分の正規性と $L^2$ 有界性に関する条件である。 #theorem[#h(1mm) Gilsanov の定理\ $(theta_t)$ から新たな(確率)測度 $QQ$ を作ることを考える。\ ここで、ブラウン運動 $W$ : $PP$ - BM とすると $ W_t^QQ := W_t + integral_0^t theta_s d s $ <W_tQQ> によって定義された $W_t^QQ$ は $QQ$ - BM である。 ] このとき、@W_tQQ の微分形は $ d W_t^QQ = d W_t + theta_t d t $ であることに注意する。 このとき、実際に $W_t^QQ$ が $QQ$ - BM であることを示すには、*Levy* の定理から(記号)#v(1mm) -- $0$ スタート #v(1mm) -- $QQ$ - マルチンゲール #v(1mm) -- 2次変分 $t$ #v(1mm) であればよい。 表式から、$0$ スタートは自明に従う。また、2次変分も $ d W_t^QQ d W_t^QQ &= (d W_t + d t)^2\ &= d W_t d W_t\ &= d t $ より確認できる。 ここで、$QQ$ - マルチンゲールについては $ D_t = cal(E)(-L)_t $ より、 $ (d cal(E)(-L)_t)/(d (-L)_t) = cal(E)(-L)_t $ であるから、 $ d D_t &= d cal(E) (-L)_t\ &= cal(E)(-L)_t d(-L)_t\ &= - D_t d L_t\ &= - D_t theta_t d W_t $ これから、$PP$ 上で $ d (W_t^QQ D_t) &= W_t^QQ d D_t + D_t d W_t^QQ + d D_t d W_t^QQ\ &= - W_t^QQ D_t theta_t d W_t + D_t (d W_t + theta_t d t) - D_t theta_t d t\ &= (1 - W_t^QQ theta_t) D_t d W_t $ $ therefore #h(1mm) W_t^QQ D_t : PP "- マルチンゲール" $ ここで、測度の変換に際し $ EE^QQ [X_t|cal(F)_s] = D_s^(-1) EE^PP [X_t D_t|cal(F)_s] $ が成立しているのであったから $ EE^QQ [W_t^QQ|cal(F)_s] &= D_s^(-1) EE^PP [W_t^QQ D_t|cal(F)_s]\ &= D_s^(-1) W_s^QQ D_s\ &= W_s^QQ $ $ therefore #h(1mm) W_t^QQ : QQ "- マルチンゲール" $ となり、所望の結果を得る。 これまでに得られた結果を踏まえると、$cal(E)(-L)_t$ による Gilsanov 変換は、#v(1mm) -- $M$ : $PP$ - 局所マルチンゲール#v(1mm) から#v(1mm) -- $M + angle.l M, L angle.r$ : $QQ$ - 局所マルチンゲール#v(1mm) を得るための操作であると言い換えられる。 実際、 $ d W_t^QQ = d W_t + theta_t d t $ とすることで、 $ d X_t = mu_t d t + sigma_t d W_t "on" PP $ $ d X_t = (mu_t - theta_t sigma_t) d t + sigma_t d W_t "on" QQ $ であることから、確率測度 $QQ$ を(適当に)取り換えればドリフト項が何にでもなることがわかる。 fact[#h(1mm)マルチンゲール表現定理\ completed Brownian filtration $(attach(cal(F)_t, t:tilde.op))$ 上において $M$ : 連続マルチンゲールとする。\ このとき、$C in.small RR$ で $ M_t = C + integral_0^t h_s d W_s $ と、ある $h$ によって書ける。\ あるいは、一般に、マルチンゲール $M$ に対し $ d M_t = h_t d W_t $ と書ける。 ] これより、$N$ : 連続マルチンゲールのとき $ d N_t = sigma_t d W_t quad (sigma_t eq.not 0) $ として $ M_t = C + integral_0^t phi_s d N_s $ なる $phi$ が存在する。というのは、 $ d M_t &= h_t d W_t\ &= (h_t sigma_t^(-1)) sigma_t d W_t\ &= (h_t sigma_t^(-1)) d N_t $ とできるからである。 いま、割引株価過程 $ Z_t := B_t^(-1) S_t $ $ d B_t &= - B_t^(-2) d B_t\ &= - r B_t^(-1) d t $ $ d Z_t &= B_t^(-1) d S_t + d B_t^(-1) S_t\ &= B_t^(-1) {d S_t + (- r d t) S_t}\ &= B_t^(-1) {S_t (mu d t + sigma d W_t - r d t)}\ &= Z_t {(mu - r) d t + sigma d W_t} $ $theta = (mu - r)/sigma$ Gilsanov $ d W_t^QQ = d W_t + theta d t $ $ d Z_t = Z_t sigma d W_t^QQ $ $ E_t := EE^QQ [B_T^(-1) X|cal(F)_t] $ $ d E_t = phi_t d Z_t $ $ psi_t := E_t - phi_t Z_t $ $(phi, psi)$ 1. $(phi, psi)$ 3. $ V_t &= phi_t S_t + psi_t B_t\ &= phi_t S_t + (E_t - phi_t Z_t) B_t\ &= B_t E_t $ $ therefore #h(1mm) V_T &= B_T EE^QQ [B_t^(-1) X|cal(F)_T]\ &= B_T B_T^(-1) X \ &= X $ 2. $ d V_t &= E_t d B_t + B_t d E_t + d E_t d B_t\ &= (phi_t Z_t + psi_t) d B_t + B_t (phi_t d Z_t) + d B_t (phi_t d Z_t)\ &= phi_t (Z_t d B_t + B_t d Z_t + d B_t + d Z_t) + psi_t d B_t\ &= phi_t d (B_t Z_t) + psi_t d B_t\ &= phi_t d S_t + psi_t d B_t $ #corollary[ #h(1mm) デリバティブ価格公式#v(1mm) $ V_t &= B_t E_t\ &= B_t EE^QQ [B_T^(-1) X|cal(F)_t] $ ]
https://github.com/nixon-voxell/nixon_cover_letter_template
https://raw.githubusercontent.com/nixon-voxell/nixon_cover_letter_template/main/template.typ
typst
MIT License
// const color #let color_darknight = rgb("#131A28") #let color_darkgray = rgb("333333") // layout utility #let justify_align(left_body, right_body) = { block[ #left_body #box(width: 1fr)[ #align(right)[ #right_body ] ] ] } #let justify_align_3(left_body, mid_body, right_body) = { block[ #box(width: 1fr)[ #align(left)[ #left_body ] ] #box(width: 1fr)[ #align(center)[ #mid_body ] ] #box(width: 1fr)[ #align(right)[ #right_body ] ] ] } #let generate_contact(icon, contact, url: "") = { block[ #icon #if url != "" { link(url)[#contact] } else { contact } ] } #let letter(author: (), date: "", recipient: "Sir/Madam", body) = { set document( author: author.firstname + " " + author.lastname, title: "resume", ) set text( font: ("Source Sans Pro"), lang: "en", size: 11pt, fill: color_darknight, fallback: false ) set page( paper: "a4", margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm), footer: [ #set text(fill: gray, size: 8pt) #justify_align_3[ #smallcaps[#date] ][ #smallcaps[ #author.firstname #author.lastname #sym.dot.c #"Cover Letter" ] ][ #counter(page).display() ] ], footer-descent: 0pt, ) // set paragraph spacing show par: set block(above: 0.75em, below: 0.75em) set par(justify: true) set heading( numbering: none, outlined: false, ) let name = { align(left)[ #pad(bottom: 5pt)[ #block[ #set text(size: 20pt, style: "normal", font: ("Roboto")) #text(weight: "thin")[#author.firstname] #linebreak() #text(weight: "bold")[#author.lastname] ] ] ] } let positions = { set text( size: 9pt, weight: "regular" ) align(left)[ #smallcaps[ #author.positions.join( text[#" "#sym.dot.c#" "] ) ] ] } let contacts0 = { set box(height: 11pt) let email_icon = box(image("assets/icons/mail.svg")) let phone_icon = box(image("assets/icons/phone.svg")) let location_icon = box(image("assets/icons/location.svg")) let linkedin_icon = box(image("assets/icons/linkedin.svg")) align(left)[ #generate_contact(email_icon, author.email, url: "mailto:" + author.email) #generate_contact(phone_icon, author.phone) #generate_contact(location_icon, author.loc) #generate_contact(linkedin_icon, author.linkedin, url: "https://linkedin.com/in/" + author.linkedin) ] } let contacts1 = { set box(height: 11pt) let url_icon = box(image("assets/icons/url.svg")) let github_icon = box(image("assets/icons/github.svg")) let youtube_icon = box(image("assets/icons/youtube.svg")) let itchio_icon = box(image("assets/icons/itchio.svg")) align(left)[ #generate_contact(url_icon, author.url_name, url: author.url) #generate_contact(github_icon, author.github, url: "https://github.com/" + author.github) #generate_contact(youtube_icon, author.youtube, url: "https://youtube.com/" + author.youtube) #generate_contact(itchio_icon, author.itchio, url: "https://itch.io/profile/" + author.itchio) ] } align(left)[ #box[ #box(radius: 6pt, clip: true)[#image("assets/images/me.jpg", height: 80pt)] #h(8pt) #box[ #name #positions ] ] #h(1fr) #box[#contacts0] #h(1fr) #box[#contacts1] ] set text( size: 12pt, hyphenate: false, ) set par( first-line-indent: 18pt, leading: 10pt, justify: true, ) [ #linebreak() #line(length: 100%) #linebreak() Dear #recipient \ #linebreak() #body #linebreak() \ Best Regards, \ _ #author.firstname _ ] }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/bytefield/0.0.5/lib/asserts.typ
typst
Apache License 2.0
#import "@preview/oxifmt:0.2.0": strfmt #let assert_dict(arg, var_name) = { assert.eq(type(arg),dictionary, message: strfmt("expected {} to be a dictionary, found {}",var_name, type(arg))); } /// fail if field is not a bf-field #let assert_bf-field(field) = { assert_dict(field, "field") let bf-type = field.at("bf-type", default: none) assert.eq(bf-type, "bf-field", message: strfmt("expected bf-type of 'bf-field', found {}",bf-type)); let field-type = field.at("field-type", default: none) assert.ne(field-type, none, message: strfmt("could not find field-type at bf-field {}", field)); } /// fail if field is not a bf-field of type data-field #let assert_data-field(field) = { assert_bf-field(field); let field-type = field.at("field-type", default: none) assert.eq(field-type, "data-field", message: strfmt("expected field-type == data-field, found {}",field-type)) let size = field.data.size; assert(type(size) == int, message: strfmt("expected integer for parameter size, found {} ", type(size))) } /// fail if field is not a bf-field of type data-field #let assert_note-field(field) = { assert_bf-field(field); // Check for correct field-type let field-type = field.at("field-type", default: none) assert.eq(field-type, "note-field", message: strfmt("expected field-type == note-field, found {}",field-type)) // Check if it has a valid anchor id let anchor = field.data.anchor assert(type(anchor) == int, message: strfmt("expected integer for parameter anchor, found {} ", type(anchor))) // Check side assert(field.data.side == left or field.data.side == right, message: strfmt("expected left or right for the notes side argument.")) } /// fail if it does not match #let assert_header-field(field) = { assert_bf-field(field); } /// fail if cell is not a bf-cell #let assert_bf-cell(cell) = { assert_dict(cell, "cell"); // Check bf-type let bf-type = cell.at("bf-type", default: none) assert.eq(bf-type, "bf-cell", message: strfmt("expected bf-type of 'bf-cell', found {}",bf-type)); // Check cell-type is not none let cell-type = cell.at("cell-type", default: none) assert.ne(cell-type, none, message: strfmt("could not find cell-type at bf-cell {}", cell)); }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/minerva-report-fcfm/0.1.0/minerva-report-fcfm.typ
typst
Apache License 2.0
/** minerva-article.typ * * Este archivo contiene la estructura y estilos usados por el template. * Para definir tus propios comandos agrégalos a preamble.typ. * **/ /****************************************************************************** * Funciones base * * La idea es que si necesitas extender personalizar el template, * sobrescribir el header o crear una portada, etc. Deberías extender * su respectivo base. La razón de esto es que ciertas funcionalidades * del template requieren estado. Además estos base settean estilos * que ayudan a que haya coherencia visual. *****************************************************************************/ #let base-header(it) = { metadata((marker: "PAGE-START")) set block(spacing: 0pt, clip: false) set par(leading: 0.4em) it } #let base-footer(it) = { set block(spacing: 0pt, clip: false) set par(leading: 0.4em) it metadata((marker: "PAGE-END")) } #let base-front-page(it, ..args) = { return page(..args, { it counter(page).update(0) }) } /** Localización * * Las siguientes son funciones de utilidad general para mejor * soporte del español. **/ /// Arreglo con los nombres de meses en español. #let meses = ("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre") /// Aplica el formato "[day] de [month repr: long] del [year]" en español /// /// fecha (datetime): fecha a dar formato. /// -> str #let formato-fecha(fecha) = { return str(fecha.day()) + " de " + meses.at(fecha.month()) + " de " + str(fecha.year()) } /// Show rule que cambia el formato de los número para usar coma decimal. /// /// doc (content): documento a aplicar reglas /// -> content #let formato-numeros(doc) = { // https://github.com/typst/typst/issues/1093#issuecomment-1536620129 show regex("\d+.\d+"): it => { if it.func() == heading { show ".": "," } it } show math.equation: it => { show regex("\d+.\d+"): it => { show ".": {","+h(0pt)} it } it } doc } /** Elements * * Estas funciones generan elementos para usarse como parte del documento. */ /// Repite un contenido `count` veces con `padding` entre ellos. /// Si `count` es `auto`, se utiliza tanto espacio como haya disponible. /// - body (content, str, int): Contenido a repetir. /// - padding (length) : Espaciado entre repeticiones. /// - count (int, auto) : Cantidad de repeticiones. /// -> content #let rep(padding: 0pt, count: auto, body) = context { if count != auto { stack(dir: ltr, spacing: padding, ..range(count + 1).map(_ => body)) } else { layout(size => context { let width = measure(body).width let real-count = calc.quo((size.width - width).pt(), (width + padding).pt()) stack(dir: ltr, spacing: padding, ..range(count-real + 1).map(_ => body)) }) } } /// Crea un resumen que no aparece en el índice (outline). /// /// - body (content): Cuerpo del resumen. /// -> content #let resumen(body) = [ #heading(level: 1, numbering: none, outlined: false)[Resumen] #body #pagebreak(weak: true) ] #let abstract = resumen /******************************** * Portadas * *******************************/ /// Diseño de portada básico, perfecto para informes y tareas. /// /// - meta (dictionary): Contenidos del archivo **meta.typ** /// - titulo-centrado (bool): Si es que el título debería ir centrado respecto /// a la página. Por defecto `false`. /// -> content #let portada1( meta, titulo-centrado: false, ) = { let miembros = (:) if type(meta.autores) == "string" { miembros.insert("Integrante", meta.autores) } else if meta.autores.len() > 0 { miembros.insert( if meta.autores.len() == 1 { "Integrante" } else { "Integrantes" }, meta.autores ) } miembros = miembros + meta.equipo-docente let header = base-header[ #grid(columns: (auto, 1fr), rows: auto)[ #set align(left + bottom) #for nombre in meta.departamento.nombre [#nombre \ ] ][ #set align(right + bottom) #if meta.departamento.logo != none { image.decode(meta.departamento.logo, height: 50pt) } ] #v(8pt) #line(length: 100%, stroke: 0.4pt) ] let member-table-args = () for (categoria, nombres) in miembros { member-table-args.push[#categoria:] member-table-args.push[ #if type(nombres) == array { for nombre in nombres [#nombre \ ] } else { nombres } ] } let titulo = align(center, { set text(size: 25pt) if meta.titulo != none { meta.titulo linebreak() } if meta.subtitulo != none { meta.subtitulo linebreak() } if meta.tema != none { meta.tema } }) let member-table = grid(columns: (1fr, auto), rows: auto)[][ #grid(columns: 2, rows: auto, row-gutter: 10pt, column-gutter: 5pt, ..member-table-args) #for (nombre, fecha) in meta.fechas [ Fecha de #nombre: #fecha \ ] #meta.lugar ]; let member-table-wrapper = { if titulo-centrado { (it) => place(bottom+right, align(top+left, it)) } else { (it) => it } } return base-front-page(header: header)[ #v(1fr) #titulo #v(1fr) #member-table-wrapper(grid(columns: (1fr, auto), rows: auto, [], member-table)) ] } /** Headers * */ /// El header por defecto. /// - meta (dictionary): Contenidos del archivo **meta.typ** /// - romano-hasta-primer-header (bool): Si es true, las páginas antes del /// primer heading con numbering utilizan números romanos en minúsculas. /// Por defecto es `true`. /// -> content #let header1( meta, romano-hasta-primer-heading: true ) = base-header[ #set text(weight: 1) // typst bug? #grid(columns: (auto, 1fr), rows: auto)[ #set align(left + bottom) #context { let here = here() let prev-headings = query(selector(heading.where(level: 1)).before(here), here) let post-headings = query(selector(heading.where(level: 1)).after(here), here) let heading-found = none if post-headings != () and post-headings.first().location().page() == here.page() { heading-found = post-headings.first() } else if prev-headings != () { heading-found = prev-headings.last() } if heading-found != none and heading-found.numbering != none { heading-found.body } } ][ #set align(right + bottom) #context { let headings = query(heading) let first-numbered-heading = none for heading in headings { if heading.numbering != none { first-numbered-heading = heading } } let numbering = "i" if first-numbered-heading != none { if here().page() == first-numbered-heading.location().page() { counter(page).update(1) } if first-numbered-heading.location().page() <= here().page() { numbering = "1" } } context { counter(page).display(numbering) } } ] #v(8pt) #line(length: 100%, stroke: 0.4pt) ] /** Footers * */ /// El footer por defecto. /// - meta (dictionary): Contenido del archivo **meta.typ**' /// -> content #let footer1(meta) = base-footer[ #set text(style: "italic", weight: 1) #line(length: 100%, stroke: 0.4pt) #v(8pt) #grid(columns: (auto, 1fr), rows: auto)[ #set align(left + top) #meta.curso ][ #set align(right + top) #meta.titulo ] ] /****************************************************************************** * Show rules * * Las siguientes funciones están pensadas para utilizarse como show rules de * la forma: * *****************************************************************************/ /// Hace que el primer heading con numbering esté en una página nueva. Esta /// show rule es aplicada por defecto en el template. Puede ser desactivada /// usando el parámetro `showrules: false` en la show rule del template. /// Puede ser reactivada agregando esta línea: /// ```typ /// show: primer-heading-en-nueva-pag /// ``` /// /// - doc (content): Documento a aplicar la regla. /// -> content #let primer-heading-en-nueva-pag(doc) = { show heading: it => context { if counter(heading).get() == (1,) { pagebreak(weak: true) it } else { it } } doc } /** * */ #import "departamentos.typ" as departamentos #let departamentos = departamentos /****************************************************************************** * Template *****************************************************************************/ /// Función que aplica los estilos del template para infromes. /// /// - meta (dictionary, module): Archivo `meta.typ` /// - fuente (str): Fuente a usar en el texto. /// - portada (function): Portada a usar. /// - header (function): Header a usar. /// - footer (function): Footer a usar. /// - margenes-portada (dictionary): Márgenes de la portada. /// - margenes (dictionary): Márgenes del documento. /// - showrules (bool): Si es `true` se aplicarán showrules irreversibles. /// Si se requiere más personalización se recomiendo desactivar. /// - doc (content): Documento a aplicar el template. /// -> content #let report( meta, fuente: "", portada: portada1, header: header1, footer: footer1, margenes-portada: (top: 3.5cm), margenes: (top: 3.5cm), showrules: true, doc ) = { let portada-set-extra = (:) if margenes-portada != (:) { portada-set-extra.insert("margin", margenes-portada) } let author = meta.autores if type(meta.autores) == array { author = meta.autores.at(0) } set text(lang: "es", region: "cl", hyphenate: true) set heading(numbering: "1.") set par(leading: 0.5em, justify: true, linebreaks: "optimized") set document(author: author, date: datetime.today()) set math.equation(numbering: "(1)") set page(header: header(meta), footer: footer(meta), margin: margenes) if portada != none { set page(header: [], footer: [], ..portada-set-extra) portada(meta) } set page(numbering: "1") if showrules { show: primer-heading-en-nueva-pag doc } }
https://github.com/sitandr/typst-examples-book
https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/snippets/pretty.md
markdown
MIT License
# Pretty things ## Set bar to the text's left (also known as quote formatting) ```typ #let line-block = rect.with(fill: luma(240), stroke: (left: 0.25em)) + #lorem(10) \ #line-block[ *Solution:* #lorem(10) $ a_(n+1)x^n = 2... $ ] ``` ## Text on box top ```typ // author: gaiajack #let todo(body) = block( above: 2em, stroke: 0.5pt + red, width: 100%, inset: 14pt )[ #set text(font: "Noto Sans", fill: red) #place( top + left, dy: -6pt - 14pt, // Account for inset of block dx: 6pt - 14pt, block(fill: white, inset: 2pt)[*DRAFT*] ) #body ] #todo(lorem(100)) ``` ## Book Ornament ```typ // author: thevec #let parSepOrnament = [\ \ #h(1fr) $#line(start:(0em,-.15em), end:(12em,-.15em), stroke: (cap: "round", paint:gradient.linear(white,black,white))) #move(dx:.5em,dy:0em,"🙠")#text(15pt)[🙣] #h(0.4em) #move(dy:-0.25em,text(12pt)[✢]) #h(0.4em) #text(15pt)[🙡]#move(dx:-.5em,dy:0em,"🙢") #line(start:(0em,-.15em), end:(12em,-.15em), stroke: (cap: "round", paint:gradient.linear(white,black,white)))$ #h(1fr)\ \ ]; #lorem(30) #parSepOrnament #lorem(30) ```
https://github.com/orkhasnat/resume
https://raw.githubusercontent.com/orkhasnat/resume/master/modern-1P/resume-lib.typ
typst
#import "fa-lib.typ": * // font sizes #let bf = 8pt #let h1f = bf+4pt #let h2f = bf+2pt #let h2secf = bf+1pt #let h3f = bf - 1pt #let markerf = 7pt #let sepf = markerf - 2pt #let padf = 2pt #let spf= 1em // const color // #let color-darknight = rgb("131A28") #let color-darknight = rgb("141E1E") #let color-darkgray = rgb("213131") // #let default-accent-color = rgb("333ECC") #let default-accent-color = rgb("2C7865") #let color-lightgray = rgb("415161") // const icons #let linkedin-icon = box(fa-icon("linkedin", fa-set: "Brands", fill: color-darknight)) #let github-icon = box(fa-icon("github", fa-set: "Brands", fill: color-darknight)) #let phone-icon = box(fa-phone(fill: color-darknight)) #let email-icon = box(fa-icon("at", fill: color-darknight)) /// Helpers // layout utility #let __justify_align(left_body, right_body) = { set text(fill:color-lightgray ) block[ #left_body #box(width: 1fr)[ #align(right)[ #right_body ] ] ] } #let __justify_align_3(left_body, mid_body, right_body) = { block[ #box(width: 1fr)[ #align(left)[ #left_body ] ] #box(width: 1fr)[ #align(center)[ #mid_body ] ] #box(width: 1fr)[ #align(right)[ #right_body ] ] ] } #let github-link(github_path) = { set box(height: 11pt) align(right + horizon)[ #fa-icon("github", fa-set: "Brands", fill: color-darkgray) #link("https://github.com/" + github_path, github_path) ] } #let secondary-right-header(body, accent_color: default-accent-color) = { set text(accent_color, size: h2secf, style: "italic", weight: "medium") body } #let tertiary-right-header(body) = { set text(weight: "medium", style: "italic", size: h3f) body } #let justified-header(primary, secondary) = { set block(above: spf*0, below: spf*0.5) pad[ #__justify_align[ == #primary ][ #secondary-right-header[#secondary] ] ] } #let secondary-justified-header(primary, secondary) = { __justify_align[ === #primary ][ #tertiary-right-header[#secondary] ] } /// --- End of Helpers /// ---- Resume Template ---- #let resume( author: (:), // date: datetime.today().display("[month repr:long] [day], [year]"), accent_color: default-accent-color, body) = { set document( author: author.firstname + " " + author.lastname, title: "resume", ) set text( font: ("Atkinson Hyperlegible"), lang: "en", size: bf, fill: color-darkgray, hyphenate: false, fallback: true ) set page( paper: "a4", margin: (left: 15mm, right: 15mm, top: 10mm, bottom: 10mm), // footer: [ // #set text(fill: gray, size: bf) // #__justify_align_3[ // #smallcaps[#date] // ][ // #smallcaps[ // #author.firstname // #author.lastname // #sym.dot.c // #"Résumé" // ] // ][ // #counter(page).display() // ] // ], footer-descent: 0pt, ) // set paragraph spacing show par: set block(above: spf*0.75, below: spf*0.75) set par(justify: true) set heading( numbering: none, outlined: false, ) show heading.where(level:1): it => [ #set block(above: spf, below: spf) #set text( size: h1f, weight: "regular" ) #align(left)[ // Simple Design #text(fill:default-accent-color)[#strong[#it.body]] // Fancy Deesign // #text[#strong[#text(accent_color)[#it.body.text.slice(0, 3)]]]#strong[#text[#it.body.text.slice(3)]] #box(width: 1fr, line(length: 100%)) ] ] show heading.where(level: 2): it => { set text(color-darkgray, size: h2f, style: "normal", weight: "bold") it.body } show heading.where(level: 3): it => { set text(size: h3f, weight: "bold") smallcaps[#it.body] } let name = { align(center)[ #pad(bottom: sepf)[ #block[ #set text(size: 32pt, style: "normal", font: ("Free Serif")) #text(accent_color, weight: "regular")[#author.firstname] #text(weight: "bold")[#author.lastname] ] ] ] } let positions = { set text( accent_color, size: h2secf, weight: "regular" ) align(center)[ #smallcaps[ #author.positions.join( text[#" "#sym.dot.c#" "] ) ] ] } // let address = { // set text( // size: h2secf, // weight: "bold", // style: "italic", // ) // align(center)[ // #author.address // ] // } let contacts = { set box(height: markerf) let separator = box(width: sepf) align(center)[ #set text(size: bf, weight: "regular", style: "normal") #block[ #align(horizon)[ #phone-icon // #box[#text(author.phone)] #box[#link("tel:"+author.phone)[#author.phone]] #separator #email-icon #box[#link("mailto:" + author.email)[#author.email]] #separator #github-icon #box[#link("https://github.com/" + author.github)[#author.github]] #separator #linkedin-icon #box[ #link("https://www.linkedin.com/in/" + author.linkedin)[#author.firstname #author.lastname] ] ] ] ] } name positions contacts body } #let resume-item(body) = { set text(size: bf, style: "normal", weight: "light") set par(leading: spf*0.65) body } #let resume-entry( title: none, location: "", date: "", description: "" ) = { pad[ #justified-header(title, location) #secondary-justified-header(description, date) ] } #let resume-skill-item(category, items) = { set block(below: spf*0.45) set pad(top: padf) pad[ #grid( columns: (25fr, 70fr), gutter: 15pt, align(right)[ #set text(hyphenate: false) == #category ], align(left)[ #set text(size: h2secf, style: "normal", weight: "light",fill:default-accent-color,) #items.join(", ") ], ) ] } /// ---- End of Resume Template ---- // My custom functions #let resume-achievement(body) = { // let t = text.with(weight:"black") set list( tight:true, marker: ([#box(height:markerf,fa-trophy(fill:color-lightgray))],[]) ) body } #let resume-achievement2(title,rank) = { __justify_align[ === #fa-trophy(fill:color-lightgray) #text(fill:color-darkgray,weight:"black")[#title] ][ #tertiary-right-header[ #text(fill:default-accent-color)[#rank] ] ] // secondary-justified-header(fa-trophy()+title,rank) } #let resume-cocurr(body) = { set list( tight:true, marker: [#box(height:markerf,fa-award(fill:color-lightgray))] ) body } #let resume-project( title: none, location: "", stack:"" ) = { pad[ #justified-header(title, location) #set text(fill:color-lightgray,weight:"bold") #set list( tight: true, marker:[#box(height:markerf,fa-code(fill:default-accent-color))], indent: padf, body-indent: spf*0.5 ) - #stack ] }
https://github.com/gekoke/resume
https://raw.githubusercontent.com/gekoke/resume/main/main.typ
typst
#import "lib.typ": resume, icon, experience, project, language, volunteering #show: resume.with( author: "<NAME>", contacts: ( [#icon("icons/solid/envelope.svg") #link("mailto:<EMAIL>")], [#icon("icons/solid/globe.svg") #link("https://www.grigorjan.net/")[grigorjan.net]], [#icon("icons/brands/github.svg") #link("https://github.com/gekoke")[gekoke]], [#icon("icons/brands/linkedin.svg") #link("https://www.linkedin.com/in/gregor-grigorjan/")[gregor-grigorjan]], ), ) = Summary Software enthusiast and open-source contributor with nearly 7 years of experience and a knack for Linux systems. Most proficient in mainstream object-oriented languages, but a polyglot with a penchant for functional paradigms at heart. = Work Experience #experience( [#link("https://www.gamesglobal.com/")[Games Global]], "Software Development Intern", "Tallinn, Estonia", "Sep 2024 - present", [], ) #experience( "Orkla Accounting Centre", "Data Analyst", "Tallinn, Estonia", "Jun 2021 - Oct 2022", [ - Maintained software deployments processing thousands of invoices per month - Developed mission-critical .NET application to parse thousands of sales data entries - Eliminated administrative processes saving hours of time per month using Python and Selenium ], ) = Entrepreneurial Experience #experience( [#link("https://www.abiõpetaja.ee")[Abiõpetaja]], "Technical Co-Founder", "Tallinn, Estonia", "Jan 2024 - present", [ - Developed Django application and guaranteed its reliability with end-to-end NixOS tests - Ensured reproducible provisioning of infrastructure using Terraform (OpenTofu) - Bootstrapped a reliable CI/CD pipeline to AWS using Nix, NixOS, and GitHub Actions ], ) = Education #experience( "TalTech", "BSc - Computer Science", "Tallinn, Estonia", "Sep 2020 - Jun 2024", [ - Tutored coursemates in Python, Java, C++, Haskell, Idris, and Ansible courses ], ) = Personal Projects #project( [#link("https://github.com/gekoke/magit-file-icons")[magit-file-icons]], [ An Emacs Lisp package which prefixes filenames in the #link("https://github.com/magit/magit")[Magit Git client] with #link("https://www.nerdfonts.com/")[Nerd Font] icons ], ) #project( [#link("https://github.com/gekoke/dotfiles")[dotfiles]], [ Declarative and reproducible system configurations with Nix ], ) #project( [#link("https://github.com/gekoke/AntSimulator")[AntSimulator]], [ A simple ant simulator inspired by the work of <NAME> and <NAME> ], ) = Cybersecurity Competitions - Finalist at CyberSpike 2023 - Ranked \#4 in Estonia on #link("https://ctftime.org/team/223398")[CTFTime] in 2023 = Volunteering #volunteering( [#link("https://nixos.org/")[NixOS]], "Contributor", "Oct 2022 - present", [ - Packaging and updating software for the world's largest package archive #link("https://github.com/NixOS/nixpkgs")[nixpkgs] - Assisting users in the NixOS Matrix channel ], ) #volunteering( [#link("https://www.gnu.org/")[GNU Project]], "Community Member", "May 2023 - present", [ - Maintaining a #link("https://melpa.org/")[MELPA] package - Assisting users in the Emacs Matrix channel ], ) = Languages #language("Estonian", "Native") #language("English", "C2")
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/op/binary.typ
typst
Apache License 2.0
#{ let f(x) = x f("Unsupported content type "+type(content)+"! "+ "Provide your own `draw-node` implementation.") }
https://github.com/denizenging/site
https://raw.githubusercontent.com/denizenging/site/master/page/works/index.tr.typ
typst
#import "@local/pub-page:0.0.0": * #show: template( title: "Çalışmalar", description: "Yayınlarım, konuşmalarım ve dahası!", menu: (3, "certificate"), ) ORCID iD (kimlikğimi) profil fotoğrafımının hemen altında bulabilirsiniz. Bilgisayarda iseniz sol tarafta, telefonda iseniz de üst tarafta bulunmaktadır. Ayrıca kendisine bağlantılarımın #link("/page/links")[bulunduğu sayfadan] da ulaşabilirsiniz. = Makaleler Eklenecek... = Konuşmalar Eklenecek... = Posterler Eklenecek...
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/grayness/0.1.0/README.md
markdown
Apache License 2.0
# Grayness A package providing simple image editing capabilities via a WASM plugin. Available functionality includes converting images to grayscale, cropping and flipping the images. Furthermore, this package supports adding transparency and bluring (very slow) as well as handling additional raster image formats. The package name is inspired by the blurry, gray images of Nessie, the [Loch Ness Monster](https://en.wikipedia.org/wiki/Loch_Ness_Monster) ## Usage Due to the way typst currently interprets given paths, you have to read the images yourself in the calling typst file. This raw imagedata can then be passed to the grayness-package functions, like grayscale-image. These functions also optionally accept all additional parameters of the original typst image function like `width` or `height`: ```typst #import "@preview/grayness:0.1.0": grayscale-image #let data = read("Art.webp", encoding: none) #grayscale-image(data, width: 50%) ``` A detailed descriptions of all available functions is provided in the [manual](manual.pdf). ## Examples Here are several functions applied to a WEBP image of [<NAME>](https://commons.wikimedia.org/wiki/File:Arturo_Nieto-Dorantes.webp) (CC-By-SA 4.0): ![Example image manipulations](example.png)
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/field-03.typ
typst
Other
// Error: 9-16 function `assert` does not contain field `invalid` #assert.invalid
https://github.com/sofianedjerbi/ResumeOld
https://raw.githubusercontent.com/sofianedjerbi/ResumeOld/main/modules/certificates.typ
typst
Apache License 2.0
#import "../brilliant-CV/template.typ": * #cvSection("Certifications") #cvHonor( date: [2024], title: [AWS Certified Cloud Practitioner], issuer: [#link("https://www.credly.com/badges/cf4d255c-4844-4a68-8c36-8b581cf26552")[AWS]] ) #cvHonor( date: [2024], title: [AWS Certified Solutions Architect Associate], issuer: [#link("https://www.credly.com/badges/9becf713-3bbd-4337-8df8-69d4ff0b0609")[AWS]] )
https://github.com/FinleyGe/typst-profile
https://raw.githubusercontent.com/FinleyGe/typst-profile/main/example.typ
typst
#import "template/lib.typ": * #show: conf.with( pic: "placeholder.png", name: "张三", sex: "男", birthday: "2001-01-01", phone: "19999999999", email: "<EMAIL>", address: "xx省xx市xx区xx路xx号", ) #container( title: "校园经历", [ #triple( "2019.09 - 2023.06", "xx大学", "计算机科学与技术" ) ] ) #container( title: "技能", [ #pair("编程语言", "C, C++, Java, Python, JavaScript") #pair("技术栈", "React, Vue, Node.js, Spring Boot, Flask") ] )
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/tracking-spacing-03.typ
typst
Other
// Test tracking in arabic text (makes no sense whatsoever) #set text(tracking: 0.3em) النص
https://github.com/chilingg/kaiji
https://raw.githubusercontent.com/chilingg/kaiji/main/template/contents.typ
typst
Other
#import "main.typ": font_size_list #columns(2)[ #align(center)[ #show outline.entry.where( level: 1 ): it => { set text(size: font_size_list.at(1), weight: "medium") block(below: 0em, above: 2em)[ #it.body <sans_font> #h(1fr) #text(size: font_size_list.at(2), it.page) ] } #show outline.entry.where( level: 2 ): it => { set text(size: font_size_list.at(2), weight: "medium") box(width: 90%)[ #it.body <sans_font> #h(1fr) #it.page ] } #show outline.entry.where( level: 3 ): it => { set text(size: font_size_list.at(3), weight: "medium") box(width: 80%)[ #it.body.children.at(2) - #it.page #h(1fr) ] } #outline( title: none, fill: none ) ] ]
https://github.com/Shuenhoy/modern-zju-thesis
https://raw.githubusercontent.com/Shuenhoy/modern-zju-thesis/master/utils/indent-first-par.typ
typst
MIT License
// Source from: https://github.com/nju-lug/modern-nju-thesis #let empty-par = par[#box()] #let fake-par = context empty-par + v(-measure(empty-par + empty-par).height) #let indent-first-par(s) = { show heading: it => { it fake-par } s }
https://github.com/curvenote/pubmatter
https://raw.githubusercontent.com/curvenote/pubmatter/main/validate-frontmatter.typ
typst
MIT License
#let validateContent(raw, name, alias: none) = { if (name in raw) { assert(type(raw.at(name)) == str or type(raw.at(name)) == content, message: name + " must be a string or content") return raw.at(name) } if (type(alias) != array) { return } for a in alias { if (a in raw) { validateContent(raw, a) } } } #let validateString(raw, name, alias: none) = { if (name in raw) { assert(type(raw.at(name)) == str, message: name + " must be a string") return raw.at(name) } if (type(alias) != array) { return } for a in alias { if (a in raw) { validateString(raw, a) } } } #let validateBoolean(raw, name, alias: none) = { if (name in raw) { assert(type(raw.at(name)) == bool, message: name + " must be a boolean") return raw.at(name) } if (type(alias) != array) { return } for a in alias { if (a in raw) { validateBoolean(raw, a) } } } #let validateArray(raw, name, alias: none) = { if (name in raw) { assert(type(raw.at(name)) == array, message: name + " must be an array") return raw.at(name) } if (type(alias) != array) { return } for a in alias { if (a in raw) { validateArray(raw, a) } } } #let validateDate(raw, name, alias: none) = { if (name in raw) { let rawDate = raw.at(name) if (type(rawDate) == datetime) { return rawDate } if (type(rawDate) == int) { // assume this is the year assert(rawDate > 1000 and rawDate < 3000, message: "The date is assumed to be a year between 1000 and 3000") return datetime(year: rawDate, month: 1, day: 1) } if (type(rawDate) == str) { let yearMatch = rawDate.find(regex(`^([1|2])([0-9]{3})$`.text)) if (yearMatch != none) { // This isn't awesome, but probably fine return datetime(year: int(rawDate), month: 1, day: 1) } let dateMatch = rawDate.find(regex(`^([1|2])([0-9]{3})([-\/])([0-9]{1,2})([-\/])([0-9]{1,2})$`.text)) if (dateMatch != none) { let parts = rawDate.split(regex("[-\/]")) return datetime( year: int(parts.at(0)), month: int(parts.at(1)), day: int(parts.at(2)), ) } panic("Unknown datetime object from string, try: `2020/03/15` as YYYY/MM/DD, also accepts `2020-03-15`") } if (type(rawDate) == dictionary) { if ("year" in rawDate and "month" in rawDate and "day" in rawDate) { return return datetime( year: rawDate.at("year"), month: rawDate.at("month"), day: rawDate.at("day"), ) } if ("year" in rawDate and "month" in rawDate) { return return datetime( year: rawDate.at("year"), month: rawDate.at("month"), day: 1, ) } if ("year" in rawDate) { return return datetime( year: rawDate.at("year"), month: 1, day: 1, ) } panic("Unknown datetime object from dictionary, try: `(year: 2022, month: 2, day: 3)`") } panic("Unknown date of type '" + type(rawDate)+ "' accepts: datetime, str, int, and object") } if (type(alias) != array) { return } for a in alias { if (a in raw) { return validateDate(raw, a) } } } #let validateAffiliation(raw) = { let out = (:) if (type(raw) == str) { out.name = raw; return out; } let id = validateString(raw, "id") if (id != none) { out.id = id } let name = validateString(raw, "name") if (name != none) { out.name = name } let institution = validateString(raw, "institution") if (institution != none) { out.institution = institution } let department = validateString(raw, "department") if (department != none) { out.department = department } let doi = validateString(raw, "doi") if (doi != none) { out.doi = doi } let ror = validateString(raw, "ror") if (ror != none) { out.ror = ror } let address = validateString(raw, "address") if (address != none) { out.address = address } let city = validateString(raw, "city") if (city != none) { out.city = city } let region = validateString(raw, "region", alias: ("state", "province")) if (region != none) { out.region = region } let postal-code = validateString(raw, "postal-code", alias: ("postal_code", "postalCode", "zip_code", "zip-code", "zipcode", "zipCode")) if (postal-code != none) { out.postal-code = postal-code } let country = validateString(raw, "country") if (country != none) { out.country = country } let phone = validateString(raw, "phone") if (phone != none) { out.phone = phone } let fax = validateString(raw, "fax") if (fax != none) { out.fax = fax } let email = validateString(raw, "email") if (email != none) { out.email = email } let url = validateString(raw, "url") if (url != none) { out.url = url } let collaboration = validateBoolean(raw, "collaboration") if (collaboration != none) { out.collaboration = collaboration } return out; } #let pickAffiliationsObject(raw) = { if ("affiliation" in raw and "affiliations" in raw) { panic("You can only use `affiliation` or `affiliations`, not both") } if ("affiliation" in raw) { raw.affiliations = raw.affiliation } if ("affiliations" not in raw) { return; } if (type(raw.affiliations) == str or type(raw.affiliations) == "dictionary") { // convert to a list return (validateAffiliation(raw.affiliations),) } else if (type(raw.affiliations) == "array") { // validate each entry return raw.affiliations.map(validateAffiliation) } else { panic("The `affiliation` or `affiliations` must be a array, dictionary or string, got:", type(raw.affiliations)) } } #let validateAuthor(raw) = { let out = (:) if (type(raw) == str) { out.name = raw; out.affiliations = () return out; } let name = validateString(raw, "name") if (name != none) { out.name = name } let orcid = validateString(raw, "orcid", alias: ("ORCID",)) if (orcid != none) { out.orcid = orcid } let email = validateString(raw, "email") if (email != none) { out.email = email } let corresponding = validateBoolean(raw, "corresponding") if (corresponding != none) { out.corresponding = corresponding } else if (email != none) { out.corresponding = true } let phone = validateString(raw, "phone") if (phone != none) { out.phone = phone } let fax = validateString(raw, "fax") if (fax != none) { out.fax = fax } let url = validateString(raw, "url", alias: ("website", "homepage")) if (url != none) { out.url = url } let github = validateString(raw, "github") if (github != none) { out.github = github } let deceased = validateBoolean(raw, "deceased") if (deceased != none and deceased) { out.deceased = deceased } let equal-contributor = validateBoolean(raw, "equal_contributor", alias: ("equal-contributor", "equalContributor")) if (equal-contributor != none and equal-contributor) { out.equal-contributor = equal-contributor } let note = validateString(raw, "note") if (note != none) { out.note = note } let affiliations = pickAffiliationsObject(raw); if (affiliations != none) { out.affiliations = affiliations } else { out.affiliations = () } return out; } #let consolidateAffiliations(authors, affiliations) = { let cnt = 0 for affiliation in affiliations { if ("id" not in affiliation) { affiliation.insert("id", "aff-" + str(cnt + 1)) } affiliations.at(cnt) = affiliation cnt += 1 } let authorCnt = 0 for author in authors { let affCnt = 0 for affiliation in author.affiliations { let pos = affiliations.position(item => { ("id" in item and item.id == affiliation.name) or ("name" in item and item.name == affiliation.name) }) if (pos != none) { affiliation.remove("name") affiliation.id = affiliations.at(pos).id affiliations.at(pos) = affiliations.at(pos) + affiliation } else { affiliation.id = if ("id" in affiliation) { affiliation.id } else { affiliation.name } affiliations.push(affiliation) } author.affiliations.at(affCnt) = (id: affiliation.id) affCnt += 1 } authors.at(authorCnt) = author authorCnt += 1 } // Now that they are normalized, loop again and update the numbers let fullAffCnt = 0 let authorCnt = 0 for author in authors { let affCnt = 0 for affiliation in author.affiliations { let pos = affiliations.position(item => { item.id == affiliation.id }) let aff = affiliations.at(pos) if ("index" not in aff) { fullAffCnt += 1 aff.index = fullAffCnt affiliations.at(pos) = affiliations.at(pos) + (index: fullAffCnt) } author.affiliations.at(affCnt) = (id: affiliation.id, index: aff.index) affCnt += 1 } authors.at(authorCnt) = author authorCnt += 1 } return (authors: authors, affiliations: affiliations) } /// Create a short citation in APA format, e.g. Cockett _et al._, 2023 /// - show-year (boolean): Include the year in the citation /// - fm (fm): The frontmatter object /// -> content #let show-citation(show-year: true, fm) = { if ("authors" not in fm) {return none} let authors = fm.authors let date = fm.date let year = if (show-year and date != none) { ", " + date.display("[year]") } else { none } if (authors.len() == 1) { return authors.at(0).name.split(" ").last() + year } else if (authors.len() == 2) { return authors.at(0).name.split(" ").last() + " & " + authors.at(1).name.split(" ").last() + year } else if (authors.len() > 2) { return authors.at(0).name.split(" ").last() + " " + emph("et al.") + year } return none } #let validateLicense(raw) = { if ("license" not in raw) { return none } let rawLicense = raw.at("license") if (type(rawLicense) == str) { if (rawLicense == "CC0" or rawLicense == "CC0-1.0") { return ( id: "CC0-1.0", url: "https://creativecommons.org/licenses/zero/1.0/", name: "Creative Commons Zero v1.0 Universal", ) } else if (rawLicense == "CC-BY" or rawLicense == "CC-BY-4.0") { return ( id: "CC-BY-4.0", url: "https://creativecommons.org/licenses/by/4.0/", name: "Creative Commons Attribution 4.0 International", ) } else if (rawLicense == "CC-BY-NC" or rawLicense == "CC-BY-NC-4.0") { return ( id: "CC-BY-NC-4.0", url: "https://creativecommons.org/licenses/by-nc/4.0/", name: "Creative Commons Attribution Non Commercial 4.0 International", ) } else if (rawLicense == "CC-BY-NC-SA" or rawLicense == "CC-BY-NC-SA-4.0") { return ( id: "CC-BY-NC-SA-4.0", url: "https://creativecommons.org/licenses/by-nc-sa/4.0/", name: "Creative Commons Attribution Non Commercial Share Alike 4.0 International", ) } else if (rawLicense == "CC-BY-ND" or rawLicense == "CC-BY-ND-4.0") { return ( id: "CC-BY-ND-4.0", url: "https://creativecommons.org/licenses/by-nd/4.0/", name: "Creative Commons Attribution No Derivatives 4.0 International", ) } else if (rawLicense == "CC-BY-NC-ND" or rawLicense == "CC-BY-NC-ND-4.0") { return ( id: "CC-BY-NC-ND-4.0", url: "https://creativecommons.org/licenses/by-nc-nd/4.0/", name: "Creative Commons Attribution Non Commercial No Derivatives 4.0 International", ) } panic("Unknown license string: '" + rawLicense + "'") } if (type(rawLicense) == dictionary) { assert("id" in rawLicense and "url" in rawLicense and "name" in rawLicense, message: "License nust contain fields of 'id' (the SPDX ID), 'url': the URL to the license, and 'name' the human-readable license name") let id = validateString(rawLicense, "id") let url = validateString(rawLicense, "url") let name = validateString(rawLicense, "name") return (id: id, url: url, name: name) } panic("Unknown format for license: '" + type(rawLicense) + "'") } #let load(raw) = { let out = (:) let title = validateContent(raw, "title") if (title != none) { out.title = title } let subtitle = validateContent(raw, "subtitle") if (subtitle != none) { out.subtitle = subtitle } let short-title = validateString(raw, "short-title", alias: ("short_title", "shortTitle", "running-head", "running_head", "runningHead", "runningTitle", "running_title", "running-title")) if (short-title != none) { out.short-title = short-title } // author information if ("author" in raw and "authors" in raw) { panic("You can only use `author` or `authors`, not both") } if ("author" in raw) { raw.authors = raw.author } if ("authors" in raw) { if (type(raw.authors) == str or type(raw.authors) == "dictionary") { // convert to a list out.authors = (validateAuthor(raw.authors),) } else if (type(raw.authors) == "array") { // validate each entry out.authors = raw.authors.map(validateAuthor) } else { panic("The `author` or `authors` must be a array, dictionary or string, got:", type(raw.authors)) } } else { out.authors = () } let affiliations = pickAffiliationsObject(raw); if (affiliations != none) { out.affiliations = affiliations } else { out.affiliations = () } let open-access = validateBoolean(raw, "open-access", alias: ("open_access", "openAccess",)) if (open-access != none) { out.open-access = open-access } let venue = validateString(raw, "venue") if (venue != none) { out.venue = venue } let license = validateLicense(raw) if (license != none) { out.license = license } let doi = validateString(raw, "doi") if (doi != none) { assert(not doi.starts-with("http"), message: "DOIs should not include the link, use only the part after `https://doi.org/[]`") out.doi = doi } if ("date" in raw) { out.date = validateDate(raw, "date"); } else { out.date = datetime.today() } let citation = validateString(raw, "citation") if (citation != none) { out.citation = citation; } else { out.citation = show-citation(out) } if ("abstract" in raw and "abstracts" in raw) { panic("You can only use `abstract` or `abstracts`, not both") } if ("abstract" in raw) { raw.abstracts = raw.abstract } if ("abstracts" in raw) { if (type(raw.abstracts) == str or type(raw.abstracts) == content) { raw.abstracts = (content: raw.abstracts) } if (type(raw.abstracts) == dictionary) { if ("title" not in raw.abstracts) { raw.abstracts.title = "Abstract" } raw.abstracts = (raw.abstracts,) } if (type(raw.abstracts) == array) { // validate each entry out.abstracts = raw.abstracts.map((abs) => { if (type(abs) != dictionary or "title" not in abs or "content" not in abs) { return } return (title: abs.at("title"), content: abs.at("content")) }) } else { panic("The `abstract` or `abstracts` must be content, or an array, got:", type(raw.abstracts)) } } let keywords = validateArray(raw, "keywords") if (keywords != none) { out.keywords = keywords.map((k) => validateString((keyword: k), "keyword")) } let consolidated = consolidateAffiliations(out.authors, out.affiliations) out.authors = consolidated.authors out.affiliations = consolidated.affiliations return out }
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/design_concept/content/design/design_iteration_1_scratch_inspired.typ
typst
= Scratch-inspired design <scratch-inspired-design> The proposal of the scratch-inspired design takes scratch's imperative block style and converts it into the context of an expressional and declarative setup. Functions, variables, parameters, etc., are portrayed as colorful blocks that can be dragged on top of each other. == Function Declaration, Composition and Application Function declarations are displayed as red blocks with light-blue parameters below them, and the main expression above it, as shown in @scratch_inspired_addition. #figure( image("../../static/scratch-inspired-addition.svg", width: 30%), caption: "Example of scratch-inspired function definition for an addition function" )<scratch_inspired_addition> Functions used in expressions are displayed as green blocks and can be applied by inserting blocks to the parameters declared above them. Their name is shown inside the block, whereas the alignment of the name (left, center, right) doesn't bear any semantic meaning. == Type Holes If a parameter is left unapplied, a type hole is shown instead as a violet block with the expected value type as its name. Such a type hole can be seen in @scratch_inspired_type_hole. #figure( image("../../static/scratch-inspired-mapAdd5.svg", width: 25%), caption: "Example of scratch-inspired function definition with a type hole" )<scratch_inspired_type_hole> In @scratch_inspired_type_hole, the second parameter of the `(+)` function is left unapplied, and thus, a type hole of type `Int` is shown. == Pattern Matching Pattern matching is provided as a dedicated block that takes a value as a parameter and has the list of possible patterns as its pre-applied arguments. These cases then offer the matched patterns as values and can be supplied with blocks to specify the expression to be evaluated. An example of such a function can be seen in @scratch_inspired_product. #figure( image("../../static/scratch-inspired-product.svg", width: 50%), caption: "Example of scratch-inspired function definition with pattern matching" )<scratch_inspired_product>
https://github.com/SkytAsul/fletchart
https://raw.githubusercontent.com/SkytAsul/fletchart/main/src/logical.typ
typst
#import "declarative.typ": fc-declarative #import "elements.typ": * #import "utils.typ": map-auto #let logic-action(type, content, ..node-options) = { assert(node-options.pos().len() == 0, message: "Cannot pass non-named node options.") metadata(( class: "action", type: type, content: content, node-options: node-options.named() )) } #let fc-process = logic-action.with(process) #let fc-predefined-process = logic-action.with(predefined-process) #let fc-begin = logic-action.with(beginning) #let fc-end = logic-action.with(end) #let fc-io = logic-action.with(input-output) /// Creates an "if" branching. /// - content (content): Content shown on the condition block. /// /// - yes (content): Content of the "yes" branch. /// /// Same type as the #the-param[fc-logical][content]. /// /// - yes-label (str, content): Label shown on the "yes" arrow. /// /// - no (content): Content of the "no" branch. /// /// Same type as the #the-param[fc-logical][content]. /// /// - no-label (str, content): Label shown on the "no" arrow. #let fc-if(content, yes-label: auto, yes, no-label: auto, no, ..node-options) = { // Cannot name it "if" because it's a reserved keyword. Same for "no": cannot name it "else". assert(node-options.pos().len() == 0, message: "Cannot pass non-named node options.") // We do not parse and create the condition element right here // because we lack context on how to decide the ID of the element. metadata(( class: "if", content: content, yes-label: yes-label, yes: yes, no-label: no-label, no: no, node-options: node-options.named() )) } /// Parses the elements from a logical content /// and returns an ordered list of elements. /// - logic (content): content to parse the logic from /// - n (int): amount of elements already parsed /// - options (dict): options of the logic flowchart /// - next-element (element): element that should follow the parsed ones in the logical order #let parse-contents(logic, n, options, next-element: none) = { assert.eq(type(logic), content, message: "logic parameter has wrong type") let elements = () let logic-elements = if logic.has("children") { logic.children } else { (logic,) } let content-accumulator = [] for (index, content-piece) in logic-elements.rev().enumerate(){ if content-piece.func() != metadata { content-accumulator = content-piece + content-accumulator if index + 1 == logic-elements.len() or logic-elements.at(index - 1).func() == metadata { content-piece = fc-process(content-accumulator) content-accumulator = [] } else { continue } } assert.eq(content-piece.func(), metadata, message: "Invalid content child type") let obj = content-piece.value if obj.class == "action" { n += 1 if obj.type == end { next-element = none } next-element = action(str(n), obj.content, destination: next-element, type: obj.type, ..obj.node-options) elements.push(next-element) if obj.type == beginning { next-element = none } } else if obj.class == "if" { let choices = () for (branch-label, branch-label-default, branch-logic) in ((obj.yes-label, options.if-yes-label, obj.yes), (obj.no-label, options.if-no-label, obj.no)) { let branch-elements = parse-contents(branch-logic, n, options, next-element: next-element) if branch-elements.len() == 0 { continue } n += branch-elements.len() elements += branch-elements.rev() choices.push(choice(branch-elements.at(0), label: map-auto(branch-label, branch-label-default))) } n += 1 next-element = condition(str(n), obj.content, ..choices, ..obj.node-options) elements.push(next-element) } else { assert(false, "Unknown object class " + obj.class) } } return elements.rev() } /// Creates a flowchart based on a logical block. /// - elements (content): Content of the flowchart. /// /// A combination of `fc-if`, `fc-process`, `fc-predinfed-process`, /// `fc-begin`, `fc-end` and `fc-io` function calls, or `content` objects. /// /// - if-yes-label (str, content): default value of #the-param[fc-if][yes-label] /// /// - if-no-label (str, content): default value of #the-param[fc-if][no-label] /// /// - other configuration parameters, the same ones as in `fc-declarative`. #let fc-logical(logic, if-yes-label: "yes", if-no-label: "no", elements-style-override: (:), debug: false) = { let options = ( if-yes-label: if-yes-label, if-no-label: if-no-label ) let elements = parse-contents(logic, 0, options) let elements-content = elements.join() fc-declarative( elements-content, elements-style-override: elements-style-override, debug: debug ) }
https://github.com/fenjalien/metro
https://raw.githubusercontent.com/fenjalien/metro/main/tests/num/group-minimum-digits/test.typ
typst
Apache License 2.0
#import "/src/lib.typ": num, metro-setup #set page(width: auto, height: auto) #num[1234] #num[12345] #num(group-minimum-digits: 4)[1234] #num(group-minimum-digits: 4)[12345] #num[1234.5678] #num[12345.67890] #num(group-minimum-digits: 4)[1234.5678] #num(group-minimum-digits: 4)[12345.67890]
https://github.com/Enter-tainer/m-jaxon
https://raw.githubusercontent.com/Enter-tainer/m-jaxon/master/mj.typ
typst
MIT License
#import "./typst-package/lib.typ" as m-jaxon // Uncomment the following line to use the m-jaxon from the official package registry // #import "@preview/m-jaxon:0.1.1" #set page(height: auto, width: auto, margin: 2em, fill: white) = M-Jaxon #m-jaxon.render(`\mathcal{M}-\mathrm{jaxon}`, inline: true) Typst, now with *MathJax*. The equation of mass-energy equivalence is often written as $E=m c^2$ in modern physics. But we can also write it using M-Jaxon as: #m-jaxon.render(`E = mc^2`, inline: true), which is ```#m-jaxon.render(`E = mc^2`, inline: true)``` #let code = ``` \vec{\nabla} \times \vec{F} = \left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right) \mathbf{i} + \left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right) \mathbf{j} + \left( \frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right) \mathbf{k} ``` #table(columns: (30em, 30em), inset: 10pt, align: horizon, [Typst], [M-Jaxon], [$ arrow(nabla) times arrow(F) eq lr((frac(diff F_z, diff y) minus frac(diff F_y, diff z))) bold(i) plus lr((frac(diff F_x, diff z) minus frac(diff F_z, diff x))) bold(j) plus lr((frac(diff F_y, diff x) minus frac(diff F_x, diff y))) bold(k) $], [#m-jaxon.render(code, inline: false)], [`$ arrow(nabla) times arrow(F) eq lr((frac(diff F_z, diff y) minus frac(diff F_y, diff z))) bold(i) plus lr((frac(diff F_x, diff z) minus frac(diff F_z, diff x))) bold(j) plus lr((frac(diff F_y, diff x) minus frac(diff F_x, diff y))) bold(k) $`], [#code] )
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/bugs/block-width-box_00.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page #block(width: 100%, fill: red, box("a box")) #block(width: 100%, fill: red, [#box("a box") #box()])
https://github.com/csimide/SEU-Typst-Template
https://raw.githubusercontent.com/csimide/SEU-Typst-Template/master/seu-thesis/utils/states.typ
typst
MIT License
#let part-state = state("part")
https://github.com/osbm/resume
https://raw.githubusercontent.com/osbm/resume/main/resume.typ
typst
#import "@preview/modern-cv:0.6.0": * #show: resume.with( author: ( firstname: "<NAME>.", lastname: "Bayram", email: "<EMAIL>", // phone: "(+1) 111-111-1111", github: "osbm", twitter: "the_osbm", website: "https://osbm.dev", // scholar: "", birth: "7 April 2001", linkedin: "osbm", address: "Turkey / Istanbul", positions: ( "Deep Learning Engineer", "Student Researcher", "Open Source Contributor", ), ), date: datetime.today().display(), language: "en", colored-headers: true, ) = About Me I have always been passionate about Computers and Science Fiction. And naturally the field of AI has been the perfect intersection of these two interests. I have worked on Large Language Models, Reinforcement Learning, and Tabular Data. But most of my experience lies in Computer Vision and Medical Imaging. I also love using Linux in day-to-day life and contributing to Open Source Projects. Reading sci-fi novels and watching movies are my favorite pastime activities. Dont hesitate to reach out to me if you have any questions or just want to chat. = Experience #resume-entry( title: "Research Intern", location: "Istanbul, Turkey", date: "2023 - Present", description: "Tubitak 1001 Project funding program", // title-link: "https", ) #resume-item[ - *Project Name*: Assessment of Prostate Cancer with Machine Learning in Quantitative Synthetic Prostate Magnetic Resonance Imaging - Developed end-to-end deep learning models for prostate cancer detection and segmentation. - Worked on kspace data for image reconstruction. - Trained models that start from raw kspace data and output the lesion segmentation. ] #resume-entry( title: "Summer Intern", location: "Istanbul, Turkey", date: "2024", description: "Hevi.AI", ) #resume-item[ - Helped maintain existing nnunet models and improved their performance. - Trained and modeled a deep learning pipeline for an Image Segmentation task on Private Hospital Data. // - After confirming performance had improved, deployed the model on the cloud and integrated it into the company's product. ] = Projects, Models, and Datasets #show link: underline Github: #link("https://github.com/osbm")[github.com/osbm] Kaggle: #link("https://kaggle.com/osmanf")[kaggle.com/osmanf] Huggingface Hub: #link("https://huggingface.co/osbm")[hf.co/osbm] Docker Hub: #link("https://hub.docker.com/u/osbm")[hub.docker.com/u/osbm] = Skills #resume-skill-item("Languages",(strong("C++"), strong("Python"), "CUDA", "JavaScript")) #resume-skill-item("Libraries", (strong("Pytorch"), "Tensorflow", "Huggingface Transformers", "OpenCV")) #resume-skill-item("Spoken Languages", (strong("English"), strong("Turkish"))) #resume-skill-item("Tools", (strong("Git"),strong("Linux"), "Docker")) = Education #resume-entry( title: "Bahçeşehir University", location: "Turkey / Istanbul", date: "August 2021 - May 2025", // artificial intelligence engineering description: "Bachelor of Engineering in Artificial Intelligence (100% Scholarship)", ) = Research #resume-entry( title: "Target Specific De Novo Design of Drug Candidate Molecules with Graph Transformer-based Generative Adversarial Networks", location: "https://arxiv.org/abs/2302.07868", ) #resume-item[A new Architecture for Drug Design with Graph Transformer-based Generative Adversarial Networks. I volunteered to work on this project and contributed to the live demo implementation.] = Certifications #resume-item[ - Deep Learning Specialization, DeepLearning.AI - Huggingface Deep Reinforcement Learning Course Certificate of Excellence - DevOps, DataOps, MLOps, Duke University ]
https://github.com/GuilloteauQ/qcv
https://raw.githubusercontent.com/GuilloteauQ/qcv/main/qcv.typ
typst
MIT License
#let qcv_size_col_left = 20% #let qcv_space_between_cols = 1% #let qcv_color = blue #let qcv_gray = rgb("#888888") #let qcv_size_section_title = 20pt #let qcv_size_entry_title = 15pt #let qcv_size_entry_details = 12pt #let qcv_size_years = 8pt #let qcv(body) = { set page( fill: white, margin: 3em, header: none, footer: none, ) show heading: it => [ #set align(left) #box(rect(width: qcv_size_col_left, height: 7pt, fill: qcv_color)) #text(it.body, fill: qcv_color, size: qcv_size_section_title) ] body } #let header( name, email: none, webpage: none, orcid: none, ) = { grid( columns: (1.8fr, 1fr), align(center + horizon, text(40pt)[ #name ]), align(right, text(12pt, fill: qcv_gray)[ #box(image("./orcid.logo.icon.svg", width:6%)): #link("https://orcid.org/" + orcid)[#orcid] #link(webpage) #link("mailto:" + email) ]) ) } #let raw_entry( min_year, max_year, year_start, year_end, title: none, details: none ) = { let year_size = 100% * (year_end - year_start) / (max_year - min_year) let start_percentage = 100% * ((year_start - min_year) / (max_year - min_year)) let years_text = if year_start == year_end or year_end == max_year { text(qcv_size_years)[#year_start] } else { text(qcv_size_years)[#year_start - #year_end] } let rect_or_circle = if year_start == year_end { circle(radius: 2pt, fill: qcv_color) } else if year_end == max_year { rect(width: year_size, height: 4pt, fill: gradient.linear(qcv_color, white)) } else { rect(width: year_size, height: 4pt, fill: qcv_color) } let align_top_of_rect(body) = context { let size = measure(body) move(dx: start_percentage + (year_size - size.width) / 2 + if year_start == year_end { 2pt } else {0pt}, dy: -1.5pt, body) } grid( columns: (qcv_size_col_left, qcv_space_between_cols, 100% - qcv_space_between_cols - qcv_size_col_left), align(left + horizon, stack( align_top_of_rect(years_text), move(dx: start_percentage, rect_or_circle), rect(width: 100%, height:0.5pt, fill: qcv_gray) ) ), "", align(left, [ #text(qcv_size_entry_title, weight: "bold")[#title] #text(qcv_size_entry_details)[#details] ]) ) }
https://github.com/AliothCancer/AppuntiUniversity
https://raw.githubusercontent.com/AliothCancer/AppuntiUniversity/main/latest_style.typ
typst
#let apply_my_style(title:str,body) = [ // CONFIGURATION #let mode = "a4"; //#show strong: set text(blue) #set par(justify: false, leading: 0.52em) #let title = text(50pt,title) #v(8cm) #align(center, title) #set par(justify: true, leading: 0.52em) #let fs_1 = 27pt #let fs_2 = 7*fs_1/8 #let fs_3 = 6*fs_1/8 #let fs_4 = 5*fs_1/8 // CONTENTS STYLING #show outline.entry.where(level: 1): it => { v(0.5cm, weak: false) set text(19pt) strong(it) } #show outline.entry.where(level: 2): it => { //v(1pt, weak: false) set text(16pt) it } #show outline.entry.where(level: 3): it => { //v(1pt, weak: false) set text(14pt) it } #set heading(numbering: "1.1 ") #set par(leading: 0.2cm) #set page(numbering: "1/1", columns: 1) // HEADING STYLING // H1 #show heading.where(level: 1): it => { pagebreak() set align(left) set par(justify: true, leading: 0.52em) set text(fs_1, weight: "bold", number-type: "old-style", ) rect(smallcaps(underline(it)) + v(1cm), fill: rgb("#ddd5f3"),height: 1.2em, radius: .5cm, ) } //H2 #show heading.where(level: 2): it => { //pagebreak() set align(center) set text(fs_2, weight: "regular") v(1cm) + strong(it) + v(.5cm) } //H3 #show heading.where(level: 3): it => { set align(center) set text(fs_3, weight: "regular") v(.5cm) + strong(it) + v(.3cm) } //H4 #show heading.where(level: 4): it => { set align(center) set text(fs_4, weight: "regular") v(.3cm) + strong(it) + v(.3cm) } // FONT SIZES #show math.equation: set text(size: 17pt) #set text(15pt) #show link: set text(fill: color.blue) #outline(indent: 2em) *Document made with typst: #link("https://typst.app/docs/")[Link to typst documentation]* #body ] #let custom_style=[ #set heading(numbering: "1.1") #show heading.where(level:1): it => { pagebreak() set align(center) v(2em) ellipse(it,fill: aqua) } #show heading.where(level:2): it => { set align(left) v(2em) underline(it) } #show math.equation: it =>{ if it.block { rect(it) }else{ it } } ] #let presentation_style(title:str,body) = [ // CONFIGURATION //#show strong: set text(blue) //#set text(font: "Monofur Nerd Font") #set page(paper: "presentation-16-9") #set par(justify: false, leading: 0.52em) #let title = text(50pt,title) #v(8cm) #align(center, title) #set par(justify: true, leading: 0.52em) #let fs_1 = 27pt #let fs_2 = 7*fs_1/8 #let fs_3 = 6*fs_1/8 #let fs_4 = 5*fs_1/8 #let mode = "presentation"; // CONTENTS STYLING #show outline.entry.where(level: 1): it => { v(0.5cm, weak: false) set text(19pt) strong(it) } #show outline.entry.where(level: 2): it => { //v(1pt, weak: false) set text(16pt) it } #show outline.entry.where(level: 3): it => { //v(1pt, weak: false) set text(14pt) it } #set heading(numbering: "1.1 ") #set par(leading: 0.2cm) #set page(numbering: "1/1", columns: 1) // HEADING STYLING // H1 #show heading.where(level: 1): it => { pagebreak() set align(left) set par(justify: true, leading: 0.52em) set text(fs_1, weight: "bold", number-type: "old-style", ) rect(smallcaps(underline(it)) + v(1cm), fill: rgb("#ddd5f3"),height: 1.2em, radius: .5cm, ) } //H2 #show heading.where(level: 2): it => { pagebreak() set align(center) set text(fs_2, weight: "regular") v(1cm) + strong(it) + v(.5cm) } //H3 #show heading.where(level: 3): it => { pagebreak() set align(center) set text(fs_3, weight: "regular") v(.5cm) + strong(it) + v(.3cm) } //H4 #show heading.where(level: 4): it => { set align(center) set text(fs_4, weight: "regular") v(.3cm) + strong(it) + v(.3cm) } // FONT SIZES #show math.equation: set text(size: 17pt) #set text(15pt) #show link: set text(fill: color.blue) #outline(indent: 2em) *Document made with typst: #link("https://typst.app/docs/")[Link to typst documentation]* #body ]
https://github.com/rabotaem-incorporated/algebra-conspect-1course
https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/03-polynomials/06-principal-ideals.typ
typst
Other
#import "../../utils/core.typ": * == Факториальность области главных идеалов #def[ Пусть $R$ --- коммутативное кольцо. Элемент $a$ называется _неприводимым_, если $a eq.not 0$, $a in.not R^*$ и $a = b c ==> b in R^*$ или $c in R^*$. То есть неприводимый элемент --- необратимый элемент, который не раскладывается в произведение двух обратимых. ] #def[ _Приводимый элемент_ --- элемент, который не является ни $0$, ни обратимым, ни неприводимым. ] #examples[ + #[ $R = K[x]$, ($K$ --- поле) $deg f = 1 ==> f$ --- неприводимый, так как $f = b c, space deg f = deg b + deg c = 1 + 0 = 0 + 1 = 1$ ] + #[ $RR[x]$: $x^2 - 4$ приводим $x^2 - 4 = (x - 2)(x + 2)$ $x^2 + 1$ неприводим, иначе имел бы корень в $RR$ ] ] #lemma[ Пусть $f in K[x]$ --- многочлен степени $2$ или $3$. Тогда $f$ приводим $<==>$ у него есть корень в $K$. ] #proof[ "$arrow.r.double$": $a$ --- корень $f limits(==>)^("т. Безу") (X - a) divides f$. Рассмотрим разложение $f = (X - a) dot g$. Так как $deg g = deg f - 1 >= 1$, оно нетривиально и $f$ --- приводимый. "$arrow.l.double$": Пусть $f = g h$ и $deg g, space deg h >= 1$, не умаляя общности, $deg g >= deg h$. Тогда: $ underbrace(deg f, 2" или "3) = deg g + deg h $ Есть два стула: $2 = 1 + 1$ и $3 = 2 + 1$ (на какой сам сядешь, на какой друга посадишь?) В любом случае: $ deg h = 1 ==> h = a X + b ==> h(-(b)/(a)) = 0 ==> f(-(b)/(a)) = 0. $ Значит $-(b)/(a)$ --- корень $f$. ] #notice[ Многочлены большей степени могут быть приводимыми, но не иметь корней в $K$. ] #example[ Рассмотрим $f = x^4 + 2x^2 + 1$ в $RR[x]$: $ f = (x^2 + 1)^2 = (x^2 + x + 1)(x^2 - x + 1). $ ] #notice[ Далее считается, что $R$ --- область главных идеалов ] #lemma[ Пусть $p, f in R$. $p$ --- неприводимый элемент. Тогда $p divides f$ либо $(p, f) = 1$. ] #proof[ $(p, f) divides p ==> (p, f) = 1 $ или $(p, f) = p ==> (p, f) = 1$ или $p divides f$. ] #pr[ Пусть $p$ --- неприводимый$, space p divides a b ==> p divides a$ или $p divides b$. ] #proof[ Пусть $p divides.not a, space p divides.not b ==> (p, a) = (p, b) = 1 ==>$ $p m + a n = 1, space p m' + b n' = 1 limits(==>)^("перемножим") p(p m m' + m b n' + a n m') + a b n n' = 1 ==> p divides 1$ ] #def[ Область целостности $R$ называют факториальным кольцом, если: + Любой $a in R$ отличный от $0$ и не являющийся обратимым можно представить в виде $a = p_1 ... p_s, space s >= 1$ и $p_1, ..., p_s$ --- неприводимые элементы. + Если $p_1 ... p_s = q_1 ... q_t$, где все $p_i, q_i$ --- неприводимые элементы, то $s = t$ и после перенумерации $q_j$ выполнено $q_1 sim p_1, ..., q_s sim p_s$. ] #th[ Область главных идеалов является факториальным кольцом. ] #proof[ + "Существование разложения" #[ Есть элемент $a$, докажем что существует неприводимый $p$ такой, что $p divides a$. Возьмем $a$, если он неприводимый, то доказывать нечего (т.к. $a divides a$), иначе: $a = a_1 b_1$, где $a_1, b_1 in.not R^*$ ($a$ не неприводим $==> a_1, b_1$ оба обратимы либо оба необратимы, если оба обратимы, то $a$ обратим, а нас такие элементы не интересуют) $a_1$ -- неприводимый, следовательно утверждение доказано, иначе $a_1 = a_2 b_2$, где $a_2, b_2 in.not R^*$ и так далее Предположим, утверждение неверно. Обозначим $I = limits(union.big)_(i = 1)^(oo) (a_i)$. Можно заметить, что $a_2 divides a_1, space a_3 divides a_2, space ... ==> (a_1) subset (a_2) subset ...$ Покажем, что $I$ --- главный идеал. + $x, y in (a_j) subset I ==> x + y in (a_j) subset I$ + $x in I ==> x in (a_i)$ для некоторого $i$, тогда для $a in R ==> a x in (a_i) subset I$ Значит $I$ главный идеал, тогда $I = (c)$ для некоторого $c in I ==> c in (a_i)$ для некоторого $i$, при этом $a_(i+1) in I ==> c divides a_(i+1)$ $display(cases( a_i divides c, c divides a_(i + 1) )) ==> a_i divides a_(i+1) limits(==>)^(a_(i + 1) divides a_i) a_i sim a_(i + 1) ==>$ цепочка когда-то прервется, так как $a_i = a_(i + 1) dot b_(i + 1)$, где $a_i = epsilon a_(i + 1), space epsilon in R^* ==> b_(i + 1) = epsilon in R^*$ Значит любой необратимый элемент делится на неприводимый. ] + "Единственность разложения" #[ Пусть $p_1 ... p_s = q_1 ... q_t$, где все $p_i, q_i$ --- неприводимы и не умаляя общности $s <= t$ Индукция по $S$ "База": $s = 1$ $p_1 = q_1 ... q_t$, где $p_1$ --- неприводимый $==> t = 1, space q_1 = p_1$. "Переход": $s > 1$ $p_s divides (p_1 ... p_s) ==> p_s divides (q_1 ... q_t) ==> exists j: p_s divides q_j$ Перенумеруем, так чтобы $j = t$, тогда $q_t = p_s dot epsilon$, но $q_t$ неприводим $==> epsilon in R^*$ $p_1 ... p_s = q_1 ... q_(t - 1) dot epsilon p_s ==> p_1 ... p_(s-1) = q_1 ... q_(t - 1) dot epsilon = underbrace((epsilon q_1), "неприводимый") dot q_2 ... q_(t - 1)$ По индукционному предположению $p_1 ... p_(s-1)$ совпадает с $(epsilon q_1) dot q_2 ... q_(t - 1)$ c точностью до порядка и ассоциировнности. ] ] #notice[ Евклидова область $subset$ Область главных идеалов $subset$ Факториальное кольцо $subset$ Область целостности ] #examples[ + $R$ --- факториальное кольцо $==> R[X]$ --- факториальное кольцо. + $ZZ[X]$ --- факториальное кольцо. + $K[X][Y] = K[X, Y] ==> K[X, Y]$ --- факториальное кольцо. ]
https://github.com/Enter-tainer/zint-wasi
https://raw.githubusercontent.com/Enter-tainer/zint-wasi/master/typst-package/lib.typ
typst
MIT License
#let zint-wasm = plugin("./zint_typst_plugin.wasm") // handles option conversion #let _proc_options(options) = { let result = options let proc_color(opt, name) = { let c = opt.at(name, default: none) if c != none { if type(c) == color { return c.to-hex().slice(1) } else if type(c) == str { if c.at(0) == "#" { color.rgb(c) // error: not a valid HEX color } else { color.rgb("#" + c) // error: not a valid HEX color } return c } else { panic(name + " must be a color or HEX color str; found: " + type(c)) } } return none } let fg-color = proc_color(result, "fg-color") if fg-color != none { result.insert("fg-color", fg-color) } let bg-color = proc_color(result, "bg-color") if bg-color != none { result.insert("bg-color", bg-color) } return result } /// Draw a barcode SVG of any supported `symbology`. /// /// *Example:* /// #example( /// ` /// tiaoma.barcode("12345678", "QRCode", options: ( /// scale: 2.0, /// fg-color: blue, /// bg-color: green.lighten(70%), /// output-options: ( /// barcode-dotty-mode: true /// ), /// dot-size: 1.2, /// )) /// `) /// /// - data (str): Data to encode. /// - symbology (str): Symbology type name; must be one of #l(<symbology>)[supported types]. /// /// Example values: #typst-val("\"Code11\""), #typst-val("\"C25Standard\""), ... /// - options (dictionary): Additional options to pass to Zint. /// /// See the #l(<options>)[configuration section] for details on available options and how to use them. /// - ..args (any): Any additional arguments to forward to #l("https://typst.app/docs/reference/visualize/image/#definitions-decode", raw("image.decode", lang: "typ")) function. /// -> content #let barcode(data, symbology, options: (:), ..args) = { let data = data if type(data) == str { data = bytes(data) } else if type(data) == array { data = bytes(data) } image.decode( zint-wasm.gen_with_options( cbor.encode((symbology: symbology, .._proc_options(options))), data, ), format: "svg", ..args, ) } /// Returns #typst-type("int") option value for given Data Matrix _width_ and _height_. /// /// Zint allows square and rectangular values to be enforced with `DM_SQUARE` and `DM_DMRE` #l(<opt_3>, "Option 3") values. /// /// - width (int): Data Matrix width /// - height (int): Data Matrix height /// -> int #let dm-size(height, width) = { // Copied from DM size table if height == 10 and width == 10 { return int(1) } if height == 12 and width == 12 { return int(2) } if height == 14 and width == 14 { return int(3) } if height == 16 and width == 16 { return int(4) } if height == 18 and width == 18 { return int(5) } if height == 20 and width == 20 { return int(6) } if height == 22 and width == 22 { return int(7) } if height == 24 and width == 24 { return int(8) } if height == 26 and width == 26 { return int(9) } if height == 32 and width == 32 { return int(10) } if height == 36 and width == 36 { return int(11) } if height == 40 and width == 40 { return int(12) } if height == 44 and width == 44 { return int(13) } if height == 48 and width == 48 { return int(14) } if height == 52 and width == 52 { return int(15) } if height == 64 and width == 64 { return int(16) } if height == 72 and width == 72 { return int(17) } if height == 80 and width == 80 { return int(18) } if height == 88 and width == 88 { return int(19) } if height == 96 and width == 96 { return int(20) } if height == 104 and width == 104 { return int(21) } if height == 120 and width == 120 { return int(22) } if height == 132 and width == 132 { return int(23) } if height == 144 and width == 144 { return int(24) } if height == 8 and width == 18 { return int(25) } if height == 8 and width == 32 { return int(26) } if height == 12 and width == 26 { return int(28) } if height == 12 and width == 36 { return int(28) } if height == 16 and width == 36 { return int(29) } if height == 16 and width == 48 { return int(30) } // Copied from DMRE table if height == 8 and width == 48 { return int(31) } if height == 8 and width == 64 { return int(32) } if height == 8 and width == 80 { return int(33) } if height == 8 and width == 96 { return int(34) } if height == 8 and width == 120 { return int(35) } if height == 8 and width == 144 { return int(36) } if height == 12 and width == 64 { return int(37) } if height == 12 and width == 88 { return int(38) } if height == 16 and width == 64 { return int(39) } if height == 20 and width == 36 { return int(40) } if height == 20 and width == 44 { return int(41) } if height == 20 and width == 64 { return int(42) } if height == 22 and width == 48 { return int(43) } if height == 24 and width == 48 { return int(44) } if height == 24 and width == 64 { return int(45) } if height == 26 and width == 40 { return int(46) } if height == 26 and width == 48 { return int(47) } if height == 26 and width == 64 { return int(48) } panic("Data Matrix with dimensions " + str(width) + "x" + str(height) + " not supported") } #let code11(data, options: (:), ..args) = barcode( data, "Code11", options: options, ..args, ) #let c25-standard(data, options: (:), ..args) = barcode( data, "C25Standard", options: options, ..args, ) #let c25-inter(data, options: (:), ..args) = barcode( data, "C25Inter", options: options, ..args, ) #let c25-iata(data, options: (:), ..args) = barcode( data, "C25IATA", options: options, ..args, ) #let c25-logic(data, options: (:), ..args) = barcode( data, "C25Logic", options: options, ..args, ) #let c25-ind(data, options: (:), ..args) = barcode( data, "C25Ind", options: options, ..args, ) #let code39(data, options: (:), ..args) = barcode( data, "Code39", options: options, ..args, ) #let ex-code39(data, options: (:), ..args) = barcode( data, "ExCode39", options: options, ..args, ) #let eanx(data, options: (:), ..args) = barcode( data, "EANX", options: options, ..args, ) #let eanx-chk(data, options: (:), ..args) = barcode( data, "EANXChk", options: options, ..args, ) #let ean(data, options: (:), ..args) = eanx-chk(data, options: options, ..args) #let gs1-128(data, options: (:), ..args) = barcode( data, "GS1128", options: options, ..args, ) #let codabar(data, options: (:), ..args) = barcode( data, "Codabar", options: options, ..args, ) #let code128(data, options: (:), ..args) = barcode( data, "Code128", options: options, ..args, ) #let dp-leitcode(data, options: (:), ..args) = barcode( data, "DPLEIT", options: options, ..args, ) #let dp-ident(data, options: (:), ..args) = barcode( data, "DPIDENT", options: options, ..args, ) #let code16k(data, options: (:), ..args) = barcode( data, "Code16k", options: options, ..args, ) #let code49(data, options: (:), ..args) = barcode( data, "Code49", options: options, ..args, ) #let code93(data, options: (:), ..args) = barcode( data, "Code93", options: options, ..args, ) #let flat(data, options: (:), ..args) = barcode( data, "Flat", options: options, ..args, ) #let dbar-omn(data, options: (:), ..args) = barcode( data, "DBarOmn", options: options, ..args, ) #let dbar-ltd(data, options: (:), ..args) = barcode( data, "DBarLtd", options: options, ..args, ) #let dbar-exp(data, options: (:), ..args) = barcode( data, "DBarExp", options: options, ..args, ) #let telepen(data, options: (:), ..args) = barcode( data, "Telepen", options: options, ..args, ) #let upca(data, options: (:), ..args) = barcode( data, "UPCA", options: options, ..args, ) #let upca-chk(data, options: (:), ..args) = barcode( data, "UPCAChk", options: options, ..args, ) #let upce(data, options: (:), ..args) = barcode( data, "UPCE", options: options, ..args, ) #let upce-chk(data, options: (:), ..args) = barcode( data, "UPCEChk", options: options, ..args, ) #let postnet(data, options: (:), ..args) = barcode( data, "Postnet", options: options, ..args, ) #let msi-plessey(data, options: (:), ..args) = barcode( data, "MSIPlessey", options: options, ..args, ) #let fim(data, options: (:), ..args) = barcode( data, "FIM", options: options, ..args, ) #let logmars(data, options: (:), ..args) = barcode( data, "Logmars", options: options, ..args, ) #let pharma(data, options: (:), ..args) = barcode( data, "Pharma", options: options, ..args, ) #let pzn(data, options: (:), ..args) = barcode( data, "PZN", options: options, ..args, ) #let pharma-two(data, options: (:), ..args) = barcode( data, "PharmaTwo", options: options, ..args, ) #let cepnet(data, options: (:), ..args) = barcode( data, "CEPNet", options: options, ..args, ) #let pdf417(data, options: (:), ..args) = barcode( data, "PDF417", options: options, ..args, ) #let pdf417-comp(data, options: (:), ..args) = barcode( data, "PDF417Comp", options: options, ..args, ) #let maxicode(data, options: (:), ..args) = barcode( data, "MaxiCode", options: options, ..args, ) #let qrcode(data, options: (:), ..args) = barcode( data, "QRCode", options: options, ..args, ) #let code128ab(data, options: (:), ..args) = barcode( data, "Code128AB", options: options, ..args, ) #let aus-post(data, options: (:), ..args) = barcode( data, "AusPost", options: options, ..args, ) #let aus-reply(data, options: (:), ..args) = barcode( data, "AusReply", options: options, ..args, ) #let aus-route(data, options: (:), ..args) = barcode( data, "AusRoute", options: options, ..args, ) #let aus-redirect(data, options: (:), ..args) = barcode( data, "AusRedirect", options: options, ..args, ) #let isbnx(data, options: (:), ..args) = barcode( data, "ISBNX", options: options, ..args, ) #let rm4scc(data, options: (:), ..args) = barcode( data, "RM4SCC", options: options, ..args, ) #let data-matrix(data, options: (:), ..args) = barcode( data, "DataMatrix", options: options, ..args, ) #let ean14(data, options: (:), ..args) = barcode( data, "EAN14", options: options, ..args, ) #let vin(data, options: (:), ..args) = barcode( data, "VIN", options: options, ..args, ) #let codablock-f(data, options: (:), ..args) = barcode( data, "CodablockF", options: options, ..args, ) #let nve18(data, options: (:), ..args) = barcode( data, "NVE18", options: options, ..args, ) #let japan-post(data, options: (:), ..args) = barcode( data, "JapanPost", options: options, ..args, ) #let korea-post(data, options: (:), ..args) = barcode( data, "KoreaPost", options: options, ..args, ) #let dbar-stk(data, options: (:), ..args) = barcode( data, "DBarStk", options: options, ..args, ) #let dbar-omn-stk(data, options: (:), ..args) = barcode( data, "DBarOmnStk", options: options, ..args, ) #let dbar-exp-stk(data, options: (:), ..args) = barcode( data, "DBarExpStk", options: options, ..args, ) #let planet(data, options: (:), ..args) = barcode( data, "Planet", options: options, ..args, ) #let micro-pdf417(data, options: (:), ..args) = barcode( data, "MicroPDF417", options: options, ..args, ) #let usps-imail(data, options: (:), ..args) = barcode( data, "USPSIMail", options: options, ..args, ) #let plessey(data, options: (:), ..args) = barcode( data, "Plessey", options: options, ..args, ) #let telepen-num(data, options: (:), ..args) = barcode( data, "TelepenNum", options: options, ..args, ) #let itf14(data, options: (:), ..args) = barcode( data, "ITF14", options: options, ..args, ) #let kix(data, options: (:), ..args) = barcode( data, "KIX", options: options, ..args, ) #let aztec(data, options: (:), ..args) = barcode( data, "Aztec", options: options, ..args, ) #let daft(data, options: (:), ..args) = barcode( data, "DAFT", options: options, ..args, ) #let dpd(data, options: (:), ..args) = barcode( data, "DPD", options: options, ..args, ) #let micro-qr(data, options: (:), ..args) = barcode( data, "MicroQR", options: options, ..args, ) #let hibc-128(data, options: (:), ..args) = barcode( data, "HIBC128", options: options, ..args, ) #let hibc-39(data, options: (:), ..args) = barcode( data, "HIBC39", options: options, ..args, ) #let hibc-dm(data, options: (:), ..args) = barcode( data, "HIBCDM", options: options, ..args, ) #let hibc-qr(data, options: (:), ..args) = barcode( data, "HIBCQR", options: options, ..args, ) #let hibc-pdf(data, options: (:), ..args) = barcode( data, "HIBCPDF", options: options, ..args, ) #let hibc-mic-pdf(data, options: (:), ..args) = barcode( data, "HIBCMicPDF", options: options, ..args, ) #let hibc-codablock-f(data, options: (:), ..args) = barcode( data, "HIBCCodablockF", options: options, ..args, ) #let hibc-aztec(data, options: (:), ..args) = barcode( data, "HIBCAztec", options: options, ..args, ) #let dotcode(data, options: (:), ..args) = barcode( data, "DotCode", options: options, ..args, ) #let hanxin(data, options: (:), ..args) = barcode( data, "HanXin", options: options, ..args, ) #let upus10(data, options: (:), ..args) = barcode( data, "UPUS10", options: options, ..args, ) #let mailmark-4s(data, options: (:), ..args) = barcode( data, "Mailmark4S", options: options, ..args, ) #let azrune(data, options: (:), ..args) = barcode( data, "AzRune", options: options, ..args, ) #let code32(data, options: (:), ..args) = barcode( data, "Code32", options: options, ..args, ) #let channel(data, options: (:), ..args) = barcode( data, "Channel", options: options, ..args, ) #let code-one(data, options: (:), ..args) = barcode( data, "CodeOne", options: options, ..args, ) #let grid-matrix(data, options: (:), ..args) = barcode( data, "GridMatrix", options: options, ..args, ) #let upnqr(data, options: (:), ..args) = barcode( data, "UPNQR", options: options, ..args, ) #let ultra(data, options: (:), ..args) = barcode( data, "Ultra", options: options, ..args, ) #let rmqr(data, options: (:), ..args) = barcode( data, "RMQR", options: options, ..args, ) #let bc412(data, options: (:), ..args) = barcode( data, "BC412", options: options, ..args, ) #let mailmark-2d(height, width, data, options: (:), ..args) = barcode( data, "Mailmark2D", options: ( option_2: dm-size(height, width), ..options, ), ..args, ) #let barcode-primary(primary, data, type, options: (:), ..args) = barcode( data, type, options: ( primary: primary, ..options, ), ..args, ) #let barcode-composite( primary, data, mode, type, options: (:), ..args, ) = barcode-primary( primary, data, type, options: ( option_1: int(mode), ..options, ), ..args, )
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/stack-2-01.typ
typst
Other
#set page(height: 2cm) #set text(white) #rect(fill: red)[ #v(1fr) #h(1fr) Hi you! ]
https://github.com/kaewik/pen_and_paper
https://raw.githubusercontent.com/kaewik/pen_and_paper/master/splittermond/Patalis/main.typ
typst
#set heading(numbering: "1.") #set text(12pt, font: "HK Grotesk", lang: "de") #set page( numbering: "1", background: locate(loc => if loc.page() > 1 { if calc.odd(loc.page()) [ #grid( columns: (90%, 10%), rows: (90%, 10%), [], [#rect(width: 100%, height: 100%, fill: gradient.linear(..(white, aqua)))], [#rect(width: 100%, height: 100%, fill: gradient.linear(..(white, aqua), angle: 90deg))], [#rect(width: 100%, height: 100%, fill: gradient.radial(..(white, aqua), center: (0%, 0%), radius: 100%))] ) ] else [ #grid( columns: (10%, 90%), rows: (10%, 90%), [#rect(width: 100%, height: 100%, fill: gradient.radial(..(white, aqua), center: (100%, 100%), radius: 100%))], [#rect(width: 100%, height: 100%, fill: gradient.linear(..(white, aqua), angle: -90deg))], [#rect(width: 100%, height: 100%, fill: gradient.linear(..(white, aqua), dir: rtl))], [] ) ] } ) ) #show heading: it => text(fill: blue.darken(50%), it) #set table(fill: (col, row) => if row == 0 { aqua } else if calc.even(row) { aqua.lighten(50%) }, stroke: blue.lighten(40%) ) #show link: set text(style: "italic") #let quest = (name, employer, task, reward, notes) => block(breakable: false, table( columns: (auto, auto), [*Questname*], [#name], [*Questgeber*], [#employer], [*Auftrag*], [#task], [*Belohnung*], [#reward], [*Notizen*], [#notes], )) #let center_table = table.with(align: center) #let left_table = table.with(align: left) #let creature = (stats: (:), weapons: (:), info: (:)) => { let weapons_head_row = weapons.at(0).map(strong) let weapons_table = (weapons_head_row, weapons.slice(1)) block(breakable: false)[ #center_table(columns: stats.keys().len(), ..stats.keys().map(strong), ..stats.values()) #table(columns: weapons_head_row.len(), ..weapons_table.flatten()) #grid(columns: 2, gutter: 8pt, ..info.pairs().map(pair => (strong(pair.at(0) + ":"), pair.at(1))).flatten()) ] } #let log_entry = (date, heading_level: 2, content) => [ #heading(level: heading_level, numbering: none)[09.03.024] #content ] #outline(title: [Inhaltsverzeichnis], depth: 2, indent: 1em) #pagebreak() = Schauplätze == Caleria === Quests #quest( [Gaukler für die Komtissa], [_<NAME> (ca 60 Jahre, schlacksig)_], [Reist nach _Lamera_ um #link("Komtissa Ravininia von Jokania") zu treffen.], [keine Belohnung], [ - Reise per Schiff (s. @Schiffsreisen) - Kosten: 1L pro Person - Dauer: 2 Tage - Reise übers Land (s. ) - Dauer: 8 Tage ] ) #quest( [Der Sommernachtstraum], [_Händlerin <NAME> (29 Jahre alt, reich)_], [Weckt meine Großmutter und meinen Sohn.], [50L], [ - Großmutter bildet Feenweltübergang - im Sommernachtstraum schläft Szon ein Traumwesen in einem Loch im Baum - Großmutter besitzt eine winziges Traumblatt von Sasipanije in Glas (Verbindung der Welten) - Glas muss zerstört werden oder da gelassen werden - Weg zurück ist die Oberfläche eines Teichs oder die Treppen im Baum - Feenweltexperten können in Caleria befragt werden - Baum besitzt Treppen nach oben und unten mit insgesamt 4 Stockwerken - Stockwerk 1 (Diesseits): Charatere erwachen, wenn sie auf diese Stufe kommen - Stockwerk 2 (Friedlicher Traum): Ewige Wiese, schlafender Szon, verwandelt sich in Wolf wenn geweckt - Stockwerk 3 (Starker Traum): Szon ist Sinnbild eines lebendigen Traumes einer Person aus Lorakis - Themen: Wut, Angst, Neid, Lust, Macht, etc. - Stockwerk 4 (Traumreich): Seen (Träume), Szons Berg, Sasipanije Baum des Einschlafens im Wald - Großmutter irrt im Wald von Sasipanije - Nebelkreaturen wandern auch im Wald ] ) #quest( [Der Bauer mit zu viel Gemüse], [_<NAME>, Lehnsherr_], [Verhindert einen Lünchmob], [50L], [ - _Bauer Turio (Mensch, 60)_ hat weiterhin Nahrung, obwohl alle anderen hungern - Dorf verdächtigt ihn der Hexerei - _Turio_ versklavt Fee - alter Pakt (Wechselbalg der Mutter) zwingt Fee dazu - alte Freundin _Victoria (80)_ der Mutter weiß mehr - Mutter lange tot - hatte in Jugend Affäre - Kind musste weg ] ) #quest( [Der Brief an die Front], [_<NAME>_], [Überbringt dringende Befehle an die Front], [Belohnung: 100L], [ - Glasz ein Auge auf einem menschlichen Arm (Feenwesen) bewacht Tunnel nach Malait - möchte Körperteile als Wegezoll - Finde Feldmarschall in der Feenwelt ] ) #quest( [SAM needs you!], [_<NAME>_], [Aquiriert freiwillige aus der Landbevölkerung], [100L], [ - brauchen alles schwache als auch starke ] ) == Lamera === Quests #quest( [Gaukler für die Komtissa II], [#link("Komtissa Ravinia von Jokania")], [Reist nach Ravheim und verbessert den Ruf der Komtissa], [200L], [] ) #quest( [Blutopfer für den Jokabaum], [_<NAME>(Gnom)_], [Findet die geflüchteten Gefangenen], [100L], [] ) == Ravheim === Quests #quest( [Der politisch Gefangene], [_<NAME>(Albin, sehr attraktiv)_], [Befreit meinen Bruder aus dem Gefängnis], [Aufnahme bei den Neu-Farolischen Separatisten, Ruf Komtissa -50%], [] ) #quest( [Rettungsaktion], [_Agent der Silberringe, <NAME>_], [Findet #link("Lucilla")[<NAME>]], [200L], [ - gefangen in Zilia ] ) #quest( [Rattlinge in der Kanalisation], [_Mercator und Hauptmann Julio von Ravheim_], [Tötet die Ratlinge], [Komtissa Ruf +10%], [ - Verhandlung und Kampf möglich ] ) #quest( [Öffentliche Erheiterung von der Komtissa], [_Mercator und Hauptmann Julio von Ravheim_], [Gewinnt das Ringen um die Meinungshoheit], [Komtissa Ruf +50%], [ - Darbietung, etc. ] ) #quest( [Aufwiegler und Störenfriede aus Neu-Farol], [_Mercator und Hauptmann Julio von Ravheim_], [Macht wichtige Anführer der Neu-Farolischen Bewegung mundtot], [pro Anführer +/-20% Komtissa Ruf], [] ) #quest( [Separatisten aus Neu-Farol], [_Mercator und Hauptmann Julio von Ravheim_], [Bringt Beweise, dass die Separatisten im Osten Soldaten aus Neu-Farol sind], [+30% Komtissa Ruf], [ - Lager im Wald - Untergrundorganisation ] ) = Personen == Komtissa Ravinia von Jokania #label("Komtissa Ravinia von Jokania") #table( columns: (auto, auto, auto), [*Eigenschaften*], [*Offene Interessen*], [*Versteckte Interessen*], [ - Zwergin, ca 70 Jahre alt - halbseitig gelähmt, wortkark ], [ - Krieg mit Neu-Farol verhindern - Stabilität im Land sichern ],[ - Handel mit Jokanüssen und -blättern aufrechterhalten - hofft auf Wunderheilmittel aus dem Jokabaum ] ) == Severos, Kanzler von Patalis #table( columns: (auto, auto), [*Offene Interessen*], [*Versteckte Interessen*], [ - #link(<Lucilla>, "<NAME>") finden und sicher in Ultia wissen ],[ - die Geheimwaffe _#link(<Zaghir>, "Zaghir")_ unter Kontrolle bringen ] ) == <NAME>, die Magierin <Lucilla> == <NAME>, Hauptmann der Stadtwache #table( columns: (auto, auto), [*Offene Interessen*], [*Versteckte Interessen*], [ - möchte Neu-Farol erblühen sehen ],[ - wird von _Rania Ruwensee_ gezwungen ] ) == <NAME>, Königin von Neu-Farol #table( columns: (auto, auto), [*Offene Interessen*], [*Versteckte Interessen*], [ - möchte Unabhängigkeit für die Faroler - möchte Wohlstand für ihr Volk - möchte Vordan als Patron Gott für ihr Volk - möchte farolische Bürger in Jokania beschützen ],[ - mehr Einfluss auf Patalische Politik - territoriale Ausdehnung - Zugang zum Toralla - benötigt #link(<Zaghir>, "Geheimwaffe, Zaghir") um Jokania zu erobern ] ) #pagebreak(weak: true) = Kreaturen == Kleien Nebelkreatur #creature(stats: ( AUS: "2", BEW: "2", INT: "3", KON: "2", MYS: "1", STÄ: "3", VER: "2", WIL: "2", GK: "5", GSW: "7", LP: "7", FO: "26", VTD: "18", SR: "0", KW: "16", GW: "16", ), weapons: ( ("Waffen", "Wert", "Schaden", "WGS", "INI", "Merkmale"), ("Körper", "10", "1W6", "7", "8", "Stumpf"), ("Nebelklinge", "14", "1W6+2", "9", "7", "-"), ), info: ( Typus: "Monster, Humanoider, Schattenwesen", Monstergrad: "1 / 1", Fertigkeiten: "Entschlossenheit 8, Wahrnehmung 12, Beherrschungsmagie 12", Zauber: "Beherrschung I: Furcht (S. 230)", Meisterschaften: "", Merkmale: "Furchterregend (15) S. 11 Bestarium, Schmerzresistenz", Beute: "-", )) == Landpeitschen <NAME> <Landpeitsche> #creature(stats: ( AUS: "2", BEW: "2", INT: "3", KON: "2", MYS: "1", STÄ: "3", VER: "2", WIL: "2", GK: "5", GSW: "7", LP: "7", FO: "26", VTD: "18", SR: "0", KW: "16", GW: "31", ), weapons: ( ("Waffen", "Wert", "Schaden", "WGS", "INI", "Merkmale"), ("Ruder", "9", "1W6+5", "9", "7", "Stumpf"), ("Ranke 1", "9", "1W6", "12", "8", "Umklammern"), ("Ranke 2", "9", "1W6", "12", "8", "Umklammern") ), info: ( Typus: "Monster, Humanoider", Monstergrad: "2 / 1", Fertigkeiten: "Entschlossenheit 16, Wahrnehmung 12, Beherrschungsmagie 25, Lichtmagie 10", Zauber: "Beherrschung I: Furcht, Verwirren; II: Suggestion; Licht 0: Licht, Lichtertanz", Meisterschaften: "Handgemenge (I: Umklammern; III: Würgegriff)", Merkmale: "Furchterregend (15), Koloss 3 (normaler Angriff des Wirtes, Ranken), Schmerzresistenz", Beute: "Ranken (10 Lunare; Alchemie gg. 25)", )) == Zaghir <Zaghir> #pagebreak(weak: true) = Tabellen == Namen #block(breakable: false)[ #center_table( columns: (auto, auto, auto, auto), [*1W10*], [*m. Vorname*], [*w. Vorname*], [*Nachname*], [1], [Alyosha], [Alyena], [Sestani], [2], [Ascan], [Ascania], [Farvian], [3], [Branek], [Brana], [Roterius], [4], [Caran], [Carina], [Letian], [5], [Drinan], [Drina], [Meronius], [6], [Farano], [Farina], [Eranova], [7], [Flavio], [Flavia], [von Dravnic], [8], [Gorin], [Gorina], [Cirdanian], [9], [Juvenio], [Juvenia], [Juveni], [10], [Lavinio], [Lavinia], [Tarasgan], )] == Schiffsreisen <Schiffsreisen> Bei vergleichenden Proben entscheidet die Anzahl der Erfolgsgrade(EG) über Sieg oder Niederlage. Wie oft auf diese Tabelle goworfen wird ist der Spielleitung überlassen. #table( columns: (auto, auto, auto), [2W10], [Ereignis], [Erläuterung], [2-3], [Schiffsbruch durch Seeungeheuer], [ - 5 Vergleichende Proben gg. 14 - Niederlage: - verliere 2W10L oder Gegenstände diesen Wertes - Verwundet 1W4 Stufen - Sieg: Erschöpft 1W4 Stufen ], [4-7], [Schwerer Sturm], [ - 5 Vergleichende Proben gg. 12 - Niederlage: verliere 1W10L oder Gegenstände diesen Wertes - Sieg: verliere einen Gegenstand deiner Wahl ], [8-12], [Infizierter Seemann], [Kampf gegen #link("Landpeitsche")n Befallener Seemann], [13-18], [<NAME>gang], [ - 5 Vergleichende Proben gg. 8 - Niederlage: verliere (1W10 / 5)L oder Gegenstände diesen Wertes - Sieg: Erschöpft 1W2 Stufen ], [19-20], [Ereignislos] ) == Überlandreisen <Überlandreisen> Die folgenden Tabellen sind denen des Regionalbandes für Patalis und Elyrea@PuE[S. 119f] stark nachempfunden. Bei vergleichenden Proben entscheidet die Anzahl der Erfolgsgrade(EG) über Sieg oder Niederlage. Wie oft auf diese Tabelle geworfen wird ist der Spielleitung überlassen. #table( columns: (auto, auto, auto), [1W4], [Ereignis], [Erläuterung], [1], [Feinde], [ wirf auf @Feinde ], [2], [Hindernisse], [wirf auf @Hindernisse ], [3], [Reiseglück], [ wirf auf @Reiseglück ], [4], [Begegnung], [ wirf auf @Begegnung ], ) === Feinde #figure( caption: "Feinde")[ #left_table( columns: (auto, auto, auto), [2W10], [Ereignis], [Erläuterung], [2-3], [Drachenangriff], [ - 5 vergleichende Proben gg. 14 - Niederlage: - Verwundet 1W4 Stufen - Waffe, Schild oder Rüstung beschädigt - Sieg: Erschöpft 1W4 Stufen ], [4-8], [Rattlinge], [1W6 Rattlinge verfolgen die Reisenden _(Wahrnehmung)_@GRW[S. 275]], [8-11], [Aggressive Landbevölkerung], [ - 2W6 Bettler bedrängen Reisende um Gaben - Stehlen notfalls _Vergleichende Probe (15 (Fingerfertigkeit + 3) gg. Wahrnehmung)_ ], [12-14], [Bär der sein Revier verteidigt], [ Kampf gegen Bär@GRW[S. 284]], [15-16], [keine Feinde], [ Ereignislos ], [17-18], [Wegelagerer], [ - 2W3 Räuber@GRW[S. 276] - Kampf oder Wegezoll 2W10L ], [19-20], [Adelsfrust], [ - 2W6 Söldner@GRW[S. 280] + Adliger - will Reisende für blutige Kampfarena ] ) ] <Feinde> === Hindernisse #figure(caption: "Hindernisse")[ #left_table( columns: (auto, auto, auto), [2W10], [Ereignis], [Erläuterung], [2-3], [Katastrophe], [ - 5 vergleichende Proben gg. 14 (Vulkan, Tsunami, Erdbeben) - Niederlage: - Verwundet 1W4 Stufen - Sieg: Erschöpft 1W4 Stufen ], [4-8], [Schlechtes Wetter], [ - 5 vergleichende Proben gg. 14 - Niederlage: - Erschöpft 1W4 Stufen - Sieg: keine Konsequnzen ], [8-12], [<NAME>, umgekippter Baum, Viehherde], [ - 4 vergleichende Proben gg. 12 - Niederlage: - Erschöpft 1W2 Stufen - Sieg: keine Konsequnzen ], [13-18], [Erdrutsch], [ - _Athletik gg. 25_, ansonsten 2W6+3 Schaden - _Akrobatik gg. 20_ reduziert Schaden um 1 Punkt (+1 pro EG) ], [19-20], [keine Hindernisse], [Ereignislos] ) ] <Hindernisse> === Reiseglück #figure(caption: "Reiseglück")[ #left_table( columns: (auto, auto, auto), [2W10], [Ereignis], [Erläuterung], [2-7], [Kleiner Fund], [ - Ziege - Geldbeutel (1W4 L) - Pferd - Heilkräuter (+3 auf Heilkundeprobe) ], [8-17], [Abkürzung], [ - 1W4 Tage weniger ], [17-19], [großer Fund], [ - Geldbeutel (1W6 + 4 L) - Höhleneingang mit Schätzen - Schriftrolle mit Zauber 1. Grades ], [20], [Freundliche Fee], [ - jeder Spieler daf wählen - eine goldene Heilbeere (+1W10 LP) - ein goldenes Wässerchen (+1W10 Fokus) ] ) ] <Reiseglück> === Begengung #figure(caption: "Begegnung")[ #left_table( columns: (auto, auto, auto), [2W10], [Ereignis], [Erläuterung], [2-7], [Freundliche Landbevölkerung], [ - geben Unterkunft und Essen ], [8-10], [Einzelner Reisender], [], [11-18], [Reisegruppe], [ 1W10 Personen ], [19-20], [Handelszug], [], ) ] <Begegnung> #pagebreak() = Abenteuer-Logbuch #table( columns: (auto, auto, auto), ..([Name], [Volk], [Aktuelles]).map(strong), [Iva], [Mensch], [ - arbeitet als Söldner für die Teleschai - Imja, das Feenwesen hat etwas gut bei ihm - verfügt noch für 6 Tage weder über Schmerz noch über einen Geruchssinn ], [Felessan], [Albe], [ - trägt eine rote Feder am Hut - ist ein Teleschai und Akkrobat - besitzt eine 3-Personen Tarva plus 2 Zugpferde ], [Larisanos], [Mensch], [ - ist ein Lyxa-Priester, aber zeigt sich als Gelehrter ], [Aldon], [Albe], [ - ist ein Barde und Teleschai mit einem Bogen und einem Saiteninstrument ] ) #log_entry("09.03.024")[ - Gruppe bezieht Platz am Markt, Stellplatz für die Tarva - Iva verspricht _Händlerin <NAME>_ zu helfen, die Mutter und Sohn zu wecken - Iva tauscht einen Gefallen an _Imja (Feenwesen auf dem Markt)_ für zweimaliges "wiederfinden des Wachseins" - Gruppe findet Wachsein vom Sohn der Händlerin, _<NAME> (20 Jahre, Mensch)_ - Larisanos schläft neben Großmutter ein und wacht in Traumwelt auf (ewig weite Wiese und Baum mit Loch) - Larisanos findet schlafenden Jungen (10 Jahre) im Baum und Treppe nach oben und unten - Larisanos findet heraus, dass sich Junge verwandelt wenn man ihn wecken möchte - Iva findet <NAME> wieder - Larisanos und Aldon gehen zu _Magierin, <NAME> (Albin, sehr gut gekleidet)_ - Iva und Felessan beschatten _Offizier Wandlerose_, erfolglos - Magierin gibt Larisanos eine Schriftrolle mit Zauber "Gedächtnis schützen" - Gruppe geht zurück zum Markt - Iva gewinnt Schwerkampf-Wettkampf und gewinnt Kettenrüstung (35L) und Auftrag "Brief an die Front" - _<NAME>_ verabredet sich mit Iva am nächsten Tag - Iva tauscht Kettenhemd und Schmerzgefühl und Geruchssinn für 7 Tage gegen "Einen gemeinsamen Traum aus dem alle Erwachen" bei _Imja_ - Aldon und Felessan gewinnen Darbietungswettkampf (15L) und eine Schleife mit Aussicht auf Zusatzbelohnung bei _<NAME>_ - Gruppe legt sich neben Großmutter und verfällt in Schlaf - Gruppe wacht in dunklem Fichten-Wald auf und bekämpft riesigen Wolf - Gruppe besänftigt Wolf und dieser wird zu schlafenden Jungen - Gruppe bringt Jungen zum großen Baum und wickelt ihn in eine Decke - Gruppe geht Treppe nach oben und findet schlafenden Jungen - Iva entfernt sich vom Baum mit Tagträumen - Gruppe steigt Treppen weiter hoch und erwacht - Hausmädchen der Händlerin bringt Gruppe in Gastgemächer ] #pagebreak() #bibliography(full: true, style: "turabian-fullnote-8", "material.bib")
https://github.com/connachermurphy/typst-cv
https://raw.githubusercontent.com/connachermurphy/typst-cv/main/cv_sample.typ
typst
MIT License
#import "cv.typ": * #show: cv.with( name: "<NAME>", email: [#link("mailto:<EMAIL>")[<EMAIL>]], date: "11/21/2023", ) = Education #experience( description: [University of School, Advanced Degree in Subject], date: [2022-Present], )[] #experience( description: [University of School, Undergraduate Degree in Subject], date: [2015-2019], )[] = Research Assistance #experience( description: [Research Experience #1], date: [2020-2023], )[] #experience( description: [Research Experience #2], date: [2017-2019], )[] = Works in Progress #include "works_in_progress.typ" = Working Papers #include "working_papers.typ"
https://github.com/alexanderkoller/typst-blinky
https://raw.githubusercontent.com/alexanderkoller/typst-blinky/main/examples/README.md
markdown
MIT License
# Example for Blinky See [main.typ](https://github.com/alexanderkoller/typst-blinky/blob/main/examples/main.typ) for an example of citing bibliographic entries of various types with Blinky. The compiled PDF is [main.pdf](https://github.com/alexanderkoller/typst-blinky/blob/main/examples/main.pdf). The [CSL file](https://github.com/alexanderkoller/typst-blinky/blob/main/examples/association-for-computational-linguistics-blinky.csl) is a modified version of the [official CSL style](https://github.com/citation-style-language/styles) for ACL publications (see also [CSL](https://citationstyles.org/)). It is redistributed here under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](https://creativecommons.org/licenses/by-sa/3.0/). I have modified the ACL CSL file as described in the [main README](https://github.com/alexanderkoller/typst-blinky), by replacing all uses of the title variable with a magic symbol encapsulating the citation key.
https://github.com/chendaohan/bevy_tutorials_typ
https://raw.githubusercontent.com/chendaohan/bevy_tutorials_typ/main/28_states_and_data_of_assets/states_and_data_of_assets.typ
typst
#set page(fill: rgb(35, 35, 38, 255), height: auto, paper: "a3") #set text(fill: color.hsv(0deg, 0%, 90%, 100%), size: 22pt, font: "Microsoft YaHei") #set raw(theme: "themes/Material-Theme.tmTheme") = 1. 资产事件 如果你需要在资产创建、修改或删除时执行特定操作,可以创建一个系统来响应 AssetEvent 事件。 ```rs fn print_asset_event(mut asset_events: EventReader<AssetEvent<Mesh>>) { for asset_event in asset_events.read() { match asset_event { AssetEvent::Added { id } => info!("asset event added: {id}"), AssetEvent::Modified { id } => info!("asset event modified: {id}"), AssetEvent::Removed { id } => info!("asset event removed: {id}"), AssetEvent::Unused { id } => info!("asset event unused: {id}"), AssetEvent::LoadedWithDependencies { id } => info!("asset event loaded: {id}"), } } } ``` 注意:如果你正在处理 Modified 事件并对数据进行可变访问,.get_mut 将会为同一个资产触发另一个 Modified 事件。如果不小心,这可能会导致无限循环!(由你自己的系统引起的事件) = 2. 追踪加载进度 如果你想检查各种资产文件的状态,可以从 AssetServer 轮询。它会告诉你资产是否已加载、仍在加载、未加载或遇到错误。 要检查单个资产,你可以使用 asset_server.get_load_state(…),并提供一个句柄或路径来引用该资产。 ```rs fn print_load_state(asset_server: Res<AssetServer>, suzanne: Res<Suzanne>) { let Some(load_state) = asset_server.get_load_state(suzanne.0.id()) else { return; }; match load_state { LoadState::NotLoaded => info!("asset not loaded"), LoadState::Loading => info!("asset loading"), LoadState::Loaded => info!("asset loaded"), LoadState::Failed(error) => error!("asset failed: {error}"), } } ``` = 3. 访问资产数据 要从系统中访问实际的资产数据,请使用 Assets\<T> 资源。 你可以使用句柄来识别所需的资产。 ```rs fn suzanne_to_cube(mut meshes: ResMut<Assets<Mesh>>, suzanne: Res<Suzanne>) { let Some(mesh) = meshes.get_mut(suzanne.0.id()) else { return; }; *mesh = Cuboid::from_size(Vec3::splat(2.)).mesh().build(); } ``` = 4. 从代码创建资产 你也可以手动将资产添加到 Assets\<T> 中。 为此,首先创建资产的数据(资产类型的实例),然后将其添加到 Assets\<T> 资源中,以便 Bevy 存储和跟踪它。你将获得一个句柄来引用它,就像任何其他资产一样。 ```rs fn spawn_red_sphere( mut commands: Commands, mut meshes: ResMut<Assets<Mesh>>, mut materials: ResMut<Assets<StandardMaterial>>, ) { commands.spawn(( MaterialMeshBundle { mesh: meshes.add(Sphere::new(1.)), material: materials.add(Color::Srgba(Srgba::RED)), transform: Transform::from_xyz(-2.5, 0., 0.), ..default() }, Name::new("Red Sphere"), )); } ```
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/058%20-%20Duskmourn%3A%20House%20of%20Horror/003_Episode%202%3A%20Don't%20Split%20the%20Party.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Episode 2: Don't Split the Party", set_name: "Duskmourn: House of Horror", story_date: datetime(day: 20, month: 08, year: 2024), author: "<NAME>", doc ) The hallway looked like it hadn't been cleaned in years, cobwebs choking the corners and grime streaking the faded wallpaper. Every footstep lifted a small cloud of dust from a tattered rug as the rescue party walked along it, moving with careful tactical precision. Kaito led the group, with the Wanderer close behind. Both had their swords out and ready, eyes scanning the hall for signs of Nashi. Zimone followed them, her own eyes fixed on one of Niv-Mizzet's scanners, which she clutched in both hands like some sort of strange technological security blanket. Tyvar and Niko brought up the rear, both prepared for something to jump out at them. Himoto made a chittering sound and swiveled on Kaito's shoulder, looking back the way they'd come. The rest of the group stopped to see what she was looking at—all save Zimone, who kept walking forward with her eyes on the screen and stopped when she bumped into the Wanderer. "Huh?" she asked, glancing up and blinking owlishly. "The door's gone," said Kaito. "That's ridiculous. Doors are static structures, they can't just—" Zimone turned and paused. "The door's gone." "We tread carefully from here, friends," said Tyvar. "Predators who hide to hunt are more dangerous than those who come to you directly." They resumed their trek along the hall, walking with even more care than they had before. The corridor widened into a parlor of sorts, the faded wallpaper giving way to peeling velour patterned with wide-winged moths picked out in green and gray against the pale rose background. Each moth had multiple eyespots on their wings, creating an eerie sensation of being watched. More halls branched off from here, openings adorning each wall, and paler squares on the walls showed where pictures had fallen or been removed. Zimone frowned, looking from her monitor to the room and back again. "One of Nashi's drones kept transmitting all the way to the end of the hall," she said. "This isn't the same room that it recorded. How is that …?" "The most dangerous labyrinths can rearrange themselves when left to their own devices," said Niko. "Nothing says those are unique to Theros." Kaito nodded. "We don't know whether it can only move when no one's looking. We stay close together. Someone should be able to see you at all times, understand?" "Yes," said Niko. Himoto chittered. Keeping close together and never turning their backs to each other, the group began to explore the room, looking for some sign that Nashi had been here—or that #emph[anyone] had been here, really. Kaito moved to the center of the room, taking a deep breath. "Watch me?" he asked the Wanderer. When she nodded, he closed his eyes. His training had involved learning more than he would have thought possible about the movement of air. Swift-Arm had been insistent that understanding space would make it easier for that space to be exploited to suit a warrior's needs. Under his tutelage, Kaito had learned how to step into a room and feel from the way the air moved against his skin whether he was the first to disturb it recently, or whether he was walking just behind someone who had slipped out another door. This room felt like the central hall of the academy, the air so disturbed and distorted that it was moving in every direction at the same time, never settled, never still. Kaito frowned and opened his eyes, finding the Wanderer watching him intently, no more than a few feet away. "I don't know if Nashi was here recently, but #emph[someone] was," he said. "The air's all over the place." "The … air?" asked Niko. Zimone, meanwhile, nodded enthusiastically. "It's a well-documented phenomenon. Haven't you ever walked into a room and been absolutely #emph[sure] that you just missed someone?" Niko nodded, more grudgingly. "Yes." "And haven't you usually been right when you felt that way? Well, that's because your instincts are keyed to the presence of danger on a level the conscious mind can't normally access. They can tell by the way the air hits your skin whether it's been disturbed recently. Some people can learn to read that sense on a conscious level. But it's very unusual. It takes a lot of training." "That's our Kaito," said Tyvar brightly. "Master of subtlety." "So #emph[why] do I like you again?" "Because our foes are so preoccupied by my brilliance that it makes your job easier," said Tyvar. Zimone blinked after him. "He's smarter than he lets on," said Kaito. "But subtle, he's not." "So someone was just here," said Niko. "Do we try to follow them?" "That might be unwise," said the Wanderer, picking up a frame that had been shoved behind several empty ceramic jugs. The picture it contained looked printed rather than painted, showing a family of three—man, woman, and teenage daughter—all turned toward the original painter. The faces of the adults had been scratched out, reduced to white scabs on the paper, while the daughter continued to smile serenely at the people in the room. Gingerly, the Wanderer placed the picture back on the shelf. "I don't know if we want to find the people who live here," said Zimone. Niko stepped forward. "When we did labyrinth exercises back on Theros, we would search in a pattern to help us be sure we didn't miss anything. We take the right-hand turn and keep following to the right until and unless we wind up back where we started. That way we're never lost, and we know what we haven't looked at yet." "We don't want to find the locals, but we #emph[do] want to find Nashi," said Kaito. "And we want to get as much data as we can for the research team," said Zimone, aiming her monitor at the picture. It beeped, apparently recording something, and she gave a satisfied nod. "Right-hand turn? This tactic matches simple fractal logic." "Glad to have your approval," said Niko, and indicated the door to their right. "This way." They began walking. The rest of the group followed, Kaito tense as he waited for the House to change itself again, still unsettled by the feeling of the air against his skin. The room hadn't felt unoccupied when they entered it, and it didn't feel unoccupied now. All his training said that he was leaving an enemy at his back. Still, he walked on. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Following Niko's route through the House took them through a nonsensical jumble of rooms, connecting to one another with neither rhyme nor reason, kitchens leading into bedrooms, bedrooms leading into conservatories. One echoing room seemed to have been constructed to contain an indoor swimming pool that was still half-filled with dark, murky water, its surface blooming with algae and broad, improbable water lilies. Their flowers were a bruised pinkish white, like the flesh of a drowned sailor, and Niko shivered as they looked at it, turning their face away. This was as far from the wine-dark seas of Theros as they could imagine, and they had seen quite a lot during their travels—their imagination was wide. Barely wide enough to encompass the next room, which lay beyond a set of tall glass doors with moths worked into their metal frames. In the vast space on the other side, an abandoned funfair loomed above a field of rustling, unharvested corn, ears hanging heavy on their stalks and rotting where they fell. The funfair bore little resemblance to the traveling games of Theros, but the commonalities were enough to make the tents and rough constructs of wood and steel make sense. Nothing moved there but the wind. "We found an exit," said Kaito, beginning to step forward. Zimone caught his arm. He stopped to look at her, and she pointed up, at the lightless sky. "Look," she said, and called a small fractal equation into being, mathematics made magical and manifest. It leapt from her hand, shedding blue and green light as it hung in the air a few feet above their heads. The light it shed wasn't much, but it glinted off distant panes of glass, making it obvious that even this impossible place was part of the House. The rustling of the corn seemed suddenly sinister. If they were indoors, there could be no breeze, and without a breeze, why was it moving? "We go back," said the Wanderer firmly. "But—" began Niko. "We go #emph[back] ," she repeated. "Royalty speaks in commands, and commoners answer in action," said Tyvar, amiably enough, and the group turned away from the looming, terrible shapes of the deserted amusements, moving back into the room with the pool. "Where I'm from, we elect our leaders," muttered Niko, and Tyvar laughed. The water looked no less dangerous on their return visit, and no less likely to drag down anyone who got too close. Keeping close to the wall, they walked on, back through a door that should have taken them into a pantry filled with half-empty jars and bushels of rotting root vegetables. Instead, they found themselves crossing an echoing ballroom, cobweb-snarled chandeliers dangling overhead and cracks patterning the windows. "Still no sign of Nashi." Kaito paused, looking up at the windows. "Maybe a rooftop view would be of use?" "No," said the Wanderer, with absolute firmness. Kaito turned, eyebrows raised. She shook her head. "You were the one who realized we had to stay ever visible to one another. None of us would be able to follow you." "I might," said Niko. "I wouldn't trust 'might' in a place like this," said the Wanderer. "It wouldn't matter anyway," said Zimone. They turned to her. She had slung her monitor against her hip and produced a paper notebook from inside her vest, pencil moving fast as she wrote her calculations. "The architecture of this place doesn't make sense. Some of the angles measure differently depending on whether you look at them from the left or the right. If you climbed to the windows above us, you'd be just as likely to come out in a basement or an attic—and you'd still be inside the House either way." Tyvar scoffed. "It's only a house. How large can it be?" "Large," said the Wanderer. Collectively, they switched their attention to her. She pressed one hand to her temple, shaking her head. "This place is … I can't walk the planes any longer, but I can still feel them, the way I did when they pulled me across the Blind Eternities without my consent. This place is #emph[wrong] . It feels encased, like a moth caught in amber, and rotting from within. I'm not sure anything remains of what was once here #emph[except] the House." "There are some fungi that will swallow entire hillsides if allowed to grow unchecked," said Tyvar, uncertainly. "Yes, like that," said the Wanderer. "This feels like a shell surrounding everything there is of what once was, and I fear it has no limits. We should return to where we lost the door back to Ravnica and see if we can't find a way to open it again." "The door vanished," said Niko. "We're pretty smart," said Zimone. "Collectively, I mean. I bet we can figure out how to make the door come back." "So, we backtrack," said Kaito. "This way." They began to move, but had only taken a few steps before someone screamed, deeper in the House, beyond one of the left-hand doorways they had been ignoring during their methodical progress. Tyvar jerked to attention like a hunting hound hearing a huntsman's horn. The voice screamed again. "#emph[HELP ME HELP ME OH SWEET SUNS HELP ME] !" it howled. Tyvar's thin leash on his own heroic urges snapped, and he took off running, shouting, "Fear not! I shall save you!" Zimone's eyes widened. Years of dealing with impulsive Prismari underclassmen had honed her reflexes to a fine point. When someone raced toward danger, it was often down to her to pull them back, so they'd still be alive to pull #emph[her] back when she started wandering toward danger in a more academic manner. She ran after Tyvar. "Come back!" she yelled. "Tyvar, come back! We have to stay together!" Something shattered on the doorway next to her head as she ran through, and then the ballroom was gone, and it was just her, Tyvar, and the sound of screaming. On the other side of the door was an empty hall. There was no one there. No one in danger, no one screaming, only Tyvar, slowing in confusion as he registered the lack of someone in need of rescue. Zimone caught up to him, putting a hand on his elbow. "We have to go back," she said. "But I heard—" "We all did. I think the House is playing tricks." She glanced back over her shoulder, then froze, paling. "That, or it heard us say we didn't want to split the party and thought it would make the decision easier for us." "Houses don't #emph[think] ," said Tyvar, half-laughing as he turned to follow her gaze. "Yeah, well, apparently neither do elven princes, because here we are," said Zimone. Behind them, where the doorway back to the ballroom should have been, was a wall, papered in faded blue and patterned with more of those ever present, increasingly ominous moths. These had long, swooping tails on their hind wings, giving the impression that they were melting off the paper. Tyvar stepped cautiously forward, reaching out to touch the wallpaper with his fingertips. He pulled back as soon as he made contact, grimacing. "Solid," he said, looking to Zimone. "What do we do now?" Zimone shook her head. "I don't know. But we're going to need to figure it out." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "I thought you never missed!" said Kaito, wheeling on Niko, who was staring at their hands in confusion. "Why didn't your shard stop her?" "I … I don't," said Niko. "I never miss." "And you didn't," said the Wanderer. "The doorway moved as Tyvar passed through it. Not very far, but enough to skew your aim. Zimone was already running, she adjusted without thought. This was a trap." "How does a house set a trap?" asked Kaito. "I don't know, but I have the feeling we don't have long to figure it out." Kaito had started after Zimone as soon as the girl began to run and was now standing several feet away from the others, alone in a sea of faded marble tiles. He frowned. "They'll be back. They have to come back." "Do they?" asked Niko. "I trust Tyvar." "The man who just ran off into certain danger at the first excuse?" Niko shook their head. "I saw him try to arm wrestle a giant once, because he thought it would make a good story. He may not worship Birgi, but he's one of hers, no question. I like him, but trust him? To choose safety over glory? I don't think so." The doorway remained empty. "I think …" Kaito chewed the inside of his cheek briefly. "I think we go after them. They can't have gone very far." "We need to stay together," said the Wanderer. Kaito turned to flash her a bright, cocky smile. "That's why I said 'we,' isn't it?" He stepped toward the doorway. The floor he stepped onto opened like the mouth of a lamprey, wide and circular and ringed with jagged, downward-facing teeth. Kaito fell, barely managing to jam his sword into the remaining sliver of the floor before he dropped entirely out of sight. The Wanderer lunged for him, shouting his name as she reached. He reached back, and their fingertips almost brushed before the hole in the floor gaped wider, dislodging his sword, and Kaito fell into the blackness, Himoto's eyes the only light that tracked his descent. #figure(image("003_Episode 2: Don't Split the Party/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) The Wanderer tensed as if to jump after him, only to stop when Niko grabbed her wrist. She looked back at them, disbelieving, and they shook her head. "No," they said. "Not even for Kaito. He's the only one of us who can get out on his own. He's got this." Desperate, she looked back to the hole, and found that it, too, was gone, replaced by smooth floor as if it had never been. She wrenched her arm out of Niko's grasp and sank to her knees, staring at the smooth tile. "But he's alone," she said. "He's alone in this house, where everything is wrong, and everything is rotting." "So, we find him," said Niko, offering her a hand up. The Wanderer looked at their extended hand for a moment, blankly, then took it and allowed herself to be tugged back to her feet. "So, we find them all," she said. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Tyvar hammered on the wall with both fists, sending up a terrible din and bringing cascades of dust down from the crown molding at the top of the walls. "Kaito! Niko! Very pleasant swordswoman without a name!" he shouted. "Can you hear us?" "I don't think they can," said Zimone. She had her monitor out again and was facing away from the wall. "Tyvar …" "What?" "Problem." "I feel we have those in plenty," he said, and turned. They were no longer in a hallway. It had been replaced by a massive, towering library at least three stories in height, the ceiling above them open in a sort of central courtyard shape to show the levels above. Wrought-iron railings shaped into moth wings and spreading branches surrounded each layer of the opening, presumably to keep people from falling to their deaths. The walls were lined with shelves, each one groaning under the weight of dusty books crammed in until no space remained. "It changes when neither of us is looking," he said. "Quantum superposition," she replied. At Tyvar's blank look, she explained, "It's the observer effect. It holds true in physics. In some forms of magic, too. Some interpretations of the Vorzani Conjecture say that the Multiverse itself seeks observation, in the form of people capable of seeing it from multiple directions at once—I haven't proven it yet, but I'd posit that's part of why the opening of connections between planes has been met with a matching decrease in the number of people who can travel them under their own power. The Multiverse can remain stable and observed without that investment of resources." Tyvar didn't look any less blank. Zimone sighed. "It can't change if we're looking. Or at least not as much." "I see." He looked back to the wall, relieved to find it was still there, not replaced by a bookshelf or another endless hall. "Is there any reason to think this wall is loadbearing in any way?" "Not that I can see," said Zimone. "Why?" In answer, Tyvar's skin rippled, taking on the hardwood sheen of the floor beneath his feet, and he pulled back his arm, slamming his fist into the wall hard enough to send fractures racing through the wood beneath the wallpaper. "Ah," said Zimone. "Violence." She should probably stay and watch him fight the wall. She knew that. Looking away risked losing him. But the sound of him punching his way into the body of the House was loud and consistent enough that she wasn't particularly worried about him disappearing without a trace: sometimes being the elvish equivalent of a Lorehold stone mover had its advantages. So she turned and began scanning the shelves around them, making note of the titles she saw represented there, seeking patterns. There was a mighty crashing sound followed by Tyvar's jubilant declaration of, "I'm through! And there's a stairway on the other side!" Zimone flicked her fingers, unspooling a cascading spiral of energy. "Take one end of this with you," she said, pushing it toward him. "I'll keep the other one, and hopefully that means we won't lose each other." She should go with him. She knew that. But the #emph[books] —the lost knowledge of an entire plane, however dangerous, wasn't something she could walk away from easily. Holding tightly to the end of her ribbon of fractal light, she stepped closer to the nearest shelf, trying to decide where to begin. Tyvar frowned a little as he caught the end of Zimone's thread, watching her move closer to the books. He knew a lure when he saw one. Many monsters used them to catch their prey. Give the appearance of sweetness and something truly desired, and they could take things far too canny to be snared. "Zimone …" "Just come back quickly. There's something about the way the floors are layered here that makes me think you won't be gone long." Tyvar blinked. Then he shrugged, turning back to the stairs. He'd tried. Short of picking the young woman up and carrying her with him, or staying trapped where they were, he really didn't see another option. He tied the fractal thread around his wrist, then stepped through the hole he'd opened in the wall and began climbing up. The walls of the stairwell were decorated with painted portraits of ordinary people, humans and elves, which became more distorted and #emph[wrong] as he continued onward. Teeth extended into fangs, hands into claws, and smiles grew too wide for the faces that wore them, until it seemed like their heads should split in two. Tyvar shuddered and kept walking. After Phyrexia, anything which distorted the body without the invitation of its owner transcended horror, becoming a violation of the natural order of things. True, these people could have sought their transformations, but there was a glinting despair in their painted eyes that made him think they had done no such thing. He walked through a gallery of nightmares, and he was well pleased when he saw a doorway up ahead at the next landing. He walked faster. The thread around his wrist extended to stay with him, and as it didn't rebound to flutter uselessly against his skin, he assumed Zimone still held her end, safe in the library that seemed to be her natural environment. Tyvar kept walking, stepping through the doorway and into a narrow aisle between heavily laden bookshelves. They were filled with dusty, tight-packed books. He was back in the library. His stomach sank. He continued onward to the end of the aisle, where he heard Zimone's voice call, "Psst, Tyvar! Over here!" He looked to the left. There was Zimone, the other end of the thread tied around her own wrist, waving vigorously with her free hand. He walked toward her, dispirited. "I fear we may be in dire danger, friend Zimone," he said. She nodded. "I think you're probably right. Come help me move the archivist's ladder. I need to get to the top shelves." She tugged the thread, which dissolved into glittering light as it fell away, and walked deeper into the library. Not wanting to lose sight of her again, Tyvar followed. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Niko and the Wanderer attempted to backtrack their way through the transformed, ever-shifting house, taking the turns that corresponded to the ones they'd taken before, moving with grim purpose through eerie, unfamiliar rooms. For a whole series of lushly appointed parlors and bedrooms, the air was so hot their clothing became almost unbearable, leaving them miserable and sweaty. It was followed by a long corridor with walls of glass that looked like it had been built for a grand royal conservatory, a passage for the gardeners to use in their daily labors. But outside those glass walls was no garden green, but a drowned world of flooded rooms, filled with rotten, floating furniture and bloated books that floated to and fro on impossible currents. "I'm going to take a bold stance and say that I don't like it here," said Niko. "It's pretty awful, actually." The Wanderer cracked a slight smile—her first since Kaito's disappearance. "I think you'll find general agreement for that position." "I'm sorry about your friend." Niko paused, then added, "The one we came here to find." "Nashi, yes. His mother was very dear to me, and I owe his family a great debt. She died in the invasion." "I'm sorry to hear that." "I was sorry to kill her." Niko shook their head. "If she died in the invasion, you didn't kill her. Phyrexia did. You just made sure it would stick." The Wanderer sighed. "If I could believe that, I might sleep easier. I owe my life to the people of Kamigawa, and she was among the best of them. She may have died at Phyrexia's hand, but we've seen some lost that way returned to us. If I'd been slower in my defense, less determined, she might be with us now." "Or Kamigawa might be gone." The Wanderer blinked. She hadn't considered that, and so for a while they walked in silence, her thoughts threatening to overwhelm her. A door came into view ahead of them, heavy metal with frosted hinges, entirely out of place in the delicate glass wall. Both frowned, but it was Niko who reached for the latch and pulled the door open, releasing a burst of freezing air. Cautiously, they slipped through, and the door swung shut behind them, sealing them in. They were in a cold room with stone floors, heavy iron chains hanging from the ceiling, the hooks at their ends driven into massive cuts of meat. The Wanderer scanned the raw, skinned bodies, relieved when she saw nothing that appeared either human or nezumi. The House didn't bring them here to gloat over Nashi's death, at least. Not yet. Niko and the Wanderer moved in silence between the dangling cuts of meat, careful not to lose sight of one another. The House had already claimed three among their number. All they could do now to help their companions was make it back to Ravnica and ask Niv-Mizzet for aid. Surely, he had a plan for what to do if the first team went missing. Surely, he would give them the resources to bring their people home. Surely. The cold room seemed almost endless. There were no walls in sight, only hanging carcasses and chains waiting for the delivery of the next kill. Abruptly, Niko thrust their arm out, stopping the Wanderer from going any farther. She shot them a sour look and they nodded toward the far side of the room where they could see the chains swinging back into place, as if something massive had pushed the hanging carcasses aside. The Wanderer drew her sword, taking up a fighting stance, while Niko pulled several shards of magic out of the air, rotating them above their fingertips. The pair prepared for the battle sure to come, and, as such, were entirely unprepared for the hands which reached out from behind them and yanked them hard behind the nearest hanging, flensed behemoth. Whatever it had been in life, it had resembled some sort of sloth, all solid muscle and long limbs tipped in wicked claws. Now it was a serviceable wall. Niko and the Wanderer whirled, ready to fight. The pale, narrow-faced man who had pulled them behind the beast backed away, hands up like he was trying to ward them off. He pressed a finger to his lips, pulling a sheet of paper out of his pocket and holding it out to them. There, written in several scripts, including Theran and Kamigawan, was the phrase BE QUIET. It didn't translate exactly; the Kamigawan text read UTTER NO SOUND. But the meaning was the same, no matter what. The pair looked at him in quizzical silence, and he nodded exaggeratedly before pulling a slingshot out of his other pocket. He produced a ball of what looked like blood-matted hair from the same pocket, slipping it into the slingshot's cup as he pulled it back and nodded toward the room behind them. Niko and the Wanderer turned to peer around the edge of the carcass into the chain-filled gloom. As they watched, a figure came stalking through the carcasses, tall and wiry. Wild and unkempt hair sprouted around a mask which covered the upper part of its face, revealing only two mad, searching eyes. It wore a canvas apron covered in unmentionable stains and carried a cleaver. The stranger pulled back the cup of his slingshot even farther before letting fly, sending the ball of bloody hair sailing into the dark beyond the figure. He missed. He missed, and the figure continued to stalk silently, menacingly toward them. Then, the ball of hair hit one of the distant chains, setting it rattling, and the figure whipped around with terrifying speed to face the sound. It stalked toward the motion, only to step into a beartrap that had been concealed by the fog on the floor. It howled, struggling to free itself. The smell of blood filled the air. #figure(image("003_Episode 2: Don't Split the Party/02.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) The stranger pocketed his slingshot before gesturing for the others to follow him, a satisfied look on his face as he slid silently between carcasses. Niko and the Wanderer followed, unsure of what was happening, but seeing no better solution. Finally, a door, this one polished with a small window set at eye level. The stranger eased it open, and they followed him out to yet another parlor, this one warm as if to offset the freezing room they'd just escaped. A small fire crackled in the fireplace at one end of the space; the bookshelves were almost empty, clearly looted to feed the fire. "Razorkin," said the stranger. "The ones you find in the Floodpits aren't used to hearing sounds not echoed through water. You can distract them, sometimes. That was a big one. You wouldn't want to fight it head-on. You'd lose." Niko, meanwhile, was giving the newcomer a frank once-over. He had spiky, scraggly black hair and wore a long, loose jacket-vest over clothing that looked like it had been patched together from a dozen different sources; Niko was sure some of the pieces had originally been wallpaper. "What's your name?" they asked. "Winter." "And how long have you lived in the House, Winter?" "All my life," said the stranger. He shrugged. "There isn't anything else. The House is the world, and the world is the House, and once it has hold of you, there's nowhere else to go. You'll see that soon, if you don't already." "You belong to Duskmourn now."
https://github.com/wjwei-handsome/personal_poster_typst
https://raw.githubusercontent.com/wjwei-handsome/personal_poster_typst/main/example.typ
typst
#import "./poster.temp.typ": * /// HERE START CONFIGURE YOUR POSTER #show: poster.with( title: [#text[TYPST: a #emph[rust] tool to compose essays faster, Maybe your looooonger title to 2 rows.]], authors: ( (name: "<NAME>", staff: "1"), (name: "<NAME>", staff: "2*") ), departments: ( (id: "1", name: "National Unnatural Phenomena Institute"), (id: "2", name: "Oklahoma Thunders") ), univ_logo: "images/logo.png", team_logo: "images/logo.png", footer_center_text: "The 6th Maize Biology Conference of China @ Harbin", footer_left_text: "<NAME>: www.wjwei.blog", footer_right_text: "E-mail: <EMAIL>", footer_color: "ebcfb2", num_columns: "2", ) /// HERE END CONFIGURE YOUR POSTER /// HERE START YOUR POSTER CONTENTS = #lorem(2) #lorem(200) = Overview of Multi Omics #figure( image("images/fig1.jpg", width: 100%), caption: lorem(2), ) + #lorem(20) + #lorem(20) + #lorem(20) + #lorem(20) - #lorem(20) - #lorem(20) - #lorem(20) - #lorem(20) - #lorem(20) - #lorem(20) = #lorem(3) #grid( columns: (auto, auto), rows: (auto, auto), image("images/fig2.jpg",width: 100%), image("images/fig3.jpg",width: 100%), image("images/fig4.jpg",width: 100%), image("images/fig5.jpg",width: 100%), ) #lorem(100) = #lorem(3) #lorem(100) = #lorem(3) #lorem(200) /// HERE END YOUR POSTER CONTENTS
https://github.com/Shedward/dnd-charbook
https://raw.githubusercontent.com/Shedward/dnd-charbook/main/dnd/game/proficiencies.typ
typst
#import "../core/core.typ" #let toolsProficiency( title, source: none, items: (), actions: (), skillsEffects: () ) = ( title: title, source: source, items: items, actions: actions, skillsEffects: skillsEffects ) #let any = "~" #let toolsAction( name, dc: none, ..args ) = ( name: name, dc: dc, body: if args.pos().len() > 0 { args.pos().last() } else { none } ) #let skillEffect(..skills, body) = ( skills: skills, body: body )
https://github.com/lrmrct/CADMO-Template
https://raw.githubusercontent.com/lrmrct/CADMO-Template/main/README.md
markdown
# CADMO thesis Template My quick and dirty translation of the CADMO thesis template into Typst, which I will use for my own thesis. ## TODOs - Add missing text. - Exact margins and font sizes. - Section headers. - Insert Q.E.D. into math body. - Showcase visualizations.
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/105.%20maybe.html.typ
typst
maybe.html Can You Buy a Silicon Valley? Maybe. February 2009A lot of cities look at Silicon Valley and ask "How could we make something like that happen here?" The organic way to do it is to establish a first-rate university in a place where rich people want to live. That's how Silicon Valley happened. But could you shortcut the process by funding startups?Possibly. Let's consider what it would take.The first thing to understand is that encouraging startups is a different problem from encouraging startups in a particular city. The latter is much more expensive.People sometimes think they could improve the startup scene in their town by starting something like Y Combinator there, but in fact it will have near zero effect. I know because Y Combinator itself had near zero effect on Boston when we were based there half the year. The people we funded came from all over the country (indeed, the world) and afterward they went wherever they could get more funding—which generally meant Silicon Valley.The seed funding business is not a regional business, because at that stage startups are mobile. They're just a couple founders with laptops. [1]If you want to encourage startups in a particular city, you have to fund startups that won't leave. There are two ways to do that: have rules preventing them from leaving, or fund them at the point in their life when they naturally take root. The first approach is a mistake, because it becomes a filter for selecting bad startups. If your terms force startups to do things they don't want to, only the desperate ones will take your money.Good startups will move to another city as a condition of funding. What they won't do is agree not to move the next time they need funding. So the only way to get them to stay is to give them enough that they never need to leave.___How much would that take? If you want to keep startups from leaving your town, you have to give them enough that they're not tempted by an offer from Silicon Valley VCs that requires them to move. A startup would be able to refuse such an offer if they had grown to the point where they were (a) rooted in your town and/or (b) so successful that VCs would fund them even if they didn't move.How much would it cost to grow a startup to that point? A minimum of several hundred thousand dollars. Wufoo seem to have rooted themselves in Tampa on $118k, but they're an extreme case. On average it would take at least half a million.So if it seems too good to be true to think you could grow a local silicon valley by giving startups $15-20k each like Y Combinator, that's because it is. To make them stick around you'd have to give them at least 20 times that much.However, even that is an interesting prospect. Suppose to be on the safe side it would cost a million dollars per startup. If you could get startups to stick to your town for a million apiece, then for a billion dollars you could bring in a thousand startups. That probably wouldn't push you past Silicon Valley itself, but it might get you second place.For the price of a football stadium, any town that was decent to live in could make itself one of the biggest startup hubs in the world.What's more, it wouldn't take very long. You could probably do it in five years. During the term of one mayor. And it would get easier over time, because the more startups you had in town, the less it would take to get new ones to move there. By the time you had a thousand startups in town, the VCs wouldn't be trying so hard to get them to move to Silicon Valley; instead they'd be opening local offices. Then you'd really be in good shape. You'd have started a self-sustaining chain reaction like the one that drives the Valley.___But now comes the hard part. You have to pick the startups. How do you do that? Picking startups is a rare and valuable skill, and the handful of people who have it are not readily hireable. And this skill is so hard to measure that if a government did try to hire people with it, they'd almost certainly get the wrong ones.For example, a city could give money to a VC fund to establish a local branch, and let them make the choices. But only a bad VC fund would take that deal. They wouldn't seem bad to the city officials. They'd seem very impressive. But they'd be bad at picking startups. That's the characteristic failure mode of VCs. All VCs look impressive to limited partners. The difference between the good ones and the bad ones only becomes visible in the other half of their jobs: choosing and advising startups. [2]What you really want is a pool of local angel investors—people investing money they made from their own startups. But unfortunately you run into a chicken and egg problem here. If your city isn't already a startup hub, there won't be people there who got rich from startups. And there is no way I can think of that a city could attract angels from outside. By definition they're rich. There's no incentive that would make them move. [3]However, a city could select startups by piggybacking on the expertise of investors who weren't local. It would be pretty straightforward to make a list of the most eminent Silicon Valley angels and from that to generate a list of all the startups they'd invested in. If a city offered these companies a million dollars each to move, a lot of the earlier stage ones would probably take it.Preposterous as this plan sounds, it's probably the most efficient way a city could select good startups.It would hurt the startups somewhat to be separated from their original investors. On the other hand, the extra million dollars would give them a lot more runway.___Would the transplanted startups survive? Quite possibly. The only way to find out would be to try it. It would be a pretty cheap experiment, as civil expenditures go. Pick 30 startups that eminent angels have recently invested in, give them each a million dollars if they'll relocate to your city, and see what happens after a year. If they seem to be thriving, you can try importing startups on a larger scale.Don't be too legalistic about the conditions under which they're allowed to leave. Just have a gentlemen's agreement.Don't try to do it on the cheap and pick only 10 for the initial experiment. If you do this on too small a scale you'll just guarantee failure. Startups need to be around other startups. 30 would be enough to feel like a community.Don't try to make them all work in some renovated warehouse you've made into an "incubator." Real startups prefer to work in their own spaces.In fact, don't impose any restrictions on the startups at all. Startup founders are mostly hackers, and hackers are much more constrained by gentlemen's agreements than regulations. If they shake your hand on a promise, they'll keep it. But show them a lock and their first thought is how to pick it.Interestingly, the 30-startup experiment could be done by any sufficiently rich private citizen. And what pressure it would put on the city if it worked. [4]___Should the city take stock in return for the money? In principle they're entitled to, but how would they choose valuations for the startups? You couldn't just give them all the same valuation: that would be too low for some (who'd turn you down) and too high for others (because it might make their next round a "down round"). And since we're assuming we're doing this without being able to pick startups, we also have to assume we can't value them, since that's practically the same thing.Another reason not to take stock in the startups is that startups are often involved in disreputable things. So are established companies, but they don't get blamed for it. If someone gets murdered by someone they met on Facebook, the press will treat the story as if it were about Facebook. If someone gets murdered by someone they met at a supermarket, the press will just treat it as a story about a murder. So understand that if you invest in startups, they might build things that get used for pornography, or file-sharing, or the expression of unfashionable opinions. You should probably sponsor this project jointly with your political opponents, so they can't use whatever the startups do as a club to beat you with.It would be too much of a political liability just to give the startups the money, though. So the best plan would be to make it convertible debt, but which didn't convert except in a really big round, like $20 million.___How well this scheme worked would depend on the city. There are some towns, like Portland, that would be easy to turn into startup hubs, and others, like Detroit, where it would really be an uphill battle. So be honest with yourself about the sort of town you have before you try this.It will be easier in proportion to how much your town resembles San Francisco. Do you have good weather? Do people live downtown, or have they abandoned the center for the suburbs? Would the city be described as "hip" and "tolerant," or as reflecting "traditional values?" Are there good universities nearby? Are there walkable neighborhoods? Would nerds feel at home? If you answered yes to all these questions, you might be able not only to pull off this scheme, but to do it for less than a million per startup.I realize the chance of any city having the political will to carry out this plan is microscopically small. I just wanted to explore what it would take if one did. How hard would it be to jumpstart a silicon valley? It's fascinating to think this prize might be within the reach of so many cities. So even though they'll all still spend the money on the stadium, at least now someone can ask them: why did you choose to do that instead of becoming a serious rival to Silicon Valley? Notes[1] What people who start these supposedly local seed firms always find is that (a) their applicants come from all over, not just the local area, and (b) the local startups also apply to the other seed firms. So what ends up happening is that the applicant pool gets partitioned by quality rather than geography.[2] Interestingly, the bad VCs fail by choosing startups run by people like them—people who are good presenters, but have no real substance. It's a case of the fake leading the fake. And since everyone involved is so plausible, the LPs who invest in these funds have no idea what's happening till they measure their returns.[3] Not even being a tax haven, I suspect. That makes some rich people move, but not the type who would make good angel investors in startups.[4] Thanks to <NAME> for pointing this out.Thanks to <NAME>, <NAME>, <NAME>, and <NAME> for reading drafts of this.
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/list_08.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Alignment shouldn't affect marker #set align(horizon) - ABCDEF\ GHIJKL\ MNOPQR
https://github.com/UntimelyCreation/typst-neat-cv
https://raw.githubusercontent.com/UntimelyCreation/typst-neat-cv/main/src/content/en/education.typ
typst
MIT License
#import "../../template.typ": * #cvSection("Education") #cvEntry( title: [Master of Science in Computer Science], organisation: [Same University], logo: "", date: [2016 - 2018], location: [France], description: list( [#lorem(20)], ), tags: ("Database Systems", "Computer Networks", "Cybersecurity") ) #divider() #cvEntry( title: [Bachelor of Science in Computer Science], organisation: [Some University], logo: "", date: [2014 - 2016], location: [France], description: list( [#lorem(20)], ), )
https://github.com/kdog3682/typkit
https://raw.githubusercontent.com/kdog3682/typkit/main/0.1.0/src/layout.typ
typst
#import "resolve.typ": * #import "ao.typ": * #import "misc.typ": wrap #import "typography.typ": * #import "validation.typ": * #import "strokes.typ" #import "lines.typ" #import "typst.typ" #let transpose(arr, width) = { array.zip(..arr.chunks(width)).join() } #let apply-padding(c, ..sink) = { let kwargs = sink.named() let left = kwargs.at("padding-left", default: none) let right = kwargs.at("padding-right", default: none) let x = kwargs.at("padding-x", default: none) if left != none { h(resolve-pt(left)) } else if x != none { h(resolve-pt(x)) } c if right != none { h(resolve-pt(right)) } else if x != none { h(resolve-pt(x)) } } #let apply-margins(c, ..sink) = { let kwargs = sink.named() let left = kwargs.at("margin-left", default: none) let right = kwargs.at("margin-right", default: none) let bottom = kwargs.at("margin-bottom", default: none) let top = kwargs.at("margin-top", default: none) let x = kwargs.at("margin-x", default: none) let y = kwargs.at("margin-y", default: none) let base = ( left: left, right: right, x: x, y: y, bottom: bottom, top: top, ) // let attrs = (:) // assign(attrs, base) // pad(c, ..remove-none(base)) } #let centered(c, ..sink) = { let args = sink.pos() let alignment = if args.len() == 1 { horizon + center } else { center } align(c, alignment) } #let flex(..sink) = { let opts = sink.named() let aligner(c) = { return align(c, opts.at("align", default: horizon)) } let kwargs = build-attrs((spacing: 15pt), sink) let args = sink.pos().map(aligner) stack(dir: ltr, ..args, ..kwargs) } #let tflex(..sink) = { let args = sink.pos() let kwargs = sink.named() let columns = args.len() table(align: horizon + center, columns: columns, stroke: none, ..kwargs, ..args) } #let base-flex(..args) = { let base = ( inset: 0pt, column-gutter: 15pt, stroke: none, ) let pos = args.pos() let opts = build-attrs(base, args) let spacing = opts.remove("spacing", default: none) if spacing != none { opts.insert("column-gutter", spacing) } table(columns: pos.len(), ..opts, ..pos) } #let tflex(..sink) = { base-flex(align: horizon + center, ..sink) } #let boxed(c, size: 20, ..sink) = { size = resolve-pt(size) box(c, width: size, height: size, ..sink) } /// Documentation /// css-flex, flex, and tflex all do flex layouts. /// the main contribution of css-flex is to have justify-content key. /// example: "apart" #let css-flex(..sink) = { let flat(arg) = { if is-array(arg) { arg.join() } else { arg } } let apart(col, row, length: none) = { if col == 0 { left + horizon } else if col == length - 1 { right + horizon } else { center + horizon } } let alignments = ( "apart": apart ) let args = sink.pos().map(flat) let length = args.len() let base = ( inset: 0pt, align: "apart", columns: (1fr,) * length ) let opts = merge-dictionary(base, sink.named()) let align = alignments.at(opts.at("align")).with(length: length) let columns = opts.at("columns") if columns == auto { columns = (auto,) * length } let table-opts = ( columns: columns, align: align, stroke: none, inset: opts.inset ) return table(..table-opts, ..args) } #let simple-colon(a, b, spacing: 0.5em, underline: false, ..sink) = { let prefix = if is-string(a) { bold(a + ":") } else { bold(a) } let c = resolve-content(b) let suffix = if underline == true { typst.underline(c) } else { c } let value = { prefix h(spacing) suffix } text(value, ..sink) } #let is-bolded(el) = { if is-string(el) { return false } let children = el.fields().children return children.any((x) => x.func() == strong) } #let colon(..sink) = { let pos=sink.pos() let opts=sink.named() if pos.len() == 2 { return simple-colon(..pos, ..opts) } let joins = ( "comma": ", ", "newlines": "\n" ) let join = joins.at(opts.at("join", default: "comma")) let width = opts.at("width", default: none) let align = opts.at("align", default: top) let base-table-attrs = ( column-gutter: 15pt, row-gutter: 15pt, inset: 0pt ) let table-attrs = build-attrs(base-table-attrs, sink) let callback((i, el)) = { if is-even(i) { if is-bolded(el) { el } else if is-string(el) { bold(str(el) + ":") } else { bold(el) } } else { if is-array(el) { el.join(resolve-content(join)) } else { resolve-content(el) } } } let args = pos.enumerate().map(callback) let c = table(columns: 2, stroke: none, align: align, ..table-attrs, ..args) if exists(width) { box(c, width: width) } else { c } } #let bullet(items, label: none, ..sink) = { let items = items.map(resolve-content) if label == none { list(..items, ..sink.named()) } else { bold(label) v(0pt) list(..items, indent: 5pt, ..sink.named()) } } #let pill(c, ..sink) = { let base = (inset: 5pt, radius: 5pt, stroke: strokes.soft) let attrs = build-attrs(base, sink) box(..attrs, align(c, center + horizon)) } #let indent(c, ind) = { stack(dir: ltr, h(resolve-pt(ind)), resolve-content(c), spacing: 0pt) } #let indent(content, indent: 15pt, above: 5pt, below: 10pt, width: 65%, spacing: 0.6em) = { v(above) let c = block(width: width, spacing: spacing, { set text(size: 0.9em) content }) stack(dir: ltr, h(indent), c, spacing: 0pt) v(below) } #let boxy(c, ..sink) = { let base = ( stroke: 0.25pt + black, inset: ( x: 5pt, y: 5pt, ), radius: 3pt, baseline: 25%, ) let attrs = build-attrs(base, sink, key: "box", aliases: true) let kwargs = sink.named() let outer-label = kwargs.at("outer-label", default: none) let p = box(..attrs, resolve-math-content(c)) if outer-label != none { p = box({ centered(resolve-math-content(outer-label)) v(-5pt) p }, stroke: none) } apply-padding(p, ..sink) } #let stack-boxy(a, b, inner: (:), outer: (:), spacing: 10pt) = { let inner-attrs = inner let outer-attrs = outer boxy(..outer-attrs, stack(align(boxy(resolve-content(a), ..inner-attrs), horizon), align(resolve-content(b), horizon), spacing: spacing, dir: ltr)) } #let flex-table(..sink) = { let opts = sink.named() let rows = sink.pos() let base = ( stroke: none, align: left + horizon, inset: 0pt, columns: rows.at(0).len(), column-gutter: 15pt, row-gutter: 10pt, ) let attrs = build-attrs(base, sink, key: "table") table(..attrs, ..rows.flatten()) } #let x-table(..sink) = { let opts = sink.named() let rows = sink.pos() let base = ( inset: 10pt, align: horizon + center, ) let attrs = build-attrs(base, sink, key: "table") let dir = opts.at("dir", default: "V") if dir == "H" { let a = () let b = () for ((x, y)) in rows { a.push(x) b.push(y) } attrs.insert("columns", a.len()) let elements = a + b table(..attrs, ..elements) } else { attrs.insert("columns", rows.at(0).len()) table(..attrs, ..rows.flatten()) } } #let title(c, line: "soft") = { centered(h1(resolve-content(c))) v(-15pt) dictionary(lines).at(line) v(10pt) } #let footer(c) = { place(box({ lines.soft resolve-content(c) }), bottom + center) } // flex2 is the next version of base-flex // it might be the next version of all the flexes // it is the most explicit // go with this #let flex2(..sink) = { let args = sink.pos() let items = () let align = () let columns = () for arg in args { items.push(arg.content) align.push(arg.at("align", default: auto)) columns.push(arg.at("width", default: auto)) } let items = args.map((x) => x.content) let base = ( stroke: none ) let kwargs = build-attrs(base, sink, key: "table") table(..items, align: align, columns: columns, ..kwargs) } // #simple-colon("abc", "def", size: 50pt, underline: true)
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/GR_old/oktoich/Hlas1/0_Nedela.typ
typst
#let M_Ne = ( "HV": ( ("", "", "Τάς εσπερινάς ημών ευχάς, πρόσδεξαι Άγιε Κύριε, καί παράσχου ημίν άφεσιν αμαρτιών, ότι μόνος εί ο δείξας εν κόσμω τήν Ανάστασιν."), ("", "", "Τάς εσπερινάς ημών ευχάς, πρόσδεξαι Άγιε Κύριε, καί παράσχου ημίν άφεσιν αμαρτιών, ότι μόνος εί ο δείξας εν κόσμω τήν Ανάστασιν."), ("", "", "Κυκλώσατε λαοί Σιών, καί περιλάβετε αυτήν, καί δότε δόξαν εν αυτή, τώ Αναστάντι εκ νεκρών, ότι αυτός εστιν ο Θεός ημών, ο λυτρωσάμενος ημάς εκ τών ανομιών ημών."), ("", "", "Δεύτε λαοί υμνήσωμεν, καί προσκυνήσωμεν Χριστόν, δοξάζοντες αυτού τήν εκ νεκρών ανάστασιν. Ότι αυτός εστιν ο Θεός ημών, ο εκ τής πλάνης τού εχθρού τόν κόσμον λυτρωσάμενος."), ("Δογματικόν", "", "Παρθενική πανήγυρις σήμερον, αδελφοί, σκιρτάτω η κτίσις, χορευέτω η ανθρωπότης, συνεκάλεσε γάρ ημάς η Αγία Θεοτόκος, τό αμόλυντον κειμήλιον τής Παρθενίας, ο λογικός τού δευτέρου Αδάμ Παράδεισος, τό εργαστήριον τής ενώσεως τών δύο φύσεων, η πανήγυρις τού σωτηρίου συναλλάγματος, η παστάς, εν ή ο Λόγος ενυμφεύσατο τήν σάρκα, η όντως κούφη νεφέλη, η τόν επί τών Χερουβείμ μετά σώματος βαστάσασα. Ταίς αυτής ικεσίαις, Χριστέ ο Θεός, σώσον τάς ψυχάς ημών."), ), "S": ( ("", "", "Τώ πάθει σου, Χριστέ, παθών ηλευθερώθημεν, καί τή Αναστάσει σου εκ φθοράς ελυτρώθημεν, Κύριε, δόξα σοι."), ("", "Τῶν οὐρανίων ταγμάτων.", "Δεδοξασμένη υπάρχεις εν γενεαίς γενεών, Παρθενομήτορ Κόρη, Θεοτόκε Μαρία, τού κόσμου προστασία, τεκούσα σαρκί, τόν Υίόν τού Ανάρχου Πατρός, καί συναϊδιον Πνεύματι αληθώς, όν ικέτευε σωθήναι ημάς."), ("", "", "Οι συνεχόμενοι θλίψεσιν αδοκήτοις, Αγνή, σέ προστασίαν μόνην, κεκτημένοι Παρθένε, βοώμεν ευχαρίστως, σώσον ημάς, Παναγία Θεόνυμφε, σύ γάρ υπάρχεις τού κόσμου καταφυγή, καί αντίληψις τού γένους ημών."), ("", "", "Ανεκαινίσθη ο κόσμος εν τή κυήσει σου, Θεοκυήτορ Κόρη, τών πιστών σωτηρία, καί άγρυπνος προστάτις τών ευσεβώς αιτουμένων σε άχραντε, μή διαλείπης πρεσβεύουσα εκτενώς, υπέρ πάντων τών υμνούντων σε."), ("Θεοτοκίον", "", "Νεφέλην σε φωτός αϊδίου, Παρθένε, ο Προφήτης ωνόμασεν, εν σοί γάρ ως υετός επί πόκον, καταβάς ο Λόγος τού Πατρός, καί εκ σού ανατείλας, τόν κόσμον εφώτισε, τήν πλάνην κατήργησε, Χριστός ο Θεός ημών, αυτόν ικετεύουσα εκτενώς, Παναγία δεόμεθα, μή παύση υπέρ ημών, τών αληθή Θεοτόκον ομολογούντων σε."), ), ) #let V_Ne = ( "HV": ( ("", "", "Τάς εσπερινάς ημών ευχάς, πρόσδεξαι Άγιε Κύριε, καί παράσχου ημίν άφεσιν αμαρτιών, ότι μόνος εί ο δείξας εν κόσμω τήν ανάστασιν."), ("", "", "Κυκλώσατε λαοί Σιών, καί περιλάβετε αυτήν, καί δότε δόξαν εν αυτή, τώ Αναστάντι εκ νεκρών, ότι αυτός εστιν ο Θεός ημών, ο λυτρωσάμενος ημάς εκ τών ανομιών ημών."), ("", "", "Δεύτε Λαοί υμνήσωμεν, καί προσκυνήσωμεν Χριστόν, δοξάζοντες αυτού τήν εκ νεκρών Ανάστασιν, ότι αυτός εστιν ο Θεός ημών, ο εκ τής πλάνης τού εχθρού τόν κόσμον λυτρωσάμενος."), ("", "", "Ευφράνθητε ουρανοί, σαλπίσατε τά θεμέλια τής γής, βοήσατε τά όρη ευφροσύνην, ιδού γάρ ο Εμμανουήλ τάς αμαρτίας ημών, τώ σταυρώ προσήλωσε, καί ζωήν ο διδούς, θάνατον ενέκρωσε, τόν Αδάμ αναστήσας, ως φιλάνθρωπος."), ("", "", "Τόν σαρκί εκουσίως σταυρωθέντα δι' ημάς, παθόντα καί ταφέντα, καί αναστάντα εκ νεκρών, υμνήσωμεν λέγοντες, Στήριξον ορθοδοξία τήν Εκκλησίαν σου Χριστέ, καί ειρήνευσον τήν ζωήν ημών, ως αγαθός καί φιλάνθρωπος."), ("", "", "Τώ ζωοδόχω σου τάφω, παρεστώτες οι ανάξιοι, δοξολογίαν προσφέρομεν τή αφάτω σου ευσπλαγχνία, Χριστέ ο Θεός ημών, ότι σταυρόν κατεδέξω, καί θάνατον αναμάρτητε, ίνα τώ κόσμω δωρήση τήν Ανάστασιν, ως φιλάνθρωπος."), ("", "", "Τόν τώ Πατρί συνάναρχον, καί συναϊδιον Λόγον, τόν εκ παρθενικής νηδύος προελθόντα αφράστως καί Σταυρόν καί θάνατον δι' ημάς εκουσίως καταδεξάμενον, καί αναστάντα εν δόξη, υμνήσωμεν λέγοντες, ζωοδότα Κύριε δόξα σοι, ο Σωτήρ τών ψυχών ημών."), ("", "", ""), ("", "", ""), ("", "", ""), ("Θεοτοκίον", "", "Τήν παγκόσμιον δόξαν τήν εξ ανθρώπων σπαρείσαν, καί τόν Δεσπότην τεκούσαν, τήν επουράνιον πύλην, υμνήσωμεν Μαρίαν τήν Παρθένον, τών Ασωμάτων τό άσμα, καί τών πιστών τό εγκαλλώπισμα, αύτη γάρ ανεδείχθη ουρανός, καί ναός τής θεότητος, αύτη τό μεσότοιχον τής έχθρας καθελούσα, ειρήνην αντεισήξε, καί τό βασίλειον ηνέωξε, Ταύτην ούν κατέχοντες, τής πίστεως τήν άγκυραν, υπέρμαχον έχομεν, τόν εξ αυτής τεχθέντα Κύριον. Θαρσείτω τοίνυν, θαρσείτω Λαός τού Θεού, καί γάρ αυτός πολεμήσει τούς εχθρούς ως παντοδύναμος."), ), "S": ( ("", "", "Τώ πάθει σου Χριστέ, παθών ηλευθερώθημεν, καί τή Αναστάσει σου εκ φθοράς ελυτρώθημεν. Κύριε δόξα σοι."), ("", "", "Αγαλλιάσθω η κτίσις, ουρανοί ευφραινέσθωσαν, χείρας κροτείτω τά έθνη μετ' ευφροσύνης, Χριστός γάρ ο Σωτήρ ημών, τώ Σταυρώ προσήλωσε τάς αμαρτίας ημών, καί τόν θάνατον νεκρώσας, ζωήν ημίν εδωρήσατο, πεπτωκότα τόν Αδάμ παγγενή αναστήσας, ως Φιλάνθρωπος."), ("", "", "Βασιλεύς υπάρχων ουρανού καί γής, Ακατάληπτε, εκών εσταύρωσαι διά φιλανθρωπίαν, όν ο Άδης συναντήσας κάτωθεν επικράνθη, καί Δικαίων ψυχαί δεξάμεναι, ηγαλλιάσαντο, Αδάμ δέ ιδών σε τόν Κτίστην εν τοίς καταχθονίοις ανέστη. Ώ τού θαύματος! πώς θανάτου εγεύσατο η τών απάντων ζωή; άλλ' ή ως ηβουλήθη, κόσμον φωτίσαι κραυγάζοντα καί λέγοντα, ο αναστάς εκ τών νεκρών, Κύριε δόξα σοι."), ("", "", "Γυναίκες μυροφόροι μύρα φέρουσαι, μετά σπουδής καί οδυρμού τόν τάφον σου κατέλαβον, καί μή ευρούσαι τό άχραντον Σώμά σου, παρά δέ τού Αγγέλου μαθούσαι τό καινόν, καί παράδοξον θαύμα, τοίς Αποστόλοις έλεγον, Ανέστη ο Κύριος, παρέχων τώ κόσμω τό μέγα έλεος."), ("Θεοτοκίον", "", "Ιδού πεπλήρωται η τού Ησαϊου πρόρρησις, Παρθένος γάρ εγέννησας, καί μετά τόκον, ως πρό τόκου διέμεινας. Θεός γάρ ήν ο τεχθείς, διό καί φύσις εκαινοτόμησεν. Αλλ' ώ Θεομήτορ, ικεσίας σών δούλων, σώ τεμένει προσφερομένας σοι, μή παρίδης, αλλ' ως τόν Εύσπλαγχνον σαίς αγκάλαις φέρουσα, σοίς οικέταις σπλαγχνίσθητι, καί πρέσβευε σωθήναι τάς ψυχάς ημών."), ), "T": ( ("", "", "Τού λίθου σφραγισθέντος υπό τών Ιουδαίων, καί στρατιωτών φυλασσόντων τό άχραντόν σου Σώμα, ανέστης τριήμερος Σωτήρ, δωρούμενος τώ κόσμω τήν ζωήν, διά τούτο αι Δυνάμεις των ουρανών εβόων σοι ζωοδότα. Δόξα τή Αναστάσει σου Χριστέ, δόξα τή βασιλεία σου, δόξα τή οικονομία σου, μόνε φιλάνθρωπε."), ("Θεοτοκίον", "", "Τού Γαβριήλ φθεγξαμένου σοι Παρθένε τό Χαίρε, σύν τή φωνή εσαρκούτο ο τών όλων Δεσπότης, εν σοί τή αγία κιβωτώ, ως έφη ο δίκαιος Δαυϊδ, εδείχθης πλατυτέρα τών ουρανών, βαστάσασα τόν Κτίστην σου. Δόξα τώ ενοικήσαντι εν σοί, δόξα τώ προελθόντι εκ σού, δόξα τώ ελευθερώσαντι ημάς διά τού τόκου σου."), ), ) #let N_Ne = ( "1": ( ("", "", "Σοῦ ἡ τροπαιοῦχος."), ("", "", "Μίαν τρισυπόστατον ἀρχήν, τὰ Σεραφεὶμ ἀσιγήτως δοξάζουσιν, ἄναρχον ἀΐδιον, ποιητικὴν ἁπάντων ἀκατάληπτον· ἣν καὶ πᾶσα γλῶσσα, πιστῶς γεραίρει τοῖς ᾄσμασιν."), ("", "", "Ἵνα τοῖς ἀνθρώποις ἑνικήν, τὴν τριλαμπῆ σου δηλώσῃς Θεότητα, πλάσας πρὶν τὸν ἄνθρωπον, κατὰ τὴν σὴν εἰκόνα διεμόρφωσας, νοῦν αὐτῷ καὶ λόγον, καὶ πνεῦμα δούς, ὡς φιλάνθρωπος."), ("", "", "Ἄνωθεν δεικνὺς μοναδικόν, θεαρχικαῖς ἐν τρισὶν ὑποστάσεσι, κράτος, Πάτερ ἔφησας, τῷ ἰσουργῷ Υἱῷ σου, καὶ τῷ Πνεύματι· Δεῦτε καταβάντες, αὐτῶν τὰς γλώσσας συγχέωμεν."), ("Θεοτοκίον", "", "Νοῦς μὲν ὁ ἀγέννητος Πατήρ, εἰκονικῶς τοῖς σοφοῖς προηγόρευται· Λόγος δὲ συνάναρχος, ὁ συμφυὴς Υἱός, καὶ Πνεῦμα ἅγιον, τὸ ἐν τῇ Παρθένῳ, τοῦ Λόγου κτίσαν τὴν σάρκωσιν."), ), "3": ( ("", "", "Ὁ μόνος εἰδώς."), ("", "", "Σὺ πάλαι σαφῶς τῷ Ἀβραάμ, ὡς ὤφθης τρισυπόστατος, μοναδικός τε φύσει Θεότητος, θεολογίας τὸ ἀκραιφνέστατον, τυπικῶς ἐνέφηνας· καὶ πιστῶς ὑμνοῦμέν σε, τόν μονάρχην Θεόν, καὶ τρισήλιον."), ("", "", "Ἐκ σοῦ γεννηθεὶς θεοπρεπῶς, ἀῤῥεύστως Πάτερ ἔλαμψε, φῶς ἐκ φωτός, Υἱὸς ἀπαράλλακτος, καὶ Πνεῦμα θεῖον, φῶς ἐκπεπόρευται· καὶ μιᾶς Θεότητος, αἴγλην τρισυπόστατον, προσκυνοῦμεν πιστῶς καὶ δοξάζομεν."), ("", "", "Μονὰς ἡ Τριὰς ὑπερφυῶς, ἀῤῥήτως ὑπὲρ ἔννοιαν, ταῖς νοεραῖς οὐσίαις δοξάζεται, ταῖς τρισαγίαις φωναῖς, ἀσίγητον, ἐκβοώσαις αἴνεσιν· αἷς συμφώνως ὑμνεῖται, καὶ ἡμῖν τρισυπόστατος Κύριος."), ("Θεοτοκίον", "", "Ἐκ σοῦ χρονικῶς ἄνευ σπορᾶς, προῆλθεν ὁ ὑπέρχρονος, ὁμοιωθεὶς ἡμῖν ὁ ἀνείδεος, καὶ μίαν φύσιν καὶ κυριότητα, τοῦ Πατρὸς ἐδίδαξε, καὶ Υἱοῦ καὶ Πνεύματος, Θεοτόκε· διό σε δοξάζομεν."), ), "S1": ( ("", "Τὸν τάφον σου Σωτὴρ.", "Πατέρα καὶ Υἱόν, προσκυνήσωμεν πάντες, καὶ Πνεῦμα τὸ εὐθές, καὶ ἰσότιμον δόξῃ, Τριάδα τὴν ἄκτιστον, καὶ ὑπέρθεον δύναμιν, ἣν δοξάζουσι, τῶν Ἀσωμάτων αἱ τάξεις· ταύτην σήμερον, καὶ γηγενεῖς μετὰ φόβου, πιστῶς εὐφημήσωμεν."), ("Θεοτοκίον", "", "Ὁδήγησον ἡμᾶς, ἐν ὁδῷ μετανοίας, ἐκκλίνοντας ἀεί, πρὸς κακῶν ἀνοδίας, καὶ τὸν ὑπεράγαθον, παροργίζοντας Κύριον, ἀπειρόγαμε, εὐλογημένη Μαρία, καταφύγιον ἀπεγνωσμένων ἀνθρώπων, Θεοῦ ἐνδιαίτημα."), ), "4": ( ("", "", "Ὄρος σε τῇ χάριτι."), ("", "", "Λάμψον μοι Θεαρχία τρισήλιε λάμψεσι, σῶν θεουργῶν μαρμαρυγῶν, τοῖς τῆς καρδίας ὀφθαλμοῖς, τὸ κάλλος φαντάζεσθαι, τῆς ὑπὲρ νοῦν θεαρχικῆς σου λαμπρότητος, καὶ φωτουργοῦ, καὶ γλυκείας μεθέξεως."), ("", "", "Πρότερον οὐρανοὺς ἐστερέωσας Κύριε, καὶ πᾶσαν δύναμιν αὐτῶν, τῷ Λόγῳ σου τῷ παντουργῷ, καὶ Πνεύματι στόματος τῷ συμφυεῖ, μεθ’ ὧν δεσπόζεις τοῦ σύμπαντος, ἐν τριλαμπεῖ μοναρχίᾳ Θεότητος."), ("", "", "Ὡς ἔπλασας κατ’ εἰκόνα με σὴν καὶ ὁμοίωσιν, θεαρχικὴ παντουργική, Τριὰς ἀσύγχυτε μονάς, συνέτισον φώτισον, πρὸς τὸ ποιεῖν τὸ θέλημά σου τὸ ἅγιον, τὸ ἀγαθόν ἐν ἰσχύϊ καὶ τέλειον."), ("Θεοτοκίον", "", "Τέτοκας τῆς Τριάδος τὸν ἕνα Πανάχραντε, θεαρχικώτατον Υἱόν, σωματωθέντα δι’ ἡμᾶς, ἐκ σοῦ, καὶ αὐγάζοντα τοὺς γηγενεῖς, τῆς τρισηλίου Θεότητος, τῷ ἀνεσπέρῳ φωτὶ καὶ ταῖς λάμψεσιν."), ), "5": ( ("", "", "Ὁ φωτίσας τῇ ἐλλάμψει."), ("", "", "Ἡ τὸν πρῶτον τῶν Ἀγγέλων ἀμέσως διάκοσμον, ἀπροσίτοις τοῦ σοῦ κάλλους ἀκτῖσιν ἐλλάμπουσα, ταῖς σαῖς αἴγλαις φώτισον, Τριὰς ἡ μοναρχικωτάτη, τοὺς ὀρθοδόξως σε μέλποντας."), ("", "", "Νῦν ἡ φύσις, ἑνικὴ Θεαρχία τρισήλιε, ἀνυμνεῖ σε, ἣν οὐσίωσας δι’ ἀγαθότητα, τῶν πταισμάτων λύτρωσιν, καὶ πειρασμῶν ἐξαιτουμένη, καὶ τῶν δεινῶν καὶ τῶν θλίψεων."), ("", "", "Τὸν Πατέρα καὶ Υἱόν, καὶ τὸ Πνεῦμα τὸ ἅγιον, μίαν φύσιν, καὶ Θεότητα, πίστει δοξάζομεν, μεριστὴν ἀμέριστον, ἕνα Θεὸν τῆς ἀοράτου, καὶ ὁρωμένης τε κτίσεως."), ("Θεοτοκίον", "", "Ῥήσεις πᾶσαι Προφητῶν, προδιέγραψαν Ἄχραντε, τὸν σὸν τόκον, τὸν ἀπόρρητον καὶ ἀνερμήνευτον· ὃν ἡμεῖς ἐγνώκαμεν, μυσταγωγὸν τῆς ἑνιαίας, καὶ τρισηλίου Θεότητος."), ), "6": ( ("", "", "Ἐκύκλωσεν ἡμᾶς."), ("", "", "Ῥήσεις πᾶσαι Προφητῶν, προδιέγραψαν Ἄχραντε, τὸν σὸν τόκον, τὸν ἀπόρρητον καὶ ἀνερμήνευτον· ὃν ἡμεῖς ἐγνώκαμεν, μυσταγωγὸν τῆς ἑνιαίας, καὶ τρισηλίου Θεότητος."), ("", "", "Ῥήσεις πᾶσαι Προφητῶν, προδιέγραψαν Ἄχραντε, τὸν σὸν τόκον, τὸν ἀπόρρητον καὶ ἀνερμήνευτον· ὃν ἡμεῖς ἐγνώκαμεν, μυσταγωγὸν τῆς ἑνιαίας, καὶ τρισηλίου Θεότητος."), ("", "", "Σὺ πάντας τοὺς αἰῶνας τῇ βουλήσει σου, ὡς ἀγαθὴ ὑπέστησας, ἐξ οὐκ ὄντων, ἀκατάληπτε Τριάς· εἶτα καὶ τὸν ἄνθρωπον διέπλασας. Ἀλλὰ καὶ νῦν, ἐκ πάσης ῥῦσαί με περιστάσεως."), ("Θεοτοκίον", "", "Ἡλίου τοῦ ἀδύτου οἶκος γέγονας, τοῦ κτίσαντος καὶ τάξαντος, τοὺς φωστῆρας τοὺς μεγάλους πανσθενῶς, ἄρχαντε Παρθένε Θεονύμφευτε. Ἀλλὰ καὶ νῦν, τῆς τῶν παθῶν με ῥῦσαι ζοφώσεως."), ), "S2": ( ("", "Τὸν τάφον σου Σωτήρ. ", "Τριάδα τὴν σεπτήν, καὶ ἀμέριστον φύσιν, προσώποις ἐν τρισί, τεμνομένην ἀτμήτως, καὶ μένουσαν ἀμέριστον, κατ’ οὐσίαν Θεότητος, προσκυνήσωμεν, οἱ γηγενεῖς μετὰ φόβου, καὶ δοξάσωμεν, ὡς Ποιητὴν καὶ Δεσπότην, Θεὸν ὑπεράγαθον."), ("Θεοτοκίον", "", "Κυβέρνησον Ἁγνή, τὴν ἀθλίαν ψυχήν μου, καὶ οἴκτειρον αὐτήν, ὑπὸ πλήθους πταισμάτων, βυθῷ ὀλισθαίνουσαν, ἀπωλείας Πανάμωμε, καὶ ἐν ὥρᾳ με, τῇ φοβερᾷ τοῦ θανάτου, σὺ ἐξάρπασον, κατηγορούντων δαιμόνων, καὶ πάσης κολάσεως."), ), "7": ( ("", "", "Σὲ νοητὴν Θεοτόκε."), ("", "", "Λόγε Θεοῦ, συμφυὲς ἀπαύγασμα, τοῦ παντοκράτορος Θεοῦ, ὡς ὑπέσχου τὴν παρὰ σοῦ θεουργὸν ἐνοίκησιν, ποίησον ὡς εὔσπλαγχνος, σὺν τῷ Πατρί σου καὶ τῷ Πνεύματι, καὶ φοβερόν, τοῖς δαίμοσί με δεῖξον καὶ πάθεσιν."), ("", "", "Λόγε Θεοῦ, συμφυὲς ἀπαύγασμα, τοῦ παντοκράτορος Θεοῦ, ὡς ὑπέσχου τὴν παρὰ σοῦ θεουργὸν ἐνοίκησιν, ποίησον ὡς εὔσπλαγχνος, σὺν τῷ Πατρί σου καὶ τῷ Πνεύματι, καὶ φοβερόν, τοῖς δαίμοσί με δεῖξον καὶ πάθεσιν."), ("", "", "Ἵνα τῆς σῆς, εὐσπλαγχνίας Δέσποτα, δείξῃς τὸ πέλαγος ἡμῖν, τὸν Υιόν σου πρὸς τὴν ἡμῶν, πέμψας ταπεινότητα αὖθις ἀνεμόρφωσας πρὸς τὴν ἀρχαίαν λαμπρότητα. Ἀλλὰ καὶ νῦν, τῷ θείῳ με συνέτισον Πνεύματι."), ("Θεοτοκίον", "", "Ὁ Χερουβείμ, θρόνῳ ἐποχούμενος καὶ τῶν ἁπάντων Βασιλεύς, ἐν γαστρί σου παρθενικῇ, ᾤκησε Πανάχραντε, πάντας ἐκλυτρούμενος, ἐκ τῆς φθορᾶς ὡς φιλάνθρωπος. Ἀλλὰ καὶ νῦν, ταῖς σαῖς πρεσβείαις με περιφρούρησον."), ), "8": ( ("", "", "Θαύματος ὑπερφυοῦς."), ("", "", "Νεύματι θεουργικῷ Κύριε πάντων, τρισυπόστατε καὶ παντοκράτορ, οὐρανοὺς ἐξέτεινας ὡσεὶ δέῤῥιν· εἶτα καὶ γῆς, ἀπῃώρησας τὸ βάθος, πανσθενεῖ σου δρακί. Διὸ καὶ τοὺς δούλους σου κραταίωσον, τῇ ἀγάπῃ καὶ πίστει τῇ σῇ φιλάνθρωπε, ἵνα σε δοξάζωμεν πόθῳ εἰς αἰῶνας."), ("", "", "Νεύματι θεουργικῷ Κύριε πάντων, τρισυπόστατε καὶ παντοκράτορ, οὐρανοὺς ἐξέτεινας ὡσεὶ δέῤῥιν· εἶτα καὶ γῆς, ἀπῃώρησας τὸ βάθος, πανσθενεῖ σου δρακί. Διὸ καὶ τοὺς δούλους σου κραταίωσον, τῇ ἀγάπῃ καὶ πίστει τῇ σῇ φιλάνθρωπε, ἵνα σε δοξάζωμεν πόθῳ εἰς αἰῶνας."), ("", "", "Φώτισον θεαρχικὸν φῶς τοὺς ὑμνοῦντας, τὸ Τρισήλιον φῶς τοῖς προσώποις, ἑνιαῖον αὖθις δὲ τῇ οὐσίᾳ καὶ πρὸς τὰς σάς, φωτοδότιδας ἀκτῖνας ἐπιβλέπειν ἀεί· δι’ ὧν χορτασθήσομαι τὴν δόξαν σου, τὴν γλυκεῖαν καὶ φωτουργὸν καὶ πανόλβιον, καὶ ὑπερυψῶ σε πιστῶς εἰς τοὺς αἰῶνας."), ("Θεοτοκίον", "", "Ὕψωσεν εἰς οὐρανοὺς τὴν τῶν ἀνθρώπων, προσλαβόμενος φύσιν ἀτρέπτως, ὁ Υἱός σου πάναγνε Θεοτόκε, ὑπερβολῇ ἀγαθότητος, ῥυσάμενος τῆς πάλαι φθορᾶς· ᾧ καὶ εὐχαρίστως ἀναμέλπωμεν· Εὐλογείτω ἡ κτίσις πᾶσα τὸν Κύριον, καὶ ὑπερυψούτω εἰς πάντας τοὺς αἰῶνας."), ), "9": ( ("", "", "Τύπον τῆς ἁγνῆς."), ("", "", "Σῶσον ὁ Σωτὴρ τῆς κτίσεως, τῆς αἰσθητῆς καὶ νοουμένης τοὺς δούλους σου, τῆς τῶν δυσμενῶν ἐπιβουλῆς καὶ κακώσεως, παναγία Τριὰς ὁμοούσιε, καὶ φρούρει τὴν σὴν ποίμνην, διαπαντὸς ἀνεπιβούλευτον."), ("", "", "Σῶσον ὁ Σωτὴρ τῆς κτίσεως, τῆς αἰσθητῆς καὶ νοουμένης τοὺς δούλους σου, τῆς τῶν δυσμενῶν ἐπιβουλῆς καὶ κακώσεως, παναγία Τριὰς ὁμοούσιε, καὶ φρούρει τὴν σὴν ποίμνην, διαπαντὸς ἀνεπιβούλευτον."), ("", "", "Ἵνα τὸν βυθὸν τὸν ἄπειρον, τῆς οὐσιώδους δείξῃς σου ἀγαθότητος, δέδωκας ἡμῖν ἐπαγγελίας τρισήλιε, καὶ μονάρχα Θεὲ παντοδύναμε, σωστικὰς τοῖς σοῖς δούλοις, ἃς ἐκπληρῶσαι καταξίωσον."), ("Θεοτοκίον", "", "Νεῦσον ταῖς ἡμῶν δεήσεσιν ὁ ἐν τρισὶ θεαρχικαῖς ὑποστάσεσι, μόνος εἷς Θεὸς ἀληθινός, πιστευόμενος, καὶ παράσχου σοῖς δούλοις παράκλησιν, πρεσβείαις τῆς ἀχράντου, καὶ πανυμνήτου Θεομήτορος."), ), "Y": ( ("","","Ἡ τοῦ λῃστοῦ μετάνοια, τὸν Παράδεισον ἐσύλησεν, ὁ δὲ θρῆνος τῶν Μυροφόρων τὴν χαρὰν ἐμήνυσεν· ὅτι ἀνέστης Χριστὲ ὁ Θεός, παρέχων τῷ κόσμῳ τὸ μέγα ἔλεος."), ) ) #let U_Ne = ( "T": ( ("", "", "Τού λίθου σφραγισθέντος υπό τών Ιουδαίων, καί στρατιωτών φυλασσόντων τό άχραντόν σου Σώμα, ανέστης τριήμερος Σωτήρ, δωρούμενος τώ κόσμω τήν ζωήν, διά τούτο αι Δυνάμεις των ουρανών εβόων σοι ζωοδότα. Δόξα τή Αναστάσει σου Χριστέ, δόξα τή βασιλεία σου, δόξα τή οικονομία σου, μόνε φιλάνθρωπε."), ("Θεοτοκίον", "", "Τού Γαβριήλ φθεγξαμένου σοι Παρθένε τό Χαίρε, σύν τή φωνή εσαρκούτο ο τών όλων Δεσπότης, εν σοί τή αγία κιβωτώ, ως έφη ο δίκαιος Δαυϊδ, εδείχθης πλατυτέρα τών ουρανών, βαστάσασα τόν Κτίστην σου. Δόξα τώ ενοικήσαντι εν σοί, δόξα τώ προελθόντι εκ σού, δόξα τώ ελευθερώσαντι ημάς διά τού τόκου σου."), ), "S1": ( ("", "", "Τὸν τάφον σου Σωτήρ, στρατιῶται τηροῦντες, νεκροὶ τῇ ἀστραπῇ, τοῦ ὀφθέντος Ἀγγέλου, ἐγένοντο κηρύττοντος, Γυναιξὶ τὴν Ἀνάστασιν, σὲ δοξάζομεν, τὸν τῆς φθορᾶς καθαιρέτην, σοὶ προσπίπτομεν, τῷ ἀναστάντι ἐκ τάφου, καὶ μόνῳ Θεῷ ἡμῶν."), ("", "", "Σταυρῷ προσηλωθείς, ἑκουσίως Οἰκτίρμον, ἐν μνήματι τεθείς, ὡς θνητὸς Ζωοδότα, τὸ κράτος συνέτριψας, Δυνατὲ τῷ θανάτῳ σου. Σὲ γὰρ ἔφριξαν, οἱ πυλωροὶ οἱ τοῦ ᾅδου· σὺ συνήγειρας, τοὺς ἀπ’ αἰῶνος θανόντας, ὡς μόνος φιλάνθρωπος."), ("Θεοτοκίον", "Τὸν τάφον σου Σωτήρ.", "Μητέρα σε Θεοῦ, ἐπιστάμεθα πάντες, Παρθένον ἀληθῶς, καὶ μετὰ τόκον φανεῖσαν, οἱ πόθῳ καταφεύγοντες, πρὸς τὴν σὴν ἀγαθότητα· σὲ γὰρ ἔχομεν, ἁμαρτωλοὶ προστασίαν· σὲ κεκτήμεθα, ἐν πειρασμοῖς σωτηρίαν τὴν μόνην πανάμωμον."), ), "S2": ( ("", "Τοῦ λίθου σφραγισθέντος", "Γυναῖκες πρὸς τὸ μνῆμα παρεγένοντο ὄρθριαι, καὶ ἀγγελικὴν ὀπτασίαν θεασάμεναι ἔτρεμον· ὁ τάφος ἐξήστραπτε ζωήν, τὸ θαῦμα κατέπληττεν αὐτάς· διὰ τοῦτο ἀπελθοῦσαι, τοῖς μαθηταῖς ἐκήρυττον τὴν ἔγερσιν. Τὸν ᾅδην ἐσκύλευσε Χριστός, ὡς μόνος κραταιὸς καὶ δυνατός, καὶ φθαρέντας συνήγειρε πάντας, τὸν τῆς κατακρίσεως φόβον, λύσας δυνάμει Σταυροῦ."), ("", "", "Ἐν τῷ Σταυρῷ προσηλωθεὶς ἡ ζωὴ τῶν ἁπάντων, καὶ ἐν νεκροῖς λογισθεὶς ὁ ἀθάνατος Κύριος, ἀνέστης τριήμερος Σωτήρ, καὶ ἢγειρας Ἀδὰμ ἐκ τῆς φθορᾶς· διὰ τοῦτο αἱ Δυνάμεις τῶν οὐρανῶν ἐβόων σοι Ζωοδότα· Δόξα τοῖς σοῖς παθήμασι Χριστέ· δόξα τῇ ἀναστάσει σου· δόξα τῇ συγκαταβάσει σου, μόνε Φιλάνθρωπε."), ("Θεοτοκίον", "", "Μαρία τὸ σεπτόν, τοῦ Δεσπότου δοχεῖον, ἀνάστησον ἡμᾶς, πεπτωκότας εἰς χάος, δεινῆς ἀπογνώσεως, καὶ πταισμάτων καὶ θλίψεων. Σὺ γὰρ πέφυκας, ἁμαρτωλῶν σωτηρία, καὶ βοήθεια, καὶ κραταιὰ προστασία, καὶ σῴζεις τοὺς δούλους σου."), ), "Y": ( ("", "", "Ἡ τοῦ Λῃστοῦ μετάνοια, τὸν παράδεισον ἐσύλησεν, ὁ δὲ θρῆνος τῶν Μυροφόρων τὴν χαρὰν ἐμήνυσεν, ὅτι ἀνέστης Χριστὲ ὁ Θεός, παρέχων τῷ κόσμῳ τὸ μέγα ἔλεος."), ), "A1": ( ("", "", "Ἐν τῷ θλίβεσθαί με, εἰσάκουσόν μου τῶν ὀδυνῶν, Κύριε σοὶ κράζω."), ("", "", "τοῖς ἐρημικοῖς, ἄπαυστος ὁ θεῖος πόθος ἐγγίνεται, κόσμου οὖσι τοῦ ματαίου ἐκτός."), ("", "", "Ἁγίῳ Πνεύματι, τιμὴ καὶ δόξα, ὥσπερ Πατρί, πρέπει ἅμα καὶ Υἱῷ· διὰ τοῦτο ᾄσωμεν τῇ Τριάδι Μονοκρατορίᾳ."), ), "A2": ( ("", "", "Εἰς τὰ ὄρη τῶν σῶν, ὕψωσάς με νόμων, ἀρεταῖς ἐκλάμπρυνον, ὁ Θεός, ἵνα ὑμνῶ σε."), ("", "", "Δεξιᾷ σου χειρὶ λαβὼν σὺ Λόγε, φύλαξόν με, φρούρησον, μὴ πῦρ με φλέξῃ τῆς ἁμαρτίας."), ("", "", "Ἁγίῳ Πνεύματι, πᾶσα ἡ κτίσις καινουργεῖται, παλινδρομοῦσα εἰς τὸ πρῶτον· Ἰσοσθενὲς γάρ ἐστι Πατρὶ καὶ Λόγῳ."), ), "A3": ( ("", "", "Ἐπὶ τοῖς εἰρηκόσι μοι ὁδεύσωμεν εἷς τὰς αὐλὰς τοῦ Κυρίου, εὐφράνθη μου τὸ Πνεῦμα, συγχαίρει ἡ καρδία."), ("", "", "Ἐπὶ οἶκον Δαυΐδ, φόβος μέγας· ἐκεῖ γὰρ θρόνων ἐκτεθέντων, κριθήσονται ἅπασαι, αἱ φυλαὶ τῆς γῆς καὶ γλῶσσαι."), ("", "", "Ἁγίῳ Πνεύματι, τιμὴν προσκύνησιν, δόξαν καὶ κράτος, ὡς Πατρί τε ἄξιον, καὶ τῷ Υἱῷ δεῖ προσφέρειν· Μονὰς γάρ ἐστιν ἡ Τριὰς τῇ φύσει, ἀλλ' οὐ προσώποις."), ), "P": ( ("", "", "Νῦν ἀναστήσομαι λέγει Κύριος, θήσομαι ἐν σωτηρίῳ παρρησιάσομαι ἐν αὐτῷ."), ("", "", "Τὰ λόγια Κυρίου λόγια ἁγνά."), ), "K": ( "P1": ( "1": ( ("", "", "Σοῦ ἡ τροπαιοῦχος δεξιά, θεοπρεπῶς ἐν ἰσχύϊ δεδόξασται. Αὕτη γὰρ ἀθάνατε, ὡς πανσθενὴς ὑπεναντίους ἔθραυσε, τοῖς Ἰσραηλίταις, ὀδὸν βυθοῦ καινουργὴσασα."), ("", "", "Ὁ χερσὶν ἀχράντοις ἐκ χοός, θεουργικῶς κατ’ ἀρχὰς διαπλάσας με, χεῖρας διεπέτασας ἐν τῷ Σταυρῷ, ἐκ γῆς ἀνακαλούμενος, τὸ φθαρέν μου σῶμα, ὃ ἐκ Παρθένου προσείληφας."), ("", "", "Νέκρωσιν ὑπέστη δι’ ἐμέ, καὶ τὴν ψυχὴν τῷ θανάτῳ προδίδωσιν, ὁ ἐμπνεύσει θείᾳ ψυχήν μοι ἐνθείς· καὶ λύσας αἰωνίων δεσμῶν, καὶ συναναστήσας, τῇ ἀφθαρσίᾳ ἐδόξασε."), ("Θεοτοκίον", "", "Χαῖρε ἡ τῆς χάριτος Πηγή· χαῖρε ἡ κλῖμαξ καὶ πύλη οὐράνιος· χαῖρε ἡ λυχνία καὶ στάμνος χρυσῆ, καὶ ὄρος ἀλατόμητον, ἡ τὸν Ζωοδότην, Χριστὸν τῷ κόσμῳ κυήσασα."), ), "2": ( ("", "", "Χριστὸς γεννᾶται."), ("", "", "Χριστὸς θεοῖ με σαρκούμενος, Χριστός με ἀνυψοῖ ταπεινούμενος, Χριστὸς ἀπαθῆ ἐργάζεται, πάσχων ὁ Ζωοδότης φύσει σαρκός· ὅθεν ἀναμέλπω, χαριστήριον ᾠδήν· ὅτι δεδόξασται."), ("", "", "Χριστὸς ὑψοῖ με σταυρούμενος, Χριστὸς συνανιστᾷ με νεκρούμενος, Χριστός μοι ζωὴν χαρίζεται· ὅθεν ἐν εὐφροσύνῃ χεῖρας κροτῶν, ᾄδω τῷ Σωτῆρι, ἐπινίκιον ᾠδήν· ὅτι δεδόξασται."), ("Θεοτοκίον", "", "Θεὸν Παρθένε συνέλαβες, Χριστὸν ἐν παρθενίᾳ δὲ τέτοκας, ἐκ σοῦ σαρκωθέντα Πάναγνε, ἕνα τῇ ὑποστάσει μονογενῆ, ἐν δυσὶν οὐσίαις, γνωριζόμενον Υἱόν· ὅτι δεδόξασται."), ), "3": ( ("", "", "Σοῦ ἡ τροπαιοῦχος δεξιά, θεοπρεπῶς ἐν ἰσχύϊ δεδόξασται. Αὕτη γὰρ ἀθάνατε, ὡς πανσθενὴς ὑπεναντίους ἔθραυσε, τοῖς Ἰσραηλίταις, ὀδὸν βυθοῦ καινουργὴσασα."), ("", "", "Ποίαν σοι ἐπάξιον ᾠδὴν, ἡ ἡμετέρα προσοίσει ἀσθένεια; εἰ μὴ τὴν χαρμόσυνον, ἣν Γαβριὴλ ἡμᾶς ἐμυσταγώγησε! Χαῖρε Θεοτόκε, Παρθένε Μῆτερ ἀνύμφευτε."), ("", "", "Τῇ Ἀειπαρθένῳ καὶ Μητρί, τοῦ Βασιλέως τῶν ἄνω Δυνάμεων, ἐκ καθαρωτάτης καρδίας πιστοί, πνευματικῶς βοήσωμεν· Χαῖρε Θεοτόκε, Παρθένε Μῆτερ ἀνύμφευτε."), ("", "", "Ἄπειρος ἡ ἄβυσσος τῆς σῆς, ἀκαταλήπτου κυήσεως Πάναγνε, πίστει ἀδιστάκτῳ οὖν, εἰλικρινῶς προσφέρομέν σοι λέγοντες· Χαῖρε Θεοτόκε Παρθένε Μῆτερ ἀνύμφευτε."), ) ), "P3": ( "1": ( ("", "", "Ὁ μόνος εἰδὼς τῆς τῶν βροτῶν, οὐσίας τὴν ἀσθένειαν, καὶ συμπαθῶς αὐτὴν μορφωσάμενος, περίζωσόν με ἐξ ὕψους δύναμιν, τοῦ βοᾷν σοι, Ἅγιος, ὁ ναὸς ὁ ἔμψυχος, τῆς ἀφράστου σου δόξης Φιλάνθρωπε."), ("", "", "Θεός μου ὑπάρχων Ἀγαθέ, πεσόντα κατῳκτείρησας, καὶ καταβῆναι πρός με ηὐδόκησας, ἀνύψωσάς με διὰ σταυρώσεως, τοῦ βοᾶν σοι· Ἅγιος, ὁ τῆς δόξης Κύριος, ὁ ἀνείκαστος ἐν ἀγαθότητι."), ("", "", "Ζωὴ ἐνυπόστατος Χριστέ, ὑπάρχων καὶ φθαρέντα με, ὡς συμπαθὴς Θεὸς ἐνδυσάμενος, εἰς χοῦν θανάτου καταβὰς Δέσποτα, τὸ θνητὸν διέρρηξας, καὶ νεκροὺς τριήμερος, ἀναστὰς ἀφθαρσίαν ἠμφίεσας."), ("Θεοτοκίον", "", "Θεὸν συλλαβοῦσα ἐν γαστρί, Παρθένε διὰ Πνεύματος, τοῦ παναγίου ἔμεινας ἄφλεκτος· ἐπεί σε βάτος τῷ νομοθέτῃ Μωσῇ, φλεγομένη ἄκαυστα, σαφῶς προεμήνυσε, τήν τὸ πῦρ δεξαμένην τὸ ἄστεκτον."), ), "2": ( ("", "", "Τῷ πρὸ τῶν αἰώνων."), ("", "", "Τῷ ἐπὶ τῶν ὤμων, τὸ πλανώμενον πρόβατον ἄραντι, καὶ καθελόντι διὰ ξύλου, τὴν αὐτοῦ ἁμαρτίαν, Χριστῷ τῷ Θεῷ βοήσωμεν· Ὁ ἀνυψώσας τὸ κέρας ἡμῶν, Ἅγιος εἶ Κύριε."), ("", "", "Τῷ ἀναγαγόντι, τὸν Ποιμένα τὸν μέγαν ἐξ ᾅδου Χριστόν, καὶ τῇ αὐτοῦ ἱεραρχίᾳ, διὰ τῶν Ἀποστόλων, σοφῶς τὰ ἔθνη ποιμάναντι, ἐν ἀληθείᾳ, τῷ θείῳ πιστοί, Πνεύματι λατρεύσωμεν."), ("Θεοτοκίον", "", "Τῷ ἐκ τῆς Παρθένου, σαρκωθέντι ἀσπόρως βουλήσει Υἱῷ, καὶ τὴν τεκοῦσαν μετὰ τόκον, θεϊκῇ δυναστείᾳ, ἁγνὴν παρθένον φυλάξαντι, τῷ ἐπὶ πάντων βοῶμεν Θεῷ· Ἅγιος εἶ Κύριε."), ), "3": ( ("", "", "Ὁ μόνος εἰδὼς τῆς τῶν βροτῶν, οὐσίας τὴν ἀσθένειαν, καὶ συμπαθῶς αὐτὴν μορφωσάμενος, περίζωσόν με ἐξ ὕψους δύναμιν, τοῦ βοᾷν σοι, Ἅγιος, ὁ ναὸς ὁ ἔμψυχος, τῆς ἀφράστου σου δόξης Φιλάνθρωπε."), ("", "", "Νεφέλην σε κούφην ἀψευδῶς, Παρθένε, ὀνομάζομεν, προφητικαῖς ἑπόμενοι ῥήσεσιν· ἐλήλυθε γὰρ ἐπὶ σοὶ Κύριος, καθελεῖν αἰγύπτια, πλάνης χειροποίητα, καὶ φωτίσαι τοὺς ταῦτα λατρεύοντας."), ("", "", "Σὲ ἐσφραγισμένην ἀληθῶς, χορὸς Προφητικός, πηγήν, καὶ κεκλεισμένην πύλην ὠνόμασε, τῆς παρθενίας τῆς σῆς Πανύμνητε, τηλαυγῶς τὰ σύμβολα, ἡμῖν διαγράφοντα, ἣν ἐφύλαξας καὶ μετὰ γέννησιν."), ("", "", "Νοῦν τὸν ὑπερούσιον ἰδεῖν, ὡς θέμις ἀξιούμενος, ὁ Γαβριὴλ Παρθένε πανάμωμε, περιχαρῆ σοι φωνὴν ἐκόμισε, τὴν τοῦ Λόγου σύλληψιν, ἐμφανῶς μηνύουσαν, καὶ τόν ἄφραστον τόκον κηρύττουσαν."), ) ), "P4": ( "1": ( ("", "", "Ὄρος σε τῇ χάριτι, τῇ θείᾳ κατάσκιον, προβλεπτικοῖς ὁ Ἀββακούμ, κατανοήσας ὀφθαλμοῖς, ἐκ σοῦ ἐξελεύσεσθαι, τοῦ Ἰσραὴλ προανεφώνει τὸν Ἅγιον, εἰς σωτηρίαν ἡμῶν καὶ ἀνάπλασιν."), ("", "", "Τίς οὗτος, Σωτήρ, ὁ ἐξ Ἐδὼμ ἀφικόμενος, στεφηφορῶν ἐξ ἀκανθῶν, πεφοινιγμένος τὴν στολήν, ἐν ξύλῳ κρεμάμενος; Τοῦ Ἰσραὴλ ὑπάρχει οὗτος ὁ Ἅγιος, εἰς σωτηρίαν ἡμῶν καὶ ἀνάπλασιν."), ("", "", "Ἴδετε λαὸς τῶν ἀπειθῶν, καὶ αἰσχύνθητε· ὃν ὡς κακοῦργον γὰρ ὑμεῖς, ἀναρτηθῆναι ἐν Σταυρῷ, Πιλάτῳ ᾐτήσασθε φρενοβλαβῶς, θανάτου λύσας τὴν δύναμιν, θεοπρεπῶς ἐξανέστη τοῦ μνήματος."), ("Θεοτοκίον", "", "Ξύλον σε Παρθένε τῆς ζωῆς ἐπιστάμεθα· οὐ γὰρ τῆς βρώσεως καρπός, θανατηφόρος τοῖς βροτοῖς, ἐκ σοῦ ἀνεβλάστησεν, ἀλλὰ ζωῆς τῆς ἀϊδίου ἀπόλαυσις, εἰς σωτηρίαν ἡμῶν τῶν ὑμνούντων σε."), ), "2": ( ("", "", "Ῥάβδος ἐκ τῆς ῥίζης."), ("", "", "Τίς οὗτος ὡραῖος ἐξ Ἐδώμ, καὶ τούτου τὸ ἐρύθημα, τῶν ἱματίων ἐξ ἀμπέλου Βοσόρ; ὡραῖος ὅτι Θεός, ὡς βροτὸς δὲ αἵματι, σαρκός, τὴν στολὴν πεφοινιγμένος, ᾧ μελῳδοῦμεν πιστοί· Δόξα τῇ δυνάμει σου Κύριε."), ("", "", "Χριστὸς τῶν μελλόντων ἀγαθῶν, φανεὶς ἀρχιερεὺς ἡμῶν, τὴν ἁμαρτίαν διεσκέδασε, καὶ δείξας ξένην ὁδόν, τῷ ἰδίω αἵματι, εἰς κρείττονα καὶ τελειοτέραν, εἰσέδραμε δὲ σκηνήν, πρόδρομος ἡμῶν εἰς τὰ Ἅγια."), ("Θεοτοκίον", "", "Τῆς Εὔας τὴν πάλαι ὀφειλήν, ἀπέτισας Πανύμνητε, τῷ δι’ ἡμᾶς φανέντι νέῳ Ἀδάμ· ἑνώσας γὰρ ἑαυτῷ, ἐξ ἁγνῆς συλλήψεως, σάρκα νοερὰν ἐμψυχωμένην, ἐκ σοῦ προῆλθε Χριστός, εἰς τὸ συναμφότερον Κύριος."), ), "3": ( ("", "", "Ὄρος σε τῇ χάριτι, τῇ θείᾳ κατάσκιον, προβλεπτικοῖς ὁ Ἀββακούμ, κατανοήσας ὀφθαλμοῖς, ἐκ σοῦ ἐξελεύσεσθαι, τοῦ Ἰσραὴλ προανεφώνει τὸν Ἅγιον, εἰς σωτηρίαν ἡμῶν καὶ ἀνάπλασιν."), ("", "", "Ἄκουε θαυμάτων οὐρανέ, ἐνωτίζου δὲ ἡ γῆ, ὅτι θυγάτηρ χοϊκοῦ, τοῦ πεπτωκότος μὲν Ἀδάμ, Θεοῦ ἐχρημάτισε, τοῦ ἑαυτῆς Δημιουργοῦ τε λοχεύτρια, εἰς σωτηρίαν ἡμῶν καὶ ἀνάπλασιν."), ("", "", "Ὑμνοῦμεν τὸ μέγα καὶ φρικτόν σου μυστήριον· ὑπερκοσμίους γὰρ λαθών, Ταξιαρχίας ἐπὶ σέ, ὁ Ὢν καταβέβηκεν, ὡς ὑετός, ὁ ἐπὶ πόκον, Πανύμνητε, εἰς σωτηρίαν ἡμῶν καὶ ἀνάπλασιν."), ("", "", "Ἁγίων ἁγία Θεοτόκε Πανύμνητε, ἡ προσδοκία τῶν ἐθνῶν, καὶ σωτηρία τῶν πιστῶν, ἐκ σοῦ ἀνατέταλκεν, ὁ λυτρωτὴς καὶ ζωοδότης καὶ Κύριος, ὃν ἐκδυσώπει σωθῆναι τοὺς δούλους σου."), ) ), "P5": ( "1": ( ("", "", "Ὁ φωτίσας τῇ ἐλλάμψει, τῆς σῆς παρουσίας Χριστέ, καὶ φαιδρύνας τῷ Σταυρῷ σου, τοῦ κόσμου τὰ πέρατα, τάς καρδίας φώτισον, φωτὶ τῆς σῆς θεογνωσίας, τῶν ὀρθοδόξως ὑμνούντων σε."), ("", "", "Τὸν ποιμένα τῶν προβάτων, τὸν μέγαν καὶ Κύριον, Ἰουδαῖοι διὰ ξύλου σταυροῦ ἐθανάτωσαν· ἀλλ’ αὐτὸς ὡς πρόβατα νεκρούς, ἐν ᾅδῃ τεθαμμένους, κράτους θανάτου ἐρρύσατο."), ("", "", "Τῷ Σταυρῷ σου τὴν εἰρήνην, εὐαγγελισάμενος, καὶ κηρύξας αἰχμαλώτοις Σωτήρ μου τὴν ἄφεσιν, τὸν κρατοῦντα ᾔσχυνας, Χριστέ, γυμνὸν ἠπορημένον, δείξας τῇ θείᾳ ἐγέρσει σου."), ("Θεοτοκίον", "", "Τὰς αἰτήσεις τῶν πιστῶς αἰτουμένων, Πανύμνητε, μὴ παρίδῃς, ἀλλὰ δέχου, καὶ ταύτας προσάγαγε, τῷ Υἱῷ σου Ἄχραντε Θεῷ, τῷ μόνῳ εὐεργέτῃ· σὲ γὰρ προστάτιν κεκτήμεθα."), ), "2": ( ("", "", "Θεὸς ὢν εἰρήνης"), ("", "", "Ὢ πλοῦτος καὶ βάθος, σοφίας Θεοῦ! τοὺς σοφοὺς ὁ δρασσόμενος Κύριος, τῆς τούτων πανουργίας ἐλυτρώσατο ἡμᾶς· παθὼν γὰρ ἑκουσίως, σαρκὸς ἐξ ἀσθενείας, ἐξ ἰδίας ἰσχύος, ζωοποιὸς νεκρὸς ἐγήγερται."), ("", "", "Θεὸς ὢν ἑνοῦται, σαρκὶ δι’ ἡμᾶς, καὶ σταυροῦται καὶ θνῄσκει καὶ θάπτεται, καὶ αὖθις ἐξανίσταται, καὶ ἄνεισι φαιδρῶς, σαρκὶ σὺν τῇ ἰδίᾳ, Χριστὸς πρὸς τόν Πατέρα, μεθ’ ἧς ἤξει καὶ σώσει, τοὺς εὐσεβῶς αὐτῷ λατρεύοντας."), ("Θεοτοκίον", "", "Ἁγίων ἁγία, Παρθένε ἁγνή, τῶν Ἁγίων τὸν Ἅγιον τέτοκας, τὸν πάντας ἁγιάζοντα, Χριστὸν τὸν Λυτρωτήν· διό σε βασιλίδα, καὶ Δέσποιναν ἁπάντων, ὡς Μητέρα τοῦ Κτίστου, τῶν ποιημάτων καταγγέλλομεν."), ), "3": ( ("", "", "Ὁ φωτίσας τῇ ἐλλάμψει"), ("", "", "Εὐφραίνονται, οὐρανῶν αἱ Δυνάμεις, ὁρῶσαί σε, ἀγάλλονται σὺν αὐταῖς, τῶν βροτῶν τὰ συστήματα· τῷ γὰρ τόκῳ ἥνωνται τῷ σῷ, Παρθένε Θεοτόκε· ὃν ἐπαξίως δοξάζομεν."), ("", "", "Κινείσθωσαν, πᾶσαι γλῶσσαι βροτεῖαι καὶ ἔννοιαι, πρὸς ἔπαινον τοῦ βροτῶν, ἀληθῶς καλλωπίσματος· ἡ Παρθένος πάρεστι σαφῶς, δοξάζουσα τοὺς πίστει, ταύτης ὑμνοῦντας τὰ θαύματα."), ("", "", "Δοξάζεται, ὕμνος ἅπας σοφῶν καὶ ἐγκώμιον, τῇ Παρθένῳ καὶ Μητρί, τοῦ Θεοῦ προσφερόμενος· τῆς γὰρ δόξης γέγονεν, αὕτη ναὸς τῆς ὑπερθέου· ἣν ἐπαξίως δοξάζομεν."), ) ), "P6": ( "1": ( ("", "", "Ἐκύκλωσεν ἡμᾶς ἐσχάτη ἄβυσσος, οὔκ ἐστιν ὁ ῥυόμενος, ἐλογίσθημεν ὡς πρόβατα σφαγῆς, σῶσον τὸν λαόν σου ὁ Θεὸς ἡμῶν· σὺ γὰρ ἰσχύς, τῶν ἀσθενούντων καὶ ἐπανόρθωσις"), ("", "", "Τῷ πταίσματι τοῦ πρωτοπλάστου Κύριε, δεινῶς ἐτραυματίσθημεν· τῷ δὲ μώλωπι ἰάθημεν τῷ σῷ, ᾧ ὑπὲρ ἡμῶν ἐτραυματίσθης Χριστέ· σὺ γὰρ ἰσχὺς τῶν ἀσθενούντων, καὶ ἐπανόρθωσις."), ("", "", "Ἀνήγαγες ἡμᾶς ἐξ ᾅδου Κύριε, τὸ κῆτος χειρωσάμενος, τὸ παμφάγον Παντοδύναμε, τῷ σῷ κράτει καθελὼν αὐτοῦ τὴν δύναμιν· σὺ γὰρ ζωὴ καὶ φῶς ὑπάρχεις, καὶ ἡ ἀνάστασις."), ("Θεοτοκίον", "", "Εὐφραίνονται ἐν σοί, Παρθένε ἄχραντε, τοῦ γένους οἱ προπάτορες, τὴν Ἐδὲμ ἀπολαβόντες διὰ σοῦ, ἣν ἐκ παραβάσεως ἀπώλεσαν· σὺ γὰρ ἁγνή, καὶ πρὸ τοῦ τόκου, καὶ μετὰ γέννησιν."), ), "2": ( ("", "", "Σπλάγχνων Ἰωνᾶν"), ("", "", "Νοῦς ὢν ἀπαθής, καὶ ἄϋλος μίγνυται, Χριστὸς ὁ Θεός, τῷ ἀνθρωπίνῳ νοϊ, μεσιτεύοντι, θείᾳ φύσει σαρκός τε παχύτητι, καὶ ὅλῳ μοι, ἀτρέπτως ὅλος ἥνωται, ἵνα σωτηρίαν ὅλῳ μοι, τῷ πεσόντι ὀρέξῃ σταυρούμενος."), ("", "", "Πίπτει πτερνισθείς, Ἀδὰμ καὶ συντρίβεται, ἐλπίδι ψευσθεὶς πάλαι θεώσεως, ἀλλ’ ἀνίσταται, τῇ ἑνώσει τοῦ Λόγου θεούμενος, καὶ πάθει τὴν ἀπάθειαν κομίζεται, θρόνῳ ὡς Υἱὸς δοξάζεται, συνεδρεύων Πατρί τε, καὶ Πνεύματι."), ("Θεοτοκίον", "", "Κόλπων οὐκ ἐκστάς, ἀνάρχου Γεννήτορος, ἐν κόλποις ἁγνῆς Κόρης αὐλίζεται, καὶ καθίσταται, ὁ ἀμήτωρ ἀπάτωρ σαρκούμενος, ὁ τῆς δικαιοσύνης βασιλεύων Θεός· τούτου ἀγενεαλόγητος, ἡ φρικτὴ γενεὰ καὶ ἀπόρρητος."), ), "3": ( ("", "", "Ἐκύκλωσεν ἡμᾶς"), ("", "", "Παρίστανται δουλοπρεπῶς τῷ τόκῳ σου, αἱ τάξεις αἱ οὐράνιαι, ἐκπληττόμεναι ἀξίως τὸ τῆς σῆς ἀσπόρου λοχείας Ἀειπάρθενε· σὺ γὰρ ἁγνὴ καὶ πρὸ τοῦ τόκου, καὶ μετὰ γέννησιν."), ("", "", "Σεσάρκωται ὁ πρὶν ὑπάρχων ἄσαρκος, ὁ Λόγος ἐκ σοῦ Πάναγνε, ὁ τὰ σύμπαντα βουλήματι ποιῶν, ὁ τῶν Ἀσωμάτων τὰ στρατεύματα, παραγαγὼν ἐκ τοῦ μὴ ὄντος, ὡς παντοδύναμος."), ("", "", "Νενέκρωται ἐχθρὸς τῷ ζωηφόρῳ σου, καρπῷ θεοχαρίτωτε, καὶ πεπάτηται ὁ ᾅδης προφανῶς, καὶ οἱ ἐν δεσμοῖς ἠλευθερώθημεν· διὸ βοῶ· Τὰ πάθη λῦσον, τὰ τῆς καρδίας μου."), ) ), "K": ( ("", "Ὅταν ἔλθῃς ὁ Θεὸς", "Ἐξανέστης ὡς Θεός, ἐκ τοῦ τάφου ἐν δόξῃ, καὶ κόσμον συνανέστησας, καὶ ἡ φύσις τῶν βροτῶν ὡς Θεόν σε ἀνύμνησε, καὶ θάνατος ἠφάνισται, καὶ ὁ Ἀδὰμ χορεύει, Δέσποτα, καὶ ἡ Εὔα νῦν ἐκ τῶν δεσμῶν λυτρουμένη, χαίρει κράζουσα· Σὺ εἶ ὁ πᾶσι παρέχων, Χριστὲ τὴν ἀνάστασιν."), ("", "", "Τὸν ἀναστάντα τριήμερον ἀνυμνήσωμεν, ὡς Θεὸν παντοδύναμον, καὶ πύλας τοῦ ᾅδου συντρίψαντα, καὶ τοὺς ἀπ’ αἰῶνος ἐκ τάφου ἐγείραντα, Μυροφόροις ὀφθέντα καθὼς ηὐδόκησε, πρώταις ταύταις τό, Χαίρετε, φήσας· καὶ Ἀποστόλοις χαρὰν μηνύων, ὡς μόνος ζωοδότης. Ὅθεν πίστει αἱ γυναῖκες, Μαθηταῖς σύμβολα νίκης εὐαγγελίζονται, καὶ ᾅδης στενάζει, καὶ θάνατος ὀδύρεται, καὶ κόσμος ἀγάλλεται, καὶ πάντες συγχαίρουσι· Σὺ γὰρ παρέσχες πᾶσι, Χριστὲ τὴν ἀνάστασιν."), ), "P7": ( "1": ( ("", "", "Σὲ νοητήν, Θεοτόκε κάμινον, κατανοοῦμεν οἱ πιστοὶ ὡς γὰρ Παῖδας ἔσωσε τρεῖς, ὁ ὑπερυψούμενος, ὅλον με τὸν ἄνθρωπον, ἐν τῇ γαστρί σου ἀνέπλασεν, ὁ αἰνετὸς τῶν Πατέρων, Θεὸς καὶ ὑπερένδοξος."), ("", "", "Ἔφριξε γῆ, ἀπεστράφη ἥλιος, καὶ συνεσκότασε τὸ φῶς, διερράγη τὸ τοῦ Ναοῦ θεῖον καταπέτασμα, πέτραι δὲ ἐσχίσθησαν· διὰ Σταυροῦ γὰρ ᾖρται ὁ δίκαιος, ὁ αἰνετός τῶν πατέρων, Θεὸς καὶ ὑπερένδοξος."), ("", "", "Σὺ γεγονώς, ὡσεὶ ἀβοήθητος, καὶ τραυματίας ἐν νεκροῖς, ἑκουσίως τὸ καθ’ ἡμᾶς, ὁ ὑπερυψούμενος, πάντας ἠλευθέρωσας, καὶ κραταιᾷ χειρὶ συνανέστησας, ὁ αἰνετός τῶν πατέρων, Θεὸς καὶ ὑπερένδοξος."), ("Θεοτοκίον", "", "Χαῖρε πηγή, ἀειζώου νάματος· Χαῖρε Παράδεισε τρυφῆς· Χαῖρε τεῖχος τὸ τῶν πιστῶν· Χαῖρε Ἀπειρόγαμε· Χαῖρε ἡ παγκόσμιος χαρά, δι’ ἧς ἡμῖν ἐξανέτειλεν, ὁ αἰνετός τῶν πατέρων, Θεὸς καὶ ὑπερένδοξος."), ), "2": ( ("", "", "Οἱ Παῖδες εὐσεβείᾳ"), ("", "", "Πάλαι μὲν κατηράθη, τῷ τοῦ Ἄβελ, φοινιχθεῖσα αἵματι, ἀδελφοκτόνῳ γῆ χειρί, θεορρύτῳ δέ σου αἵματι, εὐλογεῖται ῥαντισθεῖσα, καὶ σκιρτῶσα βοᾷ· Ὁ τῶν πατέρων Θεὸς εὐλογητὸς εἶ."), ("", "", "Θρηνείτω Ἰουδαίων, ὁ ἀντίθεος λαός, τὸ τόλμημα τῆς ἀναιρέσεως Χριστοῦ· τὰ δὲ ἔθνη εὐφραινέσθωσαν, καὶ κροτείτωσαν τὰς χεῖρας, καὶ βοάτωσαν· Ὁ τῶν πατέρων Θεὸς εὐλογητὸς εἶ."), ("Θεοτοκίον", "", "Ἰδοὺ ταῖς Μυροφόροις, ἐξαστράπτων, ἀνεβόα Ἄγγελος· Τῆς ἀναστάσεως Χριστοῦ, δεῦτε ἴδετε τὰ σύμβολα, τὰς σινδόνας, καὶ τὸν τάφον, καὶ βοήσατε· Ὁ τῶν πατέρων Θεὸς εὐλογητὸς εἶ."), ), "3": ( ("", "", "Σὲ νοητήν, Θεοτόκε κάμινον, κατανοοῦμεν οἱ πιστοὶ ὡς γὰρ Παῖδας ἔσωσε τρεῖς, ὁ ὑπερυψούμενος, ὅλον με τὸν ἄνθρωπον, ἐν τῇ γαστρί σου ἀνέπλασεν, ὁ αἰνετὸς τῶν Πατέρων, Θεὸς καὶ ὑπερένδοξος."), ("", "", "Σὲ Ἰακώβ, Θεοτόκε κλίμακα, προφητικῶς κατανοεῖ· διὰ σοῦ γὰρ ἐπὶ τῆς γῆς, ὁ ὑπερυψούμενος, ὤφθη τοῖς ἀνθρώποις τε, συνανεστράφη ὡς ηὐδόκησεν, ὁ αἰνετὸς τῶν πατέρων, Θεὸς καὶ ὑπερένδοξος."), ("", "", "Χαῖρε Σεμνή, τοῦ Ἀδὰμ τὸ κώδιον, ἐκ σοῦ προῆλθεν ὁ Ποιμήν, ἐνδυσάμενος ἀληθῶς, ὁ ὑπερυψούμενος ὅλον με τὸν ἄνθρωπον, δι’ εὐσπλαγχνίαν ἀκατάληπτον, ὁ αἰνετὸς τῶν πατέρων, Θεὸς καὶ ὑπερένδοξος."), ("", "", "Nóvyj Adám ot čístych krovéj tvojích prevíčnyj Bóh býsť voístinnu, jehóže nýňi molí, obvetšávšaho mjá obnovíti zovúšča: chváľnyj otcév Bóh i preproslávlen."), ) ), "P8": ( "1": ( ("", "", "Ἐν καμίνῳ Παῖδες Ἰσραήλ, ὡς ἐν χωνευτηρίῳ, τῷ κάλλει τῆς εὐσεβείας, καθαρώτερον χρυσοῦ, ἀπέστιλβον λέγοντες· Εὐλογεῖτε πάντα τὰ ἔργα Κυρίου, τὸν Κύριον ὑμνεῖτε, καὶ ὑπερυψοῦτε, εἰς πάντας τοὺς αἰῶνας"), ("", "", "Ὁ βουλήσει ἅπαντα ποιῶν, ὁ καὶ μετασκευάζων, ἐκτρέπων σκιὰν θανάτου, εἰς αἰώνιον ζωήν, τῷ πάθει σου Λόγε Θεοῦ, σὲ ἀπαύστως πάντα τὰ ἔργα, ὡς Κύριον ὑμνοῦμεν, καὶ ὑπερυψοῦμεν, εἰς πάντας τοὺς αἰῶνας."), ("", "", "Σὺ καθεῖλες σύντριμμα Χριστέ, καὶ τὴν ταλαιπωρίαν, ἐν πύλαις καὶ ὀχυρώμασι τοῦ ᾅδου, ἀναστὰς ἐκ τάφου τριήμερος. Σὲ ἀπαύστως πάντα τὰ ἔργα, ὡς Κύριον ὑμνοῦσι, καὶ ὑπερυψοῦσιν, εἰς πάντας τοὺς αἰῶνας."), ("Θεοτοκίον", "", "Τὴν ἀσπόρως καὶ ὑπερφυῶς, ἐξ ἀστραπῆς τῆς θείας, τεκοῦσαν τὸν μαργαρίτην, τὸν πολύτιμον Χριστόν, ὑμνήσωμεν λέγοντες· Εὐλογεῖτε πάντα τὰ ἔργα, τὸν Κύριον ὑμνεῖτε, καὶ ὑπερυψοῦτε, εἰς πάντας τοὺς αἰῶνας."), ), "2": ( ("", "", "Θαύματος ὑπερφυοῦς"), ("", "", "Δεῦτε λαοὶ προσκυνήσωμεν τὸν τόπον, ἐν ᾧ ἔστησαν ἄχραντοι πόδες, καὶ ἐν ξύλῳ θεῖαι Χριστοῦ παλάμαι ζωοποιαί, ἐξετάθησαν εἰς πάντων σωτηρίαν βροτῶν, καὶ τάφον ζωῆς κυκλοῦντες μέλψωμεν· Εὐλογείτω ἡ κτίσις πᾶσα τὸν Κύριον, καὶ ὑπερυψούτω εἰς πάντας τοὺς αἰῶνας."), ("", "", "Ἤλεγκται τῶν θεοκτόνων Ἰουδαίων, ἡ παράνομος συκοφαντία· ὃν γὰρ πλάνον ἔφησαν, ἐξηγέρθη ὡς δυνατός, μυκτηρίσας τῶν ἀνόμων τὰ σφραγίσματα. Διὸ γεγηθότες ἀναμέλψωμεν· Εὐλογείτω ἡ κτίσις πᾶσα τὸν Κύριον, καὶ ὑπερυψούτω εἰς πάντας τοὺς αἰῶνας."), ("", "", "Τρισὶν ἐν ἁγιασμοῖς θεολογοῦντες, τῆς μιᾶς κυριότητος δόξαν, Σεραφεὶμ τὰ ἄχραντα, μετὰ δέους δουλοπρεπῶς, τρισυπόστατον δοξάζουσι Θεότητα· μεθ’ ὧν καὶ ἡμεῖς εὐσεβοῦντες ἀναμέλψωμεν· Εὐλογείτω ἡ κτίσις πᾶσα τὸν Κύριον, καὶ ὑπερυψούτω εἰς πάντας τοὺς αἰῶνας."), ), "3": ( ("", "", "Ἐν καμίνῳ Παῖδες"), ("", "", "Τὴν παστάδα τὴν φωτοειδῆ, ἐξ ἧς ὁ τῶν ἁπάντων Δεσπότης, ὥσπερ νυμφίος προελήλυθε Χριστός, ὑμνήσωμεν ἅπαντες, ἐκβοῶντες· Πάντα τὰ ἔργα, τὸν Κύριον ὑμνεῖτε, καὶ ὑπερυψοῦτε, εἰς πάντας τοὺς αἰῶνας."), ("", "", "Χαῖρε θρόνε ἔνδοξε Θεοῦ· πιστῶν χαῖρε τὸ τεῖχος, δι’ ἧς φῶς τοῖς ἐν σκότει, ἐξανέτειλε Χριστός, τοῖς σὲ μακαρίζουσι, καὶ βοῶσι· Πάντα τὰ ἔργα, τὸν Κύριον ὑμνεῖτε, καὶ ὑπερυψοῦτε, εἰς πάντας τοὺς αἰῶνας."), ("", "", "Σωτηρίας αἴτιον ἡμῖν, τὸν Κύριον τεκοῦσα, ἱκέτευε ὑπὲρ πάντων, τῶν βοώντων ἐκτενῶς, Παρθένε πανύμνητε· Εὐλογεῖτε πάντα τὰ ἔργα, τὸν Κύριον ὑμνεῖτε, καὶ ὑπερυψοῦτε, εἰς πάντας τοὺς αἰῶνας."), ) ), "P9": ( "1": ( ("", "", "Τύπον τῆς ἁγνῆς λοχείας σου, πυρπολουμένη βάτος ἔδειξεν ἄφλεκτος, καὶ νῦν καθ' ἡμῶν, τῶν πειρασμῶν ἀγριαίνουσαν, κατασβέσαι αἰτοῦμεν τὴν κάμινον, ἵνα σε Θεοτόκε, ἀκαταπαύστως μεγαλύνωμεν"), ("", "", "Ὢ πῶς ὁ λαὸς ὁ ἄνομος, ὁ ἀπειθὴς καὶ πονηρὰ βουλευσάμενος, τὸν ἀλάστορα καὶ ἀσεβῆ ἐδικαίωσε, τὸν δὲ δίκαιον ξύλῳ κατέκρινε, τὸν Κύριον τῆς δόξης! Ὃν ἐπαξίως μεγαλύνομεν."), ("", "", "Σῶτερ, ὁ ἀμνὸς ὁ ἄμωμος, ὁ τὴν τοῦ κόσμου ἁμαρτίαν ἀράμενος, σὲ δοξάζομεν τὸν ἀναστάντα τριήμερον, σὺν Πατρὶ καὶ τῷ θείῳ σου Πνεύματι, καὶ Κύριον τῆς δόξης, θεολογοῦντες μεγαλύνομεν."), ("Θεοτοκίον", "", "Σῶσον τὸν λαόν σου Κύριε, ὅν περ ἐκτήσω τῷ τιμίῳ σου αἵματι, κατ’ ἐχθρῶν ἰσχὺν τῷ βασιλεῖ χαριζόμενος, καὶ ταῖς σαῖς Ἐκκλησίαις Φιλάνθρωπε, βραβεύων τὴν εἰρήνην, τῆς Θεοτόκου ταῖς ἐντεύξεσιν."), ), "2": ( ("", "", "Μυστήριον ξένον"), ("", "", "Δεδόξασται τῇ ἀπορρήτῳ δυνάμει σου, ὁ Σταυρός σου Κύριε· σοῦ γὰρ τὸ ἀσθενές, ὑπὲρ δύναμιν πᾶσιν ἐδείχθη, δι’ οὗ δυνατοὶ μέν, καταβέβληνται εἰς γῆν, καὶ πτωχοὶ πρὸς οὐρανὸν ἀνακομίζονται."), ("", "", "Νενέκρωται ὁ ἀμειδὴς ἡμῶν θάνατος· ἐκ νεκρῶν ἀνάστασιν, σὺ γὰρ ἐπιφανείς, τοῖς ἐν ᾅδῃ Χριστὲ ἐδωρήσω. Διὸ ὡς ζωήν σε καὶ ἀνάστασιν, καὶ φῶς τὸ ἐνυπόστατον, ὑμνοῦντες μεγαλύνομεν."), ("", "", "Ἡ ἄναρχος φύσις καὶ ἀπεριόριστος, ἐν τρισὶ γνωρίζεται, μόναις θεαρχικαῖς ὑποστάσεσι· μία Θεότης Πατρί, Υἱῷ τε καὶ Πνεύματι, ἐφ’ ᾗ ὁ θεόφρων βασιλεὺς πεποιθὼς σῴζεται."), ), "3": ( ("", "", "Τύπον τῆς ἁγνῆς"), ("", "", "Ῥίζης ἐκ Δαυῒδ ἐβλάστησας, προφητικῶς Παρθένε τοῦ θεοπάτορος, ἀλλὰ καὶ Δαυΐδ, ὡς ἀληθῶς σὺ ἐδόξασας, ὡς τεκοῦσα τὸν προφητευόμενον, τὸν Κύριον τῆς δόξης, ὃν ἐπαξίως μεγαλύνομεν."), ("", "", "Ἅπας ἐγκωμίων Πάναγνε, νόμος ἡττᾶται τῷ μεγέθει τῆς δόξης σου, ἀλλὰ Δέσποινα παρ’ ἱκετῶν ἀναξίων μέν, ἐξ εὐνοίας δὲ σοὶ προσφερόμενον, προσδέχου Θεοτόκε, μετ’ εὐμενείας τὸ ἐφύμνιον."), ("", "", "Ὢ τῶν ὑπὲρ νοῦν θαυμάτων σου! σὺ γὰρ Παρθένε μόνη ὑπὲρ τὸν ἥλιον, πᾶσι δέδωκας κατανοεῖν τὸ καινότατον, θαῦμα Πάναγνε τῆς σῆς γεννήσεως, τὸ τῆς ἀκαταλήπτου. Διό σε πάντες μεγαλύνομεν."), ) ), ), "CH": ( ("", "", "Ὑμνοῦμέν σου Χριστέ, τὸ σωτήριον πάθος, καὶ δοξάζομέν σου τὴν ἀνάστασιν."), ("", "", "Ὁ Σταυρὸν ὑπομείνας, καὶ τὸν θάνατον καταργήσας, καὶ ἀναστὰς ἐκ τῶν νεκρῶν, εἰρήνευσον ἡμῶν τὴν ζωὴν Κύριε, ὡς μόνος παντοδύναμος."), ("", "", "Ὁ τὸν ᾅδην σκυλεύσας, καὶ τὸν ἄνθρωπον ἀναστήσας, τῇ ἀναστάσει σου Χριστέ, ἀξίωσον ἡμᾶς ἐν καθαρᾷ καρδίᾳ, ὑμνεῖν καὶ δοξάζειν σε."), ("", "", "Τὴν θεοπρεπῆ σου συγκατάβασιν δοξάζοντες, ὑμνοῦμέν σε Χριστέ· ἐτέχθης ἐκ Παρθένου, καὶ ἀχώριστος ὑπῆρχες τῷ Πατρί· ἔπαθες ὡς ἄνθρωπος, καὶ ἑκουσίως ὑπέμεινας Σταυρόν· ἀνέστης ἐκ τοῦ τάφου, ὡς ἐκ παστάδος προελθών, ἵνα σώσῃς τὸν κόσμον· Κύριε δόξα σοι."), ("", "", "Ὅτε προσηλώθης τῷ ξύλῳ τοῦ Σταυροῦ, τότε ἐνεκρώθη τὸ κράτος του ἐχθροῦ· ἡ κτίσις ἐσαλεύθη τῷ φόβῳ σου, καὶ ὁ ᾅδης ἐσκυλεύθη τῷ κράτει σου· τοὺς νεκρούς ἐκ τῶν τάφων ἀνέστησας, καὶ τῷ λῃστῇ τὸν Παράδεισον ἤνοιξας· Χριστὲ ὁ Θεὸς ἡμῶν, δόξα σοι."), ("", "", "Ὀδυρόμεναι μετὰ σπουδῆς, τὸ μνῆμά σου κατέλαβον αἱ τίμιαι γυναῖκες· εὑροῦσαι δὲ τὸν τάφον ἀνεῳγμένον, καὶ μαθοῦσαι παρὰ τοῦ Ἀγγέλου, τὸ καινὸν καὶ παράδοξον θαῦμα, ἀπήγγειλαν τοῖς Ἀποστόλοις, ὅτι ἀνέστη ὁ Κύριος, δωρούμενος τῷ κόσμῳ τὸ μέγα ἔλεος."), ("", "", "Τὴν τῶν παθῶν θείαν μωλώπωσιν, σοῦ προσκυνοῦμεν, Χριστὲ ὁ Θεός, καὶ τὴν ἐν τῇ Σιὼν δεσποτικὴν ἱερουργίαν, τὴν ἐν τέλει τῶν αἰώνων θεοφανῶς γεγενημένην· τοὺς γὰρ ἐν σκότει καθεύδοντας, ὁ Ἥλιος ἐφώτισας τῆς δικαιοσύνης, πρὸς ἀνέσπερον χειραγωγῶν ἔλλαμψιν· Κύριε δόξα σοι."), ("", "", "Τὸ φιλοτάραχον γένος τῶν Ἰουδαίων, ἐνωτίσασθε· Ποῦ εἰσιν οἱ Πιλάτῳ προσελθόντες; εἴπωσιν οἱ φυλάσσοντες στρατιῶται· ποῦ εἰσιν αἱ σφραγῖδες τοῦ μνήματος; ποῦ μετετέθη ὁ ταφείς; ποῦ ἐπράθη ὁ ἄπρατος; πῶς ἐσυλήθη ὁ θησαυρός; τί συκοφαντεῖτε τὴν ἔγερσιν τοῦ σταυρωθέντος, παράνομοι Ἰουδαῖοι; Ἀνέστη ὁ ἐν νεκροῖς ἐλεύθερος, καὶ παρέχει τῷ κόσμῳ τὸ μέγα ἔλεος."), ), ) #let L_Ne = ( "B": ( ("", "", "Διὰ βρώσεως ἐξήγαγε, τοῦ Παραδείσου ὁ ἐχθρὸς τὸν Ἀδάμ, διὰ Σταυροῦ δὲ τὸν λῃστήν, ἀντεισήγαγε Χριστὸς ἐν αὐτῷ· Μνήσθητί μου κράζοντα, ὅταν ἔλθῃς ἐν τῇ βασιλείᾳ σου."), ("", "", "Προσκυνῶ σου τὰ παθήματα, δοξολογῶ καὶ τὴν ἀνάστασιν, σὺν τῷ Ἀδὰμ καὶ τῷ λῃστῇ, μετὰ φωνῆς ἀναβοῶ σοι λαμπρᾶς· Μνήσθητί μου Κύριε, ὅταν ἔλθῃς ἐν τῇ Βασιλείᾳ σου."), ("", "", "Ἐσταυρώθης ἀναμάρτητε, καὶ ἐν μνημείῳ κατετέθης ἑκών, ἀλλ' ἐξανέστης ὡς Θεός, συνεγείρας ἑαυτῷ τὸν Ἀδάμ. Μνήσθητί μου κράζοντα, ὅταν ἔλθῃς ἐν τῇ Βασιλεία σου."), ("", "", "Τὸν ναόν σου τὸν τοῦ σώματος, τῇ τριημέρῳ ἀναστήσας ταφῇ, σὺν τῷ Ἀδὰμ καὶ τοὺς ἐξ Ἀδάμ, ἐξανέστησας Χριστὲ ὁ Θεός. Μνήσθητί μου κράζοντας, ὅταν ἔλθῃς ἐν τῇ Βασιλείᾳ σου."), ("", "", "Μυροφόροι ἦλθον κλαίουσαι, ἐπὶ τὸ μνῆμά σου Χριστὲ ὁ Θεός, λίαν πρωΐ, καὶ ἐν λευκοῖς, εὗρον Ἄγγελον καθήμενον, Τί ζητεῖτε; κράζοντα, ἐξανέστη Χριστός, μὴ θρηνεῖτε λοιπόν."), ("", "", "Οἱ Ἀπόστολοί σου Κύριε, ἐπὶ τὸ ὄρος, οὗ ἐτάξω αὐτοῖς, παραγενόμενοι Σωτήρ, σὲ ἰδόντες προσεκύνησαν, οὓς καὶ ἐξαπέστειλας, εἰς τὰ ἔθνη διδάσκειν, καὶ βαπτίζειν αὐτούς."), ("", "", "Τὸν Πατέρα προσκυνήσωμεν, καὶ τὸν Υἱὸν δοξολογήσωμεν, καὶ τὸ Πανάγιον ὁμοῦ, πάντες Πνεῦμα ἀνυμνήσωμεν, κράζοντες καὶ λέγοντες· Παναγία Τριάς, σῶσον πάντας ἡμᾶς."), ("", "", "Τὴν Μητέρα σου προσάγει σοι, ἱκεσίαν ὁ λαός σου Χριστέ· ταῖς παρακλήσεσιν αὐτῆς, τοὺς οἰκτιρμούς σου δὸς ἡμῖν Ἀγαθέ, ἵνα σε δοξάζωμεν, τὸν ἐκ τάφου ἡμῖν ἀνατείλαντα."), ), "TKB": ( ("", "", "Τού λίθου σφραγισθέντος υπό τών Ιουδαίων, καί στρατιωτών φυλασσόντων τό άχραντόν σου Σώμα, ανέστης τριήμερος Σωτήρ, δωρούμενος τώ κόσμω τήν ζωήν, διά τούτο αι Δυνάμεις των ουρανών εβόων σοι ζωοδότα. Δόξα τή Αναστάσει σου Χριστέ, δόξα τή βασιλεία σου, δόξα τή οικονομία σου, μόνε φιλάνθρωπε."), ("", "", "Ἐξανέστης ὡς Θεός, ἐκ τοῦ τάφου ἐν δόξῃ, καὶ κόσμον συνανέστησας, καὶ ἡ φύσις τῶν βροτῶν ὡς Θεόν σε ἀνύμνησε, καὶ θάνατος ἠφάνισται, καὶ ὁ Ἀδὰμ χορεύει, Δέσποτα, καὶ ἡ Εὔα νῦν ἐκ τῶν δεσμῶν λυτρουμένη, χαίρει κράζουσα· Σὺ εἶ ὁ πᾶσι παρέχων, Χριστὲ τὴν ἀνάστασιν."), ("Θεοτοκίον", "", "Τού Γαβριήλ φθεγξαμένου σοι Παρθένε τό Χαίρε, σύν τή φωνή εσαρκούτο ο τών όλων Δεσπότης, εν σοί τή αγία κιβωτώ, ως έφη ο δίκαιος Δαυϊδ, εδείχθης πλατυτέρα τών ουρανών, βαστάσασα τόν Κτίστην σου. Δόξα τώ ενοικήσαντι εν σοί, δόξα τώ προελθόντι εκ σού, δόξα τώ ελευθερώσαντι ημάς διά τού τόκου σου."), ), "P": ( ("", "", ""), ("", "", ""), ("", "", ""), ("", "", ""), ) )
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/docs/overview.md
markdown
Apache License 2.0
--- description: | Learn how to use Typst to compose documents faster. Get started with the tutorial, or dive into the reference. --- # Overview Welcome to Typst's documentation! Typst is a new markup-based typesetting system for the sciences. It is designed to be an alternative both to advanced tools like LaTeX and simpler tools like Word and Google Docs. Our goal with Typst is to build a typesetting tool that is highly capable _and_ a pleasure to use. This documentation is split into two parts: A beginner-friendly tutorial that introduces Typst through a practical use case and a comprehensive reference that explains all of Typst's concepts and features. We also invite you to join the community we're building around Typst. Typst is still a very young project, so your feedback is more than valuable.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/anatomy/0.1.0/sample.typ
typst
Apache License 2.0
#import "lib.typ": metrics #let typography = { let multiplier = 1.5 ( size: 12pt, line-march: multiplier * 1em, line-across: (2 * multiplier - 1) * 1em, leading: (multiplier - 1) * 1em, ) } #set text( typography.size, font: "American Typewriter", ) #set par( first-line-indent: 1.5em, leading: typography.leading, ) #show par: set block(spacing: typography.leading) #show heading: set text(typography.size) = Samples #let samples = ( ( content: metrics( 72pt, "EB Garamond", "Typewriter" ), caption: "The metrics of EB Garamond" ), ( content: metrics( 54pt, "一點明體", "電傳打字機", typeset: metrics => table( columns: 2, ..metrics.pairs().flatten().map(x => [ #x ]) ) ), caption: "The metrics of I.Ming (table attached)" ), ( content: metrics( 54pt, "Hiragino Mincho ProN", "テレタイプ端末" ), caption: "The metrics of Hiragino Mincho ProN" ) ).map(it => figure( it.content, caption: it.caption )) `metrics(72pt, "EB Garamond", "Typewriter")` will be rendered as follows: #samples.at(0) Additionally, a closure using `metrics` dictionary as parameter can be specified for further typesetting: ```typ metrics(54pt, "一點明體", "電傳打字機", typeset: metrics => table( columns: 2, ..metrics.pairs().flatten().map(x => [ #x ]) ) ) ``` It will generate: #samples.at(1) #rect(inset: 1em)[ *Remark*: To typeset CJK text, adopting font's ascender/descender as `top-edge`/`bottom-edge` makes more sense in some cases. As for most CJK fonts, the difference between ascender and descender heights will be exact 1em. Tested with `metrics(54pt, "Hiragino Mincho ProN", "テレタイプ端末")`: #samples.at(2) ]
https://github.com/danilasar/conspectuses-3sem
https://raw.githubusercontent.com/danilasar/conspectuses-3sem/master/Основы_теории_изучаемого_языка/3 семестр/240904_вводная.typ
typst
#set quote(block: true) = Введение = Основы теории изучаемого языка == Организационные вопросы <NAME>. В конце семестра бует итоговая аттестация. Это может быть как зачёт, так и экзамен, точно неизвестно. Будет 15 лекций, примерно к середине декабря кончим. В прошлом году мы освоили фонетику, грамматику и морфологию. В курсе 3 блока: + Синтаксис + Теория перевода + Стилистика Мы будем сопоставлять русский и английский язык. Будут задания, за которые будут присуждаться баллы. Они будут основаны на материале английского языка. Посещаемость является одним из ключевых моментов при вычислении баллов. Если возникает уважительная причина пропуска, нужно заранее предупредить препода. Хорошая посещаемость и полное выполнение заданий предполагают автомат. На зачёте один теоретический вопрос и один практический. == Предложение. Классификация предложений / Предложение: --- центральная единица синтаксиса, которая служит главным средством формирования, выражения и сообщения мысли. Каждое предложение состоит из каких-то элементов, в частности, из словосочетаний, которые, в свою очередь, состоят из слов. === Классификация предложений По структуре бывают простые и сложные, двусоставные и односоставные. Простое и сложное предложения различаются в зависимости от наличия придаточных, осложняющих их. Например: He is smiling. I got the information. Nobody knew that he hadn't come. В третьем примере есть две основы. Придаточные предложения (clauses) входят в состав сложноподчинённых. В основе двусоставных предложений лежит подлежащно-сказуемостная структура. Например: My friend John is a clever student. Односоставное предложене имеет один главный член. Например: Slience, Summer. English spring flowers! Слово "есть" опускается в русском языке, вместо него ставится тире или не ставится ничего. Двусоставные предложения могут быть распространёнными (наличие второстепенных членов предложения и нераспространёнными (наличие только главных членов). === Классификация по логическому признаку утверждения/отрицания - Утвердительные (It was difficult for him to do it) - Отрицательные (It was difficult for him not to do it) В английской речи есть тенденция к упрощению, что объясняется мировыми процессами, которые продолжаются на протяжении нескольких десятилетий. Миграционные потоки в США и Великобритании приводят к снижению среднего уровня грамотности населения, что естественным образом ускоряет упрощение языковых норм. === Функциональная классификация предложений - Поествовательные - Вопросительные - Побудительные - Восклицательные == Повествовательные предложения / Повествовательные предложения: сообщают определённую информацию. Они могут быть утвердительными и отрицательными. Повествовательные предложения --- это двусоставные предложения с прямым порядком слов. Например: #quote[I don't want to go anywhere else.] Мы можем произнести одно и то же предложение с разной интонацей, повлияв на его смысл. == Вопросительные предложения Вопросительные предложения запрашивают информацию. Они могут быть утвердительными и отрицательными. Это двусоставные предложения с частичной инверсией, когда служебная ычасть сказуемого предшествует подлежащему, а знаменательная часть сказуемого следует за подлежащим. Пример: #quote[When did you go to bed?] Единственное исключение представляет вопрос к подлежащему, который характеризуется прямым порядком слов: #quote[Who (подлежащее) went (сказуемое) to bed at 11 o'clock?] === Типы вопросов - Общий - Специальный - Альтернативный - Разделительный / Общий вопрос: имеет целью проверить истинность определённых положений говорящего. Он начинается со служебного глагола и требует ответа "да" или "нет". Например: #quote[ Have you got a pen? --- Yes.] #quote[Do you want me to come? --- No.] / Специальные вопросы: задаются с целью получения более подробной или более точной информации о событии, известной собеседнику. Они начинаются с вопросительного слова и сопровождаются ответом, раскрывающим содержание вопросительного слова. Например #quote[How many pictures did he show? --- He showed many pictures.] What? When? Why? Which? Where? Who? Whose? How? How many/how much? / Альтернативный вопрос: предполагает выбор. Например: #quote[Do you go to the theatre or to the cinema?] / Разделительный вопрос: представляет собой комбинацию повествовательного и общего вопросительног опредложения. Например: #quote[She is pretty, isn't she? You aren't coming with us, are you? I am good at languages, aren't I?] #quote(attribution: [Даня])[Если я прямо на паре начну изучать новый вариант русской раскладки, пожалею ли я об этом?] == Побудительные предложения / Побудительные предложения: выражают побуждение к действиб, просьбу, совет. Побудительные предложения могут быть утвердительными и отрицательными. Например: #quote[Yankee, go home! Don't go home!] В основном побудительные предложения односоставны по структуре: #quote[Stop it! Don't be cross. Let the children go to bed.] == Восклицательные предложения - это конструкции, начинающиеся с _what_: #quote[What beatiful weather!] - конструкции, начинающиеся с _how_: #quote[How clewer he is!] - конструкции с эмфатическим _do_ в _present simple_, _did_ в _past simple_: #quote[I #underline[do] love him. Do stop crying!]
https://github.com/Skimmeroni/Appunti
https://raw.githubusercontent.com/Skimmeroni/Appunti/main/Metodi%20Algebrici/Crittografia/Firma.typ
typst
Creative Commons Zero v1.0 Universal
#import "../Metodi_defs.typ": * Nello scenario presentato nel precedente capitolo, due entitá sono in grado di scambiarsi messaggi senza che terze parti siano in grado di leggerne il contenuto. Si presenta peró un problema: per il ricevente non c'é modo di sapere _davvero_ se il mittente del messaggio sia effettivamente chi dice di essere o se sia qualcun'altro che lo sta impersonando. Diventa quindi necessario associare al messaggio una *firma* che dia al ricevente la certezza di aver ricevuto un messaggio da un mittente che é davvero chi dice di essere. Una firma di questo tipo puó essere facilmente implementata mediante RSA. Siano Alice e Bob due entitá che vogliono comunicare; senza perdita di generalitá, si assuma che Alice sia il mittente e Bob il ricevente. Alice ha una chiave di cifratura $(N_(A), r_(A))$ ed una chiave di decifratura $(N_(A), s_(A))$, mentre Bob ha una chiave di cifratura $(N_(B), r_(B))$ ed una chiave di decifratura $(N_(B), s_(B))$. Naturalmente, le chiavi di cifratura sono note per entrambi, mentre le chiavi di decifratura sono note solamente ai rispettivi possessori. Si assuma per semplicitá che $cal(P)$, l'insieme delle unitá di messaggi in chiaro, e $cal(C)$, l'insieme delle unitá dei messaggi cifrati, coincidano. Sia $F$ un messaggio non cifrato speciale (un numero identificativo, un timestamp, ecc...) che fa da firma ai messaggi di Alice. Si noti come Alice, per provare a Bob di essere sé stessa e non un impostore, non puó semplicemente cifrare ed inviare $F$, perché si ripresenterebbe il problema. Si distinguono due casi: + $N_(A) gt.eq N_(B)$. Per cifrare il suo messaggio, Alice innanzitutto cifra $F$ usando la sua chiave di decifratura (anziché quella di cifratura, come farebbe di norma), ottenendo $F_(A) = F^(s_(A)) mod N_(A)$. A partire da questa, calcola $F_(A, B) = F_(A)^(r_(B)) mod N_(B)$ e invia a Bob sia il messaggio che vuole inviargli, sia la sua firma $F_(A, B)$. Bob ricostruisce sia il messaggio sia la firma $F_(A) = F_(A, B)^(s_(B)) N_(B)$, per poi ottenere $F$ come $F = F_(A)^(r_(A)) mod N_(A)$; + $N_(A) < N_(B)$. Per cifrare il suo messaggio, Alice innanzitutto cifra $F$ usando la chiave di cifratura di Bob (anziché la sua chiave di cifratura, come farebbe di norma), ottenendo $F_(B) = F^(r_(B)) mod N_(B)$. A partire da questa, calcola $F_(B, A) = F_(B)^(s_(A)) mod N_(A)$ e invia a Bob sia il messaggio che vuole inviargli, sia la sua firma $F_(B, A)$. Bob ricostruisce sia il messaggio sia la firma $F_(B) = F_(B, A)^(r_(A)) N_(A)$ per poi ottenere $F$ come $F = F_(B)^(s_(B)) mod N_(B)$. Bob ha la certezza che il messaggio provenga da Alice perché per ricostruire la firma ha dovuto usare la chiave pubblica di Alice, e solamente Alice puó conoscere la relativa chiave privata, e aver quindi cifrato il messaggio con essa.
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-justify-cjk_00.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test Chinese text in narrow lines. // In Chinese typography, line length should be multiples of the character size // and the line ends should be aligned with each other. // Most Chinese publications do not use hanging punctuation at line end. #set page(width: auto) #set par(justify: true) #set text(lang: "zh", font: "Noto Serif CJK SC") #rect(inset: 0pt, width: 80pt, fill: rgb("eee"))[ 中文维基百科使用汉字书写,汉字是汉族或华人的共同文字,是中国大陆、新加坡、马来西亚、台湾、香港、澳门的唯一官方文字或官方文字之一。25.9%,而美国和荷兰则分別占13.7%及8.2%。近年來,中国大陆地区的维基百科编辑者正在迅速增加; ]
https://github.com/typst-cn/typst-programming-tutorial
https://raw.githubusercontent.com/typst-cn/typst-programming-tutorial/master/examples/hello.typ
typst
#let content = "Hello Typst! \n 你好, Typst!" #[ #content ]
https://github.com/TycheTellsTales/typst-pho
https://raw.githubusercontent.com/TycheTellsTales/typst-pho/main/tests/poster_tags/test.typ
typst
#import "../../lib.typ": pho, link #pho( viewer: "<NAME>", poster: "<NAME>", date: "January 1st 1001", (topic, post) => { topic( title: "Hello World!", board: "Announcements", )[ Hello World!\ \ This is a post\ \ #link[[This is a link.jpg]] ] post("Procto the Unfortunate Tinker")[ Reply 1 ] })
https://github.com/imkochelorov/ITMO
https://raw.githubusercontent.com/imkochelorov/ITMO/main/src/discrete-math/s2/main.typ
typst
#import "template.typ": * #set page(margin: 0.55in, height: auto) #set par(leading: 0.55em, first-line-indent: 0em, justify: false) #set text(font: "New Computer Modern") #set heading(numbering: "1.1.") #show raw: set text(font: "New Computer Modern Mono") #show par: set block(spacing: 0.55em) #show heading: set block(above: 1.4em, below: 1em) #show heading.where(level: 1): set align(center) #show heading.where(level: 1): set text(1.44em) #show outline.entry.where( level: 1 ): it => { v(15pt, weak: true) text(weight: "bold", size: 1.35em, it) } #show: project.with( title: "Дискретная математика\nII семестр", authors: ( "_scarleteagle", "imkochelorov" ), date: "зима/весна 2024", subtitle: "Лектор: <NAME>" ) #let def = strong("Определение:") #let proof=par(strong("Доказательство:")) #let th=strong("Теорема:") #let lm=strong("Лемма:") #let defnot = strong("Обозначение:") #let qed=$space qed$ #let note=strong("Замечание:") #let emptyset=$diameter$ #let dp(first, second)=$angle.l #first, #second angle.r$ #let ex(..number)= { if number.pos().len() == 0 { strong("Пример:") } else { strong("Пример " + str(number.pos().at(0)) + ":") } } #let cor(..number)= { if number.pos().len() == 0 { strong("Следствие:") } else { strong("Следствие " + str(number.pos().at(0)) + ":") } } #let ev = $upright(E)$ #let sd = $upright(D)$ #outline(title: "Оглавление", indent: auto) #pagebreak() #quote("Надеюсь, сессия прошла нормально", attribution: "<NAME>", block: true) = Дискретная теория вероятностей == Введение Случайности и вероятности давно интересовали людей, _в основном в азартных играх_. Первые теоремы дискретной теории вероятностей появились задолго до появления первого конечного автомата. Но философы всех времён задаются вопросом --- "существует ли случайность?" Философская мысль делится на 2 направления --- считающих, что случайности существуют, и #strike[остальных] детерминистов, считающих, что у нас просто недостаточно входных данных *Это всё мы с вами изучать не будем* == Аксиоматическая теория вероятностей by _<NAME>_ \ \ _Бытовое восприятие случайностей мешает в понимании формальной модели_ \ \ #def множество элементарных исходов \ $Omega$ --- множество всех возможных элементарных исходов случайного эксперимента, который может закончиться ровно одним из них\ $Omega$ может быть не более чем счётным, счётным, или не счётным. Но мы будем рассматривать дискретное множество элементарных исходов \ $|Omega|$ --- конечно или счётно \ \ #def элементарный исход\ Элемент $omega in Omega$ \ \ #def дискретная плотность вероятности\ $p: Omega -> RR: p(omega >= 0), limits(sum)_(omega in Omega) p(omega) = 1$\ _Если $Omega$ несчётна, то требуется другая теория_ \ \ #def дискретное вероятностное пространство \ Пара из множества элементарных исходов и дискретной плотности вероятностей $(Omega, p)$ \ \ *Примеры:* 1. Честная монета: \ $Omega = {0, 1}, space p(0) = p(1) = 1/2$ 2. Нечестная монета (распределение Бернулли):\ $Omega={0, 1}, space p(1) = p, space p(0)=1-p$ 3. Честная игральная кость _(1d6)_: \ $Omega = {1, 2, 3, 4, 5, 6}, space p(i) = 1/6$ 1. "Честная" игральная кость (1d20): \ $Omega={1, dots, 20}, space p(20) = 1$ 4. Колода карт:\ $Omega = {dp(r, s) | r = 1 dots 13, s = 1 dots 4 }, space p(dp(r, s))$ \ #def случайное событие \ Подмножество элементарных исходов $A subset Omega, quad P(A) = limits(sum)_(a in A)p(a)$\ Дискретное множество элементарных исходов является случайным событием \ \ *Примеры:* 1. Пустое событие $P(emptyset)=0$ 2. Достоверное событие (полное (?)) $P(Omega)=1$ 3. _Для честной монеты_ $P({0}) = 1/2, quad P({1}) = 1/2$ 4. _Для честной 1d6_ $P({1, 3, 5})=1/6 + 1/6 + 1/6 = 1/2, quad P({5, 6})=1/3, quad P({1,2,3})=1/2$ \ == Независимость событий #def независимое случайное событие\ $A$ и $B$ независимы, если $P(A sect B)=P(A) dot P(B)$ \ \ *Примеры:*\ _Для честной игральной кости_ \ $"Even"={2,4,6}$,$quad "Big"={5,6}$,$ quad"Small"={1,2,3}$ - $P("Even" sect "Big")=P({6})=1/6 quad$ $space space space P("Even") dot P("Big")=1/2 dot 1/3 = 1/6$ - $P("Even" sect "Small") = P({2}) = 1/6 quad$ $P("Even") dot P("Small") = 1/2 dot 1/2 = 1/4$ - $P("Big" sect "Small") = P(emptyset)=0 quad$ $space space space space space P("Big") dot P("Small") = 1/3 dot 1/2 = 1/6$ \ #def события, независимые в совокупности\ $A_1, A_2, dots, A_k$ -- независимы в совокупности, если $forall I subset {1, 2, dots, k} quad P(limits(sect.big)_(i in I) A_i) = limits(product)_(i in I) P(A_i)$ \ \ *Примеры:*\ _Для броска двух разных честных монет_\ $Omega={00,01,10,11}, quad p(i dot j)=1/4$\ $A={01,00} , quad B={10,00}, quad C={11,00}$ не независимы в совокупности \ \ == Прямое произведение вероятностных пространств #def прямое произведение вероятностей пространств\ $dp(Omega_1, p_1), quad dp(Omega_2, p_2)$, прямое произведение пространств $Omega = Omega_1 times Omega_2: quad p(dp(u_1, u_2)) = p_1(omega_1) dot p_2(omega_2)$\ $limits(sum)_(dp(omega_1, omega_2) in Omega_1 times Omega_2) p(dp(omega_1, omega_2)) = sum p_1(omega_1) dot p_2(omega_2) = limits(sum)_omega_1(p_1(omega_1) dot limits(sum)_omega_2 p_2(omega_2)) = 1$\ //чекни формулу суммы перемножения \ #ex()\ $A_1 subset Omega_1, space A_2 subset Omega_2 => A_1 times Omega_2 space$ и $space Omega_1 times A_2$ --- независимы\ $(A_1 times Omega_2) sect (Omega_1 times A_2) = A_1 times A_2$ == Условная вероятность _имеет смысл, если $P(B) eq.not emptyset$_\ \ #columns(2)[$P(A|B) = P(A sect B)/P(B), quad P(B)!=0$\ \ если $A$ и $B$ независимы, то \ $P(A|B)=(P(A) dot P(B))/P(B)=P(A)$\ \ $p_B (omega)=p(omega)/P(B), quad P_B (A)=P(A sect B)/P(B))$ #colbreak() #image("1.png", width: 50%)] // Введение в теорию вероятностей. Вероятности не существует. // Введение в теорию формальных языков #th (_Формула полной вероятности_)\ $Omega = limits(underbrace(A_1 union A_2 union dots union A_k))_("полная система событий"), quad A_i sect A_j = emptyset$ при $i!= j$\ \ $B quad quad P(B|A_i)$\ $P(B) = limits(sum)_(i=1)^n P(B|A_i) P(A_i)$\ $limits(sum)_(i=1)^k P(B|A_i) P(A_i)=limits(sum)_(i=1)^k (P(B sect A_i))/P(A_i) dot P(A_i) = limits(sum)_(i=1)^k P(B sect A_i)=P(B)$ \ \ *Задача:*\ Две урны, в одной 3 черных и 2 белых, в другой 4 черных и 1 белый шар. С какой вероятностью можно вынуть черный шар? \ $A_1 quad A_2 quad 1/2$\ $P(B|A_1) = 3/5 quad P(B|A_2) = 4/5 quad P(B) = 3/5 dot 1/2 + 4/5 dot 1/2 = 7/10$ \ \ *Задача:*\ $P(B|A_i) quad P(A_i) quad $ найти $P(A_i|B) =$ ?\ Достоверность = 1 - $P(B|A_2)$ = $99%$\ Надёжность = $P(B|A_1)$ = $95%$\ $A_1$ --- болен ($1/100$)\ \ $A_2$ --- здоров ($99/100$)\ \ $P(A_1|B)=(0,95 dot 0,01)/(0,95 dot 0,01 + 0,01 dot 0,99)$ \ \ $P(B|A_i) = P(A_i sect B)/P(A_i)$ \ \ #def формула Байеса\ \ $P(A_i|B) = P(A_i sect B) / P(B) = (P(B|A_i) P(A_i))/(limits(sum)_(j = 1)^k P(B|A_j)P(A_j))$\ \ \ #def Байесовский спам-фильтр\ $A_1$ --- спам\ $A_2$ --- не спам\ $B$ --- критерий\ $P(B|A_1)$ --- вероятность выполнения критерия, если письмо спам _(можно посчитать)_\ $P(B|A_2)$ --- вероятность выполнения критерия, если письмо не спам _(можно посчитать)_\ \ Сам фильтр: $P(A_1|B)$ --- вероятность спама при выполнении критерия _(можно вычислить, используя значения выше)_ #pagebreak() == Случайная величина #def случайная величина\ $angle.l Omega, space p angle.r$ --- вероятностное пространство\ $xi: Omega -> RR$ --- _случайная величина (численная характеристика вероятностного эксперимента)_ \ \ *Примеры:* \ Игральная кость\ $Omega = {1, space 2, space 3, space 4, space 5, space 6}$\ $xi(omega) = omega$\ $eta$ --- выигрыш Васи \ \ #ex(1) \ _Вася получает 1 монету, если игральная кость падает нечётным числом и теряет 1 монету в ином случае:_ \ #table(columns: (15pt, auto, auto, auto, auto, auto, auto), sym.omega, "1", "2", "3", "4", "5", "6", sym.eta, "1", "-1", "1", "-1", "1", "-1")\ #ex(2)\ _Вася получает число монет, равное 2 в степени числа бросков кости, которые потребовались, чтобы выпало определённое число_ \ #table(columns: (15pt, auto, auto, auto, auto, auto), sym.omega, "1", "01", "001", "0001", sym.dots, sym.eta, "2", "4", "8", "16", sym.dots) \ \ *Операции над случайными величинами:*\ Произведение с числом:\ $xi = c dot eta quad c in RR$\ Сумма случайных величин:\ $xi = eta + zeta$\ Произведение случайных величин:\ $xi = eta dot zeta$\ Возведение в степень случайной величины:\ $xi = eta^zeta$\ _Можно даже рассмотреть синус случайной величины_:\ $xi = sin zeta$ \ \ #def дискретная плотность распределения\ $xi$ --- случайная величина\ $f_xi : RR -> RR$ --- _дискретная плотность распределения_\ $f_xi (a) = P(xi=a) = P({omega | xi(omega) = a})$ \ \ #def функция распределения\ $xi$ --- случайная величина\ $F_xi: RR -> RR$ --- _функция распределения_\ $F_xi (a) = P(xi <= a)$ \ \ #ex()\ Подбросим 10 монет\ $Omega = BB^10$\ $xi(omega)$ --- число единиц\ \ $P(xi=a) = binom(10, a)/2^10$ \ \ $f(a) = F(a)-F(a - delta)$\ $F(a) = limits(sum)_(b<=a) f(b)$ == Математическое ожидание #def математическое ожидание\ $xi : Omega -> RR$ --- случайная величина\ $ev xi = limits(sum)_(omega in Omega) xi(omega) dot p(omega)$ --- _математическое ожидание_ \ \ #ex()\ Игральная кость\ $Omega = {1, space 2, space 3, space 4, space 5, space 6}$\ $xi(omega)= omega$\ $ev xi = 1 dot 1/6 + 2 dot 1/6 + 3 dot 1/6 + 4 dot 1/6 + 4 dot 1/6 + 5 dot 1/6 + 6 dot 1/6 = 3.5$\ \ Легко заметить, что 3.5 никогда не выпадает на игральной кости\ Математическое ожидание не означает наиболее вероятные исход \ \ #ex(1)\ _Вася получает 1 монету, если игральная кость падает нечётным числом и теряет 1 монету в ином случае:_ \ #table(columns: (15pt, auto, auto, auto, auto, auto, auto), sym.omega, "1", "2", "3", "4", "5", "6", sym.eta, "1", "-1", "1", "-1", "1", "-1") $E xi = 0$\ Математическое ожидание равно 0, но при этом, после 1 игры, Вася либо получит монету, либо потеряет \ \ #ex(2) \ _Вася получает число монет, равное 2 в степени числа бросков кости, которые потребовались, чтобы выпало определённое число_ \ #table(columns: (15pt, auto, auto, auto, auto, auto), sym.omega, "1", "01", "001", "0001", sym.dots, sym.eta, "2", "4", "8", "16", sym.dots) $ev_xi = +infinity$\ Математическое ожидание может равняться $+infinity$\ \ $ev c = c$\ Математическое ожидание константы равняется константе \ \ *Линейность математического ожидания:*\ #th\ $xi = c dot eta quad ev xi = c dot ev eta$\ $xi = eta + zeta quad ev xi = ev eta + ev zeta$\ \ $ev (eta + zeta) = limits(sum)_(omega in Omega)(eta + zeta)(omega)= limits(sum)_(omega in Omega)(eta(omega) + zeta(omega)) =ev eta + ev zeta$ \ \ *Примечание:*\ Если $|Omega| = +infinity$, то $exists ev xi space <=> exists ev (|xi|)$ \ \ #ex()\ $xi$ --- выпало на верхней грани игральной кости D6\ $eta$ --- выпало на нижней грани\ $ev xi = 3.5, ev eta = 3.5$\ $ev (xi+eta) = 7$\ _Вне зависимости от расположения значений на игральной кости относительно друг друга_ \ \ #ex()\ $Omega = S_n$ --- перестановки $n$ элементов\ $abs(Omega) = n!$\ $xi(sigma) = abs({i | sigma_i = i})$ --- количество неподвижных точек\ $n = 3 quad xi(angle.l 1, 3, 2 angle.r) = 1$\ $ev xi = 1$\ Мы можем посчитать математическое ожидание, не зная распределение \ $xi_i = cases(1\, quad sigma_i = i, 0\, quad "иначе")$\ $xi_1 (1 space 3 space 2)=1$\ $xi_2 (1 space 3 space 2)=0$\ $xi_3 (1 space 3 space 2)=0$\ \ $xi = limits(sum)_(i=1)^n xi_i$\ $P(xi_i = 1) = 1/n$\ $ev xi_i = 1 dot P(xi_i = 1) + 0 dot P(xi_i=0) = 1/n$\ $ev xi = limits(sum)_(i=1)^n 1/n = 1$ \ \ #th\ $ev xi = limits(sum)_a a dot P(xi = a)$\ $limits(sum)_(omega in Omega) xi(omega) p(omega) = limits(sum)_a limits(sum)_(omega: xi(omega)=a) xi(omega) p(omega) = limits(sum)_a a limits(sum)_(omega: xi(omega) = a) p(omega) = limits(sum)_a a dot P(xi = a)$ \ \ #def независимые случайные величины\ $xi$ и $eta$ --- _независимы_, если\ $forall a,b in RR quad [xi <= a] " и " [eta <= b]$ --- _независимые случайные события_\ $P(xi <= a and eta <= b) = P(eta <= a) dot P(eta <= b)$\ \ *Замечание*:\ $xi" и" eta $ --- независимые, если \ $forall a, b in RR quad [xi = a] " и " [eta = b]$ --- независимые\ _Работает за исключением патологических случаев, которые мы не будем рассматривать_ \ \ #ex(1)\ $P(xi = 1) = 1/2$ --- вероятность того, что Вася выиграл 1 монету \ \ $P(eta=2)=1/6$ --- вероятность выпадения на игральной кости 2\ \ $P(xi=1 and eta=2)=0$ \ \ #ex(2)\ #table(columns: (auto, auto, auto), $attach("", bl: eta, tr: xi)$, "-1", "1", "0", $1/3$, $1/3$, "1", $1/6$, $1/6$) \ #th\ $xi$ и $eta$ независимы $=> ev(xi dot eta) = ev(xi) dot ev(eta)$\ \ $ev(xi dot eta) = limits(sum)_a a dot P(xi dot eta = a) = limits(sum)_a limits(sum)_b limits(sum)_(c:b dot c=a) b c dot P(xi=b and eta =c)=limits(sum)_a limits(sum)_b limits(sum)_(c:b dot c=a) b c P(xi = b) P(eta = c)=$$=limits(sum)_b b limits(sum)_c c P(xi=b)P(eta=c)=ev xi dot ev eta$ == Дисперсия _Вступление:_ \ Давайте посчитаем математическое ожидание отклонения этой случайной величины от ее математического ожидания. Внезапно обнаружим, что оно равняется 0\ $ev(xi - ev xi) = ev xi - ev ev xi = ev xi - ev xi = 0$ #emoji.face.down\ \ #def дисперсия\ $sd xi = ev (xi - ev xi)^2 $ --- _дисперсия_ \ $ev(xi - ev xi)^2 = ev(xi^2 - 2 xi ev xi + (ev xi)^2) = ev xi^2 - 2 ev xi ev xi + (ev xi)^2 = ev xi^2 - (ev xi)^2$\ _На английском:_ $"Var" xi$\ \ $sd c xi = c^2 sd xi$\ $sd (xi + eta) = ev(xi+eta)^2 - (ev(xi+eta))^2 = ev xi^2 + 2 ev xi eta + ev eta^2 - (ev xi)^2 - 2 ev xi ev eta - (ev xi)^2 = sd xi + sd eta + 2(ev xi eta - ev xi ev eta)$\ \ #def ковариация\ $ev xi eta - ev xi ev eta = "Cov"(xi, space eta)$ --- _ковариация_ #pagebreak() $Omega, space p$ --- вероятностное пространство\ #v(0.2cm) $xi: Omega -> RR$ --- случайная величина _(численная характеристика вероятностного эксперимента)_\ #v(0.2cm) $E xi = limits(sum)_(omega in Omega) xi (omega) dot p(omega) = limits(sum)_a a dot p(xi = a)$ --- мат ожидание\ #v(0.2cm) $E(xi + eta) = E xi + E eta $ --- мат ожидание суммы равно сумме мат ожиданий\ #v(0.2cm) $F_xi (a) = P(xi <= a)$ --- функция распределения случайной величины\ #v(0.2cm) $f_xi (a) = P(xi = a)$ --- плотность случайной величины\ #v(0.2cm) $xi " и " eta$ --- независимые для $forall alpha space beta$, если $[xi = alpha] " и " [eta = beta]$\ #v(0.2cm) $xi " и " eta$ --- независимые $=> E(xi, eta) = E xi dot E eta$\ #v(0.2cm) \ $D xi = E(xi - E xi)^2 = E xi^2 - (E xi)^2$ --- дисперсия\ #v(0.2cm) $xi "и " eta$ независимые $=> D(xi + eta) = D xi + D eta$\ #v(0.2cm) $D(xi + eta) = D xi + D eta + 2(E xi eta - E xi dot E eta)$\ #v(0.2cm) $"Cov"(xi, space eta)= E xi eta - E xi dot E eta$ --- ковариация\ #v(0.2cm) $xi " и " eta $ независимые $=> "Cov"(xi, space eta) = 0$\ #v(0.2cm) $"Cov"(xi, xi) = E(xi dot xi) - E xi dot E xi = D xi$ \ #v(0.2cm) $"Cov"(xi, -xi) = - E xi^2 + (E xi)^2 = - D xi$ --- ковариация может быть отрицательной#v(0.1cm) \ \ #th\ #v(0.2cm) $"Cov"(xi, eta)^2 <= D xi dot D eta$ \ \ #def корреляция\ #v(0.2cm) $"Corr"(xi, eta) = ("Cov"(xi, eta))/sqrt(D xi dot D eta)$ --- _корреляция_\ #v(0.2cm) $-1 <= "Corr"(xi, eta) <= 1$\ \ $D xi = 0 <=> E(xi - E xi)^2 = 0 <=> p(omega) > 0 => xi(omega) = E xi$\ Корреляции с константой не бывает, иначе в формуле деление на ноль\ \ \ #th\ #v(0.2cm) $"Corr"(xi, eta) &= 1 quad <=> quad xi = c dot eta, space &c > 0 \ &= -1 &c < 0 $ \ \ Корреляция не означает причинно-следственной связи \ \ == Хвостовые неравенства #image("2.png", width: 50%) *Задача:*\ Средняя зарплата 10 опрошенных человек --- 50 тысяч. Сколько максимум человек может иметь зарплату больше или равную 250 тысяч рублей?\ Максимум 2 человека, в случае, если 8 остальных имеют нулевую зарплату \ \ *Неравенство Маркова* _"очень богатых не может быть очень много"_\ #v(0.2cm) $xi > 0 quad E xi$\ #v(0.2cm) $P(xi >= c dot E xi) <= 1/c$ #v(0.2cm) *Доказательство:*\ #v(0.2cm) $P(xi >= c dot E xi) = limits(sum)_(omega : xi >= c dot E xi) p(omega)$\ #v(0.2cm) $E xi = limits(sum)_omega p(omega) dot xi (omega) =$\ #v(0.2cm) $= limits(sum)_(omega: xi(omega) >= c dot E xi) p(omega) dot xi(omega) + limits(sum)_(omega: xi(omega) < c dot E xi) p(omega) dot xi(omega) >=$ \ #v(0.2cm) $>= limits(sum)_(omega : xi(omega) >= c dot E xi) p(omega) dot c dot E xi$\ #v(0.2cm) $E xi >= c dot E xi dot P (xi >= c dot E xi)$\ #v(0.2cm) $P(xi >= c dot E xi) <= 1/c$ #columns(2)[ #image("3.png") #colbreak() #image("4.png")]\ $D xi = E(xi - E xi)^2$\ #v(0.2cm) $eta = (xi - e xi)^2$\ #v(0.2cm) $P(eta >= c ^ 2 E eta) <= 1/c^2$\ #v(0.2cm) $P((xi - E xi)^2 >= c^2 D xi) <= 1/c^2$\ #v(0.2cm) $P(|xi - E xi|) >= c dot sqrt(D xi)) <= 1/c^2$\ \ #def среднеквадратическое отклонение\ #v(0.2cm) $sigma = sqrt(D xi)$\ \ #th неравенство Чебышева\ #v(0.2cm) $P(|xi - E xi| >= c dot sigma) <= 1/c^2$\ \ \ $P(eta >= alpha) quad alpha^2 = c^2 E eta quad c^2 = alpha^2 / (D xi)$\ #v(0.2cm) $P(|eta - E eta| <= alpha) <= (D xi) / alpha^2$\ \ \ $xi quad n$ раз $1/n limits(sum)^n_(i = 1) xi_i = eta$\ #v(0.2cm) $xi_i$ --- о. р. незав. сл. величины\ #v(0.2cm) $E eta = E xi$\ #v(0.2cm) $D eta = 1/n^2 dot n D xi = 1/n D xi$\ \ нет. м. о. $mu$\ #v(0.2cm) $P(|xi - mu| >= alpha) <= (D xi)/alpha^2 = epsilon$\ #v(0.2cm) $P(|eta - mu| >= alpha) <= (D eta)/ alpha^2 = epsilon/n$\ \ Для какого $alpha$\ $P(|xi - mu| >= alpha) <= epsilon$\ \ $(D xi) / alpha^2 <= epsilon$\ #v(0.2cm) $alpha^2 >= 1/epsilon dot D xi$\ #v(0.2cm) $alpha >= sqrt(1/epsilon dot D xi) = N_0$\ #v(0.2cm) $alpha >= sqrt(1/epsilon D dot eta) = 1/sqrt(n) dot N_0$ \ \ #def распределение Бернулли\ $0, 1 quad p(1) = p, space p(0) = q, quad xi_i $\ #v(0.2cm) $xi = limits(sum)_(i = 1)^n xi_i quad E xi = n p$\ #v(0.2cm) $P(|xi - n p| >= |1/2 n - n p|)$ #image("5.png", width: 40%) $P_"err" <= P(|xi - n p| >= |1/2 n - n p|)$ \ \ \ $P(n p - xi >= n p - 1/2 n)$\ $P(xi <= (1/2 n - n p) + n p)$\ $P(xi <= n p ((1/(2p) - 1) + 1)) quad 1/(2p) - 1 = delta$\ $P(xi <= n p (1 - delta))$\ $P(xi >= n p (1 + delta))$ --- симметричная ситуация \ \ #th граница Чернова\ \ $P(xi <= n p (1 - delta)) &\ & quad <= e^(-delta^2/2 n p) \ P(xi >= n p (1 + delta)) &$ \ \ $e^(-1/(54) n) <= epsilon$\ \ $-1/54 n <= ln epsilon $\ \ $n >= 54 ln 1/epsilon$\ \ \ $xi quad t quad eta = e^(t xi)$\ \ $P(eta >= e^(t alpha)) <= (E eta) / e^(t alpha)$\ \ $E eta = E e^(t xi) - E e^(t limits(sum)_(i = 1)^n xi_i) = E limits(product)_(i = 1)^n e^(t xi_i) = limits(product)_(i = 1)^n E e^(t xi_i) = limits(product)_(i = 1) ^ n (p dot e^t + 1 - p)$ /* = TODO: Теория формальных языков /* TODO */ *\/\/ TODO* // TODO - TODO + TODO ```py # TODO ``` ```cpp // TODO ``` *#underline("T.O.D.O.") */ #pagebreak() #quote("Сегодня будет не так весело, как на вчерашней лекции парадигм", attribution: "<NAME>", block: true) _Что такое информация?_\ #v(0.4cm) == Энтропия _информация = -неопределённость_ \ \ #def энтропия случайнго источника\ #v(0.2cm) _Количество информации, приходящейся на одно сообщение источника_\ #v(0.2cm) $Omega = {1, 2, dots, n}$ --- _вероятностное пространство (случайный источник)_\ #v(0.2cm) Вероятности $p_1, p_2, dots, p_n$ \ #v(0.2cm) $H(p_1, p_2, dots, p_n)$ --- _энтропия случайного источника_\ \ \ *Свойства:*\ + $H$ непрерывна + $H(1/n, 1/n, dots 1/n)$ возрастает при росте $n$ + Закон аддитивности\ #v(0.2cm) $Omega = {(i, j), space i = 1dots n, space j = 1 dots m_i }$\ #v(0.2cm) $p_i = P(w."first" = i)$\ #v(0.2cm) $limits(sum)_(i = 1)^n p_i = 1$\ #v(0.2cm) $q_(i j) = p(w."second" = j | w."first" = i)$\ #v(0.2cm) $limits(sum)_(j = 1)^m_i q_(i j) = 1$\ #v(0.2cm) $p((i, j)) = p(w."first = i") dot p(w."second" = j | w."first" = i) = p_i dot q_(i j)$\ #v(0.2cm) $H(p_1q_(1 1), p_1 q_(1 2), dots, p_1 q_(1 m_1), p_2 q_(2 1), dot, p_n q_(n m)) = H(p_1, p_2, dots, p_n) + limits(sum)_(i = 1)^n p_i dot H(q_(i 1), q_(i 2), dots, q_(i m_i))$ \ \ $h(n) = H(1/n, 1/n, dots 1/n) quad h: NN -> RR$\ #v(0.2cm) $h(n) arrow.tr$ \ #v(0.2cm) $p_i = 1/n, space q_(i j) = 1/m$ \ #v(0.2cm) $h(m dot n) = h(n)$\ #v(0.2cm) Такая функция единственна --- логарифм. Докажем это\ #v(0.4cm) $h(n) = space ?$\ #v(0.4cm) $i quad h(n^i) = i dot h(n)$\ #v(0.4cm) $display(2^k <= n^i <= 2^(k+1) quad quad k = floor(log_2 n^i) = floor(i dot log_2 n))$\ #v(0.4cm) $display(k dot h(2) <= i dot h(n) <= (k + 1)h(2))$\ #v(0.4cm) $display(h(2) floor(i dot log_2 n)/i <= h(n) <= h(2) (floor(i dot log_2 n) + 1)/i)$\ #v(0.4cm) $display(forall i abs(h(n) - floor(i dot log_2 n)/i) < 1/i)$\ #v(0.4cm) $display(floor(i dot log_2 n) = i dot log_2 n = {i dot log_2 n})$\ #v(0.4cm) $display(abs(h(n)/h(2) - log_2 n + {i dot log_2 n}/i) < 1/i)$\ #v(0.4cm) $display(h(n)/h(2) = log_2 n quad quad h(2) = c)$\ #v(0.4cm) $h(n) = c dot log_2 n$\ #v(0.4cm) Бит, если $c = 1$ \ \ \ $display(p_i = a_i/b quad quad q_(i j) = 1/a_i quad m_i = a_i)$\ #v(0.4cm) $H(p_i q_(i j)) = H(p_i) + sum p_I H(q_(i j))$\ #v(0.4cm) $h(b) = H(p_1 dots p_n) + sum(p_i h(a_i))$\ #v(0.4cm) $limits(sum)_(i = 1)^n p_i dot log_2 b = H(p_1 dots p_n) + limits(sum)_(i = 1)^n p_i dot log_2 a_i$\ #v(0.4cm) $-limits(sum)_(i = 1)^n (p_i(log_2 a_i - log_2 b)) = H(p_1 dots p_n)$\ #v(0.4cm) $H(p_1 dots p_n) = - limits(sum)_(i = 1)^n p_i dot log p_i$ \ \ \ *Пример 1:*\ #v(0.2cm) Возьмём TeX исходник учебника математического анализа, представимый в виде строки. Рассмотрим все символы в нём и вероятность получить конкретный символ, взяв случайный. Получим энтропию учебника математического анализа --- количество информации. Но это не лучшая оценка информации учебника математического анализа, потому что после случайной перестановки символов энтропия (количество информации) не изменится, но количество информации по математическому анализу приравняется к 0 \ \ *Пример 2:*\ #v(0.2cm) Возьмём случайную строку длинной в миллион символов (число информации несколько миллионов бит). Лучший способ передать её (информацию о ней) --- передать весь миллион символов (несколько миллионов бит _возможно после небольшого сжатия_)\ Если мы захотим передать эту строку по телефонному звонку, нам придётся диктовать весь миллион символов. Но если мы просто захотим передать не фиксированную случайную строку в миллион символов, достаточно сказать "запиши случайную строку в миллион символов". В обоих случаях количество переданной информации равно, но усилия для передачи не равны \ \ \ #def сложность по Колмогорову\ #v(0.2cm) $S in Sigma^*$\ #v(0.2cm) $K(S)$ --- наименьшая длина программы, выводящей $S$ на пустом входе\ #v(0.2cm) $abs(K_"c++" (S) - K_"java" (S)) <= C_"c++, java" quad$\ #v(0.2cm) Можно написать на языке проргаммирования Java интерпретатор язык программирования C++\ Его размер не зависит ни от размера программы на C++, ни от $S$ --- константа\ #v(0.2cm) $K(S) quad S$ случайнвя строка длины $n$\ #v(0.2cm) $K(S) = Omega(n)$ "почти наверное"\ #v(0.2cm) $S = (01)^n quad K(S) = O(log_2 n)$ #quote("С++ плохо выбирать, потому что он такой. Немного мерзкий язык. Выберем математическую модель C++", attribution: "<NAME>", block: true) *Пример 1:*\ #v(0.2cm) Колмогоровская сложность учебника по математическому анализу меньше, чем колмогоровская сложность случайной строки. _Доказательства не будет_ \ \ Кодирование Хаффмана --- оптималльный префиксный код, независимо кодирует $forall$ символ \ \ Арифметическое кодирование ---\ #v(0.2cm) $L quad f_i$\ #v(0.2cm) $p/z^q quad q tilde.eq - L limits(sum)_(i = 1)^n f_i/L log_2 f_i/L = L dot H(f_1/L, dots , f_n/L)$ --- _энтропийный барьер_\ #v(0.2cm) Арифметическое кодироание --- оптимальный алгоритм кодирования, не учитывающего взаимного расположения символов\ #v(0.2cm) _Доказательство минимальной асимптотики алгоритма сортировки с помощью энтропийного барьера:_ \ #v(0.2cm) $h(n!) = log_2(n!) tilde.eq log_2(n^n/e^n sqrt(2 pi n)) = n dot log_2 n - n dot log_2 e + log sqrt(2 pi n) = Sigma(n dot log n)$ //ты в аудитории?
https://github.com/actions-marketplace-validations/yusancky_setup-typst
https://raw.githubusercontent.com/actions-marketplace-validations/yusancky_setup-typst/main/README.md
markdown
MIT License
# Setup Typst Setup Typst in GitHub Actions (currently only supported for Windows). ## Inputs ### `token` The token used to authenticate when fetching Typst distributions. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. ### `version` Exact version of Typst to use. ## Example usage ```yaml - uses: yusancky/[email protected] id: setup-typst with: version: 'v0.2.0' - run: typst compile file.typ ``` You can also use the additional uses given in [Usage](https://github.com/typst/typst#usage) in the Typst documentation.
https://github.com/tingerrr/anti-matter
https://raw.githubusercontent.com/tingerrr/anti-matter/main/README.md
markdown
MIT License
# anti-matter This typst packages allows you to simply mark the end and start of your front matter and back matter to change style and value of your page number without manually setting and keeping track of inner and outer page counters. ## Example ```typst #import "@preview/anti-matter:0.1.1": anti-matter, fence, set-numbering #set page("a4", height: auto) #show heading.where(level: 1): it => pagebreak(weak: true) + it #show: anti-matter #set-numbering(none) #align(center)[My Title Page] #pagebreak() #set-numbering("I") #include "front-matter.typ" #fence() #include "chapters.typ" #fence() #include "back-matter.typ" ``` ![An example outline showing the outer Roman numbering interrupted by temporary inner Arabic numbering][example] ## Features - Marking the start and end of front/back matter. - Specifying the numbering styles for each part fo the document ## FAQ 1. Why are the pages not correctly counted? - If you are setting your own page header, you must use `step`, see section II in the [manual]. 2. Why is my outline not displaying the correct numbering? - If you configure your own `outline.entry`, you must use `page-number`, see section II in the [manual]. 3. Why does my front/inner/back matter numbering start on the wrong page? - The fences must be on the last page of their respective part, if you have a `pagebreak` forcing them on the next page it will also incorrectly label that page. - Otherwise please open an issue with a minimal reproducible example. ## Etymology The package name `anti-matter` was choosen as a word play on front/back matter. ## Glossary - [front matter] - The first part of a thesis or book (intro, outline, etc.) - [back matter] - The last part of a thesis or book (bibliography, listings, acknowledgements, etc.) [front matter]: https://en.wikipedia.org/wiki/Book_design#Front_matter [back matter]: https://en.wikipedia.org/wiki/Book_design#Back_matter_(end_matter) [example]: example/example.png [manual]: docs/manual.pdf
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/delimited_06.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test manual scaling. $ lr(]sum_(x=1)^n x], size: #70%) < lr((1, 2), size: #200%) $
https://github.com/jeffa5/typst-todo
https://raw.githubusercontent.com/jeffa5/typst-todo/main/README.md
markdown
Apache License 2.0
# Typst todo Inspired by [todonotes](http://tug.ctan.org/macros/latex/contrib/todonotes/todonotes.pdf). This demonstrates some useful commands for adding todo notes to typst documents. ## Progress - [x] Inline todos - [ ] Margin todos - [x] Numbered todos - [ ] List of todos - [x] collect todos in the document (with labels) - [ ] limit text length based on current line width - [ ] get slug from types other than text - [ ] Missing figures - [x] box with text - [ ] better warning logo
https://github.com/typst-doc-cn/tutorial
https://raw.githubusercontent.com/typst-doc-cn/tutorial/main/src/intermediate/content-stateful-2.typ
typst
Apache License 2.0
#import "mod.typ": * #show: book.page.with(title: "查询文档状态 —— 制作页眉标题法一") #import "/typ/embedded-typst/lib.typ": svg-doc, default-fonts, default-cjk-fonts 本节我们讲解制作页眉标题的第一种方法,即通过查询文档状态直接估计当前页眉应当填入的内容。 // #locate(loc => query(heading, loc)) // #locate(loc => query(heading.where(level: 2), loc)) == 「locate」<grammar-locate> 有的时候我们会需要获取当前位置的「位置」信息。 在Typst中,获取「位置」的唯一方法是使用「#typst-func("locate")」函数。 #typst-func("locate")的唯一参数是一个「回调函数」,我们在上一节已经学习过这个术语。在排版阶段的过程中,一旦排版引擎为你收集到了足够的信息,就会“回过头来调用”我们传入的该函数。 我们来`repr`一下试试看: #code(```typ 当前位置的相关信息:#locate(it => repr(it)) ```) 由于「位置」太过复杂了,`repr`放弃了思考并在这里为我们放了两个点。 我们来简单学习一下Typst为我们提供了哪些位置信息: #code(```typ 当前位置的坐标:#locate(loc => loc.position()) 当前位置的页码:#locate(loc => loc.page()) ```) 或直接使用方法函数: #code(```typ 当前位置的坐标:#locate(location.position) 当前位置的页码:#locate(location.page) ```) 一个常见的问题是:为什么Typst提供给我的页码信息是「内容」,我无法在内容上做条件判断和计算!<grammar-locate-calc> #code(```typ #repr(locate(location.page)) \ #type(locate(location.page)) ```) 上面输出的内容告诉我们#typst-func("locate")不仅是一个函数,而且更是一个元素的构造函数。#typst-func("locate")构造出一个`locate`内容。 这其中的关系比较复杂。一个比较好理解的原因是:Typst会调用你的函数多次,因此你理应将所有使用「位置」信息的脚本放在一个内容块中,这样Typst才能更好地合成内容。 #code(```typ #locate(loc => [ 当前位置的页码是偶数:#calc.even(loc.page()) ]) // 根据位置信息 计算得到 我们想要的内容 ```) #pro-tip[ 这与Typst的缓存原理相关。由于#typst-func("locate")函数接收的闭包```typc loc => ..```是一个函数,且在Typst中它被认定为*纯函数*,Typst只会针对特定的参数执行一次函数。为了强制让用户书写的函数保持纯性,Typst规定用户必须在函数内部使用「位置」信息。 因此,例如我们希望在偶数页下让内容为“甲”,否则让内容为“乙”,应当这样书写: #code(```typ #locate(loc => if calc.even(loc.page()) [“甲”] else [“乙”]) ```) ] == 「query」<grammar-query> 使用「#typst-func("query")」函数你可以获得当前文档状态。 #code(```typ #locate(loc => query(heading, loc)) ```, res: raw(```typc ( heading(body: [雨滴书 v0.1.2], level: 2, ..), .., ) ```.text, lang: "typc", block: false)) 「#typst-func("query")」函数有两个参数。 第一个参数是「选择器」,很好理解。它接受一个选择器,并返回被选中的所有元素的列表。 #code(```typ #locate(loc => query(heading, loc)) ```, res: raw(```typc ( heading(body: [雨滴书 v0.1.2], level: 2, ..), heading(body: [KiraKira 样式改进], level: 3, ..), heading(body: [FuwaFuwa 脚本改进], level: 3, ..), heading(body: [雨滴书 v0.1.1], level: 2, ..), heading(body: [雨滴书 v0.1.0], level: 2, ..), ) ```.text, lang: "typc", block: false)) 我们记得,选择器允许继续指定`where`条件过滤内容: #code(```typ #locate(loc => query(heading.where(level: 2), loc)) ```, res: raw(```typc ( heading(body: [雨滴书 v0.1.2], level: 2, ..), heading(body: [雨滴书 v0.1.1], level: 2, ..), heading(body: [雨滴书 v0.1.0], level: 2, ..), ) ```.text, lang: "typc", block: false)) 第二个参数是「位置」,就比较难以理解了。首先说明,`loc`并没有任何作用,即它是一个「哑参数」(Dummy Parameter)。 如果你学过C++,以下两个方法分别匹配到前缀自增操作函数和后缀自增操作函数。 ```cpp class Integer { Integer& operator++(); // 前缀自增操作函数 Integer operator++(int); // 后缀自增操作函数 }; ``` ```cpp class Integer```类中的`int`就是一个所谓的哑参数。 「哑参数」在实际函数执行中并未被使用,而仅仅作为标记以区分函数调用。我们知道以下两点:其一,只有#typst-func("locate")函数会返回「位置」信息;其二,#typst-func("query")函数需要我们传入「位置」信息。 有了:那么Typst就是在告诉我们,#typst-func("query")函数只能在#typst-func("locate")函数内部调用。正如示例中的那样: ```typ #locate(loc => query(heading.where(level: 2), loc)) ``` 这个规则有些隐晦,并且Typst的设计者也已经注意到了这一点,所以他们正在计划改进这一点。当然在这之前,你只需要记住:#typst-func("query")函数的第二个「位置」参数用于限制该函数仅在#typst-func("locate")函数内部使用。 #pro-tip[ 这与Typst的缓存原理相关。为了加速#typst-func("query")函数,Typst需要对其缓存。Typst合理做出以下假设:在文档每处的查询(`loc`),都单独缓存对应选择器的查询结果。 更细致地描述如下:将```typc query(selector, loc)```的参数为「键」,执行结果为「值」构造一个哈希映射表。若使用`(selector, loc)`作为「键」,查询该表: + 未对应结果,则执行查询,缓存并返回结果。 + 已经存在对应结果,则不会重新执行查询,而是使用表中的值作为结果。 ] == 回顾其二 页眉的设置方法是创建一条```typc set page(header)```规则: #frames-cjk(read("./stateful/q0.typ"), code-as: ```typ #set page(header: [这是页眉]) ```) 既然如此,只需要将`[这是页眉]`替换成一个`locate`内容,就能通过#typst-func("query")函数完成与「位置」相关的页眉设定: ```typ #set page(header: locate(loc => emph( get-heading-at-page(loc)))) ``` 现在让我们来编写`get-heading-at-page`函数。 首先,通过`query`函数查询得到整个文档的*所有二级标题*: ```typc let headings = query(heading, loc). filter(it => it.level == 2) ``` 如果你熟记`where`方法,你可以更高效地做到这件事。以下函数调用也可以得到整个文档的*所有二级标题*: ```typc let headings = query(heading.where(level: 2), loc) ``` 很好,Typst文档可以很高效,但有些人写出的Typst代码天生更高效,而我们正在向他们靠近。 接着,考虑构建这样一个`fold-headings`函数,它返回一个数组,数组的内容是每个页面页眉应当显示的内容,即每页的第一个标题。 ```typ #let fold-headings(headings) = { .. } ``` 我们可以对其直接调用以测试: #code(```typ #let fold-headings(headings) = { (none, none) } #fold-headings(( (body:"v2",page:1),(body:"v1",page:1),(body:"v0",page: 2), )) ```) 很好,这样我们就可以很方便地进行测试了。 该函数首先创建一个数组,数组的长度为页面的数量。 #code(```typ #let fold-headings(headings) = { let max-page-num = calc.max(..headings.map(it => it.page)) (none, ) * max-page-num } #fold-headings(( (body:"v2",page:1),(body:"v1",page:1),(body:"v0",page: 2), )) ```) 这里,```typc headings.map(it => it.page)```意即对每个标题获取对应位置的页码;```typc calc.max(..numbers)```意即取页码的最大值。 由于示例中页码的最大值为`2`,`fold-headings`针对示例会返回一个长度为2的数组,数组的每一项都是`none`。 接着,该函数遍历给定的`headings`,对每个页码,都首先获取第一个标题元素: #code(```typc for h in headings { if first-headings.at(h.page - 1) == none { first-headings.at(h.page - 1) = h } } ```, res: eval(```typ #let fold-headings(headings) = { let max-page-num = calc.max(..headings.map(it => it.page)) let first-headings = (none, ) * max-page-num for h in headings { if first-headings.at(h.page - 1) == none { first-headings.at(h.page - 1) = h } } first-headings } #fold-headings(( (body:"v2",page:1),(body:"v1",page:1),(body:"v0",page: 2), )) ```.text, mode: "markup")) 这里,```typc first-headings.at(h.page - 1)```意即获取当前页码对应在数组中的元素;`if`语句,如果对应页码对应的元素仍是```typc none```,那么就将当前的标题元素填入对应的位置中。 同理,可以获得`last-headings`,存储每页的最后一个标题: #code(```typc let last-headings = (none, ) * max-page-num for h in headings { last-headings.at(h.page - 1) = h } ```, res: eval(```typ #let fold-headings(headings) = { let max-page-num = calc.max(..headings.map(it => it.page)) let last-headings = (none, ) * max-page-num for h in headings { last-headings.at(h.page - 1) = h } last-headings } #fold-headings(( (body:"v2",page:1),(body:"v1",page:1),(body:"v0",page: 2), )) ```.text, mode: "markup")) 这里`for`语句意即:无论如何,都将当前的标题元素存入数组中。那么每页的最后一个标题总是能被存入到数组中。 但是我们还没有考虑相邻情况。如果我们希望如果当前页面没有标题元素,则显示之前的标题。接下来我们来根据这个思路,组装正确的结果: #code(```typc let res-headings = (none, ) * max-page-num for i in range(res-headings.len()) { res-headings.at(i) = if first-headings.at(i) != none { first-headings.at(i) } else { last-headings.at(i) = last-headings.at( calc.max(0, i - 1), default: none) last-headings.at(i) } } ```, res: eval(```typ #let fold-headings(headings) = { let max-page-num = calc.max(..headings.map(it => it.page)) let first-headings = (none, ) * max-page-num let last-headings = (none, ) * max-page-num for h in headings { if first-headings.at(h.page - 1) == none { first-headings.at(h.page - 1) = h } last-headings.at(h.page - 1) = h } let res-headings = (none, ) * max-page-num for i in range(res-headings.len()) { res-headings.at(i) = if first-headings.at(i) != none { first-headings.at(i) } else { last-headings.at(i) = last-headings.at( calc.max(0, i - 1), default: none) last-headings.at(i) } } res-headings } #fold-headings(( (body:"v2",page:1),(body:"v1",page:1),(body:"v0",page: 2), )) ```.text, mode: "markup")) `res-headings`就是我们想要得到的结果。 #let fold-headings(headings) = { let max-page-num = calc.max(..headings.map(it => it.page)) let first-headings = (none, ) * max-page-num let last-headings = (none, ) * max-page-num for h in headings { if first-headings.at(h.page - 1) == none { first-headings.at(h.page - 1) = h } last-headings.at(h.page - 1) = h } let res-headings = (none, ) * max-page-num for i in range(res-headings.len()) { res-headings.at(i) = if first-headings.at(i) != none { first-headings.at(i) } else { last-headings.at(i) = last-headings.at( calc.max(0, i - 1), default: none) last-headings.at(i) } } res-headings } 由于`res-headings`的计算比较复杂,我们先来一些测试用例来理解: 情形一:假设文档的前段没有标题,该函数会将对应下标的结果置空: #code(```typ 情形一:#fold-headings(( (body:"v2",page:3),(body:"v1",page:3),(body:"v0",page: 3), )) ```, scope: (fold-headings: fold-headings)) 情形二:假设一页有多个标题,那么,对应下表的结果为该页面的首个标题: #code(```typ 情形二:#fold-headings(( (body:"v2",page:2),(body:"v1",page:2),(body:"v0",page: 3), )) ```, scope: (fold-headings: fold-headings)) 情形三:假设中间有页空缺,则对应下表的结果为前页的最后一个标题。 #code(```typ 情形三:#fold-headings(( (body:"v2",page:1),(body:"v1",page:1),(body:"v0",page: 3), )) ```, scope: (fold-headings: fold-headings)) 其中,情形一其实是情形三的特例:假设某一页没有标题,则对应下表的结果为前页的最后一个标题。如果不存在前页包含标题,则对应下表的结果为```typc none```。 于是我们可以给代码加上注释: ```typc let res-headings = (none, ) * max-page-num // 对于每一页,我们迭代下标 for i in range(res-headings.len()) { // 让对应下标的结果等于: res-headings.at(i) = { // 如果该页包含标题,则其等于该页的第一个标题 if first-headings.at(i) != none { first-headings.at(i) } else { // 否则,我们积累`last-headings`的结果 last-headings.at(i) = last-headings.at( // 始终至少等于前一页的结果 calc.max(0, i - 1), // 默认没有结果 default: none) // 其等于前页的最后一个标题 last-headings.at(i) } } } ``` 最后,我们将`query`与`fold-headings`结合起来,便得到了目标函数: ```typ #let get-heading-at-page(loc) = { let headings = fold-headings(query( heading.where(level: 2), loc)) headings.at(loc.page() - 1) } ``` 这里有一个问题,那便是`fold-headings`没有考虑标题的最后一页仍然存在内容的情况。例如第二页有最后一个标题,但是我们文档一共有三页。 重新改造一下: #let calc-headings(headings) = { let max-page-num = calc.max(..headings.map(it => it.page)) let first-headings = (none, ) * max-page-num let last-headings = (none, ) * max-page-num for h in headings { if first-headings.at(h.page - 1) == none { first-headings.at(h.page - 1) = h } last-headings.at(h.page - 1) = h } let res-headings = (none, ) * max-page-num for i in range(res-headings.len()) { res-headings.at(i) = if first-headings.at(i) != none { first-headings.at(i) } else { last-headings.at(i) = last-headings.at( calc.max(0, i - 1), default: none) last-headings.at(i) } } (res-headings, if max-page-num > 0 { last-headings.at(-1) }) } ```typ #let calc-headings(headings) = { // 计算res-headings和last-headings .. // 同时返回最后一个标题 (res-headings, if max-page-num > 0 { last-headings.at(-1) }) } ``` 我们来简单测试一下: #code(```typ 情形一:#calc-headings(( (body:"v2",page:3),(body:"v1",page:3),(body:"v0",page: 3), )).at(1) \ 情形二:#calc-headings(( (body:"v2",page:2),(body:"v1",page:2),(body:"v0",page: 3), )).at(1) \ 情形三:#calc-headings(( (body:"v2",page:1),(body:"v1",page:1),(body:"v0",page: 3), )).at(1) ```, scope: (calc-headings: calc-headings)) 很好,这样,下面的实现就完全正确了: ```typ #let get-heading-at-page(loc) = { let (headings, last-heading) = calc-headings( query(heading.where(level: 2), loc)) headings.at(loc.page() - 1, default: last-heading) } ``` #pro-tip[ 将`calc-headings`与`get-heading-at-page`分离可以改进脚本性能。这是因为Typst是以函数为粒度缓存你的计算。在最后的实现: + ```typc query(heading.where(level: 2), loc)```会被缓存,如果二级标题的结果不变,则#typst-func("query")函数不会重新执行(不会重新查询文档状态)。 + ```typc calc-headings(..)```会被缓存。如果查询的结果不变。则其不会重新执行。 ] 最后,让我们适配`calc-headings`到真实场景,并应用到页眉规则: #frames-cjk(read("./stateful/q1.typ"), code-as: ```typ // 这里有get-heading-at-page的实现.. #set page(header: locate(loc => emph( get-heading-at-page(loc)))) ```)
https://github.com/Jollywatt/typst-fletcher
https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/tests/node-label-align/test.typ
typst
MIT License
#set page(width: auto, height: auto, margin: 1em) #import "/src/exports.typ" as fletcher: diagram, node, edge #diagram( spacing: 5pt, node((0,0), [Hi], height: 15mm, stroke: 1pt + red), node((1,0), align(top)[Hi], height: 15mm, stroke: 1pt + green), node((2,0), align(bottom)[Hi], height: 15mm, stroke: 1pt + blue), node((0,1), [Hi], stroke: 1pt + red), node((1,1), align(left)[Hi], stroke: 1pt + green), node((2,1), align(right)[Hi], stroke: 1pt + blue), node((0,2), [Hi], width: 15mm, stroke: 1pt + red), node((1,2), align(left)[Hi], width: 15mm, stroke: 1pt + green), node((2,2), align(right)[Hi], width: 15mm, stroke: 1pt + blue), ) #pagebreak() #diagram( spacing: 5pt, node-fill: yellow, node((0,0), [Automatic width]), node((0,1), align(left)[Explicit width causes wrapping], width: 35mm), ) #pagebreak() #diagram( node(align(top + left, box(fill: orange)[aligned \ content]), enclose: ((0,1), (1,0)), fill: yellow, inset: 0pt), node((1,0), [node], fill: green), node((0,1), [x \ y], fill: green), ) #pagebreak() The baseline #diagram($A edge(->) & B$) should align.
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/014%20-%20Khans%20of%20Tarkir/004_Taigam's%20Scheming.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Taigam's Scheming", set_name: "Khans of Tarkir", story_date: datetime(day: 01, month: 10, year: 2014), author: "<NAME>", doc ) #emph[The man called Taigam is known as Sidisi's Hand, the personal enforcer of the Sultai khan. But Taigam was not always Sultai, and his former clanmates have not forgotten him.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The Marang River flowed through Sultai territory, deep into the jungle and around many of their most illustrious palaces. Along the river, far from these palaces, were less regal settlements—homes of farmers and fishermen, built on raised wooden stilts and platforms. Although the marshy jungle was inhospitable to most, some had found the means to make a living, but only enough to scrape by. Their stomachs were as empty as their purses, and the small town of Kishla was in debt to the Sultai. They couldn't remember if it was for taxes or outright extortion, but they knew that Sidisi's Hand was there to collect. What the town could call its leadership was a small group of men and women who only were forced to get together and congregate when dealing with the Sultai. #figure(image("004_Taigam's Scheming/01.jpg", width: 100%), caption: [Treasure Cruise | Art by Cynthia Sheppard], supplement: none, numbering: none) The vessel pulled up to the dock. It moved slowly, and the village leaders could see the ropes from the ship's bow leading into the water. The water there was shallow enough they could see the undead sibsig servants pulling the ship, some of their heads partially above the waterline. Many of them had once lived in the village they were visiting. One of the younger leaders retched off the side of the dock. The others kept their composure, having dealt with the Sultai in the past. In contrast to the sibsig, the vessel itself was opulent and covered in gold. A light breeze brought the smell of perfume and spices to the leaders. A human Sultai enforcer lowered the gangplank for the leaders to enter the ship and head belowdecks.   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)     The only sound was the clinking of coins. Taigam sat on his chair, an ornate golden throne covered in silk and pillows. He put his hand on the temple of his bald head, closing his eyes, trying to force out the sound. He used to be able to do that—focus his mind to close out all distractions, but that was when he was Jeskai. Weak, idealistic. But Taigam would easily trade strength for peace and quiet.   "Unless you've managed to pull gold from the air, I doubt there are any more or less than there have been," Taigam said, annoyed. A deep laugh bellowed next to him. "Do you not doubt that I could perform such a parlor trick?" "I wouldn't doubt that you could, only that you prefer to take from others," Taigam said, massaging his temples. Again, a deep laugh. "You'd better shake off that headache, Hand. Your public awaits." Laughter again, followed by the clinking of coins.   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)     Taigam had always craved #emph[more] . As a young man, he never knew what that meant. Growing up in a small fishing village in the shadow of the Jeskai strongholds, he had always thought that meant knowledge. That was how his father had conditioned him. With wisdom came respect, with respect would come a stable life. He had believed that fable, at least for a while. He found he was not a physical fighter, not like the other monks, but his power lay more in his mind. While others mastered pearls or mantis riding, Taigam absorbed the scrolls and the lessons of his teachers. He was still a fighter, but preferred the scrolls. He even had the honor of being trained by the khan of the Jeskai, Narset. She once confessed she regarded him as one of her most adept students. Taigam felt great pride from that comment, but realized that would be the height of what he could get from the Jeskai. Respect? Honor? All for #emph[just] a stable life?   #figure(image("004_Taigam's Scheming/02.jpg", width: 100%), caption: [Taigam's Scheming | Art by <NAME>], supplement: none, numbering: none) He didn't set out to join another clan. In fact, he had elected to follow the Way of the Wandering Warrior—or so he told Narset and the other monks he had trained with. He hoped to uncover different disciplines of magic, possibly learn different forms of fighting. Taigam travelled to Purugir, the trading post near the Salt Road, hoping to find work as either a teacher or bodyguard. He had always heard of the Sultai as decadent monsters, and although he was inclined to agree, seeing some of their nobles pass through Purugir had sparked his interest. They had rich clothes and exquisite taste. But Taigam sparked their interest as well—a Jeskai looking for work was peculiar. That night, a rakshasa visited him in the inn where he slept. The rakshasa were powerful demons, and the Sultai derived much of their power and undead from age-old deals made with them. That rakshasa, named Ebirri, wished to make Taigam a deal. In exchange for the privilege of being the knowledgeable Taigam's most humble servant, Ebirri would bring Taigam great fortune and power within the Sultai. Taigam knew he was being deceived in some fashion, but the immediate promise of power won out over his common sense. The pact was made, and in exchange for power, Taigam swore his life in service of the rakshasa. Taigam rose to chief advisor of Sidisi, the kahn of the Sultai. The brood tyrant sent Taigam to perform her decrees outside of the palace, which was a great honor, as she usually kept those she mistrusted close to her so she could be the one to end their lives. Taigam executed Sidisi's rule throughout Sultai territory, all under the watchful eye of his true master, Ebirri, who had bound himself to Taigam.   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)     The farmers stank. Not even the spices and perfumes that covered the smell of a wet sibsig could remove the stench of the peasants that stood before Taigam. They looked worried—they always looked worried—and seemed unsure if they should speak or wait for Taigam to begin the proceedings. Taigam was content with sitting back in his chair, making them squirm a little longer. These were not true Sultai. They were those who had the poor fortune of being born in Sultai territory, and although they were required to give tax and food to the Sultai, they had less value to Sidisi than a sibsig.   An older man, a rarity in these parts, stepped forward to speak, which shocked Taigam, as one didn't gain gray hair by speaking first. "My lord Taigam," he said, as he lowered his head, stepping forward to approach, "our next shipment will exceed the current quota and make up for what the last shipment lacked." The man was clearly guessing as to why the Sultai were there, and it was a good guess. Taigam was disappointed at the level-headed response. He wanted to have fun. "Why do you not kneel in the presence of your better?" Taigam asked with a smirk. The man took to a knee, and knelt. Taigam cleared his throat, and the man repositioned himself so his forehead was on the floor. The rakshasa Ebirri laughed from the shadows. "If you want him to bow any lower he should bow from below the deck." Taigam hid his anger at the comment. "How many children do you have?" The man didn't rise from his prostrate position. "Three, my lord." "Now you have two," Taigam said. He nodded to the human guard, who nodded back and left the ship.   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)     Outside, on the river, the sibsig stood in the water, tethered to Taigam's boat. Blurred figures ran fast on the water, using the sibsigs' heads as stepping stones.   As the guard sent by Taigam was exiting the ship to enact his task, half a dozen small daggers riddled his body and he fell over, dead, before he realized what had happened. The figures ran up the tethers, ready to perform their task. #figure(image("004_Taigam's Scheming/03.jpg", width: 100%), caption: [Leaping Master | Art by <NAME>ova], supplement: none, numbering: none)   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)     Taigam would not have time to revel in his cruelty. From the sides of the ship, three blurred figures flew through the windows into the room. Three human Jeskai monks stood with clenched fists. They dashed toward Taigam. The peasants ran the opposite way, heading toward the door.   "By Narset's will!" one of them shouted. Taigam moved to stand. He was able to dodge the first fist, but the second caught him in the shoulder, sending him spiraling to the floor. Rusty, but not completely out of practice, he used the momentum of the fall to send his foot out to kick the first monk in the leg near the knee, bending the monk's leg the opposite direction. The monk cried out in pain and fell over. Ebirri emerged from the shadows. One of the remaining monks threw daggers at Taigam, but the rakshasa growled in their direction and they fell to the ground as though hitting an invisible wall. Although Ebirri usually hunched over, the feline demon then stood tall, nearly hitting his head on the ceiling. Taigam pulled himself from the floor and saw a chance to free himself from the demon in the confusion. As the rakshasa willed dark magic, purple mist emanated from his eyes toward one of the monks. Taigam drew a dagger from his ankle and rushed toward the demon. Although the assassins were there to kill him, Taigam knew the greatest threat to his life had always been the rakshasa. #figure(image("004_Taigam's Scheming/04.jpg", width: 100%), caption: [Rakshasa Vizier | Art by <NAME>], supplement: none, numbering: none) The remaining monk grabbed Taigam's arm, but the Sultai spun away, tossing his dagger to his other hand and striking at the rakshasa. The dagger stuck in Ebirri's side, interrupting his concentration, and the monk who was hovering in the air, strangled by smoke, fell to the ground. Ebirri roared and backhanded both Taigam and the monk who held him. They both slammed into the wall, but the monk was not deterred. He punched Taigam in the throat, interrupting Taigam's breathing. The rakshasa grabbed the monk by his clothes and pulled him back, then grabbed his head. Ebirri crushed it, exploding brain and skull all over the cabin. The uninjured monk had recovered, but Ebirri continued his spell and choked the life from the monk with his dark magic. Taigam finally caught his breath, and the hulking rakshasa picked him up by his clothing and pulled him close, so the Sultai's face was next to his mouth. "I own you," Ebirri growled. The rakshasa dropped Taigam, who picked himself up. There was still a monk alive, but unable to move due to the damage to his leg. "Who sent you?" Taigam asked. "Narset, khan of the Jeskai," he said with contempt, cringing through the pain. "That doesn't seem like her," Taigam replied. "Are you saying she sent you, or that you act in her name?" The monk didn't reply. Taigam nodded to Ebirri, and the rakshasa stepped on the monk's chest, crushing him. "Do you think the Jeskai khan meant to end you with assassins?" Ebirri asked. "No," Taigam said. "They were zealots, most likely acting without her knowledge. I'm sure there are still many among the Jeskai who would like to see a mistake like me removed from the picture. Still, things have been escalating lately, so I can't be sure dear old Narset hasn't finally become more of a threat. I'll take care of it." Ebirri growled. "I'll take care of it," Taigam restated, more forceful. Ebirri didn't reply, but returned to the shadows. Taigam signaled the sibsig to keep the boat moving as he began to size the intact dead monks for golden uniforms.
https://github.com/Isaac-Fate/booxtyp
https://raw.githubusercontent.com/Isaac-Fate/booxtyp/master/src/theorems/mod.typ
typst
Apache License 2.0
#import "theorem.typ": theorem #import "definition.typ": definition #import "proposition.typ": proposition #import "lemma.typ": lemma #import "corollary.typ": corollary #import "proof.typ": proof #import "solution.typ": solution #import "example.typ": example #import "exercise.typ": exercise #import "note.typ": note #let theorem-rules(body) = { show figure.where(kind: "Theorem"): it => it.body show figure.where(kind: "Proposition"): it => it.body show figure.where(kind: "Lemma"): it => it.body show figure.where(kind: "Corollary"): it => it.body show figure.where(kind: "Definition"): it => it.body show figure.where(kind: "Example"): it => it.body show figure.where(kind: "Exercise"): it => it.body show figure.where(kind: "Note"): it => it.body // The rest of the document body }
https://github.com/jamesrswift/ionio-illustrate
https://raw.githubusercontent.com/jamesrswift/ionio-illustrate/main/gallery/isobulelene_epoxide.typ
typst
MIT License
#set par(justify: true) #set page(width: auto, height: auto, margin:1em) #set text(size: 7pt) #import "../src/lib.typ": * #let data = csv("../assets/isobutelene_epoxide.csv") #let massspec = data.slice(1) #let ms = mass-spectrum(massspec, args: (range: (0,100),)) #(ms.display)()
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/semantic_tokens/for-loop.typ
typst
Apache License 2.0
#for i in range(0) { i += 1 }
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/docs/tutorial/3-advanced.md
markdown
Apache License 2.0
--- description: Typst's tutorial. --- # Advanced Styling In the previous two chapters of this tutorial, you have learned how to write a document in Typst and how to change its formatting. The report you wrote throughout the last two chapters got a straight A and your supervisor wants to base a conference paper on it! The report will of course have to comply with the conference's style guide. Let's see how we can achieve that. Before we start, let's create a team, invite your supervisor and add them to the team. You can do this by going back to the app dashboard with the four-circles icon in the top left corner of the editor. Then, choose the plus icon in the left toolbar and create a team. Finally, click on the new team and go to its settings by clicking 'manage team' next to the team name. Now you can invite your supervisor by email. ![The team settings](3-advanced-team-settings.png) Next, move your project into the team: Open it, going to its settings by choosing the gear icon in the left toolbar and selecting your new team from the owners dropdown. Don't forget to save your changes! Now, your supervisor can also edit the project and you can both see the changes in real time. You can join our [Discord server](https://discord.gg/2uDybryKPe) to find other users and try teams with them! ## The conference guidelines { #guidelines } The layout guidelines are available on the conference website. Let's take a look at them: - The font should be an 11pt serif font - The title should be in 17pt and bold - The paper contains a single-column abstract and two-column main text - The abstract should be centered - The main text should be justified - First level section headings should be 13pt, centered, and rendered in small capitals - Second level headings are run-ins, italicized and have the same size as the body text - Finally, the pages should be US letter sized, numbered in the center of the footer and the top right corner of each page should contain the title of the paper We already know how to do many of these things, but for some of them, we'll need to learn some new tricks. ## Writing the right set rules { #set-rules } Let's start by writing some set rules for the document. ```example #set page( >>> margin: auto, paper: "us-letter", header: align(right)[ A fluid dynamic model for glacier flow ], numbering: "1", ) #set par(justify: true) #set text( font: "Linux Libertine", size: 11pt, ) #lorem(600) ``` You are already familiar with most of what is going on here. We set the text size to `{11pt}` and the font to Linux Libertine. We also enable paragraph justification and set the page size to US letter. The `header` argument is new: With it, we can provide content to fill the top margin of every page. In the header, we specify our paper's title as requested by the conference style guide. We use the `align` function to align the text to the right. Last but not least is the `numbering` argument. Here, we can provide a [numbering pattern]($numbering) that defines how to number the pages. By setting into to `{"1"}`, Typst only displays the bare page number. Setting it to `{"(1/1)"}` would have displayed the current page and total number of pages surrounded by parentheses. And we could even have provided a completely custom function here to format things to our liking. ## Creating a title and abstract { #title-and-abstract } Now, let's add a title and an abstract. We'll start with the title. We center align it and increase its font weight by enclosing it in `[*stars*]`. ```example >>> #set page(width: 300pt, margin: 30pt) >>> #set text(font: "Linux Libertine", 11pt) #align(center, text(17pt)[ *A fluid dynamic model for glacier flow* ]) ``` This looks right. We used the `text` function to override the previous text set rule locally, increasing the size to 17pt for the function's argument. Let's also add the author list: Since we are writing this paper together with our supervisor, we'll add our own and their name. ```example >>> #set page(width: 300pt, margin: 30pt) >>> #set text(font: "Linux Libertine", 11pt) >>> >>> #align(center, text(17pt)[ >>> *A fluid dynamic model >>> for glacier flow* >>> ]) #grid( columns: (1fr, 1fr), align(center)[ <NAME> \ Artos Institute \ #link("mailto:<EMAIL>") ], align(center)[ Dr. <NAME> \ Artos Institute \ #link("mailto:<EMAIL>") ] ) ``` The two author blocks are laid out next to each other. We use the [`grid`]($grid) function to create this layout. With a grid, we can control exactly how large each column is and which content goes into which cell. The `columns` argument takes an array of [relative lengths]($relative) or [fractions]($fraction). In this case, we passed it two equal fractional sizes, telling it to split the available space into two equal columns. We then passed two content arguments to the grid function. The first with our own details, and the second with our supervisors'. We again use the `align` function to center the content within the column. The grid takes an arbitrary number of content arguments specifying the cells. Rows are added automatically, but they can also be manually sized with the `rows` argument. Now, let's add the abstract. Remember that the conference wants the abstract to be set ragged and centered. ```example:0,0,612,317.5 >>> #set text(font: "Linux Libertine", 11pt) >>> #set par(justify: true) >>> #set page( >>> "us-letter", >>> margin: auto, >>> header: align(right + horizon)[ >>> A fluid dynamic model for >>> glacier flow >>> ], >>> numbering: "1", >>> ) >>> >>> #align(center, text(17pt)[ >>> *A fluid dynamic model >>> for glacier flow* >>> ]) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> align(center)[ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> align(center)[ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> <<< ... #align(center)[ #set par(justify: false) *Abstract* \ #lorem(80) ] >>> #lorem(600) ``` Well done! One notable thing is that we used a set rule within the content argument of `align` to turn off justification for the abstract. This does not affect the remainder of the document even though it was specified after the first set rule because content blocks _scope_ styling. Anything set within a content block will only affect the content within that block. Another tweak could be to save the paper title in a variable, so that we do not have to type it twice, for header and title. We can do that with the `{let}` keyword: ```example:single #let title = [ A fluid dynamic model for glacier flow ] <<< ... >>> #set text(font: "Linux Libertine", 11pt) >>> #set par(justify: true) #set page( >>> "us-letter", >>> margin: auto, header: align( right + horizon, title ), <<< ... >>> numbering: "1", ) #align(center, text(17pt)[ *#title* ]) <<< ... >>> #grid( >>> columns: (1fr, 1fr), >>> align(center)[ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> align(center)[ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> >>> #align(center)[ >>> #set par(justify: false) >>> *Abstract* \ >>> #lorem(80) >>> ] >>> >>> #lorem(600) ``` After we bound the content to the `title` variable, we can use it in functions and also within markup (prefixed by `#`, like functions). This way, if we decide on another title, we can easily change it in one place. ## Adding columns and headings { #columns-and-headings } The paper above unfortunately looks like a wall of lead. To fix that, let's add some headings and switch our paper to a two-column layout. The [`columns`]($columns) function takes a number and content, and layouts the content into the specified number of columns. Since we want everything after the abstract to be in two columns, we need to apply the column function to our whole document. Instead of wrapping the whole document in a giant function call, we can use an "everything" show rule. To write such a show rule, put a colon directly behind the show keyword and then provide a function. This function is given the rest of the document as a parameter. We have called the parameter `rest` here, but you are free to choose any name. The function can then do anything with this content. In our case, it passes it on to the `columns` function. ```example:single >>> #let title = [ >>> A fluid dynamic model >>> for glacier flow >>> ] >>> >>> #set text(font: "Linux Libertine", 11pt) >>> #set par(justify: true) >>> #set page( >>> "us-letter", >>> margin: auto, >>> header: align( >>> right + horizon, >>> title >>> ), >>> numbering: "1", >>> ) >>> >>> #align(center, text( >>> 17pt, >>> weight: "bold", >>> title, >>> )) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> align(center)[ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> align(center)[ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> >>> #align(center)[ >>> #set par(justify: false) >>> *Abstract* \ >>> #lorem(80) >>> ] >>> #v(4mm) <<< ... #show: rest => columns(2, rest) = Introduction #lorem(300) = Related Work #lorem(200) ``` Now there is only one thing left to do: Style our headings. We need to make them centered and use small capitals. Because the `heading` function does not offer a way to set any of that, we need to write our own heading show rule. ```example:50,250,265,270 >>> #let title = [ >>> A fluid dynamic model >>> for glacier flow >>> ] >>> >>> #set text(font: "Linux Libertine", 11pt) >>> #set par(justify: true) >>> #set page( >>> "us-letter", >>> margin: auto, >>> header: align( >>> right + horizon, >>> title >>> ), >>> numbering: "1", >>> ) #show heading: it => [ #set align(center) #set text(12pt, weight: "regular") #block(smallcaps(it.body)) ] <<< ... >>> >>> #align(center, text( >>> 17pt, >>> weight: "bold", >>> title, >>> )) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> align(center)[ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> align(center)[ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> >>> #align(center)[ >>> #set par(justify: false) >>> *Abstract* \ >>> #lorem(80) >>> ] >>> >>> #v(4mm) >>> #show: rest => columns(2, rest) >>> >>> = Introduction >>> #lorem(35) >>> >>> == Motivation >>> #lorem(45) ``` This looks great! We used a show rule that applies to all headings. We give it a function that gets passed the heading as a parameter. That parameter can be used as content but it also has some fields like `title`, `numbers`, and `level` from which we can compose a custom look. Here, we are center-aligning, setting the font weight to `{"regular"}` because headings are bold by default, and use the [`smallcaps`]($smallcaps) function to render the heading's title in small capitals. The only remaining problem is that all headings look the same now. The "Motivation" and "Problem Statement" subsections ought to be italic run in headers, but right now, they look indistinguishable from the section headings. We can fix that by using a `where` selector on our set rule: This is a [method]($scripting/#methods) we can call on headings (and other elements) that allows us to filter them by their level. We can use it to differentiate between section and subsection headings: ```example:50,250,265,245 >>> #let title = [ >>> A fluid dynamic model >>> for glacier flow >>> ] >>> >>> #set text(font: "Linux Libertine", 11pt) >>> #set par(justify: true) >>> #set page( >>> "us-letter", >>> margin: auto, >>> header: align( >>> right + horizon, >>> title >>> ), >>> numbering: "1", >>> ) >>> #show heading.where( level: 1 ): it => block(width: 100%)[ #set align(center) #set text(12pt, weight: "regular") #smallcaps(it.body) ] #show heading.where( level: 2 ): it => text( size: 11pt, weight: "regular", style: "italic", it.body + [.], ) >>> >>> #align(center, text( >>> 17pt, >>> weight: "bold", >>> title, >>> )) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> align(center)[ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> align(center)[ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> >>> #align(center)[ >>> #set par(justify: false) >>> *Abstract* \ >>> #lorem(80) >>> ] >>> >>> #v(4mm) >>> #show: rest => columns(2, rest) >>> >>> = Introduction >>> #lorem(35) >>> >>> == Motivation >>> #lorem(45) ``` This looks great! We wrote two show rules that each selectively apply to the first and second level headings. We used a `where` selector to filter the headings by their level. We then rendered the subsection headings as run-ins. We also automatically add a period to the end of the subsection headings. Let's review the conference's style guide: - The font should be an 11pt serif font ✓ - The title should be in 17pt and bold ✓ - The paper contains a single-column abstract and two-column main text ✓ - The abstract should be centered ✓ - The main text should be justified ✓ - First level section headings should be centered, rendered in small caps and in 13pt ✓ - Second level headings are run-ins, italicized and have the same size as the body text ✓ - Finally, the pages should be US letter sized, numbered in the center and the top right corner of each page should contain the title of the paper ✓ We are now in compliance with all of these styles and can submit the paper to the conference! The finished paper looks like this: <img src="3-advanced-paper.png" alt="The finished paper" style="box-shadow: 0 4px 12px rgb(89 85 101 / 20%); width: 500px; max-width: 100%; display: block; margin: 24px auto;" > ## Review You have now learned how to create headers and footers, how to use functions and scopes to locally override styles, how to create more complex layouts with the [`grid`]($grid) function and how to write show rules for individual functions, and the whole document. You also learned how to use the [`where` selector]($styling/#show-rules) to filter the headings by their level. The paper was a great success! You've met a lot of like-minded researchers at the conference and are planning a project which you hope to publish at the same venue next year. You'll need to write a new paper using the same style guide though, so maybe now you want to create a time-saving template for you and your team? In the next section, we will learn how to create templates that can be reused in multiple documents. This is a more advanced topic, so feel free to come back to it later if you don't feel up to it right now.
https://github.com/RafDevX/distinction-cybsoc
https://raw.githubusercontent.com/RafDevX/distinction-cybsoc/master/mod2-vulnerabilities-in-the-use-of-systems/analysis.typ
typst
#let title = [Equifax Data Breach: Incentives Analysis] #let kthblue = rgb("#004791") #set page("a4", header: { set text(10pt) smallcaps[#title] h(1fr) smallcaps[DD2510 - Module 2] line(length: 100%, stroke: 0.5pt + rgb("#888")) }, footer: { set text(10pt) line(length: 100%, stroke: 0.5pt + rgb("#888")) smallcaps[R<NAME> e Oliveira] h(1fr) [Page ] counter(page).display("1 of 1", both: true) }) #set par(justify: true) #align(center)[ = #underline(title) == DD2510 Cybersecurity in a Socio-Technical Context === Module 2: Vulnerabilities in the Use of Systems ==== #smallcaps(text(fill: kthblue, [KTH Royal Institute of Technology, november 2023])) #v(7pt) *<NAME> (#link("mailto:<EMAIL>", "<EMAIL>"))* #line(length: 60%, stroke: 1.5pt + black) #v(7pt) ] _*Equifax Inc.*_ is one of the largest consumer credit reporting agencies in the world @equifax-annual-report-2022, with their entire business model relying on them owning an enormous trove of personal information with which they can advise banks and other financial institutions on the credit risk and worthiness of specific consumers. As such, it should come as no surprise that Equifax is a prime target for attackers wishing to access the information they own, especially for nefarious purposes --- and, indeed, hackers managed to do so in a 2017 cyber incident that compromised the private records of 147.9 million Americans, 15.2 million British citizens, and 19 000 Canadians. Equifax has been widely criticized for their handling of the situation, both in terms of insufficient preventive efforts and in relation to their incident response. Regarding the former, although an urgent security patch (fixing the critical vulnerability that would eventually be used as an entry-point into Equifax's network) was released by Apache on March 7#super[th] @apache-release and an Equifax employee was instructed to apply it on the 9#super[th], they did not do so and no one noticed. Moreover, on the 15#super[th], Equifax ran several scans in order to identify vulnerable systems, but the scans were not working properly and although there were multiple such vulnerable systems, none was flagged or patched. Equifax also had tools to inspect encrypted traffic, but they did not work because a necessary certificate had been expired for almost a year without anyone noticing @cso-faq. Additionally, at the same time, the company's relationship with their security consulting firm _Mandiant_ soured (after Mandiant warned Equifax about multiple unpatched and misconfigured systems), which gave the hackers leeway to explore the network and compromise it further over the course of several months, during which they were completely undetected @bloomberg-state-sponsored. In light of all this, the FTC claimed Equifax failed to implement basic security measures @ftc-settlement. This behavior suggests that Equifax perhaps did not take security seriously enough, down-playing it and not expressing sufficient concern over it. It seems likely that this would be the result of misaligned incentives, with top management believing that prioritizing the business aspects over information security would lead to the best results for the company, especially from a financial point of view. Such a situation is common, with top managers often failing to see the benefits that would arise from a proper security posture (and the sizeable investment that it necessary entails). This may be because they are not sufficiently well-informed of the risks, because they have personal biases that shield them from accepting and fully believing the veracity and magnitude of these risks, or because there truly are not enough socio-economical incentives to justify it. Though before this incident Equifax might have lacked some of the incentives to adopt a more proactive cybersecurity posture, it seems now that this attack proved to be a very costly wake-up call, with the company having to spend over \$1.38 billion in fines and consumer compensation @cso-faq, despite being covered by cyber insurance. Now realizing the great monetary incentive behind security, the company announced that they have spent over \$1.5 billion in incident response and upgrading their technical infrastructure @reuters-fine, with major changes related to new technology and data security @bis-breach-cost. This is likely to be an indicator that the credit reporting giant has re-considered their priorities and incentives (in this case, financial), coming to the conclusion that security is more important than they had previously judged it. There are, however, other types of incentives besides financial ones, or at least entirely financial in nature. In this case, there is no doubt that Equifax's public image as a custodian of personal information was impacted by this incident @equifax-annual-report-2022, with their stock price dropping almost 14% in just the first day of the breach being disclosed (on the 8#super[th] of September 2017, more than a month after being discovered on the 29#super[th] of July when the expired Intrusion Detection System certificate was finally renewed). Several security experts and business analysts have publicly shamed the company, promoting generalized distrust from both individuals and financial institutions (Equifax's most important customers) @wired-response. The arguably most relevant point to consider, though, is that cyber incidents such as this one can have quite unfavorable effects for society as a whole (i.e., they cause negative externalities), which makes it a prime target for state regulation in the interest of minimizing the risk and consequences for the general population. If there is a strong regulatory force requiring companies to follow best practices, maintain their systems' security, and responsibly disclose any vulnerabilities discovered, that can prove to be a very powerful incentive for them to give sufficient note to the matter of security. This is most effective when it is clear that regulations will be enforced and any violations will result in severe consequences for the violator, therefore forcing top managers to consider this incentive to an investment in security. Another possible approach would be to offer positive incentives to those that follow the regulations and show a stellar behavior in their preventive and post-incident handling, which could come in the form of tax benefits, legal protections, and priority in procurement calls for public contractors. If regulations are strengthened in this fashion, with significant punishments for companies that fail to patch known vulnerabilities (especially critical ones), and otherwise relevant benefits if they do patch them, that would most likely provide sufficient incentives for companies to do so and prevent similar (somewhat negligence-driven) incidents from happening in the future. Requirements on disclosure deadlines can also help minimize consequences for affected third parties: for example, in this case, consumers should have been notified as soon as possible so they could have immediately taken appropriate protective measures (such as requesting a credit block to prevent identity fraud). Evidently there can be challenges involved, such as difficulty to implement and enforce this sort of regulations due to industry push-back (as it goes against their current incentives to maximize short-term financial gains), and it is overall difficult to strike a balance between proper security and undue burden on businesses --- but if implemented correctly, this can have very noticeable effects. Of course, the context surrounding Equifax in 2017 (and before then) was not devoid of regulation, or they would not have had to pay several hundred million USD in fines and then consumer compensation funding on top of that, but it is clear that the regulatory incentives were not sufficient to warrant the desired consideration prior to the incident actually taking place. This may simply have been because top managers did not grasp the potential magnitude of the consequences, but offering positive regulatory incentives is more likely to be well-perceived and has more certainty associated, which is a relevant factor when companies must at all times balance contradicting forces (in this case, desirable security brings undesirable expenses, which could be offset by near-guaranteed regulatory benefits). In conclusion, the Equifax 2017 data breach cyber incident serves as a stark reminder of the critical importance of cybersecurity, particularly in industries that handle such vast amounts of personal data. The lax approach to security demonstrated by the credit reporting agency can be attributed to a possible misalignment of socio-economical incentives or a (perceived) lack of sufficient strength in them to encourage behaviors beneficial to society, but Equifax's shift in attitude after suffering the consequences of such a major incident shows newfound recognition of the importance of a proper security posture. A solution for this could be strengthening regulatory measures to encourage security proactivity and responsibility industry-wide, despite the resistance that such measures' implementation process might encounter. In particular, focusing on providing positive incentives might yield better results. #pagebreak() #bibliography("references.yml", title: "References")
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/acrotastic/0.1.0/acrotastic.typ
typst
Apache License 2.0
// Acronym package for Typst // Author: Julian #let prefix = "acronym-state-" #let acros = state("acronyms", none) #let init-acronyms(acronyms) = { acros.update(acronyms) } // Reset a specific acronym. It will be expanded on next use. #let reset-acronym(acr) = { state(prefix + acr, false).update(false) } // Reset all acronyms. They will all be expanded on the next use. #let reset-all-acronyms() = { state("acronyms",none).display(acronyms => for acr in acronyms.keys() {reset-acronym(acr)} ) } // Check if an acronym exists #let is-valid(acr) = { acros.display(acronyms => { if acr not in acronyms { panic(acr + " is not a key in the acronyms dictionary.") return false } }) return true } // Display acronym as clickable link #let display-link(acr, text) = { if is-valid(acr) {link(label(acr), text)} } // Display acronym #let display(acr, text, link: true) = { if link {display-link(acr, text)} else {text} } // Display acronym in short form. #let acrs(acr, plural: false, link: true) = { if plural {display(acr, acr + "s", link: link)} else {display(acr, acr, link: link)} } // Display acronym in short plural form #let acrspl(acr, link: true) = {acrs(acr, plural: true, link: link)} // Display acronym in long form. #let acrl(acr, plural: false, link: true) = { acros.display(acronyms => { if is-valid(acr) { let defs = acronyms.at(acr) if type(defs) == "string" { if plural { display(acr, defs + "s", link: link) } else { display(acr, defs, link: link) } } else if type(defs) == "array" { if defs.len() == 0 { panic("No definitions found for acronym " + acr + ". Make sure it is defined in the dictionary passed to #init-acronyms(dict)") } if plural { if defs.len() == 1 { display(acr, defs.at(0) + "s", link: link) } else if defs.len() == 2 { display(acr, defs.at(1), link: link) } else { panic("Definitions should be arrays of one or two strings. Definition of " + acr + " is: " + type(defs)) } } else { display(acr, defs.at(0), link: link) } } else { panic("Definitions should be arrays of one or two strings. Definition of " + acr + " is: " + type(defs)) } } }) } // Display acronym in long plural form. #let acrlpl(acr, link: true) = {acrl(acr, plural: true, link: link)} // Display acronym for the first time. #let acrf(acr, plural: false, link: true) = { if plural { display(acr, [#acrlpl(acr) (#acr\s)], link: link) } else { display(acr, [#acrl(acr) (#acr)], link: link) } state(prefix + acr, false).update(true) } // Display acronym in plural form for the first time. #let acrfpl(acr, link: true) = {acrf(acr, plural: true, link: link)} // Display acronym. Expands it if used for the first time. #let acr(acr, plural: false, link: true) = { state(prefix + acr, false).display(seen => { if seen { if plural {acrspl(acr, link: link)} else {acrs(acr, link: link)} } else { if plural {acrfpl(acr, link: link)} else {acrf(acr, link: link)} } }) } // Display acronym in the plural form. Expands it if used for the first time. #let acrpl(acronym, link: true) = {acr(acronym, plural: true, link: link)} // Print an index of all the acronyms and their definitions. #let print-index(title: "List of Abbreviations", sorted: "up", delimiter: ":", acr-col-size: 20%, level: 1) = { assert(sorted in ("keep","up","down"), message:"Sorted must be a string either \"keep\", \"up\" or \"down\"") if title != "" {heading(level: level, outlined: outlined)[#title]} acros.display(acronyms=>{ let acr-list = acronyms.keys() if sorted == "up" { acr-list = acr-list.sorted() } else if sorted == "down" { acr-list = acr-list.sorted().rev() } for acr in acr-list{ table( columns: (acr-col-size,100%-acr-col-size), stroke:none, inset: 0pt, [*#acr#label(acr)#delimiter*], [#acrl(acr, link: false)] ) } }) }
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-08.typ
typst
Other
// Test the `even` and `odd` functions. #test(calc.even(2), true) #test(calc.odd(2), false) #test(calc.odd(-1), true) #test(calc.even(-11), false)
https://github.com/fenjalien/metro
https://raw.githubusercontent.com/fenjalien/metro/main/src/impl/qty.typ
typst
Apache License 2.0
#import "num/num.typ": num #import "unit.typ": unit as unit_ #import "/src/utils.typ": combine-dict #let default-options = ( allow-quantity-breaks: false, quantity-product: sym.space.thin, separate-uncertainty: "bracket", ) #let get-options(options) = combine-dict(options, default-options) #let qty( number, unit, e: none, pm: none, pw: none, options ) = { options = get-options(options) let result = { let u = unit_( unit, options ) num( number, exponent: e, uncertainty: pm, power: pw, options + ( separate-uncertainty-unit: if options.separate-uncertainty == "repeat" { u } ) ) u } return if options.allow-quantity-breaks { result } else { box(result) } }
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/project_documentation/content/introduction.typ
typst
= Introduction This document contains the project documentation for the VisualFP project.
https://github.com/ryuryu-ymj/mannot
https://raw.githubusercontent.com/ryuryu-ymj/mannot/main/examples/usage5.typ
typst
MIT License
#import "/src/lib.typ": * #set page(width: auto, height: auto, margin: (x: 4cm, y: 1cm), fill: white) #set text(24pt) #show: mannot-init #let rmark = mark.with(color: red) #let gmark = mark.with(color: green) #let bmark = mark.with(color: blue) $ integral_rmark(0, tag: #<i0>)^bmark(1, tag: #<i1>) mark(x^2 + 1, tag: #<i2>) dif gmark(x, tag: #<i3>) #annot(<i0>)[Begin] #annot(<i1>, pos: top)[End] #annot(<i2>, pos: top + right)[Integrand] #annot(<i3>, pos: right, yshift: .6em)[Variable] $
https://github.com/TechnoElf/mqt-qcec-diff-thesis
https://raw.githubusercontent.com/TechnoElf/mqt-qcec-diff-thesis/main/template/title.typ
typst
#import "colour.typ": * #let title_page( title: "", author: "", chair: "", school: "", degree: "", examiner: "", supervisor: "", submitted: "" ) = { page( paper: "a4", margin: ( top: 5cm, bottom: 3cm, x: 2cm, ), header: [ #grid( columns: (1fr, 1fr), rows: (auto), text( fill: tum_blue, size: 8pt, font: "TUM Neue Helvetica", [#chair \ #school \ Technical University of Munich] ), align(bottom + right, image("resources/TUM_Logo_blau.svg", height: 30%)) ) ], footer: [] )[ #set text( font: "TUM Neue Helvetica", size: 10pt ) #v(1cm) #set align(top + left) #text(size: 24pt, [*#title*]) #v(3cm) #text(fill: tum_blue, size: 17pt, [*#author*]) #v(3cm) Thesis for the attainment of the academic degree #v(1em) *#degree* #v(1em) at the #school of the Technical University of Munich. #v(3cm) *Examiner:*\ #examiner #v(0em) *Supervisor:*\ #supervisor #v(0em) *Submitted:*\ Munich, #submitted ] pagebreak() }
https://github.com/MLAkainu/Network-Comuter-Report
https://raw.githubusercontent.com/MLAkainu/Network-Comuter-Report/main/components/cover.typ
typst
Apache License 2.0
#import "../metadata.typ": meta #stack( dir: ttb, { set align(center) show text: it => upper(it) stack( dir: ttb, spacing: 1.2em, [Đại học Quốc gia Thành phố <NAME>], [Trường Đại học Bách Khoa], text(weight: "bold")[Khoa Khoa học và Kỹ thuật Máy tính] ) }, 1.5cm, align(center, image("./assets/hcmut.jpg", height: 3cm)), 1.5cm, stack( dir: ttb, text(weight: "bold", size: 15pt)[ #meta.course-name - #meta.course-id ], 1cm, block(width: 100%, inset: (y: 2em), stroke: (y: 1pt))[ #set text(weight: "bold", size: 14pt) Báo cáo #set align(center) #set par(leading: 1em) #set text(size: 18pt) #upper(meta.title) ] ), 1cm, grid( columns: (1fr, 1fr), rows: (2em, auto), column-gutter: .5cm, align(right, text(style: "italic")[Giảng viên hướng dẫn:]), meta.advisor, align(right, text(style: "italic")[Sinh viên thực hiện:]), stack( dir: ttb, spacing: 1em, ..meta.students.pairs().map((pair) => [#pair.at(0) - #pair.at(1)]) ), ), 1fr, align(center)[TP. <NAME>, #meta.date] )
https://github.com/ClazyChen/Table-Tennis-Rankings
https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2012/MS-05.typ
typst
#set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (1 - 32)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [1], [MA Long], [CHN], [3467], [2], [ZHANG Jike], [CHN], [3335], [3], [XU Xin], [CHN], [3228], [4], [WANG Hao], [CHN], [3202], [5], [BOLL Timo], [GER], [3182], [6], [MA Lin], [CHN], [3116], [7], [NIWA Koki], [JPN], [3101], [8], [WANG Liqin], [CHN], [3098], [9], [CHEN Qi], [CHN], [3012], [10], [OVTCHAROV Dimitrij], [GER], [2992], [11], [HAO Shuai], [CHN], [2952], [12], [OH Sangeun], [KOR], [2932], [13], [JIANG Tianyi], [HKG], [2929], [14], [CHUANG Chih-Yuan], [TPE], [2893], [15], [RYU Seungmin], [KOR], [2892], [16], [MIZUTANI Jun], [JPN], [2882], [17], [JOO Saehyuk], [KOR], [2877], [18], [<NAME>], [ROU], [2876], [19], [SAMSONOV Vladimir], [BLR], [2867], [20], [ALAMIYAN Noshad], [IRI], [2866], [21], [LEE Jungwoo], [KOR], [2855], [22], [<NAME>], [SLO], [2838], [23], [<NAME>], [CHN], [2835], [24], [<NAME>], [AUT], [2829], [25], [<NAME>], [SGP], [2822], [26], [<NAME>], [GER], [2817], [27], [<NAME>], [FRA], [2813], [28], [<NAME>], [GRE], [2808], [29], [<NAME>], [GER], [2799], [30], [<NAME>], [AUT], [2798], [31], [<NAME>], [DEN], [2783], [32], [KISHIKAWA Seiya], [JPN], [2767], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (33 - 64)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [33], [<NAME>], [KOR], [2751], [34], [LUNDQVIST Jens], [SWE], [2738], [35], [KARAKASEVIC Aleksandar], [SRB], [2730], [36], [<NAME>], [CHN], [2730], [37], [<NAME>], [SGP], [2721], [38], [<NAME>], [DOM], [2717], [39], [SKACHKOV Kirill], [RUS], [2715], [40], [<NAME>], [PRK], [2712], [41], [LIVENTSOV Alexey], [RUS], [2707], [42], [YOSHIM<NAME>], [JPN], [2703], [43], [<NAME>], [HKG], [2694], [44], [FREITAS Marcos], [POR], [2693], [45], [<NAME>], [JPN], [2693], [46], [<NAME>], [POR], [2692], [47], [MATSUDAIRA Kenji], [JPN], [2683], [48], [<NAME>], [AUT], [2672], [49], [#text(gray, "<NAME>")], [HKG], [2668], [50], [<NAME>], [BLR], [2666], [51], [<NAME>], [KOR], [2663], [52], [MATSUDAIRA Kenta], [JPN], [2656], [53], [<NAME>], [POR], [2656], [54], [<NAME>], [KOR], [2652], [55], [KIM Hy<NAME>], [PRK], [2646], [56], [<NAME>], [CAN], [2645], [57], [<NAME>], [IND], [2643], [58], [PATTANTYUS Adam], [HUN], [2639], [59], [<NAME>], [GER], [2638], [60], [GERELL Par], [SWE], [2637], [61], [FRANZISKA Patrick], [GER], [2634], [62], [TAKAKIWA Taku], [JPN], [2634], [63], [JEONG Sangeun], [KOR], [2628], [64], [VANG Bora], [TUR], [2626], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (65 - 96)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [65], [JEOUNG Youngsik], [KOR], [2615], [66], [#text(gray, "RUBTSOV Igor")], [RUS], [2614], [67], [<NAME>], [ITA], [2612], [68], [<NAME>], [FRA], [2610], [69], [<NAME>], [CHN], [2610], [70], [<NAME>], [AUT], [2602], [71], [<NAME>], [KOR], [2601], [72], [SMIRNOV Alexey], [RUS], [2601], [73], [<NAME>], [JPN], [2598], [74], [<NAME>], [BEL], [2596], [75], [<NAME>], [IND], [2593], [76], [<NAME>], [HKG], [2591], [77], [<NAME>], [SGP], [2589], [78], [<NAME>], [GER], [2589], [79], [<NAME>], [BRA], [2589], [80], [<NAME>], [ENG], [2583], [81], [<NAME>], [PAR], [2582], [82], [<NAME>], [CHN], [2577], [83], [<NAME>], [ESP], [2576], [84], [<NAME>], [CUB], [2575], [85], [<NAME>], [CRO], [2572], [86], [<NAME>], [CRO], [2572], [87], [<NAME>], [ENG], [2570], [88], [<NAME>-An], [TPE], [2568], [89], [<NAME>], [AUS], [2567], [90], [<NAME>], [HKG], [2564], [91], [#text(gray, "<NAME>")], [CHN], [2563], [92], [<NAME>], [HUN], [2561], [93], [SHIBAEV Alexander], [RUS], [2558], [94], [<NAME>], [EGY], [2558], [95], [KREANGA Kalinikos], [GRE], [2557], [96], [JEVTOVIC Marko], [SRB], [2557], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Men's Singles (97 - 128)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [97], [GOLOVANOV Stanislav], [BUL], [2554], [98], [PROKOPCOV Dmitrij], [CZE], [2550], [99], [WU Chih-Chi], [TPE], [2548], [100], [KOU Lei], [UKR], [2548], [101], [<NAME>], [POL], [2547], [102], [<NAME>], [FRA], [2546], [103], [<NAME>], [POL], [2544], [104], [BURGIS Matiss], [LAT], [2542], [105], [ZHMUDENKO Yaroslav], [UKR], [2541], [106], [CHEUNG Yuk], [HKG], [2540], [107], [<NAME>], [IND], [2539], [108], [<NAME>], [MEX], [2536], [109], [<NAME>], [TUR], [2535], [110], [<NAME>], [QAT], [2531], [111], [<NAME>], [PRK], [2527], [112], [<NAME>], [JPN], [2523], [113], [<NAME>], [ROU], [2522], [114], [<NAME>], [CRO], [2522], [115], [<NAME>], [HUN], [2517], [116], [<NAME>], [POL], [2517], [117], [<NAME>], [KOR], [2516], [118], [<NAME>], [UKR], [2510], [119], [<NAME>], [CRO], [2509], [120], [<NAME>], [SWE], [2507], [121], [LIU Song], [ARG], [2506], [122], [<NAME>], [CRO], [2505], [123], [<NAME>], [GER], [2504], [124], [HUNG Tzu-Hsiang], [TPE], [2504], [125], [KORBEL Petr], [CZE], [2503], [126], [PETO Zsolt], [SRB], [2502], [127], [KIM Junghoon], [KOR], [2500], [128], [WANG Zengyi], [POL], [2497], ) )
https://github.com/julyfun/jfmfoi
https://raw.githubusercontent.com/julyfun/jfmfoi/main/240824-字符串/main.typ
typst
#import "@preview/touying:0.4.2": * #import "@preview/cetz:0.2.2" #import "@preview/ctheorems:1.1.2": * #import "@preview/fletcher:0.5.0" as fletcher: diagram, node, edge, shapes // cetz and fletcher bindings for touying #let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) #let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide) // Register university theme // You can replace it with other themes and it can still work normally #let s = themes.university.register(aspect-ratio: "16-9") // Set the numbering of section and subsection #let s = (s.methods.numbering)(self: s, section: "1.", "1.1") // Set the speaker notes configuration // #let s = (s.methods.show-notes-on-second-screen)(self: s, right) // [my] #set text( font: ("New Computer Modern", "Songti SC") ) #show strong: set text(weight: 900) // Songti SC 700 不够粗 // Global information configuration #let s = (s.methods.info)( self: s, title: [【算法2-4】字符串], subtitle: [], author: [方俊杰.SJTU], date: datetime.today(), institution: [交附闵分 OI], ) // Pdfpc configuration // typst query --root . ./example.typ --field value --one "<pdfpc-file>" > ./example.pdfpc #let s = (s.methods.append-preamble)(self: s, pdfpc.config( duration-minutes: 30, start-time: datetime(hour: 14, minute: 10, second: 0), end-time: datetime(hour: 14, minute: 40, second: 0), last-minutes: 5, note-font-size: 12, disable-markdown: false, default-transition: ( type: "push", duration-seconds: 2, angle: ltr, alignment: "vertical", direction: "inward", ), )) // Theorems configuration by ctheorems #show: thmrules.with(qed-symbol: $square$) #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee")) #let corollary = thmplain( "corollary", "Corollary", base: "theorem", titlefmt: strong ) #let definition = thmbox("definition", "Definition", inset: (x: 1.2em, top: 1em)) #let example = thmplain("example", "Example").with(numbering: none) #let proof = thmproof("proof", "Proof") // Extract methods #let (init, slides, touying-outline, alert, speaker-note) = utils.methods(s) #show: init #show strong: alert // Extract slide functions #let (slide, empty-slide) = utils.slides(s) // --- 以下为正文 #show raw.where(lang: "cpp"): it => { set text(12pt) it } #set text(20pt) #show: slides = KMP - 理解“部分匹配值” 阮一峰: https://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html ```cpp int ok = 0; for (int i = 1; i <= slen; i++) { while (ok && t[ok + 1] != s[i]) ok = nxt[ok]; if (t[ok + 1] == s[i]) ok++; if (ok == tlen) { printf("%d\n", i - tlen + 1); ok = nxt[ok]; } } ``` == - 如何求出 nxt 数组?nxt[i] 表示前 i 位字符串最长相同前缀后缀长度 ```cpp nxt[1] = 0; // nxt[i]: 前 i 位的最长相同前后缀长度(不含整串) int prefix = 0; for (int i = 2; i <= tlen; i++) { while (prefix && t[prefix + 1] != t[i]) prefix = nxt[prefix]; if (t[prefix + 1] == t[i]) prefix++; nxt[i] = prefix; } ``` == P4391 [BOI2009] Radio Transmission 无线传输 `n - nxt[n]` = 字典树 Trie == P1481 魔族密码 #slide[ ```cpp struct Node { int ch[26] = { 0 }; } node[N * 80]; ``` 题解:在每个单词最后字母所在节点打标签,然后 dfs (无重复单词) ][ #image("image.png") ] == P2580 于是他错误的点名开始了 建好树,每条查询路径走一次就行。 = 01 Trie == P4551 最长异或路径 看题解 1 就行。注意是 - 随便选一个根 - 算出每一个点到根的异或和 - 对每一个点异或和 build Trie - 对每一个点异或和,在 01 Trie 上找异或路径即可
https://github.com/RiccardoTonioloDev/TypUrNotes
https://raw.githubusercontent.com/RiccardoTonioloDev/TypUrNotes/main/tun_template/appendix/glossary.typ
typst
MIT License
#set heading(numbering: none) #import "@preview/glossarium:0.4.1": print-glossary #show figure.caption : set text(font: "EB Garamond",size: 12pt) = Glossary #print-glossary( ( (key: "ft", short: "first term", desc: "The first term in the glossary."), (key: "st", short: "second term", desc: "The second term in the glossary."), (key: "tt", short: "third term", desc: "The third term in the glossary."), ) )
https://github.com/yhtq/Notes
https://raw.githubusercontent.com/yhtq/Notes/main/复变函数/作业/hw5.typ
typst
#import "../../template.typ": proof, note, corollary, lemma, theorem, definition, example, remark, proposition,der, partialDer, Spec, seqLimit, seqLimitn #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: note.with( title: "作业5", author: "YHTQ", date: none, logo: none, withOutlined : false, withTitle :false, ) #let Gal = $G a l$ #set heading(numbering: none) (应交时间为4月3日) = p67 == 7 取 $t_(n) = 1/(pi n + pi/2)$,取分划: $ P_n : 0 = x_(n 0) < x_(n 1) = t(n) < x_(n 2) = t(n - 1) < ... < x_(n n) = t(1) < x_(n n + 1) = 1 $ 则: $ sum_(k=0)^n norm(gamma(x_(n (k+1))) - gamma(x_(n k))) = sqrt((sum_(k=0)^n (x_(n (k+1)) - x_(n k)))^2 + sum_(k=0)^n norm(gamma(t_k) - gamma(t_(k+1))) ) \ = sqrt((t(1) - 0)^2 + sum_(k=1)^n norm(t_k sin (k pi + pi/2) - t_(k+1) sin ((k+1)pi + pi/2)) )\ = sqrt((t(1) - 0)^2 + sum_(k=1)^n t_(k+1) + t_k )\ = sqrt((t(1) - 0)^2 + 2 sum_(k=1)^n 1/(pi n + pi/2) + t_n )\ $ 容易看出 $n->+infinity$ 时上式并无上界 == 19 证明中利用了开集内两点的连线还在开集内,换言之必须是一个凸的开集,这利用了开圆盘的假设 == 23 首先,我们取包含 $gamma$ 的开集 $G' subset G$ 使得 $exists m, forall x in G', norm(x - a) > m > 0$\ - 若 $a$ 不是 $G$ 的边界点,则 $G' = G$ 即可 - 反之,在 $a$ 附近找到开球使得 $overline(U(a, delta)) sect gamma = emptyset$,取 $G - overline(U(a, delta))$ 包含 $gamma$ 的连通分支即可 取 $F = 1/(z-a), forall z in G'$,则由 $norm(z - a) > m$ 知它是解析函数,且 $F' = - 1/(z-a)^2$,由熟知定理知当然有: $ integral_(gamma)^() F' = 0 $ = p74 4 == (a) 令 $s_N = sum_(n = 1)^N a_n$,无妨设 $s_N -> 0$,则: $ sum a_n r^n = sum (s_(n) - s_(n-1)) r^n = sum s_n r^n - sum s_(n-1) r^n = sum s_n r^n - sum s_(n) r^(n+1)\ = (1-r) sum s_n r^n $ 对于 $epsilon > 0$,由 $s_N -> 0$ ,无妨设 $abs(s_n) < epsilon$(既然前面有限项求和当 $r$ 接近于 $1$ 时当然趋近于 $0$),则: $ abs((1-r) sum s_n r^n) <= (1-r) sum abs(s_n) r^n < epsilon (1-r) sum r^n = epsilon (1-r)/(1-r) = epsilon $ 表明 $lim_(r -> 1^-) sum a_n r^n = 0$,证毕 == (b) 考虑 $f(x) = sum_(n = 1) (-1)^(n-1)1/n x^n$,则: $ f'(x) = sum_(n = 1) (-1)^(n-1) x^(n-1) = sum_(n = 0) (-1)^n x^n = 1/(1+x)\ f(x) = ln(1+x) + C $ 令 $X -> 1^-$ 由上面结论知 $sum_(n = 1) (-1)^(n-1)1/n = ln 2$
https://github.com/kotfind/hse-se-2-notes
https://raw.githubusercontent.com/kotfind/hse-se-2-notes/master/os/lectures/2024-09-16.typ
typst
Набор (пар) операций: - одноразовые: - создание -- завершение - многоразовые: - запуск -- приостановка - блокирование -- разблокирование - изменение приоритета процесса === Process Control Block и контекст процесса Process Control Block --- структура (или набор структур) с информацией о процессе; хранит: - Регистровый контекст: - Программный счетчик - Содержимое регистров - Системный контекст: - Состояние процесса - Данные для планирования использования процессора и управления памятью - Учетная информация PCB хранится в адресном пространстве ОС Код и данные в адресном пространстве --- пользовательский контекст Контекст процесса --- совокупность всех трех контекстов === Одноразовые операции Медленные тк: - Выполняют много действий - Выделяют/ освобождают ресурсы - Меняют число процессов Первые несколько процессов создаются "хитро" Всякий новый процесс рождается от другого процесса $->$ процессы образуют генеологическое дерево (или лес) === Создание процесса + Присваивание PID + Создание PCB с состоянием "рождение" + Выделение ресурсов. Подходы: + из ресурсов родителя + из ресурсов ОС (более частый вариант) + Занесение кода в адресное пространство и установка программного счетчика. Подходы: + Клонирование родителя (в UNIX) Есть системный вызов, который создает клона Есть системный вызов, который полностью заменяет пользовательский контекст + Из файла (в Windows) + Окончательное заполнение PCB + Изменение состояния на "готовность" === Завершение процесса Состояние "закончил исполнение" нужно, чтобы возможно было узнать причину завершения + Изменение состояния на "закончил исполнение" + Освобождение ресурсов + Очистка элементов PCB + Сохранение в PCB информации о причинах завершения Процесс выкидывается из системы, когда родитель - умирает - интересуется причинами завершение Если родитель умер раньше ребенка, `PID=1` усыновляет ребенка Zombie-процесс --- процесс в состоянии "закончил исполнение" === Запуск процесса - Изменение состояние на "исполнение" - Обеспечение наличия в оперативной памяти необходимой информации - Восстановление значения регистров - Передача управления по адресу программного счетчика === Приостановка процесса - Автоматическое сохранение програмного счетчика и части регистров (работа hardware) - Передача управления по специальному адресу (работа hardware) - Сохранение динамическойчасти - Обработка прерывания - Перевод процесса в состояние "Готовность" === Блокирование процесса - Сохранение контекста процесса в PCB - Обработка системного вызова - Перевод процесса в состояние "ожидание" === Разблокирование процесса - Уточнение, какое событие произошло - Проверка наличия процесса, ожидавшего события - Перевод ожидающего процесса в состояние "готовность" - Обработка произошедшего события === Пример цепочки операций // TODO: картинка = Кооперация процессов Кооперативные (взаимодействующие) процессы --- процессы, которые влияют на поведения друг друга путем обмена информацией Основные причины кооперации: - Повышение скорости решения задач (для многоядерной системы) - Совместное использование данных - Модульная конструкция какой-то системы - Для удобства работы пользователя Взаимодействие между процессами происходят через ОС == Категории средств взаимодействия - Сигнальные: передача бита - Канальные: логический канал - Разделяемая память: общее адресное пространство == Как устанавливается связь - Нужна ли инициация? - Обычно нужна для канальной и разделяемой памяти и не нужна для сигнальной - Способы адресации: - Прямая - Симметричная: и отправитель, и получатель указывают ID друг друга - Асимметричная: только отправитель указывает ID получателя - Косвенная: есть вспомогательный объект для передачи == Информационная валентность процессов и средств связи - Сколько процессов может одновременно ассоциировать с конкретным видом связи? --- "It depends". - Сколько идентичных средств связи может быть задействовано между двумя процессами? --- "It depends". - Направленность связи: - Симплексная связь: односторонняя - Полудуплексная связь: как в рации - Дуплексная связь: двусторонняя
https://github.com/timetraveler314/Note
https://raw.githubusercontent.com/timetraveler314/Note/main/24Spring/LinearAlgebra/SideNote.typ
typst
#import "@local/MetaNote:0.0.1" : * #import "@preview/commute:0.2.0": node, arr, commutative-diagram #set text(font:("linux libertine", "FandolSong"), lang: "cn") #let detm = math.mat.with(delim: "|") #show: doc => MetaNote( title: [ Linear Algebra Side Notes 2024 ], authors: ( ( name: "timetraveler314", affiliation: "2024 Spring", email: "<EMAIL>", ), ), doc, ) #outline() #let null = math.op("null") #let range = math.op("range") #let rank = math.op("rank") #let lcm = math.op("lcm") #let Hom = math.op("Hom") #let opl = math.plus.circle #let mA = math.bold($A$) #let mB = math.bold($B$) #let mC = math.bold($C$) #let mD = math.bold($D$) #let mI = math.bold($I$) #let mJ = math.bold($J$) = Matrices == Blocked Matrices === Sylvester's Theorem Sylvester's Theorem is a fantastic result using the technique of blocked matrices. The idea can be tweaked and applied to many other problems. Here are some examples. #theorem("The First Rank Reduction Theorem")[ Let $mA$ be invertible, then $ rank mat(mA,mB;mC,mD) = rank mA + rank mat(mD - mC mA^(-1) mB). $ ] #proof[ Apply elementary blocked matrix operations to the matrix $mat(mA,mB;mC,mD)$: $ mat(mI,0;-mC mA^(-1),mI) mat(mA,mB;mC,mD) mat(mI,-mA^(-1) mB; 0, mI) = mat(mA,0;0,mD-mC mA^(-1)mB). $ The result follows. ] #theorem("The Second Rank Reduction Theorem")[ Let $mA, mD$ be invertible, then $ rank mA + rank mat(mD - mC mA^(-1) mB) = rank mD + rank mat(mA - mB mD^(-1) mC). $ ] #proof[ Similar to the first theorem. ] #theorem("Sylvester's Inequality")[ $ rank mA mB >= rank mA + rank mB - n. $ ] #proof[ Apply the first rank reduction theorem, or use the trick on $ mat(mA,0;mI,mB) -> mat(0,mA mB;mI, 0). $ The result follows from $ rank mat(mA,0;mI,mB) >= rank mA + rank mB. $ #note[ This is a direct result of the Frobenuis Inequality. ] ] #theorem("Frobenuis Inequality")[ $ rank mA mB mC >= rank mA mB + rank mB mC - rank mB. $ ] #proof[ $ mat(mA mB mC, 0; 0,mB)-> mat(mA mB mC, mA mB;0, mB) -> mat(0,mA mB; - mB mC, mB). $ ] As for eigenvalues and eigenvectors, we want to obtain the form $lambda mI - mA mB$, and this can be done similarly. #theorem("Sylvester's Theorem for Eigenvalues")[ Let $mA$ be an $m times n$ matrix, $mB$ be an $n times m$ matrix, and $m >= n$. We have $ abs(lambda mI_m - mA mB) = lambda^(m-n) abs(lambda mI_n - mB mA). $ ] #proof[ A direct result of the first theorem when $lambda !=0$. When $lambda = 0$, it can either be done by the Cauchy-Binet formula or by the perbutation method. ] The theorem reveals that $mA mB$ and $mB mA$ have the same non-zero eigenvalues with the same algebraic multiplicities. Furthermore, we can actually show that their geometric multiplicities are also the same. #corollary[ Let $mA$ be an $m times n$ matrix, $mB$ be an $n times m$ matrix. Then $mA mB$ and $mB mA$ have the same non-zero eigenvalues with the same algebraic and geometric multiplicities. ] #proof[ First theorem with $ mat(lambda mI_m,0;mB,lambda I_n-mB mA) <- mat(lambda mI_m,mA;mB,mI_n)->mat(lambda mI_m - mA mB, mA;0,mI_n). $ $ n + (n- dim ker (lambda mI_n - mB mA)) = n + (n - dim ker (lambda mI_m - mA mB)). $ ] = Polynomial == Coprime Polynomials and Linear Transformations Coprime factorization of polynomials elicits the direct sum decomposition of the vector space. From the geometric perspective, this is the starting point of the Jordan Canonical Form. Here are some results, all of which use the Bezout's Theorem: #lemma[ Let $f(x),g(x)$ be coprime polynomials, $mA$ be a matrix such that $f(mA) = 0$. Then $g(mA)$ is invertible. ] #proof[ By the Bezout's Theorem, we have $u(x) f(x) + v(x) g(x) = 1$. Then $ u(mA) f(mA) + v(mA) g(mA) = mI. $ Given that $f(mA) = 0$, we have $g(mA) v(mA) = mI$, which implies that $g(mA)$ is invertible. ] #theorem[ Let $f(x),g(x)$ be coprime polynomials, $mA$ be a matrix of order $n$. Then $ f(mA)g(mA)=0 <=> rank f(mA) + rank g(mA) = n. $ ] #proof[ $ mat(f(mA),0;0,g(mA)) &-> mat(f(mA),f(mA)u(mA);0,g(mA)) -> mat(f(mA),mI;0,g(mA)) -> mat(f(mA),mI;-f(mA)g(mA),0) \ &-> mat(0,mI;-f(mA)g(mA),0) -> mat(f(mA)g(mA),0;0,mI). $ The result follows. ] This result is particularly useful when proving the diagonalizability of matrices that satisfy certain polynomial equations. #question[ Let $mA$ be an idempotent matrix, prove that $A$ is diagonalizable. ] #proof[ Let $f(x) = x^2 - x$. Then $f(mA) = 0$. By the previous theorem, we have $rank mA + rank (mA - mI) = n$. This implies that $mA$ is diagonalizable. ] #question[ Let $T$ be a linear transformation. Prove that $ ker gcd(f,g) (T) = ker f(T) sect ker g(T), \ ker op("lcm")(f,g) (T) = ker f(T) + ker g(T). $ ] #proof[ Let $beta in ker f(T) sect ker g(T)$, then by the Bezout's Theorem, we have $ u(x) f(x) + v(x) g(x) = gcd(f,g)(x). $ Then $ u(T) f(T) beta + v(T) g(T) beta = gcd(f,g)(T) beta = 0, $ which implies that $beta in ker gcd(f,g)(T)$. Let $beta in ker gcd(f,g)(T)$, then because $f = tilde(f) gcd(f,g)$, $ f(T) beta = tilde(f)(T) d(T) beta = 0. $ The result follows. ] #proof[ If $ v in ker (d tilde(f) tilde(g)) (T)$, then $ v &= (a tilde(f) + b tilde(g)) (T) v space ("Bezout") \ &= underbrace(u(T) f(T) v, in ker g(T)) + underbrace(v(T) g(T) v, in ker f(T)). $ ] #example[ If $P in Hom(V,V)$ is a projection s.t. $P^2 = P$. Then $V = ker P opl range P$. ] #proof[ From the perspective of space decomposition: #lemma[ ($I-P$ is also a projection) $ ker (I-P) = im P. $ ] Because $gcd(x,1-x) = 1, lcm(x,1-x) = x-x^2$, we have $V = ker P opl ker (I-P) = ker P opl im P$. ] Generally, the similar decomposition can be applied like this: #theorem[ Let $f(x),g(x)$ be coprime polynomials, $phi$ be a linear transformation such that $f(phi)g(phi) = 0$. Prove that $V = V_1 plus.circle V_2$ where $V_1 = ker f(phi)$ and $V_2 = ker g(phi)$. ] #proof[ By assumption, there exists $u(x),v(x)$ such that $u(x) f(x) + v(x) g(x) = 1$. Then substituting $phi$ into the equation gives $ u(phi) f(phi) + v(phi) g(phi) = mI. $ Then for any $alpha in V$, we have $alpha = u(phi) f(phi) alpha + v(phi) g(phi) alpha$. Note that $ f(phi)u(phi) in ker g(phi), g(phi)v(phi) in ker f(phi), $ we have $V = V_1 + V_2 $. By the last question, we have $V_1 sect V_2 = 0$. Therefore $V = V_1 plus.circle V_2$. ] = Space Decomposition In this section, we will discuss the decomposition of vector spaces. The main idea is to find a basis that can be used to represent the vector space in a more concise way. To begin with, we will consider the invariant subspaces of a linear transformation. Before we start, let's recall our tools from the polynomial section. #theorem[ $f = f_1,...,f_k$ is coprime factorization, then $ ker f(T) = opl.big_(j=1)^k ker f_j(T). $ ] == Invariant Subspaces Invariance $T(W) subset W$ induces the restriction of the linear transformation to the subspace $ T|_W : W |-> W, v |-> T v. $ Invariant subspace direct-sum decomposes the vector space in the following way. #note("Invariant Subspace Decomposition")[ $ V = W_1 opl ... opl W_k, $ and $T|_W_j$ has matrix representation $[T]_j$ with respect to a basis of $W_j$. Then $ T = op("diag")([T]_1, ..., [T]_k). $ ] === Commutation and Invariance #theorem[ Let $T,S$ be linear transformations that commute, then $ ker T, range T $ are invariant under $S$. ] We've got an important special case of this theorem where $S = f(T)$ is a polynomial of $T$. This is closely related to the decomposition by characteristic polynomials or sth else. == Primary Decomposition === Null Space Stops Growing #definition[ $T in Hom(V,V)$ (finite dimensional). Define $ ker T^infinity = lim_(k->infinity) ker T^k = union.big_(k=1)^infinity ker T^k, \ im T^infinity = lim_(k->infinity) im T^k = sect.big_(k=1)^infinity im T^k. $ ] #theorem("Null Space Stops Growing")[ $ ker T subset ker T^2 subset ... \ im T supset im T^2 supset ... $ $ ker T^infinity = ker T^k, im T^infinity = im T^k $ for some $k$. ] #theorem[ The following statements are equivalent: (1) $V_1 = ker T^infinity, V_2 = im T^infinity$. (2) $V = V_1 opl V_2$, where $V_1,V_2$ are $T$-invariant subspaces s.t. $T|_V_1$ is nilpotent and $T|_V_2$ is invertible. ] #proof[ (1) If $v in V_1 sect V_2$, then there exists $w$ s.t. $v = T^k w$, Then $w in ker T^(2k) = ker T^infinity = ker T^k$. $v = T^k w = 0.$ ] #note[ (2) shows a nice decomposition of the vector space to study the structure of the linear transformation, while (2)$=>$(1) means the only way to depict the vector space is to consider the null space and the range of the linear transformation. ] === Primary Decomposition #theorem[ If $W$ is invariant under $T$, then $W = opl.big ker (p_j (T)) sect W$. ] #note("Projection onto Root Spaces")[ Bezout's Theorem gives us a way to project onto the root spaces of the characteristic polynomial. $ ker f(T) &= ker p_j (T) opl ker (f slash p_j) (T). $ By Bezout's Theorem, we have $u(x) f/p_j (x) + v(x) p_j (x) = 1$. Then $ u(T) f/p_j (T) (x) + 0 = v in ker p_j (T) $ Thus the projection is $u(T) f/p_j (T)$, which is a polynomial of $T$. ] == Rational Canonical Form === Cayley-Hamilton Theorem === Cyclic Spaces #definition("Krylov Space, or Cyclic Space")[ $ K^m (v) = op("span")({v, T v, ..., T^(m-1) v}). $ $ K^infinity (v) = union.big_(m=1)^infinity K^m (v). $ They are also called cyclic spaces, generated by a single vector $v$. By finiteness, the union must stop as some point. If $m_0$ is the smallest integer s.t. $T^(m_0) v$ is a linear combination of $v, ..., T^(m_0-1) v$, then $K^infinity (v) = K^(m_0) (v)$, whereafter the sequence becomes stable. In fact, the vectors $v, ..., T^(m_0-1) v$ form a basis of $K^(m_0) (v)$. ] It's easy to see that $K^m (v)$ is $T$-invariant. Moreover, under the induced basis, the matrix representation of $T$ is a companion matrix, whose minimal polynomial is the same as the characteristic polynomial. = Diagonalization == Simultaneous Diagonalization #theorem("Simultaneous Diagonalization")[ Let $T_1, ..., T_k$ be commuting linear transformations. Then there exists a basis s.t. $T_j$ is diagonal for all $j$. ] #proof[ By induction on $dim V$. Restricting $T$ to smaller spaces, we might find their common invariant subspaces. Take the eigen decomposition $ opl.big ker (lambda I - T_j) = W_1 opl ... opl W_k, \ $ of $T_1$. By commutativity, *$W_j$ is $T_r$-invariant for all $r$*. Then $T_1|W, ..., T_k|W$ are diagonalizable (induction hypothesis). The result follows. ] == Diagonalization of Tensor Product #example[ If $A,B in FF^(n times n)$ are diagonalizable, then $ T in Hom(FF^(n times n), FF^(n times n)) : X |-> A X B $ is diagonalizable. ] #let oti = math.times.circle #proof[ $ [T] = B^T oti A \ (P oti Q)^(-1) [T] (P oti Q) = (P^(-1) B^T Q) oti (P^(-1) A Q) = D_1 oti D_2 = D. $ Alternative: $T = L_A R_B$ where $L_A, R_B$ are left and right multiplication operators. The two multiplication operators are commutative, so it suffices to diagonalize them separately (because they are simultaneously diagonalizable, the $P^(-1)$ and $P$ in the middle cancel out). ] = Commutativity == Commutating Linear Transformations #theorem[ Let $T,S$ be commuting linear transformations. Then $ ker (T - lambda I)^infinity "is invariant under" S. $ ] Choosing a basis s.t. $T$ is Jordan form $op("diag")(J_1,dots,J_n)$, then the matrix representation of $S$ is block diagonal with respect to the Jordan blocks, and $S_i J_i = J_i S_i$. = Miscellaneous == Minimal Polynomial #question[ If the minimal polynomial of $mA in CC^(n times n)$ is $m(lambda) = product (lambda - lambda_i)^(k_i)$. Prove that the minimal polynomial of $mB = mat(mA,mI;0,mA)$ is $product (lambda - lambda_i)^(k_i+1)$. ] #proof[ Note that $mB^t = mat(mA^t,t mA^(t-1);0,mA^t)$, we have$ f(mB) = mat(f(mA),f'(mA);0,f(mA)), "where " f "is a polynomial". $ Denote $g(lambda)$ as the minimal polynomial of $mB$. Then $g(mB) = 0$ implies that $g(mA) = 0, g'(mA) = 0$. Then $m | g, m | g'$. By $m | g$, we have $g = m p$, and $m | g' = m p' + m' p$, then $m | m' p$. Consider every factor $(lambda - lambda_i)^(k_i)$ in $m$, we know that $ (lambda - lambda_i)^(k_i-1) || m'. $ Therefore, the minimal $p = product (lambda - lambda_i)$, which implies that the minimal polynomial $g = product (lambda - lambda_i)^(k_i+1)$. ]
https://github.com/SWATEngineering/Docs
https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/VerbaliInterni/VerbaleInterno_231107/meta.typ
typst
MIT License
#let data_incontro = "07-11-2023" #let inizio_incontro = "16:00" #let fine_incontro = "18:00" #let luogo_incontro = "Discord"
https://github.com/kairosiot/software.2024.11-Document_Template
https://raw.githubusercontent.com/kairosiot/software.2024.11-Document_Template/main/tests/part-style-1/test.typ
typst
Other
#import "../../typst-orange.typ": project, part, chapter, my-bibliography, appendices, make-index, index, theorem, mathcal #set text(font: "Lato") #show math.equation: set text(font: "Lato Math") #show raw: set text(font: "Fira Code") #show: project.with( title: "Exploring the Physical Manifestation of Humanity’s Subconscious Desires", subtitle: "A Practical Guide", date: "Anno scolastico 2023-2024", author: "<NAME>", mainColor: rgb("#F36619"), lang: "en", listOfFigureTitle: "List of Figures", listOfTableTitle: "List of Tables", supplementChapter: "Chapter", supplementPart: "PART", part_style: 1, copyright: [ Copyright © 2023 <NAME> PUBLISHED BY PUBLISHER #link("https://github.com/flavio20002/typst-orange-template", "TEMPLATE-WEBSITE") Licensed under the Apache 2.0 License (the “License”). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. _First printing, July 2023_ ] ) #part("Part One Title") #chapter("Sectioning Examples") #index("Sectioning") == Section Title #index("Sectioning!Sections") #lorem(50) #footnote[Footnote example text...Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent porttitor arcu luctus, imperdiet urna iaculis, mattis eros. Pellentesque iaculis odio vel nisl ullamcorper, nec faucibus ipsum molestie.] #lorem(50) === Subsection Title #index("Sectioning!Subsections") #lorem(50) #lorem(50) #lorem(50) ==== Subsubsection Title #index("Sectioning!Subsubsections") #lorem(100) ===== Paragraph Title #index("Sectioning!Paragraphs") #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #lorem(50) #heading(level:2, numbering: none, "Unnumbered Section", outlined: false) #heading(level:3, numbering: none, "Unnumbered Subsection", outlined: false) #heading(level:4, numbering: none, "Unnumbered Subsubsection", outlined: false)
https://github.com/lxl66566/my-college-files
https://raw.githubusercontent.com/lxl66566/my-college-files/main/信息科学与工程学院/嵌入式系统/实验/报告/1/1.typ
typst
The Unlicense
#import "../template.typ": * #show: project.with( title: "实验报告 1", authors: ( "absolutex", ) ) = 跑马灯实验(寄存器版本) == 实验目的 通过代码控制 ALIENTEK 阿波罗 STM32 开发板上的两个 LED 灯 DS0 和 DS1 交替闪烁,实现类似跑马灯的效果。 修改代码,初步掌握 STM32F429 基本 IO 口的使用。 == 代码描述 #include_code_file("../代码/1.c","main.c", "c") 用到了两个 for 循环,外层循环控制占空比,内层循环起到延时作用,使人眼能够观测到占空比变化。 变量 d 用来控制闪烁周期,sist 控制每个亮度持续的周期数。 == 实验结果 观察到 DS1 由暗到亮,再由亮到暗的循环闪烁。 == 心得体会 想要达到比较好的观察效果需要细致地调整参数。LED 的占空比在 0.3 以下时可以明显看出亮度变化,而在 0.4 以上时,LED 较亮,导致亮度变化不明显。 = 跑马灯实验(HAL 库版本) == 实验目的 通过代码控制 ALIENTEK 阿波罗 STM32 开发板上的两个 LED 灯 DS0 和 DS1 交替闪烁,实现类似跑马灯的效果。 使用 HAL 库版本重写上述跑马灯程序,同样使 DS1 发生由暗到亮,再由亮到暗的循环闪烁。 == 代码描述 #include_code_file("../代码/2.c","main.c", "c") == 实验结果 观察到了与实验 1 相同的跑马灯闪烁。 == 心得体会 了解了HAL库的使用方法,以及在STM32开发板上通过HAL库控制LED灯的方法。学习了如何使用GPIO端口和时钟,并逐步构建复杂的应用程序。 = 按键输入实验 == 实验目的 利用板载的 4 个按键,来控制板载的两个 LED 的亮灭,熟悉 STM32F4 的 IO 口作为输入口的使用方法。 == 代码描述 #include_code_file("../代码/3.c","main.c", "c") 将调节亮度的占空比调节过程抽象成 `space_ratio()` 函数,通过不同按键,控制灯的亮度。代码中 `f = f == x ? 0 : x;` 的设计,目的是附加一个功能,在第二次按下按钮时熄灭 LED。 == 实验结果 通过不同按键,实现 LED 的亮度调节。按动 `WKUP` 键后关闭 LED,按动 `KEY2` 后调整亮度为低,而按动 `KEY1` 后亮度调整为较高,按动 `KEY0` 后亮度调整为高。 == 心得体会 由于占空比在 0.3 以上时亮度变化不明显,因此设置占空比为 0, 0.05, 0.2, 0.8,可以很好地观察到 LED 的亮度变化。 经过测试,使用 `KEY_Scan(0)` 只能监测到按键按下时的一次信号发送。如果需要监测按键持续时间或 release 时机,可能需要修改库函数代码。 = 外部中断实验 == 实验目的 学习如何使用 STM32F429 的外部输入中断,了解中断优先级的设置方法与表现,学习将中断线映射为 GPIO 的方法,在中断服务函数中处理逻辑。 == 代码描述 #include_code_file("../代码/4.c","exti.c 片段", "c") 通过改进的 `space_ratio()` 函数实现了双 LED 灯的亮度调节,通过按键按照优先级进入中断程序,执行对应的服务。 == 实验结果 在本次的实验中,使用外部中断来实现控制灯的暗灭。利用占空比的原理实现了让灯从暗至亮再从亮至暗的过程。 == 心得体会 由于不熟悉串口调试工具的使用,在串口调试时遇到了麻烦。需要接对串口线,选中正确的波特率,才可以看到正常输出。选择了错误的波特率可能导致接收的信息乱码。 一开始发现灯频闪的很快,而不是缓慢变亮,因为频率慢,没有让灯的图像在人眼中滞留,后增加了频率改善了这一问题。但由于未知原因没有实现中断优先级,即不能用其他优先级高的按钮中断当前灯的状态。
https://github.com/anntnzrb/ccpg1036
https://raw.githubusercontent.com/anntnzrb/ccpg1036/main/asgmts/prac01/docs/main.typ
typst
#import "@preview/codly:1.0.0": * #import "template.typ": * #show: project.with( title: "Práctica 1: Tiempo de ejecución de Insertion-Sort", authors: ( (name: "<NAME>", email: "<EMAIL>", affiliation: "ESPOL (FIEC)"), ), date: "Octubre 18, 2024", ) #show: codly-init.with() #codly( languages: ( python: (name: "python", icon: "\u{1F40D} ", color: rgb("#CA452B")), ), number-format: none, zebra-fill: none ) = Instrucciones + Capture una pantalla donde se indiquen las características del computador (procesador, memoria, entre otros) que usted utilizará para la realización de las prácticas de este curso. + Implemente en *Python* el algoritmo *Insertion-Sort* que aparece en el texto guía o modifique uno obtenido de Internet citando la fuente en formato _IEEE_. + Ejecute la implementación del algoritmo para un conjunto de `10, 100, 1000, 10000, 100000` datos enteros y registre los tiempos de ejecución en cada caso. + Si las características de su dispositivo lo permiten realice ejecuciones adicionales con una mayor cantidad de datos y registre los correspondientes tiempos de ejecución. [*NO APLICA*] + Escriba en forma de conclusiones qué aspectos deben ser tomados en cuenta por un grupo de personas que tienen por objetivo encontrar el tiempo promedio de ejecución del algoritmo para las cantidades de datos del punto 3. #figure( align(center, image("assets/hw_info.png", width: 100%)), caption: [Características de la computadora empleada]) #pagebreak() = Resolución == Implementación de Algoritmo Insertion-Sort El siguiente algoritmo de *Insertion Sort* fue adaptado en base al algoritmo proporcionado en el texto guía de la materia: _Introduction to Algorithms_ @cormen2022-algo. Esta versión sigue los mismos pasos que la versión original, sin embargo introduce algunos ajustes personales, por ejemplo: + *Mutación de parámetros*: Se copia el arreglo en vez de modificarlo, es una buena práctica preferir crear un nuevo arreglo en vez de modificar uno existente. + *Caso base*: En casos triviales, como cuando arreglo tiene una longitud menor a 2 (o tiene 1 elemento, o ninguno) entonces se retorna el mismo arreglo. Esto provoca una salida temprana. #figure( ```python def insertionSort(arr: List[int]) -> List[int]: arrLen: int = len(arr) # if arr length is zero or contains only 1 elem, it is sorted already if arrLen < 2: return arr # cp arr to avoid mutation sortedArr: List[int] = arr[:] for idx in range(1, arrLen): # iterate arr starting from 2nd elem elem: int = sortedArr[idx] # store current element prev_idx: int = idx - 1 # shift next elem to right if greater than current elem while prev_idx >= 0 and elem < sortedArr[prev_idx]: sortedArr[prev_idx + 1] = sortedArr[prev_idx] prev_idx -= 1 sortedArr[prev_idx + 1] = elem return sortedArr ```, caption: "Algoritmo Insertion Sort basado en " + cite(<cormen2022-algo>)) #pagebreak() == Ejecución y Tests #figure( align(center, image("assets/results.png", width: 100%)), caption: [Resultados de ejecución del algoritmo]) #set table( fill: (x, y) => if x == 0 or y == 0 { gray }, inset: (right: 1.5em), ) #show table.cell: it => { if it.x == 0 or it.y == 0 { set text(white) strong(it) } else { it } } #figure( align(center, table( columns: 3, [], [Cantidad de Datos], [Tiempo de Ejecución (segundos)], [Caso 1], [10], [0.000], [Caso 2], [100], [0.000], [Caso 3], [1000], [0.014], [Caso 4], [10000], [1.229], [Caso 5], [100000], [125.322], )), caption: "Resumen de tiempos de ejecución según cantidad de datos") #figure( ```python class TestInsertionSort(unittest.TestCase): def test_sort_basic(self): self.assertEqual(insertionSort([12, 11, 13, 5, 6]), [5, 6, 11, 12, 13]) def test_sort_empty(self): self.assertEqual(insertionSort([]), []) def test_sort_single_element(self): self.assertEqual(insertionSort([1]), [1]) def test_sort_already_sorted(self): self.assertEqual(insertionSort([1, 2, 3, 4, 5]), [1, 2, 3, 4, 5]) def test_sort_reverse_order(self): self.assertEqual(insertionSort([5, 4, 3, 2, 1]), [1, 2, 3, 4, 5]) def test_sort_duplicates(self): self.assertEqual(insertionSort([4, 4, 4, 4]), [4, 4, 4, 4]) class TestInsertionSortPerformance(unittest.TestCase): def gen_random_intlist(self, size: int) -> List[int]: return [random.randint(0, size) for _ in range(size)] def measure_execution_time(self, size: int) -> None: randomList = self.gen_random_intlist(size) timeStart = time.time() insertionSort(randomList) timeEnd = time.time() execTime = timeEnd - timeStart print() print(f"Sorting {size} elements took {execTime:.3f} seconds.") def test_sort_performance(self): for size in [10, 100, 1000, 10000, 100000]: self.measure_execution_time(size) ```, caption: "Testing de algoritmo Insertion-Sort") #pagebreak() = Conclusiones Este algoritmo implementado tiene un tiempo de complejidad cuadrático $O(n^2)$, resultando en que, a medida que el número de datos aumente, el tiempo de ejecución también lo hará. Para los números más pequeños, como `10` y `100` elementos, el tiempo de ejecución es muy rápido, sin embargo con un arreglo de elementos grande, como lo son `100.000` o más datos, el tiempo de ejecución aumenta drásticamente. El hardware empleado es considerado un buen equipo, que rinde mejor en comparación a equipos de uso personal promedio. Para obtener un tiempo promedio representativo, se recomienda realizar varias pruebas de ejecución en entornos similares para cada uno de los datos de entrada. Por último, también vale mencionar que la naturaleza de los datos también es un factor importante. Puede ser que el arreglo de elementos esté muy desordenado, parcialmente ordenado y casi ordenado totalmente. Dependiendo de cualquiera de los escenarios descritos anteriormente, el tiempo de ejecución se puede ver drásticamente afectado. #pagebreak() = Anexos == Repositorio Online La totalidad del código desarrollado se encuentra disponible en el siguiente #link("https://github.com/anntnzrb/ccpg1036")[repositorio de GitHub], en su carpeta respectiva. #pagebreak() #bibliography("bib.bib", style: "ieee")
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/closure-05.typ
typst
Other
// Import bindings. #{ let b = "module.typ" let f() = { import b: b b } test(f(), 1) }
https://github.com/patrick-kidger/typst_pyimage
https://raw.githubusercontent.com/patrick-kidger/typst_pyimage/main/typst_pyimage/pyimage.typ
typst
Apache License 2.0
#let pyimage_counter = counter("pyimage") #let pycontent_counter = counter("pycontent") #let pyinit(program) = {} #let pyimage(program, ..arguments) = { pyimage_counter.step() locate(loc => image(str(pyimage_counter.at(loc).at(0)) + ".png", ..arguments)) } #let pycontent(program) = { pycontent_counter.step() locate(loc => eval(read(str(pycontent_counter.at(loc).at(0)) + ".txt"))) }
https://github.com/OverflowCat/BUAA-Digital-Image-Processing-Sp2024
https://raw.githubusercontent.com/OverflowCat/BUAA-Digital-Image-Processing-Sp2024/master/chap11/util.typ
typst
#let problem(content) = { set text(font: "<NAME> (technical preview)", size: 1.1em, fill: rgb(55, 55, 55)) content }
https://github.com/Critik-V/resume-tmpl-typst
https://raw.githubusercontent.com/Critik-V/resume-tmpl-typst/main/headers.typ
typst
MIT License
// for section header #let SECTION(title) = { block(width: 100%,stroke: (bottom: 1pt), above: 0.2em, below: 0.6em,inset: 4pt,align(left, text(stretch: 100%, size: 14pt, weight: 700, title))) } // for job header #let JOB_HEADER(company, title, date, location) = { block(width: 100%, below: 0.7em, text(stretch: 100%, size: 11pt, weight: 700, [#company #h(1fr) #date])) block(width: 100%, text(stretch: 100%, size: 11pt, weight: 500,style: "italic", [#title #h(1fr) #location])) } // for school header #let SCHOOL_HEADER(school, city, date) = { block(width: 100%, text(stretch: 100%, size: 11pt, weight: 700, [#school, #city #h(1fr) #date])) }
https://github.com/LeoColomb/dotdocs
https://raw.githubusercontent.com/LeoColomb/dotdocs/main/packages/leocolomb/cv/1.0.0/src/lib.typ
typst
MIT License
#let primary_colour = rgb("#1F497D") #let icon( name, shift: 1.2pt, margin: 2pt, ) = { box( baseline: shift, height: 9pt, image("assets/" + name + ".svg"), ) h(margin) } #let services(services) = { set text(8pt) let icon = icon.with(shift: 1.5pt, margin: 3pt) services .map(service => { icon(service.name) if "link" in service.keys() { if "display" in service.keys() { link(service.link)[#{ service.display }] } else { link(service.link) } } else { service.display } }) .join(h(10pt)) [ ] } #let date(period) = { text( size: 8pt, weight: "light", )[#icon("calendar")#period] } #let term( period, location, ) = { text( size: 8pt, weight: "light", )[#date(period) #h(1em) #icon("location")#location] } // This function gets your whole document as its `body` // and formats it as a CV. #let template( // The name with wich the CV opens. name: none, // The links to self references/social networks. links: (), // The CV's tagline. tagline: none, // The applied position. position: [], // The applied company. company: [], // The CV's content. body ) = { // Configure page and text properties. set text( size: 9.9pt, font: "IBM Plex Sans", ) set columns(gutter: 15pt) set page( columns: 2, margin: ( x: 53pt, y: 50pt, ), header-ascent: 60%, header: rect( width: 100%, fill: primary_colour, inset: 0pt, outset: ( x: 53pt, y: 15pt, ), [ #set text( fill: primary_colour.lighten(90%), weight: "light", size: 8pt, ) #set align(right) #upper[ Application for #if position != [] [a #position] else [a] position #if company != [] [at #company] ] ], ), footer: context [ #set text( fill: gray, size: 8pt, ) #name #h(1fr) #counter(page).display( "1 / 1", both: true, ) ], ) // Configure headings properties. show heading.where(level: 2): it => text( fill: primary_colour, size: 11pt, upper(it.body), ) show heading.where(level: 4): it => text( fill: primary_colour, it.body, ) place( top, scope: "parent", float: true, rect( width: 100%, stroke: none, fill: primary_colour, inset: ( x: 0pt, top: 1pt, bottom: 30pt, ), outset: ( x: 53pt, top: 23%, ), [ #set text(fill: white) = #name #services(links) #if tagline != none { tagline } ], ), ) body }
https://github.com/MattiaOldani/Informatica-Teorica
https://raw.githubusercontent.com/MattiaOldani/Informatica-Teorica/master/capitoli/complessità/22_p_vs_np.typ
typst
#import "@preview/lemmify:0.1.5": * #let (theorem, lemma, corollary, remark, proposition, example, proof, rules: thm-rules) = default-theorems( "thm-group", lang: "it", ) #show: thm-rules #show thm-selector("thm-group", subgroup: "theorem"): it => block( it, stroke: red + 1pt, inset: 1em, breakable: true, ) #show thm-selector("thm-group", subgroup: "corollary"): it => block( it, stroke: red + 1pt, inset: 1em, breakable: true, ) #show thm-selector("thm-group", subgroup: "proof"): it => block( it, stroke: green + 1pt, inset: 1em, breakable: true, ) #import "../alias.typ": * = $P$ VS $NP$ *The Millennium Prize Problem*: _che relazione c'è tra le classi P e NP?_ È una questione ancora aperta, la quale farebbe guadagnare un milione di dollari a colui che troverà una risposta (Mr.Krab moment). == Prima analisi #theorem(numbering: none)[ $P subset.eq NP$ ] #proof[ \ È facile dimostrare che $dtime(f(n)) subset.eq ntime(f(n))$. Dato $L in dtime(f(n))$, esiste una DTM $M$ che lo riconosce in $t(n) = O(f(n)). quad (*)$ Chiaramente $M$ può essere vista come una NDTM che ignora il modulo congetturale. La NDTM così ottenuta ripropone la stessa computazione di $M$ su ogni congettura generata inutilmente. È chiaro che questa NDTM accetta $L$ in tempo $t(n) = O(f(n))$, quindi $L in ntime(f(n))$.\ Quindi vale: $ P = union.big_(k gt.eq 0) dtime(n^k) overset(subset.eq, (*)) union.big_(k gt.eq 0) ntime(n^k) = NP. $ ] _Cosa possiamo dire sulla relazione inversa?_ È chiaro che il punto cruciale del Millennium Problem è proprio la relazione $NP subset.eq P$, che in realtà si può tradurre in $P = NP$ vista la relazione appena dimostrata. Detto in altre parole, ci chiediamo se da un algoritmo non deterministico efficiente è possibile ottenere un algoritmo _reale_ efficiente. Similmente a quanto fatto nella dimostrazione di $P subset.eq NP$, proviamo ad analizzare questo problema $ ntime(f(n)) subset.eq dtime(?), $ che quantifica quanto costa togliere il fattore di non determinismo (che è un concetto non naturale) della fase congetturale. Supponiamo di avere $L in ntime(f(n))$. Questo implica che esiste una NDTM $M$ tale che $M$ accetta $L$ con $t(n) = O(f(n))$. _Come possiamo simulare la dinamica di $M$ con una DTM $overset(M, tilde)$?_ Il funzionamento di $overset(M, tilde)$ può essere qualcosa di questo tipo: + prendiamo in input $x in Sigma^*$, con $|x| = n$; + genera tutte le strutture $gamma in Gamma^*$ delle fasi di verifica; + per ognuna di esse, calcola *deterministicamente* se $(gamma, x)$ viene accettata con $M$; + se in una delle computazioni al punto 3 la risposta è positiva, allora accetta $x$, altrimenti $overset(M, tilde)$ rifiuta (la gestione dei loop può essere fatta tramite la tecnica del count-down). Il problema qui è che di stringhe $gamma in Gamma^*$ ne esistono infinite! _Ma ci servono proprio tutte?_ Rivediamo lo pseudo-codice dell'algoritmo che stiamo progettando: $ "DTM" overset(M, tilde) equiv & "input"(x) \ & "for each" gamma in Gamma^*: \ & quad "if"(M "accetta" (gamma, x) "in" t(n) "passi") \ & quad quad "return" 1; \ & "return" 0; $ Per evitare di considerare tutte le stringhe $gamma$, possiamo considerare solo quelle che non sono più lunghe di $t(n)$, perché altrimenti non potrei finire la computazione in $t(n)$ passi. L'algoritmo diventa: $ "DTM" overset(M, tilde) equiv & "input"(x) \ & "for each" (gamma in Gamma^* and |gamma| = O(f(n))): \ & quad "if"(M "accetta" (gamma, x) "in" t(n) "passi") \ & quad quad "return" 1; \ & "return" 0; $ Studiamo quanto tempo impiega $ t(n) = |Gamma|^(O(f(n))) dot.op O(f(n)) = O(f(n) dot.op 2^(O(f(n)))), $ di conseguenza avremo che $ ntime(f(n)) subset.eq dtime(f(n) dot.op 2^(O(f(n)))). $ Come ci si poteva aspettare, togliere il non determinismo purtroppo costa parecchio, tanto da rendere l'algoritmo esponenziale e quindi inefficiente. $ NP subset.eq dtime(2^(n^(O(1)))) = exptime. $ L'unica cosa che attualmente sappiamo dire è che tutti i problemi in $NP$ hanno sicuramente algoritmi di soluzione con tempo esponenziale, ma ancora non possiamo escludere che $NP subset.eq P$. *Attenzione*: $NP$ non sta per "Non Polinomiale" e quindi esponenziale. $NP$ sta per polinomiale in un architettura non deterministica. Dire che $NP$ contiene problemi con algoritmi di soluzione esponenziale è #text(red)[FALSO]. Tali problemi potrebbero anche avere soluzioni efficienti (anche se nessuno lo crede). == Come affrontare $P$ VS $NP$ Per i problemi della classe _NP_, detti anche _problemi con botta di culo_ o _problemi con il fattore C_, non abbiamo ancora una soluzione efficiente, ma questo vuol dire che non lo conosciamo ancora a fondo, o magari manca una solida base matematica che ci permetta di risolverli. Per mostrare che $NP subset.eq P$ dovremmo prendere ogni problema in _NP_ e trovare per essi un algoritmo di soluzione _polinomiale_. Ovviamente questo approccio è impraticabile dato che _NP_ contiene infiniti problemi, del tutto eterogenei. Potremmo ovviare a questo problema agendo solo su un sottoinsieme dei problemi a nostra disposizione piuttosto che su tutti quanti. Vediamo una strategia che permette di isolare un kernel di problemi in _NP_ : + stabiliamo una *relazione di difficoltà* tra problemi in _NP_ : dati $pi_1, pi_2 in NP$ allora $pi_1 lt.eq pi_2$ indica che, se riesco a trovare una soluzione efficiente per $pi_2$, allora ho automaticamente una soluzione efficiente per $pi_1$. In poche parole, $pi_1$ non è più difficile di $pi_2$, se sono bravo su $pi_2$ sono bravo anche su $pi_1$; + definita tale relazione, utilizziamola per trovare l'insieme dei problemi *più difficili* di _NP_ : $pi$ è difficile in _NP_ se $ pi in NP and forall overset(pi, tilde) in NP quad overset(pi, tilde) lt.eq pi. $ Questi possiamo definirli i _problemi bad boys_ di _NP_; + restringiamo la ricerca di algoritmi efficienti al kernel in _NP_ appena trovato: se possiamo risolvere questi in modo efficiente, allora possiamo trovare algoritmi efficienti per tutto _NP_. === Riduzione in tempo polinomiale Iniziamo definendo formalmente una *relazione di difficoltà* necessaria a identificare un sottoinsieme di $NP$. Dati due linguaggi $L_1, L_2 subset.eq Sigma^*$ (o due problemi di decisione) diciamo che $L_1$ si *riduce polinomialmente* a $L_2$, e lo indichiamo con $L_1 lt.eq_P L_2$, se e solo se esiste una funzione $f : Sigma^* arrow.long Sigma^*$ tale che: + $f$ è calcolabile su DTM in *tempo polinomiale*, quindi $f in fp$ ; + $forall x in Sigma^* quad x in L_1 arrow.double.long.l.r f(x) in L_2$. Le funzioni di riduzione polinomiale sono anche dette *many-one-reduction* perché non sono per forza funzioni iniettive (e quindi biiettive). #theorem(numbering:none)[ Siano due linguaggi $A,B subset.eq Sigma^* bar.v A lt.eq_P B$. Allora $ B in P arrow.long.double A in P . $ ] #proof[ \ Siccome $A lt.eq_P B$, sia $f in fp$ la funzione di riduzione polinomiale. Sappiamo inoltre che $B in P$. Consideriamo il seguente algoritmo: $ P equiv & "input"(x) \ & y := f(x); \ & "if" (y in B) \ & quad "return" 1 \ & "else" \ & quad "return" 0 $ Questo algoritmo è sicuramente deterministico, perché tutte le procedure che lo compongono sono deterministiche. Inoltre, riconosce $A$, per via della seconda condizione della riducibilità. La sua complessità in tempo, dato un input $x$ di lunghezza $n$, è: $ t(n) = t_f (n) + t_(y in B) (|y|) = p(n) + q(|y|). $ Notiamo che $|y| lt.eq p(n)$, in quanto output di una procedura che impiega $p(n)$ passi per generare $y$, quindi: $ t(n) lt.eq p(n) + q(p(n)) = "poly"(n), $ in quanto i polinomi sono chiusi per somma e composizione. In conclusione, l'algoritmo deterministico proposto riconosce $A$ in tempo polinomiale, quindi: $ A lt.eq_P B and B in P arrow.long.double A in P. $ ] Questo teorema è ottimo per la nostra _"missione"_: infatti, se trovo una soluzione efficiente per i _"problemi difficili"_ allora ce l'ho anche per i _"problemi meno difficili"_, visto che dovrei aggiungere solo la parte di riduzione polinomiale, che abbiamo mostrato essere efficiente. === Problemi _NP_-completi Possiamo identificare ora il sottoinsieme di problemi che sono _alla destra_ della relazione di riducibilità polinomiale per almeno un altro problema, i problemi _cattivi_ e _difficili_. Un problema di decisione $Pi$ è *_NP_-completo* se e solo se: + $Pi in NP$ ; + $forall overset(Pi, tilde) in NP quad overset(Pi, tilde) lt.eq_P Pi$. Sia $NPC$ la sottoclasse di _NP_ dei problemi _NP_-completi. Per provare che $NP subset.eq P$ posso restringere la mia ricerca di algoritmi di soluzione efficiente ai soli membri di $NPC$ grazie al seguente teorema. #theorem(numbering:none)[ Sia $Pi in NPC$ e $Pi in P$. Allora, $NP subset.eq P$, e quindi $P = NP$. ] #proof[ \ Dato che $Pi in NPC$, vale $ forall overset(Pi, tilde) in NP quad overset(Pi, tilde) lt.eq_P Pi. $ Visto che $Pi in P$, abbiamo dimostrato prima che $ overset(Pi, tilde) lt.eq_P Pi and Pi in P arrow.long.double overset(Pi, tilde) in P, $ otteniamo che ogni problema $overset(Pi, tilde) in NP$ appartiene anche a $P$, quindi $ NP subset.eq P $ e quindi anche che $ P = NP. $ ] Sorgono spontanee due domande: - _esistono problemi in NPC?_ - _se sì, sono state trovate soluzioni efficienti?_ Alla prima domanda rispondiamo *SI*: il primo problema _NP_-completo è proprio _CNF-SAT_, dimostrato nel 1970 con il teorema di Cooke-Levin. L'appartenenza a _NP_ è banale, mentre la sua completezza è _noiosa da leggere_ (cit. Mereghetti). Una prima variante di questo problema è _K-CNF-SAT_: viene limitata la cardinalità delle clausole $C_i$, formate da _or_ e _not_, a $k$ letterali. Ad esempio, se $k = 4$ una clausola può essere $(a or overline(b) or c or d)$. Con questa variante: - se $k = 1$ il problema ammette soluzioni in tempo lineare; - se $k = 2$ il problema ammette soluzioni in tempo quadratico, dimostrato in un articolo del 1975; - se $k gt.eq 3$ il problema è _NP_-completo. Una seconda variante limita invece il soddisfacimento di _al massimo k clausole_. Infine, una terza variante è quella che considera le _CNF con clausole di Horn_, ovvero clausole in cui esiste al più un letterale negato. In questo caso particolare, il problema torna ad essere efficientemente risolubile. Come vediamo, quando ho un problema difficile cerco delle varianti interessanti con la speranza di gestire almeno questi sotto-problemi significativi. Un altro problema _NP_-completo è _HC_ (_Hamiltonian Circuit_), allo stesso modo di altri migliaia di problemi interessanti sui grafi e altri di svariati ambiti. La comunità scientifica, dopo anni di tentativi e svariate ragioni, tende ormai a credere che $P eq.not NP$, di conseguenza dimostrare l'_NP_-completezza di un problema implica sancirne l'inefficienza di qualunque algoritmo di soluzione. Dopo aver stabilito l'NP-completezza, l'indagine sui problemi però non si ferma: si provano restrizioni, algoritmi probabilistici efficienti (_con margine di errore_), euristiche veloci di soluzione, eccetera. Questo perché questi problemi sono estremamente comuni e utili, quindi stabilire la loro inefficienza darebbe il via alla ricerca del _miglior algoritmo che più si approssima a quella che consideriamo efficienza_. Vediamo ora una tecnica per mostrare che un problema $Pi$ è _NP_-completo: + dimostrare che $Pi in NP$, solitamente il punto più semplice; + scegliere un problema $X$ notoriamente _NP_-completo; + dimostrare che $X lt.eq_P Pi$; + per la transitività di $lt.eq_P$ si ottiene che $Pi in NPC$. Infatti: + $Pi in NP$ per il punto 1; + $forall overset(Pi,tilde) in NP$ abbiamo che $ overset(Pi,tilde) lt.eq_P^((2)) X lt.eq_P^((3)) Pi . $ Ma quindi per la transitività di $lt.eq_P$ del punto 4 abbiamo che $forall overset(Pi,tilde) in NP$ allora $overset(Pi,tilde) lt.eq Pi$, quindi $Pi$ è _NP_-completo. == $P$ VS $L$ (secondo round) C'è un'inclusione che abbiamo lasciato in sospeso, ed è proprio quella che coinvolge le classi $L$ e $P$. Ricordiamo che $ L = dspace(log(n)), \ P = union.big_(k gt.eq 0) dtime( n^k). $ Abbiamo mostrato che $L subset.eq P$, _ma l'inclusione è propria? Oppure $P subset.eq L$?_ Possiamo procedere in maniera simile a quanto fatto per $NP subset.eq P$: + stabiliamo una *relazione di difficoltà* tra problemi $pi_1 lt.eq pi_2$ che voglia dire: _se esiste una soluzione efficiente in spazio per $pi_2$, allora esiste automaticamente una soluzione efficiente per $pi_1$_; + trovare i problemi *massimali* in $P$ secondo la relazione definita al punto precedente; + restringere la ricerca di algoritmi efficienti in spazio a questi problemi massimali. Se la ricerca porta un successo su un problema massimale, allora $P subset.eq L$ e quindi $P = L$. === Riduzione in spazio logaritmico Definiamo una riduzione utile al procedimento appena spiegato. Dati due linguaggi $L_1, L_2 subset.eq Sigma^*$ (o due problemi di decisione), diciamo che $L_1$ si *log-space riduce* a $L_2$, e lo indichiamo con $L_1 lt.eq_l L_2$, se e solo se esiste una funzione $f : Sigma^* arrow.long Sigma^*$ tale che: + $f$ è calcolabile su una DTM in *spazio logaritmico*, ovvero $f in fl$; + $forall x in Sigma^* quad x in L_1 arrow.long.double.l.r f(x) in L_2$. Similmente a quanto vista prima, esiste un teorema che dimostra una sorta di transitività per due linguaggi tra cui esiste una relazione di riducibilità. #theorem(numbering:none)[ Siano due linguaggi $A, B in Sigma^* bar.v A lt.eq_l B$. Allora $ B in L arrow.long.double A in L . $ ] #proof[ \ Sappiamo che $A lt.eq_l B$, quindi esiste $f in fl$ funzione di log-space riduzione. Consideriamo il seguente algoritmo: $ P equiv & "input"(x) \ & y := f(x); \ & "if" (y in B) \ & quad "return" 1 \ & "else" \ & quad "return" 0 . $ Questo è sicuramente un algoritmo deterministico, in quanto è composto da _"moduli"_ a loro volta deterministici. Inoltre, riconosce $A$ per via della seconda condizione della riducibilità. La sua complessità in spazio, dati input $x$ di lunghezza $n$, è descritta dalla seguente complessità: $ s(n) = s_f (n) + s_(y in B) (|y|) = O(log(n)) + O(log(|y|)). $ _Quanto sarà la lunghezza di $y$?_ Notiamo che $|y| lt.eq p(n)$, perché è output di una procedura che impiega spazio logaritmico e quindi un numero polinomiale di passi. Questo deriva dalla relazione $fl subset.eq fp$. Quindi: $ s(n) = O(log(n)) + O(log(p(n))) = O(log(n)). $ In conclusione, l'algoritmo deterministico proposto riconosce $A$ in spazio logaritmico, dunque: $ A lt.eq_l B and B in L arrow.long.double A in L. $ ] Prima di continuare dobbiamo fare attenzione ad un dettaglio: la generazione di $y$ è sì logaritmica in spazio ma serve comunque spazio per salvare il valore di questa variabile, che può essere polinomiale. Si utilizza allora la *computazione on demand*: viene generata $y$ bit per bit, non tutta insieme. Il dato che viene salvato è l'indice del bit richiesto dalla funzione che controlla l'appartenenza a $B$, ma l'indice è logaritmico se lo consideriamo in binario, quindi stiamo utilizzando spazio logaritmico. === Problemi _P_-completi Come prima, identifichiamo il sottoinsieme di problemi di $P$ che andremo a studiare. Un problema di decisione $Pi$ è *_P_-completo* se e solo se: + $Pi in P$; + $forall overset(Pi, tilde) in P quad overset(Pi, tilde) lt.eq_l Pi$. Chiamiamo $PC$ la sottoclasse di _P_ dei problemi _P_-completi. #theorem(numbering:none)[ Sia $Pi in PC$ e $Pi in L$. Allora $P subset.eq L$. ] #proof[ \ Sappiamo che $Pi in PC$, quindi $ forall overset(Pi, tilde) in P quad overset(Pi, tilde) lt.eq_l Pi . $ Se assumiamo che $Pi in L$ otteniamo che $ forall overset(Pi, tilde) in P quad overset(Pi, tilde) in L, $ quindi possiamo concludere che $P subset.eq L$ e, di conseguenza, $P = L$. ] Un esempio di problema _P_-completo è quello che si chiede se una stringa $x$ appartiene a una certa grammatica context-free. - Nome: context-free membership. - Istanza: grammatica-context-free $G$, stringa $x$. - Domanda: $x in L(G)$? Questo problema viene risolto in tempo $t(n) = n^2 log(n)$ e in spazio $s(n) = O(log^2 (n))$. Un altro problema _P_-completo è il seguente. - Nome: circuit value (_circuito con porte logiche_). - Istanza: circuito booleano $cal(C)(x_1, dots, x_n)$, valori in input $a_1, dots, a_n in {0,1}^*$. - Domanda: $cal(C)(a_1, dots, a_n) = 1$? Anche in questo caso lo spazio utilizzato è $s(n) = log^2 (n)$. Come per $P subset.eq NP$, è universale assumere che l'inclusione $L subset.eq P$ sia propria, ma questo non frena gli studi su questi problemi, che sono attuali e molto utili. Si può anche dimostrare che i problemi _P_-completi non ammettono (_quasi certamente_) algoritmi paralleli efficienti. Infine, vediamo anche per questi problemi una tecnica per mostrare che un problema $Pi$ è _P_-completo: + dimostrare che $Pi in P$; + scegliere un problema $X$ notoriamente _P_-completo; + dimostrare che $X lt.eq_l Pi$; + per la transitività di $lt.eq_l$ si ottiene che $Pi in PC$. == Problemi _NP_-hard _Ma i problemi *NP-hard*? Cosa sono e dove si posizionano?_ Un problema $Pi$ _NP_-completo è tale che: - $Pi in NP$; - se $Pi in P$ allora $P = NP$. Se invece $Pi$ è _NP_-hard vale solo che: - se $Pi in P$ allora $P = NP$. Sono problemi che _creano il collasso_ di _P_ e _NP_ ma non sono per forza problemi di decisione: ad esempio, _NP_-hard contiene tutti i *problemi di ottimizzazione* (_number-CNF-SAT_, quanti assegnamenti sono soddisfatti) oppure i *problemi enumerativi*.
https://github.com/f14-bertolotti/bedlam
https://raw.githubusercontent.com/f14-bertolotti/bedlam/main/src/measure-theory/figs/stitched-rectangles.typ
typst
#import "../../colors.typ":* #import "@preview/cetz:0.2.2" #cetz.canvas(length: 3cm, { import cetz.draw: * grid((-.8, -.8), (+.8, +.8), step: 0.1, stroke: darkgray2 + 0.1pt) line((-.8, +0), (+.8, +0), fill:orange, stroke: 1pt + orange, mark: (end: "stealth", scale:.5)) line((+0, -.8), (+0, +.8), fill:orange, stroke: 1pt + orange, mark: (end: "stealth", scale:.5)) rect((-.2 , -.2) , (+.4 , +.2) , stroke: (dash:"dashed", paint:turquoise) , fill:turquoise.transparentize(70%)) rect((+.4 , -.2) , (+.7 , +.2) , stroke: (dash:"dashed", paint:red) , fill:red.transparentize(70%)) // lines to cover dashes line((-.2,-.2), (-.2,+.2), stroke: turquoise) line((-.2,-.2), (+.4,-.2), stroke: turquoise) line((+.4,-.2), (+.4,+.2), stroke: red) line((+.4,-.2), (+.7,-.2), stroke: red) line((-.20 , -.25) , (+.40 , -.25), name:"b0" , stroke: .5pt + turquoise , fill:turquoise , mark: (end: "stealth" , start:"stealth" , scale:.5)) line((-.30 , -.20) , (-.30 , +.20), name:"b1" , stroke: .5pt + red , fill:red , mark: (end: "stealth" , start:"stealth" , scale:.5)) line((+.40 , -.25) , (+.70 , -.25), name:"r0" , stroke: .5pt + red , fill:red , mark: (end: "stealth" , start:"stealth" , scale:.5)) line((-.35 , -.20) , (-.35 , +.20), name:"r1" , stroke: .5pt + turquoise , fill:turquoise , mark: (end: "stealth" , start:"stealth" , scale:.5)) content((-.17,-.30), anchor:"north", text(6pt, fill:turquoise)[$ a_0 $]) content((+.40,-.30), anchor:"north", text(6pt, fill:gradient.linear(turquoise,red))[$ b_0=a'_0 $]) content((+.67,-.30), anchor:"north", text(6pt, fill:red)[$ b'_0 $]) content((-.325,+.27), anchor:"north", text(6pt, fill:gradient.linear(turquoise,red))[$ b_1=b'_1 $]) content((-.325,-.20), anchor:"north", text(6pt, fill:gradient.linear(turquoise,red))[$ a_1=a'_1 $]) })
https://github.com/pawarherschel/typst
https://raw.githubusercontent.com/pawarherschel/typst/main/README.md
markdown
Apache License 2.0
<h1 align="center"> <img src='https://github.com/mintyfrankie/mintyfrankie/assets/77310871/64861d2d-971c-47cd-a5e8-5ad8659f2c2b'> <br><br> AwesomeCV-Typst </h1> <p align="center"> <img alt="Check Status Badge" src="https://github.com/mintyfrankie/awesomeCV-Typst/actions/workflows/compile.yml/badge.svg"/> <a href="https://typst.app/project/rU2AU43JyRIuhbTN-Rdq66/"> <img alt="Typst Demo" src="https://img.shields.io/badge/typst.app-demo-blue"/> </a> </p> <br> **AwesomeCV-Typst** is a [**Typst**](https://github.com/typst/typst) template for making **Résume**, **CV** or **Cover Letter** inspired by the famous LaTeX CV template [**Awesome-CV**](https://github.com/posquit0/Awesome-CV). It provides customizations and **multilingual support** beyond the original LaTeX project. ## Preview | CV | Cover Letter | |:---:|:---:| | ![CV](https://github.com/mintyfrankie/mintyfrankie/assets/77310871/94f5fb5c-03d0-4912-b6d6-11ee7d27a9a3) | ![Cover Letter](https://github.com/mintyfrankie/awesomeCV-Typst/assets/77310871/b4e74cdd-6b8d-4414-b52f-13cd6ba94315) | | CV (*French, red, no photo*) | Cover Letter (*French, red*) | |:---:|:---:| | ![CV](https://github.com/mintyfrankie/awesomeCV-Typst/assets/77310871/fed7b66c-728e-4213-aa58-aa26db3b1362) | ![Cover Letter](https://github.com/mintyfrankie/awesomeCV-Typst/assets/77310871/65ca65b0-c0e1-4fe8-b797-8a5e0bea4b1c) | ## Usage ### Project Structure ``` | |-- modules/ --> sections of your CV, include these at cv.typ | |- *.typ | |-- modules_* --> multilingual sections of your CV | |-- awesomeCV/ | |- template.typ --> the template file, imported in the documents | |- metadata-demo.typ -> the example metadata file that contains all variables used in the template | | |-- src/ | |- fonts/ --> local font files | |- logos/ --> logos for your cvEntry | |- *.png --> images used in the documents | |- *.bib --> BibTeX file for Publications section | |-- cv.typ --> CV file |-- letter.typ --> Cover Letter file |-- metadata.typ --> your Personal Info variables & language settings ``` ### Tips - Build your own personal `metadata.typ` file on the root folder, by copying the `awesomeCV/metadata-demo.typ` file - Host your submodules in different languages in respective subfoler (`./modules_fr` for instance) ### Installation You can either directly create a new repository by using this template, or you might want to add the submodule repository and build up your own Typst project. **Method 1: Jumpstart by clicking `Use this template` and create your own CV repository** When compiling, use: `typst compile ./cv.typ ./output/CV.pdf --font-path ./src/fonts/` **Method 2: Add the [submodule repository](https://github.com/mintyfrankie/awesomeCV-Typst-Submodule) to your existing project** ```bash cd your/CV/project git submodule add https://github.com/mintyfrankie/awesomeCV-Typst-Submodule awesomeCV typst compile cv.typ ``` When you want to get new features from the updated template module: ```bash git submodule update --remote ``` ## Current Issues > As Typst is still a very young (although very promising and robust to my belief) project, some features are only partially supported on certain platforms. It is hence difficult to predict any anomalies, but you are definitely welcomed to bring a PR, an issue or a discussion! - **Image cropping**: Typst does not have direct support to crop images using native primitives. Bring your own cropped image for profile photo if needed. - **Publications Section**: Current version of Typst does not allow full customization on the `#bibliography` function, so the display of publication section might not be optimal. See [this disucssion](https://github.com/mintyfrankie/awesomeCV-Typst/discussions/3). ## Credit - [**Typst**](https://github.com/typst/typst) is a newborn, open source and simple typesetting engine that offers a better scripting experience than [**LaTeX**](https://www.latex-project.org/). - [**Awesome-CV**](https://github.com/posquit0/Awesome-CV) is the original LaTeX CV template from which this project is heavily inspired. Thanks [posquit0](https://github.com/posquit0) for your excellent work!
https://github.com/UntimelyCreation/typst-neat-cv
https://raw.githubusercontent.com/UntimelyCreation/typst-neat-cv/main/src/content/en/skills.typ
typst
MIT License
#import "../../template.typ": * #cvSection("Technical Skills") #cvSkill( type: [Languages], tags: ("Python", "TypeScript", "React", "HTML + CSS") ) #divider() #cvSkill( type: [Technologies], tags: ("Unix", "Git", "PostgreSQL") )
https://github.com/mem-courses/linear-algebra
https://raw.githubusercontent.com/mem-courses/linear-algebra/main/note/8.特征值理论与相似对角化.typ
typst
#import "../template.typ": * #show: project.with( title: "Linear Algebra Note #8", authors: ( (name: "<NAME>", email: "<EMAIL>", phone: "3230104585"), ), date: "December 25, 2023", ) #let xi = math.bold(math.xi) #let theta = math.bold(math.theta) #let AA = math.bold(math.italic("A")) #let BB = math.bold(math.italic("B")) #let XX = math.bold(math.italic("X")) #let YY = math.bold(math.italic("Y")) #let EE = math.bold(math.italic("E")) #let OO = math.bold(math.italic("O")) #let TT = math.upright("T") #let x1 = math.attach(math.italic("x"), br: math.upright("1")) #let x2 = math.attach(math.italic("x"), br: math.upright("2")) #let x3 = math.attach(math.italic("x"), br: math.upright("3")) #let alpha = math.bold(math.alpha) #let beta = math.bold(math.beta) #let Lambda = math.bold(math.Lambda) #let diag = math.upright("diag") #let ssim = math.attach(sp + math.upright("~") + sp, tl: "", tr:"", t: math.upright("S")) = 特征值理论 == 特征值和特征向量 设 $AA in PP^(n times n)$,如有数 $lambda_0 in PP$ 及列向量 $xi in PP^n sp (xi != theta)$ 使得 $AA xi = lambda_0 xi$,则称 $lambda_0$ 是 $AA$ 的一个 *特征值*,非零列向量 $xi$ 为 $AA$ 的一个 *特征向量*. #def[性质1]1. 若 $xi$ 是 $AA$ 的一个特征向量,则 $xi$ 只能属于 $AA$ 的唯一一个特征值. #deft[性质1]2. 属于 $AA$ 的任一个特征值的特征向量有无穷多个. #def[性质2]设有 $xi != theta$,满足 $ AA_(n times n) xi = lambda_0 xi &<=> (lambda_0 EE - AA) xi = theta\ &<=> (lambda_0 EE - AA) XX = theta "有非零解" xi\ &<=> r(lambda_0 EE - AA) < n\ &<=> |lambda_0 EE - AA| = 0\ $ == 特征多项式 #set math.mat(delim: "|") $ f_AA (lambda) &= |lambda EE - AA|\ &= mat( lambda-a_11, -a_12, dots.c, -a_(1 n); -a_21, lambda-a_22, dots.c, -a_(2 n); dots.v,dots.v,,dots.v; -a_(n 1), -a_(n 2), dots.c, lambda-a_(n n); )\ &= lambda^n - (a_11+a_22+dots.c+a_(n n))lambda^(n-1) + dots.c + (-1)^n |AA| $ #set math.mat(delim: "(") 称为 $AA$ 的 *特征多项式*,简记为 $f(lambda)$.设 $AA in PP^(n times n)$,则 $f(lambda)$ 是 $n$ 次多项式. 记 $tr(AA) = a_11 + a_22 + dots.c + a_(n n)$ 称为矩阵 $AA$ 的 *迹*. == 特征子空间 对特征值 $lambda_i$,其对应的线性方程组(称为 *特征线性方程组*) $ (lambda_i EE - AA) XX = OO $ 的一个基础解系为 $xi_(i_1),xi_(i_2),dots.c,xi_(i_(r_i))$,则 $lambda_i$ 对应的所有特征向量可被表示为: $ k_(i_1) xi_(i_1) + k_(i_2) xi_(i_2) + dots.c + k_(i_(r_i)) xi_(i_(r_i)) quad (k_(i j) "不同时为" 0) $ 记 $ V_(lambda_i) = {AA "的属于" lambda_i "的全体特征向量"} union {theta} $ 为特征值 $lambda_i$ 的 *特征子空间*. == 特征值和特征向量的求法 1. 根据 $f(lambda) = (lambda-lambda_1)^(n_1) (lambda-lambda_2)^(n_2) dots.c (lambda-lambda_s)^(n_s) = 0$,去掉不在 $PP$ 里的根,得到 $AA$ 的所有特征值 $lambda_1,lambda_2,dots.c,lambda_s$.($n_i$ 为每个特征值的重数,那么 $n_1+n_2+dots.c+n_s=n$)(特征值在 $CC$ 上,但不一定在 $PP$ 上) 2. 对于每个 $lambda_i$,求出其特征线行线性方程组的基础解系. #note[ #def[总结]特殊矩阵的特征值和特征向量求法: 1. $r(AA) = 1$:说明 $AA = alpha beta^TT$,则 $AA alpha = (alpha beta^TT) alpha = (beta^TT alpha) alpha$,这里 $beta^TT alpha$ 是一个特征根. 2. $AA$ 的每行元素和为 $c$:说明 $AA display(mat(1,1,dots.c,1)) = c display(mat(1,1,dots.c,1))$,这里 $c$ 是一个特征根. ] == 常用性质及结论 #def[性质1]1. $display(sum_(i=1)^n a_(i i) = sum_(i=1)^n lambda_i = tr(AA))$. #deft[性质1]2. $display(product_(i=1)^n lambda_i = |AA|)$. #def[推论1]$AA "可逆" <=> AA "的所有特征值都不为零"$. #note[常利用这两条性质来简化求解矩阵的特征多项式.] #def[性质2]设 $seqn(lambda,s)$ 是 $AA$ 的 $s$ 个不同的特征值,$seqn(xi,s)$ 分别是属于特征值 $seqn(lambda,s)$ 的特征向量,那么 $seqn(xi,s)$ 线性无关. #prof[ #def[证明]用归纳法证明: 1. 当 $s=1$ 时,$xi_1 != theta$,故线性无关. 2. 设 $seqn(xi,s-1)$ 线性无关,证 $seqn(xi,s)$ 也线性无关.令 $ k_1 xi_1 + k_2 xi_2 + dots.c + k_s xi_s = theta quad (1) $ 左乘 $AA$ 得到 $ k_1 lambda_1 xi_1 + k_2 lambda_2 xi_2 + dots.c + k_s lambda_s xi_s = theta quad (2) $ 令 (1) $xi_s -$ (2) 得到 $ k_1 (lambda_s-lambda_1) xi_1 + k_2 (lambda_s-lambda_2) xi_2 + dots.c + k_(s-1) (lambda_s-lambda_(s-1)) xi_(s-1) = theta $ 因为 $seqn(xi,s-1)$ 线性无关,故 $ k_1 (lambda_s - 1) = k_2 (lambda_s-lambda_2) = dots.c = k_(s-1) (lambda_s-lambda_(s-1)) = 0 $ 又因为 $lambda_i$ 两两不同,故 $k_1=k_2=dots.c=k_(s-1) = 0$.代入 (1) 得 $k_s xi_s = 0$,故 $k_s = 0$.所以 $seqn(xi,s)$ 线性无关,由归纳法即原命题成立. ] #def[性质3]进一步地,向量组 $xi_11,xi_12,dots.c,xi_(1 r_1),sp xi_(21),xi_(22),dots.c,xi_(2 r_2),sp dots.c,sp xi_(s 1),xi_(s 2),dots.c,xi_(s r_s)$ 线性无关,且 $ dim V_(lambda_1) + dim V_(lambda_2) + dots.c + dim V_(lambda_s) = r_1 + r_2 + dots.c + r_s <= n $ #def[性质4]$dim V_(lambda_i) = n - r(lambda_i EE - AA) <= n_i$,其中 $n_i$ 是特征值 $lambda_i$ 作为特征多项式零点的重数.我们称 $dim V_(lambda_i)$ 为特征值 $lambda_i$ 的 *几何重数*,$n_i$ 为特征值 $lambda_i$ 的 *代数重数*. #def[性质5]设 $AA$ 的某特征向量 $x$ 对应的特征值为 $lambda$,则满足(反过来不成立): #table( columns: 7, inset: 10pt, align: center, [$AA$], [$a AA + b EE$], [$f(AA)$], [$AA^(-1)$], [$AA^*$], [$AA^TT$], [$bold(P)^(-1) AA bold(P)$], [*特征值*], [$a lambda + b$], [$f(lambda)$], [$1/lambda$], [$1/lambda abs(AA)$], [$lambda$], [$lambda$], [*特征向量*], [$x$], [$x$], [$x$], [$x$], [无关系], [$bold(P)^(-1) x$], ) #def[推论4.1]$r(AA) >= AA "的非零特征值个数"$. #prof[ #def[证明]由性质4可得 $n-r(AA) <= n_0$,其中 $n_0$ 是 $0$ 作为特征根的重数,故 $r(AA) >= n - n_0$. ] #def[推论4.2]$r(AA) >= AA "的不同特征值的个数"$. #def[定理1](Hamilton-Cayley 定理)设 $AA in PP^(n times n)$,$f(lambda)$ 为其特征多项式,那么 $f(AA) = OO$. #def[定理2]设 $AA lambda_0 = lambda_0 xi_0$,$g(x)$ 是多项式(若 $AA$ 可逆,则还可包含逆元),则 $g(AA) xi_0 = g(lambda_0) xi_0$.进一步地,$AA$ 的特征子空间与 $g(AA)$ 相同. #def[结论1.1]幂等矩阵必有特征值且为 $1$ 或 $0$. #def[结论1.2]幂零矩阵必有特征值且必为 $0$. #def[结论2]设 $AA$ 是正交矩阵,则若 $AA$ 有特征值,则特征值必为 $1$ 或 $-1$. #def[结论3]设 $AA in PP^(s times n),sp BB in PP^(n times s)$,则 #deft[结论3]1. $AA BB$ 与 $BB AA$ 有相同的非零特征值且重数相同. #deft[结论3]2. 若 $alpha$ 是 $AA BB$ 属于 $lambda_0$ 的一个特征向量($lambda_0 != 0$),则 $BB alpha$ 是 $BB AA$ 属于 $lambda_0$ 的一个特征向量. #def[结论4]设 $AA in CC^(n times n)$ 且 $a_(i j) in RR$,则当 $lambda_0$ 是 $AA$ 的一个特征值且 $alpha$ 是 $lambda_0$ 的一个特征向量时,$overline(lambda_0)$ 也是 $AA$ 的一个特征值,$overline(alpha)$ 也是 $overline(lambda_0)$ 的一个特征向量. #def[结论5]若 $AA$ 的每行元素之和为 $k$,则 $k$ 是 $AA$ 的一个特征值,$display(mat(1,1,dots.c,1))$ 是 $AA$ 的一个特征向量. = 矩阵的相似对角化 == 矩阵的相似 设 $AA,BB in PP^(n times n)$,若存在可逆矩阵 $bold(P) in PP^(n times n)$,使得 $bold(P)^(-1) AA bold(P) = bold(B)$,则称 $AA$ 与 $BB$ 相似,记作 $AA ssim BB$. #def[性质1]矩阵的相似具有自反性、对称性、传递性. #def[性质2](矩阵相似的必要条件)设 $A ssim B$,则 #deft[性质2]1. $|AA| = |BB|$; #deft[性质2]2. $r(AA) = r(BB)$; #deft[性质2]3. $tr(AA) = tr(BB)$; #deft[性质2]4. 设 $AA,BB$ 都能对角化,$|lambda EE - AA| = |lambda EE - BB|$(反过来也成立). #deft[性质2]5. 若 $AA$ 不可逆,则 $BB$ 也不可逆;若 $AA$ 可逆,则 $BB$ 也可逆,且 $AA^(-1) ssim BB^(-1)$. #def[性质3]设 $bold(P)^(-1) AA bold(P) = BB$,$lambda$ 为 $AA,BB$ 的特征值,且 $V_lambda^AA =bold(P) V_lambda^BB$. #prof[ #def[证明]设 $XX in V_lambda^BB$,则 $BB XX = lambda XX => bold(P)^(-1) AA bold(P) XX = lambda XX => AA(bold(P) XX) = lambda (bold(P) XX)$. ] #def[性质4]若 $AA ssim BB$,则 $f(AA) ssim f(BB)$,其中 $f(XX)$ 是任意多项式. #def[结论1.1]与幂等矩阵相似的矩阵也是幂等矩阵.(幂等矩阵:$AA^2 = AA$) #def[结论1.2]与幂零矩阵相似的矩阵也是幂零矩阵.(幂零矩阵:$exists p in NN_+$,$st AA^p = OO$) #def[结论1.3]与周期矩阵相似的矩阵也是周期矩阵且周期相同.(周期矩阵:$exists m in NN_+, sp st AA^m = EE$) #def[结论2]若与 $AA$ 相似的矩阵有且只有一个,则 $AA$ 必是一个数量矩阵. #def[结论3]若 $AA$ 可逆,则 $AA BB ssim BB AA$. == 相似对角化 设 $AA$ 与对角矩阵 $Lambda = diag(seqn(lambda,n))$ 相似,则称 $AA$ 可对角化.即存在可逆矩阵 $bold(P)$ 使得 $ bold(P)^(-1) AA bold(P) = Lambda &<=> AA bold(P) = bold(P) Lambda <=> AA vecn(alpha,n) = vecn(alpha,n) Lambda\ &<=> mat(AA alpha_1, AA alpha_2, dots.c, AA alpha_n) = mat(lambda alpha_1, lambda alpha_2, dots.c, lambda alpha_n)\ &<=> AA alpha_i = lambda_i alpha_i sp (i=1,2,dots.c,n)\ &<=> AA "中有一组" n "个线性无关的特征向量" $ 故若 $AA$ 能对角化,则: 1. 对角线上的元素为矩阵 $AA$ 的特征值. 2. 矩阵 $bold(P)$ 第 $i$ 列的 $alpha_i$ 是特征值 $lambda_i$ 对应的特征向量. #def[定理](矩阵可对角化的充要条件)$AA$ 可对角化 #deft[定理]$<==>$ $AA$ 与 $PP$ 上的某个对角矩阵相似。 #deft[定理]$<==>$ $AA$ 在 $PP^n$ 中有 $n$ 个线性无关的特征向量 $seqn(alpha,n)$. #deft[定理]$<==>$ $AA$ 的不同特征值的特征解空间的维数之和为 $n$. #deft[定理]$<==>$ $AA$ 的每个特征值的代数重数 $=$ 几何重数. == 相似对角化的基本性质 #def[性质1]若 $AA$ 能对角化,则 $f(AA)$ 能对角化,且 $f(AA) = bold(P)^(-1) diag(f(lambda_1),f(lambda_2),dots.c,f(lambda_n)) bold(P)$. #note[ #def[总结]如何求 $AA^k$?几种常见的情况: 1. $AA^2 = lambda EE$:运用乘法结合律. 2. $AA = lambda EE + bold(B)$:运用二项式展开. 3. $r(AA_(n times n)) = 1$:转换成 $AA = vecn(a,n)^TT vecn(b,n)$,然后利用矩阵乘法的结合律. 4. $AA$ 能对角化:求出 $AA$ 的特征值和特征向量. ] #def[性质2]若 $AA$ 可逆且 $AA$ 可对角化,则 $AA^(-1)$、$AA^*$ 均可对角化. == 相似对角化的常用结论 #def[结论1.1]幂等矩阵必可对角化. #def[结论1.2]幂零矩阵若非零,则必不可对角化. #prof[ #def[证明]由于 $AA!=OO$,故 $r(AA)>=1$,故 $AA$ 的唯一特征解空间 $dim W_0<=n-1$,不可相似对角化。 ] #def[结论2]幂等矩阵的迹等于它的秩 $==>$ $seqn(AA,s) in PP^n$,$display(sum_(i=1)^n AA_i = EE)$ 且 $AA_i sp (1<=i<=n)$ 是幂等矩阵,则 $display(sum_(i=1)^n r(AA_i) = n)$. #prof[ #def[证明]由幂等矩阵的特征值只有 $0$ 或 $1$,且相似对角化不改变矩阵的秩,故幂等矩阵的秩与迹相同。再考虑将等式两边同时取 $tr$ 并相加,可以得到结论。 ] #def[结论3]设 $AA in PP^(n times n)$,若 $forall beta in PP^n$,$beta$ 均为 $AA$ 的特征向量,则 $AA$ 必是一个数量矩阵. #def[结论4]设 $AA$ 是 $n$ 阶上三角矩阵,则 #deft[结论4]1. 若 $a_11,a_22,dots.c,a_(n n)$ 两两不等,则 $AA$ 可对角化. #deft[结论4]2. 若 $a_11=a_22=dots.c=a_(n n)$ 且 $AA$ 不是对角矩阵,则 $AA$ 不可对角化. == 实对称矩阵的特性 实对称矩阵:$AA = AA^TT in RR^(n times n)$. #def[性质1]设 $AA = AA^TT in RR^(n times n)$,则 $AA$ 的所有特征值、特征向量都是实的. #prof[ #def[证明]设 $AA = AA^TT in RR^(n times n)$,若 $lambda$ 为 $AA$ 在 $CC$ 中的一个特征值,$xi = vecn(a,n)^TT in CC^n$ 为 $AA$ 的属于 $lambda$ 的特征向量($xi!=theta$),令 $abs(xi) = display(sum_(i=1)^n abs(a_i)^2)$(这里的 $abs(sp dot sp)$ 表示复数的模长),则: $ overline(xi) AA xi = lambda overline(xi)^TT xi = lambda |xi|^2\ overline(xi) AA xi = (AA^TT overline(xi))^TT xi = (AA overline(xi))^TT xi = (overline(AA xi))^TT xi = (overline(lambda xi))^TT xi = overline(lambda) abs(xi)^2\ $ 由 $xi$ 是非零向量知 $abs(xi)^2 != 0$,故 $lambda=overline(lambda)$,即 $lambda$ 必须是实数。 ] #def[性质2]设 $AA = AA^TT in RR^(n times n)$,则 $AA$ 的属于不同特征根的特征向量必正交. #prof[ #def[证明]设 $xi_1,xi_2$ 是 $AA$ 的两个特征向量,$lambda_1,lambda_2$ 是其对应的特征根.考察内积 $(AA xi_1,xi_2)$: 一方面:$(AA xi_1,xi_2) = (lambda_1 xi_1, xi_2) = lambda_1 (xi_1,xi_2)$; 另一方面:$(AA xi_1, xi_2) = (AA xi_1)^TT xi_2 = xi_1^TT AA^TT xi_2 = (xi_1, AA^TT xi_2) = lambda_2 (xi_1,xi_2)$. 两式相减得 $(lambda_1-lambda_2) (xi_1,xi_2) = 0$,由于 $lambda_1!=lambda_2$,故 $xi_1,xi_2$ 正交. ] #def[性质3]设 $AA in AA^TT in RR^(n times n)$,则 $AA$ 任一特征值的代数重数 $t$ 一定等于几何重数 $k$. #def[定理]设 $AA = AA^TT in RR^(n times n)$,则 $AA$ 一定可相似对角化.且存在正交矩阵 $bold(U)$ 使得 $ bold(U)^TT AA bold(U) = bold(U) AA bold(U)^TT = diag(lambda_1,lambda_2,dots.c,lambda_n) $ #note[ #def[思考]如何求 $bold(U)$? 可以分别对每个特征线性方程组的解向量组做 Schmid 正交单位化. ] #def[结论1]若实矩阵 $AA$ 正交相似于对角阵 $bold(D)$,则 $AA$ 必对称. #def[结论2]两个实对称矩阵正交相似的充要条件是它们相似.
https://github.com/LDemetrios/TypstParserCombinators
https://raw.githubusercontent.com/LDemetrios/TypstParserCombinators/master/combinators-test.typ
typst
#import "combinators.typ" : force, delay, comp, partial, cons, conj, apply, constantly, stringify, reduce, reduce_v, result, fail-r, map-result, noparse, char-p, char-list, char-not-p, char-not-list, exactly, exactly-as, combine, either, map-p, ignore, iconj, seq, seqf, seqn, or-p, opt, star, plus, stringifing, whole_parser, char-regex-p, skip #let test(parser, inputs) = { for input in inputs { let res = parser(input) assert(res != none) if res.valid { repr(res.value) + " |" + res.tail + [\ ] } else { [failed\ ] } } } #let test-simple(parser) = test(parser, ("a", "a~", "aa", "aab", "b", "b~", "", "x", "x~")) == char-p #test-simple(char-p(c => c == "a")) == char-list #test-simple(char-list("abc")) == char-not-list #test-simple(char-not-list("abc")) == map #test-simple(map-p(upper, char-list("abc"))) == ignoring #test-simple(ignore(char-list("abc"))) #let test-combinations(parser) = test(parser, ("axA~", "axA", "aXA~", "aA", "xA", "yB")) == either #test-combinations(either(char-list("a"), char-list("x"))) == combine === combine regular #test-combinations(combine((a, b) => (a, b), char-list("a"), char-list("x"))) === combine with a delayed #test-combinations(combine((a, b) => (a, b), delay(() => char-list("a")), char-list("x"))) === combine with b delayed #test-combinations(combine((a, b) => (a, b), char-list("a"), delay(() => char-list("x")))) === combine with both delayed #test-combinations( combine((a, b) => (a, b), delay(()=>char-list("a")), delay(()=>char-list("x"))), ) == seq #test-combinations(seq(char-list("abc"), ignore(char-list("xyz")), char-list("ABC"))) == seqf #test-combinations(seqf( stringify, char-list("abc"), ignore(char-list("xyz")), char-list("ABC"), )) == seqn #test-combinations(seqn(1, char-list("abc"), ignore(char-list("xyz")), char-list("ABC"))) == or #test-simple(or-p(char-list("a"), char-list("b"), char-list("c"))) == opt #test-simple(opt(char-list("a"))) == star #test-simple(star(char-list("ab"))) == plus #test-simple(plus(char-list("ab"))) == stringifying star #test-simple(stringifing(star(char-list("ab"))))
https://github.com/miyaji255/Typst-Utilities
https://raw.githubusercontent.com/miyaji255/Typst-Utilities/main/exports.typ
typst
MIT License
#import "./src/lib.typ": fmt-float, display-era
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/049%20-%20The%20Brothers'%20War/001_Episode%201%3A%20The%20End.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Episode 1: The End", set_name: "The Brothers' War", story_date: datetime(day: 20, month: 10, year: 2022), author: "<NAME>", doc ) #strong[69 AR] It was snowing in Penregon. Five years after the war that ended the world concluded, the survivors found that nothing truly ended; in the wake of the machines, the quakes, and the scouring waves, spring still came. Soldiers wandered back from far-flung apocalyptic fronts with their ragged uniforms to beg for rice and bread. Merchants traded their wares and dispatched their ships for distant coasts, exacting gold for goods, erecting manors, and tabulating their customers' debt. Guards policed the streets and borders of the high districts, hands on their swords and eyes wide with the same fear as always. The fields still needed sowing and harvesting; thin laborers still shuffled out to gather grain under the stern eyes of supervisors. The price of bread and milk crept higher, livestock and game grew scarce, the wage one took home from working in the fields did not spend as well, and in the evenings the horizon far to the southeast never really darkened. Life continued in Terisiare, though the spring and summer seasons seemed to run shorter, the warm months compressing into warm weeks, and in winter, snow now fell in Penregon. Everyone who witnessed the cataclysm—that is, everyone in Terisiare—knew the world had ended on that day. Then they woke up the next morning and found that life went on, only it never really seemed to change for the better. The best that people could hope for was that things did not continue to get worse. #figure(image("001_Episode 1: The End/01.jpg", width: 100%), caption: [Art by: <NAME>ec], supplement: none, numbering: none) Five years after the blast, <NAME>-Kroog sat alone in the council chambers of Penregon's government house, listening to the warm crackling of the room's dying fire. With the day's agenda complete but for one last private meeting, her councilors and committee members had all filed out to trudge through the snow back to their homes. They left her alone with Penregon's latest ledgers, census figures, and expedition debriefings—a coterie of nightmares scratched out in watered-down ink on scrubbed paper. Jarsyl had been seen to, sent away for evening study with his tutors. Alone at last. Kayla held a grain report, the numbers grim, and stared over it to a newly drawn map of the Visceral Sea to the east, spread out on the table before her. Empty. The once-verdant island of Argoth to the southeast was gone, reduced to monolithic spires of basalt stone lashed by waves. The merchant guild had demanded this most recent expedition, hoping to revive the old trade routes between Penregon and the distant kingdoms across the ocean, but the small islands they once used to resupply their water and food were gone; either the stars were now wrong, or those islands had been swallowed by the sea. Kayla threw the grain report to the side. She already knew what it would say—the harvests were in and lower than last year, as last year's reports were lower than the year before it, and so on back to when the world as they knew it had ended. The papers fluttered to the floor some distance away near a cracked-open window overlooking the city, where they mixed with the melting flakes of snow drifting in. Snow. Kayla remembered rare walks in her younger years in the foothills around his tower. The mountains, the alpine forests, the wind—winter had a severe beauty that she had tried to relate to Urza's austere bearing, but she could not. The truth was Kayla hated winter. Though the steam heaters pumped enough heat that the whole chamber should be comfortable, Kayla still felt a bone-deep cold. Her council put her in a dark mood. "How distant you gods are now," Kayla muttered. When had the gods last felt close to her? Kroog, before it was sacked. Its airy spires and crowded markets. A home, torn from her. Kayla closed the window. Nostalgia gripped her by the heart today. A hint of distaste to the memory, not for what she recalled but for the pain of recollection; there was a reason for her reverie, due to intrude in moments. A polite knock from the chamber doors drew her attention. The bitter flood of adrenaline that followed was unexpected, uncharacteristic, and unwelcome despite the previous night's preparations. "Yes?" Kayla said, addressing the knock. A young page entered the chambers and cleared his throat. "Ma'am, your last meeting is here." "Send him in," Kayla said. She waved him away. "And bring us refreshments, I'm sure our guest is hungry." The page bowed and then left the chamber, closing the door softly behind. The door opened again, and her guest shuffled in. Kayla looked over to see a dead man. Ragged and wind-chapped, his nose and ears blackened with patches of frostbite, the high ridges of his cheeks peeling where the ice had scoured him. The hale and steady man she knew decades ago withered to a crooked skeleton with crisp, white hair. His eyes remained bright, though, and his voice unmistakable. "Hello, Kayla. You look well." Kayla allowed a polite and hollow smile. "Tawnos," she said. "I thought you were dead." Urza's former assistant bowed. "In a way, I was," he said. Tawnos spoke with a stiffness new to Kayla. In his youth he had always seemed a warm contrast to Urza, an affable man spoiled by his love and devotion to her husband. Now Tawnos was almost a mirror to Urza, even down to his white hair. Kayla waved him toward a seat at the council's table, to which he hobbled and sat. "The world has changed since I was last a part of it." Tawnos said, tucking his cloak around himself. "I never knew it to snow this close to the sea." "The world was changed," Kayla corrected him. "Yes, I suppose you're right," Tawnos grimaced. "But that is past—I have so much to tell you, and much to show." His smile was that of a skull stripped of its flesh. Kayla had seen too many smiles like that since the end of the war, stretched across the faces of the soldiers that returned and the dead piled high on charnel carts. "Nothing is #emph[past] ," Kayla said. "As evidenced by you shambling into Penregon." The door to the council chamber opened, saving Tawnos from having to respond. Two pages wheeled in a cart carrying mint tea and small, steaming, savory pastries. Dinner, for now. "I was with him just before the end," Tawnos said, taking a pastry from the cart. "You were always close with my husband." "He stopped a demon from taking this world," Tawnos said, quiet but firm, eyes downcast. "His brother had been~" Tawnos searched for the word and found it in bitter memory. "Turned by that creature. Fused with a machine." Tawnos looked up, tears brimming. "The same thing would have happened to the rest of us if Urza had not acted. He saved us." Kayla poured herself tea. "You told me he would keep my son safe," she said. Without looking up from her cup, she offered the steeping pot to Tawnos. "I never saw him again." "He—" Tawnos cleared his throat. "Harbin was an example to his men—a brave officer, and a good pilot." "Was his death a good one?" Kayla said. Her voice was even and calm, but colder than the wind that had clipped Tawnos's ears and burned his nose. "If my son was an #emph[example] , I would hope that he was a good example and saved other mothers the pain of losing their firstborn to war." "As a pilot he—" "All Harbin ever wanted to do was make his father proud," Kayla said, interrupting Tawnos. "He always worried, because he was only a pilot and not an artificer like you, that his father thought less of him," Kayla said. "Before—when he was young—Harbin would tell me of his dreams. He dreamed he could fly, and that whenever he returned home, his father would be proud of his flying boy. Did he ever make my husband smile, Tawnos? Before he died, did he make his father proud of him?" "Urza never wished to put Harbin in danger—" "Then why did he start a war for my son to die in?" Kayla snapped. The anger blazed through her, a wildfire. She flung her cup against the wall, where it shattered, echoing throughout the chamber. Tawnos said nothing while she calmed herself. "Tawnos." Kayla spoke, composing each word, shaping every syllable from primordial sound to meaning. "So, we are clear: I will never forgive you for convincing me to allow my son to go off and die in my husband's war. Your road back to my grace is tenfold as long and cold as the bitter trail you followed here." "Yes, ma'am," Tawnos said. "Now tell me what you came here to tell me." Tawnos reached into the folds of his cloak and pulled out a waxcloth roll. He unrolled it on the table, revealing a short sheaf of old papers, thick and yellowed with age. Some water damage crinkled the edges, but not enough to spoil their contents. Kayla recognized them immediately. "Designs," Kayla said. "My husband's work?" "And some of my own," Tawnos said. "I kept them with me while I was away. Avengers, clay statues—you remember those? Ornithopters as well, all types." Tawnos carefully peeled the pages out of their waxcloth roll and displayed them on the table. "Steam engines, communication towers—ships, machines, and devices he had designed. Most for war, to be sure, but some for a peace he hoped to live in one day." "And all useless without powerstones," Kayla said. "Unless we wish to create a~ novelty clockwork rat industry in Penregon." She waved one page bearing the sketched designs for a toy rodent at Tawnos. Tawnos laughed, and then realized that Kayla was not humoring him. He coughed. "Indeed, yes, of course, and to that point, I have good news. I was able to recover a clutch of powerstones and know where we can find more." Kayla leveled her gaze at Tawnos. She steepled her fingers, pressed them under her chin. Closed her eyes. Sighed. "It doesn't matter how much grain we harvest or how many fish we catch, men like you will always be hungry. Tell me." "Before the collapse, Argive had the largest stockpile of powerstones in Terisiare," Tawnos said. "Their storehouses were buried, but in Urza's documents, I found a map. With the powerstones I have in my possession and these designs, I could build new machines to go and dig them out." Tawnos was enthusiastic, as animated as Kayla remembered him in their youth. His wild shock of hair and wide eyes, paired with his frostbitten nose, made him look like some creature from a fairytale—wild, if not almost grotesque. "No weapons, only tools," Tawnos said. "We can use the stones to power automatons that will help us mine and harvest. We can use them to light the city at night, or power heaters to keep the cold at bay." Tawnos leaned forward, reaching toward Kayla. "We could rebuild Penregon. Your guards told me when I arrived that any who saw the light of Penregon was welcome in this city." Tawnos pointed across the room toward Penregon's walls. Kayla knew he was speaking of the lighthouse overlooking the harbor. "I would offer my knowledge and these plans to spread that light across Terisiare." Kayla did not answer, nor did she take Tawnos's hands. The first year after the cataclysm was a year of tumult. In Penregon, the blast caused terrible earthquakes that leveled most of the city's stone and brick buildings, collapsing them on top of their occupants. The king and his court, sheltering in the Lion's Hall—the mighty citadel perched on the vertiginous cliffs overlooking Penregon Harbor—collapsed into the sea. Massive tidal waves followed, pounding the coastal districts, scouring the city streets, scraping them clean of rubble and survivors. When the shaking stopped and the water receded, Kayla bin-Kroog was one of the few nobles left alive. As the wife of the alliance's leader and a princess herself, rule of the city fell to her. Six long years later, and she was still the shepherd of Penregon, the city of remains. "You sound like my husband," Kayla finally said. "All he wanted to do was make the world a better place." "If I may," Tawnos said. "He did ask me to relay a message to you." Kayla arched an eyebrow. "He asked me to tell you to, ah"—Tawnos sipped his own tea—"to 'remember him not as he was, but as he tried to be.'" Kayla laughed, a sharp, crystalline sound that held in it the breaking of her voice. For a moment Tawnos thought it was a genuine laugh, but that moment vanished as soon as Kayla spoke. "Does he think I am still the little princess he won?" Kayla said. "All he ever tried to be—all he and his brother ever tried to be—were princes of the world." Kayla pointed at Tawnos. "You knew that then as well as I do now; through our whole marriage, you spent more time by his side than I did." Tawnos remained silent. "My husband and his brother forced cruel choices on their people," Kayla said. "They burned the world down because neither of them could talk to one another." She reached across the table and picked up one of Tawnos's designs. An upright automaton, one of the war-forms she remembered Urza designing after the sack and ruin of Kroog. Kayla looked at her husband's precise script. His perfectly drawn lines. The machine, rendered in old ink on fine paper, looked as if it could walk off the page if one were to utter its activation command. "Now we must rebuild from those brothers' ashes," she said, setting the page down. "Look at me, Tawnos." Tawnos did as he was commanded. Tears tracked down his weathered cheeks. "Stop crying," Kayla said. "You and me and everyone else lived in the shadow of my husband and his brother. Terisiare was stripped of everything by their war. I lost my father, my son, and my kingdom. Every good and kind thing that made up my life I lost because of him." She gestured around the room—the peeling wallpaper, the gurgling steam pipes. The snow that still fell outside. "I don't relish my husband's death. There has been enough death. But I am happy that he is gone, and I do not forgive him for what he did. I will not remember him as he wanted to be remembered. I will remember him as he was." Kayla's voice was firm as iron. She saw something in the slump of Tawnos's shoulders—a hesitation, distinct from the sinking of his spirit. "Tawnos?" She asked. "What are you not telling me?" Tawnos chewed his wind-chapped bottom lip. Tears welled again, but he blinked them away. "Urza is not dead, ma'am." The pulse at Kayla's temple quickened, and the clench of her jaw could have cracked stone. For Tawnos, who only ever knew Kayla as the bright and lovely princess of Kroog, the iron in the woman who sat across from him was terrifying. Urza had ruined the world, but the one he hurt most was Kayla bin-Kroog. "What?" The anger in Kayla's voice was honed to a needle's precision. "He's not dead," Tawnos said. "He has become~ something else." "Is that 'something else' a better man?" "I'm—I'm not sure what he has become," Tawnos admitted, dropping his gaze. Slowly, he stood and began to scrape together his loose papers, tucking them back into the roll. "What are you doing?" Tawnos stopped. "Leaving, ma'am." Kayla shook her head. "No, Tawnos. Sit. Please." Tawnos sat. "We recovered what we could of my husband's factories after the blast," Kayla said. "Machines, chassis, stones—the things he used to build his automatons in great number. No one here knows how to use them, but with your arrival, it seems that has changed." Kayla gathered her small items and walked Tawnos to the door. "Tomorrow, I will have Myrel, my scout captain, take you to the warehouses so you can begin." "Thank you, Kayla," Tawnos said, pausing at the door. Kayla's lips thinned, offering not even a ghost of a smile. "A long road, Tawnos," she said. "Go. It is cold." Tawnos left, following the waiting page into the candle-lit darkness, leaving Kayla alone once more. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Spring arrived months later, and Penregon became a living city once more. The jagged summits of the Kher Ridges could be seen piercing the range's ever-present shroud of mist, their horns white with the winter's snow. Downslope, new growth stood between the root stumps that were once ancient forests, harvested during the war for fuel and coal. Streams, swollen with snowmelt, tumbled down the mountains, spilling into the fields outside of Penregon where they filled the old defensive trenches, creating new, thin, regimented lakes. Those old battle lines, once a hellish panorama of stone, metal, and fire-stripped earth, were now oceans of grass across which sprays of delicate wildflowers bloomed. Under the flowers, the numberless dead lay unknown but never forgotten. Birds flocked, roosting in the old and decaying communications towers Urza once erected, all those years ago. Near the base of the Khers and out in the marches to the south of Penregon, barren sores marked the earth where the worst of the war's machines had died. Large, corroded hulks listed in pools of dark water, slick with horribly mutated lichens that dripped and never froze. No songbirds made their winter homes inside these machine corpses. No beasts drank from the oil-slick water. A stink simmered the air around them, and Penregon's scouts were careful to mark a perimeter around any such remains they came across in their ranging. Kayla paced along the top of Penregon's new inland wall with Tawnos at her side, looking over the parapet at the work being done along this part of the city's fortifications. Hundreds of laborers worked to fill in the gaps in the old stone wall, whole sections of which had slid into Penregon's ancient moat when the earth shook during the cataclysm. The wall, once a mighty testament to the skill of Penregon's engineers, had tumbled in minutes. Its reconstruction was of low priority until winter started to wane. This spring would bring more than warm weather and flowers: another danger threatened Penregon. A detachment of long-range scouts had returned to the city in the early hours of the morning. Kayla, expecting their arrival, met them at the wall to hear their report. Tawnos had been closing out the late shift at his factory and had hurried to answer her summons. The small group atop the earthworks were a motley collection: Kayla in trousers and a padded coat against the cold, Tawnos in his foundry apron, and Scout Captain Myrel in their muddy uniform under a dark poncho. Myrel had returned from the field this morning and still wore a cloth-wrapped cuirass and sword. #figure(image("001_Episode 1: The End/02.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) "How many?" Kayla asked her captain. "My best assumption is ten thousand," Myrel said. "The front of the march had reached the foothills before the tail had broken camp, but the column was narrow, no more than five abreast." "And how many warriors?" "There did not appear to be a distinction, ma'am," Myrel said. "Most of them carried something: a club, a spear, old armor-breakers and anti-mech pikes from the war. Around two or three hundred mounted riders." Myrel shrugged. "It's not a professional army, but there were many dressed in armor. I saw old Fallaji armor, Korlisian cuirasses, Argivian plate, even some in Yotian mail. It is as you thought—they're organized, but not regimented." Kayla watched the construction below. Laborers and engineers worked alongside some of the earliest models of Tawnos's civil automatons, dragging massive tumbled, but salvageable, stone blocks from the flooded moat via pulleys. Other teams hauled previously salvaged blocks, fresh timber, and baskets of gravel and earth to the breaches in the wall, filling the gaps. This labor stretched all along the inland wall of Penregon, per Kayla's orders. Slow work over the last year, though, with the addition of Tawnos's new automatons, the repairs had picked up speed. "My crews should finish the wall by month's end," Tawnos said, as if listening to Kayla's thoughts. "The city depends on this work," Kayla said. "Let the council know what you need to get this done. Captain Myrel," Kayla said, turning to her scout captain. "Did the march show any colors?" "They flew flags of both sides," Myrel said. "Though the most common was a plain black banner. They also hoisted machine remains." "Remains?" Tawnos asked. "Automaton parts," Myrel said. They grimaced. "As well as the Red Woman's creations, carried in cages or bound up with wire." "Transmogrants," Tawnos said. "Ashnod's hideous work." Kayla knew the name, though only in passing. Some artificer who worked for Mishra during the war—his torturer, when he had been captured. His lover as well, if rumors carried truth. "Tawnos," Kayla called the old artificer's attention. "The automatons—your civils. Can they be converted to the defense of Penregon?" Tawnos furrowed his brow. "You mean, can they fight?" "Yes." "They can. With some time, I could repurpose the civils to wield weapons." He hesitated. "Should I?" "Not just yet," Kayla said. "Though be ready." "I will set my artificers to the task." "Captain?" Kayla said to Myrel. "See that you and your scouts get rest. Come tomorrow, I want steady eyes on this column and daily reports on their movement. We need to know if they are bound for Penregon or elsewhere." Kayla looked to the mountains to the south. Behind those wintered summits, the march gathered. Within a month, the passes would thaw, and surely the ragged march would come upon Penregon's walls soon after. For the first time in years, Kayla felt more than the dull ache of reconstruction's heavy burden. What she felt was sharper, more bitter. The feeling roused her from bed this morning well before dawn, though she had only slept for an hour at most: fear. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Two months later, the shambolic march tromped through the muddy fields outside of Penregon, the sound of their passing a low rumble of boots, horses, and long cart trains. Instead of road dust, distant shouting rose above the column, the conflict of many songs and cadence chants all competing to be the march's voice. The hollering and braying of human and beast, voices raised in prayer or anguish, hunger or protest, joy or—to Kayla's ears—meaningless utterance. It was the sound of delirium, pandemonium, of war and fear and deliverance. It brought to Kayla's mind the memory of the morning Mishra's forces attacked Kroog, how the city of her birth had sounded as it died and became something else: a ruin, a grave, a symbol. Ten thousand souls had been a sober estimate, Kayla realized; had she scouted the march she would have guessed a hundred thousand. The passage of people seemed endless and overwhelming, a dark-clad column winding up from the south to cross the riparian grasslands between Penregon and the Khers. The march reminded her of migrating ants, how they would form an unbroken thread of workers and warriors when traveling from old hive to new, the queen hidden among the commoners. Was it the same with this march? Who was its queen and where were its warriors? Kayla empathized with the scout captain's uncertainty in calling this great assembly an army or a migration. With the aid of Myrel's looking glass, Kayla saw elders and children, masses of people clad in scavenged or makeshift armor, some wearing only rags—all marching together in a heaving mass, swirling, organized by momentum. Like the refugee columns of her youth, this seething river of humanity was a creature, a being whose only drive was to stay together and stay moving. After a time, Kayla did notice some patterns in her observation of the march: Riders hurried alongside the vast number, ferrying messages, distributing water and extra blankets, carrying those too exhausted or otherwise unable to continue on their own back to the long train of rolling carts that followed the march. These riders kept the great column's course as herding dogs would guide livestock. "Ma'am," Myrel called Kayla's attention. They pointed toward a small clutch of black-clad riders that had broken away and begun riding for Penregon's gates. There were only five of them, all armed and armored. One carried a tall lance—an old anti-mech pattern from the war—with a black banner fluttering from its tapered steel point, a white bolt tied beneath. "Emissaries," Kayla said. "Captain, bring a squadron of your scouts. Let us go meet these marchers." Down from the patched walls and into the crowded streets of Penregon in spring, Kayla and her escort of scouts pushed through the noontime press of people, all eager and hurrying to the walls to watch the distant procession. People shouted as Kayla and her guards passed, hollering questions and encouragement. To be seen and acknowledged by the Lady of Penregon was enough for most; the eager reached out their hands, heartened by Kayla's touch. She had an idea of what she had become to the people she led—a living martyr, the forgotten wife of the world-killer who, in the shadow of his passing, led the survivors in carving out a sanctuary. Not a gentle place but a safe one. Secretly, Kayla hated how the people thought of her: she was more than a forgotten, bereaved wife. All the same, each cheering person, each hopeful or fearful face she passed on her way to the gates, drove an iron nail of determination deeper into her: she would see Penregon safe through any adversity set before it. Clearing the gates took some shouting and shoving, but the scouts were able to usher her to the front, where the little gate to Penregon—a door cut out in the much larger stone and ironwork portcullis—stood open. She ducked through and walked out onto the cobblestone road where a line of city guards waited. Captain Myrel hurried to Kayla's side and barked commands to their scouts to do the same. So arranged, Kayla's retinue parted to allow her through. The black-clad emissaries of the march waited to meet her opposite a patch of barren land a scant few yards wide. Kayla wrinkled her nose at their stink, composed herself after the reflex passed. The emissaries did not seem to mind. They slouched over the horns of their saddles, leered toward the city behind her, and waited. "Welcome to Penregon," Kayla said, raising her voice to cross the space between. The sound of the march rumbling along behind the emissaries was an unwelcome substrate, a new background that set the small hairs on the back of Kayla's neck standing up. "All are accepted within our walls on three conditions. Surrender your weapons, maintain yourselves, and contribute to Penregon's well-being," Kayla said. She looked for who among the emissaries would be their leader but found no relief in marks of station or ornament, as the men wore an eclectic mix of sigils, colors, and armor. Kayla's old knowledge of protocol, banners, house signs—all those identifiers of the world long gone—served only to increase her confusion. She settled on the man in the patched set of drop-trooper armor, assuming him to be their leader by his bulk, equipment, and bearing. "We are penitents." A man in an iron-armored coat spoke first. He was older and weathered by a hard life. He had thin salt-and-pepper hair, with a dark beard growing between a spidery web of shallow burn scars. Kayla had seen these wounds before on some veterans of the war: those who had been there at the end, when the machines lashed each other with terrible energy weapons. "We are righteous pilgrims," the man continued, speaking past Kayla to address the people and guards arrayed along Penregon's walls. "We are the living of Terisiare, who seek to clean this land of machine filth." He looked at the battlements, panning across the dark stone, staring at each person there in turn. "We have liberated Korlis and march on an iron pilgrimage. We approach you as kin, with peace and a request: that all who hold righteous hate and fear of the machine join us on our crusade." The man's voice was clear and sturdy, a leader's voice, with an edge like a razor. He was not speaking to her, but to the people of Penregon; Kayla could hear his cruelty. She hoped her people could as well. "We are like you—survivors of the machine demons and the doom that their creators brought upon us. Many of us fought on opposite sides during the war, but in the wake of the end, we now recognize our shared humanity. Do not fear us—join us." One of the marchers in the leader's retinue, a man carrying a black banner, spurred his horse forward. Kayla's scouts stepped back, dropping their hands to their blades, preparing to draw. The flagbearer wheeled his horse in a tight circle, hoisting the black flag high, a salute toward Penregon. The other riders cheered, three shouts to their order's glory. No cheers followed from the curious crowds along the wall. The distant sound of the march filled the space instead. The rising wind snapped the dark cloth, loud as a whip cracking. Kayla furrowed her brow and read the banner, realizing it was more than just a simple black field. Embroidered on it in a deep blue, so dark it was difficult to see from a distance, were two circles, side by side. "<NAME>," the speaker finally addressed Kayla. For a moment she was taken aback that he would know her name—she had assumed them bandits, raiders, maybe even one of the western warlords that her scouts had told her now ruled inland Terisiare. "I am <NAME>." His voice was unaccented to Kayla's ears, placing him anywhere from Yotia in the south to the small Argivian holds in the far northeast. "You do not know me, but I served under your father during the second Suwwardi campaign." Raddic said. He spoke with a rough grace, like most commonfolk officers Kayla knew. Her father at his best had been one like them—a man of rough grace, simple in his understanding of leadership and rule. It was no wonder then that this man seemed familiar. "You are Yotian?" Kayla asked. "I was, yes," Raddic said. "I wandered to the southern Khers after the sacking of Kroog. Found a home there until the Korlisians drafted us for the Tomakul Campaign of 955." He nodded toward the man in the brass cap. "Met old Arah in the trenches, though we did not see each other again until after the Cataclysm." Raddic grinned as much as his scars allowed. "After our defeat, I spent the rest of the war in a Fallaji work camp." "What a journey," Kayla said drily. "All of us living have suffered one like it," Raddic agreed. "And what is this?" Kayla asked, pointing toward the marching column in the distance. "Another army, gathering old soldiers? Or something else?" Raddic looked up, staring past her and up to the walls, as if self-conscious under the gaze of the crowds that watched their little summit. "I spoke the plain truth, <NAME>." Raddic said. "We are warriors for humanity. Crusaders against the mage, the unliving, and the machine demon." Raddic raised his left hand to his heart, and Kayla saw that his fingers had been shortened—likely cut away in some battle. "We began our crusade with a purge of the Gixian lands to the far north, emptying out that wretched temple of oil and machine," Raddic said. "We then marched through the desert that was the old Fallaji empire, and then through the ruins of fair Kroog. Korlis followed; we liberated her from a cruel machine warlord and recruited many to our cause. Now we are bound for the Iron Tower, where the Lord Protector," Raddic practically spat Urza's old title, "once birthed his machine demons into the world. We seek only food, water, and what other supplies you can spare. As well I ask that my priests be welcomed into your streets to minister to the people and call the faithful to arms." "The Iron Tower?" Kayla asked, ignoring Raddic's request. "Do you know it?" he asked, without a hint of a question softening his words. Did she know it? He meant Urza's old tower. "I was taken there once, years ago," Kayla said. "But I could not tell you the way. It is well hidden in the mountains somewhere to the west or southwest. You'll know it by the thick mist that surrounds it." "Your husband was not a trusting man," Raddic said. Kayla bristled. "Urza was not a trusting man, no." "Why not come with us then?" Raddic said. "Show us the way, lend us your soldiers. Come and wipe this world clean of machines." Kayla looked past Raddic toward the slow-moving march in the distance, that mass of humanity. Everyone carried something—heavy packs, weapons, the elderly too feeble to walk or children too young to carry themselves. The war had ruined so much. These poor people. Kayla did not fear them anymore; she understood. Raddic's hatred for the machine was the same hatred she held, only he was free to follow that burning vein to its bloody end. Kayla had a city to lead, a world to rebuild—not a grave to fill. "I cannot," Kayla said, tearing her eyes from the sight. "I am the queen regent of Penregon, not a warrior, nor a storied commander. I am, however, willing to trade. We have goods, food, and artisans," Kayla said. "Your people are free to seek refuge in our city, but we ask that no soldiers enter. No weapons may cross our gates." Raddic bowed as best he could on horseback. "Your charity will be remembered," he said. "Thanks be to Tal for your humanity." Tal. An old god of Yotia, something to do with the sun. Kayla recognized the name but did not recall any great cults or monuments to the deity; the end of the world shook all kinds of strange things from their hidden corners. "You quest for all of us," Kayla said. Polite, neutral. "Penregon is happy to see you along your way." Raddic grinned, understanding her diplomatic language well. He clicked his tongue to his horse, turning it around. His guards followed suit. Without looking back, he raised his shortened hand to the sky, a lazy gesture, half-wave, half-salute. A farewell, for now. Kayla, escorted by her own retinue, walked back through the gates into the safety of Penregon. The crowds on the wall talked a rainfall chorus of excitement, curiosity, bravado, and fear. It was the sound following a decision before its outcome was decided. Kayla only hoped that she had made the correct one, and that the days to come would not prove her charity wrong. #figure(image("001_Episode 1: The End/03.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Peace lasted a day and ended in screams. Kayla did not hear them at first; she was busy in a meeting with representatives from Penregon's fisher guilds, mediating as the masters hollered accusations of net-slicing and claim jumping at each other. Fish, unlike land-based game and agricultural industries, had not been brutalized by the cataclysm; poor before the war, after its end, these fisherfolk had become fantastically wealthy. With much of the world guttering like a dying candle, piscine gold came to be bitterly contested by the sailors who worked long hours to harvest it, though no dockyard fight was as bloodthirsty as these arguments over contracts, fishing rights, and fleet timber. Kayla had just thrown her hands up in frustration when Tawnos entered the council chambers. "Ah, thank the gods," Kayla said. She spoke without worry, as the guildmasters certainly could not hear her over their shouting. "Nothing so sweet as moving from misery to annoyance." Kayla stood and hurried over to her artificer, motioning for him to leave the council chambers. "They'll be fine," Kayla said, reassuring him when he looked to the arguing guildmasters. "They'll have it out at some point, or the guards will step in before." Kayla took Tawnos by the arm and walked with him down the hall, guiding him with the determination of a harbor pilot navigating a treacherous strait. She stopped next to a narrow window overlooking inland Penregon, with a view of the mist-shrouded Khers. There was a stiffness about Tawnos, a rigidity that turned Kayla's relief to concern. All the same, she kept her pleasant tone—voices carried in stone halls. "Now, tell me," Kayla said. "What is important enough to have drawn you out from your factory?" "There's been an incident," Tawnos said. "A group of Talites in the market attacked one of my civils." Kayla swore. "Did it—" "No," Tawnos said. "No. None of the models in the city have been trained or equipped to fight. It didn't fight back. The city guard, however." Tawnos sighed. He checked down the hall to see that they were alone. "Two of the pilgrims are dead and one of our guards was wounded. She'll live. The rest of the pilgrims near the area were arrested." Kayla stepped to the window. From this vantage point, nothing seemed different. The march had slowed or stopped in the fields outside of Penregon, and thin gray ribbons of campfire smoke drifted up, tugged along by the wind. Cookfires and industrial smoke bled from chimney tops all over Penregon. People bustled about their work. It was a normal spring evening, though the news Tawnos brought colored the panorama with a sinister tint. "Did any of their order witness the attack?" "There were dozens of people there," Tawnos said. "I would be more shocked if the marchers did not hear of this." Kayla swore again. "The Talites attacked the civil unprovoked?" "Yes," Tawnos said. "They called it a demon. They managed to damage one of its knee joints, but nothing serious—it can be repaired in an afternoon, no more." "Fine," Kayla said. "We will try to keep this quiet. I—" A shout echoed through the government house. A door slammed open, followed by the sound of booted feet charging through the bottom floor. Kayla looked to Tawnos with concern, then to the end of the hall where a corner hid the stairs to the floor below. The two braced themselves for who would round the corner. "Ma'am! L<NAME>!" Kayla exhaled. She leaned a little against the wall. It was only Myrel. "I'm here," Kayla called back. She reached over and patted Tawnos on the shoulder. "Composure," she said, quietly. Tawnos nodded, unclenched his fists. Scout Captain Myrel rounded the hall, out of breath, followed by a pair of their scouts. Their eyes were bright and cheeks flushed—adrenaline, the cold: action. "L<NAME>, we need to get you to safety," Myrel said between breaths. "The marchers are arranging against the city." "What?" Kayla said. First the civil, now the marchers. Where was Jarsyl? With one of his tutors, to be sure. She would need to send for him, keep him close— "Ma'am," Myrel interrupted, calling Kayla's attention. They pointed out the window, toward the distant campfires. "Raddic and a dozen men, all armed—they're approaching the gates, and my scouts have seen their marchers arming themselves for battle." "Then they know," Kayla said. "We must tell them Tawnos's civils are not the same machines—" "Ma'am, please," Myrel said. "We should go to a higher floor. I have my scouts barricading the house—" "Send them to find Jarsyl and bring him here." Kayla said. "I will not hide, not just yet." Concern crossed Myrel's face. Kayla waved it away. "This is my city, captain. I will not hide when Penregon is threatened." Myrel nodded to the two scouts, who saluted and took off at a run to find Jarsyl. Kayla watched them go, then turned back to the window. The setting sun flared warm behind the Khers, plunging the fields outside of Penregon into a premature twilight that hid the black-clad marchers. As Kayla watched, cookfires stippled the darkness, flaring like dim stars in deep night. This march outnumbered Penregon's warriors. How many did they have in the city's colors? A mere hundred scouts, a city guard numbering less than a thousand. She could order the city levies to be called, but that would put untrained people on the line of battle. Penregon's strength was her isolation, but when she was not isolated, and when a force threatened the city— Enough. There was only one option left for Kayla. In her youth, she fled Kroog and never returned. To this day, her home was a ruin. Kayla would not flee Penregon. "Tawnos, arm the civils," Kayla ordered. Tawnos rocked back on his heels—a small movement betraying his surprise. "I don't know if we should do that," he said. Kayla's eyes flared with the same steel that had animated Urza, cold and efficient. Brilliant, unrelenting. "I lived through the end of the world as well, Tawnos," Kayla said. "I was not on the front, but I know what I am asking you to do." Kayla reached out and laid a hand on his upper arm, squeezing it. In their youth, a gesture like that would have sent sparks shooting through him. Now, it was only pressure. "I am not Urza," Kayla said. "I'm asking you to do this to protect Penregon and her people. Nothing more." Tawnos placed his hand over hers and squeezed. "Thank you," Kayla said. She lifted her hand from Tawnos's arm and turned to her captain. "Myrel?" "I have already called the scouts," Myrel said. "And the city guard has been on alert since yesterday." "Levy the militia," Kayla said. "Empty the armories. Send everyone able to lift a spear to the walls." "They won't be much in a fight." "I know," Kayla said. "But we need numbers. Find those with experience from the war and have them lead the others. They will fight to defend their city. Go." Kayla did not turn from the window as Myrel ran to carry out her commands; to turn from the window meant the beginning of a terrible new chapter, a return to the cruelties of the old world. Penregon was a fragile place, her walls unnecessary for years before today. Kayla hoped that they would become no more than a relic after this: a reminder and a warning of the worst of the old world. Kroog fell in the morning. The memory came to Kayla with an unwelcome and bitter pang. A hazy spring dawn, the dew still fresh on the leaden glass of the city's magnificent towers. Kroog's red brick streets were still damp from the evening's rain and only just beginning to steam in the morning heat. She fled the city, pregnant with her son. Tawnos had been there as well; he saw her safe from the city, fleeing with her while her people died. Kayla turned from the window. "It is disheartening how little the world has changed," she said to Tawnos. "I thought we would have learned our lesson by now." Tawnos looked up from his journal. He was jotting notes on the steps necessary to arm the civils—reminders, orders, ideas. He frowned, his brow furrowing. "With respect," he said, "I think as long as there are people, the world will never really change." "I hope you are wrong," Kayla said. "How soon can you have the civils ready to defend Penregon?" "Give me an hour to brief my artificers," Tawnos said. His voice wavered in a way Kayla had never heard from him. "The civils are easy enough to adapt—I could have dozens ready by the evening, and a hundred by morning." He spoke like a man chewing gristly meat—persevering through what must be done. "Good," Kayla said. "And then we march them into the sea after this, yes?" It took a moment, but Tawnos realized that Kayla was joking with him. He smiled, and Kayla laughed. Short and sharp. Nervous, but genuine. With a parting nod, Tawnos hurried to work. #figure(image("001_Episode 1: The End/04.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) "You harbor machine demons," Raddic said, barking at Kayla as she emerged from the portcullis. Slouched over his saddle horn, mouth never quite closed, the sun setting over his shoulder, Raddic struck an animalistic silhouette. His posture reminded Kayla of the languid way some predatory cats carried themselves—relaxed and deadly. His voice was cold as a dagger's blade, and this time, ten riders in black armor flanked him. "When our faithful tried to drive the machines out, your guards killed them," Raddic all but hissed between his teeth. "Can you not hear their children crying? Or does the buzz of your city's hellstones drown them out?" Hellstones? The streetlights, Kayla thought. Last winter, Tawnos had sent his artificers to install chips of shattered powerstones in the public torches, ensuring that even in the bitterest of winter storms, Penregon stayed lit against the dark. In quiet corners of the city, one could hear them buzzing. A creeping, prickling realization crawled up Kayla's back. Kayla had never seen the black banner of Tal flown in the city, nor had she heard any street preachers extolling the sun god's scripture, but she could not be everywhere. "How long have your people been inside Penregon?" Kayla asked. "Long enough to know that this city cannot be saved," Raddic said. "Many of the faithful arrived here years ago, desperate for shelter, thinking that you of all people would know the danger of the machine. They watched in horror how you welcomed one of the Lord Protector's own into your council, how your artificers labored to bring more machines to life, and how they train Penregon's mechanical demons to obey their commands. The faithful braved the bitter passes to tell us that Penregon stands unrepentant," Raddic snarled. "You and your people are fools. You raise new walls and consume the earth in the same manner as the killers Urza and Mishra did. Tell me, <NAME>—why do you cling to the very things that killed the old world?" "Our civils are not those machines," Kayla said. "The works of Urza and Mishra died when they died. We are building—" "New demons for a new world," Raddic said, dismissing her protest. He glared past her, toward Penregon. "We cannot save this city," he said. "We do not need your help," Kayla said. "We offered you supplies for your journey to the Tower as you asked, aid to your people after their long journey, but now you must continue on. Penregon has no need of you, nor do we want to fight. Leave us." "Cast them out," Raddic ignored her. He called up to the city walls, looking to the guards and nervous militia there. "Drive the machine demons into the sea," he said. "Prostrate yourself and beg Tal's forgiveness. March to the White Tower and tear it down, brick by brick, or come the dawn, we will do the same to Penregon." Myrel started to draw their sword, but Kayla held up her hand. Myrel slid their sword back into their scabbard, glaring at Raddic. "People of Penregon," Raddic bellowed. "You are not our enemies yet. You who spit on and curse the machine demons, you who reject the leaders who cannot imagine a world without machines—you will find company in our numbers." He reached back to one of his companions, who passed him a spear. "The age of machine-magic is dead," Raddic said, raising the spear above his head. "Choose: die with it or live with us!" Myrel drew their sword fully this time, but Raddic did not attack. Instead, Raddic threw the spear on the cobblestones between him and Kayla. It skittered and bounced to a stop at her feet. "Dawn," Raddic said. "You decide, <NAME>." He wheeled his horse around and whistled to his riders. Together, they spurred their horses into motion, making for their camp. "Should I have my archers fire?" Myrel asked. A cold wind rattled across the cobblestone road leading into Penregon. The fields stretching out before the city, so vibrant at the start of spring, were ground to muddy ruin. The dark river of the Talite march spread across it, their campfires burning. The Khers loomed beyond, gray and stark. It was the end of the world. The end of the age of artifice and machines; come dawn, a new age would break across Terisiare. "Save our arrows," Kayla said. "We'll need them tomorrow."