repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/jultty/skolar | https://raw.githubusercontent.com/jultty/skolar/main/template.typ | typst | #let properties_schema = (
title: "Document Title",
author: "<NAME>",
course: "Course Name",
course_id: "COURSE_ID",
date: datetime.today().display("[day]/[month]/[year]"),
landscape: false,
margin_x: 2cm,
margin_y: 2cm,
paper: "a5",
)
// completes the user-provided properties with default values for missing fields
#let complete_properties(user_properties) = {
let completed_properties = (:)
for (key, value) in properties_schema {
completed_properties.insert(key, user_properties.at(key, default: value))
}
completed_properties
}
#let generate_header(properties) = {
align(center, [
#text(size: 1.8em, font: "Baskerville", properties.title) \
#text(size: 1.0em, font: "LT Remark", pad(properties.course))
#text(size: 1.0em, font: "Alegreya", properties.author) \
#text(size: 0.6em, font: "Wittgenstein", properties.date)
#v(30pt)
])
}
#let img(path, caption) = {
pad(y: 2em, [
#figure(
image(path, width: 100%),
caption: caption
)
])
}
#let footer_lead(properties) = [Trabalho realizado para a disciplina de #properties.course (#properties.course_id) do curso de _Análise e Desenvolvimento de Sistemas_ do Instituto Federal de São Paulo, campus Jacareí.]
#let pager(properties, loc) = {
let page = counter(page).at(loc)
if page.at(0) == 1 {
[
#line(length: 20%, stroke: 0.2pt)
#text(font: "Baskerville", size: 7pt, footer_lead(properties))
]
} else {
align(center, [#page.at(0)])
}
}
#let generate_document(body, properties: {}) = {
properties = complete_properties(properties)
set document(
title: properties.title,
author: properties.author,
date: auto,
keywords: (properties.course, properties.course_id, "IFSP", "IFSP-JCR"),
)
set text(font: "Baskerville", size: 10pt, lang: "pt")
set heading(numbering: "1.")
set enum(numbering: "1.1.", full: true)
set par(justify: true, leading: 0.7em,)
set quote(block: true, quotes: true)
set footnote.entry(gap: 1em, clearance: 1em)
show quote: set text(style: "italic")
show figure: set figure(gap: 2em)
show ref: set text(rgb("#308280"))
show link: underline
set page(
paper: properties.paper,
flipped: properties.landscape,
margin: (x: properties.margin_x, y: properties.margin_y),
numbering: "1",
footer: locate(loc => pager(properties, loc)),
footer-descent: 20%
)
generate_header(properties)
body
}
|
|
https://github.com/Error-418-SWE/Documenti | https://raw.githubusercontent.com/Error-418-SWE/Documenti/src/2%20-%20RTB/Documentazione%20interna/Verbali/23-11-19/23-11-19.typ | typst | #import "/template.typ": *
#show: project.with(
date: "19/11/23",
subTitle: "Meeting di retrospettiva e pianificazione",
docType: "verbale",
authors: (
"<NAME>",
),
timeStart: "15:00",
timeEnd: "17:00",
);
= Ordine del giorno
- Retrospettiva dello Sprint 2;
- Discussione stato di avanzamento;
- Pianificazione Sprint 3.
== Retrospettiva Sprint 2
Il gruppo si è riunito per discutere il lavoro svolto durante lo Sprint 2. Utilizzando la board Miro di retrospettiva, ogni membro ha indicato i pregi dell'attuale organizzazione del lavoro e i processi migliorabili.\
È stato discusso il fatto che durante le interviste al Proponente non tutti i membri del gruppo interagiscono o interagiscono poco a differenza di pochi altri che intervengono maggiormente. È stato quindi deciso che i membri del gruppo che hanno interagito meno si impegneranno maggiormente durante queste occasioni a interagire in maniera costruttiva con il Proponente.\
Un altro problema riscontrato è stata la lentezza dell'approvazione di alcune PR da parte dei verificatori. La causa è stata individuata nell'alto numero di controlli manuali, poiché oltre al controllo grammaticale, lessicale e sintattico si aggiungevano le verifiche di correttezza dell'output delle GitHub Action (ancora parzialmente in fase di testing). La mitigazione delle cause di questo problema è prevista per lo Sprint successivo.
== Discussione stato di avanzamento
Si è notato un netto aumento del ritmo di lavoro e ora che il gruppo comincia a prendere confidenza con gli strumenti è aumentato anche il lavoro autonomo (mentre prima si riscontravano problemi con automazioni o con nuovi strumenti e quindi bisognava consultare un altro membro del gruppo che aiutasse nella risoluzione del problema).
= Azioni da intraprendere
- Ultimare i test delle automazioni;
- Ultimare il template dei documenti;
- Continuare il lavoro sui documenti "Norme di Progetto", "Analisi dei Requisiti" e "Piano di Progetto";
- Inviare un reminder all'azienda per l'incontro programmato per giovedì 23/11/23 dalle ore 14:00 alle 15:00;
- Attuare il cambiamento dei ruoli, causa rotazione bisettimanale.
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-30.typ | typst | Other | // Test the `binom` function.
#test(calc.binom(0, 0), 1)
#test(calc.binom(5, 3), 10)
#test(calc.binom(5, 5), 1)
#test(calc.binom(5, 6), 0)
#test(calc.binom(6, 2), 15)
|
https://github.com/lphoogenboom/typstThesisDCSC | https://raw.githubusercontent.com/lphoogenboom/typstThesisDCSC/master/typFiles/acronyms.typ | typst | // Dictionary with acronyms
#import "../acronymList.typ": acronyms
// The state which tracks the used acronyms
#let usedAcronyms = state("usedDic", (:))
// #acro() displays long name format for acronyms in acronymsList.typ
#let acro(key) = {
if(acronyms.keys().contains(key) == false) {
return rect(
fill: red,
inset: 5pt,
radius: 1pt,
[!Unknown Acronym: #key!],
)
}
else {
return acronyms.at(key)
}
}
// #acro() displays long name format for acronyms in acronymsList.typ
// e.g.: #acrof("TUD") Technisch Universiteit Delft (TUD)
#let acrof(body) = {
if(acronyms.keys().contains(body) == false) {
return rect(
fill: red,
inset: 5pt,
radius: 1pt,
[!Unknown Acronym: #body!],
)
}
usedAcronyms.display(usedDic => {
if(usedDic.keys().contains(body)) {
return body
}
return text(body,weight: "bold") + h(2em) + acronyms.at(body)
});
usedAcronyms.update(usedDic => {
usedDic.insert(body, true)
return usedDic
})
} |
|
https://github.com/seven-mile/blog-ng-content | https://raw.githubusercontent.com/seven-mile/blog-ng-content/master/_typst_ts_tmpl/template.typ | typst | #let heiti = ("Times New Roman", "Source Han Sans SC", "Source Han Sans TC", "Noto Sans CJK SC", "Noto Sans CJK TC", "New Computer Modern", "New Computer Modern Math")
#let songti = ("Source Han Serif SC", "Source Han Serif TC", "Noto Serif CJK SC", "Noto Serif CJK TC", "New Computer Modern", "New Computer Modern Math")
#let zhongsong = ("Times New Roman","STZhongsong", "SimSun", "New Computer Modern")
#import "@preview/typst-ts-variables:0.1.0": page-width, target
// The project function defines how your document looks.
// It takes your content and some metadata and formats it.
// Go ahead and customize it to your liking!
#let project(title: "Untitled", keywords: (), date: datetime(year: 1970, month: 1, day: 1), description: "", body, width: page-width, backend: target) = {
// Set the document's basic properties.
let style_color = rgb("#000")
set document(title: title, keywords: keywords, date: date, author: description)
set page(
numbering: none,
number-align: center,
height: auto,
width: width,
)
set page(margin: (top: 20pt, bottom: 20pt, rest: 0em)) if backend.starts-with("web");
set text(font: songti, size: 16pt, fill: style_color, lang: "en")
// math setting
show math.equation: set text(weight: 400)
// code block setting
show raw: it => {
if it.block {
rect(
width: 100%,
inset: (x: 4pt, y: 5pt),
radius: 4pt,
fill: rgb(239, 241, 243),
[
// set text(inner-color)
#place(right, text(luma(110), it.lang))
#it
],
)
} else {
it
}
}
// Main body.
set par(justify: true)
body
}
|
|
https://github.com/Coekjan/typst-upgrade | https://raw.githubusercontent.com/Coekjan/typst-upgrade/master/README.md | markdown | MIT License | # Typst Upgrade
[](https://crates.io/crates/typst-upgrade) [](https://crates.io/crates/typst-upgrade) [](https://github.com/Coekjan/typst-upgrade) [](https://github.com/Coekjan/typst-upgrade) [](https://codecov.io/gh/Coekjan/typst-upgrade)
Help you to upgrade your Typst Packages.
## Usage
To upgrade your typst-package dependencies, you can use the following command (assuming your project located in `/path/to/your/project`):
```console
$ typst-upgrade /path/to/your/project
```
See `typst-upgrade --help` for more information:
```console
$ typst-upgrade --help
A tool to upgrade typst packages
Usage: typst-upgrade [OPTIONS] <TYPST_ENTRY_PATHS>...
Arguments:
<TYPST_ENTRY_PATHS>...
Options:
-d, --dry-run Dry run without editing files
-i, --incompatible Allow incompatible upgrades
--color <COLOR> [default: auto] [possible values: auto, always, never]
--diff <DIFF> [default: short] [possible values: short, full, none]
-v, --verbose Print more information
-h, --help Print help
-V, --version Print version
```
## Installation
### Cargo
You can install `typst-upgrade` via `cargo`:
```console
$ cargo install typst-upgrade
```
Or if you use [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall), you can install `typst-upgrade` via `cargo binstall`:
```console
$ cargo binstall typst-upgrade
```
### Prebuilt Binaries
You can download the prebuilt binaries from the [release page](https://github.com/Coekjan/typst-upgrade/releases).
## License
Licensed under the MIT License.
|
https://github.com/hugoledoux/msc_geomatics_thesis_typst | https://raw.githubusercontent.com/hugoledoux/msc_geomatics_thesis_typst/main/appendices/someumldia.typ | typst | MIT License |
= Some UML diagrams
#figure(
image("../figs/someuml.svg"),
caption: [The UML diagram of something that looks important.],
)<fig:someuml> |
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-justify-cjk_02.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test punctuation whitespace adjustment
#set page(width: auto)
#set text(lang: "zh", font: "Noto Serif CJK SC")
#set par(justify: true)
#rect(inset: 0pt, width: 80pt, fill: rgb("eee"))[
“引号测试”,还,
《书名》《测试》下一行
《书名》《测试》。
]
「『引号』」。“‘引号’”。
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas5/1_Pondelok.typ | typst | #let V = (
"HV": (
("","Rádujsja póstnikom","Pláču i sítuju hórci, smotrjája strášnoje slóva vozdajánije, ot ďíl ne imýj otvíta i mála protívu viňí, okajánnyj. Ťímže moľúsja: préžde dáže ne postíhnet mjá koncá mojehó bezmístnoje, préžde požátija smértnaho, préžde sudá strášnaho, préžde choťášču mí osuždénije prijáti, iďíže óhň nehasímyj, i ťmá kromíšňaja, iďíže čérv, i skréžet, i sňidájet sohrešívšyja, sohrišénij mí dáruj izbavlénije Christé mój, i véliju mílosť."),
("","","Zakóny tvojá i pisánija prezrív, zápovidi tvojá otverhóch okajánnyj Bóže mój, soďíteľu mój, káko izbíhnu próčeje támošňaho Spáse, mučénija? Ťímže préžde koncá mojehó Spáse, proščénije mí dáruj, sléz túču, ístinnoje umilénije podajá, jáko Bóh preblahíj daléče ot mené othoňája polkí bisóvskija, íščuščich nizvestí mjá vo ádovu própasť. Ťímže moľúsja tí, da ne rúku tvojú otímeši ot mené vsemóščnuju."),
("","","Uvý mňí! káko omračíchsja umóm: káko udalíchsja ot tebé, i rabótach okajánnyj hrichú i slásti plótsťij sebé vsehó strástnyj izdách, žívšej vo mňí strástňim? I nýňi ožidáju mojehó jéže ot žitijá ischóda, i choťáščaho tomlénija býti: Hóspodi preblahíj, podážď mí sléznoje pokajánije, i razrišénije bezčíslennych prehrišénij mojích. Vírno ťá moľú, podajúščaho mírovi véliju mílosť."),
("","Rádujsja póstnikom","Taínnicy Bohonačálija čestníji, trisvítlaho i jedinosúščnaho božestvá, íže písň neprestánno bezplótnymi hlásy i jazýki óhnennymi prinosjášče, náša molénija i molítvy prinesíte, jáže ot ustén skvérnych vozsylájem, i ostavlénije prehrišénij isprosíte: vísť bo némošč nášu obolkíjsja v ňú, i mílostiv sýj jestestvóm, molénija prijímet váša o rabích sohrišívšich byvájemaja, podajáj mírovi véliju mílosť."),
("","","Vsé ánheľskoje mnóžestvo jéže Vladýci mojemú približájuščejesja, i tohó božéstvennomu prestólu predstojáščeje so stráchom, i ispolňájemi neizrečénnym svítom, mené vo ťmí hrichóvňij zablúždšaho nastávite k svítu spasíteľnomu, poveľínijem Bóha ščédraho, ťmú otženíte mráčnuju i čuždúju kovárnych bisóv, zastuplénijem i blahodátiju vášeju: ne terpít bo svíta prišéstviju, no othoňájetsja."),
("","","Ánheli svítliji Bóžiji, predstojášče prestólu blahodáti božéstvennomu, smirénije súščeje i prosviščénije ístinnoje ot svíta božéstvennaho vosprijémľušče, nás nazirájte s nebés čelovikoľúbcy, v búri ľútych deržímych, i bídstvujuščich, i vo ťmí spjáščich. Prijidíte úbo, o archánheli! Nám v pómošč, i sitéj izbávite nás zlonačáľnaho vrahá: k vášemu vo króvu pribihájem vsí, prechváľniji."),
("Bohoródičen","","Prestól cheruvímskij voístinnu, jáko prevýšši ánhel bývši, v ťá bo božéstvennoje Slóvo vselísja čístaja, náš óbraz obnovíti choťá: iz tebé prošéd plotonósec jáko milosérd, krest i strásť nás rádi priját, i voskresénije jáko Bóh darová. Ťímže jáko preminívšuju nás osuždénnaho jestestvá, sozdáteľu víroju blahodarjášče mólimsja, ulučíti tvojími molítvami prehrišénij proščénije, i véliju mílosť."),
),
"S": (
("","","Hóspodi, sohrišája ne prestajú, čelovikoľúbija spodobľájem ne razumíju: odoľij mojemú nedoumíniju jedíne bláže, i pomíluj mjá."),
("","","Hóspodi, i strácha tvojehó bojúsja, i zlóje tvorjá ne prestajú: któ na sudíšči sudijí ne bojítsja? Ilí któ uvračevátisja choťá, vračá prohňívajet jákože áz? Dolhoterpilíve Hóspodi, na némošč mojú umilosérdisja, i pomíluj mjá."),
("","","O zemných vsích neradívše, i na múki múžeski derznúvše, blažénnych nadéžd ne pohrišíste: no nebésnomu cárstviju nasľídnicy býste, prechváľniji múčenicy. Imúšče derznovénije k čelovikoľubívomu Bóhu, míru umirénije isprosíte, i dušám nášym véliju mílosť."),
("Bohoródičen","","Strášno i preslávno, i vélije táinstvo, nevmistímyj vo črévi vmistísja, i Máti po roždeství páki prebýsť Ďívoju: Bóha bo rodí iz nejá voploščénna. tomú vozopijím, tomú písň rcém, so ánhely vospivájušče: svját jesí Christé Bóže, íže nás rádi vočelovíčivyjsja, sláva tebí."),
)
)
#let P = (
"1": (
("","","Koňá i vsádnika v móre čermnóje, sokrušájaj bráni mýšceju vysókoju Christós istrjasé: Izráiľa že spásé, pobídnuju písň pojúšča."),
("","","Čúdo v tebí soveršájetsja Ďívo, voístinnu užásno: jáko vo utróbi tvojéj nikákože vmistímaho imíla jesí, i neskazánno rodilá jesí, prisnoďívoju prebývši."),
("","","Odoždí mi Vladýčice, prehrišénij ostavlénije, jáže dóžď nebésnyj prišédšij k tebí, neizhlahólanno vmistíla jesí, i Ďívoju prebylá jesí po roždeství nepostížňim."),
("","","<NAME>énnaja i Bohorádovannaja, jáže rádosť čelovíkom róždšaja neizrečénnuju, pečáli otimí duší mojejá moľúsja, i vozveselí sérdce mojé."),
("","","Vés želánije i sládosť žízni, íže ot tebé vozsijávyj za premnóhuju bláhosť, Ďívo preneporóčnaja: jehóže molí spastí mjá, neprestánno nýňi ťá slávjaščaho."),
),
"3": (
("","","Vodruzívyj na ničesómže zémľu poveľínijem tvojím, i povísivyj neoderžímo ťahoťíjuščuju, na nedvížimim, Christé, kámeni zápovidej tvojích, cérkov tvojú utverdí, jedíne, bláže i čelovikoľúbče."),
("","","Preidóša sínem zakonotvorímaja: zakonodávca bo Christá rodilá jesí prečístaja, blahodáť očiščénija i prosviščénija nám vzakónivšaho, i ot kľátvy izjémšaho Ďívo vseneporóčnaja."),
("","","Rodísja ot tebé čístaja, Bóh voploščájem, i plótiju víďin býsť, íže préžde nevídimyj. sehó úbo molí priľížno otrokovíce, ot vídimych i nevídimych vráh mjá izbáviti, svítlo ťá slávjaščaho."),
("","","Strastéj mjá ľúta oburevájet voľná, lukávych duchóv hlubiná oderžít mjá, hrichóvnaja búrja smuščájet mí sérdce: Bohorodíteľnice, tý mja utverdí, svítlo ťá pojúščaho."),
("","","Božéstvennaho Havrijíla činonačáľnika imúšče, blahohovéjno jéže rádujsja, víroju privódim sohlásno, neiskusobráčňij Máteri Bohoródici vírno: jéjuže bíd že i skorbéj, i nedúh izbavľájemsja."),
),
"4": (
("","","Božéstvennoje tvojé razumív istoščánije, prozorlívo Avvakúm, Christé, so trépetom vopijáše tebí: vo spasénije ľudéj tvojích, spastí pomázannyja tvojá prišél jesí."),
("","","Istkávšaja vnútr ot krovéj tvojích ďivíčeskich, nébo óblaki Ďívo, oďivájušča odéždeju netľínija, préžde léstiju obnažénnaho mjá oblecý."),
("","","Utróba tvojá Ďívo, paláta svjatá carjá i Bóha neskazánna býsť, v ňúže vselívsja, cérkvi nás soďíla."),
("","","Uščédri ščédra súšči preokajánnuju mojú dúšu, Bohorodíteľnice vseneporóčnaja, júže ot strastéj i hrichá ľúťi očerňívšuju i ocepeňívšuju."),
("","","Netľínnaho cárstva vozsijála jesí skípetro, ot kórene Jesséova, i raždáješi otročá bezmúžno čístaja, Adámova i Davídova Bóha, vkúpi i ziždíteľa i Hóspoda."),
),
"5": (
("","","Oďijájsja svítom jáko rízoju, k tebí útreňuju, i tebí zovú: dúšu mojú prosvití omračénnuju Christé, jáko jedín blahoutróben."),
("","","Prebyváješi po roždeství Ďíva netľínna, istľívšich vsích čelovík k žízni privódiši, i netľínijem osijaváješi preneporóčnaja."),
("","","Nóvo rodilá jesí jáko mláďa prečístaja, predvíčnaho ot Otcá bezľítno vozsijávšaho, jehóže o míre molí Bohonevísto."),
("","","Da obrjášču ťá pomóščnicu Ďívo, izymájušču mjá v čás prínija súdnaho, jehdá na sudíšči predstánu ot tebé róždšahosja."),
("","","Vsjá blížňaja mojá dóbra, i neporóčna ot Livána, Ďívo Bohonevísto: svjatým Dúchom v tebí prouvíďisja voploščénije Sýna Bóžija."),
),
"6": (
("","","Neístovstvujuščejesja búreju dušetľínnoju, Vladýko Christé, strastéj móre ukrotí, i ot tlí vozvedí mja, jáko blahoutróben."),
("","","Neiskusomúžno rodilá jesí Bohoródice Jemmanújila, náše smirénije uščédrivšaho: ťímže prisnodólžno ťá slávim."),
("","","Páče umá bezľítnaho, páče slóva ziždíteľa presvjatája rodilá jesí, izbavľájuščaho vsjákija tlí, Bohoródicu ťá pojúščich."),
("","","Bláháho róždši blahoďíteľa i ziždíteľa, presvjatája Vladýčice blahoľubívaja, dúšu mojú ozlóblennuju ublaží."),
("","","Nóvoje tebí pochvalénije, i drévneje prinósim vsečístaja: lúčše bo ne ímamy k pochvaléniju, rázvi, rádujsja, jéže s Havrijílom tebé vospivájem."),
),
"S": (
("","","Sebé préžde sudá nýňi pláču, pomyšľája mojá ďilá lukávaja i ľútaja, i prehrišénij hlubinú oderžáščuju mjá ot júnosti, i podavľájušču úm: no tvojím čístaja, predstánijem, ostavlénije mí podážď, i spasénije ulučíti spodóbi."),
),
"7": (
("","","Prevoznosímyj otcév Hospóď, plámeň uhasí, ótroki orosí, sohlásno pojúščyja: Bóže, blahoslovén jesí."),
("","","Izbávi mjá prečístaja, zláho unýnija, i strastéj omračénija, i osuždénija víčnujuščaho: jáko da víroju ťá slávľu."),
("","","Umertví strásti mojá, jáže žízň róždšaja: vozdvíhni mjá Bohonevísto ležáščaho iz hróba nečúvstvija, da ľubóviju ťá slávľu."),
("","","Plótiju obložéna Bóha bezplótnaho, preneporóčnaja rodilá jesí, nás izbavľájuščaho, so stráchom pojúščich: Bóže blahoslovén jesí."),
("","","Iscilénije bezmézdno, čístuju tvojú molítvu obrítše, Ďívo, prósim pojúšče, duší blahopreminénija, i ťilesí zdrávija."),
),
"8": (
("","","Tebí vseďíteľu, v peščí ótrocy, vsemírnyj lík splétše pojáchu: ďilá vsjákaja Hóspoda pójte, i prevoznosíte vo vsjá víki."),
("","","Dvére svíta, pokajánija mí dvéri svitozárnyja otvérzi, pokazújušči vsják právyj púť právdy, vvoďášč v božéstvennyja vóli vchódy."),
("","","Nóvo na zemlí Ďívo Máti otročá, otcú sobeznačáľnaho Sýna rodilá jesí, za milosérdije neizrečénnoje upodóbľšahosja nám, istľívšym pod hrichóm."),
("","","Vsjá izbránna, vsjá preukrášenna, Bóh júže vozľubí, júže izbrá, javílasja jesí Ďívo prísno preproslávlennaja: ťímže ťá pojém čístaja vo víki."),
("","","Vsjá čístaja, i božéstvennyja slávy ispólnena, blížňaja mojá, rečé Dúch Bóžij, ťá provozviščája prečístaja, júže píňmi vospivájem pojúšče: tebí podobájet rádovatisja Bóha čelovíka róždšej."),
),
"9": (
("","","Isáije likúj, Ďíva imí vo črévi, i rodí Sýna Jemmanújila, Bóha že i čelovíka, Vostók íma jemú: jehóže veličájušče, Ďívu ublažájem."),
("","","Tvoích pritekátelej vsečístaja, ne otríni nýňi vozdychánija, no vozzrí na ný súščich v skórbech, pláč preloží na rádosť, i umilénije v vesélije, v písnech ťá pojúščich."),
("","","Osnovánije jesí nedvížimo, Spása róždši čístaja, na vodách zémľu božéstvennymi veľíniji osnovávšaho: na némže nás svítlo ťá blažáščich utverdíti molísja."),
("","","Páče umá roždestvó tvojé Bohoródice, bez múža bo začátije v tebí, i ďívstvenno roždestvó tvojé býsť: íbo Bóh jésť roždéjsja, jehóže veličájušče, róždšuju ťá ublážájem."),
("","","Strášen jesí Hóspodi, i któ úbo tohdá postojít preščénija tvojehó Christé, jedíne carjú, súd tvorjášču tí? Ťímže poščadí, i spasí mja Spáse, róždšija ťá blahoprijátnymi moľbámi."),
),
)
#let U = (
"S1": (
("","","Sudijí siďášču, i ánhelom predstojáščym, trubí hlasjáščej, i plámeni horjášču, čtó sotvoríši dušé mojá, vedóma na súd: tohdá bo ľútaja tebí predstánut, i tájnaja tvojá obličátsja sohrišénija. Ťímže préžde koncá vozopíj sudijí: Bóže, očísti mjá, i spasí mja."),
("","","Vsí pobdím, i Christá usrjáščim so mnóžestvom jeléja, i sviščámi svítlymi, jáko da čertóha vnútr spodóbimsja: íže bo vňí dveréj obritájajsja, bezďíľno Bóhovi vozzovét: pomíluj mjá."),
("Bohoródičen","","Svjaťíjši Cheruvím, i výšši Serafím, prečístaja, Bohoródicu ťá voístinnu ispovídajušče, ímamy hríšniji zastúpnicu, i obritájem vo vrémja napástej spasénije. Ťímže ne prestáj o nás moľášči, deržávo i pribížišče dušám nášym."),
),
"S2": (
("","","Dušé, jáže zďí vrémenna, támošňaja že víčna: zrjú sudíšče i na prestóľi sudijú, i trepéšču otvíta. Próčeje so tščánijem obratísja, súd neproščájem."),
("","","Na odrí sležú sohrišénij mnóhich, okrádajem jésm v nadéždi spasénija mojehó: íbo són mojejá ľínosti chodátajstvujet duší mojéj múku. No tý Bóže, roždéjsja ot Ďívy, vozdvíhni mjá k tvojemú píniju, da slávľu ťá."),
("Múčeničen","","Sijájet dnés strástotérpec pámjať, ímať bo i ot nebés zarjú: lík ánheľskij toržestvújet, i čelovíčeskij ród sprázdnujet. Ťímže móľatsja Hóspodevi pomílovatisja dušám nášym."),
("Bohoródičen","","So ánhely nebésnaja, s čelovíki zemnája, vo hlási rádovanija, Bohoródice, vopijém tí: rádujsja, dvére nebés prostránňijšaja. Rádujsja, jedína zemnoródnych spasénije. Rádujsja, čístaja obrádovannaja, róždšaja Bóha voploščénna."),
),
"S3": (
("","Sobeznačáľnoje Slóvo","Bezslovésnymi mjá strasťmí preklonénnaho, i blúdno žitijé mojé iždívša, prizoví Spáse, jákože blúdnaho, i prijimí, i objátija Otéčeskaja za milosérdije ščedrót rasprostrí mi: i molítvami bezplótnych drévňij čésti spodóbi."),
("Bohoródičen","","Téplaja predstáteľnice i nepobidímaja, upovánije izvístnoje i nepostýdnoje, sťinó i pokróve i pristánišče pribihájuščym k tebí, prisnoďíívo čístaja, Sýna tvojehó i Bóha molí so ánhely, umirénije dáti mírovi, i spasénije, i véliju mílosť."),
),
"K": (
"P1": (
"1": (
("","","Poím Hóspodevi, sotvóršemu dívnaja čudesá v čermňím móri, písň pobídnuju, jáko proslávisja."),
("","","Mnóhimi lesťmí izvlekóma, i preľščájema Christé čúždaho, obratí i uščédri mjá, jáko vsesílen."),
("","","Íže hlucháho úši otvérzyj Christé, duší mojejá ohlóchnuvšaja ušesá otvérzi, moľúsja: jáko da tvojá slovesá vnušáju."),
("Múčeničen","","Novojavlénnyja zvízdy súšče múčenicy Sólnca právednaho Christá, ťmú otženíte ot serdéc nášich."),
("Múčeničen","","Razžžénnyja stríly božéstvennymi úhľmi svjatáho Dúcha stradáľcy jávľšesja, stríly sokrušájut vsjá zmíjevy."),
("Bohoródičen","","Dvére božéstvennyja slávy, pokajánija mí dvéri otvérzi, i ot vrát ádovych ischití, moľúsja, smirénnuju mojú dúšu."),
),
"2": (
("","","Koňá i vsádnika v móre čermnóje, sokrušájaj bráni mýšceju vysókoju, Christós istrjasé: Izráiľa že spasé, pobídnuju písň pojúšča."),
("","","Taínnicy Bohonačálija svitodáteľnaho, i tohó lučámi pervojavlénnaho sijájušče, svítom prosvitíti dúšu mojú, ánheli, Vladýku umolíte."),
("","","Taínnicy Bohonačálija svitodáteľnaho, i tohó lučámi pervojavlénnaho sijájušče, svítom prosvitíti dúšu mojú, ánheli, Vladýku umolíte."),
("","","Imúšče derznovénije, jáko prestólu vysókomu predstojášče vsí, blahočestívňi pojúščich vás, bíd izbávite predstátelije čína nebésnaho, o archistratízi!"),
("Bohoródičen","","Razrišísja kľátva, i pečáľ prestá: blahoslovénnaja bo i blahodátnaja, vírnym rádosť vozsijá, blahoslovénije vsím koncém cvitonosjášči Christá."),
),
),
"P3": (
"1": (
("","","Nad jazýki Bóh vocarísja, Bóh sidít na prestóľi svjaťím svojém, i pojém jemú razúmno jáko carjú i Bóhu."),
("","","Tý, íže nijedínomu choťáj pohíbnuti, blahíj Hóspodi, pohibájuščaho uščédri, i spasí mja, mánijem vseščédre mílosti tvojejá."),
("","","Jáže vo víďíniji i ne v víďiniji sohriších k tebí Christé Hóspodi, vsjá víďaščemu prichoždú i pripádaju tí, prijimí mja jákože blúdnaho."),
("Múčeničen","","Da živúščij hrích umertvité múčenicy i mértva vrahá pokážete, o mértvosti ťilésňij blažénniji neradíste."),
("Múčeničen","","Ispeščréni stradáňmi múčenicy, i odéždami króviju obroščénnymi ukrašájemi, vsích carjú vincenóscy predstoité."),
("Bohoródičen","","Ďívo Máti, jáže Bóha voplóščšaja, hlásy prijimí vopijúščich tí vsehdá, i izbávi nás ot razlíčnych obstojánij."),
),
"2": (
("","","Vodruzívyj na ničesómže zémľu poveľínijem tvojím, i povísivyj neoderžímo ťahoťíjuščuju, na nedvížimim Christé, kámeni zápovidej tvojích, cérkov tvojú utverdí, jedíne bláže i čelovikoľúbče."),
("","","Íže slóvom likovánija výšnim sílam premúdro sostavléj, tvojú bláhosť neisčetnosíľnu pokazújaj, sích predstáteľstvy cérkov tvojú utverdí, jedíne bláže i čelovikoľúbče."),
("","","Íže slóvom likovánija výšnim sílam premúdro sostavléj, tvojú bláhosť neisčetnosíľnu pokazújaj, sích predstáteľstvy cérkov tvojú utverdí, jedíne bláže i čelovikoľúbče."),
("","","Ukrašája neizrečénnoju svítlostiju ánhely Christé, i ťími utverždája cérkov tvojú milosérde, okajánnuju mojú dúšu ťími prosvití, moľúsja tí Vladýko, ne pominája mojích bezčíslennych hrichóv."),
("Bohoródičen","","Tý Máti Bóha nesočetánno bylá jesí, bezplótnyja líki prosviščájuščaho, jedíno Bohonačálije v trijéch píti neprestánno svjaščénstvijich, i Hospóďstvijich, prečístaja Ďívo vsepítaja."),
),
),
"P4": (
"1": (
("","","Ďilá smotrénija tvojehó Hóspodi, užasíša proróka Avvakúma: izšél bo jesí na spasénije ľudéj tvojích, spastí pomázannyja tvojá prišél jesí."),
("","","Ďilá, jáže v žitijí soverších, súť lukáva i ľúta: o níchže Christé Bóže mój izbávi mjá, pokajánije ískrenneje podajá mi."),
("","","Vsjáku zápoviď čestnúju uničižích, strách tvój otrínuch Christé, i bojúsja neizbížnaho tvojehó sudíšča, v némže da ne osúdiši mené blahoutróbne."),
("Múčeničen","","Reméňmi otvsjúdu voístinnu proťazájemi, i ránami iznurjájemi zíľňi, i nohoťmí strúžemi Slóve, stradáľcy tvojí, víroju rádovachusja."),
("Múčeničen","","Pokolebáti vás stradáľcy ot božéstvennaho stojánija, ne vozmóže vsjáčeski lukávyj: ťímže mnóhim koléblemym, dóbliji utverždénije božéstvennoje pokazástesja."),
("Bohoródičen","","Voploščájetsja ot čístych krovéj tvojích Hospóď, pokajánije čtúščym ťá podavája vsepítaja, tvojím blahím chodátajstvom, jáko blahoutróben, i jedín čelovikoľúbec."),
),
"2": (
("","","Božéstvennoje tvojé razumív istoščánije, prozorlívo Avvakúm, Christé, so trépetom vopijáše tebí: vo spasénije ľudéj tvojích, spastí pomázannyja tvojá prišél jesí."),
("","","Ánheľskija sostávil jesí svítlosti, Bohoďíteľnymi lučámi blahopodátlive prosvitíl jesí: jáko sílen v kríposti, slóvo tvojé ispólnivyj čelovikoľúbče."),
("","","Ánheľskija sostávil jesí svítlosti, Bohoďíteľnymi lučámi blahopodátlive prosvitíl jesí: jáko sílen v kríposti, slóvo tvojé ispólnivyj čelovikoľúbče."),
("","","Zemnája ťilés mudrovánija otložím vírniji, žitijú podóbjaščesja bezplótnych činóv, i úm vperím dúchom."),
("Bohoródičen","","Búdi mí predstáteľnice preneporóčnaja, pribížišče i pristánišče, strastéj búrju othoňášči: jáže ánheľskija líki, dobrótoju bez sravnénija pobíždšaja."),
),
),
"P5": (
"1": (
("","","Svíte ístinnyj Christé Bóže, k tebí útreňuet dúch mój ot nóšči, javí na mjá licé tvojé."),
("","","Vosprjaní, o dušé, vosprjaní ot sná ťážkaho, mojehó ľútaho hrichá, i pokajánija svítom ozarísja."),
("","","Obnovím dúšu priľižánijem, i umilénija túčami napoímsja: jáko da prozjabém pokajánija klás."),
("Múčeničen","","Úhľmi ľubvé naostrívšesja, nebokovánniji méčeve, strastotérpcy javístesja, vrahóv ssicájušče polkí."),
("Múčeničen","","Neporaboščéni ot vrahá býste, porabótiste sehó strástotérpcy, i blížniji Christú javístesja drúzi."),
("Bohoródičen","","Ďívo v ženách blahoslovénnaja, tvojá mílosti podážď ľúdem tvojím: mílostivaho bo javílasja jesí Máti."),
),
"2": (
("","","Oďijájsja svítom, jáko rízoju, k tebí útreňuju, i tebí zovú: dúšu mojú prosvití omračénnuju Christé, jáko jedín blahoutróben."),
("","","Obchoďášče vsejá zemlí koncý, Vladýčňaja blahoďijánija vírnym prinósite, i sochraňájete vseslávniji archánheli."),
("","","Obchoďášče vsejá zemlí koncý, Vladýčňaja blahoďijánija vírnym prinósite, i sochraňájete vseslávniji archánheli."),
("","","Slovesí tvojemú povinújuščesja Slóve Bóha i Otcá, nebésnaho činonačálija slávnaja ukrašénija, tvojejá svítlosti svítom ozarjájutsja."),
("Bohoródičen","","Vsé mojé želánije k tebí predstávi, jáže páče slóva, želánija sládosť rodívšaja, tebé Bohoródicu čístaja víduščym."),
),
),
"P6": (
"1": (
("","","Ot kíta proróka izbávil jesí, mené že iz hlubiný hrichóv vozvedí Hóspodi, i spasí mja."),
("","","Ňísť v žitijí sém hrichá, jehóže áz jedín ne sotvorích okajánnyj, jedíne bezhríšne uščédri mjá."),
("","","Vítrilom usérdija vperímsja, i ko pristánišču spasénija pokajánijem predvarím vsí, jáko da spasémsja."),
("Múčeničen","","Propovídnikov, apóstolov i múčenikov stradánijem ozarjájetsja tvár: ímiže i nás prosvití čelovikoľúbče."),
("Múčeničen","","Sosúdy vmistívšyja zarjú božéstvennuju, i čestnája svitolítija múčeniki vsí počtím."),
("Bohoródičen","","Ďívo vírnym predstáteľnice, izbávitisja ot vsjákaho hrichá rabóm tvojím molí Hóspoda."),
),
"2": (
("","","Neístovstvujuščejesja búreju dušetľínnoju, Vladýko Christé, strastéj móre ukrotí, i ot tlí vozvedí mja, jáko blahoutróben."),
("","","Svjáščennoukrašájemi ánheľstiji sobóri izbránniji, svitodáteľnymi sijániji prosviščájetesja, Bohoďíteľnym ozarénijem jávi soveršájemi."),
("","","Svjáščennoukrašájemi ánheľstiji sobóri izbránniji, svitodáteľnymi sijániji prosviščájetesja, Bohoďíteľnym ozarénijem jávi soveršájemi."),
("","","Trisvítlymi zarjámi bohátno preukrašájemi ánheli i archánheli, Bohozráčno okajánnuju mojú dúšu prosvitíte vášimi molítvami."),
("Bohoródičen","","Začalá jesí prečístaja vsích ziždíteľa i Bóha, jehóže s trépetom zrját rádujuščesja, vsebláhohovíjno predstojášče ánheli."),
)
),
"P7": (
"1": (
("","","Blahoslovén jesí Bóže, víďaj bézdny, i na prestóľi slávy siďáj, prepítyj i preslávnyj."),
("","","Blahoslovén jesí Bóže, íže za blahoutróbije kájuščichsja vsích prijémľa, prepítyj i preslávnyj."),
("","","Iscilí blahoutróbne Christé, mnóhija mojá strásti, íže mojé svídyj nemožénije, prepítyj i preslávnyj."),
("Múčeničen","","Síloju božéstvennoju ukripísja lík strastotérpec, vrahí pobidí vopijá: prepítyj i prevoznosímyj vo víki."),
("Múčeničen","","ukripívyj premúdryja strastotérpcy Slóve, preterpíti mnohopleténnyja múki, molítvami ích uščédri vsích."),
("Bohoródičen","","Blahoslovén jesí Bóže, íže vo črévo Ďivíče vselívsja, i spásl čelovíka, prepítyj i prevoznosímyj vo víki."),
),
"2": (
("","","Prevoznosímyj otcév Hospóď plámeň uhasí, ótroki orosí sohlásno pojúščyja: Bóže, blahoslovén jesí."),
("","","Neisčetnosíľnuju Christós javľája kríposť, vás archistratízi postávil jésť, naučí vospiváti: Bóže, blahoslovén jesí."),
("","","Neisčetnosíľnuju Christós javľája kríposť, vás archistratízi postávil jésť, naučí vospiváti: Bóže, blahoslovén jesí."),
("","","Íže mnóžestvo bezčíslennoje bezplótnych činóv ukrašájaj bláhostiju, vírnych sostavlénija spodóbi píti ťá: Bóže, blahoslovén jesí."),
("Bohoródičen","","Strasťmí koléblema, Ďívo, tý nýňi utverdí mja, jáže vsím istočívšaja vírnym bezstrástije, víroju pojúščym: Bóže, blahoslovén jesí."),
),
),
"P8": (
"1": (
("","","Tvorcá tvári, jehóže užasájutsja ánheli, pójte ľúdije, i prevoznosíte vo vsjá víki."),
("","","Mértva prestuplénijem bývša mjá, Hóspodi oživí, da ťá slávľu vo vsjá víki."),
("","","Prosvitív mjá pokajánijem, ťmý hrichóvnyja izbávi Hóspodi, da ťá slávľu vo vsjá víki."),
("Múčeničen","","Strástotérpcy múčenicy, plámeň prélesti popráša, rósu s nebesé prijémše preslávno."),
("Múčeničen","","Jákože zemľá túčnaja svjatíji, klás voístinnu storíčestvujušč, podvihopolóžniku Christú plodonosíste."),
("Bohoródičen","","Iz tebé Bóh vozsijá vsepítaja Ďívo, i Bohorazúmijem prosvití omračénnyja."),
),
"2": (
("","","Tebí vseďíteľu, v peščí ótrocy, vsemírnyj lík splétše pojáchu: ďilá vsjákaja Hóspoda pójte, i prevoznosíte vo vsjá víki."),
("","","Privlačát mjá nýňi ánheľstiji sobóri, píti písňmi i serdéčnym želánijem, s nímiže pojú: ďilá vsjákaja Hóspoda pójte, i prevoznosíte jehó vo víki."),
("","","Privlačát mjá nýňi ánheľstiji sobóri, píti písňmi i serdéčnym želánijem, s nímiže pojú: ďilá vsjákaja Hóspoda pójte, i prevoznosíte jehó vo víki."),
("","","Sluhí presvjaťíj i trisólnečňij zarí, spastísja molíte víroju pojúščym: Hóspoda vospivájte ďilá, i prevoznosíte jehó vo víki."),
("Bohoródičen","","Dvéri svíta, Ďívo Máti otrokovíce: svítom tvojím ozarí víroju pojúščich: Hóspoda vospivájte ďilá, i prevoznosíte jehó vo víki."),
),
),
"P9": (
"1": (
("","","Ťá blažénnuju v ženách, i blahoslovénnuju Bohom, čelovíčeskij ród, písňmi veličájem."),
("","","Mílostiv búdi mí Hóspodi, bez čislá bezúmno sohrišívšemu, i tvojehó cárstvija Slóve spodóbi mjá."),
("","","Jákože ninevíťany spásl jesí drévle pokájavšyjasja jedíne Spáse, i nás pojúščich ťá spasí mílostiju tvojéju."),
("Múčeničen","","Plóť predávše vsjáčeskim jázvam, neujázvlenu spaslí jesté dúšu strastotérpcy Hospódni, božéstvennyja slávy pričástnicy."),
("Múčeničen","","Dnesijáteľnyja zvízdy, na zemlí vsích ozarjájušči dúšy, strástonóscy vsích Hóspoda javístesja."),
("Bohoródičen","","Nósiši jákože prestól óhnennyj mánijem vsjá nosjáščaho, i soscéma pitáješi Ďívo, vsích pitájuščaho."),
),
"2": (
("","","Isáije likúj, Ďíva imí vo črévi, i rodí Sýna Jemmanúila, Bóha že i čelovíka, vostók ímja jemú: jehóže veličájušče, Ďívu ublažájem."),
("","","Činóm načáľnicy bývše ánheľskim, presvítlyj Michaíle, i tý Havriíle božéstvennaho voploščénija vseístinnyj propovídnik býv, vsích sochraňájte pojúščich vás slávniji."),
("","","Činóm načáľnicy bývše ánheľskim, presvítlyj Michaíle, i tý Havriíle božéstvennaho voploščénija vseístinnyj propovídnik býv, vsích sochraňájte pojúščich vás slávniji."),
("","","Íže bohátymi darováňmi preizlivájaj svojá sokróvišča, íže číny privedýj ánheľskija, s ními že prišéd jáko sudijá, i vsích cár, spasí mja Vladýko pribihájuščaho k mílosti tvojéj."),
("Bohoródičen","","Úmňi archánheli, vlásti, prestóli, Cheruvími, síly i Serafími, ánheli svítliji, načála i Hospóďstvija, tvojemú Sýnu preneporóčnaja čístaja, s trépetom slúžat, Bohoródice vseblážénnaja."),
),
),
),
"CH": (
("","","Mnóžestva prehrišénij mojích prézri Hóspodi, íže ot Ďívy roždéjsja: i vsjá očísti hrichí mojá, mýsľ mňí podajá obraščénija, jáko jedín čelovikoľúbec, moľúsja, i pomíluj mjá."),
("","","Uvý mňí, komú upodóbichsja áz? Neplódňij smokóvnici, i bojúsja prokľátija s posičénijem: no nebésnyj ďílateľu Christé Bóže, oľadeňívšuju dúšu mojú plodonósnu pokaží, i jáko blúdnaho sýna prijimí mja, i pomíluj mjá."),
("","","Bláhoslovéno vóinstvo nebésnaho Carjá: ášče bo i zemnoródniji býša strastotérpcy, no ánheľskoje dostóinstvo potščášesja dostíhnuti, o ťilesích neradíša, i stradáňmi bezplótnych spodóbišasja čésti. Ťímže molítvami ích Hóspodi, nizposlí nám véliju mílosť."),
("Bohoródičen","","Obrádovannaja, chodátajstvuj tvojími molítvami, i isprosí dušám nášym mnóžestvo ščedrót, i očiščénije mnóhich prehrišénij, mólimsja."),
),
)
#let L = (
"B": (
("","","Razbójnik na kresťí Bóha ťá býti vírovav Christé, ispovída ťá čísťi ot sérdca, pomjaní mja Hóspodi, vopijá, vo cárstviji tvojém."),
("","","Dušetľínniji razbójnicy, na putí žitéjsťim srítše ujazvíša mjá: no k tvojemú blahoutróbiju nýňi pritekáju, iscilí Christé, i spasí mja, moľúsja."),
("","","Nebésniji lícy pisnoslóvjat ťá vsích Bóha: ťích Vladýko svjaščénnymi chodátajstvy, mnóhaja mí prézri zlája, i spasí mja, moľúsja."),
("","","Ánheľskim likóm sočisľájemi Christóvy stradáľcy, i ispolňájemi prosviščénija nevečérňaho, smrádnyja strásti sérdca mojehó potrebíte."),
("","","Ánheľski zemnoródniji, vo výšnich pojémomu Bóhu, vospojím trisvjátúju písň: svját jesí prebeznačálne Ótče, Sýne so Dúchom."),
("","","Jáže ánhelom rádosť vo tvojéj utróbi vosprijémši čístaja, sítujuščuju lukávymi ďíly, dúšu mojú ispólni rádosti, k svítu nastavľájušči mjá."),
)
)
|
|
https://github.com/rabotaem-incorporated/algebra-conspect-1course | https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/04-linear-algebra/05-determinants-more-props.typ | typst | Other | #import "../../utils/core.typ": *
== Дальнейшие свойства определителя
#ticket[Определитель блочно-треугольной матрицы]
#pr[
Пусть
$A = mat(delim: "[", B, X; 0, C),$ где матрицы $B$ и $C$ квадратные.
Тогда $det(A) = det(B) mul det(C)$.
Такая матрица $A$ называется _блочно-треугольной матрицей_.
]
#proof[
$ det(A) = sum_(sigma in S_n) sgn sigma mul product_(i = 1)^n a_(i sigma(i)) $
Заметим, что все перестановки которые переводят строки из $B$ в $0$ обращают произведение в 0 и наоборот. Рассмотрим остальные $sigma = pi mul rho$.
$ det(A) &=
sum_(pi in S_k \ rho in S_(n - k)) sgn(pi) mul sgn(rho) mul a_(1 pi_1) dots a_(k pi_k) mul a_(k + 1 rho_1) dots a_(n rho_(n - k)) = \
&= (sum_(pi in S_k) sgn(pi) a_(1 pi_1) dots a_(k pi_k)) mul (sum_(rho in S_(n - k)) sgn(rho) a_(k rho_1) dots a_(n rho_(n - k))) = det(B) mul det(C).
$
]
#follow[
Пусть
$ A = mat(a_11, *, dots.c, *; 0, a_22, dots.c, *; dots.v, dots.v, dots.down, dots.v; 0, 0, dots.c, a_(n n)) $
Тогда $det(A) = a_11 mul a_22 mul ... mul a_(n n)$.
]
#proof[
Индукция по $n$.
]
#ticket[Определитель произведения матриц]
#pr[
Пусть $A, B in M_(n)(K)$. Тогда $Det(A mul B) = det(A) mul det(B)$.
]
#proof[
Применим PDQ разложение $A$, будем по одному рассматривать что происходит при применении преобразования слева и справа по индукции.
+ $abs(T_(i j)(alpha) A'B) = abs(A'B) = abs(A') mul abs(B) = abs(T_(i j)(alpha) A') abs(B)$
+ #sym.dots Еще 4 случая: $S_(i j)$, $D_i (alpha)$, $E_n$, окаймленная-единичная матрица.
#TODO[Расписать случаи]
]
#ticket[Определитель матрицы с почти нулевой строкой]
#def[
_Минор_ $M_(i j)$ --- определитель матрицы из которой вырезали $i$-ю строчку и $j$-й столбец.
]
#def[
_Алгебраическое дополнение элемента в позиции_ $(i, j)$: $A_(i j) = (-1)^(i + j) M_(i j)$.
]
#lemma(name: "Об определителе матрицы с почти нулевой строкой")[
Пусть $A in M_n (K)$, $1 <= i_0, j_0 <= n$, $A = (a_(i j))$, $a_(i_0 j) = 0$ при всех $j != j_0$.
Тогда $det(A) = a_(i_0 j_0) A_(i_0 j_0)$.
]
#proof[
Пусть $i_0 = j_0 = 1$.
Посчитаем определитель по определению. Все произведения, соответствующие перестановкам $sigma: sigma(1) != 1$, равны нулю. Оставшиеся произведения в сумме дадут $a_11 M_11$, так как знаки перестановок будут такими же.
Общий случай получается, если применить элементарные преобразования $S_(i, i-1)$ над строками и столбцами. Знак суммарно поменятеся $i_0 + j_0 - 2$ раза, значит $det(A) = a_(i_0 j_0) A_(i_0 j_0)$
]
#ticket[Разложение определителя по строке (столбцу)]
#th(name: "Разложение определителя по строке")[
Пусть $A in M_n (K)$, $1 <= i <= n$.
Тогда $ det(A) = a_(i 1) A_(i 1) + a_(i 2) A_(i 2) + dots a_(i n) A_(i n). $
]
#proof[
Посмотрим на $i$ строку и воспользуемся линейностью определителя, чтобы представить $ det(A) = sum_(j=1)^n det(
a_(11), a_(12), ..., a_(1n-1), a_(1n);
a_(21), a_(22), ..., a_(1n-1), a_(2n);
dots.v, dots.v, dots.down, dots.v, dots.v;
0, ..., a_(i j), ..., 0;
dots.v, dots.v, dots.down, dots.v, dots.v;
a_(n 1), a_(n 2), ..., a_(n n-1), a_(n n);
) = sum_(j=1)^n a_(i j)A_(i j) $
Слагаемые в сумме --- следствие предыдущей леммы.
]
#follow(name: "Разложение определителя по стобцу")[
$det(A) = a_(1 j) A_(1 j) + dots + a_(n j) A_(n j)$
]
#proof[
Аналогично разложению определителя по строке.
]
#ticket[Критерий обратимости матрицы в терминах определителя]
#th[
$A in GL_n (K) <==> det(A) != 0$.
]
#proof[
- "#imply":
$A in GL_n (K) ==> exists B in M_n (K): A B = E ==> abs(A B) = abs(E) = 1 = abs(A) mul abs(B) ==> abs(A) eq.not 0$
- "#since":
Посмотрим на PDQ разложение матрицы $A = P D Q$. $P$ и $Q$ обратимы, значит $D = P^(-1)A Q^(-1) ==>$
$det(D) = det(P^(-1)) mul det(A) mul det(Q^(-1)) eq.not 0,$ так как $P, Q$ обратимы.
Вспомним, что $D = mat(
E_r, 0;
0, 0;
)$ и $r = n$, так как определитель не равен нулю, поэтому
$D = E_n ==> A = P Q ==> А$ обратима, так как является произведением обратимых.
]
#ticket[Взаимная матрица. Явный вид обратной матрицы]
#lemma(name: "О фальшивом разложении определителя")[
Пусть $A in M_n (K)$, $i != j$.
Тогда $ a_(i 1) A_(j 1) + a_(i 2) A_(j 2) + ... + a_(i n) A_(j n) = 0. $
]
#proof[
Рассмотрим $A'$, которая совпадает с $A$ везде, кроме $j$ строчки, а в $j$ строчке стоит $i$ строчка матрицы $A$. Можно увидеть, что $abs(A')=0,$ так как $i$ и $j$ строчки сопадают. С другой стороны, если разложить $abs(A')$ по $j$ строке, мы получим $ abs(A')= a_(i 1)A_(j 1) + a_(i 2)A_(j 2) + ... + a_(i n)A_(j n) = 0, $ так как $j$ строка совпадает с $i$, а дополнения совпадают с дополнениями элементов $j$ строки матрицы A (поскольку алгебраические дополнения элементов $j$ строки не зависят от того, что именно стоит в
j-ой строке).
]
#def[
Пусть $A in M_n (K)$. _Матрицей, взаимной к $A$_ называется транспонированная матрица алгебраических дополнений.
Более формально: $ "adj" A = adj(A) = (A_(i j))^T in M_n (K). $
]
#pr[
$ A mul adj(A) = adj(A) mul A = det(A) mul E_n. $
]
#proof[
$ (A mul adj(A))_(i j) = (A mul (A_(i j))^T) = a_(i 1) A_(j 1) + a_(i 2) A_(j 2) + ... + a_(i n) A_(j n) = cases(det(A)\, & space "если" i = j\,, 0\, & space "иначе".) $
Для $adj(A) mul A$, аналогично, только с разложением по столбцу.
]
#follow[
Пусть $A in GL_n (K)$.
$ A^(-1) = adj(A) / det(A). $
]
#proof[
$(A mul adj(A)) / det(A) = E_n ==> adj(A) / det(A) = E_n mul A^(-1)$
]
#ticket[Теорема Крамера]
#th(name: "Крамера")[
Рассмотрим систему линейных уравнений $(A bar b)$, $A in M_n (K)$.
Тогда $det(A) != 0 <==> "Эта система совместная определенная"$.
]
#proof[
- "#imply": $A in GL_n (K) imply A x = b iff A^(-1) A x = A^(-1) b iff x = A^(-1) b$.
- "#since": Приведем СЛУ к ступенчатому виду элементарными преобразованиями, таким образом $(A bar b)$ --- ступенчатая. Если ведущий элемент последней ненулевой строки оказался в последнем слобце расширенной матрицы (то есть в дополнительном столбце), то система несовместна, что противоречит условию. Значит, так как система уравнений определенная, ширина всех ступенек равна 1 (иначе найдется свободная переменная). Значит получилась верхнетреугольная матрица, все элементы на диагонали которой не равны 0, а значит $det(A) != 0$.
$ A = mat(
a_1, ..., *;
dots.v, dots.down, dots.v;
0, ..., a_n;
), space a_1, ..., a_n eq.not 0 ==> det(A) = a_1 dot ... dot a_n. $
]
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/dict-02.typ | typst | Other | // Test rvalue missing key.
#{
let dict = (a: 1, b: 2)
// Error: 11-23 dictionary does not contain key "c" and no default value was specified
let x = dict.at("c")
}
|
https://github.com/tingerrr/chiral-thesis-fhe | https://raw.githubusercontent.com/tingerrr/chiral-thesis-fhe/main/src/core/component/affidavit.typ | typst | #import "/src/core/authors.typ" as _authors
#import "/src/core/kinds.typ" as _kinds
#import "/src/utils.typ" as _utils
#let make-affidavit(
title: "Mustertitel",
author: "<NAME>",
date: datetime(year: 1970, month: 01, day: 01),
body: auto,
kind: _kinds.report,
) = {
_authors.assert-author-valid(author)
_kinds.assert-kind-valid(kind)
author = _authors.prepare-author(author)
set heading(numbering: none, outlined: true, offset: 0)
heading(level: 1)[Eigenständigkeitserklärung]
if body == auto {
[
Ich, #_authors.format-author(author, titles: false, email: false), versichere hiermit, dass ich die vorliegende #kind.name mit dem Titel
#align(center, emph(title))
selbstständig und nur unter Verwendung der angegebenen Quellen und Hilfsmittel angefertigt habe.
]
align(right)[
Erfurt, #_utils.format-date(date)
]
_authors.format-author(author, titles: false, email: false)
} else {
body
}
}
|
|
https://github.com/rytst/convex_analysis | https://raw.githubusercontent.com/rytst/convex_analysis/main/03_convex_functions/proposition_3.16/unequivocal-ams/proposition_3.16.typ | typst | #import "@preview/unequivocal-ams:0.1.0": ams-article, theorem, proof
#show: ams-article.with(
title: [Convex Analysis Workshop],
authors: (
(
name: "<NAME>",
email: "<EMAIL>",
),
),
bibliography: bibliography("refs.bib"),
)
#import "@preview/ctheorems:1.1.2": *
#show: thmrules.with(qed-symbol: $square$)
#set heading(numbering: "1.1.")
#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 lemma = thmbox("lemma", "Lemma", inset: (x: 1.2em, top: 1em))
#let proposition = thmbox("proposition", "Proposition", inset: (x: 1.2em, top: 1em))
#let example = thmplain("example", "Example").with(numbering: none)
#let proof = thmproof("proof", "Proof")
#set math.equation(numbering: "(1)")
#show ref: it => {
let eq = math.equation
let el = it.element
if el != none and el.func() == eq {
// Override equation references.
numbering(
el.numbering,
..counter(eq).at(el.location())
)
} else {
// Other references as usual.
it
}
}
= Convex functions
I made this material referring to @Boyd.
== Definitions
#definition("Convex function")[
A function $f colon RR^n -> RR union {oo}$ is $italic("convex")$ if $bold(op("dom")) f$ is a convex set and
$
forall bold(x), bold(y) in bold(op("dom")) f, forall t in [0, 1], f(t bold(x) + (1-t) bold(y)) lt.eq t f(bold(x)) + (1-t) f(bold(y))
$
where $bold(op("dom")) f$ is the effective domain of $f$:
$
bold(op("dom")) f := {bold(x) | f(bold(x)) < oo}.
$
]
#definition("Concave function")[
A function $f$ is said to be $italic("concave")$ if $-f$ is convex.
]
#definition("Non-decreasing and non-increasing")[
A function $f : RR -> RR$ is called $italic("non-decreasing")$ if
$
forall a, b in RR, a <= b ==> f(a) <= f(b).
$
Likewise, a function $f : RR -> RR$ is called $italic("non-increasing")$ if
$
forall a, b in RR, a <= b ==> f(a) >= f(b).
$
]
== Exercise
#proposition("Scalar composition")[
For $h : RR -> RR union {oo}, space g : RR^n -> RR union {oo},$
define $f : RR^n -> RR union {oo}$ by
$
f(bold(x)) := h(g(bold(x)))
$ <ineq>
with
$
bold(op("dom")) f = {bold(x) in bold(op("dom")) g | g(bold(x)) in bold(op("dom")) h}.
$
Then $f$ is convex if
- $h$ is convex and nondecreasing and $g$ is convex, or
- $h$ is convex and nonincreasing and $g$ is concave.
]
#proof[
First, we prove that $f$ is convex if $h$ is convex and nondecreasing and $g$ is convex. \
Let $bold(x), bold(y) in bold(op("dom")) f$, and $t in [0,1].$
Since $bold(x), bold(y) in bold(op("dom")) f$, we have $bold(x), bold(y) in bold(op("dom")) g$
and $g(bold(x)), g(bold(y)) in bold(op("dom")) h.$
From the convexity of $bold(op("dom")) g$, $t bold(x) + (1 - t) bold(y) in bold(op("dom")) g.$
Then, since $g$ is convex, we have
$
g(t bold(x) + (1 - t) bold(y)) <= t g(bold(x)) + (1 - t) g(bold(y)).
$ <g_conv>
Since $g(bold(x)), g(bold(y)) in bold(op("dom")) h$ and $bold(op("dom")) h$ is convex, we have
$t g(bold(x)) + (1 - t) g(bold(y)) in bold(op("dom")) h$.
Then,
$
h(t g(bold(x)) + (1 - t) g(bold(y))) < oo.
$ <g_dom>
Using the assumption that $h$ is nondecreasing and @g_conv, it follows that
$
h(g(t bold(x) + (1 - t) bold(y))) <= h(t g(bold(x)) + (1 - t) g(bold(y))).
$ <h_mono>
From @g_dom and @h_mono, we get
$
h(g(t bold(x) + (1 - t) bold(y))) < oo,
$
which means $g(t bold(x) + (1 - t) bold(y)) in bold(op("dom")) h$.
Since $t bold(x) + (1 - t) bold(y) in bold(op("dom")) g$
and $g(t bold(x) + (1 - t) bold(y)) in bold(op("dom")) h$,
we get $t bold(x) + (1 - t) bold(y) in bold(op("dom")) f$.
Therefore, $bold(op("dom")) f$ is convex set.
From the convexity of $h$, we have
$
h(t g(bold(x)) + (1 - t) g(bold(y))) <= t h(g(bold(x))) + (1 - t) h(g(bold(y))).
$ <h_conv>
From @h_mono and @h_conv, we get
$
h(g(t bold(x) + (1 - t) bold(y))) <= t h(g(bold(x))) + (1 - t) h(g(bold(y))).
$
That is
$
f(t bold(x) + (1 - t) bold(y)) <= t f(bold(x)) + (1 - t) f(bold(y)).
$
Then, we have shown that $f$ is convex if $h$ is convex and nondecreasing and $g$ is convex.
Next, we prove that $f$ is convex if $h$ is convex and nonincreasing and $g$ is concave.
Let $bold(x), bold(y) in bold(op("dom")) f$, $t in [0,1]$ and $g : RR^n -> RR.$
Since $bold(x), bold(y) in bold(op("dom")) f$, we have $bold(x), bold(y) in bold(op("dom")) g$
and $g(bold(x)), g(bold(y)) in bold(op("dom")) h.$ Recall that $g(bold(x)), g(bold(y)), g(t bold(x) + (1 - t) bold(y)) in RR$,
we have $-g(bold(x)) < oo$, $-g(bold(y)) < oo$ and $g(t bold(x) + (1 - t) bold(y)) < oo$.
That is $bold(x), bold(y) in bold(op("dom")) -g$ and $t bold(x) + (1 - t) bold(y) in bold(op("dom")) g$.
From the convexity of $bold(op("dom")) -g$, $t bold(x) + (1 - t) bold(y) in bold(op("dom")) -g.$
Then, since $-g$ is convex, we have
$
- g(t bold(x) + (1 - t) bold(y)) <= t (- g(bold(x))) + (1 - t) (- g(bold(y))).
$
Multiplying this inequality by $-1$ yields
$
g(t bold(x) + (1 - t) bold(y)) >= t g(bold(x)) + (1 - t) g(bold(y)).
$ <g1_conv>
Since $g(bold(x)), g(bold(y)) in bold(op("dom")) h$ and $bold(op("dom")) h$ is convex, we have
$t g(bold(x)) + (1 - t) g(bold(y)) in bold(op("dom")) h$.
Then,
$
h(t g(bold(x)) + (1 - t) g(bold(y))) < oo.
$ <g1_dom>
Using the assumption that $h$ is nonincreasing and @g1_conv, it follows that
$
h(g(t bold(x) + (1 - t) bold(y))) <= h(t g(bold(x)) + (1 - t) g(bold(y))).
$ <h1_mono>
From @g1_dom and @h1_mono, we get
$
h(g(t bold(x) + (1 - t) bold(y))) < oo,
$
which means $g(t bold(x) + (1 - t) bold(y)) in bold(op("dom")) h$.
Since $t bold(x) + (1 - t) bold(y) in bold(op("dom")) g$
and $g(t bold(x) + (1 - t) bold(y)) in bold(op("dom")) h$,
we get $t bold(x) + (1 - t) bold(y) in bold(op("dom")) f$.
Therefore, $bold(op("dom")) f$ is convex set.
From the convexity of $h$, we have
$
h(t g(bold(x)) + (1 - t) g(bold(y))) <= t h(g(bold(x))) + (1 - t) h(g(bold(y))).
$ <h1_conv>
From @h1_mono and @h1_conv, we get
$
h(g(t bold(x) + (1 - t) bold(y))) <= t h(g(bold(x))) + (1 - t) h(g(bold(y))).
$
That is
$
f(t bold(x) + (1 - t) bold(y)) <= t f(bold(x)) + (1 - t) f(bold(y)).
$
Then, we have shown that $f$ is convex if $h$ is convex and nonincreasing and $g$ is concave.
]
|
|
https://github.com/Hao-Yuan-He/resume_typst | https://raw.githubusercontent.com/Hao-Yuan-He/resume_typst/main/readme.md | markdown | This is a template for resume based on `typst`, specifically, this template is developed based on [This Repo](https://github.com/stuxf/basic-typst-resume-template).
---
The advantages of this template:
- `bib` for academic publication list
- Flexible format and content replacement.
- Easy to use and re-develop.
## License
MIT License.
> Please feel free to use it. |
|
https://github.com/kaarmu/splash | https://raw.githubusercontent.com/kaarmu/splash/main/src/palettes/beamer.typ | typst | MIT License | /* The classic beamer colors (and metropolis!).
*
* == Metropolis theme ==
* Source: https://ftp.acc.umu.se/mirror/CTAN/macros/latex/contrib/beamer-contrib/themes/metropolis/doc/metropolistheme.pdf
* Accessed: 2023-04-12
*/
// TODO: Add the normal beamer color themes
#let beamer = (
metropolis-dark-brown : rgb("#604c38"),
metropolis-dark-teal : rgb("#23373b"),
metropolis-light-brown : rgb("#eb811b"),
metropolis-light-green : rgb("#14b03d"),
)
|
https://github.com/BenH11235/cryptoctf23_did_it_solution | https://raw.githubusercontent.com/BenH11235/cryptoctf23_did_it_solution/main/solution.typ | typst | #let title = "DiD It (2023 CryptoCTF) -- Solution"
#let author = "<NAME>"
#import "@preview/ctheorems:1.1.0": *
#show: thmrules
#set heading(numbering: "1.1")
#show link: underline
#set document(
title: title,
author: author
)
#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 remark = thmbox(
"remark",
"Remark",
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 = thmplain(
"proof",
"Proof",
base: "theorem",
bodyfmt: body => [
#body #h(1fr) $square$ // Insert QED symbol
]
).with(numbering: none)
#let solution = thmplain(
"solution",
"Solution",
base: "exercise",
inset: 0em,
).with(numbering: none)
#set align(center)
#text(17pt, weight: "bold")[#title]
#text(10pt)[#author, #datetime.today().display()]
#set align(left)
#outline()
= The Challenge
#definition[
The "DiD Game" with parameters $(n, l, q)$ is a game for one player played in the following way.
- A secret set $K subset.eq NN_n$ with $|K|=l$ is picked at random.
- The player can then make $q$ _queries_ $Q_0, Q_1, dots, Q_(q-1)$. Each query is of the form $Q_i subset.eq NN_n$.
- After sending each query $Q_i$ the player receives that query's _response_ $R(Q_i)$, which is computed in the following way: each $w in Q_i$ is assigned a random per-query secret value $e_w in {0,1}$, and then $R(Q_i) = {(w^2+e_w)_(mod n) | w in Q_i without K}$.
- If the player can guess $K$ within their alloted queries (that is, if for any $0 lt.eq i lt l$ we have $Q_i=K$) then the player wins. Otherwise, the player loses.
]
The exercise calls for a winning strategy for the DiD game with $n=127$, $l=20$, $q=11$.
= Preliminary Discussion <strategy>
Somewhat counter-intuitively, the 'reasonable' way to get an initial grasp on this problem doesn't get involved very much with the specific ring structure of $frac(ZZ, n ZZ)$, the behavior of $f(k) = k^2$ or the error term $e_m$. Instead, it contends with the basic structure of repeatedly sending a query $S$ and obtaining $f(S without K)$, and mainly with the fact that $f$ is not a bijection (that is: we can have $f(x_1)=f(x_2)$ but $x_1 eq.not x_2$).
To understand how central $f$ not being bijective is to the challenge posed here, we will show how $f$ being a bijection would have trivialized the problem.
#theorem[
Consider a variation of the DiD game where instead of $f(x) = x^2$, $f$ is some nondeterministic bijection (meaning there is an error term $e_k$, but we are still guaranteed that $f(x_1)=f(x_2) arrow x_1 = x_2$). Then there is a winning strategy for this game using 2 queries.
#proof[Take the first query to be $Q_0 = NN_n$, obtain the response $R(Q_0)$ and then immediately compute $ Q_1 = f^(-1)({x in NN_n | exists.not y in R(Q_0): f^(-1)(x) = f^(-1)(y)}) = K $ Informally, every value $f(x)$ immediately "incriminates" the original value of $x$ that induced it -- the other possible values of $f(x)$ that might have occurred don't mitigate that. So, by analogy, the set of values $f(Q_0 without K)$ "incriminates" (determines) the original set $(Q_0 without K)$, and thus immediately $K$ as well, since $K subset.eq Q_0$ and $Q_0$ is known.
]
] <bijection_strategy>
Clearly, being able to invert $f$ is a powerful tool for defusing this sort of problem. Alas, the original problem has a non-invertible $f$. Can we somehow rescue this approach? Can we do the impossible, and invert the non-invertible?
= Branch Inversion
Actually, chances are you've already seen how to do it back in seventh grade. The arcane operation known as a "square root" is somehow the inverse of the non-invertible function $f(x) = x^2$. This strange feat of alchemy is pulled off by breaking $f$'s domain $D$ into several _branches_.
#definition[Let $f: D arrow R$ a function. Some $B subset.eq D$ is said to be a _branch_ of $f$ if for all $x_1, x_2 in B$, $f(x_1) = f(x_2)$ implies $x_1 = x_2$ (that is, the restriction of $f$ to $B$ is a bijection). A set of branches ${B_i}_(i=0)^n$ that are disjoint with $union_(i=0)^n B_i = D$ is called a _branch decomposition_ for $f$ in $D$.] <branch_definition>
Specifically for $f(x)=x^2$, it is customary to break down its domain $RR$ into 2 branches, $(-infinity, 0)$ and $[0, infinity)$. $f$ is injective if its domain is one of those branches, instead of the whole of $RR$. Thus we obtain one $f^(-1)$ candidate per branch, and two in total. One of these is the aforementioned "principal square root", and the other is ignored #footnote[Presumably so that one day it may come back to haunt the first, shouting "look at me, brother! I'm you! I'm your SHADOW!"].
#theorem[Let $f: D arrow R$ a function. Then there is a branch decomposition for $f$ in $D$.
#proof[
Take every $x in D$ to be its own separate branch.]
] <branch_decomposition_exists>
But we are naturally interested in branch decompositions with a finite number of branches, and ideally as few as possible.
#definition[Let $f: D arrow R$ a function. The minimum number of branches required to construct a decomposition of $f$ in $D$ is called $f$'s _branch number_ in $D$.] <branch_number>
#theorem[Let $f: D arrow R$ a function. The branch number of $f$ in $D$ equals the maximum number of different $x in D$ that $f$ maps to the same value.
#proof[
Let's call the branch number $b$ and this maximum number $k$. To prove $b=k$ we will separately prove $b lt.eq k$ and $k lt.eq b$.
- $k lt.eq b$: By definition of $k$ there must exist $x_0, x_1, dots, x_(k-1)$ with $f(x_i)=f(x_0)$ for all $0 lt.eq i lt k$. Suppose by contradiction there's a branch decomposition with fewer than $k$ branches. Then two of these values $x_i, x_j$ (with $i eq.not j$) have to share a branch (due to what's called the 'pigeonhole principle': there are $k$ 'pigeons' trying to fit into fewer than k 'pigeonholes'). But $f(x_i)=f(x_j)$ so $x_i$ and $x_j$ sharing a branch violates the definition of a branch (@branch_definition).
- $b lt.eq k$: For each $r in R$ number the $d in D$ that have $f(x)=r$. The result is a list $x_0, x_1, dots$ that is guaranteed to have at most $k$ values. Further, because $f$ is deterministic, a $d in D$ can only appear in the list for at most one value of $r$. Number the branches $0, 1, dots, k-1$ and assign each $x_i$ in each $r$-list branch number $i$. This results in a branch decomposition for $f$ in $D$ with $k$ branches.
]
] <branch_number_formula>
= Attacking DiD... Sort of
Working with branch decomposition hands us a winning strategy for a relaxed version of the DiD game without the error term.
#theorem[
Consider a variation of the DiD game without the error term $e_k$, and let $b$ the branch number of $f$ in $NN_n$. There is a winning strategy for this game using $b+1$ queries, where $b$ is the branch number of $f$ in $NN_n$.
#proof[Let ${B_i}_(i=0)^(b-1)$ a branch decomposition of $f$ in $NN_n$. Send $b$ queries with $Q_i = B_i$. By the same logic described in @bijection_strategy, the response to each $Q_i$ determines $K sect B_i$. Now compute: $ Q_b = union_(i=0)^(b-1) (K sect B_i) = K sect (union_(i=0)^(b-1) B_i) = K sect NN_n = K $.
]] <win_did_no_error_term>
How can we use this to win the real game, that has the error term $e_k$? We might try to generalize the notion of "branch" (@branch_definition) to allow for nondeterministic functions, like so:
#definition[Let $f: D arrow 2^R$ be a nondeterministic function. Some $B subset.eq D$ is said to be a _branch_ of $f$ if for all $x_1, x_2 in B$, $f(x_1) sect f(x_2) eq.not emptyset$ implies $x_1 = x_2$.]
Analogues of @branch_decomposition_exists, @branch_number and even @win_did_no_error_term emerge immediately, so we should get an easy analogue of @branch_number_formula as well, right? Well, unfortunately, not quite...
#theorem[Determining the branch number of a nondeterministic function is NP-complete. (More precisely: Consider the decision problem of determining, for a given nondeterministic $f: D arrow 2^R$ and $m in NN$, whether the branch number of $f$ in $D$ (denoted $k$) satisfies $k lt.eq m$. This problem is NP-complete.)
#proof[
It's easy to verify a given branch decomposition with $m$ branches or fewer in polynomial time (so the problem is in NP). For NP-hardness, there's a natural reduction to this problem of a known NP-complete problem -- graph k-colorability. Number the graph's edges and vertices, then construct an $f: ZZ arrow ZZ$ which sends each vertex number to a set containing itself, as well as all numbers of edges that vertex touches. There is a straightforward one-to-one correspondence between $k$-colorings of the graph and branch decompositions of $f$ in $ZZ$ that have $k$ branches. So, the graph is $k$-colorable iff $f$'s branch number in $ZZ$ is at most $k$.
]
] <nondeterministic_branch_number_npc>
Informally speaking, this means that any attack on DiD that tries to make use of $f$'s nondeterministic branch number will have to either make use of $f$'s specific features ($f$ lives in $ZZ / (p ZZ)$ for a prime $p$; it squares then possibly adds 1; etc), or else be suboptimal, in the sense that it will not have access to the exact branch number.
"Suboptimal" in this case does not mean not optimal enough. Using some greedy algorithm for "efficient enough" coloring (like e.g. repeatedly taking away a maximal independent set and assigning it a color) works well enough in practice for this problem with the original challenge parameters. Doing this typically results in a game win that requires 6-7 queries.
= Properly Rescuing the Attack
How feasible is analyzing $f$ to understand its potential branch structure? The kind of problem we are looking at here tends to get very scary, very quickly. A good start would be to envision the "graph we need to color" per the analogy in @nondeterministic_branch_number_npc; $a, b in ZZ / (127 ZZ)$ will be connected by an edge (meaning, they can't be on the same branch) if $a^2 - b^2 in {-1, 0, 1}$. The case with 0 is straightforward, meaning $a$ and $-a$ are always neighbors, but what about the other cases? For $a^2 - b^2 = 1$, this would have to mean that... scribble, scribble... three hours in and you are looking at arXiv papers from 2014 that prove lower bounds on the lengths of consecutive quadratic residues modulo a prime, and asking yourself where you had gone wrong to reach this point in your life.
Thankfully, there is a workaround that allows dealing with the issue without most of this hassle. The key insight is visualizing the graph of quadratic residues directly, repressing for a moment the way that a residue actually represents two possible square roots.
#theorem[For all p>5,#footnote[If we allow $p lt.eq 5$ the argument is not much different; it just allows for a degenerate case where $G_1$ has chromatic number $1$ and consequently $G$ has chromatic number $2$ instead.]
the graph $G$ induced by a DiD problem has chromatic number exactly 4.
#proof[
Consider the two graphs: $ G_1: V_1 = {b in ZZ_p | exists a in ZZ_p: a^2 = b_(mod p)} , E_1 = {{a,b} | a, b in V_1, b-a = 1 _(mod p)} $ $ G_2: V_2 = {0,1}, E_2 = {{0,1}} $
$G_2$ is the simple 2-clique and clearly has chromatic number 2. As for $G_1$, it is a sub-graph of a "circle graph" where each element of $ZZ_p$ is connected to the previous and the next; specifically, it is the sub-graph including all quadratic residues modulo $p$. But assuming $p>5$, by folk theorem there exist at least two consecutive quadratic residues and at least one quadratic non-residue modulo $p$; so $G_1$ must also have a chromatic number of $2$, since it is a union of disjoint simple paths at least one of which is more than 1 vertex long.
Now (and this is the key insight) $G$ is in fact isomorphic to the strong product of $G_1$ and $G_2$. By a property of strong products, the product's chromatic number is at most the product of the element chromatic numbers, $2 times 2 = 4$. But clearly $G$ cannot have a chromatic number smaller than 4, since it contains 4-cliques (any 4 square roots corresponding to 2 consecutive quadratic residues). This shows its chromatic number is exactly 4. ]
] <did_colorable>
Try drawing the graph for a sample $p$ and see its shape to become convinced of what's going on here, and the way that the fact that $G$ "is a bunch of simple paths, it's just that each node in the path is actually 2 nodes, with all the induced edges this implies" determines $G$'s chromatic number.
Understanding this structure of the graph immediately allows a winning strategy that only requires $5$ queries (a nice margin below the allotted 11).
This is a good time to take a moment and appreciate how, using some visualization and / or the properties of graph strong products, you just "solved an NP-complete problem"! Not everything that is difficult in the general case is going to be difficult in the specific case you actually need to solve.
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-bidi_06.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test inline object.
#set text(lang: "he")
קרנפיםRh#box(image("/assets/files/rhino.png", height: 11pt))inoחיים
|
https://github.com/ayoubelmhamdi/typst-phd-AI-Medical | https://raw.githubusercontent.com/ayoubelmhamdi/typst-phd-AI-Medical/master/chapters/ch10-ipynb.typ | typst | MIT License |
== Data Preparation: Merging the CSV Files and Creating Named Tuples
One of the challenges of working with the LUNA16 dataset is that it provides two separate CSV files that contain information about the candidates and the annotations. The candidates.csv file has four columns: seriesuid, coordX, coordY, and coordZ, which indicate the unique identifier of the CT scan that contains the candidate and the coordinates of its center in the patient coordinate system. The annotation.csv file has five columns: seriesuid, coordX, coordY, coordZ, and diameter_mm, which indicate the same information as the candidates.csv file plus the diameter of the nodule in millimeters.
Using only one of these files is not sufficient or optimal for the analysis and modeling because:
- The candidates.csv file does not have information about the diameter of the candidates, which is an important feature that can affect the diagnosis and treatment of lung cancer.
- The annotation.csv file does not have information about whether the candidates are true or false nodules, which is necessary for training and evaluating a classifier.
- Both files have redundant information about the seriesuid and the coordinates, which can lead to errors or inconsistencies if they are not aligned properly.
To overcome these problems, we use a Python code that merges the information from both files and creates a list of named tuples that store relevant information for each candidate. A named tuple is a data structure that allows us to access values in a tuple using indexes or field names.
The code reads both CSV files and loops over each row in the candidates.csv file. For each candidate, it creates a tuple to represent its center coordinates and assigns it a default diameter of zero. It then fetches the annotations that belong to the same CT scan as the candidate from a dictionary called diameters. It loops over each annotation and compares its center coordinates with the candidate’s center coordinates along each axis (X, Y and Z). If the distance between them is less than half the radius of the annotation along all three axes, then it considers the candidate and the annotation as the same nodule and assigns the diameter of the annotation to the candidate. If no match is found, then it keeps the default diameter of zero.
The code also adds the information about whether the candidate is a true nodule or not (based on the class column in the candidates.csv file) to the named tuple.
== HU
In the context of HU (Hounsfield Units), which are used to measure the density of tissues in CT scans, We use a the clip function to limit the range of HU values to a certain interval, such as [-1000, 1000], which corresponds to the typical range of lung tissues. This can help to reduce the noise and improve the contrast of the images. For example, it will replace any values in ct_scan that are less than -1000 with -1000, and any values that are greater than 1000 with 1000.
== scan
The sentence means that the CT scan has a shape of (305, 512, 512), which means that it has 305 slices of size 512 by 512 pixels. Each slice is a grayscale image that represents a cross-section of the patient's body. 41 color channel in the same resolution. This is because 305 / 3 = 41.666, which we can round down to 41.
==
Here are the two tables in markdown format:
| Epoch | Loss | Accuracy | Correct pos/neg |
| ----- | ------ | -------- | --------------- |
| 01 | 1.177 | 95.92% | 0/141 |
| 02 | 0.000 | 100.00% | 0/147 |
| 03 | 0.000 | 100.00% | 0/147 |
| 04 | 0.000 | 100.00% | 0/147 |
| 05 | 0.000 | 100.00% | 0/147 |
Training metrics table
| Epoch | Loss | Accuracy | Correct pos/neg |
| ----- | ------- | -------- | --------------- |
| 01 | 407.578 | 94.12% | 0/16 |
| 02 | 658.517 | 94.12% | 0/16 |
| 03 | 773.610 | 94.12% | 0/16 |
| 04 | 820.082 | 94.12% | 0/16 |
| 05 | 836.596 | 94.12% | 0/16 |
Validation metrics table
== Evaluating Lung Nodule Detection Using FROC
One of the challenges of evaluating nodule detection algorithms is that there is no single threshold that can be used to classify a candidate as a nodule or not. Different thresholds may result in different trade-offs between sensitivity (the ability to detect true nodules) and false positive rate (the number of false alarms per scan) ².
To overcome this challenge, the LUNA16 framework uses a metric called Free-Response Receiver Operating Characteristic (FROC) curve, which plots the sensitivity versus the average number of false positives per scan at different operating points. The FROC curve can capture the performance of a nodule detection algorithm across a range of thresholds, and it can be summarized by a single score called the FROC score, which is the average sensitivity at seven predefined false positive rates: 1/8, 1/4, 1/2, 1, 2, 4, and 8 ².
The LUNA16 framework provides a script for validation that computes the FROC curve and score for a given nodule detection algorithm. The script takes as input a csv file that contains the predicted locations and probabilities of candidates for each scan in the dataset. The script then compares the predictions with the reference standard annotations and calculates the sensitivity and false positive rate at different probability thresholds. The script then plots the FROC curve and prints the FROC score for the algorithm ³.
The purpose of the script is to provide a consistent and objective way of evaluating nodule detection algorithms on the LUNA16 dataset. The script also allows participants to submit their results to the online leaderboard and compare their performance with other algorithms.
== Résumé.
We present a machine learning experiment where we attempted to classify lung nodules as benign or malignant based on CT scan images. We used a convolutional neural network (CNN) model and trained it on a dataset of 10861 nodules, of which only 25 were malignant. We evaluated the model on a validation set of 2709 nodules, of which only 6 were malignant. We obtained an accuracy of 99.78%, but a recall of 0% for the malignant class. We discuss the reasons for this poor performance and suggest some possible solutions to address the class imbalance problem.
== Introduction
Lung cancer is one of the leading causes of cancer-related deaths worldwide. Early detection and diagnosis of lung nodules, which are small masses of tissue in the lungs, can improve the survival rate and treatment outcomes for lung cancer patients. However, lung nodules are difficult to detect and classify, as they can vary in size, shape, location, and appearance. Moreover, most lung nodules are benign, meaning they are not cancerous, and only a small fraction are malignant, meaning they are cancerous. This poses a challenge for machine learning models that aim to automate the task of lung nodule detection and classification.
In this rapport, we present a machine learning experiment where we used a CNN model to classify lung nodules as benign or malignant based on CT scan images. We used a publicly available dataset called LUNA16, which contains 888 CT scans with annotated nodules. We extracted 10861 nodules from the scans, of which only 25 were malignant. We split the nodules into a training set of 8152 nodules and a validation set of 2709 nodules. We trained the CNN model on the training set and evaluated it on the validation set. We measured the performance of the model using accuracy and recall.
== Results
We obtained an accuracy of 99.78% on the validation set, which means that the model correctly predicted the class of 2703 out of 2709 nodules. However, when we looked at the confusion matrix, we found that the model predicted all the nodules as benign, and none as malignant. This means that the model had a recall of 0% for the malignant class, which means that it failed to identify any of the 6 malignant nodules in the validation set. This also means that the model had a precision of 0% for the malignant class, which means that none of its predictions for the malignant class were correct.
== Discussion
The main reason for this poor performance is the class imbalance problem in our dataset. The dataset has a very large imbalance between the benign and malignant classes, with the benign class being over 400 times more frequent than the malignant class. This makes it hard for the model to learn how to distinguish between the classes, and it might default to predicting the most common class. Moreover, because our dataset is highly imbalanced, accuracy is not a good measure of performance, as it can be misleadingly high even when the model makes incorrect predictions for the minority class.
To address this problem, we need to use a better strategy to train our model and also a better indication of model performance instead of accuracy. Some possible solutions are:
- Using data augmentation techniques to increase the number of malignant samples in our dataset.
- Using oversampling or undersampling methods to balance the classes in our dataset.
- Using weighted loss functions or class weights to penalize incorrect predictions for the minority class more than for the majority class.
- Using metrics such as F1-score, ROC-AUC, or PR-AUC that take into account both precision and recall for each class.
We plan to implement some of these solutions in our future work and hope to improve our model's performance on lung nodule classification.
== Conclusion
We presented a machine learning experiment where we attempted to classify lung nodules as benign or malignant based on CT scan images. We used a CNN model and trained it on a dataset of 10861 nodules, of which only 25 were malignant. We evaluated the model on a validation set of 2709 nodules, of which only 6 were malignant. We obtained an accuracy of 99.78%, but a recall of 0% for the malignant class. We discussed the reasons for this poor performance and suggested some possible solutions to address the class imbalance problem.
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Lausanne.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Lausanne",
authors: (
"<NAME>",
),
date: "4 Août, 2024",
)
#set heading(numbering: "1.1.")
- Forfait
- Suisse
- Prix
- 12.95 CH/Mois (A vie)
- Activation gratuite
- Offre
- Tout illimité en suisse
- Documents
- Carte d’identité
- ?
- #link("https://www.go-mo.ch/fr/?utm_source=monforfait&utm_medium=comparators")[lien]
- France
- Prix
- 2 €/Mois OU Gratuit pour les abonnées free
- Offre
- Free 50 Mo
- #link("https://mobile.free.fr/fiche-forfait-2-euros")[lien]
- Box Internet
- Wingo
- Prix
- 49.95 CHF/Mois
- Engagement 12 mois
- 99 CHF en Frais d’Activation
- Offre
- 1 Gbit/s
- Box internet
- #link("https://www.wingo.ch/fr/internet")[lien]
- Banque
- Raiffeisen
- Offre
- Retrait 1500 CHF sans frais
- TWINT
- Carte de crédit
- Prepaid moins de 18 ans
- classic avec des servicces d’assurances ( 18 ans )
- Compte épargne
- Compte privé
- 50% sur l’abonnement demi-tarif
- Prix
- Frais de tenus de compte 0 CHF
- Cotisation annuelle 0 CHF
- Paiements en Suisse 0 CHF
- Paiements à l’étranger 1.25%, min 1.50 CHF
- Retraits
- Gratuit chez Raiffeisen
- 12 Gratuits chez les autres, 2 CHF par retrait
- A l’étranger 4.50 CHF par retrait
- Taux d’intéret 0.4% à partir de 50’000 CHF sur le compte privé
- Taux d’intéret 1.1% à partir de 50’000 CHF sur le compte épargne
- Relevés de compte 12 CHF / ans
- #link("https://www.raiffeisen.ch/lausanne-haute-broye-jorat/fr/clients-prives/comptes-et-paiements/pack-youngmemberplus.html#dteaccordionitem_1100681283-1100596685")[lien]
- UBS
- #link("https://www.ubs.com/ch/fr/private/accounts-and-cards/bundles/generation.html")[lien]
- neon free
- Banque en ligne
- Revolut
- Electricité
- #link("https://www.lausanne.ch/vie-pratique/energies-et-eau/services-industriels/particuliers/je-choisis-mon-offre/electricite.html?tab=tarifs")[lien]
- Assurance mobilier ménage
- #link("https://www.eca-vaud.ch/assurances/assurance-mobilier-menage/")[lien]
- Controle des habitants
- #link("https://www.lausanne.ch/prestations/controle-des-habitants/formulaires-documents-ch.html#documents-pour-les-habitants-0")[lien]
- Transport
- FlexiAbo Annuel tl
- Prix 275 CHF / ans
- Il faut choisir 100 jours dans l’année où on voyage
- #link("https://www.t-l.ch/abos_et_billets/abonnements/abonnements-mobilis/#junior")[lien]
- Abonnement Annuel
- Prix 495 CHF / ans
- Tout les jours de l’année
- #link("https://www.t-l.ch/abos_et_billets/abonnements/abonnements-mobilis/#junior")[lien]
- Demi-Tarif Jeune sbb ( Rentable si on va en vélo la majorité du
temps)
- Prix 120 CHF la 1ère année puis 100 CHF / ans
- 50 trajet pour le rentabiliser
- #link("https://www.sbb.ch/fr/billets-offres/abonnements/demi-tarif.html")[lien]
|
|
https://github.com/DieracDelta/presentations | https://raw.githubusercontent.com/DieracDelta/presentations/master/polylux/book/src/utils/sections.md | markdown | # Sections
Another way of expressing where we are in a presentation is working with sections.
Usually, this is a topic that a theme will/should handle so **this page is
addressed more towards theme authors**.
In your theme, you can incorporate the following features from the `utils`
module:
First, whenever a user wants to start a new section, you can call
```typ
#utils.register-section(the-section-name)
```
with whatever name they specify.
It is up to you to decide what kind of interface you provide for the user and
how/if you visualise a new section, of course.
Based on that, you can then display what section the presenter is currently in
by using:
```typ
#utils.current-section
```
If no section has been registered so far, this is empty content (`[]`).
And finally, you might want to display some kind of overview over all the sections.
This is achieved by:
```typ
#utils.polylux-outline()
```
Unfortunately, it is hard to get the Typst-builtin `#outline` to work properly
with slides, partly again due to how page numbers are kind of meaningless.
`polylux-outline` is a good alternative to that and will return an `enum` with
all the registered sections (ever, not only so far, so you can safely use it
at the beginning of a presentation).
`polylux-outline` has two optional keyword arguments:
- `enum-args`: pass a dictionary that is propagated to
[`enum` as keyword arguments](https://typst.app/docs/reference/layout/enum#parameters),
for example `enum-args: (tight: false)`, default: `(:)`
- `padding`: pass [something that `pad` accepts](https://typst.app/docs/reference/layout/pad#parameters),
will be used to pad the `enum`, default: `0pt`
|
|
https://github.com/marcothms/clean-polylux-typst | https://raw.githubusercontent.com/marcothms/clean-polylux-typst/main/theme.typ | typst | #import "@preview/polylux:0.3.1": *
#import "@preview/codelst:1.0.0": sourcecode
// CONFIG: Font
#let font = "Roboto"
#let weight = "light"
#let size = 20pt
// CONFIG: Color
#let color-primary = rgb("#66A182")
#let color-foreground = rgb("#5c6a72")
#let color-background = rgb("#ffffff")
#let footer-lighten-value = 50% // how much lighter the color of the footer is
#let section-foreground = color-background // color of text on section slide and headers
#let focus-background = color-foreground // background of the focus slide
#let focus-foreground = color-background // foreground of focus slide
// Footer in the bottom left
#let custom-footer = state("custom-footer", none)
// Last section in the top left
#let last-section = state("last-section", none)
// A normal slide
#let slide(title: none, is_toc: false, body) = {
let header-cell = block.with(
width: 100%,
height: 100%,
above: 0pt,
below: 0pt,
breakable: false
)
// Bar in the top
let header = {
set align(top)
if title != none {
show: header-cell.with(fill: color-primary, inset: 1.2em)
set align(horizon)
if not is_toc {
text(fill: section-foreground, size: 0.6em, last-section.display())
text([\ ])
}
text(fill: section-foreground, size: 1.2em, strong(title))
} else { [] }
}
// Footer with text on the left and slide count on the right
let footer = {
set text(size: 0.6em)
show: pad.with(1em)
set align(bottom)
let footer-color = color-foreground.lighten(footer-lighten-value)
text(fill: footer-color, custom-footer.display())
h(1fr)
text(fill: footer-color, [#logic.logical-slide.display()/#utils.last-slide-number])
}
set page(
header: header,
footer: if not is_toc { footer } else [],
margin: (top: 5em),
fill: color-background,
)
let content = {
show: align.with(horizon)
show: pad.with(left: 2em, right: 2em, top: -1.5em)
set text(fill: color-foreground)
body
}
logic.polylux-slide(content)
if is_toc {
// Don't count TOC slide towards slide count
logic.logical-slide.update(0)
}
}
// The actual presentation main
#let presentation(
aspect-ratio: "16-9",
title: [Sample title],
occasion: [Sample occasion],
author: [Sample Author],
date: [01.01.1970],
logos: (),
logo_height: 50%,
footer: [],
body
) = {
set text(font: font, weight: weight, size: size)
set strong(delta: 100)
set par(justify: true)
set page(
paper: "presentation-" + aspect-ratio,
fill: color-background,
margin: 0em,
header: none,
footer: none,
)
// save foother to global state
custom-footer.update(footer)
let title-slide = {
set text(fill: color-foreground, size)
set align(center + horizon)
block(width: 100%, inset: 2em, {
// Logo
if type(logos) == type("string") { // fix buggy behavior, with a single entry
align(center+horizon, image(logos, height: logo_height))
} else if logos.len() == 0 {
// Do not show any logos
} else {
grid(
columns: logos.len(),
..logos.map((logo) => (align(center+horizon, image(logo, width: logo_height))))
)
}
text(size: 1.3em, strong(title))
line(length: 100%, stroke: .05em + color-primary)
set text(size: .8em)
h(1fr)
if author != none {
block(spacing: 1em, author)
}
if date != none {
block(spacing: 1em, date)
}
set text(size: .8em)
h(1fr)
if occasion != none {
set text(weight: "regular")
block(spacing: 1em, occasion)
}
})
}
logic.polylux-slide(title-slide)
// Show TOC
slide(title: "Contents", is_toc: true)[
#utils.polylux-outline(enum-args: (tight: false,))
]
body
}
// Section brake slides with big title printed
#let section(name) = {
set page(fill: color-primary)
let content = {
utils.register-section(name)
set align(horizon + center)
show: pad.with(20%)
set text(size: 2em, weight: "bold", fill: section-foreground)
name
}
logic.polylux-slide(content)
// Do not count section slides towards total slide count
logic.logical-slide.update(i => i - 1)
// Update last section name to display it in the following slides
last-section.update(name)
}
// Only show the text centered and big (good for a final slide)
#let focus-slide(body) = {
set page(fill: focus-background, margin: 2em)
set text(fill: focus-foreground, size: 1.5em)
logic.polylux-slide(align(horizon + center, body))
// Do not count focus slides towards total slide count
logic.logical-slide.update(i => i - 1)
}
|
|
https://github.com/CedricMeu/ugent-typst-template | https://raw.githubusercontent.com/CedricMeu/ugent-typst-template/main/0.1.0/lib.typ | typst | #import "@preview/acrostiche:0.3.1": init-acronyms, print-index
#import "lib/research-questions.typ": init-rqs
#import "lib/utils.typ": current-academic-year
#let thesis(
// The title of this thesis [content]
title: none,
// the authors of this thesis [array of strings]
authors: none,
// the font that's used for the thesis [string]
font: "UGent Panno Text",
// optionally align pagebreaks to odd pages [bool]
body
) = {
// title, authors are required (return clear error message if not given)
assert.ne(title, none, message: "`title` is a required argument")
assert.ne(authors, none, message: "`authors` is a required argument")
set document(
title: title,
author: authors,
)
// make new sections appear on the right hand side
set pagebreak(weak: true, to: "odd")
show par: set block(spacing: 20pt)
set par(leading: 12pt, justify: true)
set page(
margin: (left: 2.5cm, right: 2.5cm, top: 2.5cm, bottom: 2.5cm),
paper: "a4",
numbering: "I",
header: context {
let elems = query(
selector(heading).before(here()))
let headings_at_this_page = query(
heading.where(level: 1)
).find(h => h.location().page() == here().page())
let page_has_no_heading = headings_at_this_page == none
if elems.len() != 0 and page_has_no_heading {
let body = elems.last().body
align(right, emph(body))
}
},
)
show heading.where(
level: 1
): it => {
pagebreak()
text(size: 26pt, it)
v(1.25em)
}
show heading.where(
level: 2
): it => {
text(size: 22pt, it)
v(1em)
}
show heading.where(
level: 3
): it => {
text(size: 17pt, it)
v(.75em)
}
set text(font: font)
// don't break up words in justified text
set text(hyphenate: false)
body
}
#let main-content(body) = {
set heading(numbering: "1.1", supplement: "Chapter")
set page(numbering: "1")
counter(page).update(1)
body
}
// whether to show text black or white based on background colour
#let bw-text(colour) = {
if oklab(colour).components().at(0) > 70% {
black
} else {
white
}
}
#let acronyms(
acros: (
"ML": "Machine Learning",
"AI": "Artificial Intelligence",
)
) = {
init-acronyms(acros)
}
#let show-acronyms() = {
print-index()
}
#let rqs(
questions: ("RQ1": "What is the impact of X on Y?",)
) = {
init-rqs(questions)
}
|
|
https://github.com/grnin/Zusammenfassungen | https://raw.githubusercontent.com/grnin/Zusammenfassungen/main/Bsys2/06_Scheduling.typ | typst | // Compiled with Typst 0.11.1
#import "../template_zusammenf.typ": *
#import "@preview/wrap-it:0.1.0": wrap-content
/*#show: project.with(
authors: ("<NAME>", "<NAME>"),
fach: "BSys2",
fach-long: "Betriebssysteme 2",
semester: "FS24",
tableofcontents: (enabled: true),
language: "de"
)*/
= Scheduling
Auf einem Prozessor läuft zu einem Zeitpunkt immer _höchstens ein Thread_. Es gibt folgende _Zustände:_
#wrap-content(
image("img/bsys_27.png"),
align: bottom + right,
columns: (60%, 40%),
)[
- _Running:_ der Thread, der gerade läuft
- _Ready:_ Threads die laufen können, es aber gerade nicht tun
- _Waiting:_ Threads, die auf ein Ereignis warten
#hinweis[(können nicht direkt in den Status running wechseln, müssen neu gescheduled werden)]
Übergänge von einem Status zum anderen werden _immer vom OS_ vorgenommen.
Dieser Teil vom OS heisst _Scheduler_.
]
#wrap-content(
image("img/bsys_28.png"),
align: top + right,
columns: (55%, 45%),
)[
== Grundmodell
Threads, die auf Ereignisse _warten_, müssen das _nicht_ in einer _Endlosschleife_ tun
#hinweis[(Busy-Wait)]. Stattdessen registriert das OS sie auf das entsprechende Ereignis
und setzt sie in den Zustand _waiting_. Tritt das Ereignis auf, ändert das OS den
Zustand auf _ready_. Es laufen nur Threads auf dem Prozessor, die _nicht warten_.
=== Ready-Queue
In der Ready-Queue #hinweis[(kann auch ein Tree sein)] befinden sich alle Threads, die
_bereit sind zu laufen_. Neue Threads kommen typischerweise direkt in die Ready-Queue
#hinweis[(Einige OS stellen neue Threads auf waiting)].
]
=== Powerdown-Modus
Wenn kein Thread _laufbereit_ ist, schaltet das OS den Prozessor in _Standby_.
Der Prozessor wird dann durch den nächsten _Interrupt_ wieder geweckt.
So wird erheblich _Energie gespart_. _Busy-Waits_ sind verpönt, weil sie das Umschalten
ins Standby verhindern.
=== Arten von Threads
- _I/O-lastig:_ Kommuniziert sehr häuftig mit I/O-Geräten und rechnet relativ wenig
#hinweis[(USB, Tastatur, Speicher)]. Priorisieren _kurze Latenz_.
- _Prozessor-lastig:_ Kommuniziert kaum oder gar nicht mit I/O-Geräten und rechnet fast
ausschliesslich. Priorisieren _mehr CPU-Zeit_.
Der Unterschied ist fliessend, aber gute Systeme _trennen rechen-intensive von
interaktiven Aktivitäten_. #hinweis[(I/O-Thread, UI-Thread etc.)]
=== Arten der Nebenläufigkeit
- _Kooperativ:_ Jeder Thread entscheidet selbst, wann er den Prozessor abgibt
#hinweis[(Auch non-preemptive genannt)]
- _Präemptiv:_ Der Scheduler entscheidet, wann einem Thread der Prozessor entzogen wird
#hinweis[(besseres System)]
*Präemptives Multithreading:* Der Thread läuft immer so lange weiter, bis er:
- Auf Ein-/Ausgabedaten, einen anderen Thread oder eine Ressource zu _warten_ beginnt,
d.h. blockiert
- _freiwillig_ auf den Prozessor _verzichtet_ #hinweis[(yield)]
- ein _System-Timer-Interrupt_ auftritt
- ein anderer Thread _ready_ wird, der auf einen Event gewartet hat und _bevorzugt werden soll_
- ein neuer Prozess _erzeugt_ wird und _bevorzugt werden soll_
=== Parallele, quasiparallele und nebenläufige Ausführung
- _Parallel:_ Alle Threads laufen tatsächlich gleichzeitig, für $n$ Threads werden $n$
Prozessoren benötigt.
- _Quasiparallel:_ $n$ Threads werden auf $<n$ Prozessoren _abwechselnd_ ausgeführt,
sodass der Eindruck entsteht, dass sie parallel laufen würden.
- _Nebenläufig:_ Überbegriff für parallel oder quasiparallel; aus Sicht des Programmierers
sind thread-basierte Programme meist nebenläufig.
#wrap-content(
image("img/bsys_29.png"),
align: top + right,
columns: (50%, 50%),
)[
=== Bursts
- _Prozessor-Burst:_ Intervall, in dem ein Thread den Prozessor in einem parallelen
System _voll belegt_, also vom Einrit in _running_ bis zum nächsten _waiting_.
- _I/O-Burst:_ Intervall, in dem ein Thread den Prozessor _nicht_ benötigt,
also vom Eintritt in _waiting_ bis zum nächsten _running_.
]
Jeder Thread kann als _Abfolge_ von _Prozessor-Bursts_ und _I/O-Bursts_ betrachtet werden.
== Scheduling-Strategien
Anforderungen an einen Scheduler können vielfältig sein.
_Geschlossene Systeme:_
Der Hersteller kennt alle Anwendungen und weiss, in welcher Beziehung sie zueinander
stehen #hinweis[(Router, TV Box)].
_Offene Systeme:_
Der Hersteller des OS muss von typischen Anwendungen ausgehen und dahin gehend optimieren.
*Anforderungen aus Sicht der Anwendung sind z.B. die Minimierung von:*
- _Durchlaufzeit (turnaround time):_ Zeit vom Starten des Threads bis zu seinem Ende
- _Antwortzeit (respond time):_ Zeit vom Empfang eines Requests bis die Antwort zur
Verfügung steht
- _Wartezeit (waiting time):_ Zeit, die ein Thread in der Ready-Queue verbringt
*Anforderungen aus Sicht des Systems sind z.B. die Maximierung von:*
- _Durchsatz (throughput):_ Anzahl Threads, die pro Intervall bearbeitet werden
- _Prozessor-Verwendung (processor utilization):_ Prozentsatz der Verwendung des
Prozessors gegenüber der Nichtverwendung
Grundsätzlich können Scheduler _nicht_ auf _alle Anforderungen gleichzeitig optimiert_
werden. Es gibt _keinen optimalen Scheduler_ für _alle_ Systeme. Die Wahl des Schedulers
hängt vom Einsatzzweck ab.
=== Beispiel Utilization und Antwortzeit
_Latenz_ ist die durchschnittliche Zeit zwischen Auftreten und vollständigem Verarbeiten
eines Ereignisses. Im schlimmsten Fall tritt das Ereignis dann auf, wenn der Thread gerade
vom Prozessor entfernt wurde. Um die Antwortzeit zu verringern, muss jeder Thread öfters
ausgeführt werden, was jedoch zu mehr Thread-Wechsel und somit zu mehr Overhead führt.
_Die Utilization nimmt also ab, wenn die Antwortzeit verringert wird._
#wrap-content(
image("img/bsys_30.png"),
align: top + right,
columns: (50%, 50%),
)[
=== Idealfall: Parallele Ausführung #hinweis[($bold(n)$ Threads auf $bold(n)$ Prozessoren)]
Jeder Thread kann seinen Prozessor immer dann verwenden, wenn er ihn braucht.
In der Praxis _unrealistisch_, es gibt immer mehr Threads als Prozessoren.
Dient als _idealisierte Schranke_ für andere Scheduling-Strategien.
]
#wrap-content(
image("img/bsys_31.png"),
align: top + right,
columns: (50%, 50%),
)[
=== FCFS-Strategie #hinweis[(First Come, First Served)]
Threads werden in der Reihenfolge gescheduled, in der sie der Ready-Queue hinzugefügt
werden. _Nicht präemptiv:_ Threads geben den Prozessor nur ab, wenn sie auf waiting wechseln
oder sich beenden. Die durchschnittliche Wartezeit hängt von der Reihenfolge
des Eintreffens der Threads ab. Wird der längste Prozessor-Burst zuerst bearbeitet,
warten die kürzeren Threads länger.
]
#wrap-content(
image("img/bsys_32.png"),
align: top + right,
columns: (50%, 50%),
)[
=== SJF-Strategie #hinweis[(Shortest Job First)]
Scheduler wählt den Thread aus, der den _kürzesten_ Prozessor-Burst hat.
Bei gleicher Länge wird nach FCFS ausgewählt. Kann _kooperativ_ oder _präemptiv_ sein.
Ergibt _optimale Wartezeit:_ Der kürzeste Prozessor-Burst blockiert die anderen Threads minimal.\
Kann nur _korrekt implementiert_ werden, wenn die Länge der Bursts _bekannt_ sind.
Kann sonst nur mit einer _Abschätzung historischer Daten annähernd_ implementiert werden.
]
#wrap-content(
image("img/bsys_33.png"),
align: top + right,
columns: (50%, 50%),
)[
=== Round-Robin-Scheduling
Der Scheduler definiert eine _Zeitscheibe_ von etwa 10 bis 100ms. Das Grundprinzip folgt
_FCFS_, aber ein Thread kann nur solange laufen, bis seine _Zeitscheibe erschöpft_ ist,
dann wird der in der _Ready-Queue hinten angehängt_. Benötigt er nicht den gesamten
Time-Slice, beginnt die Zeitscheibe des nächsten Threads entsprechend früher.
Die _Wahl der Zeitscheibe beeinflusst das Verhalten_ massiv.
]
=== Prioritäten-basiertes Scheduling
Jeder Thread erhält _eine Nummer_, seine _Priorität_. Threads mit höherer Priorität werden
vor Threads mit niedriger Priorität ausgewählt. Threads mit gleicher Priorität werden nach
FCFS ausgewählt. SJF ist ein Spezialfall davon: kurzer nächster Prozessor-Burst entspricht
hoher Priorität. Prioritäten je nach OS z.B. von 0 bis 7 oder von 0 bis 4096.
Auf manchen OS ist 0 die höchste, auf anderen die niedrigste Priorität. Chaos ensues.
==== Starvation
Ein Thread mit _niedriger Priorität_ kann _unendlich lange nicht laufen_, weil immer
Threads mit _höherer Priorität_ laufen.
Abhilfe z.B. mit _Aging:_ in bestimmten Abständen wird die Priorität um 1 erhöht.
=== Multi-Level Scheduling
Threads werden nach bestimmten Kriterien in verschiedene _Level_ aufgeteilt,
z.B. Priorität, Prozesstyp, Hintergrund- oder Vordergrund. Für jedes Level gibt es eine
_eigene Ready-Queue_. Jedes Level kann nach einem eigenen Verfahren geschedulet werden,
z.B. Queues gegeneinander priorisieren #hinweis[(Threads in Queues mit _höherer Priorität_
werden _immer_ bevorzugt)] oder Time-Slices pro Queue
#hinweis[(80% für UI-Queue mit Round-Robin, 20% für Hintergrund-Queue mit FCFS)].
#wrap-content(
image("img/bsys_34.png"),
align: top + right,
columns: (50%, 50%),
)[
=== Multi-Level Scheduling mit Feedback
Je Priorität eine Ready-Queue. Threads aus Ready-Queues mit _höherer Priorität_ werden
_immer_ bevorzugt. Erschöpft ein Thread seine Zeitscheibe, wird seine Priorität um 1
verringert. Typischerweise werden die Zeitscheiben mit _niedrigerer_ _Priorität_
_grösser_ und Threads mit _kurzen Prozessor-Bursts bevorzugt_.
Threads in tiefen Queues dürfen zum Ausgleich länger am Stück laufen.
]
== Prioritäten in POSIX
=== #link("https://www.youtube.com/watch?v=UBX8MWYel3s")[Der Nice-Wert]
Jeder Prozess $p$ hat einen Nice-Wert $n_p$ #hinweis[(in Linux jeder Thread)].
Dieser geht von $-20$ bis zu $+19$ und ist ein Hinweis ans System:
- Soll $p$ _bevorzugen_, wenn $n_p$ _kleiner_ ist #hinweis[($p$ ist weniger nett)]
- Soll $p$ _weniger_ oft laufen lassen, wenn $n_p$ _grösser_ #hinweis[($p$ ist netter)]
==== Nice-Wert beim Start erhöhen oder verringern: ```sh nice [-n increment] utility [argument...]```
Startet `utility` #hinweis[($u$, mit den optionalen Argumenten)] mit möglicherweise
_anderem Nice-Value_ als der aufrufende Prozess $p$.
Wenn kein `increment` angegeben: $n_u >= n_p$.
Wenn `increment` ($i$) angegeben: $n_u = n_p + i$
==== Nice-Wert im Prozess erhöhen oder verringern: ```c int nice (int i)```
Addiert `i` zum Nice-Wert des aufrufenden Prozesses $p$.
Gibt $n_p$ zurück oder $-1$, wenn Fehler. Da $-1$ aber auch ein gültiger Nice-Wert ist,
muss man den Fehler wie folgt abfragen:
```c
errno = 0; // reset errno
if (nice(i) == -1 && errno != 0) { /* Errror */ } else { /* -1 is nice value */ }
```
==== Nice-Wert im Prozess abfragen oder setzen: ```c int getpriority``` / ```c int setpriority```
```c int getpriority (int which, id_t who)``` gibt den Nice-Wert von $p$ zurück\
```c int setpriority (int which, id_t who, int prio)``` setzt den Nice-Wert
von $p$ auf $n$. Gibt 0 zurück wenn OK, sonst -1 und Fehlercode in `errno`.
Spezifiziert Prioriät für einzelnen Prozess, Prozessgruppe oder alle Prozesse eines Users.
- _`which`:_ `PRIO_PROCESS`, `PRIO_PGRP` oder `PRIO_USER`
- _`who`:_ ID des Prozesses, der Gruppe oder des Users
==== Priorität bei Threads setzen: ```c ...schedparam```
```c int pthread_getschedparam(pthread_t thread, int * policy, struct sched_param * param)```\
```c int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param * param)```\
```c int pthread_attr_getschedparam(const pthread_attr_t * attr, struct sched_param * param)```\
```c int pthread_attr_setschedparam(pthread_attr_t * attr, const struct sched_param * param)```
Die Priorität kann während der Thread läuft mit den regulären Funktionen, vor dem
Threadstart mit den `attr`-Funktionen gesetzt werden. Attribute eines Threads enthalten
ein _`struct sched_param`_. Dieser kann vom Thread oder seinen Attributen _abgefragt_
werden. Enthält ein Member `sched_priority`, das die _Priorität_ bestimmt.
==== Priorität bei Thread-Erzeugung setzen
```c
pthread_attr_t a;
pthread_attr_init (&a);
struct sched_param p;
pthread_attr_getschedparam ( &a, &p ); // read parameter
// set p.sched_priority
pthread_attr_setschedparam ( &a, &p );
pthread_create ( &id, &a, thread_function, argument );
pthread_attr_destroy ( &a ); // destroy attributes
``` |
|
https://github.com/MHellmund/typst-kbd-cheatsheet | https://raw.githubusercontent.com/MHellmund/typst-kbd-cheatsheet/main/Readme.md | markdown | MIT License |
# A keyboard cheatsheet written in Typst loading a YAML file with keyboard codes
The design was inspired by <NAME>'s beautiful LaTeX template https://gist.github.com/alexander-yakushev/c773543bf9a957749f79 .
|
https://github.com/Toniolo-Marco/git-for-dummies | https://raw.githubusercontent.com/Toniolo-Marco/git-for-dummies/main/slides/practice/commit.typ | typst | #import "@preview/touying:0.5.2": *
#import themes.university: *
#import "@preview/numbly:0.1.0": numbly
#import "@preview/fletcher:0.5.1" as fletcher: node, edge
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)
#import "../components/gh-button.typ": gh_button
#import "../components/git-graph.typ": branch_indicator, commit_node, connect_nodes, branch
Once we add the files to the staging area, we can create a commit with the command:
```bash
➜ git commit -m "Message describing changes made"
```
The commit message should be clear and describe what you have done.
If you want to add all *modified files* to the staging area and create a commit in one command, you can use it:
```bash
➜ git commit -am "Message describing changes made"
```
If you want to add all the files, even the untracked ones, you cannot do it in one command. You will first have to add the files to the staging area with `git add -A` and then create the commit, following the classic procedure.
---
=== Amend
Through the command `git commit --amend` we can edit the last commit we made if *not already pushed*. This allows us both to *change the commit message* and to *add files that are currently in stage to the previous commit*; rather than creating a new commit.
#footnote([note: actually the commit hash changes!])
#v(10%)
#grid(columns: 2,rows: 2,column-gutter: 10%, row-gutter: 15%,
[So you transform this:],
[into this:],
grid.cell(align: bottom)[
#set text(size: 10.5pt)
#fletcher-diagram(
node-stroke: .1em,
node-fill: none,
spacing: 4em,
mark-scale: 50%,
branch( // main branch
name:"main",
color:blue,
start:(0,1),
length:3,
commits:("init commit","second commit","unneeded commit",),
head:2
),
node((3,1.6), `a76bca`, stroke:none),
edge((3,1),(4,1),"--",stroke:2pt+blue,label-pos:1,
label:[
#set text(style:"italic")
some staged files]),
)
],
grid.cell(align: bottom)[
#set text(size: 10.5pt)
#fletcher-diagram(
node-stroke: .1em,
node-fill: none,
spacing: 4em,
mark-scale: 50%,
branch( // main branch
name:"main",
color:blue,
start:(0,1),
length:3,
commits:("init commit",
"second commit",
"renamed message\nall changes",),
head:2
),
node((3,1.6), `663b9d`, stroke:none),
)
]
)
---
=== Amend
#grid(columns:2, column-gutter:5%,
[
- If we only need to _rename_ the commit, the command: `git commit --amend -m “changed message”`.
- Instead, to _add_ staged files to the previous commit, simply run the command `git add <file>` (if we don't already have the affected files in staging area) and then `git commit --amend`.
- At this point a file will show up in our default editor, here we can edit the commit message, read the changes made.
- Once the file is saved and closed, the commit will be edited.
],
image("/slides/img/meme/git-commit-message.png")
)
---
=== Co-author in commit
#set align(center + horizon)
#grid(columns: 2, column-gutter: 1em,
grid.cell(align: left)[Some platforms, such as GitHub, allow co-authors to be added to commits. This can be done by simply formatting the commit message as follows:],
image("../img/co-authored-commit.png")
)
#v(10%)
```bash
➜ git commit -m "Commit message
>
>
Co-authored-by: NAME <<EMAIL>>
Co-authored-by: ANOTHER-NAME <<EMAIL>>"
```
---
```bash
➜ git commit -m "Commit message
>
>
Co-authored-by: NAME <<EMAIL>>
Co-authored-by: ANOTHER-NAME <<EMAIL>>"
```
Yeah, *no password required*, no approval required: you can add both *<NAME>* and *your teacher* as Co-Authors
#grid(columns: 2,
align: center,
inset: 0pt,
image("../img/linus-torvalds.jpg",width: 50%),
image("../img/marco-patrignani.png", width: 45%)
)
What a time to be alive.
---
=== Visualize commits
To view the commit history, you use: `git log`. This will show commits with their hash, author, date and message. You can also use options such as `--online` for a more compact view.
```bash
➜ git log --oneline
4f60048 (HEAD -> main, origin/main, my-fork/main, my-fork/HEAD) Merge pull request #3 from Username/main
7b6bc5a (my-fork/feature-1, feature-2, feature-1) Merge branch 'feature-2'
81a7ba6 feature 2 commit
f679048 feature 1 commit
ff2e750 renamed
0a0d983 ops
8732acf Create README.md
``` |
|
https://github.com/HEIGVD-Experience/docs | https://raw.githubusercontent.com/HEIGVD-Experience/docs/main/S4/WEB/docs/3-JavaScript/javascript.typ | typst | #import "/_settings/typst/template-note-en.typ": conf
#show: doc => conf(
title: [
JavaScript
],
lesson: "WEB",
chapter: "3 - JavaScript",
definition: "This text provides a comprehensive introduction to JavaScript, covering its educational objectives, differences between client and server environments, data types, operators, variables, functions, and regular expressions. It emphasizes the ability to write and understand JavaScript code in various contexts, including client-side and server-side. Concepts are explained concisely with practical examples, making it a useful resource for beginners and those looking to deepen their understanding of JavaScript.",
col: 1,
doc,
)
= Educational objectives
- Cite all the environments where JavaScript can be executed.
- Can write JavaScript code in all the environments where it can be executed.
- Explain the difference between interpreted and compiled languages.
- Read and write basic JavaScript code.
- Read regular expressions.
- Explain the difference between var, let, and const.
- Explain the difference between == and ===.
- Explain the difference between null and undefined.
= Introduction
JavaScript is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.
*Interpreted*
The interpreter reads the source code and executes it directly. It does not require the compilation of the program into machine-code.
*Just-in-time (JIT) compiled*
The interpreter compiles the hot parts of the source code into machine-code and executes it directly. The rest of the program is interpreted.
*First-class functions*
Functions are treated like any other value. They can be stored in variables, passed as arguments to other functions, created within functions, and returned from functions.
== Client and server-side JavaScript
=== Client-side JavaScript
Client-side JavaScript is executed in the user's browser. It is used to create dynamic web pages. It can be used to validate user input, create animations, and communicate with the server without reloading the page.
==== Adding JavaScript directly to HTML
```html
<script type='text/javascript'>
console.log('Hello, World!');
document.writeln('Hello, World!')
</script>
```
==== Adding JavaScript to an external file
```html
<script src='script.js'></script>
```
- The defer attribute is used to defer the execution of the script until the page has been loaded.
- The async attribute is used to load the script asynchronously.
=== Server-side JavaScript
Server-side JavaScript is executed on the server. It is used to create web applications, APIs, and server-side scripts. It can be used to interact with databases, send emails, and perform other server-side tasks. You can run server-side JavaScript using Node.js.
= JavaScript types
== Primitive types
- *Undefined*: Unique primitive value undefined
- *Number*: Real or integer number (e.g. 3.14, 42)
- *Boolean*: true or false
- *String*: Character sequence, whose literals begin and end with single or double - quotes (e.g. "HEIG-VD", 'hello')
- *BigInt*: Arbitrary-precision integers, whose literals end with an n (e.g. - 9007199254740992n)
- *Symbol*: Globally unique values usable as identifiers or keys in objects (e.g. Symbol(), Symbol("description"))
- *Null*: Unique value null
*In a dynamic language you don’t specify the type when you declare a variable and the type of a variable can change.*
== Objects
- Object: Collection of key-value pairs
The symtax for creating an object is:
```javascript
let person = {
firstName: 'John',
lastName: 'Doe',
age: 30
};
```
Properties can be accessed using dot notation or bracket notation:
```javascript
console.log(person.firstName); // John
console.log(person['lastName']); // Doe
```
== Arrays
- Array: Ordered collection of values
The syntax for creating an array is:
```javascript
let fruits = ['Apple', 'Banana', 'Cherry'];
```
Elements can be accessed using bracket notation:
```javascript
console.log(fruits[0]); // Apple
console.log(fruits.length); // Banana
```
=== Methods on arrays
```javascript
fruits.push("mango", "papaya"); // Appends new items
fruits.pop(); // Removes and returns the last item
fruits.reverse(); // Reverses the items' order
fruits.splice(2, 1, 'Orange'); // Replaces 1 elemnt at position 2 with 'Orange'
fruits.splice(1, 0, 'Peach'); // Inserts 'Peach' at index 1
```
= Operators
== Typeof operator
The typeof operator returns the type of a variable or expression.
```javascript
console.log(typeof 42); // number
console.log(typeof 'hello'); // string
console.log(typeof null); // object
console.log(typeof [1, 2, 3]); // object
```
== Arithmetic operators
```javascript
1 + 1; // addition
1 - 1; // subtraction
1 / 1; // division
1 * 1; // multiplication
1 % 1; // modulo
1 ** 1; // exponentiation
```
== String operators
```javascript
"con" + "cat" + "e" + "nate";
`PI = ${Math.PI}`; // template literals (instead of: "PI = " + Math.PI)
```
In practice we should opt for template literals over string concatenation.
== Assignment operators
```javascript
let a = 1;
// arithmetic assignments
a += 1; // addition
a -= 1; // subtraction
a *= 1; // multiplication
a /= 1; // division
a %= 1; // modulo
a **= 1; // exponentiation
```
=== Unary operators
```javascript
let a = 1;
// unary operators
a++; // increment
++a; // increment
a--; // decrement
--a; // decrement
```
== Destructuring assignment
```javascript
var [a, b] = [1, 2];
console.log(a); // 1
console.log(b); // 2
var [a, b, ...rest] = [1, 2, 3, 4, 5];
console.log(a); // 1
console.log(b); // 2
console.log(rest); // [3, 4, 5]
var {a, b} = {a: 1, b: 2};
console.log(a); // 1
console.log(b); // 2
var {a, b, ...rest} = {a: 1, b: 2, c: 3, d: 4};
console.log(a); // 1
console.log(b); // 2
console.log(rest); // {c: 3, d: 4}
```
== Logical operators
```javascript
!true // false
true && false // false
true || false // true
true ? a : b // a
```
== Optional chaining
```javascript
const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah'
}
};
console.log(adventurer.dog?.name); // expected output: undefined
console.log(adventurer.cat?.name); // expected output: Dinah
```
In this example, if we had omitted the ? symbol, it would have failed with a TypeError: adventurer.dog is undefined.
== Comparison operators
```javascript
1 == 1;
1 != 2;
1 < 2;
2 > 1;
1 <= 1;
1 >= 1;
```
=== Automatic type conversion
Automatic type conversion is performed when comparing values of different types. It is at the root of many issues when using comparison operators.
```javascript
"1" == 1 // true (!!!)
false == 0 // true
8 * null // 0
```
=== Strict equality
Strict equality compares two values for equality without type conversion.
```javascript
"1" === 1 // false
"1" !== 1 // true
```
= Variables
== var
The var statement declares a *non-block-scoped* variable, optionally initializing it to a value. Its scope is its current execution context, i.e. either the enclosing function or, if outside any function, global. It can be re-declared.
```javascript
var x = 1;
if (true) { var x = 2; } // same variable
console.log(x); // 2
```
== let
The let statement declares a *block-scoped* local variable, optionally initializing it to a value. It can be re-assigned but not re-declared.
```javascript
let x = 1;
{ let x = 2; } // different variable (in a new scope)
console.log(x); // 1
let x = 1000; // Error: redeclaration of let x
```
== const
The const statement declares a *block-scoped* read-only named constant. It can be re-assigned but not re-declared.
```javascript
const x = 1;
x = 2; // TypeError: Assignment to constant variable.
```
= Functions
== Conditional execution
```javascript
let num = prompt("Enter a number");
if (num > 0) {
alert(`${num} is positive`);
} else if (num < 0) {
alert(`${num} is negative`);
} else {
alert(`${num} is zero`);
}
```
== Switch statement
```javascript
let val = prompt("Enter a letter");
switch(val) {
case "a":
alert("a");
break;
case "b":
alert("b");
break;
default:
alert("Not a or b");
break;
}
```
== While and do-while loops
```javascript
let num = 0;
while (num < 10) {
console.log(num);
num += 1;
}
let echo = "";
do {
echo = prompt("Echo");
console.log(echo);
} while (echo != "stop");
```
== For loop
```javascript
for (let num = 0; num < 10; num++) {
console.log(num);
}
```
The for...in statement iterates over the enumerable properties of an object.
```javascript
let obj = {a: 1, b: 2, c: 3};
for (let prop in obj) {
console.log(prop, obj[prop]);
}
```
The for...of statement creates a loop iterating over iterable objects.
```javascript
let nums = [0, 1, 2, 3, 4, 5, 6, 7, 8 , 9];
for (let num of nums) {
console.log(num);
}
```
#colbreak()
== Break and continue
The *break* statement terminates the current loop.
The *continue* statement terminates the execution of the current iteration and continues the execution of the loop with the next iteration.
*break* and *continue* can also be used with labelled statements, but please don’t.
== Exception handling
```javascript
try {
variable; // ReferenceError: variable is not defined
} catch (error) {
// Fails silently
}
```
Exceptions can be triggered using *throw* and *Error*:
```javascript
throw new Error("AAHHARG!!!");
```
= Function
== Declaration notation
```javascript
function square(x) {
return x * x;
}
// or
var square = function(x) {
return x * x;
}
```
== Arrow functions
```javascript
var square = x => x * x
// or
var square = (x) => {
return x * x;
}
```
== Recursion
```javascript
function factorial(n) {
return n == 1 ? n : n * factorial(n-1);
}
console.log(factorial(5)) // 5 * 4 * 3 * 2 * 1 = 120
```
.. as long as it does not overflow the call stack.
== Higher-order functions
```javascript
function greaterThan(n) {
return m => m > n;
}
let greaterThan10 = greaterThan(10);
console.log(greaterThan10(11)); // true
```
= Regular expressions
Regular expressions are patterns used to match character combinations in strings. They are created using the RegExp constructor or a literal notation.
```javascript
const re1 = /ab+c/;
const re2 = new RegExp(/ab+c/);
```
A regular expression pattern must be surrounded by slashes (/). The pattern can include flags that specify how the search is performed.
- `Character Classes (., \s, \d, …)` that distinguish types of chararters (resp. any, whitespace or digit)
- `Character sets ([A-Z], [a-z], [0-9], [abc], …)` that match any of the enclosed - characters (resp. uppercase letters, lowercase letters, digits, and any of a, b or c)
- Either operator (x|y) that match either the left or right handside values
- `Quantifiers (\*, +, ?, {n}, {n,m})` that indicate the number of times an expression matches
- `Boundaries (^, \$)` that indicate the beginnings and endings of lines and words
- `Groups ((), (?<name>), (?:))` that extracts and remember (or not) information from the input
- `Assertions (x(?=y))` that helps at defining conditional expressions
== Flags
```javascript
const re1 = /ab+c/; // no flag
const re2 = /ab+c/g; // global search
const re3 = /ab+c/i; // case-insensitive search
const re4 = /ab+c/m; // multi-line search
const re5 = /ab+c/gi // global case-insensitive search
``` |
|
https://github.com/SillyFreak/typst-crudo | https://raw.githubusercontent.com/SillyFreak/typst-crudo/main/tests/unit/test.typ | typst | MIT License | #import "/src/lib.typ" as crudo
// the output is not relevant for this test
#set page(width: 0pt, height: 0pt)
#assert.eq(
crudo.r2l(```txt
first line
second line
```),
(
("first line", "second line"),
(block: true, lang: "txt"),
),
)
#assert.eq(
crudo.r2l(raw("first line\nsecond line")),
(
("first line", "second line"),
(:),
),
)
#assert.eq(
crudo.r2l("first line\nsecond line"),
(
("first line", "second line"),
(:),
),
)
#assert.eq(
crudo.l2r(("first line", "second line")),
raw("first line\nsecond line"),
)
#assert.eq(
crudo.l2r(
("first line", "second line"),
block: true,
),
raw("first line\nsecond line", block: true),
)
#assert.eq(
crudo.read(
properties: (block: true, lang: "md"),
"example.md",
),
raw("\n# Example\n\nLorem ipsum.", block: true, lang: "md"),
)
#assert.eq(
crudo.transform-text(
```typc
let foo() = {
// some comment
... do something ...
}
```,
str.trim
),
raw("let foo() = {\n // some comment\n ... do something ...\n}", block: true, lang: "typc"),
)
#assert.eq(
crudo.transform(
```typc
let foo() = {
// some comment
... do something ...
}
```,
lines => lines.filter(l => {
// only preserve non-comment lines
not l.starts-with(regex("\s*//"))
})
),
raw("let foo() = {\n ... do something ...\n}", block: true, lang: "typc"),
)
#assert.eq(
crudo.map(
```typc
let foo() = {
// some comment
... do something ...
}
```,
line => line.trim()
),
raw("let foo() = {\n// some comment\n... do something ...\n}", block: true, lang: "typc"),
)
#assert.eq(
crudo.filter(
```typc
let foo() = {
// some comment
... do something ...
}
```,
l => not l.starts-with(regex("\s*//"))
),
raw("let foo() = {\n ... do something ...\n}", block: true, lang: "typc"),
)
#assert.eq(
crudo.slice(
```typc
let foo() = {
// some comment
... do something ...
}
```,
1, 3,
),
raw(" // some comment\n ... do something ...", block: true, lang: "typc"),
)
#assert.eq(
crudo.lines(
```typc
let foo() = {
// some comment
... do something ...
// another comment
}
```,
"-2,4-,1", "2-3", range(3, 5), 5,
),
raw("let foo() = {\n // some comment\n // another comment\n}\nlet foo() = {\n // some comment\n ... do something ...\n ... do something ...\n // another comment\n}", block: true, lang: "typc"),
)
#assert.eq(
crudo.lines(
zero-based: true,
```typc
let foo() = {
// some comment
... do something ...
// another comment
}
```,
"-1,3-,0", "1-2", range(2, 4), 4,
),
raw("let foo() = {\n // some comment\n // another comment\n}\nlet foo() = {\n // some comment\n ... do something ...\n ... do something ...\n // another comment\n}", block: true, lang: "typc"),
)
#assert.eq(
crudo.join(
```java
let foo() = {
// some comment
... do something ...
}
```,
```typc
let bar() = {
// some comment
... do something ...
}
```,
main: -1,
),
raw("let foo() = {\n // some comment\n ... do something ...\n}\nlet bar() = {\n // some comment\n ... do something ...\n}", block: true, lang: "typc"),
)
#assert.eq(
crudo.join(
"// these strings don't",
"// determine the properties",
```typ
// this raw block does:
// still Typst!
```,
),
raw("// these strings don't\n// determine the properties\n// this raw block does:\n// still Typst!", block: true, lang: "typ"),
)
|
https://github.com/pedrofp4444/BD | https://raw.githubusercontent.com/pedrofp4444/BD/main/report/content/[3] Modelação Concetual/caracterização.typ | typst | #let caracterização = {
[
== Identificação e Caracterização dos Atributos das Entidades e dos Relacionamentos
Nesta etapa, a caracterização dos atributos das entidades e, possivelmente, dos relacionamentos passa a ser o alvo principal.
#figure(
caption: "Caracterização dos atributos da entidade Funcionário.",
kind: table,
table(
columns: (0.6fr, 0.9fr, 1.5fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Entidade*], [*Atributo*], [*Descrição*], [*Nulo*], [*Composto*], [*Multivalorado*], [*Derivado*],[*Chave Primária*]),
table.cell(
rowspan: 7,
align: horizon,
rotate(-90deg, reflow: true)[
Funcionário
],
),
/* Atributo */
[ID],
[Identificador único do funcionário],
[Não],
[Não],
[Não],
[Não],
[Sim],
/* Atributo */
[Nome],
[Nome do funcionário],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Data de nascimento],
[Data de nascimento do funcionário],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Salário],
[Salário do funcionário atribuído pela Lusium],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[NIF],
[Número de identificação fiscal do funcionário],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Fotografia],
[Fotografia identificadora do funcionário],
[Sim],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Número de telemóvel],
[Número de telemóvel do funcionário],
[Não],
[Não],
[Sim],
[Não],
[Não],
)
)
#underline[*Entidade Funcionário*]\
Nenhum dos atributos da entidade Funcionário (*ID* - chave primária, *Nome*, *Data de nascimento*, *Salário*, *NIF*,* Fotografia* e* Número de Telemóvel*) é *composto* ou *derivado*. Apenas o atributo *Fotografia* pode ser *nulo*, uma vez que um funcionário pode escolher ter ou não uma fotografia associada, sendo todos os outros atributos *não nulos*. Por fim, apenas o atributo *Número de telemóvel* é *multivalorado*, visto que um funcionário pode ter vários números de telemóvel.
#linebreak()
#figure(
caption: "Caracterização dos atributos da entidade Função.",
kind: table,
table(
columns: (0.6fr, 0.9fr, 1.5fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Entidade*], [*Atributo*], [*Descrição*], [*Nulo*], [*Composto*], [*Multivalorado*], [*Derivado*],[*Chave Primária*]),
table.cell(
rowspan: 2,
align: horizon,
rotate(-90deg, reflow: true)[
Função
],
),
/* Atributo */
[ID],
[Identificador único do função],
[Não],
[Não],
[Não],
[Não],
[Sim],
/* Atributo */
[Designação],
[Designação da função],
[Não],
[Não],
[Não],
[Não],
[Não],
)
)
#underline[*Entidade Função*]\
Nenhum dos atributos da entidade Função (*ID* - chave primária e *designação*) é *composto*, *derivado*, *nulo* ou *multivalorado*.
#linebreak()
#figure(
caption: "Caracterização dos atributos da entidade Terreno.",
kind: table,
table(
columns: (0.6fr, 0.9fr, 1.5fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Entidade*], [*Atributo*], [*Descrição*], [*Nulo*], [*Composto*], [*Multivalorado*], [*Derivado*],[*Chave Primária*]),
table.cell(
rowspan: 3,
align: horizon,
rotate(-90deg, reflow: true)[
Terreno
],
),
/* Atributo */
[ID],
[Identificador único do terreno],
[Não],
[Não],
[Não],
[Não],
[Sim],
/* Atributo */
[Minério previsto],
[Quantidade mínima estimada de minério a coletar por dia],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Minério coletado],
[Quantidade de minério efetivamente coletado por dia],
[Não],
[Não],
[Não],
[Não],
[Não],
)
)
#underline[*Entidade Terreno*]\
Nenhum dos atributos da entidade Terreno (*ID* - chave primária, *Minério previsto* e *Minério coletado*) é *composto*, *derivado*, *nulo* ou *multivalorado*.
#linebreak()
#figure(
caption: "Caracterização dos atributos da entidade Caso.",
kind: table,
table(
columns: (0.6fr, 0.9fr, 1.5fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Entidade*], [*Atributo*], [*Descrição*], [*Nulo*], [*Composto*], [*Multivalorado*], [*Derivado*],[*Chave Primária*]),
table.cell(
rowspan: 5,
align: horizon,
rotate(-90deg, reflow: true)[
Caso
],
),
/* Atributo */
[ID],
[Identificador único do caso],
[Não],
[Não],
[Não],
[Não],
[Sim],
/* Atributo */
[Data de abertura],
[Data de abertura do caso],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Estado],
[Estado atual do caso],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Estimativa de roubo],
[Quantidade estimada de minério roubado],
[Não],
[Não],
[Não],
[Sim],
[Não],
/* Atributo */
[Data de encerramento],
[Data de encerramento do caso],
[Sim],
[Não],
[Não],
[Não],
[Não],
)
)
#underline[*Entidade Caso*]\
Nenhum dos atributos da entidade Caso (ID - chave primária, *Data de abertura*, *Estado*, *Estimativa de roubo* e *Data de encerramento*) é composto ou *multivalorado*. Apenas o atributo *Estimativa de roubo* pode ser *derivado*, uma vez que provém da diferença entre os valores dos atributos *Minério previsto* e *Minério coletado* associados à entidade *Terreno*. Por fim, apenas o atributo *Data de encerramento* pode ser *nulo*, pois um caso só apresenta uma data de encerramento a partir do momento em que o seu estado passa para “fechado”.
#linebreak()
#figure(
caption: "Caracterização dos atributos do relacionamento Funcionário - Caso.",
kind: table,
table(
columns: (0.6fr, 0.9fr, 1.5fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr, 0.7fr),
stroke: (thickness: 0.5pt),
align: horizon,
fill: (x, y) => if y == 0 { gray.lighten(50%) },
table.header([*Relacionamento*], [*Atributo*], [*Descrição*], [*Nulo*], [*Composto*], [*Multivalorado*], [*Derivado*],[*Chave Primária*]),
table.cell(
rowspan: 3,
align: horizon,
rotate(-90deg, reflow: true)[
Funcionário - Caso
],
),
/* Atributo */
[Estado],
[Estado atual do suspeito no caso],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Envolvimento],
[Grau de envolvência do suspeito no caso],
[Não],
[Não],
[Não],
[Não],
[Não],
/* Atributo */
[Notas],
[Observações importantes sobre o suspeito],
[Sim],
[Não],
[Não],
[Não],
[Não],
)
)
#underline[*Relacionamento Funcionário - Caso*]\
Nenhum dos atributos do relacionamento Funcionário - Caso (*Estado*, *Envolvimento* e *Notas*) é *composto*, *derivado* ou *multivalorado*. Apenas o atributo *Notas* pode ser *nulo*, uma vez que podem não existir notas associadas ao relacionamento.
]
} |
|
https://github.com/Ttajika/class | https://raw.githubusercontent.com/Ttajika/class/main/math_for_basic_micro/math_for_basic_micro.typ | typst |
#import "slide_template.typ": *
#show: project.with(
title:"基礎ミクロ経済学のための数学",
authors: ("<NAME>",),
emph_color:white.darken(2%),
size:20pt,
//margin:(right:20pt、top:10pt、 left:20pt、 bottom:10pt)
)
#import "@preview/cades:0.3.0": qr-code
#show link: underline
#text(size:10pt)[Powered by Typst (#link("https://typst.app/")[typst.app])]
#slide-heading-outline.update(1)
//これを1にすればヘッドラインに目次(headingのlevelが1のもののみ)を加えられます.
= はじめに
- 大学1年生向けのミクロ経済学に必要な数学を学習します
#columns()[
- 計算が苦手な人は以下のアプリを使ってみましょう
- #link("https://www.wolframalpha.com/")[WolframAlpha]
#qr-code("www.wolframalpha.com/", height:3cm)
- #link("https://vimeo.com/928301937/7323999c71?")[使い方]
#qr-code("vimeo.com/928301937/7323999c71?", height:3cm)
#colbreak()
- 質問があれば以下のLINEオープンチャットで質問できます
#link("https://line.me/ti/g2/g_JP5wrv7AczQ4NLhNyXa4xGsys0f4BTkg4i_w?utm_source=invitation")[数学相談ルーム(LINEオープンチャット)]
#qr-code("https://line.me/ti/g2/g_JP5wrv7AczQ4NLhNyXa4xGsys0f4BTkg4i_w?utm_source=invitation", height:4cm)
]
= 等式変形
等式でできること
- 両辺に同じ数を足しても等式はそのまま
- 例: $x=a$ ならば $x+b=a+b$
- 両辺に同じ数をかけても等式はそのまま
- 例: $x=a$ ならば $b x= b a$
- 割る数が$0$でなければ両辺を同じ数で割ってもよい
- 例: $a x= a b$ であり、$a eq.not 0$ ならば $x=b$
= 等式を解く
- 変数を$x$としたとき、 $x=dots.c (x"を含まない式")$とすることを「*等式を$x$について解く*」と呼ぶ.
- 例:
$ && &b x +1 =3 && #h(1em) \
=>&& &b x +1 +(-1) = 3+(-1) #h(1em) &&"(両辺に"-1"を足す)"\
=>&& &b x = 2 && "(計算する)"\
=>&& & cases(
x = 2/b &"(もし"b eq.not 0 "なら)",
"解なし" &" (もし"b=0"なら)"
)
$
= 式変形
- くくる
- $a x-b x$ と言う式があるとき、$a x-b x =(a-b) x$とできる
- これを*「($x$で)くくる」*という
- 分数の和
- $a/b + c/d$ は分母を揃えて足す。$b、d eq.not 0$であることから $a/b = a/b d/d$、 $c/d=c/d b/b$とし、
$
a/b + c/d= a/b d/d + c/d b/b = (a d)/(b d)+ (b c)/(b d)=(a d + b c)/(b d )
$
と計算する。このように分母を揃えることを*「通分する」*と言う
- 分数分の分数
- $(a)/(c/d)$ のように分数の中に分数が入るとき、 分母分子に同じものをかけて簡単にする
$
a/(c/d)= (a d)/(c/d d)=(a d)/(c)
$
= 関数
- 入力を出力に割り当てるものを*関数*と呼ぶ
- 例: $f(x)=2x+1$
- このときの入力は $x$、 出力は$f(x)$(関数の値とも言う)
- 関数は $f$
- 例:自動販売機
- 入力は押したボタン、出力は出てくる飲み物
- 例: $u(x,y)=x dot y$
- 入力する変数が二つあっても同じ。ここの入力は $x$ と $y$
- 出力は $x dot y$
= 微分
#columns[
- 関数の傾き:
$
(f(x+h)-f(x))/h
$
- $x$ が $h$ だけ増えたとき、$f$ の値が $h$ の何倍増えるか
- #link("https://vimeo.com/804148111")[$h$が小さくなると接線の傾きに近づく_(動画)_]
#qr-code("vimeo.com/804148111", height:3cm)
- 微分する $=$ 接線の傾きを求める作業
#colbreak()
- 傾きを求めると何が良い?
- 増加局面か減少局面かがわかる
- 微分の値がプラス $->$ 少し増やせば $f$ の値は増える.
- 微分の値がマイナス $->$ 少し増やせば $f$ の値は減る.
- $x$ において微分した値を記号で $f'(x)$ と書く
- $x$ がほんの少し($h$だけ)増えると $f$ の値は $f'(x) dot.c h$だけ増える
]
== 微分の公式1
#columns[
- $f(x)=a$ $->$ $f'(x)=0$
#colbreak()
- $f(x)=a x$ $->$ $f'(x)=a$
]
== 微分の公式2
#let tred(body) = math.equation[#set text(fill: maroon); #body]
#let tblue(body) = math.equation[#set text(fill: blue); #body]
#columns[
- $f(x)=x^a$ $->$ $f'(x)=a x^(a-1)$
- なぜかを $f(x)=x^2 = #tblue[x] dot.c #tred[x]$ で考える.
- $#tred[x]$ を変数と思えば傾きは $#tblue[x]$
- $#tred[x]$が $h$ 増えれば、$f$ は $#tblue[x] dot.c h$増える
- $#tblue[x]$ を変数と思えば傾きは $#tred[x]$
- $#tblue[x]$が $h$ 増えれば、$f$ は $#tred[x] dot.c h$増える
- $x$が $h$ 増えれば $#tred[x]$ も $#tblue[x]$ も $h$ 増える
- $x$が $h$ 増えれば $f$は\
$#tblue[x] dot.c h+#tred[x] dot.c h=2x dot.c h$増える
- 微分は $2x$
#colbreak()
#set list(spacing: 4em)
- 例1: $f(x)=x^4$
-
- 例2: $f(x)=x^(1/2)$
-
- 例3: $f(x)=x^(-3)$
-
]
== 微分の公式3
#set list(spacing: 4em)
- $f(x)=a g(x)$ $->$ $f'(x)=a g'(x)$
- 例4: $f(x)=3x^2$
-
- $f(x)=h(x)+g(x)$ $->$ $f'(x)=h'(x)+g'(x)$
- 例5: $f(x)=2x^3+3a$
-
= 最大化問題
- $f(p)$ の $p$ に関する*最大化解*とは
- どんな $p$ に対しても $f(p^*)>= f(p)$ が成立するような $p^*$ のこと
- $f(p^*)$ を*最大値*と呼ぶ
- *最大化解であるための必要条件(一階の条件)*
- $f'(p^*)=0$
- なぜ?
- $f'(p^*)>0$ なら $p^*$ から少し $p$ を増やせば $f(p)$ の値が大きくなる
- $f'(p^*)<0$ なら $p^*$ から少し $p$ を減らせば $f(p)$ の値が大きくなる
- どっちのケースでも $f(p^*)$ は最大値になってない
== 最大化解を求める手順
- この方法は最大値があり、微分がいつでもでき、入力する値に制限がないことが前提
+ $f'(p)=0$ となる $p$ を探す
+ それらの $p$ のなかで、 $f(p)$ の値が一番大きいものが最大化解.
- 例:$f(p)=-p^2+2p$
= 偏微分
- *偏微分*は、関数に複数変数があるときに、ある一つの変数について微分することです
- 微分とやることは同じ
#let pd(num,denom) = $(diff num)/(diff denom)$
- 例1: $f(x,y)=x^2+y^3$のとき
- 関数 $f$ を $x$ で偏微分することを $pd(,x) f(x,y)$と書く
- 上の例では $pd(,x)f(x,y)=2 x$
- $y$ は $x$ とは関係ない文字なので、定数として扱う
== 偏微分続き
- 例2: $f(x,y)=x^2 y^4$のとき
- 関数 $f$ を $y$ で偏微分することを $pd(,y)f(x,y)$ と書く
- 上の例では $pd(,y)f(x,y)=4x^2 y^3 $
- $x^2 $ は $y$ に関係のない文字なので、$y$で偏微分するときは定数扱い |
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/035%20-%20Core%202019/010_Unbowed%2C%20Part%202.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Unbowed, Part 2",
set_name: "Core 2019",
story_date: datetime(day: 05, month: 09, year: 2018),
author: "<NAME>",
doc
)
Vivien awoke to the taste of tin in her mouth. Paste-like, it coated the insides of her cheeks and the underside of her tongue. She felt a path along her teeth, found a gap where two should have resided and the ruined stub of a third. Vivien winced. It was too bright, and the air was not hot but warm, like the gullet of a freshly butchered cow, unctuous and humid and cleanly animal.
Fingers twined in her hair tugged her head back.
"I thought you'd die in your sleep." The baron's voice, cloying, his silhouette coming into view, velvet and candle-white skin. "That would have been terribly inconvenient."
"What have—" Vivien spat blood. The words came together with effort, syllables clotting like fat, chunkier and chalkier than she'd recalled such things to be, a coppery flavor permeating her throat. "What have you done?"
"Apprehended you, it appears." Slowly, definition returned. Her vision penciled in details: the deep hollows of the baron's sockets, the pinch of his nose, so stubby in a face otherwise meant for lupine angles. "We took your bow."
She lunged before she could even fit two thoughts together, before she'd even had time to take inventory of her condition, the manacled wrists, the way her body ached from being suspended, the nervelessness of her feet and the manner in which the ropes sawed into her ankles. The hand rooted in her hair gave another yank, sharp, more vicious than the last, and Vivien howled objection.
"Quite an interesting device." The baron slid his hands into overly wide sleeves. Even his smallest mannerisms were affectations, no more authentic than the smile, the paraffin quality of his skin. Vivien twisted in her confinement, hissing. "How have you kept it from killing you? We tried so many things. We had a bear emerge once. But it survived for seconds. Just long enough to kill more of my men."
He paced circles around her, head angled just so, pausing on the third rotation to clutch her jaw, fingers turning like keys at the point where the mandibles met, coercing her mouth open. The baron stared down her throat like she was a prize horse.
"What #emph[are] you?"
Vivien glared.
"Not a nature spirit, surely. Not a god. You appear human." His voice quieted. "I wonder if you are a Planeswalker. We have some of those here. But if you are one, mademoiselle, you're unusually sloppy. No protective spells, no direction but forward. A sledgehammer without a master."
He let go.
"If you'd like to threaten me, I believe we've reached a natural pause. This is where most of these exchanges take place. At the cost of sounding presumptuous, I hope you won't take your time. I've so many questions."
The room—#emph[cell] , Vivien corrected herself, noting the absence of windows and the lack of ambient noises—was white, low-ceilinged, seamless. A single entryway and nothing else. Enough of her faculties had returned to allow for intelligent observation, some measure of analysis, and the conclusion she derived from both was discouraging. They'd been paying attention. "Give it back."
"What?"
Vivien licked her dry mouth, a gesture that did nothing. "Return the Arkbow."
"No." His breath puffed against her cheek. The other man strode into view. He wore blacksmith gloves and the accoutrements of an executioner, was barrel-chested yet crane-legged, and he slouched like a dying tree: a caricature, hilariously proportioned, but no less dangerous for the matter. "No. I will not. Now, tell me: what are you?"
Vivien glared.
"Is this the game that we shall play? Fine. #emph[Don'] #emph[t] tell me what you are. Tell me about the Arkbow. How does it work? We've already managed to call up the bear. But the serpent? Have we spoken about the serpent? It died. It dissipated within seconds of its conjuration, stillborn and poorly made." Behind him, the other man attended to a train of tools, silver laid out atop burgundy velvet, a threat implied in his meticulousness.
Vivien shuddered. The devouring wurm had been another early memory, a juvenile triumph, and although the Planeswalker had no attachment to that particular specimen she'd had quivered, it reminded her of better days. "Skalla."
"You said that word before. I remember now. 'The dead of Skalla.'" The baron's visage came alive with an academic's careful sense of wonder. "Is that what you are? Ghosts enslaving ghosts? An entire history of them."
"Return the Arkbow."
He barked an unpleasant laugh. "No. Never."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The Baron of Vernot returned twice and then twice again after that, each time with questions about the pedigree of the Arkbow's inhabitants and Skalla's storied history, each time more incensed than before. The artifact proved foully disposed toward its captors: the Arkbow had discombobulated several of the baron's assistants, reducing them to their constituent particles, a wet layer of black soaking deep into the tiles.
"How does it work?"
Vivien held her silence. The baron was uncommonly clever. Torture as Vivien understood it was a mathematics of knives and precise cuts, but such primitive behavior was only the beginning for the baron. He had additional, more sophisticated means of tormenting her, ways to hurt that inflicted no physical scars.
#figure(image("010_Unbowed, Part 2/04.jpg", width: 100%), caption: [Bishop of Binding | Art by: <NAME>], supplement: none, numbering: none)
"#emph[How does it work] ?"
Each time he asked his questions, the baron's magic reached out, found the blood coursing through Vivien's body, and brought it to boil. Slowly. But the Planeswalker only laughed at the burning in her veins. <NAME> had done worse already. No matter how the baron chased her with magic and forceps and scalpel, no matter what he did, he couldn't find traction, couldn't find a place that <NAME> hadn't already scarred with the death of Skalla.
Vivien spat curses at the baron and guffawed at his rage.
He kept healers at his side throughout Vivien's ordeal: nuns in nacreous robes, their mouths sewn with gold thread, who guided Vivien back to sanity together with sutra and sorcery each time the baron was done, their humming incantations like cricket song. Whenever the baron tired, whenever he grew bored, they came together to wash her, feed her rounds of stale bread, sips of vegetable broth, rainwater so cold and pure that it burned her tongue.
Time became measured by these events, hours and minutes replaced by the creaks of doors, the hiss of fabric dragging along the floor, the scrape of a knife on velvet.
"How does it work?"
Vivien regarded the baron through an eye, the other bruised shut. "Return the Arkbow, or I will see you die. #emph[Screaming] ."
There was no subsequent visit. The nuns, however, came one last time. Except on this occasion, they arrived with chemise and petticoat, partlet and robe, all tucked into long, gleaming walnut boxes filled with potpourri. Dried hyacinths were woven into Vivien's hair as they washed her, stripping away the clothing that had crusted on her flesh, the fabric so stiff that there were handfuls that had to be sawed away.
The nuns performed the ablutions without comment or censure, fingers cool along the muscled turn of her thighs, the tendons of her neck, the latter too tense, too gentle even with repeated applications of boiling, lilac-scented water. Vivien twitched under the nuns' care. When they'd finally concluded, the nuns then dressed Vivien in a modest ensemble the color of a mourning dove's wing. The Planeswalker caught a glimpse of herself and grimaced. Her new apparel made her look smaller, meeker, her silhouette diffused by the soft, shapeless cloth. She resembled a penitent come to beg succor from the church.
Vivien hated it.
But she said nothing, silent as the nuns laced her wrists with filigree chains, their expressions slack and serene. #emph[Drugged] , Vivien thought at first. However, the nuns' gazes, for all their absent personality, were sharp. Automatons, Vivien decided, as they led her down through corridors that ran warren-like under a firmament of dirt, no trace of Luneau's opulence to be seen. The stink of brine curdled into a texture.
Vivien ran a look over her surroundings. There were rats everywhere, and maggots in thumb-thick clumps, moles and earthworms, but nothing that she could use; the rats would just as soon devour her as they would the rest of Luneau. The maggots would take no interest nor would the earthworms, and the moles might accidentally collapse the roof. Discouraged, Vivien did nothing, permitting the nuns to lead her onward.
#figure(image("010_Unbowed, Part 2/05.jpg", width: 100%), caption: [Profane Procession | Art by: <NAME>], supplement: none, numbering: none)
Another corner, another turn. Earth became palatial marble, rose-gold and draped with red silk. The passageway crested upward, became enveloped by candlelight. Vivien gagged at the sudden stink of potpourri: attars of rose, jasmine, primrose, and ylang-ylang. The procession halted in front of rosewood doors, a broad-shouldered brute on each side. Both men had been stuffed into waistcoats and ruffled shirts, the trims too long, the sleeves too tight, cravats awkwardly knotted beneath their Adam's apples. Luneau could slather all the polish it wanted, but these men remained unmistakably criminal, shanty-side thugs to their bare-knuckled cores. As one, they bowed their heads to the nuns, an affected motion poorly executed by bodies more accustomed to violence.
Neither the nuns nor Vivien provided comment. The men opened the doors and the Planeswalker was walked inside. To her surprise, it wasn't another cell, or at least, not one that conformed to the traditional aesthetics of a prison. Vivien had toured chapels with less lavish embellishments, city halls more decorous in design. The room was sumptuous, even tawdry. A queen's dowry in mirrored surfaces and expensive wood, the flooring onyx and curlicues of gold.
Inside, there was a single round table, a chamber pot, a meagre cot, a chair carved to resemble a gryphon. Atop the table sat a bowl of fruit so vibrantly colored that it seemed unreal and a tankard of piquant wine.
The door closed behind Vivien.
She was trapped, again.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
As before, Vivien soon found herself unable to measure the passing of time. Her torture and its correction had at least provided some structure to her day. Now, there was nothing, not even the sound of the world outside, nothing but her own endless pacing, the crunch of her teeth through the meat of the fruits, juices splattering on the tiles. Vivien could almost discern her own heartbeat in that endless, empty quiet.
She counted the length and breadth of the room twice, then twice again, first measuring it with her stride and then with the precise length of her feet. Magic kept the room immaculate, the fruit bowl filled. Vivien experimented. She fed apple cores and peach pits to the chamber pot; the enchantment took them away, but not the shoe she fitted into its mouth, or soft tangles of Vivien's hair.
The Planeswalker continued to pace.
This was worse than the torture, worse even than spectacle at the coliseum, worse than anything but the sight of <NAME> rising into that burning sky, laughing as Skalla winked to white. Here, Vivien could do nothing but revisit the moment over and again. Not even sleep could divert from her recollections. When Vivien slumbered, she dreamed Skalla.
Eventually, the door opened again, some point between the first instance of captivity and a point in time, the Planeswalker nearly fell over herself in gratitude, elated for the distraction. A man stood at the exit: it was one of her guards, tugging nervously at his collar, his face pink and greasy with sweat.
"The baron wants to see ya." Unlike everyone else she'd met, his accent was provincial, sloppy and rounded. The man swallowed. "'E says he's got something important to ask you."
"Tell him to return the Arkbow."
The man shrugged. "I would, but I ain't anyone who can do nothin'. The baron says you can either come along or you can stay here."
Death, at that moment, appealed more than the continued ennui. Vivien gritted her teeth against the truth of this. The Baron of Vernot had to know, had to have predicted this aversion to the stillness. Capitulation felt too much like a personal betrayal, but Vivien was done with this place. She'd take her chances, and the baron could have her pride as payment.
"Fine."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"<NAME>, welcome."
She blinked against the glare. They had emerged into a ballroom: vaulted ceilings and murals inlaid into the walls, gold and pearl and shades of rich plum where it wasn't windows that stretched from roof to polished flooring. Outside, Vivien could see the ocean, its waters crested with silver.
The Baron of Vernot stood in surgical equipment in front of the monstrosaur from the show days before, mask over his narrow face. King Lucard sat in half-hearted attendance, ringed by courtiers, ministers who separated their time between affairs of the state and avid scrutiny of the baron's activities, the latter of which was performed through dark viewing glasses. He was, Vivien realized with a dazed start, not performing an autopsy, but a vivisection. The monstrosaur#emph[ lived] .
But only barely. Mirrors across the room, cannily positioned so that the baron's audience could see from every angle, offered every view of the procedure. Bellows and pulleys, complex machinery of varying sizes, twitched and throbbed. Each time they moved, the monstrosaur bellowed in pain. The nuns who had attended to Vivien, their robes now grubby with dark fluids, ringed the baron's subject. Whenever something ruptured, they rushed to repair the damage, their magic a lamina of shimmering gold. The baron's audience watched the procedure dispassionately, occasionally breaking into polite applause. The vivisection was entirely peripheral to their evening, a conversation piece, a distraction, and one that was less important than the woman who'd strode into their midst.
#figure(image("010_Unbowed, Part 2/06.jpg", width: 100%), caption: [Axis of Mortality | Art by: <NAME>], supplement: none, numbering: none)
The baron wiped his hands on a cloth held up by a gamine and tugged his mask low, smiling like the sight of Vivien was as welcomed as an unexpected bag of gold. Like they were old friends, raised in the same courts, bequeathed the same ambitions. Allies, as opposed to torturer and victim. Quiet rippled through the ballroom, absolute. They didn't need to breathe, Vivien thought distractedly, her adversary stalking closer, the baron trailed by a woman with a silver cart.
"The Queen of Ghosts. I must be honest. I have missed your company, but research will have its way with us scientists. How are you? How have you been?" The baron looked over his shoulder and nodded to his companion, who responded in kind. His smile remained effulgent. "You certainly look better than you had before. Did you enjoy the fruit?"
"The Arkbow." There were too many of them for Vivien to act. Too many bows, too many swords, too many opportunities for it to go wrong. But that onto itself wasn't the problem. The issue was what lay in the middle of the ballroom, dying in degrees, breath spuming through its teeth. Though great lengths had been taken to keep the creature alive, no one had taken time to repair its leg. And why would they? Vivien thought bitterly. Better to keep it like this, hobbled, helpless, unable to do anything more than shudder through its torment.
"That word you kept mentioning. Skalla. It is your home plane, is it not?" The baron continued glibly, expression sated.
A beat.
"Was," he corrected himself, venom in his enunciation. "Was your home plane. I apologize. I can be inconsiderate. One must never confuse their tenses, especially when it comes to the dead. Skalla was your home plane, was it not? Before it was razed to ashes, at least."
Vivien said nothing.
"And you are the last living relic of the plane. A ghost." The baron nodded again toward his companion, a more succinct motion. It was, as it turned out, a signal. The woman pushed her cart forward and pulled back its draping of ivory fabric with a flourish. There was the Arkbow, its body spackled with black gore but otherwise almost innocuous-looking beside Vivien's emptied quiver. "I have always had a gift of understanding things that will not surrender their secrets easily. But even I was surprised by how accurate I was. You are a ghost, <NAME>. A ghost who carries her dead on her back."
Still, Vivien said nothing. Blood cataracted the dinosaur's eye, rolled halfway now to the whites, the fluid thickest along the circumference of the iris. It panted in shallow gasps. From where she stood, Vivien could see the bruising in its lungs, a bloom of black along the pale, pinkish organs.
"But the time for secrecy is over. Skalla is nothing but cinders and corpses. You have an option, however. Teach me how to make use of the weapon and we will garland you with glories, ensure that you are never with an unfulfilled desire. We will make a proper queen of you, and Skalla will live again in these halls."
Vivien exhaled.
"Fine. But I need the Arkbow."
The baron arched his brows. "And what promises do I have that you will not use it to escape?"
"You have none." Vivien shrugged, trying and failing to take her eyes from the dying reptile behind the baron, her face contorting into a grimace. "But obviously, you have the upper hand. I'm here, am I not?"
Silence rewarded her statement.
"The Arkbow has a~unique mechanism." Vivien was raised for the hunt, and she knew, the way she knew the migrations of the birds and the habits of the arctic fox, when she has drawn the attention of her quarry. The baron, for all his poise, his measured expressions, his overtures toward indifference, was piqued by Vivien's declaration. "At the moment of a creature's death, it draws an image of the dying into itself, preserving the being in its fibers forever."
#figure(image("010_Unbowed, Part 2/07.jpg", width: 100%), caption: [Skalla Wolf | Art by: <NAME>], supplement: none, numbering: none)
The baron turned midway through Vivien's exposition, already gesturing at his armada of assistants. "That sounds simple enough to do."
"Only if you're me."
The baron paused.
"Pardon?"
"You can try all you want, but it won't work unless I'm performing the ritual."
"Oh?" The baron slanted an impatient look in his direction, hands coming together behind his spine. He pivoted on a heel, a slow motion, deliberate in its grace, and began stalking toward Vivien. "Is that so? An interesting boast to make."
Vivien shrugged, a loose clatter of her shoulders. "The Arkbow is mine. It was made for use by the shamans of Skalla. More specifically, it was made for me, and intended for my hand. You can try all you want, but you will do nothing but suffer for your impudence."
#figure(image("010_Unbowed, Part 2/08.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
It wasn't a lie. Not really. A truth, perhaps, wound through the charred bones of everything that Vivien had loved, and so what if she wouldn't unravel its nuances for the baron, wouldn't cut the truth apart and set it down on his table? At this juncture in history, it may as well have been made for Vivien. Of all the people who could have laid claim to the artifact, she was the only one left.
"And what if I don't believe you? What if I decide to endeavor this myself?"
"Then, your people will keep dying." Vivien licked her chapped mouth, tongue gliding over her teeth. "You know I'm right, #emph[Baron] . You've seen the wages of your obstinance. Are you willing to risk more of that, Baron? How many more weeks will it be before they bring you another specimen? How many opportunities for escape will you give me?"
The hush twitched with laughter. Vivien flicked her eyes up and watched as the baron's expression transformed, his unflappable veneer giving way—just for the sliver of a moment, a gasp of time so infinitesimally short that she'd not have seen it if she weren't looking—to something like rage. He spackled that crack in his defenses with a near immediate smile, but it was enough for Vivien to know she'd drawn blood.
Her own smile grew. "We are both prisoners of the situation, Baron. I have very few choices, and so do you."
The baron worked a disgusted noise through his throat. He raked a cold look down from the roof of Vivien's skull to her slippered feet, the Planeswalker's own regard filled with quiet, waiting challenge. She had him in her sights. The baron knew this, and so did Vivien. She tipped her head toward his ear. Vivien had five inches of height on the nobleman and almost as many across the shoulders. Behind them, the monstrosaur moaned again, death running soothing hands over a body that should have been given to the grave a lifetime ago.
"Do you know what you learn from watching your plane die, Baron?" Vivien pitched her voice low. "From seeing everything you know and love go up in flames? From the permanence of such a knowledge? Are you aware of what it does to a person?"
This time, it was the baron who said nothing, cheeks indented as he chewed on their meat. Vivien wondered if their audience was listening. She knew the rumors, the varied gossip about what talents vampirism might provide, and "enhanced senses" was a phrase that repeated itself in every story. The silence in the ballroom certainly contributed to the veracity of those folk tales. It was a knowing silence, smug, indulgent, cut from the same diamantine material as the jewelry that ringed <NAME>'s throat, nearly feline in its demonstration of those qualities.
Vivien hoped she was right. Luneau seemed to delight in its dramaturgy, regardless of who might be skewered at the denouement; anything went so long as the proceeding show impressed. And Vivien plotted to use that greed. Her smile spread further.
"It tells you that there are things worse than death, worse than torture, worse than any one horror that man might visit on another. You do not scare me." The Planeswalker strutted her fingers up his sternum, tapped the baron's nose to spectacular effect: the silence flexed and then gave way to a roar of laughter. "But I think I scare you."
"I think you may be making too many presumptions for your health, mademoiselle." The baron growled through gritted teeth.
"No." Vivien flicked her gaze to <NAME>, who'd long since abandoned his conversations and sat now, with a look of avaricious interest. Upon eye contact, he crooked two fingers at one of his ladies-in-waiting. She nodded and circled around the clump of courtiers, moving toward a trolley festooned with crystal decanters and graceful wine glasses. The woman poured a generous serving of something honeyed and nearly black, the light nearly iridescent through the prism of the alcohol, began moving back toward Vivien, who allowed herself then a low, rich chuckle.
"I really don't think so."
#figure(image("010_Unbowed, Part 2/09.jpg", width: 100%), caption: [Hierophant's Chalice | Art by: <NAME>], supplement: none, numbering: none)
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/cancel_06.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Specifying cancel line angle with a function
$x + cancel(y, angle: #{angle => angle + 90deg}) - cancel(z, angle: #(angle => angle + 135deg))$
$ e + cancel((j + e)/(f + e)) - cancel((j + e)/(f + e), angle: #(angle => angle + 30deg)) $
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/051%20-%20March%20of%20the%20Machine/008_Ixalan%3A%20Three%20Hundred%20Steps%20under%20the%20Sun.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Ixalan: Three Hundred Steps under the Sun",
set_name: "March of the Machine",
story_date: datetime(day: 21, month: 04, year: 2023),
author: "<NAME>",
doc
)
#strong[Now]
The jungles around Orazca burned, a ring of fire so hot that the golden borders of the city bubbled and melted, sinking into their foundations, flowing into the scorched earth. Darkness lit ruby by the titanic, sinuous mechanical vines that plunged down from somewhere above the acrid clouds. Crimson lightning scratched across the sky, chased seconds later by booming thunder. The canopy swayed and shook, trembling in the hot wind. Trees, rotted from the inside out, exploded when the flames reached them.
Huatli, alone, stood atop the Winged Temple of Orazca, her hands pressed to her chest, heaving for breath, waiting. An awful, agonizing waiting, bile and choke rising in her throat. Waiting.
Inti—was he alive? Did her company and the auxiliaries hold the steps? She could not look down, she could only keep her eyes on the horizon, waiting. It was impossible to hear anything but her own heartbeat, her own breath, and the roar of the fire.
All around her, at every point of the compass, darkness hung heavy over the plane. The only light was the fire. The jungles around Orazca burned.
Ixalan burned.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#strong[Hours Before]
The doors were sturdy, built millennia ago to defend this most sacred inner sanctum. Barricaded, they would not break.
Coughing. Muttering soldiers. Prayer. The rank smell of sweat, waste, burnt wood, burnt flesh, burnt metal. The air hurt to breathe. Someone found and struck a torch while others fumbled with their lights, whispering the necessary prayers for Kinjalli to spark them to life.
Light flooded the dark hall, revealing a long, columnar chamber carved in murals. Gold embellished every surface, burnished and shining. Nearly a hundred soldiers—the majority Sun Empire along with a handful of auxiliaries from the Corsair Coast, Torrezon, and archipelagos between—crowded the space. Exhausted, they attended to pressing duties—replacing battle-worn weapons, stripping off useless armor, wiping themselves clean of soot, blood, and oil. A priest anointed a rank of silent, greying soldiers, bidding them to return to Ixalli's embrace. Grim-faced warriors followed the priest, macahuitls ready in case any of the dying turned.
Drying blood stained Huatli's hands and she couldn't stop them from trembling. She needed water. She needed to be clean. She had a canteen. She reached for it, found it empty.
A commotion. Shouting from the barricaded door. A roar outside, loud as a volcanic eruption, and then a boom that shook the hall. Dust and plaster chips fell from the ceiling, pinging off Huatli's armor like hailstones. All around her soldiers laughed, cursed, and muttered.
"We should go," Inti said. He crouched at Huatli's side, streaked in soot, head bandaged and bloody. "I'm not confident the barricade or this hall will hold. And you dropped this." He pressed Huatli's helm into her hands. The helm of the warrior-poet. The only one in all Ixalan.
"Where's yours?" Huatli asked, indicating her cousin's bandage-wrapped head.
"In the gullet of some dead invader," Inti shrugged. "It did its job." He offered Huatli a hand. "Come on."
Huatli reached up, took Inti's hand, and stood.
"We'll surely get through this," Inti said. "You'll speak this story to the empire when the sun rises."
Huatli looked at her cousin. His grin was broad and warm, genuine despite the weight of fatigue around his eyes, across his shoulders. He trusted her, and so everything was going to be fine. She reached out and touched his bandage.
"Find a helmet," she said. "I think you got hit in the head too hard."
Inti laughed, and Huatli joined him.
Behind them the hall shook, the door jumping on its great hinges as something huge slammed into it.
"How long until dawn?" Inti asked, looking back at the door.
"Hours," Huatli said. "If it comes today."
"Let us hope."
"Fine," Huatli nodded. "But also fight."
"Warrior-poet," an elegant voice, roughened by smoke. <NAME>, the thin, patrician leader of the auxiliaries, stepped out of the darkness, flanked by a handful of his Legion paladins. He squinted against the harsh light of the Sun Empire soldiers' Kinjalli stones. Huatli could see his skin steaming where the light hit him; the stones cast a scouring kind of light, harder than day. She held up a hand to block hers.
"Thank you," Mavren said, brushing burnt, paper dry skin from his sharp cheekbones.
"Well?"
"What now?"
Huatli shrugged.
"My favorite type of poet," Mavren said. "One who lets silence speak."
Huatli reached toward him with her short spear. "Careful, colonizer," she said. "I can think of more profound silences yet."
"Fine," Mavren said. "Let me try again, begging your apology." He reached out, slowly. Huatli did not waver. The vampire raised an eyebrow, looked to the point, then to his hand, then pushed the spearpoint aside. He cleared his throat. "What do we do now?"
"Now—nothing," Huatli said.
"Nothing?"
Huatli nodded. "The Phyrexians know we are here. More will come to encircle us. We will let them."
"Trapping us here was part of your plan?"
"When hunting a great beast," Huatli said. "Bait is necessary." She lowered her spear.
"Bait," Mavren sniffed. "Ensure the trap does not close on us as well, warrior-poet."
Huatli let him leave with the last word. The last of her soldiers filed past, keeping a wary eye on the backs of Mavren and his vampires. The light went with them, fading until Huatli uncovered her bauble. Kinjalli's warm light swelled but never bloomed beyond a small pool. She was alone with her breath.
The door boomed, rocked. The ancient hinges creaked. A barrel tumbled from the barricade, cracking open when it hit the ground. Spoiled maize spilled out, wriggling with dark shapes.
"Hold," Huatli whispered, a prayer in a single word.
She turned and hustled from the door, hurrying to catch the rest of her force, a little ember of light in a great and total darkness.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#strong[Days Before ]
The invasion came to Ixalan presaged by subtle warnings ignored by the great powers contesting the old continent. War already raged; subtlety was among the first casualties. The Sun Empire had pushed the Legion of Dusk out of the golden city of Orazca. Emboldened, imperial forces chased the routed Legion expeditionary forces back to the Sun Coast. There, at Queen's Bay, the empire encountered a constellation of squat, imposing fortresses. Two crouched on the mainland and a third loomed on a barrier island at the mouth of the bay. This was Miraldanor: the Legion had carved up the Sun Empire's land and named it after their queen. This could not stand. The emperor ordered these fortresses razed.
Thousands of brave soldiers assaulted the dark stone walls of Fortress Leor, the middle of the three fortresses. The defenders held months—the Sun Empire had little experience in siege warfare—but fell before the end of the year. The empire moved in, taking Leor and splitting the Legion forces of Queen's Bay in half. A triumphant victory for the empire, but the real prize was anchored in Leor's harbor: ships, blue-water frigates that the defenders could not burn completely. The Sun Empire, firmly entrenched and with the Legion's remaining forts surrounded, reverse-engineered the vessels. The emperor, to the adulation of his subjects in Pachatupa, declared a new objective: they would build their own great ships, cross the ocean, and return to the Legion the fear that those austere knights had brought to Ixalan.
A great work began. Mighty forests fell as new shipwrights hurried to fulfill the emperor's demands. The Sun Empire youth took to the rivers, lakes, and coasts of Ixalan to learn the ways of the tides, the winds, and the stars. Hardened veterans of the empire's consolidation campaigns and the expeditions to Orazca returned to their cities to recruit more to their ranks. Quetzacama handlers and breakers set into the jungles, breeding territories, and reserves to find suitable cavalry mounts. The empire hummed with energy and excitement—conquest, war for glory, was coming.
Even then, the invasion was already underway.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Somewhere in lands unknown, or in the great gyres that twist over vast tracts of empty ocean, the invasion signs manifested. Odd symbols glimpsed in momentary alignments by sailors and lonely peasants too frightened to understand what they saw: a boiling lake, an acre of dead fish arranged in a perfect circle and bisected by a straight line, a tree weeping black oil, a red cloud, lingering in defiance of the wind.
Ixalan churned, and Torrezon rumbled, and the archipelagos around High and Dry fell silent, and no one looked up to see the sky split open one humid morning off the Sun Coast, revealing a hideous, colossal metal branch of Realmbreaker, the Invasion Tree, plunging down from a hurricane eye red as a wound.
The Phyrexians came to Ixalan and ended the emperor's war in its cradle. In its place was a greater terror: the Threefold Sun set and did not rise again, obscured by clouds as dark as ink, and hope's darkest hour fell, throttled on the sands of Ixalan's once golden shore.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Huatli stood at attention in the imperial throne room high atop Tocatli, the imperial citadel at the heart of Pachatupa, the capital city of the Sun Empire. The throne room had been converted to the imperial war room. A scale map of Ixalan, Torrezon, and the sea separating the two continents dominated the chamber, awe-inspiring in size and detail. Aides and officers orbited the table, nudging small model soldiers and quetzacama, moving and removing the finely crafted models as sweat-slick runners arrived to relay news of the war.
A ring of white stones surrounded Pachatupa, unmoving save for the occasional adjustment forward. The Phyrexians.
Huatli rolled her shoulders. She had been on the front for days; her body felt deployment's cost. She needed rest, not to stand at attention in dress uniform while the emperor gathered formal reports from his generals. Even now the imperial vanity demanded satisfaction.
Huatli looked around the room of generals, priests, and command staff. Most were old men and women, stuffed into armor tailored to fit their younger selves; the imperial vanity suffered, she thought. A handful of the assembly were her contemporaries—soldiers promoted for heroic deeds accomplished during the Orazca campaign, or officers who proved themselves against the Legion during the jungle warfare that followed—enough to make the assembly not feel totally hopeless. Together, they awaited the emperor's return from the observation platform, where he paced, trailed by attaches and scribes.
Hope was precious now, and cruel. Its absence was not a void but a dagger. Sun above, Huatli wanted to sleep. She missed Saheeli like she missed the daylight. Huatli closed her eyes, trusting her legs to keep her standing.
Outside, the sky was dark. By the priests' reckoning it was midday, but the light was hidden behind ink-black clouds. The sun had disappeared in the early days of the invasion, first choked to a feeble red orb by wildfires burning at every point of the compass, now all but quenched to a dim blush. Not only fire smoke, but some other foul emission belched from the invaders. Ash fell. A regiment's worth of palace attendants scurried across Tocatli, brooms in hand to sweep away the grey drifts, but their efforts were not enough. The imperial citadel took on the appearance a mountain in winter; the sun's light gone, the air took on a deep, uncanny chill.
"Where is my navy," Emperor <NAME>li III bellowed as he strode back into the war room. "There are nearly ten thousand soldiers and sailors aboard those ships, find them!" He waved a hand, dispatching a squadron of scribes and junior officers to the task. Good for them, Huatli thought—they would never find the fleet, and now had an excuse to flee to the far corners of the plane.
"Ten thousand soldiers, hundreds of ships," the emperor muttered, striding to the table. "Torrezon was right there," he said, slapping the facsimile continent's shores to emphasize his utterance. A collection of miniature ships, carved by expert toymakers in Pachatupa below, sat at the midway point between the two continents—the last known location of the invasion fleet. To Huatli the invasion of Torrezon had always been a bad idea; under the pressing threat of the Phyrexians ringing the walls of Pachatupa, mourning the interruption of one invasion in the face of another did not inspire confidence.
"Your grace," one of the commanders—Caparocti Sun—something, Huatli could not remember his last name—spoke up, clearing his throat. "My aerosaur fliers stand ready to scour the oceans, but the weather over the straight—"
"Kinjalli #emph[scour] the weather," the emperor shouted. "Why do your fliers #emph[stand] , Caparocti Sunborn, when they should be #emph[flying] ?"
"There are severe hurricanes, your grace, just off the coast," Caparocti said, keeping his voice calm. The first siege of Leor, that's where Huatli remembered Caparocti from. An emperor shouting at him would not rattle Caparocti after the bitter fighting they endured under those grey walls. "These storms are wild and unnatural. My fliers tell me that the skies flash with red lightning, and the wind sparkles with razors. It is not a question of will—they want to soar, your grace. It is a question of prudence."
"You doubt?"
"I do not doubt," Caparocti said. "I wish to defend the empire against losing more soldiers before meeting the enemy."
The emperor stared at Caparocti, then through him, his jaw flexing as he ground his molars. Huatli knew Caparocti to be correct. She waited to see if the emperor agreed.
"Ten thousand," the emperor whispered. Fury had left him. He walked around the table, his commanders and high priests parting, until he could reach the finely carved miniature ships. His Dawn Fleet, meant to bring the light of the Threefold Sun to Torrezon's dark corners and gothic castles. The emperor's frown deepened.
"The rest of you, report."
One by one the commanders and priests rattled off their reports, relaying grim butchers' bills likely already out of date even though they were a day old at most. A dozen towns along the northern barrier reported empty but for writhing masses of fused flesh and metal. A column of deathspitters and their handlers massacred, with only a single squad of survivors left to make it to Pachatupa. A western redoubt reduced to ash and lakes of oil, an iron rose pulsing at its center. Swarms of machine insects buzzing through the jungles. A dozen dead, a hundred dead, a thousand dead, imperial soldiers and civilians alike melded to metal armatures and lashing cables, marching before pale horrors like puppets on strings.
#figure(image("008_Ixalan: Three Hundred Steps under the Sun/01.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
This was not a war: it was a collapse, seeking its end point. The Phyrexian forces, a mix of alien invaders bolstered by a seething mass of forcibly converted fodder, formed a ring of fire and metal surrounding Pachatupa, closing tighter by the hour. Even with aerosaur flights and swift raptors ranging ahead of the advancing enemy, the delay between event and report was so great that the empire could not respond in force. Individual soldiers in the field were leading this war, while the emperor begged his commanders and generals for guidance they could not give. The great strength of the Sun Empire was its size, its logistics: it was a brontodon that ground its enemies down with well-organized, steady, overwhelming numbers. But a brontodon could not fight a swarm of hungry, furious anhafish. On the back foot, with no line to hold and their logistics in disarray, retreat was the only rational choice.
"And your report, Huatli?" The emperor asked. He plucked model ships one by one from the table, letting them fall and shatter on the polished stone floor. He did not respond to the harsh crack of stone on stone.
"My lancers remain at company strength," Huatli said. "We stand ready to break these invaders, as Tilonalli does the advance of night."
"My poet," the emperor said, a wan smile bringing out the wrinkles around his eyes. He dropped another ship on the ground. "Do you have words for the dead, warrior-poet?"
"There are many, your grace," Huatli said. "Too many to speak."
"And your powers," the emperor said. "Your planeswalking, your magic. Can you beseech the Threefold Sun to intervene in our hour of need?"
"No," Huatli said. "But there are others who could help."
The emperor plucked another ship from the map, the final model not yet broken. He held it in both hands. "Explain," he commanded.
Huatli stepped from the rank of commanders and walked to the edge of the emperor's table. She bowed to him, then gestured to the map.
The emperor nodded.
Huatli picked up a statuette, carved in the shape of a warrior, one of the many clustered atop Pachatupa. She walked a counterclockwise arc around the table, stepping around the fragments of the model ships the emperor had shattered on the floor.
"Pachatupa is surrounded," Huatli said, gesturing to the ring of white stones around the model city. "We have water. Weapons. Soldiers. The capital is a curled fist, but it is alone. Without steady supply from the empire, Pachatupa will starve. We need to break this siege or draw enough of the Phyrexians away so we can reopen those supply lines."
"Otepec and Atzocan are cinders," Inti said, his voice a low rumble. "Little Pocatli as well."
"Yes," Huatli said. "But here—Itlimoc state, Quetzatl state. No cities, just land. Small towns."
"That's true," Caparocti said. He shrugged. "We have had no reports of Phyrexians there."
"Farms," the emperor muttered. "Maize, squash, and beans. Few people live there, and most came here seeking safety behind my walls. There's nothing there but food."
"Astute, your grace," Huatli nodded. "The people there fled and the Phyrexians followed them here. The invaders don't want life—they want power." Huatli plucked a figurine of a dinosaur from a shelf under the table, where models of the dead were stored. She placed it on Orazca.
"By Kinjalli," Inti smiled, a broad grin breaking out across his face as he understood.
"I will call the elder dinosaurs to Orazca," Huatli declared. "This will draw the main body of the Phyrexians away from Pachatupa. We know they seek great power, so I'll show them great power. They'll flock to it like flies to droppings, which should lessen their numbers here, allowing you to break Pachatupa's encirclement."
A murmur of surprise and approval from the assembled generals ringed the chamber.
"This is a gambit, warrior-poet," Caparocti said. "What if the Phyrexians await us at Orazca? What if the elders do not come when you summon them?" Caparocti swept a hand to the other generals and commanders. "We cannot spare our soldiers and risk Pachatupa falling."
The generals murmured again, their approval twisting to concern.
"I would need only a small force," Huatli said. "My company of lancers. Volunteers—those who know the jungles west of the capital, those who know Orazca."
"We cannot—"
"Quiet, Caparocti," the emperor whispered. "Your desire to protect the heart of our empire is admirable, but be silent. I need to think."
The room silenced. All looked to the emperor, who stared at the figurine placed next to Orazca on the map.
The emperor smiled.
The imperial vanity was satisfied.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Huatli and her lancers left the capital via its riverside districts, accompanied by a ragtag group of auxiliaries—volunteers from regiments shattered in the initial wave of the invasion, and prisoners released to Huatli's command. Roughly one hundred soldiers and half as many quetzacama scurried alongside the riverbank.
The river bordering Pachatupa fed the city freshwater from vast inland mountain ranges, plunging down from Itlimoc to whorl and tumble through heavily irrigated floodplains. Beyond, the river diverted to Pachatupa's north, where great canals channeled the river into urban use—washings, disposal, power for riverside mills, and leisure. From there, the river continued to the sea.
Huatli's company slipped out of the city on its northern side. To its south, the fields raged with fire and the thundering, trumpeting calls of imperial brontodons and monstrosaurs. Cannons boomed and echoed, reports rolling up the southern walls of Pachatupa into the black sky. A diversion, a furious barrage and single attempt at breaking the Phyrexian encirclement. The Phyrexians were canny enemies. A simple feint would not draw their attention: to buy Huatli's company cover to slip out from the city undetected, the imperial army needed to make a serious effort. Some generals voiced their opposition to this plan, but the emperor was firm.
Huatli hurried along the foliage-choked riverbank, bundled against the sunless cold. She wanted not to think of the battle raging on the other side of the capital, all those lives thrown to the slaughter for her hope. But she clutched them close. She was the imperial conscience; it was her job to remember this moment, to speak this pain into history. In the darkness, she advanced, following the quiet rustling of the soldiers ahead of her, followed by the subtle clinking and jangling of the soldiers behind her. The earth below was muddy and stank of smoke and rain. The wide river to her right, silent despite its size. The possibility of Phyrexians on the opposite bank, the coil of her muscles, the horrible waiting for the dark jungle to burst into buzzing, screaming machines.
Huatli missed Saheeli. She wanted to walk alongside this river with her love. She wanted to sit with her on the coast, in the white sand. She wanted to stand with her in the heart of the jungle's green anywhere, under Ixalli's setting light, and kiss her.
Instead: cannon reports in the distance. A bloated body in the river, floating slowly with the current, pale. A vampire, stalking behind her.
"What do you want, Mavren?" Huatli asked, whispering. She looked back to be sure it was him, happy to see the thin, white paladin looked just as fatigued and uncomfortable in his armor as she felt in hers.
"I want to thank you for this opportunity," Mavren said. He walked with an uncanny grace—his vision, unlike Huatli's, was not affected by this penumbral night. "My paladins and I found languishing in your imperial dungeons to be quite dispiriting. I much prefer a chance at martyrdom."
"I have no plans on to die, Mavren," Huatli said. "Nor a desire for glory. I do what I do for the people of the empire."
"No one plans to die," Mavren said. "But death has its own designs. Anyways, I wanted to bring your attention to our bargain."
"We have a bargain?"
"My compatriots and I were released to your command for this expedition," Mavren said. "Nothing specific was promised to us as a reward."
"No longer languishing in an imperial cell," Huatli said. "That is your reward."
"I was thinking something more concrete," Mavren said. "Freedom."
Huatli stopped. Mavren stopped. The rest of the line of soldiers continued, parting around the two of them like water flowing around boulders in a river. Inti approached and stopped with them.
"The vampires want to be released after we succeed," Huatli said to her cousin. "What do you think?"
"I would kill them right here," Inti said. "But we can use their swords until the invaders take care of them for us."
"I can understand you, you know," Mavren said. "I speak your language."
Inti shrugged. "I spoke slowly so you could understand," he said. He turned back to Huatli. "Your call, cousin."
Mavren was an aristocrat. Huatli, in her role as warrior-poet, understood aristocrats. The opulent imperials and cold nobility of Torrezon were the same in one regard: they did not beg, even when they begged.
"We never made a bargain," Huatli said. "March. We'll discuss what happens after, after."
Mavren bowed, dipping deep enough for Huatli to roll her eyes at the obvious sarcasm. She started walking again. Inti shoved Mavren forward, and the two of them fell in line behind her, marching with the lancer company and auxiliaries toward Orazca.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Huatli and her company arrived to Orazca in the decided morning. An acrid rain fell over the golden city, swelling its waterfalls to dark, raging torrents. Much of the foliage that had greened the city was now dead, choked to withered black rot. The crown jewel of the empire, reduced to a wet crater.
Movement to the right, muffled commotion. Soldiers, laying belly-flat on the wet earth, shimmying to make way for a small group of mud-streaked scouts returning from their expedition to the city.
"Warrior-poet," the lead scout whispered when she reached Huatli. "We have a route to the temple. Temilo here," she said, indicating one of the thin, dark men who approached with her, "has been garrisoned in Orazca since the start of the invasion."
"Poet," Temilo said, also saluting. "I praise Kinjalli for you and your lancers. We thought we were alone against the monsters. Do you have any water?"
Huatli offered Temilo her own canteen. "This night is terrifying alone, but dawn approaches and brings friends. Your report."
"The Phyrexians roam the city," Temilo said. He took a long drink of water, capped the canteen, then passed it back to Huatli. "It is dangerous to be outside—we have a garrison deep in the heart of the ritual district, near the Winged Temple."
"I need to get to the recitation chamber there," Huatli said, pointing at the grand temple. "Is there a route?"
"We had an observation post there," Temilo shook his head. "But no one has heard from them for days, and none of us have tried to make it up there—too exposed."
The Winged Temple was a grand monument. Built in ages past by the command of the Sun Empire, the temple was a testament to imperial might and the glory of the Threefold Sun. Lost and forgotten after imperial greed saw Orazca stripped from the empire, the Winged Temple was altered by the River Heralds; now once more under the rule of the Sun Empire, the temple bore aspects of both cultures.
"The only route to the top is the Three Hundred Steps," Temilo said. "There are internal passages which will get you to them; the designers ensured that no one approaching the temple top could do so without walking exposed to the light of the Threefold Sun."
"Outstanding," Inti muttered, sarcastic.
"Built in a more honest time," Huatli agreed. "Thank you for your report, Temilo. Can you lead us to your garrison?"
"Yes, but we must move quickly," Temilo said. "It is not safe outside."
"Right," Huatli said. She pressed herself up from prone and looked to her lancers. With a wave, her company and their quetzacama stood. A second sharp gesture sent them forward into the city. The company stretched into a column, weapons at the ready, and wound through Orazca's golden boulevards. But for the distant sound of falling water and the clatter of their hurrying column, Orazca was silent.
A red flash lit the sky.
A roar split the waterfall chorus, shattering the soft rumbling that blanketed the city. It was a terrible sound, not the natural bellow of a quetzacama but something greater than sound.
Huatli stumbled, ducking for cover along with the rest of her soldiers as they looked to the sky, in awe at the web of red lightning spreading across the boiling clouds. For the long moment of the roar, they were not a company of veteran lancers, but terrified animals, humans humbled by the presence of a god.
On the horizon opposite them, at the lip of the bowl in which Orazca was built, stood Etali, one of the elder dinosaurs. He was huge, a creature magnitudes larger than the largest monstrosaur or dreadmaw; to be in his proximity was to crouch under an ancient king, to witness a mountain of teeth and scale walking, roaring, triumphant. Staring at his silhouette was difficult, the eye forced to capture an image one could barely hold.
The quetzacama of Huatli's company thrashed against their restraints, breaking free, throwing their handlers to the side. Eyes rolling, many fled into the city.
Ink-black clouds belched from Etali's core, his lungs turned to engines that spat thunderheads from between his ribs. Red lightning rippled up the elder dinosaur's shining, metal spine, pulsing with a heartbeat rhythm, increasing its cadence as Etali reared back to roar, building to a flash that blanketed the plane in a crimson day. His roar forced Huatli's company to their knees, hands over their ears, their own screams downed by Etali's cry.
#figure(image("008_Ixalan: Three Hundred Steps under the Sun/02.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
Etali was the storm. The Phyrexians had turned the elder dinosaur, twisting this embodiment of Ixalan to their own hideous purpose. Huatli knelt, palms on the cold gold-plated street. There was nothing beyond this fear.
The ridge upon which Etali stood boiled with movement. More Phyrexians, ground troops and greater horrors, dwarfed by the size of the elder dinosaur they now commanded.
Huatli's company and the auxiliaries started to run, following Temilo toward the garrison. Huatli lingered a moment, searching for any hope of Etali in the creature that occupied the elder's body. The great and primal storm belched choking clouds, rising like anvils. There was nothing of Ixalan left in him.
Huatli sketched a prayer to Tilonalli, to Kinjalli, and to Ixalli, then followed the last of her company, hurrying ahead of the advancing Phyrexians.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Huatli's company and auxiliaries sheltered in Temilo's garrison with the rest of the beleaguered defenders of Orazca for days. Though dark, the halls inside were dry and safe; the Phyrexians had not yet found their way inside.
Huatli, Inti, Mavren, and Temilo stood alone in the entry hall before the barricaded door. They carried small, dim-burning torches—after two days in near total darkness, a strong torch was too much.
"They've stopped trying the door," Inti said.
"Of course they know we are still here," Mavren added.
"Then why did they stop?" Inti replied.
"There might be other pockets of survivors," Temilo said, whispering. "We had warning of the invasion from the coast. The city guard stockpiled weapons, food, water—there were other garrisons." Temilo trailed off. The odds were against that hope.
Survivors. The word was a deathmark. Not defenders, not soldiers, but survivors. Huatli knew language was a weapon of the heart and the mind: as iron is shaped into a sword, words honed become rhetoric. To imagine themselves as survivors now was to chisel fate into stone.
Huatli couldn't do that.
"Temilo," Huatli said, interrupting the doom spiral brewing between the three men. "You said there are other ways to the top of the Winged Temple?"
"Not to the top," Temilo said. "But there are passages to the middle tier, the priests' chambers."
"Good enough," Huatli said, nodding. "Inti, Mavren, call the soldiers. We have done enough hiding."
"The Phyrexians control the city," Temilo said. "You saw Etali—"
"Do they control us?" Huatli said. She looked to Inti, who shook his head, then to Mavren, who, after a moment, followed suit. "No. So, you'll lead us to the priests' chambers," Huatli said, addressing Temilo. "Then we will fight to the top and call upon the elders. Then we will see the future fate holds for our plane."
"If they are turned?" Inti asked. Not doubting, no, her cousin would not doubt her. He asked as a healer or soldier might—only for clarity, to plan a response to achieve an objective.
"Then Ixalan is lost," Huatli said. "We will be the first to know the end."
Inti pressed his lips together and nodded his resolve. Temilo closed his eyes and whispered a prayer. Mavren smiled, bearing his fangs.
"You'll cover this empire in death," Mavren said. "But maybe glory, too."
"Inti, get my company ready," Huatli said. "Mavren, rouse your paladins, have them pray to your god. It's us against the invaders—let us face down this enemy together before we turn our blades against each other."
"Yes, poet," Mavren said. He bowed, then slipped away into the darkness. With a curt nod, Inti followed, Temilo in tow.
Alone, Huatli finally let out the trembling breath she had been holding. She kept her prayers—she would need them in the hours to come. Instead, she thought of Saheeli—how bright she was—and followed the others into the darkness.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
There were three hundred steps beyond the archway at the Winged Temple's middle to the recitation chamber at its summit. A sacred number, one hundred steps for each aspect of the Threefold Sun. There were an uncounted number before, a number without order or meaning, to represent the plane without order or meaning before the grace of the Threefold Sun. Three hundred steps between now and fate.
Huatli's company of lancers hustled to form a defensive line at the archway. They arranged their shields and spears into a bristling wall, aimed down at the city below.
"We'll hold the gate," Inti bellowed over the sound of the buffeting wind. "It is a chokepoint: their numbers will be even against ours."
"But inexhaustible," Mavren added. "Hurry, Poet. I believe in death's salvation, but none of us want to meet it here." Mavren's small squadron of Legion paladins and human followers wore a motley of armor and weapons—whatever they kept from their initial capture, supplemented with the old equipment they were granted from the imperial armory. Nevertheless, the Torrezonés carried themselves with resolve.
"Good," Huatli said. "Cousin, my company is yours. Mavren," Huatli shouted to be heard over the rising wind. "This is my bargain," she said, gesturing to the archway and the Phyrexians below.
Mavren flourished his sword, bowed, and then ordered his auxiliaries to the line. Sun Empire and Legion soldiers stood shoulder to shoulder as the rain began to fall. Slow at first, then steady.
Red lightning cracked across the sky, illuminating the swirling, writhing mass of flesh and machine that writhed around the temple's base. Orazca's dark streets were choked with Phyrexians—the turned, who moved in hordes that flowed like slow water, and the pure, who walked above them, their alien silhouettes taking the shape of demons, nightmares, and weapons. In ones and twos, they started up the lowest steps of the temple, taking notice of the soldiers arranged at its midpoint. A flood followed. Mechanized quetzacama, trumpeting and bellowing to the smaller things that scuttled around and atop them, lumbered up the steps. Ranks of the wretched turned marched in tight columns behind, ordered despite their disordered uniforms and weapons. Among them the elegant, copper-colored beasts from elsewhere strode on long insectile legs, multitudinous faces blinking and screaming and bellowing, facets on hideous, iridescent carapaces.
Beyond, in the dark distance, towering Phyrexian monstrosities lumbered through the city, their humanoid silhouettes a mockery of humanity. Near and far, there was only doom.
Huatli whispered a prayer of steel to her allies, turned, and started her climb, leaving the sounds of machine and human screaming behind her, the sound of swords and war behind her.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#strong[Some Time Ago]
Why fight what you cannot defeat? A question for a poet, asked by an engineer, as the two of them lay awake in the predawn hours, on the morning before they would part.
"What do you mean?" Huatli asked. She was distracted by Saheeli's dark hair, how it felt between her fingers. Like silk, like fine silk. She resolved to remember this, to commit this moment to her own history.
"It's a simple question," Saheeli said. "I know we must. I don't want to die. I don't want you to die, but there is a small part of me that wants to just~"
"Give up?"
"Rest," Saheeli said. "I don't want to give in. I just want to stop fighting. Let it end, because then it will be done. The fear, the pain, the worry—it feels like we're trying to stop the end of everything: the end of our planes, the Multiverse. Everything. I fear we can't, and then we'll die, and something terrible will take our place."
The morning birds outside had begun their call, long whoops in the distance that spoke of a humid dawn. Saheeli's voice was a soft breath against her chest, little more than a whisper. Huatli pressed her lips to Saheeli's head and kissed her.
"Do you want my answer?" Huatli asked.
"I think you're the only person who can answer this," Saheeli said, nodding. "Show me the dawn, H."
"There was a warrior-poet before me," Huatli said. "Yolotzin, who carried the title centuries ago. Her life was one of pain. She was born to a family in a little village far from Pachatupa, during a time when the empire was young and hungry, not yet an empire but one in the making. Yolotzin's village was taken in conquest and her family killed. She was taken back to the capital because she knew how to speak our language and her voice was beautiful. As she came into her adulthood, she was granted the title of warrior-poet by the emperor."
Saheeli pressed herself closer to Huatli. Her breath slowed.
"Yolotzin was a brilliant poet, her lyric precise and soft, and for her life she was the imperial conscience." Huatli kissed Saheeli's head again, resting her lips on her hair. The story would end, the sun would rise, and she would be gone.
"Why would she serve the empire?" Saheeli asked.
"For revenge," Huatli said. "A long revenge. When Yolotzin passed, the empire mourned. Tears filled the streets, flooding them as rain after a storm. The emperor was said to wander the halls of Tocatli, his voice reduced to a moan as he searched for Yolotzin's ghost to beg just a stanza more."
The room, dark, was beginning to grey. The sun was rising. Dawn becoming morning.
"She lived at the end of the world," Huatli said. "And then through it. What we face is no different than what she faced: a mighty foe who intends to conquer, to end everything, and rewrite reality. Our duty is to live through it. To daily reject despair and, should we die, take the heart of our killer with us. Like Yolotzin, we can't stop this. We can only live through it."
Warm light slipped through the drawn curtains of Huatli's quarters. The bird calls outside were joined now by the distant but persistent sounds of Pachatupa's morning streets, waking.
"That doesn't exactly inspire hope."
"I love you. I will never lie to you."
"I think I spoke to the warrior there," Saheeli said, pushing herself up. She propped her head on her hand, resting her elbow on her pillows. She looked out at the day, and then back to Huatli, a soft smile on her face. "I want to talk to the poet. Tell me it's going to be okay?"
It was a lie to say that everything would be alright, but Saheeli's eyes were wide and the morning warm and this was the last moment for the two of them, the last moment before the end.
Huatli reached up to Saheeli, ran her fingers through her hair, and pulled her close. They kissed, forever. When they parted, Huatli cupped Saheeli's cheek, tears in her eyes.
"It's going to be alright," Huatli said.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#strong[Now]
The storm raged, a hurricane that hated and swirled with hunger. Hail, dark rain, and red lighting. Etali must have arrived into the city. Huatli had only looked back once during her climb to see that the soldiers held the gate—they did, against a writhing wall of flesh and machine, too great to pass the narrow entry.
Huatli gripped the edges of the altar and prayed, a prayer for time before the recitation. Time for her little company to hold the gate. Time against Etali's impending arrival. Time for another morning. Just a moment longer on this plane. Huatli summoned up her voice. Closed her eyes. The wall of the hurricane loomed above her, and everything outside dropped away to nothing but the howl of wind, a ruin wind, the sound of the end.
Huatli spoke to the hurricane. She spoke to death, to the predator's appetite, to the surging ocean, to all calamity, and the dawn. She told them all about their brother the hurricane, how he was taken from them and turned against them, and how Ixalan needed death, needed hunger, the sea, terror, and the dawn to stand with it against a greater enemy: the end.
Their answer was silence.
The storm faltered. Huatli opened her eyes to see the red wind swirling outside. Stilling.
The warrior poet stepped away from the altar. She walked toward the doorway out from the recitation chamber, to stand at the top of the three hundred steps and look out over Orazca and the battle raging below.
Huatli's company still held, their line fortified by a wall of Phyrexian corpses. Looming before them was Etali, stopped only one terrace down, nearly upon the gate. The elder had been climbing the Winged Temple, clawing his way up the lower tiers over the surging bodies of his own allies when he froze. Lightning rippled across the metal spines of the corrupted deity's back fin, sputtering, misfiring. The Phyrexians fought on, but they were forced around the elder, slipping and scrabbling to climb over the bodies of their fallen comrades, meeting the company's long lances as they crested the mound. Slain, they tumbled back down the slope, barreling through the waves of monstrosities that followed. Shafts of sunlight illuminated the grim scene, so bright that Huatli winced and raised a hand to cover her eyes.
The light!
Huatli looked up toward the sky and the light breaking through just as the titanic silhouette of Zetalpa, the elder of dawn, pierced Etali's hurricane, plunging toward the earth. Zetalpa's wings spread wider than the horizon—or at least seemed to—and her cry banished the night. Dawn came with fury, slamming into Etali talons first, wrapping him up in her wings, her mighty jaws closed around Etali's neck. The Winged Temple trembled with the impact and a shockwave blasted out across its face, scattering hundreds of Phyrexians, sending them tumbling off the steps and terraces. Huatli's company staggered back but were protected from the worst of the blast—they recovered within moments and took up their defensive positions.
Zetalpa's breaking dawn may have been silent or—like Etali's first roar—may have been so loud as to render Huatli unable to hear anything, but the twin, rising roars around the base of the temple split open the day. Huatli ran to a nearby observation platform, a viewing terrace where priests could raise tributes to the Threefold Sun in full view of the people who walked the streets of Orazca. From there, she could look down into the golden city's streets.
Another river choked the boulevards and plazas: unturned quetzacama, mighty creatures of all shapes and sizes, carnivores and herbivores and omnivores, charging together against the beleaguered Phyrexians. Moving with them was Tetzimoc, death itself, covered in quills and spines that quivered and launched in thick volleys toward the retreating Phyrexians. Stragglers were swept up in the lumbering advance of Tetzimoc's lieutenants, armored quetzacama whose sledgehammer tails crushed metal and bashed aside the ranks of Phyrexian legionnaires.
Another roar called Huatli's attention. She turned to look out across the city to see Ghalta standing astride a distant temple, bellowing a challenge to the towering Phyrexians that stalked the city. These giants carried weapons made from living, screaming metal: they fell upon her, their swords singing, and she leapt to meet them, fury against fury. Ghalta pulled one down, bashing aside its sword to close her jaws around its midsection, tearing through its sinew and metal trunk. Another approached from behind, its weapon raised above its cloud-lost head, about to strike, when a geyser of steaming water erupted beneath it. The columnar blast hid a dark shape in its center: Nezahal, the elder of the tides. Nezahal wrapped the giant up from legs to wrists, threading its long, whip-like body around the creature, crushing it under an ocean's worth of pressure. The water fell like rain, and Ghalta and Nezahal tore through the remaining giants.
#figure(image("008_Ixalan: Three Hundred Steps under the Sun/03.png", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
"Where is she?" Huatli whispered, scanning the city horizon. There was one more elder to answer Huatli's call. The warrior poet paced the observation deck, daring to hold hope high in her heart. The other elders—Zetalpa, Nezahal, Tetzimoc, and Ghalta—had responded to her call, leaping to protect Orazca. One elder was missing.
Zacama.
Was she turned? Was she dead? A clamor from the gate below drew Huatli's attention: Zetalpa and Etali, tangled in vicious combat, broke for a moment. Zetalpa clawed back into the sky, her great wings buffeting the temple. She roared, her blood falling like rain as she ascended, recovering from the terrible clash. Etali bled dark oil, staggering but not mortally wounded, clinging to the steps. A stalemate.
Huatli ran, taking the three hundred steps down to the gate at the edge of her balance, slipping near the bottom on the rain-slick stone but not falling.
"Inti!" she cried over the sound of the desperate battle. "Inti, where are you?"
"Here, poet!" Mavren responded. A blood-slick and oil-stained Mavren limped toward Huatli, dragging a wounded Inti with him. He carried the bigger man a few steps back from the line, ducked out from under his arm, and set him down, gently. "Where did he get hurt?" Huatli asked, sliding to Inti's side. Her cousin moaned, his eyes closed and fluttering. Like Mavren, he was streaked in blood, oil, and ash.
Huatli checked Inti over, wiping the blood and ash and oil away from his face. Nothing cut, none of it was his. Gently, she laid his head down—nothing she could do for him now.
"Huatli!" A shout from the line—Temilo, calling her over. He clutched a spear. Bandages wrapped his forearms. He was, but for his voice, indistinguishable from the other living soldiers on the line—Sun Empire or Legion, they all were streaked in ash and sweat, wrapped in ragged bandages, exhausted.
Huatli crossed the courtyard and joined Temilo and her company on the line. Mavren followed.
"Look," Temilo cried, pointing down the steps, toward Etali and the streets of Orazca beyond.
The Phyrexians were retreating, tumbling down the steps, an avalanche of metal and flesh routed without direction or leadership. They streamed around Etali, who stood with his back turned to Huatli and her company. Dark oil fell from the turned elder's wounds. His dorsal sail was torn, shredded by Zetalpa's talons, spines cracked and broken by the other elder's assault. Waste heat vented from Etali with each breath, the stinking smell of lightning and ozone rankling, acidic. The great storm corralled by foreign machine, reduced to a disposable weapon. Huatli could weep.
A great shape moved in the dark streets of Orazca below. A mighty form so large that Huatli at first thought the earth itself was heaving up, as if an earthquake was shifting a mountain. The Phyrexian forces streaming down the temple shuddered in response, the front ranks hurrying to stop and change direction while the middle and rear pressed on, not yet seeing the danger before them.
Zacama, the final and greatest of the elders, loomed up from the shadows, her three heads bellowing a tri-tonal roar. The front ranks of the Phyrexian army disintegrated, metal flaring bright as daylight as the titanic sound washed over them, rolling up the flanks of the Winged Temple like a wave crashing upon the shore. Huatli called for her company to dive to the ground. They did, and a heartbeat later the wall of heat that followed the sound of the roar blasted through the gate. Huatli covered her head with her arms and screamed, a primal reaction to the overwhelming sound, the blasting heat, the shaking temple—the sound of the end, and the plane denying the end.
The wave passed, and Huatli lived. She stood and helped the lancers on either side of her to their feet. Together, they looked through the gateway to see the result of the great elder's entrance.
Zacama took to the first terrace, main head ignoring the scrambling Phyrexian forces as her other heads snapped and bellowed at them. None of the turned forces tried to attack Zacama. Only those pale white monsters of the main invasion force attempted to bring her down, wading through their fleeing comrades to throw themselves at Zacama's ankles. The great elder strode through the Phyrexian forces without care, as if walking through tall grass as she climbed the temple toward the turned Etali. He lowered himself into a ready crouch, lightning sparking and buzzing across his broken sail.
Zacama's main head opened her mouth, a yawning maw packed with human-size, dagger-shaped teeth, and inhaled.
"Down!" Huatli shouted.
Zacama roared again, unleashing another wave of heat and sound up the flank of the temple toward Etali. The Winged Temple's golden facade flash-melted before her, revealing a fan of dark stone beneath. Etali staggered, exposed metal endoskeleton superheating, twisting, flaring and spitting as the sheer force of Zacama's bellow buffeted him. He fell to a knee, bracing with one of his razor arms to stop any further fall, and raised the other in defense.
Zacama bit down on Etali's arm with her main head and tore it free with a single, swift movement. Etali struggled to stand, but Zacama's other two heads lunged forward, pinning the turned elder to the ground.
For a moment, Etali stopped struggling. Zacama held him fast, pinned, submitted. Her main head loomed close to Etali's and sniffed, inhaling the scent of her turned cousin. Huatli wondered what the two of them exchanged—was it recognition? Was it a plaintive question—a furious one?
Zacama reached out with her main head and bit down on Etali's neck. Etali shuddered, but did not roar or struggle, as Zacama tore his head from his body, then flung it into the city below. Etali's body kicked, spasming, and then stilled.
Zacama stood, triumphant. The dawn broke out behind her. Her two smaller heads roared her victory, breath steaming in the morning air. The other elder dinosaurs cried out in response, and were joined by a resounding, city-wide chorus of the quetzacama hosts that followed them.
Huatli stood. While Zacama's other heads bellowed her victory, her main head turned to look down at her. Huatli raised her hand to acknowledge the elder.
Zacama sniffed. A word, a thought, a feeling of gratitude outside of Huatli but familiar to her. Speaking with an elder was addressing something elemental; speaking with Zacama was engaging with the soul of the plane itself, and yet Huatli could only think of a warm truth, almost impossible to consider.
#emph[I did not lie to her.]
Zacama turned and descended the temple. The earth trembled.
The dark curtain of smoke, ash, and raging red hurricane had been torn and pierced. The sun was breaking through. Orazca welcomed the morning light, and the city shone gold through the oil. Dawn had arrived: the day, though not yet won, was here.
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/023%20-%20Oath%20of%20the%20Gatewatch/006_Oath%20of%20the%20Gatewatch.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Oath of the Gatewatch",
set_name: "Oath of the Gatewatch",
story_date: datetime(day: 03, month: 02, year: 2016),
author: "<NAME>",
doc
)
#emph[Chandra has joined the other Planeswalkers, rescuing Gideon, Jace, and Nissa from the prison of agony in which Ob Nixilis had bound them. But while they were locked away, Ulamog and Kozilek rampaged across the land, leaving utter destruction in their wake. Zendikar seems on the verge of collapse.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Gideon was the first to emerge from the cavern, striding into the midst of the chittering Eldrazi swarm. The creatures were pressed close together into the cleft of rock where the cave mouth opened, making them easy targets for Gideon's sural—and Chandra's blasts and cyclones of fire. Every muscle in his body ached, battered by the demon's attacks and torn by the spells of torment they had endured. But he had fallen once more into the easy rhythm of combat, bolstered by the power of the other Planeswalkers who fought at his side.
Soon enough, the Eldrazi were scattered, like a wave crashing against unmoving rock. And as the last of them skittered away, as their shouts ceased and Chandra's fire dimmed and their pounding footsteps slowed, it was like sinking underwater: silent, and strangely still.
As though the world had died.
As one last Eldrazi twitched at his feet, Gideon cast a glance around at his companions. Each of them was staring in a different direction from their high vantage point in the mountains, taking in what had surely once been a striking vista—before the Eldrazi came. His own eyes swept across the ruin of Sea Gate and the desolate waste that spread out from it, and came to rest on the Eldrazi titans—two of them now. Ulamog, who had been trapped and at their mercy, and now Kozilek, whose sudden appearance had ruined everything.
The titans were creeping along, not quite side by side, leaving twin trails of destruction in their wake. But where Ulamog left the all-too-familiar bony dust behind him, Kozilek's trail was a bizarre swatch of gleaming stone formed in strange square spirals, coated in a sickly sheen of violets and greens. Of course, their spawn teemed around them as well, but Gideon saw no other signs of life.
#figure(image("006_Oath of the Gatewatch/01.jpg", width: 100%), caption: [Ruin in Their Wake | Art by <NAME>], supplement: none, numbering: none)
His army was gone. All his work over the past months was undone. There was nothing left.
"Gideon," Jace murmured.
Gideon turned, but Jace nodded toward Nissa.
The elf had sunk to her knees, aghast at the desolation of her world. Gideon took a step toward her, but Jace tugged at his arm.
"Wait," Jace whispered. "What are you going to say to her?"
"What? I don't—"
"Don't make promises you can't keep," Jace said firmly.
Whether of their own volition or with the mind mage's prompting, all the things he might have said to comfort Nissa came to mind: we'll get them, we'll make this right, victory is still within reach, this desolate world will live again. Empty platitudes. Jace was right—he couldn't promise those things.
"I think we have to seriously consider the option of leaving Zendikar to its fate."
Jace had whispered, but Nissa clearly heard him. She sprang to her feet and whirled on them, her fists clenched at her side and her green eyes flaring. "I'm not going anywhere," she said. The ground trembled ever so slightly at her words—the first sign Gideon had seen that the world still lived.
Jace sighed. "Nissa," he said, "we need to be aware, at least, of the possibility that what we set out to do is impossible. Ugin thought so, and he has more experience with the Eldrazi than we will ever have."
"But you know he's wrong," Nissa said. "You saw the answer. You were the one who figured it out."
"How can we be sure?" Jace said.
Gideon lost track of their argument. He found himself staring down at the dusty ground. Scraps of armor and crumbling weapons suggested that they were standing among the dead, walking across bodies that had crumbled to dust at the Eldrazi's touch. His stomach knotted.
"Zendikar isn't the only world that needs our help," he heard Jace say.
"Zendikar needs #emph[me] ," Nissa retorted. "Whatever the rest of you decide to do, I am staying here. You can all leave if that's what you want. I'm staying."
Jace fell silent, and Chandra continued staring into the distance, tracing the path of the Eldrazi with her eyes while the rest of her stood uncharacteristically still. Gideon suddenly realized something remarkable: neither of them had left. Either one of them could have. Jace clearly wanted to.
But not without the others.
"You could leave," he said to Jace. "You could have left already, instead of trying to convince the rest of us. You too, Chandra. There's nothing binding you here. We could all leave."
Nissa's jaw tightened, but she didn't speak.
"For all we know, Zendikar is doomed. We could be the last people on this plane, the last ones standing between the Eldrazi and the beating heart of this world. And what can we do? What can any of us do against the Eldrazi—not one, but #emph[two] monstrous titans?"
"And who knows where the third one is," Jace added quietly.
"Maybe there's nothing to be done. Maybe one of us—any one of us—can't do anything against such monsters."
Chandra made a strangled sort of sound.
"But maybe #emph[four] of us can," Gideon said.
#figure(image("006_Oath of the Gatewatch/02.jpg", width: 100%), caption: [Oath of Gideon | Art by Wesley Burt], supplement: none, numbering: none)
Jace smiled, and Nissa's eyes widened.
"I think we can," Gideon went on. "Working together, I think the four of us could stand against just about any force the Multiverse decided to throw at us. So maybe we should."
"But—" Chandra blurted.
Gideon lifted a hand. "Hear me out. Look at what we have already done. We bound Ulamog. We defeated that demon. Each of us is powerful, in our own way. Your fire, Chandra—your fury is an incredible force. Nissa, you understand the soul of this plane and the flow of its magic in a way the rest of us cannot grasp. Jace, I underestimated you at first, but your quick thinking and forethought have saved me time and again. Together, we can take down the Eldrazi. We can save this world. And then we can save any other world that needs us, no matter how big the threat."
"You're getting ahead of yourself," Chandra said. "Maybe we should focus on the threat at hand."
"No," Gideon said. "We need to focus on #emph[why ] we're facing that threat. It can't be about just making up for our mistakes. It can't be just a personal vendetta. This is bigger than the Eldrazi, bigger than Zendikar. We need to be committed—" He saw Chandra wince at the word, but he pressed his point. "We need to be committed, not just to getting the Eldrazi off Zendikar, but to standing together against all the forces that threaten the Multiverse. No one else can do it. This is the task that falls to us, because of our power. Because of our sparks."
He took a deep breath, and rested for just a moment in the certainty that he had never been more right about anything.
"I have seen civilization fall," he said. "When the Eldrazi destroyed Sea Gate, they threatened all I believe. The people of Zendikar—my whole army—were nothing more than stinging flies in their path."
He shook his head. "Never again."
The others were all watching him now. As he spoke, he met the gaze of each of his companions.
"Not just the Eldrazi, and not just Zendikar. Never again, not on any world. This I swear: For Sea Gate, for Zendikar and all its people, for justice and peace, #emph[I will keep watch.] And when any new danger arises to threaten the Multiverse, I will be there, with you three beside me."
Jace nodded slowly, while Chandra folded her arms across her chest. At least one of them was still with him, Gideon thought.
But it was Nissa who spoke next, kneeling to touch the dusty ground. "I have seen a world laid waste," she said. "As the Eldrazi sweep over Zendikar, the land is reduced to dust and ash. Left unchecked, they will consume it and everything on it."
She stood up, dust falling from her clenched fist. "Never again," she said. "For Zendikar and the life it nurtures, for the life of every plane, I will keep watch."
#figure(image("006_Oath of the Gatewatch/03.jpg", width: 100%), caption: [Oath of Nissa | Art by Wesley Burt], supplement: none, numbering: none)
Jace took a step forward, looking at Chandra. "Gideon's right," he said. "The four of us have extraordinary power. We have a unique opportunity—a responsibility, even—to use that power against threats like this. The Eldrazi, yes, but there are other threats that go beyond a single plane. I've heard it said that a Planeswalker is someone who can always run from danger. But we are also the ones who can choose to stay."
"Say the words," said Nissa, the hint of a smile breaking the mask of her anger.
"What?"
"Say the words," she repeated. "Like an oath."
Jace returned her smile. "Fine. I've seen..." His brow furrowed and the smile faded from his lips. "I have seen a greater danger than I could have imagined. The Eldrazi don't threaten just Zendikar. If we leave here, if we leave them alone, they could consume plane after plane until even Ravnica is laid waste. At this moment, Emrakul could be drifting through the Blind Eternities, looking for another plane to devour."
Gideon thought of Theros, of Bant, of Ravnica.
Jace nodded decisively. "Never again. For the sake of the Multiverse, I will keep watch."
#figure(image("006_Oath of the Gatewatch/04.jpg", width: 100%), caption: [Oath of Jace | Art by Wesley Burt], supplement: none, numbering: none)
Gideon's eyes turned to Chandra, and he saw Jace and Nissa regarding the pyromancer as well. He wasn't sure what to expect from her anymore—except the unexpected.
"I know what you're thinking," she said. "That I could never take something like this seriously. Maybe you're right."
She turned her head and met Nissa's gaze. "But here's the thing," she said. "I've seen what we can do together. And Gideon's right—none of us can handle the Eldrazi alone. It's going to take the four of us in concert, combining all our magic, to bring them down."
She took a deep breath and let it out with a puff. "Every world has its tyrants, following their own desires with no concern for the people they step on. They're no different from the Eldrazi. So I'll say it: never again. If it means that people can live in freedom, yeah, I'll keep watch. With you."
#figure(image("006_Oath of the Gatewatch/05.jpg", width: 100%), caption: [Oath of Chandra | Art by Wesley Burt], supplement: none, numbering: none)
While Nissa embraced Chandra and the pyromancer surreptitiously dabbed at her eyes, Gideon reflected on the Chandra he had known on Regatha, who had been weighed down by a commitment she had made with her mouth but not taken on with her whole heart. He had a feeling this was different, and he smiled.
"All right, Gideon," Chandra said as she pulled away from Nissa. "What's next? You always have a plan."
"I do not," he said. "I need more information. I don't know how long we were in there, whether any soldiers are still alive—"
"I can tell you that," Chandra said. "I left Tazri and a small group of soldiers a couple miles back that way." She waved vaguely.
"Tazri. Good," Gideon said. "She'll know what resources we have left."
"Follow me," Chandra said, already walking.
"I have some ideas," Jace added. "Maybe you can help me turn them into a plan."
Gideon smiled and clapped Jace on the shoulder. Nissa was right behind Chandra, and the two men started off after them.
All Gideon's work over the past months had come down to this, he realized. To these four Planeswalkers making a choice: the choice to stay, as Jace had said. The choice to fight instead of running away. A choice—a commitment, a promise. To keep watch.
Even if that was all he had accomplished, it was enough.
#figure(image("006_Oath of the Gatewatch/06.jpg", width: 100%), caption: [Call the Gatewatch | Art by <NAME>], supplement: none, numbering: none)
|
|
https://github.com/Ttajika/auto-ref-numbery | https://raw.githubusercontent.com/Ttajika/auto-ref-numbery/main/0.0.1/translation.typ | typst | MIT License | #let trans = (
en: (Proposition: "Proposition",
Theorem: "Theorem",
Table: "Table",
Figure: "Figure",
Assumption: "Assumption",
Definition: "Definition",
Corollary: "Corollary",
Lemma: "Lemma",
Remark: "Remark",
Example: "Example",
Claim: "Claim",
Fact: "Fact",
Proof: "Proof"
),
jp: (Proposition: "命題",
Theorem: "定理",
Table: "表",
Figure: "図",
Assumption: "仮定",
Definition: "定義",
Corollary: "系",
Lemma: "補題",
Remark: "注意",
Example: "例",
Claim: "主張",
Fact: "事実",
Proof:"証明")
)
#let plurals_dic = ("Proposition": "Propositions", "Theorem":"Theorems", "Lemma":"Lemmata", "Definition":"Definitions", "Table":"Tables", "Assumption":"Assumptions", "Figure":"Figures", "Example": "Examples", "Fact":"Facts")
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/024%20-%20Shadows%20over%20Innistrad/012_I%20Am%20Avacyn.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"I Am Avacyn",
set_name: "Shadows Over Innistrad",
story_date: datetime(day: 18, month: 05, year: 2016),
author: "<NAME>",
doc
)
#emph[Jace and Tamiyo have followed clues to Thraben Cathedral, the roost of the mad angel Avacyn. Avacyn attacked, and now the three of them are locked in battle. Jace has been unable to contain Avacyn's divine power, and Tamiyo, for her part, is unwilling to break personal promises in order to help save his life. Avacyn bears down on the pair and will soon destroy them both.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#figure(image("012_I Am Avacyn/01.jpg", width: 100%), caption: [Avacyn's Judgment | Art by <NAME>], supplement: none, numbering: none)
The two fiends cower before me like a stain on the cathedral floor. They avert their eyes, unworthy of my sight.
I know they are not of this world, but I know they bleed. I can feel their heartbeats under their throats, at the tip of my spear. One more gentle thrust and I will unmask these demonic creatures, send them into the oblivion they deserve, and cleanse the world of them.
I am Avacyn. I am to protect.
One of them, the creature in the blue cloak, pleads with me. As he speaks, I see worms spilling from his mouth. "Avacyn, this isn't you," he coughs, his claw holding his head. "You don't have to do this." The words crawl away into the shadows like centipedes.
Even more than my spear, my sight is my greatest weapon. My eyes see more than the humans can, more even than my fellow angels. I see the angelic heralds in the stained-glass windows, how they bow to me in deference. I see the moonlight that follows me in my travels, even here inside the cathedral, and the white-feathered doves that scatter forth from wherever my feet touch earth. Most of all, I see the squirming jelly behind the faces. I see the revolting lies that hide dressed in human form.
I alone exist to open them to the light of justice.
"You're ill, or misinformed," says the other fiend, her long ears pulled back behind her head. Her eyes are empty sockets, and behind them all I see is coarse black hair, writhing. "You're meant to protect people, not—this."
I push toward her with my hand, and my light blasts the demon back. She slams against the wall, coughing, and the sounds that fall out of her become bedraggled black hair.
"I am the bulwark against fiends from without," I say, aiming my spear at her. The spear's points bend into a scolding finger. "I destroy wickedness, no matter its origin, no matter its form. I have seen you crawl across my provinces, slither into my church. But now I #emph[see] you. And now you answer to me."
I call to the light, and it obeys. A cold flickering manifests in my hand, and the shadows of my fingers fall across the trembling demons. "Finally," I say, "your corruption of Innistrad ends."
Something stirs up on the roof. I look up to see the skylight explode, a man crashing through it feet first. Tinted shards rain down into the cathedral. The glass bounces off my skin as the demons shield their heads.
#figure(image("012_I Am Avacyn/02.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
The man crashes onto his feet, sword in hand. He stands straight, his boots grinding glass. He is unhurt, his white hair barely ruffled.
#figure(image("012_I Am Avacyn/03.jpg", width: 100%), caption: [Clue Token | Art by <NAME>el], supplement: none, numbering: none)
It is one of the bloodsuckers, and an ancient one. I recognize him, but I cannot quite bring his name to mind.
"Stand aside, vampire," I say. "I will deal with you next."
But his body blocks my way. His weapons are already drawn: a longsword readied in one hand, a spell in the other.
"There's something wrong with you, Avacyn," the vampire says. His mouth is a leech's mouth, the words bent around a bloody circle of fangs. "I've come to help."
"Do not attempt to stay my spear, bloodsucker, or you will feel it yourself."
I cannot quite recall his title, but I #emph[see] him. His face ripples with leeches, slithering just beneath the skin. He reeks of blood.
"Avacyn," he says. "I need you to come with me down to the cellar. You'll see what I must do, if you'll just wait for a moment—"
"My mission never waits," I answer. I hurl the holy magic at him, and it hits him full in the chest.
The vampire is unmoved.
"Avacyn," he says. "The cellar. We have business we must attend to."
"Sorin," says one of the creatures, her empty eyes directed to the vampire. "You can help her, can't you?"
"Silence," he snaps, and the demons jolt with the force of his voice. He turns to me again. "Listen to me. If you have some grievance with these two, you may kill them before we begin."
The two fiends look at each other.
"But I won't permit you to leave this place until our business is concluded."
In the rafters high above, feathered wings rustle. The eyes of a dozen of my blessed angels look down on us, flashing and beautiful like the stars at midnight.
I find myself wondering something. An angel is made of goodness—but is goodness made of an angel's acts? I do not know why this question occurs to me now.
"I warn you, vampire," I say. "These invaders are the foulest threat on Innistrad, but you are in danger of becoming the greater evil in my sight. Begone, or I and my host will strike you down."
#figure(image("012_I Am Avacyn/04.jpg", width: 100%), caption: [Always Watching | Art by Chase Stone], supplement: none, numbering: none)
He steps toward me in disobedience. I pummel him with hallowed light, but again the spell does not harm him. He tilts his head. His eyes look almost concerned, but his leech's fangs flex, mocking me. I hear laughter. A sliver of doubt inserts itself into my mind—not that I may be defeated, but that I may have #emph[hesitated] at the moment I released the spell. I may have prevented myself from striking him down. I do not know why this should be.
I hear the wings of the angels who perch in the rafters above me, and I can feel their starlight eyes on me. I steel myself in their light. As I raise my spear-tip to the vampire, it curves into a blade of justice.
The vampire takes another step, so that his chest rests against the spearhead. "Avacyn," he says with his bloody mouth. "You cannot harm me." He reaches out to me. "And there is a reason."
The next words he says leave a mark on me. They are just sounds, just vibrations in air. But I feel them like a carver's knife. Like an inquisitor's brand.
"I am your creator," he says.
The words feel old, as if they have been chiseled somewhere inside me, dust gathering in the troughs. But now the dust floats away, and I see him.
He is Sorin, of the Markov bloodline. I see him. His mouth is not round like a leech's—I do not know why I perceived him that way before. His white-within-black eyes and high cheekbones are not unlike my own.
He is my creator. The truth of it is plain to me now. As I see him, I see myself.
He is the reason I exist. He was there when I was created, the man who stood over me that first instant when I came into being. It was he who imbued me with my mission. My creation happened #emph[here] , in the deep reaches of this very cathedral. I know now that he made me, Innistrad's divinity, for one purpose.
I am Avacyn. I am to protect.
To root out threats to Innistrad. To answer the prayers of the innocent, and to strike down those who would torment them. To protect those who would otherwise be devoured by the shadows of this world.
"You are my creator," I say.
"Yes."
"Then you must be good," I say.
My creator's smile is gentle, showing just the slightest edge of fang.
"You are the source," I say. "Of me. And therefore. Of goodness."
"That's right, Avacyn. And so that you can be the best you can be, you must join me. Come." He reaches his hand out to me, but something makes me hesitate to take it.
I look at the two people I have battled tonight, their backs against a wall of the nave. They still look as fiends to me now, but also like a woman and a man. Mages. Mortals.
Their blood has been spilled in my cathedral. I can smell the tang of copper on my blade. But this could only be so if they were wicked. If I have struck them down, then what could they be but monsters? An angel is made of goodness—is goodness made of an angel's acts?
My creator regards me. His eyes are cold as they scrutinize my face. I can see his pulse in the pale skin of his neck, the vein beating with someone else's warm blood.
I am Avacyn. I am to protect.
#emph[But]
Images whirl around me.
#emph[I]
Villages burning.
#emph[have]
Innocents slain.
#emph[not]
A mother, crying over her child.
#emph[protected.]
I have set those fires. I have slain those innocents. I was created as a defender, as a protector—and yet that protector has brought destruction. And I was not only a protector, but a symbol. An entire church grew up around me—but the church has kindled a zealous hatred, and my power has fanned those flames.
What does it mean to be good? Is goodness made of an angel's acts?
I look at my creator and tilt my head at him.
I was made, but I was made imperfectly. With flawed sight. I am not a protector at all, but a danger, a weapon for those who would wield me to harm this world.
"You," I say.
I square my shoulders toward my creator and flex my pinions. Moonlight gathers on my body. My skin glows, and I can see doves flying in the cathedral around me. It is clear to me now what I must do.
"Avacyn," Markov says, his voice low, a predator's tone.
"Scion of Markov," I announce, raising my spear. Its blades curve and warp to jab at his chest. "You have allowed this to happen."
"You should be careful what you say to me, child," Markov says.
"I am not your child," I say. "I am your creation. You are responsible for everything I am capable of. I was made for a purpose, and your purpose was impure. <NAME>, I condemn you as the greatest evil of this world."
"You've fallen out of line," Markov says through his teeth.
"Wait, Sorin—" warns one of the fiends. "Don't. The consequences for the plane—"
"Why would you allow this?" I ask. "Why would you make me this way?" I press with the spear against his chest, scratching the armor.
Markov sneers. The blade in his hand flashes in the light from the rafters. "Avacyn, come down to the cellar," he says. "Let us discuss your creation."
"You created me to ensure that all wickedness meets its demise," I say. "Prepare to meet yours."
I lunge with the spear, using every bit of my divine strength. Somehow, the blade misses his chest, and I fall past him. He lashes me with draining magic, but I turn in time to deflect it away.
I claw at him, channeling light into the blow. It connects, but only rakes sparks across his armor.
He swings back at me, batting me with the flat of his blade. Still, it's strong enough to rattle my ribcage.
I raise my spear in both hands, the deadly end pointing to the heavens. I channel my wrath into the weapon, and it thrums with divine power.
"You were made to be loyal to me," Markov says. "You can't harm me."
"It seems not," I say. "But they can."
He looks up to see the angels I have called down on him. They dive from the rafters. He barely has time to shield his face before they crash onto him, their graceful hands tearing at him like talons.
But he fights back, and his blows are terrible. He impales one angel with his sword and slices through the wing of another. He throws one angel to the floor, cracking the marble, and another through a column, turning the masonry to powder. He holds another by the neck as she attacks him with furious claws, buffeting at his face and shoulders. I will my strength to her, but I can see her essence flowing into him, dark liquid strands from her eyes and mouth into his own. She seizes into a hunch, like the rictus of a crow.
He turns to me, his leather torn and his chest plate raked open. My angels have weakened him, but he is far from defeated. He taps the tip of his sword on the marble. "This changes nothing, Avacyn," he says.
I call, and the last three of my twinkling-eyed angels, the final guardians of the Cathedral, encircle him. They attack him in concert with sword and claw, blows many and fierce. They close in on him, shrieking, slicing from all sides. Markov must feel the way I felt inside the Helvault, with demons' wings grazing me in the lightless void.
One by one he destroys my angels. He charges into one, slamming her through row after row of stone pews. As the next swoops at him, he hurls his sword overhand, catching the blade in her chest and impaling her. She falls in a heap. He grabs the final attacker by the shoulder, looks her in the eye, and throws her through the floor-to-ceiling stained-glass window. The wall shatters into a thousand shards. The angel arcs somewhere off the bluff.
Markov turns back to me once more, a snarl revealing one of his fangs. I put my spear-blade against his neck, but I can feel it resist harming him. I lean into it, and it simply fails to cut him.
I focus on his face. I remind myself—he is not a vampiric noble, but a horror. He is a monster, a blood demon, a leech.
And I see him anew. His eyes become mouths, ringed with teeth. His face is a flimsy mask. He is my creator, and he is the embodiment of evil.
"Avacyn—" he begins through a leech's mouth, and I slash my spear through his neck, cutting deep enough to hit bone.
He roars and leaps back, grasping his neck. Rotting ooze gushes from between his fingers, turning to sickly fungus on the flagstones.
He leaps at me, sword aimed at my heart, and the blade sparks along my spear as I parry. I pivot to strike him, but I must duck his claw, and the blow severs tendons in my wing. When I lunge to push light through him, it is met with a blast of blood magic that scatters my spell. I shriek and dive into him, breaking a column with his body, crashing him through glass and splintered wood until he is shoved against the wall of the cathedral.
The monster's head tilts and I hear bone crack against bone. His neck wound has begun to scar over.
The mouths in his eye sockets drool words. "Avacyn. I must do this."
"And I, this," I say, and I sink my spear through the gap in the monster's chest plate, so deep that the blade hits the granite of the cathedral wall on the other side.
He roars and I am blasted back. I skid to a halt. Markov clutches the spear handle and yanks out the blade, and for a moment I can see the slimy animal that must serve as his heart. Squirming lampreys flow from the wound. He drops the spear and his own sword, and they clatter alongside one another. He clutches his wound closed with one claw.
"You are lost," he mouths. "You can only see me as a monster now, and that is why you can harm me."
"You are a stain on the world," I say. "It is only now that I am able to see that clearly."
His attack comes at once, almost faster than the sound reaches me.
We grapple, clamping our hands into each other's shoulders. We slam each other through pews. We lift each other up into the rafters, fragmenting the beams, and our struggle is clouded with plaster dust and feathers. I scrape at his jawing face, and the wounds do not heal immediately. My fingers find flesh and shred it, and acrid smoke seeps from the wounds as great chunks of Thraben Cathedral fall to the floor far below us.
He grimaces and suddenly locks his claws onto my upper arms, pinning me as I thrash my wings to keep us aloft. His muscles are steel, and he's bending my arms behind my back, dislocating a shoulder. I realize he was holding back before. This is his true strength.
He bites my neck, and the pain is like a thousand innocents screaming, a thousand pleas for aid, a thousand prayers I will never answer. I feel my blood pumping at my throat, drawn by suction.
When we fall, it is not from gravity, not from a weakness in my wings. We fall because he drives us down, his strength slamming us from the height of the Cathedral down to its floor.
Through its floor.
When we slam to a halt, we lie in the cellar of Thraben Cathedral, a ragged hole of marble above us. Markov's sword balances on the edge of the hole, then falls beside us, sticking point-down in the stone.
I touch the cold stone floor, pawing for my spear, but it's missing. It must still be upstairs. Instead I touch a dark shape, a burn scar on the floor, the remains of some mighty spell. It is shaped like wings. Angel's wings.
#figure(image("012_I Am Avacyn/05.jpg", width: 100%), caption: [Vault of the Archangel | Art by <NAME>], supplement: none, numbering: none)
Above us, the fiends are shouting warnings. Their pleading echoes through the halls. To me they sound like unanswered prayers.
"You should know this place," Markov says, getting up off me, wiping his fang-filled mouth. "This is the place where you were made."
I rise. The wound at my neck bleeds, but I let it bleed. Somehow, in this place, it feels like healing. "Where you made me what I am," I say.
"Let me help you, my child," the monster says. "I could...cleanse your mind. Make you a proper instrument of virtue again. I'll make you anew."
Never. "If I am not the daughter you want..." I say.
He winces.
"...then we must battle again, and again, forever. For I will never yield. I am no monster's instrument. I will not be altered by the likes of you."
I can feel my strength returning already, here in this holy place. I am inexhaustible. In a moment, I will be ready to strike him down again.
"No," Markov says. "This ends. Now."
"I know what you will do," I say. "So go on. Create another vault of silver. Imprison me. That is the only way you will stop me from doing everything in my power to destroy you."
"The prison is gone," he says. "I cannot create another Helvault, just as I cannot create another you."
I gather my strength. "You are my creator. You must know the way of this world. What cannot be destroyed must be bound."
Markov unsheathes his sword from the stone floor. His words are quiet. "But Avacyn...you can be destroyed."
#figure(image("012_I Am Avacyn/06.jpg", width: 100%), caption: [Anguished Unmaking (Game Day Promo) | Art by <NAME>], supplement: none, numbering: none)
I cannot see his face now, because he turns away from me. I cannot see whether he is monster or man. I can only see the point of that sword. I can only hear ancient words, words of a ritual performed in reverse, words of a gift being revoked. I can only feel my knees dropping onto the unyielding limit of the Cathedral floor. I can only smell the ash of some nearby smoldering. I can only touch the shadow on the floor under me, the shape that marks my first moment.
I can only say to you, in this, my final prayer to the world, that I only ever meant to keep the innocent from harm.
I am Avacyn. I am to protect.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#figure(image("012_I Am Avacyn/07.jpg", width: 100%), caption: [Holy Justiciar | Art by <NAME>], supplement: none, numbering: none)
#figure(image("012_I Am Avacyn/08.jpg", width: 100%), caption: [Selfless Cathar | Art by <NAME>ak], supplement: none, numbering: none)
#figure(image("012_I Am Avacyn/09.jpg", width: 100%), caption: [Lunar Mystic | Art by <NAME>], supplement: none, numbering: none)
#figure(image("012_I Am Avacyn/10.jpg", width: 100%), caption: [Geist of Saint Traft | Art by Daarken], supplement: none, numbering: none)
#figure(image("012_I Am Avacyn/11.jpg", width: 100%), caption: [Banners Raised | Art by Mike Bierek], supplement: none, numbering: none)
#figure(image("012_I Am Avacyn/12.jpg", width: 100%), caption: [Increasing Devotion | Art by <NAME>], supplement: none, numbering: none)
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"What—have you #emph[done?] " Jace demanded.
Fumes rose from the burnt place on the floor, drifting up through shafts of light from one of the cathedral's skylights. Avacyn was no more. The cathedral felt overly large now, somehow. Too much space under the rafters. Too vacant.
Jace glanced back and forth between the space that had been Avacyn and Sorin's face. The vampire was trembling slightly, fists clenched around his sword, as if trying to hold an earthquake in his chest.
"I had to," Sorin whispered.
Jace made incredulous gestures with his hands, unable to figure out which of the eleven things wrong with that statement to insist on first. In the end, he turned to Tamiyo. "#emph[Did] he have to?"
Tamiyo only frowned. She hiked her robes and squatted on the floor, reaching out with gloved fingertips to sample the ash remains. She rose, rubbing the ash between her fingers. She rested her hand on a small telescope on her belt, like a warrior touching a reassuring weapon, her eyes fixed on Jace. "This will have...consequences," she said.
Jace nodded. "The people of this world have lost a protector."
An extended, guttural bass rumble rolled across the sky, profound and booming. The sound thudded in Jace's chest and shook dust from the ceiling.
Tamiyo looked grave. "The #emph[plane] has lost its protector," she said.
The world rumbled again, this time under Jace's feet. The ground shuddered, the tremor intensifying from moment to moment. Flagstones jittered in their ancient mortar. Shards of stained glass shook and fell, tumbling from leaden frames that depicted Avacyn's face, and the shattering sound echoed through the vacant halls.
The tremor subsided. The echoes fell silent.
Jace watched Sorin shove his sword into his scabbard and turn away, his collar pulled up around his jaw, his shoulders hunched. The vampire glided up a staircase, his fingernails raking pits in the marble bannister.
The stairs were sunken and pitted in their centers, Jace noticed. Attrition from centuries of footfalls. Centuries of worshipers. Centuries of seekers of Avacyn.
"What have you done?" Jace called after him.
|
|
https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/identify-elevation/entry.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/packages.typ": notebookinator
#import notebookinator: *
#import themes.radial.components: *
#show: create-body-entry.with(
title: "Identify: Elevation",
type: "identify",
date: datetime(year: 2023, month: 11, day: 3),
author: "<NAME>",
witness: "Violet Ridge",
)
Elevation is a key part of scoring points that our robot cannot currently do. We
have reached the limit of allowed motors, meaning that we need to come up with a
mechanism that is either passive or can be powered by pistons.
#image("./identify.svg", width: 50%)
#heading[Design Constraints]
- Must be either passive or use pistons
- Must keep the bot within the 18" sizing restrictions
#heading[Design Goals]
We don't anticipate very many robots in our region to be able to climb, so we
don't need to go for the highest possible climb, we just need to be able to.
Since the elevations are scored relative to other robots this should give us the
same amount of points regardless.
- Needs to be able to achieve an elevation of the lowest tier in under 10 seconds
- Needs to be able to be built in a single meeting
|
https://github.com/darioglasl/Arbeiten-Vorlage-Typst | https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/Anhang/03_Projektplan/00_projektmanagement.typ | typst | === Projektmanagement
==== Rollenverteilung
#par(justify: false)[
#figure(
table(
columns: (auto, auto, auto),
inset: 10pt,
align: left,
[*Wer*], [*Was*], [*Verantwortlichkeiten*],
[Anna Abc], [Scrum Master, Entwickler], [Leiten der Scrum Meetings, Verantwortung Frontend, User Stories umsetzen],
[<NAME>], [Entwickler], [Verantwortung Backend, User Stories umsetzen],
[<NAME>], [Product Owner], [Priorisierung des Backlogs, Abnahme der User Stories],
),
caption: "Rollenverteilung im Team",
)]
==== Meetings
In der folgenden Tabelle werden die Meetings aufgelistet, die im Projekt regelmässig durchgeführt werden.
#par(justify: false)[
#figure(
table(
columns: (auto, auto, auto),
inset: 10pt,
align: left,
[*Wann*], [*Wer*], [*Was*],
[Jeden Montag Abend und Freitag Nachmittag], [Entwicklerteam], ["Daily" Scrum],
[Jeden zweiten Donnerstag Abend], [Entwicklerteam, Product Owner], [Sprint Review / Sprint Planning],
[Jeden Donnerstag oder Freitag, nach Bedarf], [Entwicklerteams], [Sync mit Kalender-Team]
),
caption: "Zeitpunkt von Meetings",
)]
|
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CU/minea/1_generated/00_all/01_september.typ | typst | #import "../../../all.typ": *
#show: book
= #translation.at("M_01_september")
#include "../01_september/26.typ"
#pagebreak()
|
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/docs/tutorial/1-writing.md | markdown | Apache License 2.0 | ---
description: Typst's tutorial.
---
# Writing in Typst
Let's get started! Suppose you got assigned to write a technical report for
university. It will contain prose, maths, headings, and figures. To get started,
you create a new project on the Typst app. You'll be taken to the editor where
you see two panels: A source panel where you compose your document and a
preview panel where you see the rendered document.

You already have a good angle for your report in mind. So let's start by writing
the introduction. Enter some text in the editor panel. You'll notice that the
text immediately appears on the previewed page.
```example
In this report, we will explore the
various factors that influence fluid
dynamics in glaciers and how they
contribute to the formation and
behavior of these natural structures.
```
_Throughout this tutorial, we'll show code examples like this one. Just like in the app, the first panel contains markup and the second panel shows a preview. We shrunk the page to fit the examples so you can see what's going on._
The next step is to add a heading and emphasize some text. Typst uses simple
markup for the most common formatting tasks. To add a heading, enter the `=`
character and to emphasize some text with italics, enclose it in
`[_underscores_]`.
```example
= Introduction
In this report, we will explore the
various factors that influence _fluid
dynamics_ in glaciers and how they
contribute to the formation and
behavior of these natural structures.
```
That was easy! To add a new paragraph, just add a blank line in between two
lines of text. If that paragraph needs a subheading, produce it by typing `==`
instead of `=`. The number of `=` characters determines the nesting level of the
heading.
Now we want to list a few of the circumstances that influence glacier dynamics.
To do that, we use a numbered list. For each item of the list, we type a `+`
character at the beginning of the line. Typst will automatically number the
items.
```example
+ The climate
+ The topography
+ The geology
```
If we wanted to add a bulleted list, we would use the `-` character instead of
the `+` character. We can also nest lists: For example, we can add a sub-list to
the first item of the list above by indenting it.
```example
+ The climate
- Temperature
- Precipitation
+ The topography
+ The geology
```
## Adding a figure { #figure }
You think that your report would benefit from a figure. Let's add one. Typst
supports images in the formats PNG, JPEG, GIF, and SVG. To add an image file to
your project, first open the _file panel_ by clicking the box icon in the left
sidebar. Here, you can see a list of all files in your project. Currently, there
is only one: The main Typst file you are writing in. To upload another file,
click the button with the arrow in the top-right corner. This opens the upload
dialog, in which you can pick files to upload from your computer. Select an
image file for your report.

We have seen before that specific symbols (called _markup_) have specific
meaning in Typst. We can use `=`, `-`, `+`, and `_` to create headings, lists
and emphasized text, respectively. However, having a special symbol for
everything we want to insert into our document would soon become cryptic and
unwieldy. For this reason, Typst reserves markup symbols only for the most
common things. Everything else is inserted with _functions._ For our image to
show up on the page, we use Typst's [`image`]($image) function.
```example
#image("glacier.jpg")
```
In general, a function produces some output for a set of _arguments_. When you
_call_ a function within markup, you provide the arguments and Typst inserts the
result (the function's _return value_) into the document. In our case, the
`image` function takes one argument: The path to the image file. To call a
function in markup, we first need to type the `#` character, immediately
followed by the name of the function. Then, we enclose the arguments in
parentheses. Typst recognizes many different data types within argument lists.
Our file path is a short [string of text]($str), so we need to enclose it in
double quotes.
The inserted image uses the whole width of the page. To change that, pass the
`width` argument to the `image` function. This is a _named_ argument and
therefore specified as a `name: value` pair. If there are multiple arguments,
they are separated by commas, so we first need to put a comma behind the path.
```example
#image("glacier.jpg", width: 70%)
```
The `width` argument is a [relative length]($relative). In our case, we
specified a percentage, determining that the image shall take up `{70%}` of the
page's width. We also could have specified an absolute value like `{1cm}` or
`{0.7in}`.
Just like text, the image is now aligned at the left side of the page by
default. It's also lacking a caption. Let's fix that by using the
[figure]($figure) function. This function takes the figure's contents as a
positional argument and an optional caption as a named argument.
Within the argument list of the `figure` function, Typst is already in code
mode. This means, you can now remove the hash before the image function call.
The hash is only needed directly in markup (to disambiguate text from function
calls).
The caption consists of arbitrary markup. To give markup to a function, we
enclose it in square brackets. This construct is called a _content block._
```example
#figure(
image("glacier.jpg", width: 70%),
caption: [
_Glaciers_ form an important part
of the earth's climate system.
],
)
```
You continue to write your report and now want to reference the figure. To do
that, first attach a label to figure. A label uniquely identifies an element in
your document. Add one after the figure by enclosing some name in angle
brackets. You can then reference the figure in your text by writing an `[@]`
symbol followed by that name. Headings and equations can also be labelled to
make them referenceable.
```example
Glaciers as the one shown in
@glaciers will cease to exist if
we don't take action soon!
#figure(
image("glacier.jpg", width: 70%),
caption: [
_Glaciers_ form an important part
of the earth's climate system.
],
) <glaciers>
```
<div class="info-box">
So far, we've passed content blocks (markup in square brackets) and strings
(text in double quotes) to our functions. Both seem to contain text. What's the
difference?
A content block can contain text, but also any other kind of markup, function
calls, and more, whereas a string is really just a _sequence of characters_ and
nothing else.
For example, the image function expects a path to an image file.
It would not make sense to pass, e.g., a paragraph of text or another image as
the image's path parameter. That's why only strings are allowed here.
On the contrary, strings work wherever content is expected because text is a
valid kind of content.
</div>
## Adding a bibliography { #bibliography }
As you write up your report, you need to back up some of your claims. You can
add a bibliography to your document with the [`bibliography`]($bibliography)
function. This function expects a path to a bibliography file.
Typst's native bibliography format is
[Hayagriva](https://github.com/typst/hayagriva/blob/main/docs/file-format.md),
but for compatibility you can also use BibLaTeX files. As your classmate has
already done a literature survey and sent you a `.bib` file, you'll use that
one. Upload the file through the file panel to access it in Typst.
Once the document contains a bibliography, you can start citing from it.
Citations use the same syntax as references to a label. As soon as you cite a
source for the first time, it will appear in the bibliography section of your
document. Typst supports different citation and bibliography styles. Consult the
[reference]($bibliography.style) for more details.
```example
= Methods
We follow the glacier melting models
established in @glacier-melt.
#bibliography("works.bib")
```
## Maths
After fleshing out the methods section, you move on to the meat of the document:
Your equations. Typst has built-in mathematical typesetting and uses its own
math notation. Let's start with a simple equation. We wrap it in `[$]` signs
to let Typst know it should expect a mathematical expression:
```example
The equation $Q = rho A v + C$
defines the glacial flow rate.
```
The equation is typeset inline, on the same line as the surrounding text. If you
want to have it on its own line instead, you should insert a single space at its
start and end:
```example
The flow rate of a glacier is
defined by the following equation:
$ Q = rho A v + C $
```
We can see that Typst displayed the single letters `Q`, `A`, `v`, and `C` as-is,
while it translated `rho` into a Greek letter. Math mode will always show single
letters verbatim. Multiple letters, however, are interpreted as symbols,
variables, or function names. To imply a multiplication between single letters,
put spaces between them.
If you want to have a variable that consists of multiple letters, you can
enclose it in quotes:
```example
The flow rate of a glacier is given
by the following equation:
$ Q = rho A v + "time offset" $
```
You'll also need a sum formula in your paper. We can use the `sum` symbol and
then specify the range of the summation in sub- and superscripts:
```example
Total displaced soil by glacial flow:
$ 7.32 beta +
sum_(i=0)^nabla Q_i / 2 $
```
To add a subscript to a symbol or variable, type a `_` character and then the
subscript. Similarly, use the `^` character for a superscript. If your
sub- or superscript consists of multiple things, you must enclose them
in round parentheses.
The above example also showed us how to insert fractions: Simply put a `/`
character between the numerator and the denominator and Typst will automatically
turn it into a fraction. Parentheses are smartly resolved, so you can enter your
expression as you would into a calculator and Typst will replace parenthesized
sub-expressions with the appropriate notation.
```example
Total displaced soil by glacial flow:
$ 7.32 beta +
sum_(i=0)^nabla
(Q_i (a_i - epsilon)) / 2 $
```
Not all math constructs have special syntax. Instead, we use functions, just
like the `image` function we have seen before. For example, to insert a column
vector, we can use the [`vec`]($math.vec) function. Within math mode, function
calls don't need to start with the `#` character.
```example
$ v := vec(x_1, x_2, x_3) $
```
Some functions are only available within math mode. For example, the
[`cal`]($math.cal) function is used to typeset calligraphic letters commonly
used for sets. The [math section of the reference]($category/math) provides a
complete list of all functions that math mode makes available.
One more thing: Many symbols, such as the arrow, have a lot of variants. You can
select among these variants by appending a dot and a modifier name to a symbol's
name:
```example
$ a arrow.squiggly b $
```
This notation is also available in markup mode, but the symbol name must be
preceded with `#sym.` there. See the [symbols section]($category/symbols/sym)
for a list of all available symbols.
## Review
You have now seen how to write a basic document in Typst. You learned how to
emphasize text, write lists, insert images, align content, and typeset
mathematical expressions. You also learned about Typst's functions. There are
many more kinds of content that Typst lets you insert into your document, such
as [tables]($table), [shapes]($category/visualize), and [code blocks]($raw). You
can peruse the [reference]($reference) to learn more about these and other
features.
For the moment, you have completed writing your report. You have already saved a
PDF by clicking on the download button in the top right corner. However, you
think the report could look a bit less plain. In the next section, we'll learn
how to customize the look of our document.
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/let-15.typ | typst | Other | // Error: 6-12 cannot destructure boolean
#let (a, b) = true
|
https://github.com/GolemT/BA-Template | https://raw.githubusercontent.com/GolemT/BA-Template/main/main.typ | typst | #import "template.typ": *
#import "acronyms.typ": Acronyms
#import "glossar.typ": Glossar
#show: project.with(
// Folgende Einstellungen einkommentieren und anpassen wenn benötigt.
// title: "",
authors: (
(name: "<NAME>", Matrikelnummer: "222033"),
(name: "<NAME>", Matrikelnummer: "222097"),
(name: "<NAME>", Matrikelnummer: "222024"),
(name: "<NAME>", Matrikelnummer: "222020"),
(name: "<NAME>", Matrikelnummer: "222049")
),
// date: "01.01.2024",
// logo: image("images/BA_Logo.jpg", width: auto),
// modul: [Theorie-Praxis-Anwendung II],
// sperrvermerk: false,
// vorwort: false,
// genderhinweis: true,
// abbildungsverzeichnis: true,
// tabellenverzeichnis: true,
// codeverzeichnis: true
// abkürzungsverzeichnis: true,
// glossar: true,
// literaturverzeichnis: true,
// Texte
// sperrvermerkText: [],
// vorwortText: [],
// genderhinweisText: [],
)
// Hier wird die wirkliche Ausarbeitung geschrieben
// Hinweis:
// Titel sehen besser aus wenn sie nacher (und vorher) einen #linebreak() einfügen
= Introduction
#include "subtext.typ"
== Different Objects
#acr("API") ist eine Abkürzung
#gls("API") ist eine Glossarverlinkung
#figure(
image("images/BA_Logo.jpg", width: 100pt),
caption: "Logo der Berufsakademie Rhein-Main"
)<Logo> //Hiermit wird ein aufrufbarer Link erstellt
#figure(
table(columns: 2fr, row-gutter: 1)[Das ist eine Tabelle],
caption: "Tabellenbeispiel"
)<tabelle> //Hiermit wird ein aufrufbarer Link erstellt
#figure(
caption: "Beispiel für Code",
```ts
const ReactComponent = () => {
return (
<div>
<h1>Hello World</h1>
</div>
);
};
export default ReactComponent;
```
)<code>
=== Contributions
#comment("This is a comment")
#todo("This is a ToDo")
#lorem(40)
= Linking Text
Hier wird nochmal #acr("API") aus dem Abkürzungsverzeichnis erwähnt.
Hier wird nochmal #gls("API") aus dem Glossar erwähnt
@Logo Zeigt das Logo der BA
@tabelle zeigt ein Beispiel einer Tabelle
@code zeigt ein Code Snippet
== Zitate
Hier ist ein Zitat @nissen_softwareagenten_2006.
#cite(<nissen_softwareagenten_2006>, form: "prose")) zitiert etwas im laufenden Text.
Hier ist ein zitat mit Link auf die Fußnote #footnote()[#cite(<nissen_softwareagenten_2006>)]
|
|
https://github.com/rem3-1415926/Typst_Thesis_Template | https://raw.githubusercontent.com/rem3-1415926/Typst_Thesis_Template/main/appendix/app3.typ | typst | MIT License |
= Appendix Three
Typst does not like having an A3 paper as last one with this template, so...
Here we go. |
https://github.com/ivaquero/lang-speeches | https://raw.githubusercontent.com/ivaquero/lang-speeches/main/es%20-%20javier%20milei%20-%20un.typ | typst | #import "@local/scibook:0.1.0": *
#show: doc => conf(
title: "El Debate General del 79 Período de Sesiones",
author: ("<NAME>"),
footer-cap: "",
header-cap: "Speech Collection",
outline-on: false,
lang: "en",
doc,
)
#tip[
Palabras del Presidente de la Nación <NAME>, en el debate general, del 79 Período de Sesiones, de la Asamblea General de Naciones Unidas, Nueva York, Estados Unidos
]
A las autoridades de la Naciones Unidas, a los representantes de los distintos países que le integran y a todos los ciudadanos del mundo que nos estén mirando, buenas tardes: para aquellos que no lo saben, yo no soy político, soy un economista, un economista liberal libertario, que jamás tuvo la ambición de hacer política y que fue honrado, con el cargo de presidente de la República Argentina, frente al fracaso estrepitoso, de más de un siglo de políticas colectivistas, que destruyeron nuestro país.
Este es mi primer discurso - frente a la Asamblea General de las Naciones Unidas - y quiero aprovechar para - con humildad - alertar a las distintas naciones del mundo sobre el camino que están transitando, hace décadas, y sobre el peligro que implica que esta organización fracase en cumplir su misión original.
No vengo aquí a decirle al mundo lo que tiene que hacer; vengo aquí a decirle al mundo, por un lado, lo que va a ocurrir si las Naciones Unidas continúan promoviendo las políticas colectivistas, que vienen promoviendo bajo el mandato de la agenda 2030, y, por el otro, cuáles son los valores que la nueva Argentina defiende. Quiero sí comenzar dando crédito, cuando el crédito corresponde. La organización de <NAME> nace del horror de la guerra más cruenta de la historia global con el objetivo principal de que nunca volviera a ocurrir. Para eso la organización grabó en piedra sus principios fundamentales, en la Declaración Universal de Derechos Humanos. Ahí se consignó un acuerdo básico, en torno a una máxima: que todos los seres humanos nacen libres e iguales, en dignidad y derechos.
Bajo la tutela de esta organización y la adopción de estas ideas - durante los últimos 70 años - la humanidad vivió el período de paz global, más largo de la historia, que coincidió – también - con el período de mayor crecimiento económico de la historia. Se creó un foro internacional, donde las naciones pudieran dirimir sus conflictos, a través de la cooperación, en vez de recurrir – instantáneamente - a las armas y se logró algo impensado: sentar de manera permanente a las cinco potencias más grandes del mundo, en una misma mesa; cada una con el mismo poder de veto, a pesar de tener intereses totalmente contrapuestos.
Todo esto no hizo que el flagelo de la guerra desapareciera, pero se logró - por ahora - que ningún conflicto escalara a proporciones mundiales. El resultado fue que pasamos de tener dos guerras mundiales, en menos de 40 años, que - en conjunto - se cobraron más de 120 millones de vidas, a tener 70 años consecutivos de relativa paz y estabilidad global, bajo el manto de un orden que permitió al mundo entero integrarse comercialmente, competir y prosperar. Porque donde entra el comercio, no entran las balas - decía Bastiat - porque el comercio garantiza la paz, la libertad garantiza el comercio y la igualdad ante la ley garantiza la libertad.
Se cumplió, en definitiva, lo que consignó el Profeta Isaías y se lee en el parque, cruzando la calle: "Dios juzgará entre las naciones y arbitrará por los muchos pueblos; forjarán sus espadas en rejas de arado y sus lanzas en podadoras. Nación no tomará espada contra Nación; nunca más conocerán la guerra".
Esto es lo que ha ocurrido – mayormente - bajo la tutela de las Naciones Unidas, en sus primeras décadas, y por eso, desde esta perspectiva, estamos hablando de un éxito destacable, en la historia de las naciones que no puede ser soslayado. Ahora bien - en algún momento - y como suele ocurrir con la mayoría de las estructuras burocráticas que los hombres creamos, esta organización dejó de velar por los principios esbozados en su declaración fundante y comenzó a mutar. Una organización que había sido pensada – esencialmente - como un escudo para proteger el Reino de los Hombres se transformó en un Leviatán de múltiples tentáculos, que pretende decidir no sólo qué debe hacer cada Estado-Nación, sino también cómo deben vivir todos los ciudadanos del mundo. Así es como pasamos de una organización que perseguía la paz; a una organización que le impone una agenda ideológica a sus miembros, sobre un sinfín de temas, que hacen a la vida del hombre en sociedad.
El modelo de Naciones Unidas, que había sido exitoso, cuyo origen podemos rastrear, en las ideas del presidente Wilson, que hablaba de la "sociedad de paz sin victoria" y que se fundaba en la cooperación de los Estados nación, ha sido abandonado; ha sido reemplazado por un modelo de gobierno supranacional de burócratas internacionales, que pretenden imponerles a los ciudadanos del mundo un modo de vida determinado. Lo que se está discutiendo - esta semana, aquí, en Nueva York, en la Cumbre del Futuro - no es otra cosa que la profundización de ese rumbo trágico que esta institución ha adoptado. Así, la profundización de un modelo que - en palabras del propio secretario de las Naciones Unidas - exige definir un nuevo contrato social a escala global, redoblando los compromisos, de la Agenda 2030.
Quiero ser claro en la posición de la agenda argentina: la Agenda 2030, aunque bien intencionada en sus metas, no es otra cosa que un programa de gobierno supranacional, de corte socialista, que pretende resolver los problemas de la modernidad con soluciones que atentan contra la soberanía de los Estados Nación y violentan el derecho a la vida, la libertad y la propiedad de las personas. Es una agenda, que pretende solucionar la pobreza, la desigualdad y la discriminación con legislación que lo único que hace es profundizarlas. Porque la historia del mundo demuestra que la única manera de garantizar la prosperidad es limitando el poder del monarca, garantizando la igualdad ante la ley y defendiendo el derecho a la vida, la libertad y la propiedad de los individuos.
Ha sido precisamente la adopción de esa agenda, que obedece a intereses privilegiados; el abandono de los principios - esbozados en la Declaración Universal de Derechos Humanos de las Naciones Unidas - lo que tergiversó el rol de esta institución y la puso en una senda equivocada. Así, hemos visto cómo una organización, que nació para defender los derechos del hombre, ha sido una de las principales propulsoras de la violación sistemática de la libertad, como - por ejemplo - con las cuarentenas a nivel global durante el año 2020, que deberían ser consideradas un delito de lesa humanidad.
En esta misma casa que dice defender los derechos humanos, han permitido el ingreso, al Consejo de Derechos Humanos, a dictaduras sangrientas como la de Cuba y Venezuela, sin el más mínimo reproche. En esta misma casa que dice defender los derechos de las mujeres, permiten el ingreso, al Comité para la Eliminación de la Discriminación contra la Mujer, a países que castigan a sus mujeres por mostrar la piel. En esta misma casa – sistemáticamente - se ha votado en contra del Estado de Israel, que es el único país de Medio Oriente, que defiende la democracia liberal, mientras se ha demostrado - en simultáneo - una incapacidad total de responder al flagelo del terrorismo. En el plano económico, se han promovido políticas colectivistas que atentan contra el crecimiento económico; violentan los derechos de propiedad y entorpecen el proceso económico natural, llegando a impedirle a los países más postergados del mundo gozar libremente de sus propios recursos para salir adelante. Regulaciones y prohibiciones impulsadas precisamente por los países que se desarrollaron, gracias a hacer lo mismo que hoy condenan. Se ha promovido, además, una relación tóxica entre las políticas de gobernanza global y los organismos de crédito internacional, exigiéndole a los países más relegados que comprometan recursos que no tienen en programas que no necesitan, convirtiéndolos en deudores perpetuos para promover la agenda de las elites globales.
Tampoco ha ayudado el tutelaje del Foro Económico Mundial, donde se promueven políticas ridículas con anteojeras maltusianas - como las políticas de "Emisión Cero" - que dañan, sobre todo, a los países pobres. A las políticas vinculadas a los derechos sexuales y reproductivos, cuando la tasa de natalidad de los países occidentales se está desplomando, anunciando un futuro sombrío para todos. Tampoco la organización ha cumplido satisfactoriamente su misión de defender la soberanía territorial de sus integrantes, como sabemos los argentinos de primera mano, en la relación con las Islas Malvinas. Y llegamos, incluso, a una situación en la que - el Consejo de Seguridad - que es el órgano más importante de esta casa, se ha desnaturalizado, porque el veto de sus integrantes permanentes se ha empezado a utilizar, en defensa de los intereses particulares de algunos.
Así estamos hoy, con una organización impotente en brindar soluciones a los verdaderos conflictos globales, como ha sido la aberrante invasión rusa a Ucrania, que ya le ha costado la vida a más de 300.000 personas, dejando un tendal de más de un millón de heridos en el proceso. Una organización que, en vez de enfrentar estos conflictos, invierte tiempo y esfuerzo en imponerle a los países pobres qué, cómo y deben producir, con quién vincularse, qué deben comer y en qué creer, como pretende dictar el presente Pacto del Futuro. Toda esta larga lista de errores y contradicciones no ha sido gratuita, sino que ha redundado en la pérdida de credibilidad, de las Naciones Unidas, ante los ciudadanos del mundo libre y en la desnaturalización de sus funciones.
Por eso, quiero hacer una advertencia: estamos ante un fin de ciclo. El colectivismo y el postureo moral, de la agenda woke, se han chocado con la realidad y ya no tienen soluciones creíbles para ofrecer a los problemas reales del mundo. De hecho, nunca las tuvieron. Si la Agenda 2030 fracasó - como reconocen sus propios promotores - la respuesta debería ser preguntarnos si no fue un programa mal concebido de inicio, aceptar esa realidad y cambiar el rumbo. No se puede pretender persistir en el error redoblando la apuesta de una agenda que ha fracasado. Siempre ocurre lo mismo con las ideas que vienen de la izquierda: diseñan un modelo acorde a lo que el ser humano debería ser - según ellos - y cuando los individuos – libremente - actúan de otra manera, no tienen mejor solución que restringir, reprimir y coartar su libertad.
Nosotros - en Argentina - ya hemos visto con nuestros propios ojos lo que hay al final de este camino de envidia y pasiones tristes: pobreza, embrutecimiento, anarquía y una ausencia fatal de libertad. Todavía estamos a tiempo de apartarnos de ese rumbo.
Quiero ser claro con algo para que no haya malas interpretaciones: la Argentina, que está viviendo un proceso profundo de cambio, en la actualidad, ha decidido abrazar las ideas de la libertad; esas ideas que dicen que todos los ciudadanos nacemos libres e iguales ante la ley, que tenemos derechos inalienables otorgados por el Creador, entre los que se encuentran el derecho a la vida, la libertad y la propiedad. Esos principios, que ordenan el proceso de cambio, que estamos llevando adelante, en la Argentina, son también los principios que guiarán nuestra conducta internacional, a partir de ahora.
Creemos en la defensa de la vida de todos; creemos en la defensa de la propiedad de todos; creemos en la libertad de expresión para todos; creemos en la libertad de culto para todos; creemos en la libertad de comercio para todos y creemos en los gobiernos limitados, todos ellos.
Y como en estos tiempos lo que sucede en un país impacta rápidamente en otros, creemos que todos los pueblos deben vivir libres de la tiranía y la opresión, ya sea que tome forma de opresión política, de esclavitud económica o de fanatismo religioso. Esa idea fundamental no debe quedarse en meras palabras; tiene que ser apoyada en los hechos, diplomáticamente, económicamente y materialmente, a través de la fuerza conjunta de todos los países, que defendemos la libertad.
Esta doctrina de la nueva Argentina no es - más ni menos - que la verdadera esencia de la Organización de las Naciones Unidas, es decir, la cooperación de Naciones Unidas en defensa de la libertad. Si las Naciones Unidas deciden retomar los principios que le dieron vida y volver a adaptar el rol para el que fue concebida, cuenten con el apoyo – inclaudicable - de la Argentina, en la lucha por la libertad.
Sepan, también, que la Argentina no acompañará ninguna política que implique la restricción de las libertades individuales, del comercio, ni la violación de los derechos naturales de los individuos, no importa quién la promueva ni cuánto consenso tenga esa institución. Por esta razón, queremos expresar – oficialmente - nuestro disenso sobre el Pacto del Futuro, firmado el día domingo, e invitamos a todas las naciones del mundo libre a que nos acompañen, no sólo en el disenso de este pacto, sino en la creación de una nueva agenda para esta noble institución: la agenda de la libertad.
A partir de este día, sepan que, la República Argentina, va a abandonar la posición de neutralidad histórica que nos caracterizó y va a estar a la vanguardia de la lucha en defensa de la libertad. Porque - como decía <NAME> - "aquellos que desean cosechar las bendiciones de la libertad deben - como hombres - soportar la fatiga de defenderla".
Que Dios bendiga a los argentinos y a todos los ciudadanos del mundo, y que las fuerzas del cielo nos acompañen.
¡Viva la libertad, carajo!. Muchas gracias.
|
|
https://github.com/Jollywatt/typst-fletcher | https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/docs/manual.typ | typst | MIT License | #import "@preview/tidy:0.2.0"
#import "/src/exports.typ" as fletcher: diagram, node, edge
#import "/docs/style.typ"
#set page(numbering: "1")
#set par(justify: true)
#show link: underline.with(stroke: 1pt + blue.lighten(70%))
// show references to headings as the heading title with a link
// not as "Section 1.2.3"
#show ref: it => {
if it.element.func() == heading {
link(it.target, it.element.body)
} else { it }
}
#let VERSION = toml("/typst.toml").package.version
// link to a specific parameter of a function
#let param(func, arg, full: false) = {
let func = func.text
let arg = arg.text
let l1 = style.fn-param-label(func, arg)
let l2 = style.fn-label(func)
if full {
[the #link(l1, raw(arg)) option of #link(l2, raw(func + "()"))]
} else {
link(l1, raw(arg))
}
}
#let the-param = param.with(full: true)
#let scope = (
fletcher: fletcher,
diagram: fletcher.diagram,
node: node,
edge: edge,
cetz: fletcher.cetz,
param: param,
the-param: the-param,
)
#let show-fns(file, only: none, exclude: (), level: 1, outline: false) = {
let module-doc = tidy.parse-module(read(file), scope: scope)
if only != none {
let ordered-fns = only.map(fn-name => {
module-doc.functions.find(fn => fn.name == fn-name)
})
module-doc.functions = ordered-fns
}
module-doc.functions = module-doc.functions.filter(fn => fn.name not in exclude)
tidy.show-module(
module-doc,
show-outline: outline,
sort-functions: none,
first-heading-level: level,
style: style,
)
}
#show heading.where(level: 1): it => it + v(0.5em)
#v(.2fr)
#align(center)[
#stack(
spacing: 14pt,
{
set text(1.3em)
fletcher.diagram(
edge-stroke: 1pt,
spacing: 27mm,
label-sep: 6pt,
node((0,1), $A$),
node((1,1), $B$),
edge((0,1), (1,1), $f$, ">>->"),
)
},
text(2.7em, `fletcher`),
[_(noun) a maker of arrows_],
)
#v(30pt)
A #link("https://typst.app/")[Typst] package for diagrams with lots of arrows,
built on top of #link("https://github.com/johannes-wolf/cetz")[CeTZ].
#emph[
Commutative diagrams,
flow charts,
state machines,
block diagrams...
]
#link("https://github.com/Jollywatt/typst-fletcher")[`github.com/Jollywatt/typst-fletcher`]
*Version #VERSION*
]
#set raw(lang: "typc")
#show raw.where(block: false): it => {
// if raw block is a function call, like `foo()`, make it a link
if it.text.match(regex("^[a-z-]+\(\)$")) == none { it }
else {
let l = label(it.text)
locate(loc => {
if query(l, loc).len() > 0 {
link(l, it)
} else {
it
}
})
}
}
#v(1fr)
#columns(2)[
#outline(
title: align(center, box(width: 100%)[Guide]),
indent: 1em,
target: selector(heading).before(<func-ref>, inclusive: false),
)
#colbreak()
#outline(
title: align(center, box(width: 100%)[Reference]),
indent: 1em,
target: selector(heading.where(level: 1)).or(heading.where(level: 2)).after(<func-ref>, inclusive: true),
)
]
#v(1fr)
// friends :)
#show "CeTZ": it => link("https://github.com/johannes-wolf/cetz", it)
#show "Touying": it => link("https://github.com/touying-typ/touying", it)
#let gallery-page = true
#if gallery-page [
#pagebreak()
#align(center)[
#diagram(
node-defocus: 0,
spacing: (1cm, 2cm),
edge-stroke: 1pt,
crossing-thickness: 5,
node-fill: luma(97%),
node-outset: 3pt,
node((0,0), "magma"),
node((-1,1), "semigroup"),
node(( 0,1), "unital magma"),
node((+1,1), "quasigroup"),
node((-1,2), "monoid"),
node(( 0,2), "inverse semigroup"),
node((+1,2), "loop"),
node(( 0,3), "group"),
{
let quad(a, b, label, paint, ..args) = {
paint = paint.darken(25%)
edge(a, b, text(paint, label), "-latex", stroke: paint, label-side: center, ..args)
}
quad((0,0), (-1,1), "Assoc", blue)
quad((0,1), (-1,2), "Assoc", blue, label-pos: 0.3)
quad((1,2), (0,3), "Assoc", blue)
quad((0,0), (0,1), "Id", red)
quad((-1,1), (-1,2), "Id", red, label-pos: 0.3)
quad((+1,1), (+1,2), "Id", red, label-pos: 0.3)
quad((0,2), (0,3), "Id", red)
quad((0,0), (1,1), "Div", yellow)
quad((-1,1), (0,2), "Div", yellow, label-pos: 0.3, "crossing")
quad((-1,2), (0,3), "Inv", green)
quad((0,1), (+1,2), "Inv", green, label-pos: 0.3)
quad((1,1), (0,2), "Assoc", blue, label-pos: 0.3, "crossing")
},
)
#v(1fr)
#diagram(
spacing: (40mm, 35mm),
node-defocus: 0,
axes: (ltr, btt),
{
let c(x, y, z) = (x + 0.5*z, y + 0.4*z)
let v000 = c(0, 0, 0)
node(v000, $P$)
node(c(1,0,0), $P$)
node(c(2,0,0), $X$)
node(c(0,1,0), $J P$)
node(c(1,1,0), $J P$)
node(c(2,1,0), $J X$)
node(c(0,0,1), $pi^*(T X times.circle T^* X)$)
node(c(1,0,1), $pi^*(T X times.circle T^* X)$)
node(c(2,0,1), $T X times.circle T^* X$)
node(c(0,1,1), $T P times.circle pi^* T^* X$)
node(c(1,1,1), $T P times.circle pi^* T^* X$)
node(c(2,1,1), $T_G P times.circle T^* X$)
// aways
edge(v000, c(0,0,1), $"Id"$, "->", bend: 0deg)
edge(c(1,0,0), c(1,0,1), $"Id"$, "->")
edge(c(2,0,0), c(2,0,1), $"Id"$, "->")
edge(c(0,1,0), c(0,1,1), $i_J$, "hook->")
edge(c(1,1,0), c(1,1,1), $i_J$, "hook->")
edge(c(2,1,0), c(2,1,1), $i_C$, "hook->")
// downs
edge(c(0,1,0), v000, $pi_J$, "=>", label-pos: 0.2)
edge(c(1,1,0), c(1,0,0), $pi_J$, "->", label-pos: 0.2)
edge(c(2,1,0), c(2,0,0), $pi_"CP"$, "->", label-pos: 0.2)
edge(c(0,1,1), c(0,0,1), $c_pi$, "..>", label-pos: 0.2)
edge(c(1,1,1), c(1,0,1), $c_pi$, "->", label-pos: 0.2)
edge(c(2,1,1), c(2,0,1), $overline(c)_pi$, "-||->", label-pos: 0.2)
// acrosses
edge(v000, c(1,0,0), $lambda_g$, "->")
edge(c(1,0,0), c(2,0,0), $pi^G=pi$, "->")
edge(c(0,0,1), c(1,0,1), $lambda_g times 1$, "..>", label-pos: 0.2)
edge(c(1,0,1), c(2,0,1), $pi^G$, "..>", label-pos: 0.2)
edge(c(0,1,0), c(1,1,0), $j lambda_g$, "->", label-pos: 0.7)
edge(c(0,1,1), c(1,1,1), $dif lambda_g times.circle (lambda_g times 1)$, "->")
edge(c(1,1,1), c(2,1,1), $pi^G$, "->")
edge(c(1,1,1), c(2,1,1), $Ω$, "<..>", bend: 40deg)
})
#v(1cm)
#v(1fr)
#{
set text(white, font: "Fira Sans")
let colors = (maroon, olive, eastern)
fletcher.diagram(
edge-stroke: 1pt,
node-corner-radius: 5pt,
edge-corner-radius: 8pt,
mark-scale: 80%,
node((0,0), [input], fill: colors.at(0)),
node((2,+1), [memory unit (MU)], fill: colors.at(1)),
node((2, 0), align(center)[arithmetic & logic \ unit (ALU)], fill: colors.at(1)),
node((2,-1), [control unit (CU)], fill: colors.at(1)),
node((4,0), [output], fill: colors.at(2), shape: fletcher.shapes.hexagon),
edge((0,0), "r,u,r", "-}>"),
edge((2,-1), "r,d,r", "-}>"),
edge((2,-1), "r,dd,l", "--}>"),
edge((2,1), "l", (1,-.5), marks: ((inherit: "}>", pos: 0.65, rev: false),)),
for i in range(-1, 2) {
edge((2,0), (2,1), "<{-}>", shift: i*5mm, bend: i*20deg)
},
edge((2,-1), (2,0), "<{-}>"),
)
}
]
]
#pagebreak()
= Usage examples
Avoid importing everything with `*` as many internal functions are also exported.
#raw(lang: "typ", "#import \"@preview/fletcher:" + VERSION + "\" as fletcher: diagram, node, edge")
#let code-example(src) = (
{
set text(.85em)
let code = src.text.replace(regex("(^|\n).*// hide\n|^[\s|\S]*// setup\n"), "")
box(raw(block: true, lang: src.lang, code)) // box to prevent pagebreaks
},
eval(
src.text,
mode: "markup",
scope: scope
),
)
#let code-example-row(src) = stack(
dir: ltr,
spacing: 1fr,
..code-example(src)
)
#table(
columns: (2fr, 1fr),
align: (top, center),
stroke: none,
inset: (x: 0pt, y: 7pt),
..code-example(```typ
// You can specify nodes in math-mode, separated by `&`:
#diagram($
G edge(f, ->) edge("d", pi, ->>) & im(f) \
G slash ker(f) edge("ur", tilde(f), "hook-->")
$)
```),
..code-example(```typ
// Or you can use code-mode, with variables, loops, etc:
#diagram(spacing: 2cm, {
let (A, B) = ((0,0), (1,0))
node(A, $cal(A)$)
node(B, $cal(B)$)
edge(A, B, $F$, "->", bend: +35deg)
edge(A, B, $G$, "->", bend: -35deg)
let h = 0.2
edge((.5,-h), (.5,+h), $alpha$, "=>")
})
```),
..code-example(```typ
#diagram(
spacing: (10mm, 5mm), // wide columns, narrow rows
node-stroke: 1pt, // outline node shapes
edge-stroke: 1pt, // make lines thicker
mark-scale: 60%, // make arrowheads smaller
edge((-2,0), "r,u,r", "-|>", $f$, label-side: left),
edge((-2,0), "r,d,r", "..|>", $g$),
node((0,-1), $F(s)$),
node((0,+1), $G(s)$),
node(enclose: ((0,-1), (0,+1)), stroke: teal, inset: 10pt,
snap: false), // prevent edges snapping to this node
edge((0,+1), (1,0), "..|>", corner: left),
edge((0,-1), (1,0), "-|>", corner: right),
node((1,0), text(white, $ plus.circle $), inset: 2pt, fill: black),
edge("-|>"),
)
```),
..code-example(```typ
An equation $f: A -> B$ and \
an inline diagram #diagram($A edge(->, text(#0.8em, f)) & B$).
```),
..code-example(```typ
#import fletcher.shapes: diamond
#diagram(
node-stroke: black + 0.5pt,
node-fill: gradient.radial(white, blue, center: (40%, 20%),
radius: 150%),
spacing: (10mm, 5mm),
node((0,0), [1], name: <1>, extrude: (0, -4)), // double stroke
node((1,0), [2], name: <2>, shape: diamond),
node((2,-1), [3a], name: <3a>),
node((2,+1), [3b], name: <3b>),
edge(<1>, <2>, [go], "->"),
edge(<2>, <3a>, "->", bend: -15deg),
edge(<2>, <3b>, "->", bend: +15deg),
edge(<3b>, <3b>, "->", bend: -130deg, label: [loop!]),
)
```)
)
#pagebreak()
= Diagrams
Diagrams created with `diagram()` are a collection of _nodes_ and _edges_ rendered on a CeTZ canvas.
== Elastic coordinates
Diagrams are laid out on a _flexible coordinate grid_, visible when #the-param[diagram][debug] is on.
When a node is placed, the rows and columns grow to accommodate the node's size, like a table.
By default, coordinates $(u, v)$ have $u$ going $arrow.r$ and $v$ going $arrow.b$.
This can be changed with #the-param[diagram][axes].
The #param[diagram][cell-size] option is the minimum row and column width, and #param[diagram][spacing] is the gutter between rows and columns.
#code-example-row(```typ
#let c = (orange, red, green, blue).map(x => x.lighten(50%))
#diagram(
debug: 1,
spacing: 10pt,
node-corner-radius: 3pt,
node((0,0), [a], fill: c.at(0), width: 10mm, height: 10mm),
node((1,0), [b], fill: c.at(1), width: 5mm, height: 5mm),
node((1,1), [c], fill: c.at(2), width: 20mm, height: 5mm),
node((0,2), [d], fill: c.at(3), width: 5mm, height: 10mm),
)
```)
So far, this is just like a table --- however, elastic coordinates can be _fractional_.
Notice how the column sizes change as the green node is gradually moved between columns:
#stack(
dir: ltr,
spacing: 1fr,
..(0, .25, .5, .75, 1).map(t => {
let c = (orange, red, green, blue).map(x => x.lighten(50%))
fletcher.diagram(
debug: 1,
spacing: 0mm,
node-corner-radius: 3pt,
node((0,0), [a], fill: c.at(0), width: 10mm, height: 10mm),
node((1,0), [b], fill: c.at(1), width: 5mm, height: 5mm),
node((t,1), $(#t, 1)$, fill: c.at(2), width: 20mm, height: 5mm),
node((0,2), [d], fill: c.at(3), width: 5mm, height: 10mm),
)
}),
)
== Absolute coordinates
As well as _elastic_ or $u v$ coordinates, which are row/column numbers, you can also use _absolute_ or $x y$ coordinates, which are physical lengths.
This lets you break away from flexible grid layouts.
#table(
columns: (1fr, 1fr),
stroke: none,
align: center,
..([Elastic coordinates, e.g., `(2, 1)`], [Physical coordinates, e.g., `(10mm, 5mm)`]).map(strong),
[Dimensionless, dependent on row/column sizes.],
[Lengths, independent of row/column sizes.],
[Placed objects can influence diagram layout.],
[Placed objects never affect diagram layout.],
)
Absolute coordinates aren't very useful on their own, but they may be used in combination with elastic coordinates, particularly with `(rel: (x, y), to: (u, v))`.
#code-example-row(```typ
#diagram(
node((0, 0), name: <origin>),
for θ in range(16).map(i => i/16*360deg) {
node((rel: (θ, 10mm), to: <origin>), $ * $, inset: 1pt)
edge(<origin>, "-")
}
)
```)
== All sorts of coordinates
You can also use any CeTZ-style coordinate expression, mixing and matching elastic and physical coordinates, e.g., relative `(rel: (1, 2))`, polar `(45deg, 1cm)`, interpolating `(<P>, 80%, <Q>)`, perpendicular `(<X>, "|-", <Y>)`, and so on.
However, support for CeTZ-style anchors is incomplete.
= Nodes
#link(label("node()"))[`node(coord, label, ..options)`]
Nodes are content centered at a particular coordinate.
They can be circular, rectangular, or any custom shape.
Nodes automatically fit to the size of their label (with an #param[node][inset]), but can also be given an exact `width`, `height`, or `radius`, as well as a #param[node][stroke] and #param[node][fill]. For example:
#code-example-row(```typ
#diagram(
debug: true, // show a coordinate grid
spacing: (5pt, 4em), // small column gaps, large row spacing
node((0,0), $f$),
node((1,0), $f$, stroke: 1pt),
node((2,0), $f$, stroke: blue, shape: rect),
node((3,0), $f$, stroke: 1pt, radius: 6mm, extrude: (0, 3)),
{
let b = blue.lighten(70%)
node((0,1), `xyz`, fill: b, )
let dash = (paint: blue, dash: "dashed")
node((1,1), `xyz`, stroke: dash, inset: 1em)
node((2,1), `xyz`, fill: b, stroke: blue, extrude: (0, -2))
node((3,1), `xyz`, fill: b, height: 5em, corner-radius: 5pt)
}
)
```)
== Node shapes
By default, nodes are circular or rectangular depending on the aspect ratio of their label.
The #param[node][shape] option accepts `rect`, `circle`, various shapes provided in the #link(<shapes>, `fletcher.shapes`) submodule, or a function.
#code-example-row(```typ
#import fletcher.shapes: pill, parallelogram, diamond, hexagon
#diagram(
node-fill: gradient.radial(white, blue, radius: 200%),
node-stroke: blue,
(
node((0,0), [Blue Pill], shape: pill),
node((1,0), [_Slant_], shape: parallelogram.with(angle: 20deg)),
node((0,1), [Choice], shape: diamond),
node((1,1), [Stop], shape: hexagon, extrude: (-3, 0), inset: 10pt),
).intersperse(edge("o--|>")).join()
)
```)
Custom node shapes may be implemented with CeTZ via #the-param[node][shape], but it is up to the user to support outline extrusion for custom shapes.
The predefined shapes are:
#table(
columns: (1fr,)*4,
gutter: 2mm,
stroke: none,
align: center + horizon,
..{
let colors = (
blue,
red,
orange,
teal,
olive,
green,
purple,
fuchsia,
eastern,
yellow,
aqua,
maroon,
)
dictionary(fletcher.shapes).pairs()
.filter(((key, value)) => type(value) != module)
.zip(colors)
.map((((name, shape), color)) => {
diagram(node((0,0), link(label(name + "()"), raw(name)), shape: shape,
fill: color.lighten(90%), stroke: color))
})
}
)
Shapes respect the #param[node][stroke], #param[node][fill], #param[node][width], #param[node][height], and #param[node][extrude] options of `edge()`.
== Node groups
Nodes are usually centered at a particular coordinate, but they can also #param[node][enclose] multiple centers.
When #the-param[node][enclose] is given, the node automatically resizes.
#code-example-row(```typ
#diagram(
node-stroke: 0.6pt,
node($Sigma$, enclose: ((1,1), (1,2)), // a node spanning multiple centers
inset: 10pt, stroke: teal, fill: teal.lighten(90%), name: <bar>),
node((2,1), [X]),
node((2,2), [Y]),
edge((1,1), "r", "->", snap-to: (<bar>, auto)),
edge((1,2), "r", "->", snap-to: (<bar>, auto)),
)
```)
You can also #param[node][enclose] other nodes by coordinate or #param[node][name] to create node groups:
#code-example-row(```typ
#diagram(
node-stroke: 0.6pt,
node-fill: white,
node((0,1), [X]),
edge("->-", bend: 40deg),
node((1,0), [Y], name: <y>),
node($Sigma$, enclose: ((0,1), <y>),
stroke: teal, fill: teal.lighten(90%),
snap: -1, // prioritise other nodes when auto-snapping
name: <group>),
edge(<group>, <z>, "->"),
node((2.5,0.5), [Z], name: <z>),
)
```)
= Edges
#link(label("edge()"))[`edge(..vertices, marks, label, ..options)`]
An edge connects two coordinates. If there is a node at the endpoint, the edge snaps to the nodes' bounding shape (after applying the node's #param[node][outset]). An edge can have a #param[edge][label], can #param[edge][bend] into an arc, and can have various arrow #param[edge][marks].
#code-example-row(```typ
#diagram(spacing: (12mm, 6mm), {
let (a, b, c, abc) = ((-1,0), (0,1), (1,0), (0,-1))
node(abc, $A times B times C$)
node(a, $A$)
node(b, $B$)
node(c, $C$)
edge(a, b, bend: -18deg, "dashed")
edge(c, b, bend: +18deg, "<-<<")
edge(a, abc, $a$)
edge(b, abc, "<=>")
edge(c, abc, $c$)
node((.6,3), [_just a thought..._])
edge(b, "..|>", corner: right)
})
```)
== Specifying edge vertices
The first few arguments given to `edge()` specify its #param[edge][vertices], of which there can be two or more.
=== Connecting to adjacent nodes
If an edge's first or last vertex is `auto`, the coordinate of the previous or next node is used, respectively, according to the order that nodes and edges are passed to `diagram()`.
A single vertex, as in `edge(to)`, is interpreted as `edge(auto, to)`.
Given no vertices, an edge connects the nearest nodes on either side.
#code-example-row(```typ
#diagram(
node((0,0), [London]),
edge("..|>", bend: 20deg),
edge("<|--", bend: -20deg),
node((1,1), [Paris]),
)
```)
Implicit coordinates can be handy for diagrams in math-mode:
#code-example-row(```typ
#diagram($ L edge("->", bend: #30deg) & P $)
```)
// However, don't forget you can also use variables in code-mode, which is a more explicit and flexible way to reduce repetition of coordinates.
// #code-example-row(```typ
// #diagram(node-fill: blue, {
// let (dep, arv) = ((0,0), (1,1))
// node(dep, text(white)[London])
// node(arv, text(white)[Paris])
// edge(dep, arv, "==>", bend: 40deg)
// })
// ```)
=== Relative coordinate shorthands
Like node positions, edge vertices may be specified by CeTZ-style coordinate expressions, combining elastic and physical coordinates.
Additionally, you may specify relative shorthand strings such as `"u"` for up or `"sw"` for south west. Any combination of
#strong[t]op/#strong[u]p/#strong[n]orth,
#strong[b]ottom/#strong[d]own/#strong[s]outh,
#strong[l]eft/#strong[w]est, and
#strong[r]ight/#strong[e]ast
are allowed. Together with implicit coordinates, this allows you to do things like:
#code-example-row(```typ
#diagram($ A edge("rr", ->, #[jump!], bend: #30deg) & B & C $)
```)
=== Named or labelled coordinates
Another way coordinates can be expressed is through node names.
Nodes can be given a #param[node][name], which is a label (not a string) identifying that node.
A label as an edge vertex is interpreted as the position of the node with that label.
#code-example-row(```typ
#diagram(
node((0,0), $frak(A)$, name: <A>),
node((1,0.5), $frak(B)$, name: <B>),
edge(<A>, <B>, "-->")
)
```)
Node names are _labels_ (instead of strings like in CeTZ) to disambiguate them from other positional string arguments.
Since they are not inserted into the document, they do not interfere with other labels.
== Edge types
There are three types of edges: `"line"`, `"arc"`, and `"poly"`.
All edges have at least two `vertices`, but `"poly"` edges can have more.
If unspecified, #param[edge][kind] is chosen based on #param[edge][bend] and the number of #param[edge][vertices].
#code-example-row(```typ
#diagram(
edge((0,0), (1,1), "->", `line`),
edge((2,0), (3,1), "->", bend: -30deg, `arc`),
edge((4,0), (4,1), (5,1), (6,0), "->", `poly`),
)
```)
All vertices except the first can be relative coordinate shorthands (see above), so that in the example above, the `"poly"` edge could also be written in these equivalent ways:
```typc
edge((4,0), (rel: (0,1)), (rel: (1,0)), (rel: (1,-1)), "->", `poly`)
edge((4,0), "d", "r", "ur", "->", `poly`) // using relative coordinate names
edge((4,0), "d,r,ur", "->", `poly`) // shorthand
```
Only the first and last #param[edge][vertices] of an edge automatically snap to nodes.
== Tweaking where edges connect
A node's #param[node][outset] controls how _close_ edges connect to the node's boundary.
To adjust _where_ along the boundary the edge connects, you can adjust the edge's end coordinates by a fractional amount.
#code-example-row(```typ
#diagram(
node-stroke: (thickness: .5pt, dash: "dashed"),
node((0,0), [no outset], outset: 0pt),
node((0,1), [big outset], outset: 10pt),
edge((0,0), (0,1)),
edge((-0.1,0), (-0.4,1), "-o", "wave"), // shifted with fractional coordinates
edge((0,0), (0,1), "=>", shift: 15pt), // shifted by a length
)
```)
Alternatively, #the-param[edge][shift] lets you shift edges sideways by an absolute length:
#block(breakable: false, code-example-row(```typ
#diagram($A edge(->, shift: #3pt) edge(<-, shift: #(-3pt)) & B$)
```))
By default, edges which are incident at an angle are automatically adjusted slightly, especially if the node is wide or tall.
Aesthetically, things can look more comfortable if edges don't all connect to the node's exact center, but instead spread out a bit.
Notice the (subtle) difference the figures below.
#align(center, stack(
dir: ltr,
spacing: 20%,
..(([With focus (default)], 0.2), ([Without defocus], 0)).map(((label, d)) => {
figure(
caption: label,
fletcher.diagram(
spacing: 10mm,
node-defocus: d,
node((0,0), $A times B times C$),
edge((-1,1)),
edge(( 0,1.5)),
edge((+1,1)),
)
)
})
))
The strength of this adjustment is controlled by #the-param[node][defocus] or #the-param[diagram][node-defocus].
= Marks and arrows
// Edges can be arrows.
Arrow marks can be specified like `edge(a, b, "-->")` or with #the-param[edge][marks].
Some mathematical arrow heads are supported, which match $arrow$, $arrow.double$, $arrow.triple$, $arrow.bar$, $arrow.twohead$, and $arrow.hook$ in the default font.
#align(center, fletcher.diagram(
debug: 0,
spacing: (14mm, 12mm),
{
for (i, str) in (
"->",
"=>",
"==>",
"|->",
"->>",
"hook->",
).enumerate() {
for j in range(2) {
let label = if j == 0 { raw("\""+str+"\"") }
edge((2*i, j), (2*i + 1, j), str, bend: 50deg*j, stroke: 0.9pt,
label: label, label-sep: 1em)
}
}
}))
A few other marks are provided, and all marks can be placed anywhere along the edge.
#align(center, fletcher.diagram(
debug: 0,
spacing: (14mm, 12mm),
{
for (i, str) in (
">>-->",
"||-/-|>",
"o..O",
"hook'-x-}>",
"-*-harpoon"
).enumerate() {
let label = raw("\""+str+"\"")
edge((2*i, 0), (2*i + 1, 0), str, stroke: 0.9pt,
label: label, label-sep: 1em)
}
}))
All the built-in marks (see @all-marks) are defined in the state variable `fletcher.MARKS`, which you may access with `context fletcher.MARKS.get()`.
You add or tweak mark styles by modifying `fletcher.MARKS`, as described in @mark-objects.
#context [#figure(
caption: [Default marks by name. Properties such to size, angle, spacing, or fill can be adjusted.],
gap: 1em,
table(
columns: (1fr,)*6,
stroke: none,
..fletcher.MARKS.get().pairs().map(((k, v)) => [
#set align(center)
#raw(lang: none, k) \
#diagram(spacing: 18mm, edge(stroke: 1pt, marks: (v, v)))
]),
)
) <all-marks>]
== Custom marks
While shorthands like `"|=>"` exist for specifying marks and stroke styles, finer control is possible.
Marks can be specified by passing an array of _mark objects_ to #the-param[edge][marks].
For example:
#code-example-row(```typ
#diagram(
edge-stroke: 1.5pt,
spacing: 25mm,
edge((0,1), (-0.1,0), bend: -8deg, marks: (
(inherit: ">>", size: 6, delta: 70deg, sharpness: 65deg),
(inherit: "head", rev: true, pos: 0.8, sharpness: 0deg, size: 17),
(inherit: "bar", size: 1, pos: 0.3),
(inherit: "solid", size: 12, rev: true, stealth: 0.1, fill: red.mix(purple)),
), stroke: green.darken(50%)),
)
```)
In fact, shorthands like `"|=>"` are expanded with `interpret-marks-arg()` into a form more like the example above.
More precisely, `edge(from, to, "|=>")` is equivalent to:
```typc
context edge(from, to, ..fletcher.interpret-marks-arg("|=>"))
```
If you want to explore the internals of mark objects, you might find it handy to inspect the output of `context fletcher.interpret-marks-arg(..)` with various mark shorthands as input.
=== Mark objects <mark-objects>
A _mark object_ is a dictionary with, at the very least, a `draw` entry containing the CeTZ objects to be drawn.
These CeTZ objects are translated and scaled to fit the edge; the mark's center should be at the origin, and the stroke's thickness is defined as the unit length.
For example, here is a basic circle mark:
#code-example-row(```typ
#import cetz.draw
#let my-mark = (
draw: draw.circle((0,0), radius: 2, fill: none)
)
#diagram(
edge((0,0), (1,0), stroke: 1pt, marks: (my-mark, my-mark), bend: 30deg),
edge((0,1), (1,1), stroke: 3pt + orange, marks: (none, my-mark)),
)
```)
A mark object can contain arbitrary parameters, which may depend on parameters defined earlier by being written as a _function_ of the mark object.
For example, the mark above could also be written as:
```typ
#let my-mark = (
size: 2,
draw: mark => draw.circle((0,0), radius: mark.size, fill: none)
)
```
This form makes it easier to change the size without modifying the `draw` function, for example:
#code-example-row(```typ
#import cetz.draw
#let my-mark = (
size: 2,
draw: mark => draw.circle((0,0), radius: mark.size, fill: none)
) // setup
#diagram(edge(stroke: 3pt, marks: (my-mark + (size: 4), my-mark)))
```)
Lastly, mark objects may _inherit_ properties from other marks in `fletcher.MARKS` by containing an `inherit` entry, for example:
#code-example-row(```typ
#let my-mark = (
inherit: "stealth", // base mark on `fletcher.MARKS.stealth`
fill: red,
stroke: none,
extrude: (0, -3),
)
#diagram(edge("rr", stroke: 2pt, marks: (my-mark, my-mark + (fill: blue))))
```)
Internally, marks are passed to `resolve-mark()`, which ensures all entries are evaluated to final values.
=== Special mark properties
A mark object may contain any properties, but some have special functions.
#{
show table.cell.where(y: 0): emph
set par(justify: false)
let little-mark(..args) = diagram(spacing: 5mm, edge(..args, stroke: 0.5pt))
table(
columns: 3,
stroke: (x: none),
table.header([Name], [Description], [Default]),
`inherit`,
[
The name of a mark in `fletcher.MARKS` to inherit properties from.
This can be used to make mark aliases, for instance, `"<"` is defined as `(inherit: "head", rev: true)`.
],
none,
`draw`,
[
As described above, this contains the final CeTZ objects to be drawn. Objects should be centered at $(0,0)$ and be scaled so that one unit is the stroke thickness.
The default `stroke` and `fill` is inherited from the edge's style.
],
none,
`pos`,
[
Location of the mark along the edge, from `0` (start) to `1` (end).
],
`auto`,
[`fill`\ `stroke`],
[
The default fill and stroke styles for CeTZ objects returned by `draw`.
If `none`, polygons will not be filled/stroked by default, and if `auto`, the style is inherited from the edge's stroke style.
],
`auto`,
`rev`,
[
Whether to reverse the mark so it points backwards.
],
`false`,
`flip`,
[
Whether to reflect the mark across the edge; the difference between
#diagram(spacing: 8mm, edge("hook-", stroke: 1pt))
and
#diagram(spacing: 8mm, edge("hook'-", stroke: 1pt)), for example.
A suffix `'` in the name, such as `"hook'"`, results in a flip.
],
`false`,
`scale`,
[
Overall scaling factor. See also #the-param[edge][mark-scale].
],
`100%`,
`extrude`,
[
Whether to duplicate the mark and draw it offset at each extrude position.
For example, `(inherit: "head", extrude: (-5, 0, 5))` looks like
#diagram(spacing: 8mm, edge(marks: (none, (inherit: "head", extrude: (-5, 0, 5))), stroke: .7pt)).
],
`(0,)`,
[`tip-origin`\ `tail-origin`],
[
These two properties control the $x$ coordinate of the point of the mark, relative to $(0, 0)$. If the mark is acting as a tip (#little-mark("->") or #little-mark("<-")) then `tip-origin` applies, and `tail-origin` applies when the mark is a tail (#little-mark("-<") or #little-mark(">-")).
See `mark-debug()`.
],
`0`,
[`tip-end`\ `tail-end`],
[
These control the $x$ coordinate at which the edge's stroke terminates, relative to $(0, 0)$.
See `mark-debug()`.
],
`0`,
`cap-offset`,
[
A function `(mark, y) => x` returning the $x$ coordinate at which the edge's stroke terminates relative to `tip-end` or `tail-end`, as a function of the $y$ coordinate.
This is relevant for #param[edge][extrude]d edges.
See `cap-offset()`.
],
none,
)
}
The last few properties control the fine behaviours of how marks connect to the target point and to the edge's stroke.
Briefly, a mark has four possibly-distinct center points.
It is easier to show than to tell:
#context grid(
columns: (1fr, 1fr),
align: center + horizon,
fletcher.mark-debug((inherit: "}>", fill: none), show-offsets: false),
fletcher.mark-demo((inherit: "}>", fill: none)),
)
See `mark-debug()` and `cap-offset()` for details.
=== Detailed example
As a complete example, here is the implementation of a straight arrowhead in ```plain src/default-marks.typ```:
#code-example-row(```typ
#import cetz.draw
#let straight = (
size: 8,
sharpness: 20deg,
tip-origin: mark => 0.5/calc.sin(mark.sharpness),
tail-origin: mark => -mark.size*calc.cos(mark.sharpness),
fill: none,
draw: mark => {
draw.line(
(180deg + mark.sharpness, mark.size), // polar cetz coordinate
(0, 0),
(180deg - mark.sharpness, mark.size),
)
},
cap-offset: (mark, y) => calc.tan(mark.sharpness + 90deg)*calc.abs(y),
)
#set align(center)
#fletcher.mark-debug(straight)
#fletcher.mark-demo(straight)
```)
== Custom mark shorthands <custom-marks>
While you can pass custom mark objects directly to #the-param[edge][marks], this can get annoying if you use the same mark often.
In these cases, you can define your own mark shorthands.
Mark shorthands such as `"hook->"` search the state variable `fletcher.MARKS` for defined mark names.
#code-example-row(```typ
#context fletcher.MARKS.get().at(">")
```)
With a bit of care, you can modify the `MARKS` state like so:
#code-example-row(```typ
Original marks:
#diagram(spacing: 2cm, edge("<->", stroke: 1pt))
#fletcher.MARKS.update(m => m + (
"<": (inherit: "stealth", rev: true),
">": (inherit: "stealth", rev: false),
"multi": (
inherit: "straight",
draw: mark => fletcher.cetz.draw.line(
(0, +mark.size*calc.sin(mark.sharpness)),
(-mark.size*calc.cos(mark.sharpness), 0),
(0, -mark.size*calc.sin(mark.sharpness)),
),
),
))
Updated marks:
#diagram(spacing: 2cm, edge("multi->-multi", stroke: 1pt + eastern))
```)
Here, we redefined which mark style the `"<"` and `">"` shorthands refer to, and added an entirely new mark style with the shorthand `"multi"`.
Finally, I will restore the default state so as not to affect the rest of this manual:
#code-example-row(```typ
#fletcher.MARKS.update(fletcher.DEFAULT_MARKS) // restore to built-in mark styles
```)
= CeTZ integration
Fletcher's drawing capabilities are deliberately restricted to a few simple building blocks.
However, an escape hatch is provided with #the-param[diagram][render] so you can intercept diagram data and draw things using CeTZ directly.
== Bézier edges
Here is an example of how you might hack together a Bézier edge using the same functions that `fletcher` uses internally to anchor edges to nodes:
#code-example-row(```typ
#diagram(
node((0,1), $A$, stroke: 1pt, shape: fletcher.shapes.diamond),
node((2,0), [Bézier], fill: purple.lighten(80%)),
render: (grid, nodes, edges, options) => {
// cetz is also exported as fletcher.cetz
cetz.canvas({
// this is the default code to render the diagram
fletcher.draw-diagram(grid, nodes, edges, debug: options.debug)
// retrieve node data by coordinates
let n1 = fletcher.find-node-at(nodes, (0,1))
let n2 = fletcher.find-node-at(nodes, (2,0))
let out-angle = 45deg
let in-angle = -110deg
fletcher.get-node-anchor(n1, out-angle, p1 => {
fletcher.get-node-anchor(n2, in-angle, p2 => {
// make some control points
let c1 = (to: p1, rel: (out-angle, 10mm))
let c2 = (to: p2, rel: (in-angle, 20mm))
cetz.draw.bezier(
p1, p2, c1, c2,
mark: (end: ">") // cetz-style mark
)
})
})
})
}
)
```)
= Touying integration
You can create incrementally-revealed diagrams in Touying presentation slides by defining the following `touying-reducer`:
#text(.85em, ```typ
#import "@preview/touying:0.2.1": *
#let diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)
#let (init, slide) = utils.methods(s)
#show: init
#slide[
Slide with animated figure:
#diagram(
node-stroke: .1em,
node-fill: gradient.radial(blue.lighten(80%), blue,
center: (30%, 20%), radius: 80%),
spacing: 4em,
edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center),
node((0,0), `reading`, radius: 2em),
pause,
edge((0,0), (0,0), `read()`, "--|>", bend: 130deg),
edge(`read()`, "-|>"),
node((1,0), `eof`, radius: 2em),
pause,
edge(`close()`, "-|>"),
node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)),
edge((0,0), (2,0), `close()`, "-|>", bend: -40deg),
)
]
```)
#pagebreak(weak: true)
#align(center, text(2em)[*Reference*])
#v(1em)
= Main functions <func-ref>
#show-fns("/src/diagram.typ", only: ("diagram",))
#show-fns("/src/node.typ", only: ("node",))
#show-fns("/src/edge.typ", only: ("edge",))
= Behind the scenes
// == `edge.typ`
// #show-fns("/src/edge.typ", level: 2, outline: true, exclude: "edge")
== `marks.typ`
The default marks are defined in the `fletcher.MARKS` dictionary with keys:
#context fletcher.MARKS.get().keys().map(raw).join(last: [, and ])[, ].
#show-fns("/src/marks.typ", level: 2, outline: true)
== `shapes.typ` <shapes>
To use built-in shapes in a diagram, import them with:
```typ
#import fletcher: shapes
#diagram(node([Hello], stroke: 1pt, shape: shapes.hexagon))
```
or:
```typ
#import fletcher.shapes: hexagon
#diagram(node([Hello], stroke: 1pt, shape: hexagon))
```
To set a shape parameter, use `shape.with(..)`, for example `hexagon.with(angle: 45deg)`.
Shapes respect the #param[node][stroke], #param[node][fill], #param[node][width], #param[node][height], and #param[node][extrude] options of `edge()`.
#show-fns("/src/shapes.typ", level: 2, outline: true)
== `coords.typ`
#show-fns("/src/coords.typ", level: 2, outline: true)
== `diagram.typ`
#show-fns("/src/diagram.typ", level: 2, outline: true, exclude: ("diagram",))
== `node.typ`
#show-fns("/src/node.typ", level: 2, outline: true, exclude: ("node",))
== `edge.typ`
#show-fns("/src/edge.typ", level: 2, outline: true, exclude: ("edge",))
== `draw.typ`
#show-fns("/src/draw.typ", level: 2, outline: true)
== `utils.typ`
#show-fns("/src/utils.typ", level: 2, outline: true)
|
https://github.com/alberto-lazari/computer-science | https://raw.githubusercontent.com/alberto-lazari/computer-science/main/advanced-topics-cs/quantum-algorithms/common.typ | typst | #let tensor = $times.circle$
#let phi = $phi.alt$
#let jstr = $arrow(j)$
#let lstr = $arrow(l)$
#let bra(var) = $angle.l #h(.5pt) #var #h(.5pt)|$
#let ket(var) = $|#h(.5pt) #var #h(.5pt) angle.r$
#let inner(x, y) = $angle.l #x #h(.5pt)|#h(.5pt) #y angle.r$
|
|
https://github.com/typst-doc-cn/tutorial | https://raw.githubusercontent.com/typst-doc-cn/tutorial/main/typ/book/lib.typ | typst | Apache License 2.0 |
// #import "@preview/typst-ts-variables:0.1.0": page-width, target
#import "variables.typ": page-width, target
// export typst.ts variables again, don't import typst-ts-variables directly
#let get-page-width() = page-width
#let target = target
#let is-web-target() = target.starts-with("web")
#let is-pdf-target() = target.starts-with("pdf")
#let _labeled-meta(label) = locate(loc => {
let res = query(label, loc)
if res.len() <= 0 {
none
} else if res.len() == 1 {
res.at(0).value
} else {
res.map(it => it.value)
}
})
#let book-meta-state = state("book-meta", none)
/// helper function to get (and print/use) the final book metadata
#let get-book-meta() = _labeled-meta(<typst-book-book-meta>)
/// helper function to get (and print/use) the final build metadata
#let get-build-meta() = _labeled-meta(<typst-book-build-meta>)
/// Book metadata in summary.typ
///
/// title: The title of the book
/// authors: The author(s) of the book
/// description: A description for the book, which is added as meta information in the
/// html <head> of each page
/// repository: The github repository for the book
/// repository-edit: The github repository editing template for the book
/// example: `https://github.com/Me/Book/edit/main/path/to/book/{path}`
/// language: The main language of the book, which is used as a language attribute
/// <html lang="en"> for example.
/// summary: Content summary of the book
#let book-meta(
title: "",
description: "",
repository: "",
repository-edit: "",
authors: (),
language: "",
summary: none,
) = [
#metadata((
kind: "book",
title: title,
description: description,
repository: repository,
repository_edit: repository-edit,
authors: authors,
language: language,
summary: summary,
)) <typst-book-raw-book-meta>
]
/// Build metadata in summary.typ
/// dest-dir: The directory to put the rendered book in. By default this is book/ in
/// the book's root directory. This can overridden with the --dest-dir CLI
/// option.
#let build-meta(dest-dir: "") = [
#metadata(("dest-dir": dest-dir)) <typst-book-build-meta>
]
#let link2page = state("typst-book-link2page", (:))
#let encode-url-component(s) = {
let prev = false
for (idx, c) in s.codepoints().enumerate() {
if c.starts-with(regex("[a-zA-Z]")) {
if prev {
prev = false
"-"
}
c
} else {
prev = true
if idx != 0 {
"-"
}
str(c.to-unicode())
}
}
}
#let cross-link-path-label(path) = {
assert(path.starts-with("/"), message: "absolute positioning required")
encode-url-component(path)
}
/// Cross link support
#let cross-link(path, reference: none, content) = {
let path-lbl = cross-link-path-label(path)
if reference != none {
assert(type(reference) == label, message: "invalid reference")
}
assert(content != none, message: "invalid label content")
locate(loc => {
if reference != none {
let result = query(reference, loc)
// whether it is internal link
if result.len() > 0 {
link(reference, content)
return
}
}
let link-result = link2page.final(loc)
if path-lbl in link-result {
link((page: link-result.at(path-lbl), x: 0pt, y: 0pt), content)
return
}
// assert(read(path) != none, message: "no such file")
let lnk = {
"cross-link://jump?path-label="
path-lbl
if reference != none {
"&label="
encode-url-component(str(reference))
}
}
link(lnk, content)
})
}
// Collect text content of element recursively into a single string
// https://discord.com/channels/1054443721975922748/1088371919725793360/1138586827708702810
#let plain-text(it) = {
if type(it) == str {
it
} else if it == [ ] {
" "
} else if it.has("children") {
it.children.map(plain-text).filter(t => type(t) == str).join()
} else if it.has("body") {
plain-text(it.body)
} else if it.has("text") {
it.text
} else if it.func() == smartquote {
if it.double {
"\""
} else {
"'"
}
} else {
none
}
}
#let _store-content(ct) = if type(ct) == "string" {
(kind: "plain-text", content: ct)
} else if ct.func() == text {
(kind: "plain-text", content: ct.text)
} else {
// Unreliable since v0.8.0
// ( kind: "raw", content: ct )
(kind: "plain-text", content: plain-text(ct))
}
/// Represents a chapter in the book
/// link: path relative (from summary.typ) to the chapter
/// title: title of the chapter
/// section: manually specify the section number of the chapter
///
/// Example:
/// ```typ
/// #chapter("chapter1.typ")["Chapter 1"]
/// #chapter("chapter2.typ", section: "1.2")["Chapter 1.2"]
/// ```
#let chapter(link, title, section: auto) = metadata((
kind: "chapter",
link: link,
section: section,
title: _store-content(title),
))
/// Represents a prefix/suffix chapter in the book
/// Example:
/// ```typ
/// #prefix-chapter("chapter-pre.typ")["Title of Prefix Chapter"]
/// #prefix-chapter("chapter-pre2.typ")["Title of Prefix Chapter 2"]
/// // other chapters
/// #suffix-chapter("chapter-suf.typ")["Title of Suffix Chapter"]
/// ```
#let prefix-chapter(link, title) = chapter(link, title, section: none)
#let suffix-chapter(link, title) = chapter(link, title, section: none)
/// Represents a divider in the summary sidebar
#let divider = metadata((kind: "divider"))
/// Internal method to convert summary content nodes
#let _convert-summary(elem) = {
// The entry point of the metadata nodes
if metadata == elem.func() {
// convert any metadata elem to its value
let node = elem.value
// Convert the summary content inside the book elem
if node.at("kind") == "book" {
let summary = node.at("summary")
node.insert("summary", _convert-summary(summary))
}
return node
}
// convert a heading element to a part elem
if heading == elem.func() {
return (kind: "part", content: elem, title: _store-content(elem.body))
}
// convert a (possibly nested) list to a part elem
if list.item == elem.func() {
// convert children first
let maybe-children = _convert-summary(elem.body)
if type(maybe-children) == "array" {
// if the list-item has children, then process subchapters
if maybe-children.len() <= 0 {
panic("invalid list-item, no maybe-children")
}
// the first child is the chapter itself
let node = maybe-children.at(0)
// the rest are subchapters
let rest = maybe-children.slice(1)
node.insert("sub", rest)
return node
} else {
// no children, return the list-item itself
return maybe-children
}
}
// convert a sequence of elements to a list of node
if [].func() == elem.func() {
return elem.children.map(_convert-summary).filter(it => it != none)
}
// All of rest are invalid
none
}
/// Internal method to number sections
/// meta: array of summary nodes
/// base: array of section number
#let _numbering-sections(meta, base: ()) = {
// incremental section counter used in loop
let cnt = 1
for c in meta {
// skip non-chapter nodes or nodes without section number
if c.at("kind") != "chapter" or c.at("section") == none {
(c,)
continue
}
// default incremental section
let idx = cnt
cnt += 1
let num = base + (idx,)
// c.insert("auto-section", num)
let user-specified = c.at("section")
// c.insert("raw-section", repr(user-specified))
// update section number if user specified it by str or array
if user-specified != none and user-specified != auto {
// update number
num = if type(user-specified) == str {
// e.g. "1.2.3" -> (1, 2, 3)
user-specified.split(".").map(int)
} else if type(user-specified) == array {
for n in user-specified {
assert(
type(n) == int,
message: "invalid type of section counter specified " + repr(user-specified) + ", want number in array",
)
}
// e.g. (1, 2, 3)
user-specified
} else {
panic("invalid type of manual section specified " + repr(user-specified) + ", want str or array")
}
// update cnt
cnt = num.last() + 1
}
// update section number
let auto-num = num.map(str).join(".")
c.at("section") = auto-num
// update sub chapters
if "sub" in c {
c.sub = _numbering-sections(c.at("sub"), base: num)
}
(c,)
}
}
/// show template for a book file
/// Example:
/// ```typ
/// #show: book
/// ```
#let book(content) = {
// set page(width: 300pt, margin: (left: 10pt, right: 10pt, rest: 0pt))
[#metadata(toml("typst.toml")) <typst-book-internal-package-meta>]
locate(loc => {
let data = query(<typst-book-raw-book-meta>, loc).at(0)
let meta = _convert-summary(data)
meta.at("summary") = _numbering-sections(meta.at("summary"))
book-meta-state.update(meta)
[
#metadata(meta) <typst-book-book-meta>
]
})
// #let sidebar-gen(node) = {
// node
// }
// #sidebar-gen(converted)
// #get-book-meta()
content
}
#let external-book(spec: none) = {
place(
hide[
#spec
],
)
}
#let visit-summary(x, visit) = {
if x.at("kind") == "chapter" {
let v = none
let link = x.at("link")
if link != none {
let chapter-content = visit.at("inc")(link)
if chapter-content.children.len() > 0 {
let t = chapter-content.children.at(0)
if t.func() == [].func() and t.children.len() == 0 {
chapter-content = chapter-content.children.slice(1).sum()
}
}
if "children" in chapter-content.fields() and chapter-content.children.len() > 0 {
let t = chapter-content.children.at(0)
if t.func() == parbreak {
chapter-content = chapter-content.children.slice(1).sum()
}
}
show: it => {
let abs-link = cross-link-path-label("/" + link)
locate(loc => {
link2page.update(it => {
it.insert(abs-link, loc.page())
it
})
})
it
}
visit.at("chapter")(chapter-content)
}
if "sub" in x and x.sub != none {
x.sub.map(it => visit-summary(it, visit)).sum()
}
} else if x.at("kind") == "part" {
// todo: more than plain text
visit.at("part")(x.at("title").at("content"))
} else {
// repr(x)
}
}
|
https://github.com/werifu/HUST-typst-template | https://raw.githubusercontent.com/werifu/HUST-typst-template/main/cs-template.typ | typst | MIT License | #import "@preview/lovelace:0.2.0": *
#let huawenkaiti = ("Times New Roman", "STKaiti")
#let heiti = ("Times New Roman", "Heiti SC", "Heiti TC", "SimHei")
#let songti = ("Times New Roman", "Songti SC", "Songti TC", "SimSun")
#let zhongsong = ("STZhongsong", "Times New Roman")
#let bib_cite(..names) = {
for name in names.pos() {
cite(name)
}
}
#let indent() = {
box(width: 2em)
}
#let indent_par(body) = {
box(width: 1.8em)
body
}
// 设置编号 (引用时, 需要使用标签)
#let _set_numbering(body) ={
import "@preview/i-figured:0.2.4"
set heading(numbering: "1.1.1")
show heading: i-figured.reset-counters
show figure: i-figured.show-figure.with(numbering: "1-1")
show math.equation: i-figured.show-equation.with(numbering: "(1-1)")
body
}
// 设置图表
#let _set_figure(body) ={
show figure.where(kind: image): set figure(supplement: [图])
show figure.where(kind: table): set figure(supplement: [表])
show figure.where(kind: table): set figure.caption(position: top)
// 使用正确的编号与图表标题字体及分隔符
show figure.caption: set text(font: heiti)
set figure.caption(separator: " ")
set heading(supplement: [节])
set math.equation(supplement: [公式])
body
}
#let empty_par() = {
v(-1em)
box()
}
// inspired from https://github.com/lucifer1004/pkuthss-typst.git
#let chinese_outline() = {
align(center)[
#text(font: heiti, size: 18pt, "目 录")
]
set text(font: songti, size: 12pt)
// 临时取消目录的首行缩进
set par(leading: 1.24em, first-line-indent: 0pt)
locate(loc => {
let elements = query(heading.where(outlined: true), loc)
for el in elements {
// 计算机学院要求不出现三级以上标题
if el.level > 2 {
continue
}
// 是否有 el 位于前面,前面的目录中用拉丁数字,后面的用阿拉伯数字
let before_toc = query(heading.where(outlined: true).before(loc), loc).find((one) => {one.body == el.body}) != none
let page_num = if before_toc {
numbering("I", counter(page).at(el.location()).first())
} else {
counter(page).at(el.location()).first()
}
link(el.location())[#{
// acknoledgement has no numbering
let chapt_num = if el.numbering != none {
numbering(el.numbering, ..counter(heading).at(el.location()))
} else {none}
if el.level == 1 {
set text(weight: "black")
if chapt_num == none {} else {
chapt_num
" "
}
el.body
} else {
chapt_num
" "
el.body
}
}]
// 填充 ......
box(width: 1fr, h(0.5em) + box(width: 1fr, repeat[.]) + h(0.5em))
[#page_num]
linebreak()
}
})
}
// 原创性声明和授权书
#let declaration(anonymous: false) = {
set text(font: songti, 12pt)
v(5em)
align(center)[
#text(font: heiti, size: 18pt)[
学位论文原创性声明
]
]
text(font: songti, size: 12pt)[
#set par(justify: false, leading: 1.24em, first-line-indent: 2em)
本人郑重声明:所呈交的论文是本人在导师的指导下独立进行研究所取得的 研究成果。除了文中特别加以标注引用的内容外,本论文不包括任何其他个人或集体已经发表或撰写的成果作品。本人完全意识到本声明的法律后果由本人承担。
]
v(2em)
align(right)[
#if not anonymous {
text("作者签名: 年 月 日")
} else {
text("作者签名:██████████年███月███日")
}
]
v(6em)
align(center)[
#text(font: heiti, size: 18pt)[
学位论文版权使用授权书
]
]
text(font: songti, size: 12pt)[
#set par(justify: false, leading: 1.24em, first-line-indent: 2em)
#if not anonymous [
本学位论文作者完全了解学校有关保障、使用学位论文的规定,同意学校保留并向有关学位论文管理部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。本人授权省级优秀学士论文评选机构将本学位论文的全部或部分内容编入有关数据进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
] else [
本学位论文作者完全了解学校有关保障、使用学位论文的规定,同意学校保留并向有关学位论文管理部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。本人授权█████████████将本学位论文的全部或部分内容编入有关数据进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
]
学位论文属于 1、保密 □,在#h(3em)年解密后适用本授权书。
#h(6.3em) 2、不保密 □
#h(6.3em)请在以上相应方框内打 “√”
]
v(3em)
align(right)[
#if not anonymous {
text("作者签名: 年 月 日")
} else {
text("作者签名:██████████年███月███日")
}
]
align(right)[
#if not anonymous {
text("导师签名: 年 月 日")
} else {
text("导师签名:██████████年███月███日")
}
]
}
// 参考文献
#let references(path) = {
// 这个取消目录里的 numbering
set heading(level: 1, numbering: none)
set par(justify: true, leading: 1.24em, first-line-indent: 2em)
bibliography(path, title:"参考文献", style: "./hust-cs.csl")
}
// 致谢,请手动调用
#let acknowledgement(body) = {
// 这个取消目录里的 numbering
set heading(level: 1, numbering: none)
show <_thx>: {
// 这个取消展示时的 numbering
set heading(level: 1, numbering: none)
set align(center)
set text(weight: "bold", font: heiti, size: 18pt)
"致 谢"
} + empty_par()
[= 致谢 <_thx>]
body
}
// 中文摘要
#let zh_abstract_page(abstract, keywords: ()) = {
set heading(level: 1, numbering: none)
show <_zh_abstract_>: {
align(center)[
#text(font: heiti, size: 18pt, "摘 要")
]
}
[= 摘要 <_zh_abstract_>]
set text(font: songti, size: 12pt)
abstract
par(first-line-indent: 0em)[
#text(weight: "bold", font: heiti, size: 12pt)[
关键词:
]
#keywords.join(";")
]
}
// 英文摘要
#let en_abstract_page(abstract, keywords: ()) = {
set heading(level: 1, numbering: none)
show <_en_abstract_>: {
align(center)[
#text(font: heiti, size: 18pt, "Abstract")
]
}
[= Abstract <_en_abstract_>]
set text(font: songti, size: 12pt)
abstract
par(first-line-indent: 0em)[
#text(weight: "bold", font: heiti, size: 12pt)[
Key Words:
]
#keywords.join(", ")
]
}
#let project(
anonymous: false, // 是否匿名化处理
title: "",
abstract_zh: [],
abstract_en: [],
keywords_zh: (),
keywords_en: (),
school: "",
author: "",
id: "",
mentor: "",
class: "",
date: (1926, 8, 17),
body,
) = {
// 图表公式的排版
show: _set_figure
show: _set_numbering
set page(paper: "a4", margin: (
top: 2.5cm,
bottom: 2.5cm,
left: 3cm,
right: 3cm
))
// 封面
align(center)[
// hust logo
#v(20pt)
// 匿名化处理需要去掉个人、机构信息
#let logo_path = if not anonymous {
"./assets/cs-hust.png"
} else {
"./assets/black.png"
}
#image(logo_path, width: 55%, height: 7%)
#v(40pt)
#text(
size: 36pt,
font: zhongsong,
weight: "bold"
)[本科生毕业设计]
#v(40pt)
#text(
font: heiti,
size: 22pt,
)[
#title
]
#v(80pt)
#let info_value(body) = {
rect(
width: 100%,
inset: 2pt,
stroke: (
bottom: 1pt + black
),
text(
font: zhongsong,
size: 16pt,
bottom-edge: "descender"
)[
#body
]
)
}
#let info_key(body) = {
rect(width: 100%, inset: 2pt,
stroke: none,
text(
font: zhongsong,
size: 16pt,
body
))
}
#grid(
columns: (70pt, 180pt),
rows: (40pt, 40pt),
gutter: 3pt,
info_key("院 系"),
info_value(if not anonymous { school } else { "██████████" }),
info_key("专业班级"),
info_value(if not anonymous { class } else { "██████████" }),
info_key("姓 名"),
info_value(if not anonymous { author } else { "██████████" }),
info_key("学 号"),
info_value(if not anonymous { id } else { "██████████" }),
info_key("指导教师"),
info_value(if not anonymous { mentor } else { "██████████" }),
)
#v(30pt)
#text(
font: zhongsong,
size: 16pt,
)[
#date.at(0) 年 #date.at(1) 月 #date.at(2) 日
]
#pagebreak()
#pagebreak()
]
// 原创性声明
declaration(anonymous: anonymous)
pagebreak()
counter(page).update(0)
// 页眉
set page(
header: {
set text(font: huawenkaiti, 16pt, baseline: 12pt, spacing: 16pt, fill: rgb("#960000"))
set align(center)
if not anonymous {
[华 中 科 技 大 学 毕 业 设 计]
} else {
set text(fill: black)
[█████████████████████████]
}
line(length: 100%, stroke: 0.7pt)
}
)
// 页脚
// 封面不算页数
set page(
footer: {
set align(center)
grid(
columns: (5fr, 1fr, 5fr),
line(length: 100%, stroke: 0.7pt),
text(font: songti, 10pt, baseline: -3pt,
counter(page).display("I")
),
line(length: 100%, stroke: 0.7pt)
)
}
)
set text(font: songti, 12pt)
set par(justify: true, leading: 1.24em, first-line-indent: 2em)
show par: set block(spacing: 1.24em)
set heading(numbering: (..nums) => {
nums.pos().map(str).join(".") + " "
})
show heading.where(level: 1): it => {
set align(center)
set text(weight: "bold", font: heiti, size: 18pt)
set block(spacing: 1.5em)
it
}
show heading.where(level: 2): it => {
set text(weight: "bold", font: heiti, size: 14pt)
set block(above: 1.5em, below: 1.5em)
it
}
// 首段不缩进,手动加上 box
show heading: it => {
set text(weight: "bold", font: heiti, size: 12pt)
set block(above: 1.5em, below: 1.5em)
it
} + empty_par()
show figure: it => {
it + empty_par()
}
show math.equation: it => {
it + empty_par()
}
pagebreak()
counter(page).update(1)
// 摘要
zh_abstract_page(abstract_zh, keywords: keywords_zh)
pagebreak()
// abstract
en_abstract_page(abstract_en, keywords: keywords_en)
pagebreak()
// 目录
chinese_outline()
// 正文的页脚
set page(
footer: {
set align(center)
grid(
columns: (5fr, 1fr, 5fr),
line(length: 100%, stroke: 0.7pt),
text(font: songti, 10pt, baseline: -3pt,
counter(page).display("1")
),
line(length: 100%, stroke: 0.7pt)
)
}
)
counter(page).update(1)
// 代码块(TODO: 加入行数)
show raw: it => {
set text(font: songti, 12pt)
set block(inset: 5pt, fill: rgb(217, 217, 217, 1), width: 100%)
it
}
body
}
// 三线表
#let tlt_header(content) = {
set align(center)
rect(
width: 100%,
stroke: (bottom: 0pt),
[#content],
)
}
#let tlt_cell(content) = {
set align(center)
rect(
width: 100%,
stroke: none,
[#content]
)
}
#let tlt_row(r) = {
(..r.map(tlt_cell).flatten())
}
#let three_line_table(values) = {
rect(
stroke: (bottom: 1.5pt, top: 1.5pt),
inset: 0pt,
outset: 0pt,
grid(
columns: (auto),
rows: (auto),
align: center + horizon,
// table title
grid(
stroke: (bottom: 0.75pt),
columns: values.at(0).len(),
..values.at(0).map(tlt_header).flatten()
),
grid(
columns: values.at(0).len(),
..values.slice(1).map(tlt_row).flatten()
),
)
)
}
|
https://github.com/taylorh140/typst-graphviz-plugin | https://raw.githubusercontent.com/taylorh140/typst-graphviz-plugin/master/Gviztest.typ | typst | #let wasm = plugin("./dot.wasm")
#let render(code) = {
return str(wasm.render(bytes(code)))
}
#let render-svg(code, width: auto, height: auto, alt: none, fit: "cover") = {
set text(font:"linux libertine",fill:black)
image.decode(render(code), format: "svg", alt: alt, fit: fit)
//render(code)
}
#show raw.where(lang: "dot-render"): it => render-svg(it.text)
```dot-render
digraph finite_state_machine {
rankdir=LR;
node [shape = doublecircle]; 0 3 4 8;
node [shape = circle];
0 -> 2 [label = "SS(B)"];
0 -> 1 [label = "SS(S)"];
1 -> 3 [label = "S($end)"];
2 -> 6 [label = "SS(b)"];
2 -> 5 [label = "SS(a)"];
2 -> 4 [label = "S(A)"];
5 -> 7 [label = "S(b)"];
5 -> 5 [label = "S(a)"];
6 -> 6 [label = "S(b)"];
6 -> 5 [label = "S(a)"];
7 -> 8 [label = "S(b)"];
7 -> 5 [label = "S(a)"];
8 -> 6 [label = "S(b)"];
8 -> 5 [label = "S(a)"];
}
```
|
|
https://github.com/maxlambertini/scravellerchargen | https://raw.githubusercontent.com/maxlambertini/scravellerchargen/main/scraveller_eng.typ | typst | #import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx
#set page(
width:29.7cm,
height:21cm,
margin: (left: 1cm, right: 1cm, top:1cm, bottom: 1cm),
numbering: none,
)
#set rect(
width: 100%,
height: 100%,
inset: 4pt,
)
#set block(
width:100%,
)
#set text(lang: "en", size: 11pt)
#set text(font: "Arsenal")
#set par(
justify: false,
leading: 0.55em,
)
#columns(3, gutter: 20mm, [
#block[
#set align(right)
#set text(size:14pt, style: "italic",hyphenate: false)
#v(2pt)
Mayday, mayday… \
This is free trader Meowulf, we are under attack… \
Main drive is gone, turret one is destroyed… \
We are losing pressure fast… \
Mayday, mayday… \
̀]
#block(
inset: (top:24pt, bottom: 16pt),
width: 100%,
text(size: 45pt, fill: rgb("#800000"), weight: 700, style: "italic",tracking: -3pt, [
#set align(right)
SCRAVELLER!
])
)
#image("sun_spaceship_left.svg", width: 100%)
#v(24pt)
#let th(body) = {
set text(fill: rgb("#800000"), font: "Tomorrow", size:13pt, weight: 800)
[ #body ]
}
#let st(body) = {
box(fill:rgb("#FFFF00"), [
#set text(fill: black, style: "italic", weight: 700)
#body
])
}
#block[
#set align(right)
#set text(size:14pt, style: "italic",hyphenate: false)
A SCRAPCAT HACK for space misfits \ inspired by the world's most famous \ Sci-Fi RPG.
]
#let scraveller-logo={block[
#colbreak()
#set align(center)
#image("sun_spaceship_right.svg", width: 100%)
]
}
#v(1fr)
#block(
stroke: 1pt + rgb("#800000"),
inset: 4pt,
[
#set text(size:8pt)
This is a *Scrapcat* Hack. *Scrapcat* can be found here: `https://luca-negri.itch.io/scrapcat` . Published under *CC BY 4.0 Deed
Attribution 4.0 International* -- `https://creativecommons.org/licenses/by/4.0/`
]
)
#scraveller-logo
#th[INTRO] You are a #st[SPACE SCRAPCAT], a lean and mean bastard plying the #st[SPACE LANES] to #st[SWINDLE NOBLES], assault #st[CORP SHIPS] and #st[EXPLORE UNIVERSE] accompanied by a band of other like-minded gentlesentients.
#th[CHARGEN] Choose a #st[NAME]. Roll #st[2+1d6] for your #st[SIZE]. These are your HPs and how many object you can carry. Then #st[ROLL 1d10] for a #st[CAREER] term:
#tablex(
auto-vlines: false,
columns: (1fr,4fr,1fr,4fr,1fr,4fr),
[1],[Medic],
[2],[Scout],
[3],[Scientist],
[4],[Tech],
[5],[Merchant],
[6],[Smuggler],
[7],[Pirate],
[8],[Merc],
[9],[Pilot],
colspanx(1)[#text(size:1.2em)[*0*]],colspanx(5)[#text(size:1.2em)[#st[DEAD] in the line of duty, sorry.]],
)
If you're not dead, note down the resulting career and add a +1 to it. #st[REPEAT this] for #st[1d4 more times]. If you #st[die] during this phase,
#st[SCRAP] your character and generate a new one. Instead of continuing, you might also choose to #st[MUSTER OUT].
#th[CHARGEN (soft)] If you don't feel like dying during character creation, choose 1 career at +2 or 2 careers at +1 and that's it.
#th[SURVIVED / MUSTERED OUT?] If you #st[SURVIVE], choose #st[ONE] (#st[TWO] if you did 5 tours of duty) object from this list: #st[Contact] -- #st[Money] -- #st[Medium Weapon] -- #st[Gadget] -- #st[Hideout]. Describe your stuff. Every object can be used #st[up to three times], then, according to the object, it must be reloaded / repaired / you can't use it anymore.
Everyone #st[ROLL 1d20]. Lowest scoring character is saddled by the starship mortgage and has skipped the latest #st[1d10] payments, making someone *very angry*.
#scraveller-logo
#th[DOING STUFF] #st[Roll 2d6], and add most relevant career's level and +1 for a single relevant object you own. #st[2 means DISASTER], #st[9+ means SUCCESS], #st[16+ means SCRAP TIME]. When you enter the SCRAP TIME, you score a *critical success*: you become one with the universe, or receive illumination or kick serious ass, you know the drill, for 1d6 rounds.
#th[FIGHT \& CONFLICTS] Treat them like an action. If you succeed, you hit. If you fail, #st[they score 1-4 hits] according to the weapon. #st[If your HPs reach between 0 and -SIZE], #st[you're dying] and if you don't get first aid within 1d6 rounds you're dead. #st[If your HPs go] #st[lower than -SIZE], you're definitely #st[DEAD]. Roll another character, mate.
#th[THE UNIVERSE] Least-skilled player describes an #st[HELLISH PLANET] to escape from and avoid at all costs, highest skilled player describes a #st[PARADISE PLANET] where to retire or have the greatest time of your life and the player with the ship and unpaid mortgage gets to #st[describe the creditors] they are definitely #st[fleeing from]. The players then decide #st[THE SHIP'S NAME], in a collective fashion.
#v(1fr)
#block[
#set align(center)
#set par(leading: 6pt)
#set text(font:"Tomorrow", size:18pt, weight: 800, fill: rgb("#800000"))
NOW \ JUMP INTO THE FREAKIN' HYPERSPACE, \ FOR F\*\*K'S SAKE!
]
#v(24pt)
#scraveller-logo
#let th(body) = {
set text(fill: rgb("#800000"), font: "Tomorrow", size:12pt, weight: 800)
[ #body ]
}
#set text(lang: "en", size: 9pt)
#v(12pt)
#block(width: 100%, [
#set align(center)
#set text(fill: rgb("#800000"), font: "Tomorrow", size:16pt, weight: 800)
Sentients of the Known Universe
])
#v(24pt)
#grid(
columns: (1fr, 1fr, 1fr),
gutter: 2mm,
[ #image("pics/insettone01.jpeg",width: 100%) ],
[ #image("pics/scientist01.jpeg",width: 100%) ],
[ #image("pics/scout02.jpeg",width: 100%) ],
[ #image("pics/spacescout.jpeg",width: 100%) ],
[ #image("pics/pilota_01.jpg",width: 100%) ],
[ #image("pics/pirata_01.jpg",width: 100%) ],
[ #image("pics/pirata_02.jpg",width: 100%) ],
[ #image("pics/scout_04.jpg",width: 100%) ],
[ #image("pics/tech05.jpg",width: 100%) ],
)
#v(24pt)
#set text(size: 11pt)
*Humans started spreading in the Known Universe more than three millennia ago*, and soon met other kind of sentients, some starfaring, some other not. First contacts were sometimes peaceful and uneventful, but usually led to strife and conflicts. While humans have learned to live among the "aliens", traces of past wars still remain. Moreover, humans themselves tinkered with their own DNA and soon generated their own related but different species: related enough to be somewhat interfertile, distinct enough to resemble something... other. These are the most notable species populating the Known Universe.
#set text(size: 9pt)
#th[Baseline Humans] Direct, unprocessed descendants of the _homo sapiens_ stock. Granted, centuries of slightly different gravities, suns, day lenghts and radiation level forced different evolution paths that are being studies in a lot of universities, but from a biological standpoint of view baseline humans are still considered a species in itself. Politically most of baseline humans swear allegiance to the *Terran Hegemony* (a powerful but extremely conservative polity), but at least 20% of them set out to remote colonies outside the main polities in the local arm.
#th[Genenginereed Humans] Some planets, while deemed promising for colonization, were too extreme for baseline humans; thus, new species where created to exploit such worlds. Most notable are: *Soberians*, created for extremely dry climates; *Isanesleses*, engineered for hi-G planets; *Vetebeses*, created for very hot (50-70°C) worlds and *Ceertians*, adapted for 0 gee environments. These epecies were considered little more than second-class citizen by Terran rulers of yore, so they ended up revolting against them and set up a very loose confederation, named the *N-Human Empire.*, which is mired in internal quarrelings but also harbors some of the most expansionist polities of the Known Universe.
#th[Edonenites] Reptilian humanoids hailing mostly from the *Edonen Compact*, a tight-controlled union of 30-odd solar systems bordering the RK-4423 sector. Known as durable, physically adaptable, swift in their moves and quite stubborn in their thoughts. While the Compact itself is very strict in its tradition and customs, a sizable lot of Edonenites chafe under this invisible fist, and leave the Compact at their earliest opportunity, even if this means social death at home. Thus, most Edonenites are likely to have a rebellious streak fueling their actions.
#th[Getevites] Bear-like folks hailing from *Getev*, a world near the Rasalhague Archeological Zone. They recently discovered how to crack lightspeed barrier, just to discover they were hopelessly outnumbered by older interstellar polities. To make up for their scarce population, they began a vast program of espionage disguised as commercial endeavors bent to acquire the highest tech at the lowest price. Don't be fooled by their dumb stare, since they are, on the average, one of the most intelligent and analytical species out there. Their wares are quite delicate and refined, though.
#th[Raatbies] *Raat'b* is a Super Earth-type planet currently part of the N-Human empire, and it is the home of Raatbies, amphibious smallish (1.4m) humanoids whose expertise in the field of biology is matched by no other species in the Known Universe. Being Raat'b an overpopulated world, and being Raatbies endowed by a burning curiosity, they spread into their known space at an alarming velocity, quickly filling a lot of scientific, medical and scouting positions in most multispecies polities. However, while adaptable, they tend to shun hot and dry world: being there even protected by a proper suit, hurts and slows them on a deep psychological level.
#th[Tiariceites] The *Tiaritz Federation* is the oldest known civilization in this sector. They visited Earth during the last ice age (still have pictures and movies). They are very jealous of their volume of space and while lacking innovation their tech is still so fearsome that no sane being considers travelling in their space without proper authorization. They can be met mostly in the Rasalhague Archeological Sector, which they control. They resemble an awful lot baseline humans... if you don't mind their extra pair of arms. They are quite contemptful of younger starfaring races, and consider dealing with them a necessary but unpleasant evil. However, their inner calm and vast technical knowledge makes them prized member of any shipcrew.
#th[Terdiaresi] Cat-Folks from the dry worlds of the *Terdiar Alliance* combine the cunning, the sensuality and the ferocity of felines with the frame of a huge and fit human. (220cm and 140kg of muscles on average). After their First Encounter, both species spent the first four centuries embroiled in a series of wars. There's been peace ever since, but a veil of mistrusts is still part and parcel of any human-terdiarese relation. Thus, few terdiaresi can be seen in human space; most of them are _freelances_, working as independents for anyone willing to pay. On a rare case, however, humans and terdiaresi can form a Bond that no force in the universe can break. Woe betide to the one that harms the human of a Bonded terdiarese...
#th[Xevexian] These huge bipedal eight-armed insectoids covered by tough, chitinous carapaces are widespread on a sizable number of lot of humid, jungle-like worlds. Their origin is unknown, and what baffles the boffins of most races is that they exhibit both an uniform culture and little genetic differences despite lacking FTL capabilities and being spread on very far-away worlds. For these reasons, a lot of conspiracies have cropped up about a gigantic hive-mind biding its time to rule the universe using the Xevexian (which translates as "The People") as cannon fodder. Prized jack-of-all-trades, quick to learn about anything they set to, they seem to get along quite well with other races, unless they are called out as "ugly": in this case, things can get deadly very quickly...
])
|
|
https://github.com/chamik/gympl-skripta | https://raw.githubusercontent.com/chamik/gympl-skripta/main/cj-autori/wolker.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/helper.typ": autor
#autor("<NAME>", "1900", "1924", "spisovatel, překladatel, novinář", "PF UK", "proletářská literatura", "/cj-autori/media/wolker.jpg")
Byl členem skupiny #underline[Devětsil] která byla založena socialisticky orientovanými výtvarníky. Dalšími členy byli například <NAME>, nebo K. Teige. Devětsil se profiloval jako seskupení českých avantgardních umělců. Nejednalo se však pouze o literáty. Zastoupeni byli i herci, výtvarníci, hudebníci apod. Po založení se členové Devětsilu věnovali proletářskému umění a tzv. magickému realismu, od roku 1923 se angažovali v poetismu. Klíčové sborníky Devětsil a Život byly vydány v roce 1922.
Byl to významný představitel proletářské poezie, což je literární směr zobrazující hlavně dělnickou třídu, její útlak a vykořisťování. Díla proletářské poezie jsou silně provázána s levicovou ideologií. Tento směr vznikal ve 20. letech 20. století.
Zemřel předčasně na tuberkulózu. #underline[Napsal si vlastní epitaf]:
#quote[Zde leží <NAME>, básník, jenž miloval svět
a pro spravedlnost jeho šel se bít.
Dřív než moh' srdce k boji vytasit,
zemřel -- mlád dvacet čtyři let.]
Po jeho smrti se kolem něj vytvořil kult osobnosti, který byl často kritizován.
Mezi jeho známá díla patří:
1. *Host do domu* -- básnická sbírka z roku 1920, která se zabývá válečnou tematikou a vyjadřuje emocionální a psychologické důsledky války, jako je zoufalství, osamělost a smrt.
2. *Tři hry* -- sbírka divadelních her Nemocnice, Hrob a Nejvyšší oběť.
*Současníci*\
_<NAME>_ -- <NAME>, 1918 \
_<NAME>_ -- Na vlnách TSF, 1925\
_<NAME>_ -- Edison (@edison[]), 1928
#pagebreak() |
https://github.com/alberto-lazari/computer-science | https://raw.githubusercontent.com/alberto-lazari/computer-science/main/lcd/project-presentation/vcc-presentation.typ | typst | #import "/common.typ": *
#set text(font: "Roboto")
#show raw: itself => { set text(font: "Menlo"); itself }
// Add background to monospace text
#show raw.where(block: false): box.with(
fill: luma(220),
inset: (x: 5pt, y: 0pt),
outset: (y: 10pt),
radius: 10pt,
)
#show raw.where(block: true): it => { set text(size: .7em); it }
#show raw.where(block: true): block.with(
fill: luma(220),
inset: 10pt,
radius: 10pt,
)
#show: theme.with(
short-title: [vCCS compiler],
footer: [<NAME> -- LCD exam project],
logo: image("unipd-logo.png"),
)
#title-slide(
title: [Value-passing CCS Compiler],
subtitle: [Languages for Concurrency and Distribution exam project],
authors: [<NAME>],
date: [April 4, 2024]
)
#include "sections/syntax.typ"
#include "sections/components.typ"
#include "sections/stack.typ"
#include "sections/implementation.typ"
#include "sections/encoder.typ"
#focus-slide[
Demo time!
]
|
|
https://github.com/ayoubelmhamdi/typst-phd-AI-Medical | https://raw.githubusercontent.com/ayoubelmhamdi/typst-phd-AI-Medical/master/chapters/ch00-int.typ | typst | MIT License | #import "../tablex.typ": tablex, cellx, rowspanx, colspanx
#let finchapiter = text(fill:rgb("#1E045B"),[■])
= INTRODUCTION GÉNÉRALE.
== Étendue du problème.
#counter(figure.where(kind: image)).update(0)
Dans le monde entier, le cancer du poumon est la cause principale des décès liés au cancer #cite("Siegel2017Cancer2017"). Une découverte opportune grâce à des scanners thoraciques de dépistage peut augmenter considérablement les chances de survie #cite("Nationallungscreening"). Potentiellement, les nodules pulmonaires (des masses rondes ou ovales détectables dans les scanners thoraciques) peuvent indiquer un cancer du poumon #cite("Gould2007EvaluationEdition"). L'efficacité des soins de santé pourrait bénéficier significativement d'un système informatisé capable d'identifier automatiquement ces nodules, permettant d'économiser du temps et des ressources pour les prestataires de santé et les patients.
Les algorithmes de détection des nodules se composent généralement de deux parties #cite("Setio2016PulmonaryNetworks") :
- La première étape recherche une grande variété de nodules possibles avec une grande sensibilité; cependant, elle génère de nombreux faux positifs.
- L'étape suivante atténue ces faux positifs en utilisant des caractéristiques et des classificateurs améliorés, une tâche difficile en raison des variables englobant les formes, les tailles, les types de nodules et leur ressemblance potentielle avec d'autres composants thoraciques comme les vaisseaux sanguins ou les ganglions lymphatiques #cite("Gould2007EvaluationEdition","Roth2016ImprovingAggregation").
Dans nos recherches, nous avons appliqué un réseau neuronal convolutionnel sur l’ensemble de données public LUNA16, composé de scanners thoraciques de 888 patients évalués par quatre experts médicaux #cite("Setio2016PulmonaryNetworks"). De plus, nous avons également utilisé un autre modèle pour classer les nodules comme probablement normaux ou anormaux à l'aide du _LIDC-IDRI_/_TRPMLN_ dataset.
Finalement, la résultat a montré une performance de classification de nodule. Cela signifie qu’elle peut identifier de manière un peu précise plus de nodules cancéreux et moins de nodules non cancéreux #cite("Lin2016FeatureDetection","Kamnitsas2017EfficientSegmentation").
== Travaux connexes.
Les premières tentatives d'automatisation des dépistages du cancer du poumon se sont appuyées sur des algorithmes pour extraire les caractéristiques uniques des nodules pulmonaires. Les chercheurs ont mis l'accent sur les données volumétriques des nodules et les zones proches, mais ces méthodes ont souvent eu du mal à différencier correctement la gamme de variations des nodules, nécessitant une personnification pour chaque type de nodule distinct#cite("Jacobs2014AutomaticImages","Okumura1998AutomaticFilter","Li2003SelectiveScans"). Avec le temps, grâce à l'avancée des réseaux neuronaux profonds, ces techniques ont été progressivement améliorées. Les innovations récentes, tout particulièrement les méthodes basées sur les réseaux neuronaux convolutionnels (Convolutional Neural Networks, CNN), ont montré qu'elles pourraient améliorer la classification des nodules#cite("Roth2016ImprovingAggregation","Setio2016PulmonaryNetworks","Ding2017AccurateNetworks").
Un changement significatif dans le paradigme de détection des nodules pulmonaires a été l'intégration d'informations contextuelles multi-échelles, en particulier avec l'ensemble de données Luna16. Cette approche tire profit des méthodologies d'apprentissage profond pour évaluer une vaste gamme de caractéristiques morphologiques et structurales à travers diverses échelles#cite("Shen2015","Dou2016Multi-levelDetection"). Plusieurs techniques ont démontré leur efficacité.
Des chercheurs ont également suggéré plusieurs stratégies prometteuses pour la détection des anomalies pulmonaires, comme l'utilisation de patches 3D pour une précision accrue avec les données volumétriques et la réduction des faux positifs#cite("Setio2016PulmonaryNetworks","Roth2016ImprovingAggregation"). L'extraction graduelle des caractéristiques, une méthode séquentielle qui fusionne l'information de contexte à différentes échelles, offre une alternative à la pratique conventionnelle de l'intégration radicale#cite("Shen2015","Shen2017").
La combinaison holistique de ces approches a permis d'obtenir des modèles plus fiables et robustes pour la détection des nodules pulmonaires. Les régions entourant les nodules pulmonaires potentiels ont été minutieusement examinées et comparées à d'autres organes ou tissus pour améliorer la différenciation des nodules#cite("Shen2017"). Les améliorations futures pourraient inclure l'intégration de données contextuelles provenant des zones adjacentes aux nodules, renforçant ainsi potentiellement les performances et l'exactitude des modèles#cite("Dou2016Multi-levelDetection","Shen2017"). #finchapiter
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/string-17.typ | typst | Other | // Error: 23-32 expected string or function, found array
#"123".replace("123", (1, 2, 3))
|
https://github.com/teamdailypractice/pdf-tools | https://raw.githubusercontent.com/teamdailypractice/pdf-tools/main/typst-pdf/thirukkural-cover/t1.typ | typst | #set page("a4")
#set text(
font: "TSCu_SaiIndira",
size: 32pt
)
#set align(center)
\
\
\
\
\
\
\
திருக்குறள்
\
\
\
#set text(
font: "TSCu_SaiIndira",
size: 16pt
)
மு. வரதராசனார் உரை
|
|
https://github.com/valentinvogt/npde-summary | https://raw.githubusercontent.com/valentinvogt/npde-summary/main/src/boxes.typ | typst | #import "theorems.typ": *
#import "colors.typ": *
#let theorem = thmbox(
"theorem", "Theorem", fill: brown-box,
// bodyfmt: body => [
// #body 2
// ]
titlefmt: title => [
#text(weight: "bold")[
#title:
]
],
namefmt: name => [
#text(weight: "bold")[
#name
]
],
separator: linebreak(),
supplement: "Theorem"
)
#let lemma = thmbox(
"lemma", "Lemma", fill: brown-box,
titlefmt: title => [
#text(weight: "bold")[
#title:
]
],
namefmt: name => [
#text(weight: "bold")[
#name
]
],
separator: linebreak(),
supplement: "Lemma"
)
#let definition = thmbox(
"definition", "Definition", fill: brown-box,
titlefmt: title => [
#text(weight: "bold")[
#title:
]
],
namefmt: name => [
#text(weight: "bold")[
#name
]
],
separator: linebreak(),
supplement: "Definition"
)
#let equation = thmbox(
"equation", "Equation", fill: brown-box,
titlefmt: title => [
#text(weight: "bold")[
#title
]
],
namefmt: name => [
#text(weight: "bold")[
(#name)
]
],
separator: linebreak(),
supplement: "Equation"
)
#let mybox = thmbox(
"", "", fill: brown-box,
namefmt: name => [
#text(weight: "bold")[
#h(-3pt) #name
]
],
separator: linebreak()
).with(numbering: none)
// Modified from colorful-boxes:1.2.0
#let colorbox(title: none, color: none, radius: 2pt, width: auto, body) = {
let strokeColor = tip-stroke
let backgroundColor = page-color
return box(
fill: backgroundColor,
stroke: 2pt + strokeColor,
radius: radius,
width: width
)[
#if (title != "") {
block(
fill: strokeColor,
inset: 8pt,
radius: (top-left: radius, bottom-right: radius),
)[
#text(fill: white, weight: "bold")[#title]
]
}
#block(
width: 100%,
inset: if title != ""{
(x: 8pt, bottom: 8pt)
} else {
(x: 8pt, bottom: 8pt, top: 13pt)
}
)[
#body
]
]
}
#let tip-box = (title, content) => {
colorbox(
title: title,
radius: 2pt,
)[
#v(-0.2cm)
#content
]
}
#let subtle-box = (content, width: 100%) => {
box(radius: 0.5cm, stroke: 1pt + text-color, inset: 0.5cm, width: width)[
#content
]
}
|
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/153.%20herd.html.typ | typst | herd.html
Investor Herd Dynamics
Want to start a startup? Get funded by
Y Combinator.
August 2013The biggest component in most investors' opinion of you is the
opinion of other investors. Which is of course a recipe for
exponential growth. When one investor wants to invest in you, that
makes other investors want to, which makes others want to, and so
on.Sometimes inexperienced founders mistakenly conclude that manipulating
these forces is the essence of fundraising. They hear stories about
stampedes to invest in successful startups, and think it's therefore
the mark of a successful startup to have this happen. But actually
the two are not that highly correlated. Lots of startups that cause
stampedes end up flaming out (in extreme cases, partly as a result
of the stampede), and lots of very successful startups were only
moderately popular with investors the first time they raised money.So the point of this essay is not to explain how to create a stampede,
but merely to explain the forces that generate them. These forces
are always at work to some degree in fundraising, and they can cause
surprising situations. If you understand them, you can at least
avoid being surprised.One reason investors like you more when other investors like you
is that you actually become a better investment. Raising money
decreases the risk of failure. Indeed, although investors hate it,
you are for this reason justified in raising your valuation for
later investors. The investors who invested when you had no money
were taking more risk, and are entitled to higher returns. Plus a
company that has raised money is literally more valuable. After
you raise the first million dollars, the company is at least a
million dollars more valuable, because it's the same company as
before, plus it has a million dollars in the bank.
[1]Beware, though, because later investors so hate to have the price
raised on them that they resist even this self-evident reasoning.
Only raise the price on an investor you're comfortable with losing,
because some will angrily refuse.
[2]The second reason investors like you more when you've had some
success at fundraising is that it makes you more confident, and an
investors' opinion of you is the foundation
of their opinion of your company. Founders are often surprised how
quickly investors seem to know when they start to succeed at raising
money. And while there are in fact lots of ways for such information
to spread among investors, the main vector is probably the founders
themselves. Though they're often clueless about technology, most
investors are pretty good at reading people. When fundraising is
going well, investors are quick to sense it in your increased
confidence. (This is one case where the average founder's inability
to remain poker-faced works to your advantage.)But frankly the most important reason investors like you more when
you've started to raise money is that they're bad at judging startups.
Judging startups is hard even for the best investors. The mediocre
ones might as well be flipping coins. So when mediocre investors
see that lots of other people want to invest in you, they assume
there must be a reason. This leads to the phenomenon known in the
Valley as the "hot deal," where you have more interest from investors
than you can handle.The best investors aren't influenced much by the opinion of other
investors. It would only dilute their own judgment to average it
together with other people's. But they are indirectly influenced
in the practical sense that interest from other investors imposes
a deadline. This is the fourth way in which offers beget offers.
If you start to get far along the track toward an offer with one
firm, it will sometimes provoke other firms, even good ones, to
make up their minds, lest they lose the deal.Unless you're a wizard at negotiation (and if you're not sure,
you're not) be very careful about exaggerating this to push a good
investor to decide. Founders try this sort of thing all the time,
and investors are very sensitive to it. If anything oversensitive.
But you're safe so long as you're telling the truth. If you're
getting far along with investor B, but you'd rather raise money
from investor A, you can tell investor A that this is happening.
There's no manipulation in that. You're genuinely in a bind, because
you really would rather raise money from A, but you can't safely
reject an offer from B when it's still uncertain what A will decide.Do not, however, tell A who B is. VCs will sometimes ask which
other VCs you're talking to, but you should never tell them. Angels
you can sometimes tell about other angels, because angels cooperate
more with one another. But if VCs ask, just point out that they
wouldn't want you telling other firms about your conversations, and
you feel obliged to do the same for any firm you talk to. If they
push you, point out that you're inexperienced at fundraising — which
is always a safe card to play — and you feel you have to be
extra cautious.
[3]While few startups will experience a stampede of interest, almost
all will at least initially experience the other side of this
phenomenon, where the herd remains clumped together at a distance.
The fact that investors are so much influenced by other investors'
opinions means you always start out in something of a hole. So
don't be demoralized by how hard it is to get the first commitment,
because much of the difficulty comes from this external force. The
second will be easier.Notes[1]
An accountant might say that a company that has raised a million
dollars is no richer if it's convertible debt, but in practice money
raised as convertible debt is little different from money raised
in an equity round.[2]
Founders are often surprised by this, but investors can get
very emotional. Or rather indignant; that's the main emotion I've
observed; but it is very common, to the point where it sometimes
causes investors to act against their own interests. I know of one
investor who invested in a startup at a $15 million valuation cap.
Earlier he'd had an opportunity to invest at a $5 million cap, but
he refused because a friend who invested earlier had been able to
invest at a $3 million cap.[3]
If an investor pushes you hard to tell them about your conversations
with other investors, is this someone you want as an investor?
Thanks to <NAME>, <NAME>, <NAME>, and <NAME>
for reading drafts of this.Russian Translation
|
|
https://github.com/jrihon/multi-bibs | https://raw.githubusercontent.com/jrihon/multi-bibs/main/chapters/02_chapter/results.typ | typst | MIT License | #import "../../lib/multi-bib.typ": *
#import "bib_02_chapter.typ": biblio
== Results
#lorem(50)
We did the method of Cremer et al #mcite(("Cremer1975general"), biblio).
|
https://github.com/longlin10086/HITSZ-PhTyp | https://raw.githubusercontent.com/longlin10086/HITSZ-PhTyp/main/utils/two_line.typ | typst | #let two_lines = {
set pad(0pt)
v(1em)
grid(
rows: (auto, auto),
gutter: 3pt,
line(length: 100%, stroke: 0.05em),
line(length: 100%, stroke: 0.05em)
)
v(1em)
} |
|
https://github.com/saveriogzz/curriculum-vitae | https://raw.githubusercontent.com/saveriogzz/curriculum-vitae/main/modules/skills.typ | typst | Apache License 2.0 | #import "../brilliant-CV/template.typ": *
#cvSection("Skills")
#cvSkill(
type: [Languages],
info: [English #hBar() Italian]
)
#cvSkill(
type: [Tech Stack],
info: [Scala2 #hBar() Python #hBar() BigQuery]
)
#cvSkill(
type: [Personal Interests],
info: [Swimming #hBar() Learning #hBar() Food]
)
|
https://github.com/floriandejonckheere/utu-thesis | https://raw.githubusercontent.com/floriandejonckheere/utu-thesis/master/thesis/appendices/a-literature-review.typ | typst | #import "@preview/acrostiche:0.3.1": *
#import "/helpers.typ": *
= Systematic Literature Review publications <slr_publications>
#set heading(numbering: none)
== Primary studies
#show figure: set block(breakable: true)
#show figure: set text(size: 9pt)
#figure(
table(
columns: (auto, auto),
inset: 5pt,
stroke: (x: none),
align: (right, left),
[*ID*], [*Publication*],
..for (platform) in slr.platforms.keys() {
for (key) in slr.platforms.at(platform).primary {
(
[*#ref(label(key))*],
[
#slr_reference(
[
#cite_author(label(key)),
#text(slr_bibliography.at(key).at("title"), style: "italic"),
#str(slr_bibliography.at(key).at("date")).split("-").first()
],
key,
)
],
)
}
},
..for (key) in slr.snowballing.primary {
(
[*#ref(label(key))*],
[
#slr_reference(
[
#cite_author(label(key)),
#text(slr_bibliography.at(key).at("title"), style: "italic"),
#str(slr_bibliography.at(key).at("date")).split("-").first()
],
key,
)
],
)
}
),
caption: [Selected publications (primary studies)],
kind: "appendix",
supplement: "Table"
) <slr_primary_publications>
#pagebreak()
== Secondary studies
#show figure: set block(breakable: true)
#show figure: set text(size: 9pt)
#figure(
table(
columns: (auto, auto),
inset: 5pt,
stroke: (x: none),
align: (right, left),
[*ID*], [*Publication*],
..for (platform) in slr.platforms.keys() {
for (key) in slr.platforms.at(platform).secondary {
(
[*#ref(label(key))*],
[
#slr_reference(
[
#cite_author(label(key)),
#text(slr_bibliography.at(key).at("title"), style: "italic"),
#str(slr_bibliography.at(key).at("date")).split("-").first()
],
key,
)
],
)
}
},
..for (key) in slr.snowballing.secondary {
(
[*#ref(label(key))*],
[
#slr_reference(
[
#cite_author(label(key)),
#text(slr_bibliography.at(key).at("title"), style: "italic"),
#str(slr_bibliography.at(key).at("date")).split("-").first()
],
key,
)
],
)
}
),
caption: [Selected publications (secondary studies)],
kind: "appendix",
supplement: "Table"
) <slr_secondary_publications>
|
|
https://github.com/shenxiangzhuang/typst-cn-book | https://raw.githubusercontent.com/shenxiangzhuang/typst-cn-book/master/template/chapters/chap2.typ | typst | MIT License | = 基础格式使用 <chapter2>
@chapter2[章节]介绍基本格式的使用。
#lorem(100)
== 代码
=== Rust
下面是一个Rust代码块示例:
#align(center,
```rust
fn main() {
println!("Hello World!");
}
```
)
=== Python
下面是一个Python代码块示例:
#align(center,
```python
def main():
print("Hello World!")
```
)
#lorem(100)
== 数学公式
我们定义$phi.alt$如下:
$ phi.alt := (1 + sqrt(5)) / 2 $ <ratio>
根据@ratio, 可以得到@fn:
$ F_n = floor(1 / sqrt(5) phi.alt^n) $ <fn>
=== 数学公式注解
#lorem(100) |
https://github.com/ustctug/ustc-thesis-typst | https://raw.githubusercontent.com/ustctug/ustc-thesis-typst/main/template.typ | typst | MIT License | #let thesis(
title: "Thesis title",
author: "Author",
body,
) = {
// Set the document's metadata.
set document(title: title, author: author)
let serif_fonts = (
"Times New Roman",
"TeX <NAME>",
"SimSun",
"Songti SC",
)
let sans_fonts = (
"Arial",
"TeX <NAME>",
"SimHei",
"Heiti SC",
)
// Set the body font.
set text(
font: serif_fonts,
size: 12pt,
lang: "zh",
)
// Configure the page properties.
set page(
paper: "a4",
// 页面设置:上、下 2.54 cm,左、右 3.17 cm,页眉 1.5 cm,页脚 1.75 cm。
margin: (x: 3.17cm, y: 2.54cm),
// // 页眉与该部分的章标题相同,宋体 10.5 磅(五号)居中。
header: locate(loc => {
let chapter_heading = none
let i = counter(page).at(loc).first()
let all = query(heading.where(level: 1), loc)
if all.any(it => it.location().page() == i) {
// We are on a page that starts a chapter
let after = query(selector(heading.where(level: 1)).after(loc), loc)
if after != () {
chapter_heading = after.first().body
}
} else {
let before = query(selector(heading.where(level: 1)).before(loc), loc)
if before != () {
chapter_heading = before.last().body
}
}
if chapter_heading != none {
align(center, text(10.5pt, chapter_heading))
}
}),
// 页码:宋体 10.5 磅、页面下脚居中。
// footer-descent: 12pt,
// footer: locate(loc => {
// let i = counter(page).at(loc).first()
// align(center, text(size: 10.5pt, [#i]))
// }),
numbering: "1",
)
// // Configure paragraph properties.
set par(leading: 0.78em, first-line-indent: 2em, justify: true)
// show par: set block(spacing: 0.78em)
// Configure equation numbering and spacing.
set math.equation(numbering: "(1)")
show math.equation: set block(spacing: 0.65em)
let circled_number(num) = {
if num < 0 or num > 50 {
panic("Invalid circled number")
} else if num == 0 {
str.from-unicode(0x24EA)
} else if num <= 20 {
str.from-unicode(0x245F + num)
} else if num <= 35 {
str.from-unicode(0x3250 + num - 20)
} else if num <= 50 {
str.from-unicode(0x32B0 + num - 35)
}
}
// Configure chapter headings.
let heading_numbering(..args) = {
if args.pos().len() == 1 {
numbering("第1章", ..args)
} else if args.pos().len() == 2 {
numbering("1.1", ..args)
} else if args.pos().len() == 3 {
numbering("1.1.1", ..args)
} else if args.pos().len() == 4 {
numbering("1.", args.pos().last())
} else if args.pos().len() == 5 {
numbering("(1)", args.pos().last())
} else if args.pos().len() == 6 {
// numbering(circled_number, args.pos().last())
circled_number(args.pos().last())
}
}
set heading(
numbering: heading_numbering,
)
// 各章标题:黑体 16 磅加粗居中,单倍行距,段前 24 磅,段后 18 磅,章序号与章名间空一字。
show heading: it => {
if it.level == 1 {
pagebreak(weak: true)
}
// Create the heading numbering.
let number = if it.numbering != none {
counter(heading).display(it.numbering)
if it.level <= 3 {
h(1em, weak: true)
} else {
h(0.5em, weak: true)
}
}
if it.level == 1 {
set align(center)
v(24pt)
set text(font: sans_fonts, weight: "bold", size: 16pt)
block([#number#it.body])
v(18pt)
}
else if it.level == 2 {
// 一级节标题:黑体 14 磅左顶格,单倍行距,段前 24 磅,段后 6 磅,序号与题名间空一字。
v(24pt)
set text(font: sans_fonts, size: 14pt)
block([#number#it.body])
v(6pt)
}
else if it.level == 3 {
// 二级节标题:黑体 13 磅,左缩进两字,单倍行距,段前 12 磅,段后 6 磅,序号与题名间空一字。
v(12pt)
set text(font: sans_fonts, size: 13pt)
block([#h(2em)#number#it.body])
v(6pt)
}
else if it.level == 4 {
// 三级及以下节标题的格式没有具体规定,按照 Word 模板的格式:
// 使用黑体 12 磅,左缩进两字,行距 20 磅,段前段后 0 磅,序号与题名间空半字宽。
set text(font: sans_fonts, size: 12pt)
block([#h(2em)#number#it.body])
}
else if it.level == 5 {
// 按照 Word 模板的格式,四级节标题:宋体 12 磅,左缩进两字,行距 20 磅,
// 段前段后 0 磅,序号使用全宽括号,与题名间空半字宽。
set text(size: 12pt)
block([#h(2em)#number#it.body])
}
else if it.level == 6 {
// 按照 Word 模板的格式,五级节标题:宋体 12 磅,左缩进两字,行距 20 磅,
// 段前段后 0 磅,序号使用全宽括号,与题名间空半字宽。
set text(size: 12pt)
// block([#number#it.body])
block([#h(2em)#number#it.body])
}
}
set outline(
depth: 3,
indent: 1em,
)
// 各章目录要求宋体 14 磅,单倍行距,段前 6 磅,段后 0 磅,两端对齐,
// 页码右对齐,章序号与章名间空一字。
// 但是 Word 模板中实际是行距 20 磅。
show outline.entry.where(level: 1): it => {
// v(6pt, weak: true)
// v(6pt)
// set par(first-line-indent: 0pt)
text(font: sans_fonts, it)
}
set bibliography(
style: "gb-7114-2015-numeric",
)
body
}
// #let mainmatter() = {
// pagebreak(to: "odd")
// counter("page").update(0)
// }
|
https://github.com/ctenopoma/SoftwareDesignTypst | https://raw.githubusercontent.com/ctenopoma/SoftwareDesignTypst/main/000.software_spec.typ | typst | #import ".\software_designe_templete.typ": *
#show: software_requirements.with(
title: "ソフトウェア要求定義書"
)
= 概要
本書は〇〇を対象としたソフトウェアの要求定義書である。
== 目的
本書の目的は〇〇の要求を定義することである。
== 範囲
〇〇が動作する範囲を示す。
== 参照
本書で参照する図書を示す。
#v(10pt)
+ 参考図書1
+ 参考図書2
== 定義
本書で使用する用語を定義する。
#v(30pt)
#tbl(table(
columns: 3,
[用語], [意味], [備考],
[], [], [],
),
caption: [本書における用語の定義],
) <tbl1>
= 業務フロー
= 要求定義 |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz-plot/0.1.0/src/plot/errorbar.typ | typst | Apache License 2.0 | #import "/src/cetz.typ": draw, util, vector
#let _draw-whisker(pt, dir, ..style) = {
let a = vector.add(pt, vector.scale(dir, -1))
let b = vector.add(pt, vector.scale(dir, +1))
draw.line(a, b, ..style)
}
#let draw-errorbar(pt, x, y, x-whisker-size, y-whisker-size, style) = {
if type(x) != array { x = (-x, x) }
if type(y) != array { y = (-y, y) }
let (x-min, x-max) = x
let x-min-pt = vector.add(pt, (x-min, 0))
let x-max-pt = vector.add(pt, (x-max, 0))
if x-min != 0 or x-max != 0 {
draw.line(x-min-pt, x-max-pt, ..style)
if x-whisker-size > 0 {
if x-min != 0 {
_draw-whisker(x-min-pt, (0, x-whisker-size), ..style)
}
if x-max != 0 {
_draw-whisker(x-max-pt, (0, x-whisker-size), ..style)
}
}
}
let (y-min, y-max) = y
let y-min-pt = vector.add(pt, (0, y-min))
let y-max-pt = vector.add(pt, (0, y-max))
if y-min != 0 or y-max != 0 {
draw.line(y-min-pt, y-max-pt, ..style)
if y-whisker-size > 0 {
if y-min != 0 {
_draw-whisker(y-min-pt, (y-whisker-size, 0), ..style)
}
if y-max != 0 {
_draw-whisker(y-max-pt, (y-whisker-size, 0), ..style)
}
}
}
}
#let _prepare(self, ctx) = {
return self
}
#let _stroke(self, ctx) = {
let x-whisker-size = self.whisker-size * ctx.y-scale
let y-whisker-size = self.whisker-size * ctx.x-scale
draw-errorbar((self.x, self.y),
self.x-error, self.y-error,
x-whisker-size, y-whisker-size,
self.style)
}
/// Add x- and/or y-error bars
///
/// - pt (tuple): Error-bar center coordinate tuple: `(x, y)`
/// - x-error: (float,tuple): Single error or tuple of errors along the x-axis
/// - y-error: (float,tuple): Single error or tuple of errors along the y-axis
/// - mark: (none,string): Mark symbol to show at the error position (`pt`).
/// - mark-size: (number): Size of the mark symbol.
/// - mark-style: (style): Extra style to apply to the mark symbol.
/// - whisker-size (float): Width of the error bar whiskers in canvas units.
/// - style (dictionary): Style for the error bars
/// - label: (none,content): Label to tsh
/// - axes (axes): Plot axes. To draw a horizontal growing bar chart, you can swap the x and y axes.
#let add-errorbar(pt,
x-error: 0,
y-error: 0,
label: none,
mark: "o",
mark-size: .2,
mark-style: (:),
whisker-size: .5,
style: (:),
axes: ("x", "y")) = {
assert(x-error != 0 or y-error != 0,
message: "Either x-error or y-error must be set.")
let (x, y) = pt
if type(x-error) != array {
x-error = (x-error, x-error)
}
if type(y-error) != array {
y-error = (y-error, y-error)
}
x-error.at(0) = calc.abs(x-error.at(0)) * -1
y-error.at(0) = calc.abs(y-error.at(0)) * -1
let x-domain = x-error.map(v => v + x)
let y-domain = y-error.map(v => v + y)
return ((
type: "errorbar",
label: label,
axes: axes,
data: ((x,y),),
x: x,
y: y,
x-error: x-error,
y-error: y-error,
x-domain: x-domain,
y-domain: y-domain,
mark: mark,
mark-size: mark-size,
mark-style: mark-style,
whisker-size: whisker-size,
style: style,
plot-prepare: _prepare,
plot-stroke: _stroke,
),)
}
|
https://github.com/kdog3682/mathematical | https://raw.githubusercontent.com/kdog3682/mathematical/main/0.1.0/src/patterns/inner-squares-with-translate.typ | typst | #import "@preview/cetz:0.2.2"
#import cetz.draw
// more like a series of inner squares
// i dont know why this works
#let runner(size, steps: 1) = {
for i in range(steps) {
draw.rect((0, 0), (size, size))
size = size / 2
let offset = size / 2
draw.translate(x: offset, y: offset)
}
}
#let main(n: 3) = {
cetz.canvas({
runner(5, steps: 6)
})
}
#main()
|
|
https://github.com/Complex2-Liu/macmo | https://raw.githubusercontent.com/Complex2-Liu/macmo/main/contests/2023/main.typ | typst | #import "lib/init.typ": init
#import "lib/math.typ": problem, solution, note
#import "lib/utils.typ": rem
// #import "lib/config.typ": config
#show: init
TODO:
- 设计一个 titlepage.
- 添加 TOC.
- Improve page header and footer.
- Page counter.
#let header = block(stroke: (bottom: 0.6pt), outset: 0.3em, width: 100%)[
2023 _年校际数学比赛参考解答_
#h(1fr)
#link("https://github.com/Complex2-Liu/macmo")
]
#pagebreak()
#set page(header: header, numbering: "1")
#counter(page).update(1)
#include "content/problem-01.typ"
#v(rem(1))
#include "content/problem-02.typ"
#v(rem(1))
#include "content/problem-03.typ"
#v(rem(1))
#include "content/problem-04.typ"
#v(rem(1))
#include "content/problem-05.typ"
#v(rem(1))
#include "content/problem-06.typ"
#v(rem(1))
#include "content/problem-07.typ"
#v(rem(1))
#include "content/problem-08.typ"
#v(rem(1))
#include "content/problem-09.typ"
#v(rem(1))
#include "content/problem-10.typ"
#v(rem(1))
#include "content/problem-11.typ"
#v(rem(1))
#include "content/problem-12.typ"
/* vim: set ft=typst: */
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/ops-08.typ | typst | Other | // Test equality operators.
// Most things compare by value.
#test(1 == "hi", false)
#test(1 == 1.0, true)
#test(30% == 30% + 0cm, true)
#test(1in == 0% + 72pt, true)
#test(30% == 30% + 1cm, false)
#test("ab" == "a" + "b", true)
#test(() == (1,), false)
#test((1, 2, 3) == (1, 2.0) + (3,), true)
#test((:) == (a: 1), false)
#test((a: 2 - 1.0, b: 2) == (b: 2, a: 1), true)
#test("a" != "a", false)
// Functions compare by identity.
#test(test == test, true)
#test((() => {}) == (() => {}), false)
// Content compares field by field.
#let t = [a]
#test(t == t, true)
#test([] == [], true)
#test([a] == [a], true)
#test(grid[a] == grid[a], true)
#test(grid[a] == grid[b], false)
|
https://github.com/TGM-HIT/typst-diploma-thesis | https://raw.githubusercontent.com/TGM-HIT/typst-diploma-thesis/main/CHANGELOG.md | markdown | MIT License | # [v0.2.0](https://github.com/TGM-HIT/typst-diploma-thesis/releases/tag/v0.2.0)
- fix deprecation warnings and incompatibilities introduced in 0.12, in part by updating codly, glossarium and outrageous
- long chapter titles now look nicer in the header
- **breaking:** glossary entries are now defined differently, see [the diff of the template](https://github.com/TGM-HIT/typst-diploma-thesis/commit/8c4d03a14ac3ddab6718cc7e11341924c66703bd#diff-7c3fcb5c97b51160af4b4a26981b152d6995f8ec0077281456d3f51f4b0e9d84) for an example
- **regression:** if there are no glossary references, an empty glossary section will be shown (glossarium 0.5 hides a couple private functions, see [glossarium#70](https://github.com/typst-community/glossarium/issues/70))
# [v0.1.3](https://github.com/TGM-HIT/typst-diploma-thesis/releases/tag/v0.1.3)
- get rid of more custom outline styling thanks to outrageous:0.2.0
# [v0.1.2](https://github.com/TGM-HIT/typst-diploma-thesis/releases/tag/v0.1.2)
(this version was released in a broken state)
# [v0.1.1](https://github.com/TGM-HIT/typst-diploma-thesis/releases/tag/v0.1.1)
- replaces some custom outline styling with [outrageous](https://typst.app/universe/package/outrageous)
- adds support for highlighting authors of individual pages of the thesis, which is a requirement for the thesis' grading
# [v0.1.0](https://github.com/TGM-HIT/typst-diploma-thesis/releases/tag/v0.1.0)
Initial Release
|
https://github.com/ymgyt/techbook | https://raw.githubusercontent.com/ymgyt/techbook/master/cloud/aws/cdk/consept.md | markdown | # CDK Concepts
## Physical Name
* 実際に作成されるResourceの名前のこと
* `<resourceType>Name`のpropertyで指定もできる
* **あるpropertyの変更がresourceのcreate deleteを引き起こす場合、指定してあると失敗する**
```typescript
const bucket = new s3.Bucket(this, 'MyBucket', {
bucketName: 'my-bucket-name',
});
```
|
|
https://github.com/Robotechnic/diagraph | https://raw.githubusercontent.com/Robotechnic/diagraph/main/doc/manual.typ | typst | MIT License | #import "@preview/mantys:0.1.4": *
#import "@preview/diagraph:0.3.0"
#show: mantys.with(
..toml("../typst.toml"),
examples-scope: dictionary(diagraph),
)
= Drawing graphs
To draw a graph you have two options: #cmd[raw-render] and #cmd[render]. #cmd[raw-render] is a wrapper around the #cmd[render] and allow to use raw block as input.
#command(
"render",
arg("dot"),
arg("labels", (:)),
arg("xlabels", (:)),
arg("edges", (:)),
arg("clusters", (:)),
arg("engine", "dot"),
arg("width", auto),
arg("height", auto),
arg("clip", true),
arg("debug", true),
arg("background", none),
)[
#argument("dot", types: ("string"))[
The dot code to render.
]
#argument("labels", types: ((:)))[
Nodes labels to overwrite. The dictionary is indexed by the node name.
#example(````
#raw-render(```
digraph G {
rankdir=LR
A -> B
B -> A
}
```,
labels: ("A": "Node A", "B": "Node B")
)
````)
]
\
\
\
\
\
#argument("xlabels", types: ((:)))[
Nodes labels to overwrite. The dictionary is indexed by the node name.
#example(````
#raw-render(```
digraph G {
rankdir=LR
A -> B
B -> A
}
```,
xlabels: ("A": "Node A", "B": "Node B")
)
````)
]
#argument("edges", types: ((:)))[
Edges labels to overwrite. The dictionary keys are source nodes. The values are dictionaries indexed by the target node. Each edge is one dictionary or multiple ones designating multiple edges.
Valid keys are:
- `label`: The label of the edge.
- `xlabel`: The xlabel of the edge.
- `taillabel`: The taillabel of the edge.
- `headlabel`: The headlabel of the edge.
Instead of a dictionary, you can only specify a content value. In this case, the content is used as the label of the edge.
#example(````
#raw-render(
```
digraph G {
rankdir=LR
A -> B
B -> A
}
```,
edges: (
"A": ("B": "Edge A->B"),
"B": ("A": "Edge B->A"),
),
)
````)
]
#argument("clusters", types: ((:)))[
Clusters labels to overwrite. The dictionary is indexed by the cluster name.
#example(````
#raw-render(```
digraph G {
rankdir=LR
subgraph cluster_0 {
A -> B
}
}
```,
clusters: ("cluster_0": "Cluster 0")
)
````)
]
#argument("engine", types: ("string"))[
The engine to use to render the graph. The currently supported engines are:
#list(..diagraph.engine-list().engines)
]
#argument("width", types: (1em, 1%))[
The width of the rendered image.
]
#argument("height", types: (1em, 1%))[
The height of the rendered image.
]
\
#argument("clip", types: (true))[
Whether to hide part of the graphs that goes outside the bounding box given by graphviz.
]
#argument("debug", types: (true))[
Show debug boxes around the labels.
]
#argument("background", types: (none, "color"))[
The background color of the rendered image. `none` means transparent.
]
]
= Fonts, colors and sizes
If you don't overwrite the labels, the specified graphviz font, color and size will be used. However, the fonts are not necessarily the same as the graphviz fonts. If you want to use a font, it must be accessible by Typst. For colors, you can us any valid graphviz color you want as they are converted to Typst colors automatically. Font size works as usual. If you overwrite a label, the font, color and size will be the ones used by Typst where the graph is rendered.
#example(````
#raw-render(```
digraph G {
rankdir=LR
A1 -> B1
A1[color=orange, fontname="Impact", fontsize=20, fontcolor=blue]
B1[color=red, fontname="Fira Sans", fontsize=20, fontcolor=green]
}
```)
````)
The same goes for edges and clusters.
#example(````
#raw-render(```
digraph G {
rankdir=LR
subgraph cluster_0 {
label="Custom label"
fontname="DejaVu Sans Mono"
fontcolor=purple
fontsize=25
A -> B
}
}
```)
````)
#example(````
#raw-render(```
digraph G {
rankdir=LR
edge [color=red, fontname="Impact", fontsize=20, fontcolor=blue]
A -> B[label="one"]
A -> C[label="two"]
B -> C[label="three"]
}
```)
````)
= Automatic math mode detection
Diagraph tries to automatically detect simple math expressions. Single letters, numbers, and greek letters are automatically put in math mode.
#example(````
#raw-render(```
digraph {
a -> alpha
phi -> rho
rho -> a
tau -> omega
phi -> a_8
a_8 -> alpha
a_8 -> omega
alpha_8 -> omega
}
```)
````)
= Examples
Those examples are here to demonstrate the capabilities of diagraph. For more information about the Graphviz Dot language, you can check the #underline(link("https://graphviz.org/documentation/", "official documentation")). Some of the following examples are taken from the #underline(link("https://graphviz.org/gallery/", "graphviz gallery")).
#example(````
#raw-render(
```
digraph {
rankdir=LR
node[shape=circle]
Hmm -> a_0
Hmm -> big
a_0 -> "a'" -> big [style="dashed"]
big -> sum
}
```,
labels: (
big: [_some_#text(2em)[ big ]*text*],
sum: $ sum_(i=0)^n 1 / i $,
),
width: 100%,
)````
)
#example(````
#raw-render(```
digraph finite_state_machine {
rankdir=LR
size="8,5"
node [shape=doublecircle]
LR_0
LR_3
LR_4
LR_8
node [shape=circle]
LR_0 -> LR_2 [label="SS(B)"]
LR_0 -> LR_1 [label="SS(S)"]
LR_1 -> LR_3 [label="S($end)"]
LR_2 -> LR_6 [label="SS(b)"]
LR_2 -> LR_5 [label="SS(a)"]
LR_2 -> LR_4 [label="S(A)"]
LR_5 -> LR_7 [label="S(b)"]
LR_5 -> LR_5 [label="S(a)"]
LR_6 -> LR_6 [label="S(b)"]
LR_6 -> LR_5 [label="S(a)"]
LR_7 -> LR_8 [label="S(b)"]
LR_7 -> LR_5 [label="S(a)"]
LR_8 -> LR_6 [label="S(b)"]
LR_8 -> LR_5 [label="S(a)"]
}
```,
labels: (
"LR_0": $"LR"_0$,
"LR_1": $"LR"_1$,
"LR_2": $"LR"_2$,
"LR_3": $"LR"_3$,
"LR_4": $"LR"_4$,
"LR_5": $"LR"_5$,
"LR_6": $"LR"_6$,
"LR_7": $"LR"_7$,
"LR_8": $"LR"_8$,
),
edges:(
"LR_0": ("LR_2": $S S(B)$, "LR_1": $S S(S)$),
"LR_1": ("LR_3": $S(dollar"end")$),
"LR_2": ("LR_6": $S S(b)$, "LR_5": $S S(a)$),
),
width: 100%,
)
````) |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/suiji/0.1.0/README.md | markdown | Apache License 2.0 | # Suiji
[Suiji](https://github.com/liuguangxi/suiji) (随机 in Chinese, /suíjī/, meaning random) is a high efficient random number generator in Typst. Partial algorithm is inherited from [GSL](https://www.gnu.org/software/gsl) and many APIs are similar to [NumPy Random Generator](https://numpy.org/doc/stable/reference/random/generator.html).
Suiji provides pure function implementations of all its features, and does not rely on `counter` or `state`, resulting in better performance and independency. Functionally, it can completely replace related functions in LaTeX package `pgfmath`.
## Features
- All functions are immutable, which means results of random are completely deterministic.
- Core random engine chooses "Maximally equidistributed combined Tausworthe generator", which has higher quality and efficiency compared with other algorithms like LCG, MT19937, etc.
- Generate random integers of the parameterized interval.
- Generate random floats uniformly distributed over the parameterized interval.
- Generate random floats from a normal distribution.
- Randomly shuffle the array of objects.
## Example
The example below uses `suiji` and `cetz` package to create a trajectory graph of a random walk.
```typ
#import "@preview/suiji:0.1.0": *
#import "@preview/cetz:0.2.1"
#set page(width: auto, height: auto, margin: 0.5cm)
#cetz.canvas(length: 6pt, {
import cetz.draw: *
let n = 2000
let (cx, cy) = (0, 0)
let (cx-new, cy-new) = (0, 0)
let rng = gen-rng(42)
let v = 0
let col = blue
for i in range(n) {
(rng, v) = uniform(rng, low: -1.0, high: 1.0)
cx-new = cx + v
(rng, v) = uniform(rng, low: -1.0, high: 1.0)
cy-new = cy + v
col = color.mix((blue.transparentize(20%), 1-i/n), (green.transparentize(20%), i/n))
line(stroke: (paint: col, cap: "round", thickness: 1.5pt),
(cx, cy), (cx-new, cy-new)
)
(cx, cy) = (cx-new, cy-new)
}
})
```

## Usage
The idea of `suiji` is creating the random number generator object by `gen-rng` function, and then call other functions like `integers` with the random number generator object before as argument.
Note that a seed (integer) must be provided to `gen-rng` function. Due to the immutability of the functions, the random number generator object should exist in both input and output argument in all other functions. It seems a little inconvenient, but this is limited by the programming paradigm.
The code below generates several random permutations of 0 to 9. Each time function `shuffle` is called, the value of variable `rng` is updated.
```typ
#import "@preview/suiji:0.1.0": *
#{
let rng = gen-rng(42)
let a = ()
for i in range(5) {
(rng, a) = shuffle(rng, range(10))
[#(a.map(it => str(it)).join(" ")) \ ]
}
}
```

## Reference
### `gen-rng`
Initialized the random number generator.
```typ
gen-rng(seed) -> rng
```
**Arguments:**
- `seed` : [`integer`] — value of seed, an integer.
- `rng` : [`object`] — generated object of random number generator.
### `integers`
Return random integers from `low` (inclusive) to `high` (exclusive).
```typ
integers(rng, low: 0, high: 100, size: 1) -> (rng, arr)
```
**Arguments:**
- `rng` : [`object`] — object of random number generator, both for input and output.
- `low` : [`integer`] — lowest (signed) integers to be drawn from the distribution, optional.
- `high` : [`integer`] — one above the largest (signed) integer to be drawn from the distribution, optional.
- `size` : [`integer`] — returned array size, must be positive integer, optional.
- `arr` : [`integer` or `array`] — single random number if `size` = 1 otherwise array of random numbers.
### `random`
Return random floats in the half-open interval [0.0, 1.0).
```typ
random(rng, size: 1) -> (rng, arr)
```
**Arguments:**
- `rng` : [`object`] — object of random number generator, both for input and output.
- `size` : [`integer`] — returned array size, must be positive integer, optional.
- `arr` : [`float` or `array`] — single random number if `size` = 1 otherwise array of random numbers.
### `uniform`
Draw samples from a uniform distribution. Samples are uniformly distributed over the half-open interval [`low`, `high`) (includes `low`, but excludes `high`).
```typ
uniform(rng, low: 0.0, high: 1.0, size: 1) -> (rng, arr)
```
- `rng` : [`object`] — object of random number generator, both for input and output.
- `low` : [`float`] — lower boundary of the output interval, optional.
- `high` : [`float`] — upper boundary of the output interval, optional.
- `size` : [`integer`] — returned array size, must be positive integer, optional.
- `arr` : [`float` or `array`] — single random number if `size` = 1 otherwise array of random numbers.
### `normal`
Draw random samples from a normal (Gaussian) distribution.
```typ
normal(rng, loc: 0.0, scale: 1.0, size: 1) -> (rng, arr)
```
- `rng` : [`object`] — object of random number generator, both for input and output.
- `loc` : [`float`] — float, mean (centre) of the distribution, optional.
- `scale` : [`float`] — float, standard deviation (spread or width) of the distribution, must be non-negative, optional.
- `size` : [`integer`] — returned array size, must be positive integer, optional.
- `arr` : [`float` or `array`] — single random number if `size` = 1 otherwise array of random numbers.
### `shuffle`
Return a new sequence by shuffling its contents.
```typ
shuffle(rng, arr) -> (rng, arr)
```
- `rng` : [`object`] — object of random number generator, both for input and output.
- `arr` : [`array`] — array of objects, both for input and output.
|
https://github.com/Enter-tainer/typst-preview | https://raw.githubusercontent.com/Enter-tainer/typst-preview/main/addons/vscode/CHANGELOG.md | markdown | MIT License | # Change Log
All notable changes to the "typst-preview" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## v0.11.7 - [2024-06-09]
Thanks @7sDream for this release!
- Add supports for setting `sys.inputs` in configuration
- Add support for ignoring system fonts.
## v0.11.6 - [2024-05-19]
- Add extension icon designed by Zoknatwrd and QuarticCat🔮
## v0.11.5 - [2024-05-19]
- Bump to typst v0.11.1
- Show activity bar icon only when current file is a typst file
## v0.11.4 - [2024-04-09]
- Fix version in nix build
- Fix desync in firefox
## v0.11.3 - [2024-03-25]
- Bump to typst.ts 0.5.0-rc1
## v0.11.2 - [2024-03-21]
- Fix:
- #254 Zoom regression in 0.10.8 is now fixed
- #270 Wrong webview panel location when using 2-row layout
- Fix preview button being slow when using tinymist
## v0.11.1 - [2024-03-18]
- Fix:
- remove windows-ia32. It is not supported by vscode anymore.
## v0.11.0 - [2024-03-18]
- Features:
- Upgrade to typst v0.11.0
- typst-preview is available on crate.io now. You can install it by running `cargo install typst-preview`. You can also use it as a library in your project by adding `typst-preview` to your `Cargo.toml`.
## v0.10.10 - [2024-03-13]
- Features:
- Upgrade to typst v0.11.0-rc1(master, 48820fe69b8061bd949847afc343bf160d05c924)
- Bug fixes:
- Fix gradient color being rendered incorrectly
## v0.10.9 - [2024-03-10]
- Features:
- Upgrade to typst v0.11.0-rc1
- Bug fixes:
- May fix a bug when typst preview cannot launch on some windows machines
- Fix jumping view while zooming
- Fix cannot use relative path in `typst-preview.fontPaths`
## ~~v0.11.0-rc1 - [2024-03-10]~~
- Features:
- Upgrade to typst v0.11.0-rc1
- Bug fixes:
- May fix a bug when typst preview cannot launch on some windows machines
- Fix jumping view while zooming
- Fix cannot use relative path in `typst-preview.fontPaths`
## v0.10.8 - [2024-02-19]
- Features:
- Add favicon when opening the preview in browser (#239)
- Add drag to scroll. You can now drag the preview panel to scroll.
- Bug fixes:
- fix sensitive scale on touchpad (#244)
- The vscode extension will check the server version before starting.
- Misc:
- Add async tracing and add a new command `typst-preview.showAwaitTree` to pop a message and copy the async tree to clipboard. This is useful for debugging.
- Add split debug symbol for the server.
-
## v0.10.7 - [2024-01-25]
- Features:
- Jump to source is more accurate now.
- Add a config to invert color in preview panel. See `typst-preview.invertColors`.
- Allow config scroll sync mode. See `typst-preview.scrollSync`
- (Experimental) Improve cursor indicator.
## v0.10.6 - [2024-01-17]
- Bug fixes:
- fix a bug which cause the preview panel no longer updates as you type
## v0.10.5 - [2024-01-14]
- Bug fixes:
- fix a bug that fails to incrementally rendering pages with transformed content
- fix #141: glyph data desync problem, corrupting state of webview typically after your editor hibernating and coming back.
- Features:
- performance is now improved even further. We now use a more efficient way to render the document.
## v0.10.4 - [2024-01-05]
- Bug fixes:
- Fix open in browser. It's broken in v0.10.3.
- Features:
- Improve incremental rendering performance.
## v0.10.3 - [2024-01-01]
- Bug fixes:
- Thanks to new rendering technique, scrolling in no longer laggy on long document.
- Features:
- We now automatically declare the previewing file as entrypoint when `typst-preview.pinPreviewFile` is set to `true`. This is like the eye icon in webapp. This should improve diagnostic messages for typst lsp. You can enable this by setting `typst-preview.pinPreviewFile` to `true`.
## v0.10.2 - [2023-12-18]
- Bug fixes:
- fix scrollbar hiding
## v0.10.1 - [2023-12-17]
- Features:
- Improve thumbnail side panel and outline. Now it is clickable and you can jump to the corresponding page.
- Bug fixes:
- Improve performance for outline generation.
## v0.10.0 - [2023-12-05]
- Features:
- Bump to typst v0.10.0
## v0.9.2 - [2023-11-23]
- Features:
- You can now enable a preview panel in the sidebar. See `typst-preview.showInActivityBar`.
- A new keybinding is added. You can trigger preview by using `Ctrl`/`Cmd` + `k` `v` now.
- Bug fix:
- Scroll to cursor on 2-column documents is now improved.
## v0.9.1 - [2023-11-17]
- Features:
- #160: Slides mode is available now! You can enable use `typst-preview.preview-slide` command.
- Allow adjust the status bar item
- Bug fixes:
- Previously the `Compiling` status is never sent to the status bar item. This is now fixed.
- #183 #128 Various rendering fix.
## v0.9.0 - [2023-10-31]
- Features:
- Update to typst v0.9.0
- Add a status indicator in status bar. When compile fails, it becomes red. Clicking on it will show the error message.
- Bug fixes:
- #143 Scrolling is not that laggy now
- #159 Fix a clip path bug
## v0.8.3 - [2023-10-28]
- Bug fixes:
- #152 Do not pop up error message when the preview window is closed
- #156 Fix shaking scrollbar/border
- #161 #151 Should not panic when the file is not exist
- Features:
- #157 Add a rough indicator for the current cursor position in the preview panel. You may enable this in configuration.
## v0.8.2 - [2023-10-20]
- Features:
- #142 The scroll position of the preview panel is now preserved when you switch between tabs.
- #133 We now provide a button to show log when the server crashes. This should make debugging easier. You may also use the command `typst-preview.showLog` to show the log.
- #129 A `--version` flag is now provided in the cli
- Bug fixes:
- #137 Previously preview page might go blank when saving the file
- #130 Previously you cannot watch a file in `/tmp`
- #118 Previously the preview page might flash when you save the file
## v0.8.1 - [2023-09-24]
- Bug fixes:
- #121: Disable darkreader for preview panel. This should fix the problem where the preview panel is invisible when darkreader is installed in the browser.
- #123: Fix a VDOM bug which may cause color/clip-path desync.
- #124: Fix a race condition which may cause the webview process messages out of order, resulting in blank screen.
- #125: Resizing the preview panel is not that laggy now.
- Features:
- #120: We now show page breaks and center pages horizontally. By default we will choose the `vscode-sideBar-background` color as the page break color. If it is not distinguishable from white, we will use rgb(82, 86, 89) instead.
## v0.8.0 - [2023-09-17]
- Upgrade to typst v0.8.0
- Fix #111: Previously stroke related attributes are not rendered correctly. This is now fixed.
- Fix #105: The compiler will panic randomly. This is now fixed.
- Upstream bug fixes: <https://github.com/Myriad-Dreamin/typst.ts/releases/tag/v0.4.0-rc3>
## v0.7.5 - [2023-09-01]
- Fix #107: now VSCode variables like `${workspaceFolder}` can be used in `typst-preview.fontPaths`.
- Fix cannot open multiple preview tabs at the same time.
## v0.7.4 - [2023-08-29]
- Typst Preview Book is now available at <https://enter-tainer.github.io/typst-preview/> ! You can find the documentation of Typst Preview there.
- Improved standalone usage: Use `typst-preview` without VSCode now becomes easier. All you need is `typst-preview --partial-rendering cool-doc.typ`. Take a look at <https://enter-tainer.github.io/typst-preview/standalone.html>
- Upgrade to typst.ts 0.4.0-rc2. This fixes a subtle incremental parsing bug.
- Partial rendering is now enabled by default. This should improve performance on long document. You can disable it by setting `typst-preview.partialRendering` to `false`.
## v0.7.3 - [2023-08-20]
- Bugfix: fix a subtle rendering issue, [typst.ts#306](https://github.com/Myriad-Dreamin/typst.ts/pull/306).
## v0.7.2 - [2023-08-20]
- Bug fixes:
- #79: We now put typst compiler and renderer in a dedicate thread. Therefore we should get more stable performance.
- #78: Currently only the latest compile/render request is processed. This should fix the problem where the preview request will queue up when you type too fast and the doc takes a lot of time to compile.
- #81: We now use a more robust way to detect the whether to kill stale server process. This should fix the problem where the when preview tab will become blank when it becomes inactive for a while.
- #87: Add enum description for `typst-preview.scrollSync`. Previously the description is missing.
## v0.7.1 - [2023-08-16]
- Bug fixes:
- fix #41. It is now possible to use Typst Preview in VSCode Remote.
- fix #82. You can have preview button even when typst-lsp is not installed.
- Misc: We downgrade the ci image for Linux to Ubuntu 20.04. This should fix the problem where the extension cannot be installed on some old Linux distros.
## v0.7.0 - [2023-08-09]
- Upgrade to typst v0.7.0
- Bug fixes
- #77 #75: Previously arm64 devices will see a blank preview. This is now fixed.
- #74: Previously when you open a file without opening in folder, the preview will not work. This is now fixed.
## v0.6.4 - [2023-08-06]
- Rename to Typst Preview.
- Add page level partial rendering. This should improve performance on long document. This is an experimental feature and is disabled by default. You can enable it by setting `typst-preview.partialRendering` to `true`.
- The binary `typst-preview` now can be used as a standalone typst server. You can use it to preview your document in browser. For example: `typst-preview ./assets/demo/main.typ --open-in-browser --partial-rendering`
- Fix #70: now you can launch many preview instances at the same time.
## v0.6.3 - [2023-07-29]
- Fix #13, #63: Now ctrl+wheel zoom should zoom the content to the cursor position. And when the cursor is not within the document, the zoom sill works.
## v0.6.2 - [2023-07-25]
- Fix #60 and #24. Now we watch dirty files in memory therefore no shadow file is needed. Due to the removal of disk read/write, this should also improve performance and latency.
- Preview on type is now enabled by default for new users. Existing users will not be affected.
## v0.6.1 - [2023-07-14]
- Fix empty file preview. Previously, if you start with an empty file and type something, the preview will not be updated. This is now fixed.
## v0.6.0 - [2023-07-06]
- Upgrade to typst v0.6.0
- Bug fixes:
- #48: Webview cannot load frontend resources when VSCode is installed by scoop
- #46: Preview to source jump not working after inserting new text in the source file
- #52: Bug fix about VDOM operation
- Enhancement
- #54: Only scroll the preview panel when the event is triggered by mouse
## v0.5.1 - [2023-06-30]
- Performance improvement(#14): We now use typst.ts. We utilize a [virtual DOM](https://en.wikipedia.org/wiki/Virtual_DOM) approach to diff and render the document. This is a **significant enhancement** of previewing document in `onType` mode in terms of resource savings and response time for changes.
- Cross jump between code and preview (#36): We implement SyncTeX-like feature for typst-preview. You can now click on the preview panel to jump to the corresponding code location, and vice versa. This feature is still experimental and may not work well in some cases. Please report any issues you encounter.
- Sync preview position with cursor: We now automatically scroll the preview panel to the corresponding position of the cursor. This feature is controlled by `typst-preview.scrollSync`
- Open preview in separate window(#39): You can type `typst-preview.browser` in command palette to open the preview page in a separate browser.
- Links in preview panel: You can now click on links in the preview panel to open them in browser. The cross reference links are also clickable.
- Text selection in preview panel: You can now select text in the preview panel.
## v0.5.0 - [2023-06-10]
- Upgrade to typst v0.5.0
## v0.4.1 - [2023-06-07]
- Makes the WebSocket connection retry itself when it is closed, with a delay of 1 second.
## v0.4.0 - [2023-06-07]
- Upgrade to typst v0.4.0
## v0.3.3 - [2023-05-11]
- Fix nix-ld compatibility by inheriting env vars(#33)
## v0.3.1 - [2023-05-04]
- Publish to OpenVSX
- allow configuring font paths
## v0.3.0 - [2023-04-26]
- Upgrade typst to v0.3.0
- Fix panic when pages are removed
## v0.2.4 - [2023-04-21]
- Automatically choose a free port to listen. This should fix the problem where you can't preview multiple files at the same time.
- Server will exit right after client disconnects, preventing resource leak.
## v0.2.3 - [2023-04-20]
- Performance Improvement: only update pages when they are visible. This should improve performance when you have a lot of pages.
## v0.2.2 - [2023-04-16]
- Fix server process not killed on exit(maybe)
- Add config for OnSave/OnType
- Add output channel for logging
## v0.2.1 - [2023-04-16]
- Bundle typst-ws within vsix. You no longer need to install typst-ws
## v0.1.7 - [2023-04-10]
- Preview on type
- Add config entry for `typst-ws` path
## v0.1.6 - [2023-04-09]
Add preview button
## v0.1.0 - [2023-04-09]
Initial release
|
https://github.com/zomvie-break/cv-typst | https://raw.githubusercontent.com/zomvie-break/cv-typst/main/modules/projects.typ | typst | Apache License 2.0 | #import "../brilliant-CV/template.typ": *
#cvSection("Projects")
#cvEntry(
title: [Personal website],
society: [chroniclesofhades.com],
date: [2023 - Present],
location: [Bangkok, Thailand],
description: list(
[Used NextJS to render dynamic content on the server for improved SEO ],
[Styled and added responsive design using TailwindCSS],
[Used Docker to contain the NextJS, Django, and NGINX servers],
[Deployed the website on an EC2 in AWS],
),
tags: ("Django", "NextJS", "TailwindCSS", "Docker", "AWS")
)
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/053%20-%20Wilds%20of%20Eldraine/003_Episode%203%3A%20Two%20Great%20Banquets.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Episode 3: Two Great Banquets",
set_name: "Wilds of Eldraine",
story_date: datetime(day: 10, month: 08, year: 2023),
author: " <NAME>",
doc
)
#emph[Rowan, ]
#emph[I hope this finds you ...]
#emph[I can't say it'll find you well when I know that you aren't. You're angry, you're frustrated. I understand. Nothing makes sense anymore. ]
#emph[Since you left, I've worried about you every day. Losing control at the mountain, taking off—you're trying to help, but you're driving yourself half to death. What we're dealing with isn't something anyone should face alone. We're family. ]
#emph[Please come home. I know you're hurting, but together, we can find some way to help. ]
#emph[Your brother always, ]
#emph[Will]
Rowan reads the missive once. Her brother's neat handwriting stares back at her from the page. #emph[I know you're angry. I understand. We can find some way to help.]
If he understood, he'd be here. And if he wanted to help, he'd also be here. Instead, she sits on her own in a Wealdrum tavern. The courier, wearing Kenrith livery, lingers in wait of a response.
She tries to think of one. #emph[I'm right to be angry. Our world is collapsing around us, and we don't have any clear answers. You want to sit at home and wait for them to show up. I'm tired of waiting. ] #emph[Why does that make you so afraid of me? ]
The messenger approaches. Rowan still has an empty page before her. She folds it in three, then hands it to her brother's servant. "Give him this, and tell him to come find me if he's serious."
A curt smile. A nod. The messenger leaves.
Rowan returns to her drink, seeing in it her own reflection. The face that had so frightened Will at the mountain.
It doesn't look so frightening to her.
What remains of Ardenvale awaits the knight errant. A veil of mist lays over the hills and valleys, concealing the metal bodies beneath. If she takes a false step she will tumble from her horse into a trench of Phyrexians.
As she nears the castle she sees more and more of the Wicked Slumber's violet swirl. By the time she stands at the shattered gates she must take great care where her feet fall.
Yet Rowan does not take great care.
#figure(image("003_Episode 3: Two Great Banquets/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
A blast of lightning widens a hole in the great oaken gates. She steps through, the scent of burning wood clinging to her cloak, and climbs the violet-cloaked stairs.
She makes it only five steps before she sees the knights.
Worthy they are, though their armor bears the patina of ill use: each as strong and stout as they had been last Rowan saw them. For she knows these helms, these suits of plate, these people. Her comrades stand with weapons at the ready.
Worst of all: each one is bedecked in the Slumber's mist. Like the strings of an unseen puppeteer it rises from every limb and weapon. While the knights themselves do not move, the mist is more than canny enough to move them: an arrow fired by one of her former archery instructors misses her by a coin's breadth.
Must this war continue to take from her? Her chest aches.
"It's me," she calls to them. "It's Ro! Wake up!"
Another arrow fired, this one struck down in mid-flight. The lump in Rowan's throat grows. Fighting seems the only option.
Readying her blade, she begins her climb through the melee.
Syr Saxon, a ranger of generous heart, and Syr Joshua the Beast Tamer once spent all their waking hours together. The same is true now that the sleep has taken them. Saxon swings his bone axe, a blow she must parry; Joshua seizes the opening to bring his warhammer down on her leg.
Pain ignites her vision. The old headache returns, as if summoned.
Rowan scrambles away from Joshua. Aiming at his feet and Saxon's, she channels another blast. Both men are thrown from their feet, metal clattering as they hit the wall nearby. Slumber keeps their bodies limp—in this case, a good thing. Staying limp is the best way to avoid injury at times like that.
Syr Joshua told her so.
Head ringing, sorrows heavy as a crown, she ducks another oncoming arrow. Swords, hammers, sickles, and clubs all rise to meet her on the stair. Her old companions do their best to break her bones. Weaving around them is the best thing she can do—but that won't suffice in every case. More than once she's forced to let out another blast. Each one leaves behind a bigger crater than the last.
And each one feels more thrilling.
She'd like to deny it, but that is the truth of the matter. Even as she worries for her friends she finds her blood singing with the melody this new power's brought her. And that, in turn, makes it easier to draw upon. No matter how often she tells herself that this is enough, she must keep from losing control ...
It's all too easy to do.
When she finds her way to the top of the steps, the knights lay resting beneath her. She looks into the charred ruin that once was the castle.
And there she finds more knights waiting. Beneath foreign banners they stand, weapons in hand, heads turned toward her. For months no one has lived in Castle Ardenvale, yet these knights wear their courtroom finery in place of their armor. Each one is dressed to sweep someone off their feet. A plush violet carpet leads beyond a veil of shifting shadow.
Gripping her sword, Rowan advances. Sparks crackle in her hand and along her blade's edge. Should anyone come near—well, isn't it better to finish fights as fast as you can? Isn't that the merciful thing to do?
#figure(image("003_Episode 3: Two Great Banquets/02.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
She expects the knights to attack her as they did along the stair. They do, though not so directly. Instead of charging at her outright they waltz toward her, some holding partners in their free hands. Even the terrible dancers move with uncanny grace through the ruins of Castle Ardenvale. Couples part only long enough to slice at her before returning to their strange dance.
Avoiding one lunge sends her into the path of an overhead cut; ducking that leaves her open to a halberd's swing. She raises an arm to block only for someone to take her hand and pull her further into the eerie celebrations. Dozens of knights press in, a swirling garden of the slumbering. Rowan cannot move without touching another. Her sword is wrested from her hand; her breath catches in her throat. Indecision is a pillory.
The crowd moves her along, each pair of dancers a cog. The swords are coming, she knows they are, but she has to find some way to get through.
She reaches for the swaying veil with her free hand—
—only for a pale white palm to press against her own. "Welcome to the Court of the Ardent Queen, Rowan Kenrith."
All at once, the silent dancing comes to a halt. Then, as one, they drop to their knees.
Rowan's erstwhile partner remains standing. A being of strange and terrible beauty, their face hollowed like a chalice, studies her. Smoke rises from the pits where their eyes should be. A cruel mouth smiles as the figure inclines their head. "We have been waiting for you."
Rowan reaches for her sword out of habit—only to remember she lost it in the thick of the crowd. She cannot spot it among the kneeling. "You're Ashiok. I've heard of you."
They only grin, revealing a mouth of pointed teeth.
"What are you doing here?" Does she mean on Eldraine, or Castle Ardenvale? She isn't sure.
"I am a friend and counselor to the one you seek here. She has done #emph[extraordinary ] work so far." They glide past her, the air cooler where they've touched it. A simple gesture behind her, and one of the knights produces her sword. He holds it out to her, laid across the flats of his palms. The figure squeezes her shoulder. "Go on. That is what you were looking for, isn't it?"
She's seen this tableau before. Her father and mother knighting the latest worthies. The crowns upon their heads. The crown she'd seen in her vision.
Rowan's hackles rise. She takes the sword. "Let these people go," she says—but she does not yet raise the blade against the mysterious figure.
"Are you certain that's what you want?" they ask.
"I am. They're my friends, and they've suffered enough without your meddling," Rowan says. "If you can control the sleepers, you're the one who cursed us, aren't you?"
Their smile reveals two rows of pointed teeth. "The one who cursed you lays there, beyond the veil. Do you wish to speak with her?"
Rowan grits her teeth. She does not wait for the figure to guide her but takes off on her own. When they reach the gauzy gray, it is the figure who parts it for her.
On the other side is a full feasting table with a beautiful woman in black at its head. The woman lifts a goblet toward her—in her other hand, Rowan sees, is a glass apple with strands of translucent violet snaking out. Magic. "<NAME>. A pleasure, and an honor, to finally meet you. Has anyone told you you look just like your mother?"
The faceless figure pulls out a chair for her. Rowan ignores them, walking straight to the woman. "Whoever you are, you have some nerve. That woman's got nothing to do with this," she says. She lifts the sword overhead, then brings it down in a mighty swing. That she stops a hairsbreadth from the woman's face is testament to her newfound control. Rowan wants nothing more than to rid the world of her—of this curse. "Did you call me here just to make sick jokes? "
The woman makes no move to stop her, nor even to stand. She sips from her goblet. "Dear Rowan, I brought you here because I admire the fire within you."
A knight is prepared to face all manner of weapons on the battlefield: swords, pikes, arrows, hammers. What they are not prepared for—and, indeed, what Rowan has never trained against—is such disarming sincerity. Her grip wavers. "What?"
The woman smiles. She lays her manicured fingers on Rowan's knuckles, gently easing the sword from its path. "The others are afraid of you, aren't they? Your comrades. Your people. Even your siblings."
Rowan swallows. "You don't know anything about them."
"Yet you haven't told me I'm wrong," the woman says. She never looks away—her eyes are rich as mead. "Your father's family tells you that you've changed. Your brother hardly recognizes you. You're in awful pain, and yet all he can seem to do is try to 'fix' you. Isn't that right, darling?"
Rowan's mouth opens. She cannot force any words to come out.
The woman rises to her feet. Rowan lets her. Just as her mother had so many times, she clears a shock of hair from Rowan's face. "I know what it's like to have your family turn their backs on you. But I won't."
Why does it ... Why does it feel like this? To be seen in this way? Rowan's breathing is shakier than she'd like to admit.
"You've been working so hard to keep everyone safe. Since the attack, that's all you can think about, looking after the Realm, your father's family. Making sure no one hurts you ever again," says the woman. She sits once more. "You wanted to know why I brought you here. Why I created the Wicked Slumber. Just like you, I wanted to keep my people safe. The invaders had no hope of standing against something like this. That it spread to the others is ... unfortunate, but even in that misfortune, I've discovered something beautiful. Would you like to know what that is, <NAME>?"
Her mouth has gone dry, her headache pounding harder than ever. If this woman wanted Rowan dead, surely she would be. And if the Wicked Slumber truly had come about as a way to stop the invasion ...
Her mother urging her to hurry, her father planting his feet for a hopeless last stand.
What if Rowan could have stopped it? What if she could have put the invaders to sleep, as this woman had?
"I would," she says. "I would like to know."
The woman's smile is warm as spiced wine. She turns to the stranger. "Ashiok, if you would?"
A blink, a moment of darkness, no more than that. When she opens her eyes again her parents are standing at the woman's side. There is her father, whole as he'd been in the vision; her mother, beaming and proud. Rowan, for whom words have failed, rushes into the arms of her parents.
Only for them to fade after she's closed her arms around them.
Rowan's whimper is not that of a knight, nor that of a woman grown—it is the whimper of a child carried from a cabin, too young to understand what had just happened. How cold she feels, standing where they stood moments ago!
"It felt real, didn't it?" the woman asks.
Rowan can only nod, staring at her hand. A little of their warmth still clings to her skin. "Was it ... was it you who sent the first vision?"
"With assistance from my own mentor, yes," the woman answers.
"My father said I would find my blood here," Rowan says. Her voice begins to waver. "You said I looked like my mother. You didn't mean Linden."
The woman's smile is oddly nostalgic. It occurs to Rowan why—she smiles the very same way. "No, I didn't."
"That woman killed me and my brother. She was going to drink our blood," Rowan says. Every word is a cut.
"My sisters have never been known for their wisdom—only their ambition," the woman says. "Your mother was the cruelest of us. Make no mistake, your father was right to strike her down, and Linden right in saving you. But that doesn't erase the magic in your blood, Rowan. You can use it for something good. You have the opportunity to redeem our line, to grant the Realm a boon unlike any other."
Anger in her heart. She stares down at her hands, already covered in blood. How long had she denied that part of her? The blast at the mountain. Her difficulty with control. What if the witch's blood was at its core? And the dream this woman had granted her ... how long had it been since Rowan was that happy?
"Why didn't they ever tell me about you?"
The woman tuts. "I imagine they didn't want you following in our footsteps. But that hardly matters now."
Rowan swallows. The storm inside her is almost too much to bear.
"Everyone you've seen on the way here—every dreamer in the Realm—experiences the same thing," says the woman. "Whatever they've lost has returned to them. In glad halls they celebrate the Realm's victory, surrounded by all those they hold dear. Picturesque meadows away from all the turmoil, the lap of a loved companion—wherever they wish to be, that is where they are. Where they will remain. No worries, no fears."
"People need more than dreams," Rowan manages. Yet it feels hollow even to say such a thing. Given the opportunity to spend eternity in a dream with her parents ... Could this cursed blood of hers grant that to the whole Realm?
"Some do. They can remain awake. But for those who seek escape, well, I've found a way to grant it to them. Their bodies yet serve my will, but their minds are elsewhere."
Rowan takes a steadying breath. "The Slumber doesn't pick and choose who it takes. You aren't approaching them one by one and asking. Whatever your will is—"
"My will is the same as yours, Rowan. I want to keep the Realm safe. I want to lead it. I want #emph[power] ," says the woman. "Power to drive off threats, power to secure my own future. Nothing in this world is so certain, so vital, as power. With power, you can command loyalty, grow stronger, endure any challenge thrown your way. To seize it you need courage and knowledge of your enemies; holding it lends you only more. You've come to realize that, haven't you? It's the reason no one respects your brother—and the reason they fear you. You've too much of my sister in you for their tastes. But I know your potential. I can be there for you, the way I never was for her."
Rowan's eyes fall to the ground—to the tiles she'd helped her father pick during the castle's last renovation. She liked the sunburst designs.
People respected her parents. They were fine warriors, kind of heart, and had earned their places.
What had Will done? He is kind of heart, but without the rest, would anyone~?
And isn't keeping people happy the kindest thing she could possibly do? To say nothing of all this woman—her aunt?—had done for the Realm. Before coming here, Rowan thought the Slumber was a curse, but now she sees what a blessing it can be. The Realm's lost so much. Isn't ensuring that it stays whole the right thing, the gallant thing? And while her subjects slumber, she can see to their well-being. With an army of sleepers like this, they could ...
They could unite the Realm. They could turn the curse of their birth into something beautiful.
"You understand, don't you?" the woman says. "I knew you would."
Rowan presses her eyes shut. She can fix it. She can fix everything, if only she could~"Can you ... Can you teach me? To bring people peace in this way, to keep them safe? Can you teach me how to planeswalk again?"
"The spark is gone," says Ashiok, their voice a long, drawn-out hiss. "For you, and for many others."
The woman rises, grinning. "But the rest will be my pleasure. Every ruler needs an heir." She, too, opens her arms. "My name is <NAME>. Welcome home."
As Rowan lays her head on Eriette's shoulder, as she allows herself to relax for the first time in months, she wonders:
Just how long has it been since anyone understood her like this?
#figure(image("003_Episode 3: Two Great Banquets/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)
"All you have to do is keep from looking down."
"Easy for you to say, you've done this before!" Ruby shouts. Halfway up as they are, Ruby is clinging to the stalk as if it owes her money. It sort of does—Peter couldn't make it up the tree with his injuries, but he did give them all his savings so they could hire a guide.
That guide, Troyan, is way up ahead of them. He stands on a leaf the size of a paddock watching Kellan and Ruby climb. "That's not true. I've never climbed a beanstalk, not once."
"You said you were an expert climber," Kellan shouts. The air's thin enough that it hurts him to do so. Troyan looked like a beanstalk climber, blue-skinned and dashing, clad in punchy green and blue, some strange mythical creature with too many arms painted on his coat. The sign he carried even said "professional wanderer and adventurer." That had been the whole reason they hired him! Well, that and how confident he was when they asked him if he knew how to get up the beanstalk.
"I am," he says. "Climbed plenty of spires in my day, won every competition there was to be had. A beanstalk's a pleasant change of pace."
Kellan frowns. His arms hurt, his shoulders ache, and he's finding it harder to breathe, but somehow Troyan is doing just fine despite being higher up. "But ... we hired you ... to help us!"
"Yeah," Ruby says. "Do your job!"
Troyan sighs. "All right, all right, you've got a point," he says. He sits down on the edge of the leaf, then moves his heavy pack to his lap. From it he pulls two glass vials full of oily, slick liquid. The stopper's covered in bulbous warts. "I was saving these for a tough time. They're hard to come by around here, you know. But since you're paying me so well ..."
#figure(image("003_Episode 3: Two Great Banquets/04.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
"Don't sound so smug about it," Ruby chides.
"I guess I can spare two," Troyan finishes. "But you'll have to get here, first."
Ruby groans, and Kellan echoes her. Being a hero isn't all it's cracked up to be. But he has to admit, he's curious about just what those potions do.
He puts his all into it. Fifteen minutes of muscle-burning effort and he crests the leaf. Troyan is kind enough to help him up. He tosses Kellan the vial. With the cap removed, bubbles float onto his skin. One lands on his nose. When it bursts, he smells swamp water, and feels a slight buzzing in his throat. Kellan can no more keep from drinking it than a sheep could keep from grazing. He downs it in a thirsty instant.
His tongue is the first thing to change. Tingling gives way to a stretching sensation, and soon it rolls out of his mouth like a knight's unfurled banner. Next comes his skin, oozing and slick; then a sort of pent up energy in his legs. When he opens his mouth, all that comes out is a greasy croak. Kellan chuckles.
"Pretty cool, huh? Don't worry, it's only temporary," Troyan says. He gestures to the open air above them. "Go on. Jump. Just make sure to mind the landing."
Ruby's hand crests the leaf. Kellan helps her up. On seeing his now bulbous eyes, his lolling tongue, she starts. "What did you do to my friend?" she asks Troyan.
"Ruby, don't worry, I'm fine," Kellan says. He smiles to drive home the point. "I think maybe we can jump all the way up if we drink these."
Ruby squints at them both in turn. "You're asking me to believe a lot, there."
Kellan holds the other vial up. "He's got frogification in a bottle, I think we can trust him on this one," he says.
"If you're going to get up there, you need to get jumping," Troyan cuts in.
Ruby sighs. She glances at the vial, then shakes her head. "I'll hold onto you, Kellan. If these things are so hard to come by, then we'll be better off saving them. Turn around."
Kellan does as he's told. "Where'd you get this, anyway? Did a witch make them for you?" A pause as Ruby climbs on, piggyback style. "Wait. You aren't fae, are you?"
Troyan laughs. "No, no, not at all. Pay me a little more and perhaps I'll tell you how I found them."
"Skinflint," Ruby mutters.
"I heard that."
Kellan laughs. High up as they are, he isn't afraid to look down, not when he feels like this. Whether by lightning's grace or by some other unseen mechanism he feels #emph[alive] . When was the last time he was around such friendly people? People who weren't his family?
"Ready?" he asks.
"Ready."
Kellan, farm boy from Orrinshire, leaps to the sky—and the sky lowers to meet him. Bubbles of swamp water spring from his feet, propelling them higher and higher. A ribbit hits his ears only after they've broken through the clouds. On the other side?
A moonlit castle awaits.
Hurtling toward the ground is less frightening when the ground's close by. Kellan lands with only the slightest of tumbles; he falls face first, but Ruby remains unscathed. She offers him a hand as she admires the castle's brutal, towering facade. "We're really here, huh?" she says. "Stormkeld."
"It's huge," Kellan says. It's hard to keep his mouth from hanging open at the sheer size of it. Giants are big, but until now, he'd never had any indication of just #emph[how ] big. He points to the great doors, each a tower's size on their own. "Look, we can probably walk in right beneath the doors."
"They must not get many human visitors," Ruby says. "We must be like mice to them, coming to steal all their food."
"Only if they catch us," Kellan says. "Coming at night was a good call. I bet everyone's asleep."
Ruby smiles and starts walking along the path. Each flagstone is the size of a horse, taking several steps to traverse. "Listening to me is #emph[always ] the right call, hero," she says.
He shuffles to keep up. "Shouldn't we wait for Troyan?"
"Let him break another record climbing up here if he wants to," Ruby scoffs. "It's what he deserves!"
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
It takes more than an hour's walk to clear the courtyard. Troyan catches up midway through. Sweaty and exhausted but nevertheless undaunted, the three continue on their way to the threshold.
Until the ground begins to quake beneath their feet.
Ruby squats down, Kellan hides his head. Only Troyan remains standing, raising his fingers, swinging them gently side to side. Ruby yanks him down by the sleeve. "I don't know if they have earthquakes up here, but if they do, you need to brace yourself!"
Troyan shakes his head with a smirk. "Try counting the quakes."
A roll of the eye, a puff of air between her lips, Ruby protests but does as asked. All her frustrations fall away as she hears the first strains of distant music and realization sets in. "Huh."
Kellan, as yet uninitiated to the finer world, tries to follow in her footsteps with no success. The quakes stopped and started often—but why were they counting? His brows furrow as he tries to work it out.
Ruby covers his counting hand with her own. "They're dancing," she explains.
"Waltzing, to be specific," adds Troyan. "Which does, unfortunately, mean they're awake."
Waltzing? Kellan has no idea what that is, but he caught his mother and Ronald turning in wide steps around the house once. Maybe it's like that.
"If they're dancing, they won't notice us," he says. "We can still sneak in."
By now he knows what that hum from Ruby means—she's not sure, but she's not going to back down from the challenge. "Let's hope so," she says.
Further they walk, to the threshold itself, a great gate that opens only for the most miniature beings on the beanstalk. Beneath the wooden ceiling they pass. The world that awaits them on the other side would beggar any king of the Realm: beautiful marble arches higher than any parapet, a dome of morning sky overhead, boisterous music that thrums in their lungs, and gilded goblets holding wells full of wine. Most striking of all are the giants themselves. Whether clad in gambeson and mail or taffeta gowns, they make a handsome sight. And a strange one, if all the rumors of giants are to be believed.
"Shouldn't they be doing giant things?" Ruby asks. Though she's shouting, it's hard to hear her over the music.
"Maybe these #emph[are] giant things," Kellan says. When the quakes come, he hops along with them. In the back of his mind he wonders if his father has wings—if he'll have them, too, when he gets older. He hopes so.
"The boy's right. I don't see why they can't enjoy a celebration every now and again. This place certainly needs it after what it's been through," Troyan says.
"Well, I didn't say—It's just that other people don't—" Ruby starts, but she ends in a huff. "Whatever. At least they haven't noticed us. Kellan, do you know where they might keep a mirror?"
Indeed, the giants have not noticed the adventurers, and this is all the worse for their part. While there is a pattern to dances, not all giants make graceful dancers. Their best predictions of where the next footfall will be sometimes go awry. More than once Ruby pulls Kellan out of doom's reach; more than once, Troyan does the same for her.
Kellan's heart is hammering again. This is dangerous. Of course it is. But with the music playing, and the laughter around him, it's sort of fun, too. Back home he's the smallest boy in the village—but here, they're all small, and his agility is a boon. He darts from step to step, his eyes full of wonder, looking for the gleam of silver. "I don't know. Maybe it's in somebody's room?"
"What, to ask it questions in the middle of the night?" Though Ruby's initially skeptical, a moment's thought changes her tune. "Actually, that's not a bad idea."
It's hard to determine where a room might be when everything's so large as this. When at last they find a stair, only Troyan can scale the slippery stone—and it takes him great effort to do so. Nevertheless, he drops a rope for the others, and they haul themselves up one by one. In this way they can climb the two dozen steps to a higher level which may not, all told, even contain a bedroom.
But halfway up the steps they have the displeasure of running into a goose.
Years on the farm have hardened Kellan's heart to these blasted creatures. He loves near everything and everyone that draws breath in the Realm—except geese. And with good reason. The local geese are the only things that trouble him as much as the local bullies. Perhaps the geese are worse.
And what's worse than a goose his size?
A goose the size of his family's market cart.
The goose, festooned in gold, waddles down the steps ahead of its owner—who, by her raiment, must be the lady of the house herself. And while the giants may not take notice of them, the goose does, honking a horrible honk, locking eyes with them as they crest another step.
Kellan knows in his heart the right answer to dealing with this abomination.
"Run!" he shouts. "Run for your lives!"
He takes off like a shot, his shoes failing to get any traction against the marble. Ruby's got better luck—she jumps off the step, landing in Troyan's awaiting arms. She stops and turns only to see Kellan land chest first on the marble, the goose's beak descending like an axe—
And two fingers pinching the back of his cloak.
He's lifted high into the air, his feet dangling beneath him. The goose nips at his heels. If he dares to look down he will have an unholy view of the goose's mouth, something that might stain his mind forever, but he is wise enough to avoid this fate. Instead, he fixes his eyes on the giant's scowl. Kellan holds up his hands and shrugs. "S-sorry for intruding."
"Who are you?" she asks. The force of her speech sends him swaying. "What are you doing at my party?"
"I've come on a quest!" Kellan says. Difficult to strike a heroic pose here, but he gives it all he can. "I seek the magic mirror—"
The giant's lip curls in a sneer. "No."
"Honored Lady," shouts Ruby. She's cupped her hands over her mouth; she must be shouting at the top of her lungs. "We don't mean any harm! We just want to ask the mirror a question!"
"Do you think it's the first time I've heard that lie?" the giant answers. "Smallfolk like nothing more than deception. How dare you come into my home on the night of my birthday and demand such a thing from me?"
"Happy birthday!" Kellan blurts.
"I don't need to hear it from #emph[you] ," she replies.
Kellan hears a deep sigh from behind them. "Beluna, don't tell me you're causing trouble."
Their unwilling host—Beluna—turns. Over her shoulder, Kellan sees a crowned man, his cup already half empty, his cheeks ruddy. Despite the finery he wears, he's only half Beluna's size, his beard bushy and green. Beluna curtseys at the sight of him—which nearly drops Kellan into the goose's waiting gullet. "<NAME>," she says. "I'm only dealing with some pests."
"Pests you're speaking to."
"Aye, my lord," says Beluna. She holds Kellan up toward the other man. Looking at him now, he's fairly sure that beard#emph[ really is] made of plants. And if he's smaller, but Beluna's listening to him ... could that be the Giant King? Kellan doesn't even know his name, only that he vanished from Garenbrig during the invasion. What's he doing all the way over here? He's not like these Giants. Maybe he's paying them a visit for the birthday party? Kellan really, really hopes he's in a good mood, or else ... the goose awaits.
"That looks rather like a young man," says the king. "You aren't planning to feed any smallfolk to your goose on your birthday, are you? You can't be that in need of golden eggs."
"He means to steal the mirror," she protests. "And as it is my birthday, I think it right I decide what to do with him."
The king turns his attention to Kellan. "Young man. Why are you here?"
"I've been given a quest by the fae lord," Kellan says. He hopes mentioning Talion will smooth matters over. Lords respected each other, didn't they? "I and my friends mean to find and defeat two witches, but we don't know where to go. We were hoping to ask the mirror for assistance."
The king nods, stroking his beard. "Consider you and yours my guests at this party."
Kellan grins. "Of course!" he says.
"Beluna, I don't think there's any harm in showing them the mirror. There's no way they could possibly move it with only three of them, and ... well, they are guests, now." The King offers them a conspiratorial wink. "Give the Kindly Lord my regards, will you? Back now from that long trip of theirs."
He does not hear Beluna groan, but he can feel it. "You're stretching hospitality, <NAME>," she says. "But ... I see your point."
The king passes, patting the goose's head as he goes. Beluna sets Kellan down in the palm of her hand. She carefully picks up the others and sets them there, too, then starts walking with nary a word. Her gait is so wide that they reach their destination in mere moments.
It is, indeed, a bedroom.
She sets them down in front of the mirror, then crosses her arms. "Make this quick," she says. "You're lucky Albiorix won't be eating you tonight."
"Who names a goose Albiorix?" Ruby mutters.
Kellan stifles a shudder and approaches the mirror. The boy he sees there—cloaked, already a little leaner from travel—seems larger than the boy he was only a few weeks ago. More like a hero.
"Oh great mirror," he says. "Where can I find the witch Hylda?"
Nothing happens.
Kellan frowns.
"You have to tell it something it doesn't know, manling," Beluna says. "The mirror doesn't just spit out valuable information for free."
"Hm. Something it's never heard before," Troyan repeats. He sets a hand on Kellan's shoulder. "Mirror of Indrelon, my name is Troyan, and I wasn't born here in Eldraine."
"What?" Ruby says—but already the magic is starting to work.
Winter's own breath fogs the silvery surface. Kellan feels compelled to reach forward and wipe it away. Beneath the condensation, he sees a castle of ice, faceted and glittering, resting atop a rocky cliff.
"Wait ... I think I know that place. <NAME>. My brother used to take me fishing there," Ruby says. She frowns. "But there wasn't any ice there when we went before the war. How'd she build something like that so fast?"
"I don't know," says Kellan. "But if you'll lead the way, then maybe we can find out."
|
|
https://github.com/Caellian/UNIRI_voxels_doc | https://raw.githubusercontent.com/Caellian/UNIRI_voxels_doc/trunk/content/uvod.typ | typst | #import "../util.typ": complexity
#import "../template.typ": formula
#import "@preview/tablex:0.0.8": *
= Uvod
Cilj računalne grafike je deterministički prikaz trodimenzionalnog (3D) sadržaja na zaslonu računala. Kako bi se to postiglo, primjenjuju različiti algoritmi na strukturama podataka koje su zavisne o području primjene i ciljevima softvera. Tradicionalni način prikaza 3D sadržaja je predstavljanje takvog sadržaja korištenjem jednostavnih matematičkih tijela (engl. _primitives_) poput trokuta, linearna transformacija njihovog prostora, projekcija na plohu koja je uzorkovana (engl. _sampled_) pravilnom rešetkom (engl. _grid_) piksela, te konačno prikazana na ekranu.
Nakon inicijalnog razvoja grafičkih kartica (engl. _graphics processing unit_, GPU) sa fiksiranim dijelovima procesa prikaza (engl. _fixed function pipeline_, FFP), kasnije je razvijena i sljedeća generacija GPUa sa programabilnim procesom prikaza (engl. _programmable pipeline_). Takve grafičke kartice dozvoljavaju uporabu različitih programa (engl. _shader_) za prikaz i izračun. Shaderi su konstantnim napretkom postajali sve fleksibilniji te se danas primjenjuju u mnoge svrhe koje nisu usko vezane za grafiku, ali zahtjevaju visoku razinu konkurentnih izračuna, poput:
- simulacije,
- analize podataka,
- neuralnih mreža,
- obrade multimedijskih podataka, te brojne druge.
Prikaz volumetrijskih struktura je jedna od takvih namjena za koje FFP često nije prikladan jer se oslanja na specijalizirane algoritme koji često ne rade s trokutima nego simuliraju zrake svijetlosti. #linebreak()
U svrhu unaprijeđenja performansi ovakvog pristupa su proizvođači grafičkih kartica od 2020. godine počeli uključivati specijaliziran hardver kako bi se postigla hardverska akceleracija prilikom rada s volumetrijskim podacima @rtx-launch.
Cilj ovog rada je prikazati načela rada s volumetrijskim podacima, kao i njihovih prednosti u različitim područjima primjene.
Razvoj grafike koja utilizira FFP je popratio razvoj i popularnost sukladnih formata za pohranu modela koji opisuju isključivo površinsku geometriju predmeta (engl. _mesh_). Za svrhe jednostavnog prikaza je taj oblik pohrane idealan, no nedostatan je za obradu trodimenzionalnih podataka. U mnogim primjenama takvo ograničenje dovodi koncesija koje negativno utječu na performanse aplikacija ili njihove sposobnosti.
Također je nedostatan i za primjene u simulacijama jer zahtjeva nadomještaj nedostatnih podataka o volumenu različitim aproksimacijama za koje traže sporu prethodnu obradu (engl. _preprocessing_). #linebreak()
Drugi cilj ovog rada je osvrnuti se na takve formate za pohranu trodimenzionalnih podataka i ukazati na uvedene neučinkovitosti zahtjevane njihovim nedostacima.
- https://www.sciencedirect.com/topics/computer-science/volumetric-dataset
- https://developer.nvidia.com/gpugems/gpugems/part-vi-beyond-triangles/chapter-39-volume-rendering-techniques
- https://web.cse.ohio-state.edu/~shen.94/788/Site/Reading_files/Leovy88.pdf
== Definicija volumetrijskih podataka
Volumentrijski podaci se mogu predstaviti na mnogo različih načina, no u osnovi se radi o skupu vrijednosti koje su pridružene koordinatama u nekom prostoru.
Memorijska ograničenja računala nalažu da su prostori u memoriji učinkovito *konačni*. Također su svi produktni prostori koje možmo stvoriti i *prebrojivi* neovisno o načinu na koji ih pohranjujemo u memoriji. To se odnosi i na decimalne tipove podataka jer za svaki postoji neki korak $epsilon$ između uzastopnih vrijednosti koje možemo pohraniti.#linebreak()
Konačno, svaka topologija koja se rasterizira se u nekom dijelu rasterizacijskog pipelinea *poprima prekide*: u krajnjem slučaju prilikom prikaza na zaslonu računala, no obično i ranije prilikom obrade.#linebreak()
U večini primjena je cilj izbječi vidljivost tih kvaliteta prilikom prikaza, no ta činjenica opušta mnogo problema (engl. _problem relaxation_) prilikom rada jer dozvoljava međukoracima algoritama za obradu da aproksimiraju rezultate s ciljem bržeg izvođenja.
Neko tijelo u 3D prostoru predstavljamo skupom uređenih trojki, tj. vektora koji zadovoljavaju neki:
#formula(caption: "volumen tijela")[
$
P: A^3 arrow.r {top, bot}\
V :equiv {(x,y,z) in A^3 | P(x,y,z)}
$
] <volumen>
gdje je:
- $P$ neki sud koji određuje uključuje li razmatrani volumen tu trojku/vektor,
- $A$ tip vrijednosti s kojim radimo; može biti skup realnih brojeva $RR$ ili neki drugi tip poput ```rust f32``` ili ```rust u64```, a
- $(x, y, z)$ uređena trojka koordinata volumena.
Na primjer, neka kugla ima sljedeći volumen @Munkres1999-if:
#formula(caption: "volumen kugle")[
$
B^3(r) = {(x,y,z) | x^2 + y^2 + z^2 <= r }
$
] <3-kugla>
gdje je $r$ radius kugle.
U slučaju volumetrijskih podataka volumenu želimo pridružiti neku vrijednost pa ako vrijedi da
#formula(caption: "skup volumetrijskih podataka")[
$
exists f: (A^3 subset.eq V) arrow.r cal(C) \
arrow.b.double\
exists (D : A^3 times cal(C)).D :equiv {(x,y,z,f(x, y, z)) | (x,y,z) in V} equiv {(x,y,z,c)}
$
] <volumen-podaci>
gdje je:
- $f$ preslikavanje kojim ju određujemo za sve koordinate prostora $V$.
- $c$ neka vrijednost tipa $cal(C)$ koju pridružujemo koordinatama, a
Dakle, bilo koja funkcija čija je kodomena skup _uređenih trojki elemenata tipa $A^3$_ je prikladna za predstavljanje volumena (_oblika_ volumetrijskih podataka), te ako postoji neko preslikavanje tog volumena na neku željenu informaciju (npr. gustoču ili boju), imamo potpuno definirane volumetrijske podatke.
== Računalna primjena
Proces pretvorbe zapisa s uvjetima (sudom), odnosno određivanja vrijednosti funkcije u određenim točkama, zove se *diskretizacija* funckije.
Rezolucija diskretiziranih podataka ovisi o načinu na koji smo preslikali i pohranili funkciju u računalu s tipovima podataka ograničene veličine, te koji tip brojeva je korišten za pogranu (npr. ```rust u16```/```rust u32```).
Diskretizacija je željena jer značajno umanjuje potreban rad na grafičkim karticama, kao i u nekim slučajevima daljnju obradu, no kompozicija zapisa s uvjetima je manje algoritamski zahtjevna zbog čega se taj pristup češće primjenjuje za generiranje volumetrijskih podataka kao i kod generativnih metoda prikaza poput koračanja zrakama (engl. _ray marching_).
Stvaranje volumetrijskih podataka iz stvarnog prostora uporabom perifernih uređaja poput laserskih skenera se zove *uzorkovanje*. Isti naziv se ponekad koristi i za diskretizaciju, no u ovom radu će se koristiti preteći u svrhu jasnoće, iako imaju preklapanja u značenju.
Diskretne podatke je moguće predstaviti kao neuređeni niz točaka (tj. kao @volumen-podaci), no taj oblik pohrane ima najgoru složenost za pronalazak vrijednosti #complexity($n_x n_y n_z$, case: "same").#linebreak()Kako bismo odabrali optimalan način strukturiranja podataka, potrebo je znati odgovor na sljedeća pitanja @Samet2006-vg:
1. S kojim tipovima podataka baratamo?
2. Za kakve su operacije korišteni?
3. Trebamo li ih kako organizirati ili prostor u kojeg ih ugrađujemo (engl. _embedding space_)?
4. Jesu li statični ili dinamični (tj. može li broj točaka u volumenu porasti tokom rada aplikacije)?
5. Možemo li pretpostaviti da je volumen podataka dovoljno malen da ga u potpunosti smjestimo u radnu memoriju ili trebamo poduzeti mjere potrebne za pristup uređajima za trajnu pohrani?
Zbog različitih odgovora na ta pitanja ne postoji rješenje koje funkcionira približno dobro za sve namjene. U @structures su podrobnije razjašnjene razlike između različitih načina pohrane volumetrijskih podataka.
== Primjene volumetrijskih podataka
Volumetrijski podaci imaju jako širok raspon primjene te se koriste u mnogo znanstvenih i komercijalnih područja. Mnoga potencijalna područja primjene nisu još (u potpunosti) realizirana zbog hardverskih ograničenja.
Područje u kojem imaju največi značaj je medicina gdje se od 1970ih godina koriste za pohranu presjeka/slojeva ljudskog tijela @ct-nobel koje uređaji za izračunatu tomografiju (engl. _computed tomography_, CT) proizvedu računanjem absorpcije rendgenskih zraka poslanih iz različitih smjerova oko pacijenta.
Uređaji za magnetsku rezonancu (engl. _magnetic resonance imaging_, MRI) proizvode slične presjeke koristeći jaka magnetska polja, magnetske gradijente i radio valove.
Uz njih, koristi se i pozitronska tomografija (engl. _positron emission tomography_, PET) koja je slična CTu, no oslanja se na zrake pozitivno nabijenih elektrona. Kao i elektronksa tomografija (engl. _transmission electron microscopy_, TEM) za tanje uzorke ili suspenzije.
Iako su te tehnike skeniranja učestalo asocirane s medicinom, koriste se i za provjeru sadržaja prtljage na aerodromima, arheologiju, geologiju, itd.
U medicini je standardan format za pohranu takvih podataka DICOM (engl. _Digital Imaging and Communications in Medicine_) @ISO12052, koji je omotač u kojem su presjeci pohranjeni kao slike sa jednim kanalom (razina absorpcije odgovarajuće radijacije), u drugim područjima se koriste i drugi formati prikladni za pregled/obradu.
Volumetrijski podaci se koriste i za geoprostornu analizu u geografskim informacijskim sustavima (engl. _geographic information system_, GIS) za namjene poput određivanja volumena erozija @Bacova2019-oe, plavih površina, geoprostornih procesa @Jjumba2016-jm, i dr. Uz geoprostornu analizu, volumetrijski podaci se primjenjuju i u civilnom inženjerstvu, za urbano planiranje, praćenje prometa kao i u šumarstvu @Vosselman2010-xi.
U području proizvodnje uporaba volumetrijskih podataka nudi ubrzanje prototipiranja @Wu2004-ip, no primjenjivi su i u ranijim fazama za pojednostavljivanje CAD modela @Thakur2009-eb.
Znanstvene simulacije fluida @Wu2018-lu i materijala @Mishnaevsky2005-vq se također u nekim slučajevima koriste volumetrijskim podacima, no modeliranje takvih simulacije je znatno složenije u mnogim slučajevima.
Konačno, neke moderne računalne igrice poput "Teardown" @ackoTeardownFrame se oslanjaju na veču interaktivnost svijeta koju pružaju vokseli.
Iako postoje brojne demonstracije zanimljivih projekata, na tržištu je relativno malo gotovih igrica koje se koriste volumetrijskim podacima za prikaz interaktivnih komponenti (često se koriste za oblake i fluide).
Tu največu prepreku predstavlja potreba za prikazom složenih scena u realnom vremenu.
#pagebreak()
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/place-float-auto_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
#set page(height: 140pt)
#set place(clearance: 5pt)
#lorem(6)
#place(auto, float: true, rect[A])
#place(auto, float: true, rect[B])
#place(auto, float: true, rect[C])
#place(auto, float: true, rect[D])
|
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/PianoDiProgetto/sections/PianificazioneSprint/SestoSprint.typ | typst | MIT License | #import "../../functions.typ": glossary
=== Sesto #glossary[sprint]
*Inizio*: Venerdì 29/12/2023
*Fine*: Giovedì 04/01/2024
*Obiettivi dello #glossary[sprint]*:
- Iniziare revisione in stile #glossary[walkthrough] delle _Norme di Progetto v1.0_;
- Proseguire la stesura del _Piano di Progetto_, con:
- Aggiornamento di pianificazione e preventivo pertinenti allo #glossary[sprint] 6 e l'inserimento del consuntivo pertinente allo #glossary[sprint] 5.
- Proseguire la stesura del _Piano di Qualifica_:
- Proseguire la stesura del cruscotto delle metriche con valutazione delle metriche rispetto agli #glossary[sprint] 5 e 6 e aggiornamento dei grafici di confronto.
- Modificare l'_Analisi dei Requisiti_ secondo le osservazioni emerse durante la revisione in stile #glossary[walkthrough].
|
https://github.com/TycheTellsTales/typst-pho | https://raw.githubusercontent.com/TycheTellsTales/typst-pho/main/boards.typ | typst | ////////////////
// PHO Boards //
////////////////
#let __default = "Brockton Bay"
#let __boards = state("pho_boards", (
"Announcements": ("Announcements",),
"Brockton Bay": ("Places", "America", [Brockton Bay Discussion (Public Board)]),
))
#let register(name, board) = {
assert.eq(type(board), "array")
context __boards.update(x => {
x.insert(name, board)
return x
})
}
#let get() = {
__boards.get()
}
#let resolve(board) = {
if board == none {
return get().at(__default)
} else if type(board) == "string" {
return get().at(board)
}
return board
}
|
|
https://github.com/jamesrswift/blog | https://raw.githubusercontent.com/jamesrswift/blog/main/assets/packages/booktabs/rigor-test.typ | typst | MIT License | #import "lib.typ" as booktabs
#import "@preview/typpuccino:0.1.0"
#let bg-fill-1 = typpuccino.latte.base
#let bg-fill-2 = typpuccino.latte.mantle
#set text(size: 11pt)
#show link: box.with(stroke:red)
#let data = (
(
date: datetime.today(),
particulars: lorem(05),
ledger: [JRS123] + booktabs.footnotes.make[Hello World],
amount: (unit: $100$, decimal: $00$),
total: (unit: $99$, decimal: $00$),
),
)*7
#let example = (
(
key: "date",
header: align(left)[Date],
display: (it)=>it.display(auto),
fill: bg-fill-1,
align: start,
gutter: 0.5em,
),
(
key: "particulars",
header: text(tracking: 5pt)[Particulars],
width: 1fr,
gutter: 0.5em,
),
(
key: "ledger",
header: [Ledger],
fill: bg-fill-2,
width: 2cm,
gutter: 0.5em,
),
(
header: align(center)[Amount],
fill: bg-fill-1,
gutter: 0.5em,
hline: arguments(stroke: booktabs.lightrule),
children: (
(
key: "amount.unit",
header: align(left)[£],
width: 5em,
align: right,
vline: arguments(stroke: booktabs.lightrule),
gutter: 0em,
),
(
key: "amount.decimal",
header: align(right, text(number-type: "old-style")[.00]),
align: left
),
)
),
(
header: align(center)[Total],
gutter: 0.5em,
hline: arguments(stroke: booktabs.lightrule),
children: (
(
key: "total.unit",
header: align(left)[£],
width: 5em,
align: right,
vline: arguments(stroke: booktabs.lightrule),
gutter: 0em,
),
(
key: "total.decimal",
header: align(right, text(number-type: "old-style")[.00]),
align: left
),
)
),
)
#set page(height: auto, margin: 1em)
#booktabs.rigor.make(columns: example,
data: data,
notes: booktabs.footnotes.display-list
) |
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/04-opentype/exploring/name.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/components.typ": note
#import "/lib/glossary.typ": tr
#show: web-page-template
// ### The `name` table
=== `name` 表
// Any textual data stored within a font goes in the `name` table; not just the name of the font itself, but the version, copyright, creator and many other strings are found inside a font. For our purposes, one of the loveliest things about OpenType is that these strings are localisable, in that they can be specified in multiple languages; your bold font can appear as Bold, Gras, Fett, or Grassetto depending on the user's language preference.
字体中所有文本型的信息都储存在`name`表里,不只是字体名,还包括版本号、版权信息、创作者等。OpenType 中很棒的一点是这些文本都可以被本地化,也就是一个信息可以有多个语言的版本。比如粗体可以根据用户的语言偏好而被显示为 Bold、Gras或Fett。
// Unfortunately, as with the rest of OpenType, the ugliest thing is that it is a compromise between multiple font platform vendors, and all of them need to be supported in different ways. Multiple platforms times multiple languages means a proliferation of entries for the same field. So, for instance, there may be a number of entries for the font's designer: one entry for when the font is used on the Mac (platform ID 1, in OpenType speak) and one for when it is used on Windows (platform ID 3).
但很不幸,OpenType 的老毛病在这里也依旧存在。因为要同时支持多个字体供应商的古老标准,这些文本信息也需要为这些字体平台重复多次。多平台X多语言,这就意味着每一个字段都会膨胀为一堆条目。比如,字体设计者这个字段,就分别在Mac上使用的条目(按照OpenType标准的说法叫做平台ID为1),和另一个在Windows上使用的条目(平台ID为3)。
#note[
// > There's also a platform ID 0, for the "Unicode platform", and platform ID 2, for ISO 10646. Yes, these platforms are technically identical, but politically distinct. But don't worry; nobody ever uses those anyway.
其实也有代表Unicode的平台 0和代表ISO 10646的平台2。这两个平台在技术上是同一个,但在政治原则上是不同的。别担心,对应这两个平台的条目都没人使用。
]
// There may be further entries *for each platform* if the creator's name should appear differently in different scripts: a Middle Eastern type designer may wish their name to appear in Arabic when the font is used in an Arabic environment, or in Latin script otherwise.
如果某个字段需要在不同的#tr[scripts]环境下显示为不同的值,那么每个平台下可能还会细分更多的条目。比如一个中东的字体设计师,可能希望字体创建者名称在阿拉伯文环境下显示为阿拉伯文,但在其他环境下显示为对应的拉丁字母转写。
// Name entry records on the Mac platform are usually entered in the Latin script. While it's *in theory* possible to create string entries in other scripts, nobody really seems to do this. For the Windows platform (`platformID=3`), if you're using a script other than Latin for a name record, encode your strings in UTF-16BE, choose the appropriate [language ID](https://www.microsoft.com/typography/otspec180/name.htm) from the OpenType specification, and you should be OK.
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/050%20-%20Phyrexia%3A%20All%20Will%20Be%20One/002_A%20Hollow%20Body.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"A Hollow Body",
set_name: "Phyrexia: All Will Be One",
story_date: datetime(day: 12, month: 01, year: 2023),
author: "<NAME>",
doc
)
The Dross Pits stink.
You stand at the base of the vault, staring up the steaming shaft wall. You can smell the necrogen from here, at the Basilica's summit. Little eddies of it swirl above you, like figures beckoning you up. Movement between the spheres is heavily monitored, but this shaft is far enough on the outer reaches that no one will be watching. At least, no one with a hope of stopping you.
#figure(image("002_A Hollow Body/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
You spread your wings, relishing the pull in your shoulders as your body does what it is made for. A few flaps are enough to propel you up into the shaft, splitting the necrogen clouds, leaving a trail in your wake. Nothing challenges you, though a couple skitterlings clinging to the slick walls turn to you with rumbling growls that quickly become pathetic screams as you separate their heads from their bodies with a sweep of your spear. You smell the spill of their fluids as it rains down to the sphere below. Back to where your superior waits for news of your success.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#emph["Do you know of the traitor Geth?"]
#emph[You bow your head and say nothing, the marble cold beneath your knees. It is not a question that needs an answer. Everyone knows of the lich, the tainted Phyrexian with the incompleat head. An unclean mark on spotless linen.]
#emph["I want you to seek him out, Ixhel. I want you to end him."]
#emph[You raise your eyes slowly from the floor.]
#emph[Above you is the throne, a dais crowned with a coruscating confection of bone and porcelain, pure Phyrexian workmanship. The seat is empty; without the demands of a council meeting, <NAME>, Mother of Machines, retires to her contemplation. Instead, you kneel before Atraxa, the Grand Unifier, and the reason for which you draw breath.]
#emph["Geth is one of the seven Steel Thanes of the Dross Pits, a sphere that has already caused us considerable annoyance," Atraxa says, her voice as brisk as a whip. "I ask that you boil that number down to six. Bring me his filthy head."]
#emph["It will be done," you say, intoning the words. "I foresee no difficulties."]
#emph[Atraxa makes a slippery noise in the back of her throat. "No," she says. "You wouldn't, would you? You are my most perfect creation."]
#emph[Atraxa reaches for you, and you quickly drop your eyes back to the bloody red of the carpet. Her fingertips caress your cheek, and you feel a brief flare of something inside you, where a lesser creature's heart might be. It's something beyond loyalty, beyond the just desire to spread the Machine Orthodoxy across the Multiverse.]
#emph[You ignore it and hope it goes away.]
#emph[So far, it always has.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
You locate a bit of high ground, which is easier said than done—this sphere is called the Dross Pits for a reason. The landscape is shallow, pockmarked with glowing pools of liquid necrogen, shining bright and poisonous. Humped, crude structures of black-gilded bone break up the horizon. You feel your lip curling. You know that every sphere has its purpose in the perfect unity of New Phyrexia, but you can't help your disgust. Not when you have the serenity of the Fair Basilica to compare to the rest.
Fortunately, you expect this will be a short trip. Your words to Atraxa were not hubris—you have felled every creature that has ever stood against you.
You face little opposition as you pick our way across the landscape, breathing in corrosive air as you go, giving the glowing pools a wide berth.
Before long, your advance is halted. Geth's fortress is visible beyond the next rise, but the path is blocked by a sheer cliff of shining black rock. You could climb it, but that would take time. You could fly over it, but that would announce our presence to the entire sphere, which you've been told to avoid, when possible. You are still a long way from a last resort.
Stepping into the shadow of the rock face, you see the outline of a gate. It looks like it could almost be naturally occurring, as if the supersaturated atmosphere has given the rock a mind of its own, like a Dominus. There is no latch, no lock. Instead, you find a row of rounded impressions arrayed in a fan-like shape at shoulder height. You press your palm against one.
A low tone pulses out from within the stone. You take a step back. It fades so quickly you are unsure if you truly heard it. You press the spot again. The same tone comes. You press each impression in turn, and each makes a slightly different sound.
You cock your head and press them again. Something about the sounds itches at the inside of your brain. You don't like it.
"You need to press them in the right order."
The voice comes from behind you, slippery and slick, all sibilants, but it chokes off at the end when you spin and slam its owner back against the craggy ground, squeezing your fingers down on its neck.
"Please," it chokes out.
That, combined with the ease with which it folds underneath you, stays your hand for long enough to get a look at it.
"N—Now I know what you're thinking—" the thing stammers. You tighten your hand on its neck, even as you find yourself mildly surprised that it #emph[has ] a neck. A face. A midsection. Bare and unsightly hands. It's an aspirant—a male human, or an elf. Originally from the Hunter Maze, perhaps, a sphere several levels above, judging from its smell and the hue and shape of its compleation.
#figure(image("002_A Hollow Body/02.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
"Mercy!" It's shouting in your ear. "Mercy!"
You sneer. "Identify yourself, creature."
"Belaxis!" he pipes up. "I'm Belaxis. You can't kill me."
"I can," you say.
"No! I mean, I believe you, I believe you!" The aspirant shakes. His voice goes slightly nasal with fear. "I just mean, you shouldn't kill me! Please don't kill me!"
Your head tilts. "Why not?"
"Because I don't want to die!"
Your head keeps tilting. "Why?"
"Right, that—" The aspirant is breathing heavily, its brittle, defenseless ribcage going up and down. The movement is distasteful, but compelling. "Right, that's a good question. Philosophical. Why don't #emph[you] want to die?"
You consider the question. You know the correct answer. The answer that any Phyrexian would be expected to give. Why would anyone fear death when no individual holds any value? Every life in every sphere exists purely to spread the truth of Phyrexia across the Multiverse. There is no other reason to be alive.
Still, the thought unsettles something in the core of you. You try to evaluate why.
"Because I am needed," you decide.
The aspirant snorts air through the disgusting little holes in his face. "Don't you think highly of yourself," he mutters. "Not that you shouldn't!" he adds hastily, as you begin to squeeze down again. Before you can completely compress his voice to nothing, he yells, "You can't kill me! I have a contract with <NAME>!"
That makes you pause. "What?"
"L—<NAME>." The aspirant is breathing fast. He reeks of fear. What is a half-compleated weakling doing in a place like this? He should have been ripped to shreds in the Hunter Maze within a day. "<NAME> makes deals. That's why they call him the Thane of Contracts!"
"Who calls him that?" That hadn't been part of your brief.
"<NAME> saves people. With his deals!" The aspirant's eyes gleam and glisten. They're filling up with some strange clear oil.
"He makes what?"
"Deals! Protection. He can move you between spheres. Well." The aspirant gives you a quick, nervous look. "Not #emph[him] , exactly. He made a contract with me and got me out of the Hunter Maze. He saved me. And now I guard the gate to his holdings."
"If I kill you, this gate opens?"
"Yes. Wait! No!" The aspirant's breath quickens again. "That's not how it works. If you kill me, it will never open! Never ever! Besides, <NAME> will know and he'll come and find you!"
You sit back, slightly bemused. Are all aspirants so lively? You've never been in the position to find out. "If I kill you, <NAME> will know?"
"Yes!"
"How will he know?"
"Not sure. Kill me and find out."
You heft your spear.
"I'm kidding, I'm kidding! He'll just know!"
You consider this new option. Could you simply kill this aspirant and smoke out the lich that way? Your orders are different. But this might be faster.
No. You cannot stray.
"I can help you!"
"You? Don't speak nonsense, creature."
"I told you, my name is Belaxis!" He does not seem to be seeping from the eyes anymore, at least. "What's yours?"
"Ixhel," you say. "Of the Fair Basilica."
Belaxis's stares. Perhaps you should not have offered this worthless being your name. But neither are you willing to deny it.
"Ixhel." Belaxis the aspirant rolls it around his strange pink mouth. "Ixhel. I can help you! You want through that door, right? I can help you."
"What?"
"The puzzle! I can help you with the door puzzle."
You stand up sharply. "I can do it myself."
This, you worry, may be hubris.
The sounds make no sense, or not enough for you to decode them. It annoys you. The sounds itch at your brain; you think you should know what they mean, recognize the pattern they build.
Behind you, Belaxis keeps up a steady stream of chattering.
"Hmm, see—you're tall enough to hit all the plates! That's useful for something like this, but your back might start hurting. Oh! Start with the one on the far left—"
"I guess being tall is less useful when you're flying—do those wings work? I bet it's hard for you to stay upright when you're in the air. Can you fight while you fly? Oh, the two in the middle need to be pressed together—!"
"Wow, the Fair Basilica, I've never seen it. Right, where would I have seen it, huh? Is it as pretty as you are? There, on the right!"
You grind your teeth together, but you take the advice, using the hints to string the sounds together. Phyrexians all operate toward a common goal. Disregarding help because the one offering it has an abrasive, reedy voice would be counterproductive.
"Ah, there you go, there you go!"
The door flashes with a thin blue light, and the gate grinds open. You feel a thrill of warm victory most often associated with rending a creature in half. It almost makes you want to turn around and bury your spear in the aspirant's throat.
You turn to find him standing upright, looking off into the distance. The cool, radioactive light of the pits gleams off the green and silver armor plating his torso and thighs. The bare, not yet compleated parts of his body are soft, almost obscene. Surely, you'd never looked so very frail.
He just sits here all day, waiting for someone like you to come along and try the gate. What would that be like? How does he stay still with all that clamoring going on inside his head? He must enjoy the time he spends here if he is so intent on staying alive. Curious.
You turn back to the open gate, the tunnel lit only by a thin stream of necrogen trailing down the middle. You wrinkle your nose, but you pick your way inside.
"Goodbye, <NAME>!" Belaxis calls after you. "Give Lord Geth my regards!"
You don't meet anyone quite as odd or talkative on your way through Lord Geth's holding, but you do see more aspirants than you have in a long time. Creatures from across New Phyrexia. From all spheres. Some halfway through compleation, some whose compleation had gone wrong. They should have been scrapped before they even took their first breath; had Geth made deals with them as well?
Strange. Strange how these half-creatures' minds work. Binding themselves to a monstrous, blasphemous creature for nothing but the promise of the continuity of their own worthless lives? You can't fathom it. The only reason to exist is to spread perfection across the Multiverse. If you can't do that, why wouldn't you allow yourself to be taken apart, to be compleated into something that can?
You meet no great resistance on your journey, save for a few more skitterlings that try their luck, as they always do. You locate Geth's fortress easily enough—it is a blight on the horizon. A colossal structure of black bone and red sinew, grown from the burning earth of the sphere's necrogen-consecrated ground.
This gate is not guarded, nor does it have a silly little puzzle. The door stands open before you. No one challenges you on the stairs, and no one challenges you as you pass into the grand hall. It's as still as a grave.
Stepping through a low, black arch, rage begins to fill you. This is a throne room. A tall, towering imitation of Elesh Norn's throne stands between guttering torches. It is empty.
How dare he? How dare he compare himself to the Mother of Machines? The impertinence is unbelievable.
"Fool." Your voice echoes through the wide hall. "Lich. Abomination! Where are you?"
"You're smaller than I thought you'd be," says a voice in your ear. "Curious."
This is the second time some creeping thing has managed to catch you by surprise. This time you heft your spear, twisting in midair. The clash is hard enough to send shocks all the way down to your core. Very narrowly, you keep your feet.
"Good. Seems you aren't all bravado."
Before you stands Lord Geth.
#figure(image("002_A Hollow Body/03.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
His heaving, many-limbed body looms above you, arachnid legs planted in the marble floor. His hideous face peers down. He possesses none of Belaxis's energy or lithe grace, but for some reason, you can't help thinking of him as you look into Lord Geth's eyes. He holds your spear between two of his pincers.
"I assume the Mother has finally sent you for my head," he says. "She does so hate it."
You grip your sword and widen your stance. Geth is larger than you'd been expecting, his body more fully compleated. In fact, it is only his head that is still organic. An ugly, rotting thing in the center of an otherwise serviceable body. You hate it more than you'd hated Belaxis, because at least that wasn't his fault. Geth, you know, had insisted on this, refused to ever fully submit.
"It's disgusting," you sneer. "It becomes you."
Geth laughs. His eyes burn. "How low I have fallen in her notice, that she sends me a foot soldier, rather than a praetor. Not even the Unifier. How is Atraxa, then?"
You glow with rage. A #emph[foot soldier] ? You? How many corpses have you retrieved for compleation?
#emph[That doesn't matter] , you tell yourself. It doesn't matter what he thinks of you. You don't matter at all.
"You don't have the right to even say her name," you hiss. "To even think it."
Geth laughs again. He meets your next attack with a lazy swipe of a claw, deflecting with seemingly no strength at all. The blow still rattles through you. You grit your teeth so as not to let him see your shock.
Stupid. Stupid of you to assume he wouldn't put up a fight. You've gotten too used to fighting the incompleat, worthless little organics who don't stand a chance against the might of a true Phyrexian.
"You're rusty, I see," Geth says. "You've been fighting creatures who can't fight back." He reads you like he has access to your thoughts. "Picking your teeth on my contract-holders, were you?"
"As if I'd dent my blade on such a worthless enemy," you sneer.
"Yes, you would say that, wouldn't you?" Geth's strikes grow more powerful as he speaks. You hear the whistle of air as they narrowly miss you. "But that's what you and your ilk will never understand. The only true loyalty is that which can be bought."
"Foolish." Nonsense. He's speaking the same drivel Belaxis did, trying to trick you. Pathetic, that a thane would share an affliction with a half-compleated runt. No wonder your commanders want him dead.
And yet, his power is undeniable.
"You doubt me? For what reason do you fight then, child of the Machine Orthodoxy?"
"My name is Ixhel," you grit out.
Geth grins. The elasticity of his face is disgusting. You aren't used to seeing such things. "Ixhel. A good name for another Phyrexian doll."
You spit. "You think you insult me?"
"An audience's disinterest does not make the joke any less amusing."
Jokes. Hah. You'll tell #emph[him] what a joke is. Especially now that you are beginning to realize that it makes far more sense to avoid his blows than try to parry them. He is right about one thing—fighting nobodies has made you soft. You weren't prepared for someone with his kind of strength.
"And now you're scurrying around like a rat," Geth says in that deep, sonorous voice. "Are you afraid to stand and fight?" He takes another broad swing, forcing you to hop back in an ungainly scrabble. The bone marble is unfamiliar beneath your feet; you keep sliding. You should have forced him to come out and fight you under the sky.
"No wonder you're weak," Geth says with another laugh. "None of you understand the victory born out of true struggle. The struggle to survive."
"You know nothing!"
"I know more than you think." Geth's ugly face is smiling at you now, a hideous rictus. "I know that what really makes a warrior is the knowledge that if you lose, you die. Not that if you lose, there will be thousands of faceless others to take your place. Your ubiquity makes you weak."
"You're wrong," you shout back.
"Am I?" The flames of the torches burnish Geth's hard, armored back. "Then why don't you lay down your arms and die? Surely your commander can simply send the next version of you."
Belaxis had said much the same thing, if not in so many words. You worry, for a split second, that they have been in communication. That Belaxis is a direct report to the thane, instead of just a worthless underling. You dismiss it. It doesn't matter.
Geth has stopped attacking, so you stop, too, doing everything you can to hide that you are already exhausted.
Somehow, Geth is still talking. "When you win, what will hold your people to you? When you spread yourselves across the Multiverse?"
You wish you could cover your ears. You howl, brandishing your spear. Geth, in an explosion of speed beyond anything he's displayed previously, bursts through your guard, catching you around the throat with a pincer. You freeze.
He hauls you close, breath hot and fetid. "What about you, little emissary? When you have burned down the rest of the plane, what will you have to sustain you beyond your orthodoxy? The love of that strange, harsh mother?"
The question reverberates inside you. #emph[What do you have to live for? Why do you exist?]
With a hard scream of rage, you drag your throat along the blade, opening it up in a wash of hot blood and oil. Wrenching yourself out of Geth's grasp, you bring down your blade in a single stroke, parting his head from his body. You catch it, your voice gurgling in your ruined throat.
"Rot in the ground, you worthless creature. Your contracts were as valuable as your pathetic life, in the end."
The pain is searing, but it is nothing when compared to the ecstasy of your victory. And as that ecstasy grows, so does a desire. It is overpowering. It drives you to your knees.
This fool, this monster. He doesn't deserve the ease of death. You hate him, you hate him! And yet, as your throat knits itself closed, you feel the give of the flesh beneath your fingertips, the dully glowing eyes going cloudy. They are almost beautiful now, beautiful like the gleam of green and silver around vulnerable flesh.
Geth's head gibbers with words you deem as little more than nonsense. What could he have been if he'd only submitted? If he'd only realized the truth.
Maybe, in this, you can help him.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The Dross Pits are a filthy, disreputable hole, to be sure, but they do have their moments.
Dominating the landscape, more imposing even than L<NAME>'s tower, is the Dominus of Pain. When Phyrexians first settled this plane and the glistening oil, in all its glory, began transforming it to its right and true state, parts of the land awoke. They moved, shook themselves, and began to wander.
No one truly knows what the Domini are, whether they think and desire the same way other Phyrexians do. If they wish, as is right, to bring everything under the dominion of the Machine Orthodoxy.
But you know what this Dominus craves, and a towering, razor-edged monolith standing against the sky is fully equipped to harvest it. It is a short flight away from Geth's tower, and you no longer care who sees you. But Geth's words still shiver inside you, pulsing and strange.
The Dominus is at rest. It doesn't look at you. It shifts and murmurs, burnished bones whispering in the wind. Rot perfumes the air. Bodies—all sorts, from skitterlings to aspirants to a single ragged priest—hang fluttering in the breeze, impaled through with the Dominus's vicious spines. Each of them will have been chosen and placed with care, their screams and twitches drunk down with rapt attention.
You don't understand the Dominus, but you'll make use of it.
A piercing wail rings out across the wastes as you pin the writhing body in your arms down onto a razor-tipped spoke on the Dominus's east side. Bright blood gleams dark in the cold necrogen light. It's impossibly warm on your hands.
"Why?" croaks Belaxis. The aspirant's back arches in a perfect, clean line. The bone spur protrudes from his abdomen, whiter than even his incompleat flesh.
"Why?" His voice cracks. "I helped you."
Your fingers move down to cup his chin, pulling him up. His face is twisting, eloquent with pain, shaking with it. His body, covered in soft, violable skin, feels so much more than yours.
"I know," you say, as you watch him writhe. "And I'm grateful."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
After the darkness of the higher spheres, the pure white of the Fair Basilica is almost blinding. Standing in the throne room, gazing up at the seat of the Mother of Machines, the grandeur nearly sends you to your knees.
You've spent the last few days in the poisonous chill of the Surgical Bay, sitting and watching as your creation is made manifest. That sphere belongs to Jin-Gitaxias, an inventor and visionary, but if you want to use the equipment, who would stop you? Nobody was foolish enough to try.
At the end of the process, you stood looking at your creation, a strange feeling welling up inside you, not dissimilar to the experience of tearing an enemy limb from limb. Except this time, you have made something.
You have made something, and you bring it home with you.
"Ixhel." Atraxa is elegant and upright, the ideal Phyrexian. The Grand Unifier, the perfect weapon in battle. She brings life to the Machine Orthodoxy. She spreads the glistening oil across the Multiverse. She is the only true voice you will ever answer to.
And now she looks upon what you have brought her with such disdain you feel like the plane has cracked open.
#figure(image("002_A Hollow Body/04.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
"Ixhel. What have you done?"
Silence thunders around you. In the distance, chanting rises like a sinister wind through hanging bones. Your breaths feel like knives.
"Commander—"
"Answer me."
You fall to your knees. "I only, I only wanted to make something." You risk a glance up, your body burning. "Like you made me."
Atraxa stares down at you. "I fashioned a weapon. That's what you are."
"I know, I know. I just thought—"
Atraxa lets out a harsh laugh you've only heard her use with enemies. To the incompleat. "You #emph[thought] ?"
The word barks through the hall, breaking the serenity like a glass window. It claws at the center of you. In the face of certainty, there is no need for thought. You know this. You don't need to hear the things she is saying to you.
"Get rid of it, it is a—"
"Vishgraz." A voice says the name. After a moment, you realize it must be yours. No one else knows it.
"What?" The word cracks over you like a blow.
"His name." You are about to drop through the floor. Never have you felt anything like this choking guilt. You've never done anything to merit it. A thing that follows orders is a thing that can never disappoint. "His name is Vishgraz."
Atraxa doesn't respond for such a long time that you think she's left. You look up. She's still here, but she isn't looking at you. "Get rid of it," she bites out.
She leaves you kneeling on the floor, staring up at an empty throne.
Beside you, a familiar voice begins to laugh. A light, musical chuckle. It suits this bright place, but it scrapes at your insides.
"Did you expect anything different?"
For the first time since you dropped your eyes in the face of your commander, you look at him.
That face, once enraging, now fills you with a mysterious fondness. It's unrecognizable, covered by the hard plating of compleation, but you know what lurks beneath it. The traitor's head you held in your hands. Arachnid legs sprout from a bulbous body, made powerful with silver and green plating. The piercing green of his eyes hold none of their previous owner's liveliness, and none of the anguish.
Two of those limbs were once delicate wings of white and red bone. The place where you took it from your own back still flares with a hot ache.
"What are you talking about?" Your voice comes out harsh.
Vishgraz offers you a hand with a slightly ironic flourish. You let him pull you to your feet.
"You think they will thank you for making something like me?"
"She made something like #emph[me] ," you insist, even as you know how little this means. What is a claim of hypocrisy in the face of the Machine Orthodoxy? Elesh Norn decides what is true, and Atraxa speaks with her voice.
"I wanted—" You don't finish. That's the crux—you feel it before it leaves your teeth. You #emph[wanted] , and in wanting, you failed.
You meant to say you wanted to save them, to give them what you have, what #emph[everyone ] will soon have—to lay Geth's foolishness low and raise Belaxis's nervous attentiveness, but~ that would be a lie, at least in part.
You hated Geth, the things he said clanging in your head like discordant bells. You liked Belaxis, or you liked the elegant lines of his incompleat flesh, the way the light glinted off his bright eyes and pale body.
You don't know why. You just didn't want either of them to disappear. You wanted to bring them with you. You are a wretched creature.
"I wanted to save you," is all you say aloud.
When Vishgraz responds with that same musical laugh, you both expect it and can't stand it. You jerk away from him. "Silence!"
"Save me?"
You raise a hand. "I told you, be quiet!" He doesn't wince, doesn't try to stop you. This is what stays your hand. It's not like you could do him any real damage, not anymore.
"Saved?" He steps in closer to you, limbs clicking, eyes gleaming. "Inside me, I can feel this body aching to tear itself apart. I feel the disparate parts of all the things that I used to be."
He looms over you, body so huge he blots out the light. He could crush you if he tried.
"I don't remember what I used to be," you say. You lean against him in a parody of an embrace. You shiver. It feels like you have been run through, like Belaxis on the spike.
You turn from him, swiftly. "Come with me."
Vishgraz is quiet for a moment. "Where are we going?"
You look back. "To get rid of you."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The Dross Pits stink. You stand beneath the same shaft and look up, through the swirling mist of necrogen. The same spot, but you feel miles away. It is not the plane that has changed.
Beside you, Vishgraz makes a questioning noise, like he is expecting a blow.
"Go," you say.
Nothing.
"Go!"
A slow exhalation of breath. "You should come with me."
That makes you look up. You laugh. "No."
#figure(image("002_A Hollow Body/05.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
Vishgraz takes an unsteady step toward you. "You know, Ixhel. I know that you do. They claim to read the stars, to know that the Multiverse is meant to come under Phyrexian rule. The harmony of compleation will spread and spread and that is good and right." Another step. "But you know all of that is ashes. You, your people, everything you have set yourselves to do—all of it exists at the whim of a tyrant."
You should deny it.
You say nothing.
"Your Machine Orthodoxy means as much as my contracts."
"You aren't him," you growl.
"Then what am I?"
You stare at the fractured ground. "You are my first defiance. Now go."
He is silent for a long time, and when he does respond, it is with nothing but the quiet creak of his limbs, the ones you gave him.
You stand at the base of the shaft long after he has vanished into the dark. Deep in the center of you is an ache that wishes to follow him.
But you don't.
Not yet.
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-F900.typ | typst | Apache License 2.0 | #let data = (
("CJK COMPATIBILITY IDEOGRAPH-F900", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F901", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F902", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F903", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F904", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F905", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F906", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F907", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F908", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F909", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F90A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F90B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F90C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F90D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F90E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F90F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F910", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F911", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F912", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F913", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F914", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F915", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F916", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F917", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F918", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F919", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F91A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F91B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F91C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F91D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F91E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F91F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F920", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F921", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F922", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F923", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F924", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F925", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F926", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F927", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F928", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F929", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F92A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F92B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F92C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F92D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F92E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F92F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F930", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F931", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F932", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F933", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F934", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F935", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F936", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F937", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F938", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F939", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F93A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F93B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F93C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F93D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F93E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F93F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F940", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F941", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F942", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F943", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F944", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F945", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F946", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F947", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F948", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F949", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F94A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F94B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F94C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F94D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F94E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F94F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F950", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F951", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F952", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F953", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F954", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F955", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F956", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F957", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F958", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F959", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F95A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F95B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F95C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F95D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F95E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F95F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F960", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F961", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F962", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F963", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F964", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F965", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F966", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F967", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F968", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F969", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F96A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F96B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F96C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F96D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F96E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F96F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F970", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F971", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F972", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F973", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F974", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F975", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F976", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F977", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F978", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F979", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F97A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F97B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F97C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F97D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F97E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F97F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F980", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F981", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F982", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F983", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F984", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F985", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F986", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F987", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F988", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F989", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F98A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F98B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F98C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F98D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F98E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F98F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F990", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F991", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F992", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F993", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F994", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F995", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F996", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F997", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F998", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F999", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F99A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F99B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F99C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F99D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F99E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F99F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9A9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9AA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9AB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9AC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9AD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9AE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9AF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9B9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9BA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9BB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9BC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9BD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9BE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9BF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9C9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9CA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9CB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9CC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9CD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9CE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9CF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9D9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9DA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9DB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9DC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9DD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9DE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9DF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9E9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9EA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9EB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9EC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9ED", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9EE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9EF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9F9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9FA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9FB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9FC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9FD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9FE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-F9FF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA00", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA01", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA02", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA03", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA04", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA05", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA06", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA07", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA08", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA09", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA0A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA0B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA0C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA0D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA0E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA0F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA10", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA11", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA12", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA13", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA14", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA15", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA16", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA17", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA18", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA19", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA1A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA1B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA1C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA1D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA1E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA1F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA20", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA21", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA22", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA23", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA24", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA25", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA26", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA27", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA28", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA29", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA2A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA2B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA2C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA2D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA2E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA2F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA30", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA31", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA32", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA33", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA34", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA35", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA36", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA37", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA38", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA39", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA3A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA3B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA3C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA3D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA3E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA3F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA40", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA41", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA42", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA43", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA44", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA45", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA46", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA47", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA48", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA49", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA4A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA4B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA4C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA4D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA4E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA4F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA50", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA51", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA52", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA53", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA54", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA55", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA56", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA57", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA58", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA59", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA5A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA5B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA5C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA5D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA5E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA5F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA60", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA61", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA62", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA63", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA64", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA65", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA66", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA67", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA68", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA69", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA6A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA6B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA6C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA6D", "Lo", 0),
(),
(),
("CJK COMPATIBILITY IDEOGRAPH-FA70", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA71", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA72", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA73", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA74", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA75", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA76", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA77", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA78", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA79", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA7A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA7B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA7C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA7D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA7E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA7F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA80", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA81", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA82", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA83", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA84", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA85", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA86", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA87", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA88", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA89", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA8A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA8B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA8C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA8D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA8E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA8F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA90", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA91", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA92", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA93", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA94", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA95", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA96", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA97", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA98", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA99", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA9A", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA9B", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA9C", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA9D", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA9E", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FA9F", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAA9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAAA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAAB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAAC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAAD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAAE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAAF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAB9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FABA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FABB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FABC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FABD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FABE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FABF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAC9", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FACA", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FACB", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FACC", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FACD", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FACE", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FACF", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD0", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD1", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD2", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD3", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD4", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD5", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD6", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD7", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD8", "Lo", 0),
("CJK COMPATIBILITY IDEOGRAPH-FAD9", "Lo", 0),
)
|
https://github.com/Ngan-Ngoc-Dang-Nguyen/thesis | https://raw.githubusercontent.com/Ngan-Ngoc-Dang-Nguyen/thesis/main/docs/xxx-how.typ | typst | #include "../tools/multi-section-ref.typ"
#import "../tools/macros.typ": eqref
#import "../typst-orange.typ": theorem, proof, lemma, proposition, corollary, example
// = CÁCH DÙNG TYPST
// - ở mỗi file, cần thêm các dòng sau ở đầu file
// ```typ
// #include "../tools/multi-section-ref.typ"
// #import "../tools/macros.typ": eqref
// #import "../typst-orange.typ": theorem, proof
// ```
// // - Ví dụ về cách trích dẫn @alizadehBudgetconstrainedInverseMedian2020a và @alizadehCombinatorialAlgorithmsInverse2011
// // #set math.equation(numbering: "(1)")
// - Ví dụ về cách ref một equation
// $ x^2 + y^2 = z^2 $ <eq:pytago>
// Có thể dùng lệnh `eqref(<equation-label>)` (equation reference) #eqref(<eq:pytago>)
// $ x^3 + y^3 = z^3 $ <eq:pytago3>
// Có thể ref #eqref(<eq:pytago3>).
// - Ví dụ về cách tạo định lý:
#theorem[
Định lý Pytago phát biểu rằng: ....
]
// #theorem(name: "Định lý Pytago")[
// Định lý Pytago phát biểu rằng: ....
// ]
// #proof[Để chứng minh định lý đầu tiên ta sẽ ...]
// #theorem(name: "Định lý Pytago số 2")[
// Định lý Pytago phát biểu rằng: ....
// ]
// #proof[...]
// #lemma(name: "XXX")[
// YYY
// ]
// #proposition(name: "XXX")[
// YYY
// ]
// #corollary(name: "XXX")[
// YYY
// ]
// #example(name: "XXX")[
// YYY
// ]
// #pagebreak() |
|
https://github.com/Nerixyz/icu-typ | https://raw.githubusercontent.com/Nerixyz/icu-typ/main/docs/docs/fmt-timezone.md | markdown | MIT License | # `fmt-timezone` 🚧
<!-- prettier-ignore -->
!!!warning
This function is experimental and can change at any time.
```typst-code
let fmt-timezone(
offset: none, // required
iana: none,
bcp47: none,
local-date: none,
metazone-id: none,
zone-variant: none,
locale: "en",
fallback: "localized-gmt",
format: none
)
```
Formats a timezone in some [`locale`](#locale).
## Arguments
### `offset`
A `str` specifying the GMT offset as an [ISO-8601 time zone designator](https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators) (`Z`, `±hh`, `±hh:mm`, or `±hhmm`). Since v0.1.2, this can be an `int` which specifies the offset in seconds. _(required)_
example{
```typst +preview
- #fmt-timezone(offset: "-07")
- #fmt-timezone(offset: "+07")
- #fmt-timezone(offset: "-03:30")
- #fmt-timezone(offset: "+1445")
- #fmt-timezone(offset: "Z")
- #fmt-timezone(offset: "-00")
// v0.1.2 and later:
- #fmt-timezone(offset: 60 * 60)
- #fmt-timezone(offset: 30 * 60)
- #fmt-timezone(offset: 30 * 60 + 30) // (1)!
```
1. See [`iso8601` fallback format](#fallback).
}example
### `iana`
Name of the IANA TZ identifier (e.g. `#!typst-code "Brazil/West"` - see [IANA](https://www.iana.org/time-zones) and [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)). This is mutually exclusive with [`bcp47`](#bcp47). This identifier will be converted to a BCP-47 ID.
example{
```typst +preview linenums="1"
#let f(offset, iana, locale: "en") = fmt-timezone(
offset: offset,
iana: iana,
zone-variant: "st",
local-date: datetime.today(),
format: "specific-non-location-short",
locale: locale
)
#set enum(start: 16)
+ #f("-06", "Canada/Central", locale: "fi")
+ #f("-05", "Canada/Eastern")
+ #f("-04", "Canada/Atlantic")
+ #f("+02", "Libya", locale: "en-GB")
+ #f("+02", "Africa/Windhoek", locale: "en-GB")
+ #f("+02", "Africa/Windhoek", locale: "en-NA")
+ #f("+02", "Africa/Johannesburg", locale: "en-NA")
+ #f("+03", "Indian/Antananarivo", locale: "af")
+ #f("+07", "Asia/Jakarta", locale: "id")
+ #f("+0930", "Australia/Adelaide", locale: "en-AU")
```
}example
### `bcp47`
Name of the BCP-47 timezone ID (e.g. `#!typst-code "iodga"` - see [timezone.xml](https://github.com/unicode-org/cldr/blob/main/common/bcp47/timezone.xml)). This is mutually exclusive with [`iana`](#iana).
<!-- prettier-ignore -->
!!! warning
In v0.1.1 it's not possible to set the BCP-47 timezone ID - use [`iana`](#iana) instead. This will be fixed in v0.1.2.
example{
```typst +preview linenums="1"
#let f(offset, bcp47) = fmt-timezone(
offset: offset,
bcp47: bcp47,
zone-variant: "st",
local-date: datetime.today(),
format: "specific-non-location-long",
locale: "en"
)
#set enum(start: 16)
+ #f("+01", "debsngn")
+ #f("+07", "khpnh")
+ #f("+12", "mhmaj")
+ #f("+01", "nenim")
+ #f("-08", "pst8pdt")
+ #f("+09", "ruchita")
+ #f("+11", "sbhir")
+ #f("+12", "tvfun")
+ #f("+05", "invalid")
```
}example
### `local-date`
A local date to calculate the [`metazone-id`](#metazone-id). This is mutually exclusive with [`metazone-id`](#metazone-id). This can be a dictionary or a [`datetime`](https://typst.app/docs/reference/foundations/datetime) with or without time (`hour`, `minute`, `second` - these will be 0 by default).
When formatting [zoned-datetimes](./fmt-zoned-datetime.md) this isn't necessary. [metaZones.xml](https://github.com/unicode-org/cldr/blob/main/common/supplemental/metaZones.xml) contains a mapping of time zones to metazones at specific dates.
example{
```typst +preview
#let dt(year) = (
year: year, month: 1, day: 1,
hour: 12,
// minute and second default to 0
)
#let f(iana, year) = fmt-timezone(
offset: "Z", // not used in these cases
iana: iana,
zone-variant: "st",
local-date: dt(year),
format: "specific-non-location-long",
)
- #f("Africa/Tripoli", 1981)
- #f("Africa/Tripoli", 1982)
- #f("Africa/Tripoli", 1991)
\
- #f("Europe/Vilnius", 1997)
- #f("Europe/Vilnius", 1999)
\
- #f("Pacific/Galapagos", 1985)
- #f("Pacific/Galapagos", 1986)
```
}example
### `metazone-id`
A short ID of the metazone. A metazone is a collection of multiple time zones that share the same localized formatting at a particular date and time (e.g. `#!typst-code "phil"` - see [metaZones.xml](https://github.com/unicode-org/cldr/blob/main/common/supplemental/metaZones.xml) (bottom)).
example{
```typst +preview linenums="1"
#let f(metazone-id) = fmt-timezone(
offset: "Z", // (1)!
zone-variant: "st",
metazone-id: metazone-id,
format: "specific-non-location-long",
locale: "en"
)
#set enum(start: 10)
+ #f("arge")
+ #f("chri")
+ #f("dumo")
+ #f("eufe")
+ #f("haal")
+ #f("loho")
+ #f("niue")
+ #f("kosr")
+ #f("----") // invalid
```
1. `offset` doesn't need to correspond to the metazone.
}example
### `zone-variant`
Many metazones use different names and offsets in the summer than in the winter. In ICU4X, this is called the _zone variant_. Supports `#!typst-code none`, `#!typst-code "st"` (standard), and `#!typst-code "dt"` (daylight).
example{
```typst +preview(vertical)
#let f(metazone-id, variant) = fmt-timezone(
offset: "Z", // (1)!
zone-variant: variant,
metazone-id: metazone-id,
format: "specific-non-location-long",
locale: "en"
)
#let c(metazone-id) = (
f(metazone-id, "st"),
f(metazone-id, "dt")
)
#table(
columns: (auto, auto),
table.header([*st* (standard)],[*dt* (daylight)]),
..c("ammo"),
..c("coco"), // (2)!
..c("euea"),
..c("haal"),
..c("loho"),
..c("mosc"),
..c("neze"),
)
```
1. `offset` doesn't need to correspond to the metazone.
2. Cocos Islands only have a single timezone (no summer/winter time).
}example
### `locale`
The locale to use when formatting the timezone. A [Unicode Locale Identifier].
example{
```typst +preview
#let f(
locale,
metazone-id: none,
offset: "Z",
) = fmt-timezone(
offset: offset,
zone-variant: "st",
metazone-id: metazone-id,
format: "specific-non-location-long",
locale: locale,
)
- #f("ko", metazone-id: "bang")
- #f("lo", metazone-id: "cook")
- #f("ms", metazone-id: "inwe")
- #f("nl", metazone-id: "peru")
- #f("en", offset: "+06")
- #f("fi", offset: "+06")
- #f("si", offset: "+06")
```
}example
### `fallback`
The timezone format fallback. Either `#!typst-code "localized-gmt"` or a dictionary for an [ISO 8601](#iso-8601) fallback (e.g. `#!typst-code (iso8601: (format: "basic", minutes: "required", seconds: "never"))`).
example{
```typst +preview
#let f(
offset,
iso: none,
minutes: true,
seconds: false,
locale: "en"
) = fmt-timezone(
offset: offset,
fallback: if iso != none {(
iso8601: (
format: iso,
minutes: if minutes {
"required"
} else {
"optional"
},
seconds: if seconds {
"optional"
} else {
"never"
},
)
)} else {
"localized-gmt"
},
locale: locale,
)
- #f("+06")
- #f("+06", locale: "cs")
- #f("+06", locale: "da")
- #f("+06", iso: "basic")
- #f("+06", iso: "extended")
- #f("+06", iso: "utc-basic")
- #f("+06", iso: "utc-extended")
\
- #f("Z", iso: "basic")
- #f("Z", iso: "extended")
- #f("Z", iso: "utc-basic")
- #f("Z", iso: "utc-extended")
\
// 1h 30min 30s
#let sec = 90 * 60 + 30
- #f(sec, iso: "extended")
- #f(sec, iso: "extended", seconds: true)
- #f(sec, iso: "extended", minutes: false)
- #f(60 * 60, iso: "extended", minutes: false)
```
}example
### `format`
The format to display a time zone as (see [Time Zone Format Terminology](https://unicode.org/reports/tr35/tr35-dates.html#time-zone-format-terminology)). Note that not every [`locale`](#locale) has definitions for all formats. If none is found, [`fallback`](#fallback) will be used to format the timezone. Valid options are:
- `generic-location` (e.g. "Los Angeles Time") [`bcp47`](#bcp47) or [`iana`](#iana) must be specified
- `generic-non-location-long` (e.g. "Pacific Time") [`local-date`](#local-date) or [`metazone-id`](#metazone-id) must be specified
- `generic-non-location-short` (e.g. "PT") [`local-date`](#local-date) or [`metazone-id`](#metazone-id) must be specified
- `localized-gmt` (e.g. "GMT-07:00")
- `specific-non-location-long` (e.g. "Pacific Standard Time") [`local-date`](#local-date) or [`metazone-id`](#metazone-id) must be specified
- `specific-non-location-short` (e.g. "PDT") [`local-date`](#local-date) or [`metazone-id`](#metazone-id) must be specified.
- A dictionary of [ISO 8601](#iso-8601) options (e.g. "-07:00")
example{
```typst +preview(vertical)
#let f(offset, iana, locale: "en") = (
"generic-location",
"generic-non-location-long",
"generic-non-location-short",
"localized-gmt",
"specific-non-location-long",
"specific-non-location-short"
).map(format => fmt-timezone(
offset: offset,
zone-variant: "st",
iana: iana,
local-date: datetime.today(),
format: format,
locale: locale
))
#let hc(..args) = table.cell(align: center, ..args)
#table(
columns: (auto, auto, auto, auto, auto, auto),
hc(rowspan: 2, align: bottom + center)[generic-location],
hc(colspan: 2)[generic-non-location-],
hc(rowspan: 2, align: bottom)[localized-gmt],
hc(colspan: 2)[specific-non-location-],
hc(x: 1)[long],
hc[short],
hc(x: 4)[long],
hc[short],
..f("-11", "Pacific/Midway"),
..f("-07", "US/Pacific"),
..f("-06", "Mexico/General"),
..f("-05", "Jamaica"),
..f("-04", "Chile/Continental", locale: "es-CL"),
..f("-03:30", "Canada/Newfoundland", locale: "en-CA"),
..f("-03", "Brazil/East", locale: "pt-BR"),
..f("-02", "America/Godthab"),
..f("-01", "Atlantic/Azores"),
..f("Z", "Africa/Timbuktu"),
..f("+01", "Arctic/Longyearbyen", locale: "en-GB"),
..f("+02", "Africa/Johannesburg", locale: "en-ZA"),
..f("+03", "Indian/Mayotte", locale: "en-MG"),
)
```
}example
#### ISO-8601
ISO-8601 options are passed as a dictionary inside a dictionary with the `#!typst-code iso8601` key. The options must include the following keys:
- `#!typst-code format`: one of `#!typst-code "basic"`, `#!typst-code "extended"`, `#!typst-code "utc-basic"`, or `#!typst-code "utc-extended"`
- `#!typst-code minutes`: either `#!typst-code "required"` or `#!typst-code "optional"`
- `#!typst-code seconds`: either `#!typst-code "optional"` or `#!typst-code "never"`
example{
```typst +preview
#let f(
offset,
format,
minutes: "required",
seconds: "never",
) = fmt-timezone(
offset: offset,
format: (
iso8601: (
format: format,
minutes: minutes,
seconds: seconds,
),
),
)
- #f("-03", "basic")
- #f("-03", "extended")
- #f("-03", "utc-basic")
- #f("-03", "utc-extended")
\
- #f("Z", "basic")
- #f("Z", "extended")
- #f("Z", "utc-basic")
- #f("Z", "utc-extended")
\
// 2h 30min 30s
#let sec = 2 * 60 * 60 + 30 * 60 + 30
- #f(sec, "extended")
- #f(sec, "extended", seconds: "optional")
- #f(sec, "extended", minutes: "optional")
- #f(2 * 60 * 60, "extended", minutes: "optional")
```
}example
[Unicode Locale Identifier]: https://unicode.org/reports/tr35/tr35.html#Unicode_locale_identifier
|
https://github.com/tinnamchoi/resumes | https://raw.githubusercontent.com/tinnamchoi/resumes/master/src/template/template.typ | typst | #import "private.typ": *
// main template
#let header(
name: "",
links: (),
) = {
context {
set align(center)
set text(size: 9pt)
show par: set block(spacing: 0.25em)
display_name(name: name)
parbreak()
display_links(links: links)
}
}
#let template(
doc,
) = [
#set text(font: "Rubik", size: 9pt)
#show par: set block(spacing: 1em)
#show heading: it => {
let current_color = color
if it.depth == 2 {
current_color = lightcolor
}
set text(fill: current_color)
v(-0.5em)
it
v(-1em)
line(length: 100%, stroke: current_color)
}
#doc
]
// custom sections
// mostly syntactic sugar to make the markup more readable
#let education(
institution: "",
degree: "",
grade: "",
location: "",
from: "",
to: "",
date: "",
) = [
#thick(
title: institution,
subtitle: degree,
middle: grade,
location: location,
from: from,
to: to,
date: date,
)
]
#let experience(
company: "",
role: "",
location: "",
technologies: "",
from: "",
to: "",
date: "",
) = [
#thick(
title: company,
subtitle: role,
location: location,
middle: technologies,
from: from,
to: to,
date: date,
)
]
#let project(
title: "",
technologies: "",
project_link: "",
) = [
#thin(
title: title,
center: technologies,
right: link("https://" + project_link)[#raw(project_link)]
)
]
#let technologies(
daily_drivers: "",
others: "",
) = {
skill(title: "Daily drivers")[#daily_drivers]
h(1fr)
skill(title: "Familiar")[#others]
}
#let achievement(
body,
title: "",
subtitle: "",
) = {
box[
#skill(title: title)[#subtitle]
#h(1fr)
#text(style: "italic")[#body]
]
}
#let letter(
greeting: "Dear Sir or Madam, ",
date: datetime.today(),
body: {
lorem(100)
parbreak()
lorem(100)
parbreak()
lorem(100)
},
closing: "Yours faithfully,",
signature: "Firstname Lastname"
) = {
v(1fr)
show par: set block(spacing: 2em)
text(weight: "semibold")[#greeting]
h(1fr)
date.display()
parbreak()
par(first-line-indent: 1em, justify: true)[#body]
parbreak()
text(weight: "semibold")[#closing]
parbreak()
signature
v(1fr)
}
|
|
https://github.com/0x1B05/nju_os | https://raw.githubusercontent.com/0x1B05/nju_os/main/lecture_notes/content/19_系统调用和UNIX-Shell.typ | typst | #import "../template.typ": *
#pagebreak()
= 系统调用和 UNIX Shell
#image("images/2023-12-06-20-05-05.png")
```sh
❯ file /bin/ls
/bin/ls: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=897f49cafa98c11d63e619e7e40352f
855249c13, for GNU/Linux 3.2.0, stripped
❯ ldd
ldd: missing file arguments
Try `ldd --help' for more information.
❯ ldd /bin/ls
linux-vdso.so.1 (0x00007ffe6d8c8000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fb971cd2000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb971aaa000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fb971a13000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb971d34000)
❯ ldd /bin/busybox
not a dynamic executable
```
== (UNIX) Shell
=== 为用户封装操作系统 API
我们需要一个 “用户能直接操作” 的程序管理操作系统对象。
需求分析
- 我们每天都拿操作系统做什么?
- 启动应用程序
- 即时通信
- 影音娱乐
- ...
- 我们需要一个程序能协调多个应用程序
=== 为用户封装操作系统 API
#image("images/2023-12-06-20-05-20.png")
Shell: Kernel 的 “外壳”
- “与人类直接交互的第一个程序”
=== The UNIX Shell
“终端” 时代的伟大设计; “Command-line interface” (CLI) 的巅峰
*Shell 是一门 “把用户指令翻译成系统调用” 的编程语言*
- 原来我们一直在编程
- 直到有了 Graphical Shell (GUI)
- Windows, Gnome, Symbian, Android
=== 脾气有点小古怪的 UNIX 世界
“Unix is user-friendly; it's just choosy about who its friends are.”
但如果把 shell 理解成编程语言,“不好用” 好像也没什么毛病了 你见过哪个编程语言 “好用” 的?
#tip("Tip")[
(UNIX 世界有很多历史遗留约定), 在当时那个很紧凑的计算力下, 做了一个既方便编译器实现, 又比较好用的妥协.
]
=== The Shell Programming Language
基于文本替换的快速工作流搭建
- 重定向: `cmd > file < file 2> /dev/null`
- 顺序结构: `cmd1; cmd2, cmd1 && cmd2, cmd1 || cmd2`
- 管道: `cmd1 | cmd2`
- 预处理: `$()`, `<()`
- 变量/环境变量、控制流……
Job control
- 类比窗口管理器里的 “叉”、“最小化”
- jobs, fg, bg, wait
- (今天的 GUI 并没有比 CLI 多做太多事)
==== `ls -l | wc -l`
#image("images/2023-12-06-20-05-29.png")
shell 语言表达式的值是什么呢? -> 翻译成系统调用. 先做字符串的预编译,
基于文本的替换. 解析成语法树, 最终翻译成系统调用的序列.
#tip("Tip")[
shell 是 kernel 和人之间的桥梁
]
=== 人工智能时代,我们为什么还要读手册?
今天的人工智能还是 “被动” 的
- 它还不能很好地告诉你,你应该去找什么
- Manual 是一个 complete source
- 当然,AI 可以帮助你更快速地浏览手册、理解程序的行为
Let's RTFM, with ChatGPT Copilot!
- man sh - command interpreter(强烈推荐!!!)
- Read the friendly manual 😃
==== 举例
dash 里的`-f`选项: disable pathname expansion.
```sh
❯ ls *
linux:
Makefile init minimal.S
sh:
Makefile init.gdb lib.h sh.c visualize.py
❯ bash -c -f "ls *"
ls: cannot access '*': No such file or directory
```
例如里面的重定向:
```txt
Redirections
Redirections are used to change where a command reads its input or sends its output. In general, redirections open, close, or duplicate an existing reference to
a file. The overall format used for redirection is:
[n] redir-op file
where redir-op is one of the redirection operators mentioned previously. Following is a list of the possible redirections. The [n] is an optional number between
0 and 9, as in ‘3’ (not ‘[3]’), that refers to a file descriptor.
[n]> file Redirect standard output (or n) to file.
[n]>| file Same, but override the -C option.
[n]>> file Append standard output (or n) to file.
[n]< file Redirect standard input (or n) from file.
[n1]<&n2 Copy file descriptor n2 as stdout (or fd n1). fd n2.
[n]<&- Close standard input (or n).
[n1]>&n2 Copy file descriptor n2 as stdin (or fd n1). fd n2.
[n]>&- Close standard output (or n).
[n]<> file Open file for reading and writing on standard input (or n).
```
== 复刻经典
=== A Zero-dependency UNIX Shell (from xv6)
Shell 是 Kernel 之外的 “壳”
- 它也是一个状态机 (同 minimal.S)
- 完全基于系统调用 API
我们移植了 xv6 的 shell
- 零库函数依赖 (`-ffreestanding` 编译、`ld` 链接)
- 可以作为最小 Linux 的 `init` 程序
支持的功能
- 重定向/管道 `ls > a.txt, ls | wc -l`
- 后台执行 `ls &`
- 命令组合 `(echo a ; echo b) | wc -l`
=== 阅读代码
应该如何阅读 xv6 shell 的代码?
==== strace
- 适当的分屏和过滤
- AI 使阅读文档的成本大幅降低
上屏:`strace -f -o sh.log ./sh`
下屏:`tail -f sh.log`
#image("images/2023-12-06-20-09-47.png")
```sh
(sh-xv6) > /bin/ls
Makefile init.gdb lib.h sh sh.c sh.log sh.o visualize.py
(sh-xv6) >
```
```log
13932 execve("./sh", ["./sh"], 0x7ffd5c673378 /* 67 vars */) = 0
13932 write(2, "(sh-xv6) > ", 11) = 11
13932 read(0, "/", 1) = 1
13932 read(0, "b", 1) = 1
13932 read(0, "i", 1) = 1
13932 read(0, "n", 1) = 1
13932 read(0, "/", 1) = 1
13932 read(0, "l", 1) = 1
13932 read(0, "s", 1) = 1
13932 read(0, "\n", 1) = 1
13932 fork() = 13964
13964 execve("/bin/ls", ["/bin/ls"], NULL <unfinished ...>
13932 wait4(-1, <unfinished ...>
13964 <... execve resumed>) = 0
13964 brk(NULL) = 0x5558bf38a000
13964 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe83bf4cf0) = -1 EINVAL (Invalid argument)
13964 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39e8d6b000
13964 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
13964 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
13964 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=63055, ...}, AT_EMPTY_PATH) = 0
13964 mmap(NULL, 63055, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f39e8d5b000
13964 close(3) = 0
13964 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
13964 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
13964 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=166280, ...}, AT_EMPTY_PATH) = 0
13964 mmap(NULL, 177672, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f39e8d2f000
13964 mprotect(0x7f39e8d35000, 139264, PROT_NONE) = 0
13964 mmap(0x7f39e8d35000, 106496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f39e8d35000
13964 mmap(0x7f39e8d4f000, 28672, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x20000) = 0x7f39e8d4f000
13964 mmap(0x7f39e8d57000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7f39e8d57000
13964 mmap(0x7f39e8d59000, 5640, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f39e8d59000
13964 close(3) = 0
13964 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
13964 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\237\2\0\0\0\0\0"..., 832) = 832
13964 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
13964 pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0"..., 48, 848) = 48
13964 pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\244;\374\204(\337f#\315I\214\234\f\256\271\32"..., 68, 896) = 68
13964 newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=2216304, ...}, AT_EMPTY_PATH) = 0
13964 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
13964 mmap(NULL, 2260560, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f39e8b07000
13964 mmap(0x7f39e8b2f000, 1658880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7f39e8b2f000
13964 mmap(0x7f39e8cc4000, 360448, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bd000) = 0x7f39e8cc4000
13964 mmap(0x7f39e8d1c000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x214000) = 0x7f39e8d1c000
13964 mmap(0x7f39e8d22000, 52816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f39e8d22000
13964 close(3) = 0
13964 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
13964 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
13964 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=613064, ...}, AT_EMPTY_PATH) = 0
13964 mmap(NULL, 615184, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f39e8a70000
13964 mmap(0x7f39e8a72000, 438272, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f39e8a72000
13964 mmap(0x7f39e8add000, 163840, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6d000) = 0x7f39e8add000
13964 mmap(0x7f39e8b05000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x94000) = 0x7f39e8b05000
13964 close(3) = 0
13964 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39e8a6d000
13964 arch_prctl(ARCH_SET_FS, 0x7f39e8a6d800) = 0
13964 set_tid_address(0x7f39e8a6dad0) = 13964
13964 set_robust_list(0x7f39e8a6dae0, 24) = 0
13964 rseq(0x7f39e8a6e1a0, 0x20, 0, 0x53053053) = 0
13964 mprotect(0x7f39e8d1c000, 16384, PROT_READ) = 0
13964 mprotect(0x7f39e8b05000, 4096, PROT_READ) = 0
13964 mprotect(0x7f39e8d57000, 4096, PROT_READ) = 0
13964 mprotect(0x5558bdeec000, 4096, PROT_READ) = 0
13964 mprotect(0x7f39e8da5000, 8192, PROT_READ) = 0
13964 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
13964 munmap(0x7f39e8d5b000, 63055) = 0
13964 statfs("/sys/fs/selinux", 0x7ffe83bf4d30) = -1 ENOENT (No such file or directory)
13964 statfs("/selinux", 0x7ffe83bf4d30) = -1 ENOENT (No such file or directory)
13964 getrandom("\x07\x2f\x24\xe8\x5d\xe2\x34\x76", 8, GRND_NONBLOCK) = 8
13964 brk(NULL) = 0x5558bf38a000
13964 brk(0x5558bf3ab000) = 0x5558bf3ab000
13964 openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3
13964 newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
13964 read(3, "nodev\tsysfs\nnodev\ttmpfs\nnodev\tbd"..., 1024) = 478
13964 read(3, "", 1024) = 0
13964 close(3) = 0
13964 access("/etc/selinux/config", F_OK) = -1 ENOENT (No such file or directory)
13964 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
13964 ioctl(1, TIOCGWINSZ, {ws_row=26, ws_col=192, ws_xpixel=3072, ws_ypixel=832}) = 0
13964 openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
13964 newfstatat(3, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
13964 getdents64(3, 0x5558bf38f920 /* 10 entries */, 32768) = 280
13964 getdents64(3, 0x5558bf38f920 /* 0 entries */, 32768) = 0
13964 close(3) = 0
13964 newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x4), ...}, AT_EMPTY_PATH) = 0
13964 write(1, "Makefile init.gdb lib.h sh s"..., 64) = 64
13964 close(1) = 0
13964 close(2) = 0
13964 exit_group(0) = ?
13964 +++ exited with 0 +++
13932 <... wait4 resumed>NULL, 0, NULL) = 13964
13932 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13964, si_uid=1000, si_status=0, si_utime=0, si_stime=1} ---
13932 write(2, "(sh-xv6) > ", 11) = 11
```
==== gdb
- AskGPT: How to debug a process that forks children processes in gdb?
- AI 也可以帮你解释 (不用去淘文档了)
- 以及,定制的 visualization
- 对于 Shell,我们应该显示什么?
init.gdb
```gdb
set follow-fork-mode child
set detach-on-fork off
set follow-exec-mode same
set confirm off
set pagination off
source visualize.py
break _start
run
n 2
define hook-stop
pdump
end
```
1. `set follow-fork-mode child`: 设置在程序调用`fork()`系统调用时如何跟踪子进程。child参数表示在子进程中继续调试,而不是父进程。
2. `set detach-on-fork off`: 设置在程序调用`fork()`系统调用时是否自动脱离当前进程并附加到新创建的子进程。off表示不自动脱离。
3. `set follow-exec-mode same`: 设置在程序调用`exec()`系统调用时如何跟踪执行的新程序。same表示继续跟踪现有进程,而不是启动新的调试会话。
4. `set confirm off`:
设置GDB在关键操作(例如删除断点)之前是否需要确认。off表示不需要确认。
5. `set pagination off`: 设置GDB是否分页显示输出。off表示禁用分页。
6. `source visualize.py`:
加载名为visualize.py的Python脚本文件,用于可视化程序的状态。
7. `break _start`: 在程序的`_start`函数处设置断点。
8. `run`: 启动程序并开始调试会话。
9. `n 2`: 运行两次程序,即跳过两行代码。
10. `define hook-stop pdump end`:
定义当程序停止时执行的命令。这里定义了一个名为pdump的自定义命令,它将输出程序的状态。
这些命令和设置旨在改善GDB调试会话中的交互性和可视化。例如,设置跟踪模式为child和禁用自动分页显示可以更好地跟踪程序状态,而自定义命令pdump可以快速查看程序的状态。
=== 理解管道
#image("images/2023-11-27-13-55-21.png")
== 展望未来
=== UNIX Shell: Traps and Pitfalls
在 “自然语言”、“机器语言” 和 “1970s 的算力” 之间达到优雅的平衡
- 平衡意味着并不总是完美
- 操作的 “优先级”?
- `ls > a.txt | cat`
- 我已经重定向给 a.txt 了,cat 是不是就收不到输入了?
- bash/zsh 的行为是不同的
- 所以脚本一般都是 `#!/bin/bash` 甚至 `#!/bin/sh` 保持兼容
- 文本数据 “责任自负”
- 有空格?后果自负!
- (PowerShell: 我有 object stream pipe 啊喂)
=== 另一个有趣的例子
```
$ echo hello > /etc/a.txt
bash: /etc/a.txt: Permission denied
$ sudo echo hello > /etc/a.txt
bash: /etc/a.txt: Permission denied
```
=== 展望未来
Open question: 我们能否从根本上改变管理操作系统的方式?
需求分析
- Fast Path: 简单任务
- 尽可能快
- 100% 准确
- Slow Path: 复杂任务
- 任务描述本身就可能很长
- 需要 “编程”
=== 未来的 Shell
自然交互/脑机接口:心想事成
- Shell 就成为了一个应用程序的交互库
- UNIX Shell 是 “自然语言”、“机器语言” 之间的边缘地带
系统管理与语言模型
- fish, zsh, #link("https://www.warp.dev/")[ Warp ], ...
- Stackoverflow, tldr, #link("https://github.com/nvbn/thefuck")[ thef\*\*k ] (自动修复)
- Command palette of vscode (Ctrl-Shift-P)
- Predictable
- 流程很快 (无需检查),但可能犯傻
- Creative
- 给你惊喜,但偶尔犯错
|
|
https://github.com/mgoulao/IST-MSc-Thesis-Typst-Template | https://raw.githubusercontent.com/mgoulao/IST-MSc-Thesis-Typst-Template/main/appendix_a.typ | typst | = Appendix
== Appendix Section
#lorem(100) |
|
https://github.com/mielpeeters/pitcher | https://raw.githubusercontent.com/mielpeeters/pitcher/main/0.1.0/pitch.typ | typst | #let slide_count = counter("slide")
#let slide_type = state("stype", 0)
#let define_style(color: rgb("#0328fc"), font: "IBM Plex Sans", ..args) = {
let primary_color = color
let secondary_color = color.lighten(20%)
let subtle_color = color.lighten(70%)
let dark_color = color.darken(20%)
let font_color = luma(30)
let font_subtle_color = luma(80)
let color_120 = color.rotate(120deg)
let color_240 = color.rotate(240deg)
let accent_color = primary_color.negate()
let accent_color_heavy = accent_color.darken(30%)
let accent_color_light = accent_color.lighten(20%)
// all optional parameters
let radius = 15pt;
if args.named().keys().contains("radius") {
radius = args.named().at("radius")
}
let dict = (
"primary_color": color,
"secondary_color": secondary_color,
"subtle_color": subtle_color,
"dark_color": dark_color,
"accent_color": accent_color,
"accent_color_heavy": accent_color_heavy,
"accent_color_light": accent_color_light,
"color_120": color_120,
"color_240": color_240,
"font_color": font_color,
"font_subtle_color": font_subtle_color,
"font": font,
"radius": radius,
)
dict
}
#let default_sets(body) = {
set underline(stroke: (cap: "round"), offset: 1.3pt)
set image(fit: "contain")
show raw.where(block: true): orig => block(
fill: luma(235),
width: 100%,
inset: 10pt,
radius: 8pt,
[
#set text(font: "Fira Code", ligatures: true)
#set align(right)
#place(
top + right,
text(gray, orig.lang)
)
#set align(left)
#orig
]
)
show raw.where(block: false): orig => {
box(fill:luma(230), radius: 2pt, height: 1em, inset: 0.1em)[
#set text(font: "Fira Code", ligatures: true)
#orig
]
}
show ref: it => {
let eq = math.equation
let el = it.element
if el != none and el.func() == eq {
numbering(
el.numbering,
..counter(eq).at(el.location())
)
} else {
it
}
}
body
}
#let default_page_settings(style, title: "", description: "", body) = {
set page(
paper: "presentation-16-9",
margin: (
left: 80pt,
right: 80pt,
bottom: 0pt
),
header: none,
)
show outline.entry: it => {
set text(weight: "bold")
grid(
columns: (auto, auto),
[#it.body],
[#line(start: (0.2em, 0.7em), length: 100%, stroke: (dash: "loosely-dotted", cap: "round"))]
)
v(-35pt)
}
show figure: fig => {
box(radius: style.radius, clip: true, fill: white)[#fig]
}
set cite(style: "chicago-author-date")
show figure.caption: set text(size: 13pt)
show: default_sets.with()
set list(indent: 0pt)
show heading.where(level: 1): it => {
underline(
stroke: (paint: style.accent_color_light, thickness: 2pt, cap: "round"),
offset: 3pt)[#it]
v(25pt)
}
show heading.where(level: 2): it => {
set text(size: 20pt)
it.body
}
set text(size: 18pt, font: style.font, fill: style.font_color)
let pageNumb(curr, total) = {
if curr != 0 {
place(right + bottom, dy: -28pt, dx: 40pt)[
#set text(style.secondary_color, weight: 600)
#curr
#set text(fill: style.font_subtle_color)
\/ #total
]
}
}
set page(
fill: luma(245),
footer: [
#set text(size: 9pt, fill: style.secondary_color, weight: 500)
#locate(loc => {
let slide = slide_count.at(loc).first()
let tp = slide_type.at(loc)
if slide != 0 [
#place(left+bottom, dy: -23pt, dx: -00pt)[
#title \
// #h(2%)
#let col = if tp != 1 {
style.subtle_color
} else {
style.secondary_color.lighten(30%)
}
#set text(fill: col, weight: 500)
#description
]
]
})
#slide_count.display(pageNumb, both: true)
]
)
body
}
#let set_type(num) = {
slide_type.update(num)
}
#let default_slide(style, count: 0, body) = {
set page(
fill: luma(245),
)
set text(font: style.font, fill: style.font_color)
slide_type.update(0)
body
}
#let new_slide() = {
pagebreak()
slide_count.step()
}
#let to_string(input) = {
if type(input) == str {
input
} else if type(input) == array {
if type(input.at(0, default: "")) == str {
input.join(", ")
}
}
}
#let title_slide(style: (), title: "", title_color: false, ..args) = {
let authors = ""
if args.named().keys().contains("author") {
authors = to_string(args.named().at("author"))
} else if args.named().keys().contains("authors") {
authors = to_string(args.named().at("authors"))
}
page(fill: style.primary_color)[
#set align(horizon)
#let clr = luma(255)
#if title_color {
clr = style.accent_color_light
}
#set text(size: 60pt, weight: 800, fill: clr)
#title \
#set text(size: 60pt, weight: 800, fill: luma(255))
#if args.named().keys().contains("description") [
#let description = args.named().at("description")
#v(-47pt)
#set text(size: 20pt)
#description
#v(50pt)
#set align(right)
#place(right + bottom, dy: -60pt, dx: 20pt)[
#set text(size: 20pt, weight: 600, fill: style.subtle_color)
#authors
]
] else [
#set text(size: 30pt, weight: 600, fill: style.subtle_color)
#authors
]
]
}
#let accent_slide(style, body) = {
set page(
fill: style.subtle_color
)
set text(fill: style.dark_color)
slide_type.update(1)
body
}
#let animated_slide(style, ..elements) = {
let count = 0
for len in range(elements.pos().len()) {
if count > 0 [
#pagebreak()
]
default_slide(style, count: count)[
#set heading(outlined: false) if (count > 0)
#for i in range(len + 1) [
#elements.pos().at(i)
]
]
count += 1
}
}
#let set_style(style, title: "", description: "", body) = {
show: default_page_settings.with(style, title: title, description: description)
body
}
// create slides using this function:
#let slides(title_color: false, ..args, body) = {
// default title is empty
let title = ""
if args.named().keys().contains("title") {
title = args.named().at("title")
}
// default description is empty
let description = ""
if args.named().keys().contains("description") {
description = args.named().at("description")
}
// default style is blue with IBM Plex Sans font
let style = define_style(color: rgb("#3271a8"), font: "IBM Plex Sans")
if args.named().keys().contains("style") {
style = args.named().at("style")
}
show: default_page_settings.with(style, title: title, description: description)
title_slide(style: style, title: title, title_color: title_color, ..args)
body
}
|
|
https://github.com/jredondoyuste/TypstReport | https://raw.githubusercontent.com/jredondoyuste/TypstReport/main/report.typ | typst | The Unlicense | #let report(
title: "Report",
event: "Nobel Prize Ceremony",
author: "<NAME>",
supervisor: "<NAME>",
placedate: "Copenhagen, May 12th 2023.",
doc,
) = {
let header_text(term, align_value:left) = {
set text(
font: "TeX Gyre Adventor",
size: 11pt,
weight: "thin",
tracking: 1.3pt,
fill: black.lighten(33%)
)
align(align_value)[#term]
}
let ending_text(end_text, align_value:left) = {
set text(
font: "TeX Gyre Adventor",
size: 9pt,
style: "italic",
fill: black.lighten(33%)
)
align(align_value)[#end_text]
}
set page(
paper: "a4",
margin: (x:2cm, bottom: 3.5cm),
header: [#grid(
columns: (1fr, 1fr),
header_text[#event],
header_text(align_value:right)[#author]
)
#line(start: (-1cm, 0cm), end: (18cm, 0cm), stroke: 1pt + red.darken(30%))
],
footer: [
#stack(
dir: ttb,
line(start: (-1cm, 0cm), end: (18cm, 0cm), stroke: 1pt + red.darken(30%)),
v(0.1cm),
line(start: (-1cm, 0cm), end: (18cm, 0cm), stroke: 1pt + red.darken(30%)),
v(0.1cm),
image("all-logos.png", fit: "contain")
)
]
)
let title_format(title_val) = {
set text(
font: "TeX Gyre Pagella",
size: 16pt,
weight: "bold",
tracking: 2pt,
)
align(center)[#title_val]
}
title_format[#title]
set text(
font: "<NAME>",
size: 10pt,
weight: "regular",
tracking: 1pt
)
set par(
justify: true
)
doc
v(0.2cm)
grid(
columns: (1fr, 1fr),
ending_text[#supervisor],
ending_text(align_value: right)[#placedate]
)
} |
https://github.com/v1j4y/intro_qmech | https://raw.githubusercontent.com/v1j4y/intro_qmech/master/template.typ | typst | #let buildMainHeader(mainHeadingContent) = {
[
#align(center, smallcaps(mainHeadingContent))
#line(length: 100%)
]
}
#let buildSecondaryHeader(mainHeadingContent, secondaryHeadingContent) = {
[
#smallcaps(mainHeadingContent) #h(1fr) #emph(secondaryHeadingContent)
#line(length: 100%)
]
}
// To know if the secondary heading appears after the main heading
#let isAfter(secondaryHeading, mainHeading) = {
let secHeadPos = secondaryHeading.location().position()
let mainHeadPos = mainHeading.location().position()
if (secHeadPos.at("page") > mainHeadPos.at("page")) {
return true
}
if (secHeadPos.at("page") == mainHeadPos.at("page")) {
return secHeadPos.at("y") > mainHeadPos.at("y")
}
return false
}
#let getHeader() = {
locate(loc => {
// Find if there is a level 1 heading on the current page
let nextMainHeading = query(selector(heading).after(loc), loc).find(headIt => {
headIt.location().page() == loc.page() and headIt.level == 1
})
if (nextMainHeading != none) {
return buildMainHeader(nextMainHeading.body)
}
// Find the last previous level 1 heading -- at this point surely there's one :-)
let lastMainHeading = query(selector(heading).before(loc), loc).filter(headIt => {
headIt.level == 1
}).last()
// Find if the last level > 1 heading in previous pages
let previousSecondaryHeadingArray = query(selector(heading).before(loc), loc).filter(headIt => {
headIt.level > 1
})
let lastSecondaryHeading = if (previousSecondaryHeadingArray.len() != 0) {previousSecondaryHeadingArray.last()} else {none}
// Find if the last secondary heading exists and if it's after the last main heading
if (lastSecondaryHeading != none and isAfter(lastSecondaryHeading, lastMainHeading)) {
return buildSecondaryHeader(lastMainHeading.body, lastSecondaryHeading.body)
}
return buildMainHeader(lastMainHeading.body)
})
}
#let project(
title: "",
abstract: [],
authors: (),
logo: none,
body
) = {
// Set the document's basic properties.
set document(author: authors.map(a => a.name), title: title)
set text(font: "New Computer Modern", lang: "en")
show math.equation: set text(weight: 400)
set heading(numbering: "1.1")
set par(justify: true)
// Title page.
v(0.25fr)
align(center)[
#text(2em, weight: 700, title)
]
// Author information.
pad(
top: 0.7em,
grid(
columns: (1fr),
gutter: 1em,
..authors.map(author => align(center)[
*#author.name* \
#author.email \
#author.affiliation \
#author.postal \
#author.phone
]),
),
)
// Logo
if logo != none {
v(0.25fr)
align(center, image(logo, width: 26%))
v(0.50fr)
} else {
v(0.75fr)
}
pagebreak()
// Abstract page.
set page(numbering: "I", number-align: center)
v(1fr)
align(center)[
#heading(
outlined: false,
numbering: none,
text(0.85em, smallcaps[Abstract]),
)
]
abstract
v(1.618fr)
counter(page).update(1)
pagebreak()
// Table of contents.
outline(depth: 3, indent: true)
pagebreak()
// Main body.
set page(numbering: "1", number-align: center)
set par(first-line-indent: 20pt)
set page(header: getHeader())
counter(page).update(1)
body
} |
|
https://github.com/ShapeLayer/ucpc-solutions__typst | https://raw.githubusercontent.com/ShapeLayer/ucpc-solutions__typst/main/tests/i18n/test.typ | typst | Other | #import "/lib/lib.typ" as ucpc
#import ucpc: i18n
#let base = i18n.en-us
#let base__make-prob-meta-keys = base.make-prob-meta.keys()
#let base__make-prob-overview-keys = base.make-prob-overview.keys()
#let base__make-problem-keys = base.make-problem.keys()
#let base__problem-keys = base.make-problem.keys()
#assert(base__make-problem-keys == base__problem-keys)
#assert(base__make-prob-meta-keys == base.make-problem.make-prob-meta.keys())
#for (locale, content) in (i18n.supports) {
let message = "The content of locale " + locale + " is incomplete."
assert(
base__make-prob-meta-keys == content.make-prob-meta.keys(),
message: message,
)
assert(
base__make-prob-overview-keys == content.make-prob-overview.keys(),
message: message,
)
assert(
base__make-problem-keys == content.make-problem.keys(),
message: message
)
assert(
base__problem-keys == content.problem.keys(),
message: message
)
assert(
base__make-prob-meta-keys == content.make-problem.make-prob-meta.keys(),
message: message
)
}
|
https://github.com/SkiFire13/eh-presentation-shellcode | https://raw.githubusercontent.com/SkiFire13/eh-presentation-shellcode/master/unipd.typ | typst | #import "@preview/polylux:0.3.1": logic, utils
#let unipd-palette = (
main: rgb(155, 0, 20),
gray: rgb(72, 79, 89),
light-gray: rgb(237, 237, 238),
header-logo: "logo_text_white.png",
title-background: "bg.svg",
background-logo: "logo_text.png",
footer-wave: "bg_wave.svg",
)
#let palette-state = state("unipd-theme-palette", unipd-palette)
#let with-palette = f => locate(loc => f(palette-state.at(loc)))
#let title-background = with-palette(palette => {
place(image(palette.title-background, width: 100%, fit: "stretch"))
place(
bottom + right, dx: -5%, dy: -5%,
image(palette.background-logo, height: 18%)
)
})
#let unipd-theme(aspect-ratio: "4-3", palette: unipd-palette, body) = {
set page(margin: 0pt)
set page(paper: "presentation-" + aspect-ratio) if aspect-ratio != "16-9-extended"
set page(width: 1058.27pt, height: 595.28pt) if aspect-ratio == "16-9-extended"
set text(font: "New Computer Modern Sans", size: 24pt)
show heading.where(level: 2): set text(fill: palette.main)
show heading.where(level: 2): it => it + v(1em)
set list(marker: text("•", fill: palette.main.darken(20%)))
palette-state.update(palette)
body
}
#let title-slide(
title: none,
subtitle: none,
authors: none,
date: none,
) = logic.polylux-slide({
// Background
title-background
// Normalize data
if type(subtitle) == none {
subtitle = ""
}
if type(authors) != array {
authors = (authors,)
}
if type(date) == none {
date = ""
}
// Title, subtitle, author and date
v(20%)
align(
center,
box(inset: (x: 2em), text(size: 46pt, fill: white, title))
)
align(
center,
box(inset: (x: 2em), text(size: 30pt, fill: white, subtitle))
)
v(5%)
// TODO: Max 2 columns, last in a single column
block(width: 100%, inset: (x: 2em), grid(
rows: (auto,),
columns: (1fr,) * authors.len(),
column-gutter: 2em,
..authors.map(author => align(center, text(size: 24pt, fill: white, author)))
))
place(bottom, dx: 7.5%, dy: -30%, text(size: 24pt, fill: white, date))
})
#let header = with-palette(palette => {
place(rect(width: 100%, height: 12%, fill: palette.main))
place(right, dx: -2%, dy: 1%, image(palette.header-logo, height: 10%))
// Section name in header
place(dx: 2%, dy: 4.5%, text(size: 34pt, fill: white, utils.current-section))
})
#let footer = with-palette(palette => {
place(bottom, image(palette.footer-wave, width: 100%))
// Slide number in the footer
place(
bottom + right, dx: -2.5%, dy: -2.5%,
text(
size: 18pt,
fill: palette.main.lighten(50%),
logic.logical-slide.display("1 of 1", both: true)
)
)
})
#let slide(title: none, body) = logic.polylux-slide({
header
v(15%) // Space for header
footer
if title != none {
v(7%)
let title-text = with-palette(palette => text(palette.main, title))
block(
width: 100%, inset: (x: 4.5%, y: -.5em), breakable: false,
outset: 0em,
heading(level: 1, title-text)
)
v(.7em)
}
v(1fr)
block(width: 100%, inset: (x: 2em), body)
v(2fr)
})
#let new-section(title) = utils.register-section(title)
#let new-section-slide(title) = logic.polylux-slide({
header
footer
new-section(title)
set align(center + horizon)
let titletext = with-palette(palette => text(palette.main, title))
heading(level: 2, titletext)
})
#let filled-slide(content) = logic.polylux-slide(with-palette(palette => {
set text(size: 44pt, fill: white)
show: it => box(width: 100%, height: 100%, fill: palette.main, it)
show: it => align(center + horizon, it)
content
}))
/*
let default(slide-info, bodies) = {
// Header
place(rect(width: 100%, height: 12%, fill: unipd-red))
place(right, dx: -2%, dy: 1%, image("logo_text_white.png", height: 10%))
// Section name in header
place(dx: 2%, dy: 4.5%, text(size: 34pt, fill: white, section.display()))
// Skip header
v(15%)
// Footer
place(bottom, image("bg_wave.svg", width: 100%))
// Slide number in the footer
place(
bottom + right, dx: -2.5%, dy: -2.5%,
text(size: 18pt, fill: unipd-red.lighten(50%), logical-slide.display("1 of 1", both: true))
)
if bodies.len() == 0 {
if "title" in slide-info {
v(-7%)
align(
center + horizon,
heading(level: 1, text(unipd-red)[#slide-info.title])
)
}
return
}
if "title" in slide-info {
v(7%)
block(
width: 100%, inset: (x: 4.5%, y: -.5em), breakable: false,
outset: 0em,
heading(level: 1, text(unipd-red)[#slide-info.title])
)
v(.7em)
}
block(width: 100%, inset: (x: 2em), grid(
columns: (1fr,) * bodies.len(),
column-gutter: 2em,
..bodies.map(body => v(1fr) + body + v(2fr))
))
}
let wake-up(slide-info, bodies) = {
if bodies.len() != 1 {
panic("unipd theme only supports one body per slide")
}
// Background
place(block(
width: 100%, height: 100%, fill: unipd-red, breakable: false,
outset: 0pt, inset: 0pt,
))
align(center + horizon, text(size: 1.5em, fill: white, bodies.first()))
}
(
"default": default,
"title slide": title-slide,
"title": title-slide,
"wake up": wake-up,
"full": wake-up,
"end": wake-up,
)
}
#let (normal-block, alert-block, example-block) = {
let make_block_fn(header-color) = (title, body) => {
align(center, box(width: 85%, stack(dir: ttb,
box(
width: 100%, inset: 0.5em, outset: 0em,
fill: header-color, stroke: black,
align(left, heading(level: 2, text(fill: white)[#title]))
),
box(
width: 100%, inset: 1em, outset: 0em, fill: unipd-light-gray,
stroke: black,
align(left, body)
)
)))
}
(
make_block_fn(unipd-gray),
make_block_fn(unipd-red),
make_block_fn(rgb(0, 128, 0)),
)
}
*/ |
|
https://github.com/liuguangxi/suiji | https://raw.githubusercontent.com/liuguangxi/suiji/main/src/taus.typ | typst | MIT License | //==============================================================================
// Maximally equidistributed combined Tausworthe generator
//
// The period of this generator is about 2^88.
// Part of algorithm implementations reference to
// GSL (https://www.gnu.org/software/gsl)
//==============================================================================
// Tausworthe operator
#let _tausworthe(s, a, b, c, d) = {
let s1 = s.bit-and(c).bit-lshift(d).bit-and(0xFFFFFFFF)
let s2 = s.bit-lshift(a).bit-and(0xFFFFFFFF).bit-xor(s).bit-rshift(b)
return s1.bit-xor(s2)
}
// Get a new random integer from [0, 2^32) by update state
#let taus-get(st) = {
let s1 = _tausworthe(st.at(0), 13, 19, 4294967294, 12)
let s2 = _tausworthe(st.at(1), 2, 25, 4294967288, 4)
let s3 = _tausworthe(st.at(2), 3, 11, 4294967280, 17)
let val = s1.bit-xor(s2).bit-xor(s3)
return ((s1, s2, s3), val)
}
// Get a new random float from [0, 1) by update state
#let taus-get-float(st) = {
let (st, val) = taus-get(st)
return (st, val / 4294967296.0)
}
// Construct a new random number generator with a seed
#let taus-set(seed) = {
let s = seed.bit-and(0xFFFFFFFF)
if s == 0 {s = 1}
let s1 = (69069 * s).bit-and(0xFFFFFFFF)
if (s1 < 2) {s1 += 2}
let s2 = (69069 * s1).bit-and(0xFFFFFFFF)
if (s2 < 8) {s2 += 8}
let s3 = (69069 * s2).bit-and(0xFFFFFFFF)
if (s3 < 16) {s3 += 16}
let st = (s1, s2, s3)
// Warm it up
(st, _) = taus-get(st)
(st, _) = taus-get(st)
(st, _) = taus-get(st)
(st, _) = taus-get(st)
(st, _) = taus-get(st)
(st, _) = taus-get(st)
return st
}
|
https://github.com/AliothCancer/AppuntiUniversity | https://raw.githubusercontent.com/AliothCancer/AppuntiUniversity/main/capitoli_applicazioni/biocompatibilità.typ | typst | = Biocompatibilità
== Costante di affinità K
$
K = ["PS"] / ([P][S])
$
- \[PS\] $"ng"/"cm"^2$: Densità dei siti di legame occupati.
- \[P\] $"ng"/"ml"$: Concentrazione della soluzione contente la biomolecola che aderisce al biomateriale
|
|
https://github.com/ShapeLayer/ucpc-solutions__typst | https://raw.githubusercontent.com/ShapeLayer/ucpc-solutions__typst/main/lib/utils/problem.typ | typst | Other | #import "/lib/i18n.typ": en-us
#import "/lib/colors.typ": color
#import "/lib/utils/make-problem.typ": make-problem
#let problem = make-problem
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-16AD0.typ | typst | Apache License 2.0 | #let data = (
("BASSA VAH LETTER ENNI", "Lo", 0),
("BASSA VAH LETTER KA", "Lo", 0),
("BASSA VAH LETTER SE", "Lo", 0),
("BASSA VAH LETTER FA", "Lo", 0),
("BASSA VAH LETTER MBE", "Lo", 0),
("BASSA VAH LETTER YIE", "Lo", 0),
("BASSA VAH LETTER GAH", "Lo", 0),
("BASSA VAH LETTER DHII", "Lo", 0),
("BASSA VAH LETTER KPAH", "Lo", 0),
("BASSA VAH LETTER JO", "Lo", 0),
("BASSA VAH LETTER HWAH", "Lo", 0),
("BASSA VAH LETTER WA", "Lo", 0),
("BASSA VAH LETTER ZO", "Lo", 0),
("BASSA VAH LETTER GBU", "Lo", 0),
("BASSA VAH LETTER DO", "Lo", 0),
("BASSA VAH LETTER CE", "Lo", 0),
("BASSA VAH LETTER UWU", "Lo", 0),
("BASSA VAH LETTER TO", "Lo", 0),
("BASSA VAH LETTER BA", "Lo", 0),
("BASSA VAH LETTER VU", "Lo", 0),
("BASSA VAH LETTER YEIN", "Lo", 0),
("BASSA VAH LETTER PA", "Lo", 0),
("BASSA VAH LETTER WADDA", "Lo", 0),
("BASSA VAH LETTER A", "Lo", 0),
("BASSA VAH LETTER O", "Lo", 0),
("BASSA VAH LETTER OO", "Lo", 0),
("BASSA VAH LETTER U", "Lo", 0),
("BASSA VAH LETTER EE", "Lo", 0),
("BASSA VAH LETTER E", "Lo", 0),
("BASSA VAH LETTER I", "Lo", 0),
(),
(),
("BASSA VAH COMBINING HIGH TONE", "Mn", 1),
("BASSA VAH COMBINING LOW TONE", "Mn", 1),
("BASSA VAH COMBINING MID TONE", "Mn", 1),
("BASSA VAH COMBINING LOW-MID TONE", "Mn", 1),
("BASSA VAH COMBINING HIGH-LOW TONE", "Mn", 1),
("BASSA VAH FULL STOP", "Po", 0),
)
|
https://github.com/Slyde-R/not-jku-thesis-template | https://raw.githubusercontent.com/Slyde-R/not-jku-thesis-template/main/template/content/Analysis.typ | typst | MIT No Attribution | #import "../utils.typ": todo, silentheading, flex-caption
= Analysis
#todo[Replace this chapter!]
== Introduction
The analysis aims to identify patterns and relationships within the data, offering insights into how cats use specific behaviors to influence their human companions and the subsequent effects on human routines and emotions.
== Analysis of Observational Data
=== Behavioral Patterns
==== Vocalizations
The observational data revealed distinct patterns in feline vocalizations used for manipulation:
- *Meowing:* Cats primarily used meowing to solicit food or attention. High-pitched and frequent meows were associated with feeding times, and variations in pitch were observed to correspond with different types of requests.
- *Purring:* Cats employed purring as a multifaceted strategy to seek comfort or attention. Instances of purring were often accompanied by other behaviors, such as rubbing or kneading, reinforcing its role in manipulation.
- *Chirps and Trills:* These vocalizations were less frequent but used effectively to prompt interaction or play, especially when the cat was engaged with a toy or seeking active play.
==== Body Language
Key body language strategies observed included:
- *Kneading:* Cats used kneading predominantly to solicit attention and comfort. This behavior was frequently observed on human laps or soft surfaces, and was often followed by increased physical interaction from humans.
- *Tail Positioning:* The tail's position served as an indicator of the cat's intent and emotional state. Raised tails were associated with positive interactions, while low or flicking tails often preceded withdrawal or irritation.
- *Eye Contact:* Slow blinking and direct eye contact were employed to establish trust and encourage affection. Cats that used these behaviors more frequently were often rewarded with petting or close contact from their humans.
==== Attention-Seeking Behaviors
Common attention-seeking behaviors included:
- *Climbing and Jumping:* Cats used climbing and jumping to place themselves physically in the human's space, often leading to increased interaction or feeding.
- *Rubbing and Head-Butting:* These behaviors were consistently used to solicit affection or attention. Cats that engaged in these actions more frequently were noted to receive more positive responses from their owners.
- *Bringing Objects:* Cats that brought toys to their humans effectively initiated play sessions, demonstrating the use of object-oriented behaviors to engage their caregivers.
== Analysis of Survey Data
=== Frequency and Effectiveness
==== Frequency of Behaviors
Survey responses indicated that vocalizations, particularly meowing, were the most commonly observed manipulation tactic. Purring and attention-seeking behaviors such as climbing and rubbing were also reported frequently, with variations based on the cat's individual personality and the household environment.
==== Perceived Effectiveness
Participants rated meowing and purring as the most effective behaviors for soliciting attention and food. Attention-seeking actions like climbing and object bringing were perceived as effective in prompting immediate interaction or play. The effectiveness of these behaviors was found to correlate with the frequency of their occurrence and the specific context in which they were used.
== Analysis of Interview Data
=== Thematic Insights
==== Instances of Manipulation
Interviews revealed detailed accounts of how cats used specific behaviors to achieve desired outcomes. Common examples included cats meowing persistently before feeding time and using purring to calm their humans during stressful moments.
==== Emotional Reactions
Participants described a range of emotional responses to their cats' manipulation tactics, from amusement and affection to occasional frustration. The manipulation tactics often led to increased bonding and interaction, though some participants reported feeling manipulated or pressured by their cats' behaviors.
==== Behavioral Changes
The interviews highlighted changes in human behavior in response to feline manipulation. Many participants adjusted their routines to accommodate their cats' needs, such as altering feeding schedules or engaging in more playtime. These changes were generally perceived as positive, contributing to a stronger bond between the cat and its owner.
6.5 Synthesis of Findings
The analysis of observational, survey, and interview data collectively demonstrates that cats employ a variety of manipulation tactics to influence their human companions. Vocalizations, body language, and attention-seeking behaviors are used strategically to achieve specific outcomes. The effectiveness of these tactics varies based on the context and the individual cat's behavior. Human responses to these manipulative behaviors are generally positive, though they can occasionally lead to feelings of frustration or manipulation. |
https://github.com/taiga4112/jasnaoe_template_typst | https://raw.githubusercontent.com/taiga4112/jasnaoe_template_typst/main/libs/jasnaoe-conf/jasnaoe-conf_lib.typ | typst | // Workaround for the lack of an `std` scope.
#let std-bibliography = bibliography
#let mincho = ("Times New Roman", "MS Mincho", "IPAMincho", "Noto Serif CJK JP", "Hiragino Mincho Pro")
#let gothic = ("Times New Roman", "MS Gothic", "IPAGothic", "Noto Sans CJK JP", "Hiragino Kaku Gothic Pro")
#let jasnaoe-conf(
title: none,
authors: none,
abstract: none,
bibliography: none,
body
) = {
// Configure the page.
set page(
paper: "a4",
columns: 2,
margin: (top: 25mm, bottom: 22mm, x: 17mm)
)
set text(
size: 9pt,
font: mincho,
)
set par(leading: 1.00em, first-line-indent: 1.00em, justify: true)
// Configure equation numbering and spacing.
set math.equation(numbering: numbering.with("(1)"), supplement: [式])
show math.equation: set block(above: 18pt, below: 18pt)
// Configure lists.
set enum(indent: 9pt, body-indent: 9pt)
set list(indent: 9pt, body-indent: 9pt)
// Configure headings.
set heading(numbering: "1.")
show heading: it => context{
// Find out the final number of the heading counter.
let levels = counter(heading).at(here())
let deepest = if levels != () {
levels.last()
} else {
1
}
if it.level == 1 [
// First-level headings are centered smallcaps.
// We don't want to number of the acknowledgment section.
#v(9pt)
#set par(first-line-indent: 0pt)
#let is-ack = it.body in ([謝辞], [謝 辞], [謝 辞], [Acknowledgement])
#set align(center)
#set text(size: 10pt, font: gothic, weight: "bold")
// #v(9pt, weak: true)
#if it.numbering != none and not is-ack {
numbering("1.", ..levels)
h(8pt, weak: true)
}
#it.body
#v(9pt)
] else [
// The other level headings are run-ins.
#v(9pt)
#set par(first-line-indent: 0pt)
#set text(size: 9pt, font: gothic, weight: "bold")
#if it.numbering != none {
numbering("1.", ..levels)
h(8pt, weak: true)
}
#it.body
]
}
show figure.where(kind: table): set figure(placement: top, supplement: [Table ])
show figure.where(kind: table): set figure.caption(position: top, separator: [ ])
show figure.where(kind: image): set figure(placement: top, supplement: [Fig.])
show figure.where(kind: image): set figure.caption(position: bottom, separator: [ ])
// Display the paper's contents.
body
}
|
|
https://github.com/CK1201/Chengkai_CV | https://raw.githubusercontent.com/CK1201/Chengkai_CV/main/resume.typ | typst | MIT License | #import "chicv.typ": *
#show: chicv
= <NAME>
#fa[#envelope] #link("mailto:<EMAIL>")[<EMAIL>] |
#fa[#github] #link("https://github.com/ck1201")[github.com/ck1201] |
#fa[#user] #link("https://chengkaiwu.me")[chengkaiwu.me] |
// #fa[#calendar] 1 December 1999 |
// #fa[#globe] China
// #fa[#google] #link("https://scholar.google.com/citations?user=7gsdLw4AAAAJ&hl=en")[Google Scholar] |
// #fa[#linkedin] #link("https://www.linkedin.com/in/congrui-yin-a21314292/")[<NAME>]
== Education
#cventry(
tl: "Harbin Institute of Technology, Shenzhen",
tr: "2022/09 -- 2025/01 (Expected)",
bl: "M.Eng in Control Engineering",
br: "Shenzhen, China"
)[
// - School First-Class Academic Scholarship, 2023.
]
#cventry(
tl: "Xidian University",
tr: "2018/09 -- 2022/06",
bl: "B.Eng in Electronic Information Engineering",
br: "Xi'an, China"
)[
- GPA: 3.8/4.0, Rank: 1%
// - First-Class 2781 Senior Scholarship, 2020. *(1%)*
]
// == Research Interests
// I am broadly interested in the motion planning for mobile robots. My previous work involved developing *efficient real-time whole-body motion planning for mobile manipulators.*
== Publications
- Real-time Whole-body Motion Planning for Mobile Manipulators Using Environment-adaptive Search and Spatial-temporal Optimization. *<NAME>*$\ ^*$, <NAME>$\ ^*$, <NAME>, <NAME>, <NAME>, Boyu Zhou$\ ^dagger$. _2024 IEEE International Conference on Robotics and Automation_ (*ICRA 2024*).
// #link("https://ieeexplore.ieee.org/abstract/document/10095864")[[Paper]]
- Interaction-Aware Autonomous Exploration with an Eye-in-hand Mobile Manipulator. <NAME>, *<NAME>*, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, Boyu Zhou$\ ^dagger$. (In submission).
// #link("https://ieeexplore.ieee.org/abstract/document/10095864")[[Paper under review]]
== Research Experience
#cventry(
tl: "Smart Autonomous Robotics Group - Sun Yat-sen University",
tr: "2022/12 -- Present",
bl: "Visiting Student, advised by Prof. <NAME>",
br: "Zhuhai, China"
)[
- Designed an environment-adaptive path searching method for mobile manipulators, achieving a higher quality path with reduced computation time compared to _RRT$\ ^*$-Connect_.
- Developed a spatial-temporal optimization method to generate smooth, agile, safe, and dynamically feasible trajectories for mobile manipulators, outperforming CHOMP by a factor of approximately 10 in computation time efficiency.
- Established a physical platform for mobile manipulators, achieving real-time whole-body trajectory planning within 500ms in indoor scenes containing various obstacles using onboard computer.
- Designed a novel representation, called hidden frontier, along with a viewpoint sampling method that together provide suitable perspectives for complete detection of interactable objects, resulting in higher coverage rate.
- Proposed a method named Constrained Whole-body Configuration Database, accelerating the acquisition of feasible configurations by about 20 times compared to baseline method given a desired viewpoint.
- Published one paper to ICRA 2024 and submitted one paper to IROS 2024.
]
#cventry(
tl: "DJI RoboMaster University AI Challenge Competition - Team MAS",
tr: "2022/09 -- 2022/11",
bl: "Team Leader, advised by Prof. <NAME>",
br: "Shenzhen, China"
)[
// - Responsible for team management, supervising project progress, and allocating resources to ensure timely completion of competition tasks.
- Developed code for drone trajectory planning and SE(3) controller to enable the drone to cross target circles at average speeds exceeding 8m/s in simulation.
- Designed and built a physical platform for drones, deployed algorithms, and successfully crossed ten circles within 39 seconds in real-world completion.
// - Win the *national second prize*.
]
#cventry(
tl: "Field Autonomous System & Computing Lab - Zhejiang University",
tr: "2021/07 -- 2021/09",
bl: "Research Assistant, advised by Prof. <NAME>",
br: "Huzhou, China"
)[
- Developed algorithms for drone decision-making and path planning, and deployed code onto a physical drone platform.
- Designed a user interface for drone operation using ROS Qt.
]
// == Open-Source Projects
// #cventry(
// tl: iconlink("https://github.com/SYSU-STAR", text: "Smart Autonomous Robotics Group", icon: github),
// tr: "2023/01 - Present"
// )[
// - *Contributor of *#iconlink(icon: github, text: "REMANI-Planner", "https://github.com/SYSU-STAR/REMANI-Planner")* (#fa[#star]17)*. A motion planning method capable of generating high-quality, safe, agile and feasible trajectories for mobile manipulators in real time.
// ]
// #cventry(
// tl: "Personal Projects",
// tr: "65 followers " + iconlink(text: "ck1201", icon: github, "https://github.com/ck1201")
// )[
// - *#iconlink(icon: github, text: "REMANI-Planner", "https://github.com/SYSU-STAR/REMANI-Planner")* (#fa[#star]17) A motion planning method capable of generating high-quality, safe, agile and feasible trajectories for mobile manipulators in real time.
// ]
== Honors and Awards
// I was the leader of Nanchang University Student Cluster Competition Team (#link("https://hpc.ncuscc.tech/")[*Team NCUSCC*]), participating in world's largest supercomputer competition *ASC22* and *SC23.*
*National Second Prize* - RoboMaster 2022-2023 University AI Challenge Competition #h(1fr) Nov. 2022 \
*Provincial First Prize* - Contemporary Undergraduate Mathematical Contest in Modeling #h(1fr) Dec. 2020 \
*First-class Scholarship* #h(1fr) Oct. 2023 \
*First-Class Senior Scholarship* #h(1fr) Dec. 2020 \
// *First-class Scholarship* #h(1fr) Sep. 2020 \
== Technical Skills
- *Programming Languages:* C/C++(ROS), Python, MATLAB
- *Tools:* Gazebo, Isaac Sim, Unity, Git, LaTeX, LBFGS, ACADOS
// - *AI:*
// Natural language Processing (llama-2, ChatGLM-3, CPM-Bee) |
// MLSys (Flash attention & ZeRO Series) |
// Computer Vision (YOLO Series, OpenCV, Simple Ray Tracing) |
// Multimodal Pretrained Model (BLIP-2, LLAVA)
// #align(right, text(fill: gray)[Last Updated on #today()])
|
https://github.com/kristoferssolo/Mafia-the-Game-Description | https://raw.githubusercontent.com/kristoferssolo/Mafia-the-Game-Description/main/layout.typ | typst | #import "@preview/i-figured:0.1.0"
#import "@preview/big-todo:0.2.0": *
#import "@preview/tablex:0.0.6": tablex
#let indent = 1cm
#let indent-par(
body,
) = par(h(indent) + body)
#let project(
university: "",
faculty: "",
title: [],
authors: (),
advisor: "",
date: "",
body,
) = {
set document(author: authors)
set page(
margin: (
left: 30mm,
right: 20mm,
top: 20mm,
bottom: 20mm,
),
number-align: center,
paper: "a4",
)
set text(
//font: "New Computer Modern",
font: "CMU", size: 12pt, hyphenate: auto, lang: "lv", region: "LV",
)
show raw: set text(font: "New Computer Modern Mono")
show math.equation: set text(weight: 400)
// Formatting for regular text
set par(
justify: true,
leading: 1.5em,
first-line-indent: indent,
)
show par: set block(spacing: 1.5em) // Set 1.5em gap between paragraphs
show heading: set block(spacing: 1.5em)
set terms(separator: [ -- ])
// Headings
set heading(numbering: "1.1.")
show heading: it => {
if it.level == 1 {
// pagebreak(weak: true)
text(
14pt,
align(
center,
upper(it),
),
)
} else {
it
}
}
/* Title page config start */
align(
center,
upper(
text(
size: 16pt,
[
#university\
#faculty
],
),
),
)
v(1fr)
align(
center,
text(
20pt,
weight: "bold",
title,
),
)
v(1fr)
// Author information
align(
right,
[
#if authors.len() > 1 {
text(
weight: "bold",
"Darba autori:",
)
} else {
text(
weight: "bold",
"Darba autors:",
)
}\
#authors.join("\n")
#v(2em)
#if advisor != "" {
text(
weight: "bold",
"Darba vadītājs:\n",
)
advisor
}
],
)
v(0.5fr)
align(
center,
upper(
text(date),
),
)
/* Title page config end */
// WARNING: removove before sending
// todo_outline
/* --- Figure/Table conf start --- */
show heading: i-figured.reset-counters
show figure: i-figured.show-figure.with(numbering: "1.1.")
show figure.where(kind: "i-figured-table"): set block(breakable: true)
show figure.where(kind: "i-figured-table"): set figure.caption(position: top)
show figure: set par(justify: false) // disable justify for figures (tables)
show figure.caption: it => {
if it.kind == "i-figured-table" {
align(
end,
emph(it.counter.display(it.numbering) + " tabula ") + text(
weight: "bold",
it.body,
),
)
} else if it.kind == "i-figured-image" {
align(
start,
emph(it.counter.display(it.numbering) + " att. ") + text(
weight: "bold",
it.body,
),
)
} else {
it
}
}
set ref(supplement: it => { }) // disable default reference suppliments
/* --- Figure/Table conf end --- */
set list(marker: (
[•],
[--],
[\*],
[·],
))
set enum(numbering: "1aiA)") // TODO: make the same style as LaTeX: 1. | (a) | i. | A.
// Abstract
include "abstract.typ"
/* ToC config start */
// Uppercase 1st level headings in ToC
show outline.entry.where(level: 1): it => {
upper(it)
}
pagebreak()
outline(
depth: 3,
indent: 1cm,
title: text(
size: 14pt,
"SATURS",
),
)
/* ToC config end */
// Start page numering
set page(
numbering: "1",
number-align: center,
)
// Main bdy.
body
}
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.