repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/Joelius300/hslu-typst-template | https://raw.githubusercontent.com/Joelius300/hslu-typst-template/main/chapters/05_realization.typ | typst | MIT License | = Realisierung
Dies ist das Hauptkapitel Ihrer Arbeit! Hier wird die Umsetzung der eigenen Ideen und Konzepte (Kapitel 3) anhand der gewählten Methoden (Kapitel 4) beschrieben, inkl. der dabei aufgetretenen Schwierigkeiten und Einschränkungen.
#pagebreak() |
https://github.com/ludwig-austermann/typst-din-5008-letter | https://raw.githubusercontent.com/ludwig-austermann/typst-din-5008-letter/main/examples/example_letter.typ | typst | MIT License | #import "../letter.typ" : letter, letter-styling, debug-options, block-hooks
#let styling-options = letter-styling(
form: "A", // can also be form 'B'
folding-mark: true,
hole-mark: true,
page-margin-right: 2cm,
background: rotate(60deg, text(60pt, red.lighten(70%), font: "Fira Code")[EXAMPLE LETTER]),
text-params: (size: 11pt, font: "linux libertine")
)
#let debug-options = debug-options(
show-block-frames: true,
show-address-field-calculation: true,
)
#let hooks = block-hooks(
letter-head: pad(10mm)[A to DIN 5008 kinda conforming #link("https://typst.app")[Typst] extensable letter template to find at
#align(center, link("https://github.com/ludwig-austermann/typst-din-5008-letter")[GitHub -- ludwig-austermann -- typst-din-5008-letter])],
footer: [And more text in the footer\ and again more],
)
#show: letter.with(
title: [Subject of letter],
return-information: [@name, Feldweg 20, 32123 Einöde],
address-zone: [Frau\ Klara Musterfrau\ Wunderstr. 12A\ 12321 Berlin],
information-field: grid(columns: 2, column-gutter: 5mm, row-gutter: 6pt)[Sender:][@name][Telefon no.:][@telnr][][][Letter no.:][A2-335-F12][Contract no.:][137 288][][][Date:][@date],
reference-signs: (
([Letter no.], [A2-335-F12]),
([Contract no.], [137 288]),
([Date], [@date])
),
attachments: ([Something], [Another Thing]),
ps: [Try it out...],
signature: pad(rotate(image("Farah_Pahlavi_signature.svg", width: 2cm), -5deg), x: 5pt, bottom: -12pt, top: -4pt),
name: "<NAME>",
styling-options: styling-options,
debug-options: debug-options,
block-hooks: hooks,
labels: (telnr: [+49 123 4567 89])
)
#set par(justify: true)
#let headlorem(i) = {
let l = lorem(i)
l.slice(0, l.len() - 1)
}
#for i in (3, 12, 3, 12, 15, 35, 1) {
if calc.even(i) { heading(headlorem(calc.quo(i, 2))) }
else if calc.rem(i, 5) == 0 { heading(headlorem(calc.quo(i, 5)), level: 2) }
lorem(10 * i)
footnote(lorem(i))
parbreak()
}
|
https://github.com/MordragT/bib_kit | https://raw.githubusercontent.com/MordragT/bib_kit/master/README.md | markdown | MIT License | <div align=center>
# Bib Kit - Hayagriva Extension for Firefox 📚
This extension allows retrieving website information to create
citations in the `hayagriva` format.
</div>
## Warning
This extension is highly experimental. Bugs are expected.
If you encounter any feel free to create issues.
I do not recommend using the extension at this state.
If you are curious however what is working so far you can install
the extension [here](https://addons.mozilla.org/en-US/firefox/addon/bib-kit/)
## Screenshot

## Roadmap
- [ ] create more data extractors (e.g. dublin-core)
- [ ] better error handling (expose errors better to javascript)
- [ ] better data validation
## Building
#### With Nix
When you have the nix package manager installed you can just go into the root directory of this project and follow these instructions:
1. Run `nix develop` to create a shell with all necessary programs and dependencies
2. Go into the `html-meta` directory and run `just build`
3. Go back to the main directory and run `just build`
4. The extension should be built inside the `build` directory
#### Other Platforms
Install the following packages on your system:
- `just`: Task runner similar to make
- `wasm-pack`: Used to create the wasm bindings
- `web-ext`: Used to build the extension
- `cargo`: Rust's package manager and build tool
Make sure your Rust installation is able to target `wasm32-unknown-unknown`
1. Go into the `html-meta` directory and run `just build`
2. Go back to the main directory and run `just build`
3. The extension should be built inside the `build` directory
## License
The icon made by Iconsax and all the source code is published under the MIT license.
## References
- [Hayagriva](https://github.com/typst/hayagriva) - the citation format
- [Typst](https://github.com/typst/typst) - a new markup-based typesetting format
## Acknowledgements
- [Icon](https://www.svgrepo.com/svg/495072/book-square) - made by Iconsax |
https://github.com/titaneric/typst-mixed-resume | https://raw.githubusercontent.com/titaneric/typst-mixed-resume/main/resume.typ | typst | MIT License |
#import "template.typ": *
#set page(
margin: (
left: 10mm,
right: 10mm,
top: 15mm,
bottom: 15mm
),
)
#set text(font: "Mulish")
#show: project.with(
theme: rgb(73%, 1%, 0%, 4%),
first_name: "Alison",
last_name: "Turner",
title: "Site Reliability Engineer",
contact: (
contact(
text: "(+886)xxxxxx",
type: "phone",
),
contact(
text: "alison-turner",
link: "https://www.linkedin.com/in/alison-turner/",
type: "linkedin",
),
contact(
text: "alison-turner",
link: "https://www.github.com/alison-turner",
type: "github",
),
contact(
text: "www.alison-turner.com",
link: "https://www.alison-turner.com",
type: "website",
),
contact(
text: "<EMAIL>",
link: "mailto:<EMAIL>",
type: "email",
),
),
main: (
section(
content: lorem(30)
),
section(
title: "Work Experience",
content: (
subSection(
title: "Site Reliability Engineer",
titleEnd: "Engineering Dept., " + lorem(3),
subTitle: "May 2021 – Present",
subTitleEnd: "New York, US",
content: list(
[#lorem(15)],
[#lorem(17)],
[#lorem(19)],
),
),
subSection(
title: "Senior Engineer",
titleEnd: "XXX Division, " + lorem(2),
subTitle: "May 2020 – May 2021",
subTitleEnd: "Toyko, Japen",
content: list(
[#lorem(15)],
[#lorem(17)],
[#lorem(19)],
),
),
),
),
section(
title: "Projects",
content: (
subSection(
title: "Personal project I",
titleEnd: "",
subTitle: "",
subTitleEnd: "",
content: list(
[#lorem(15)],
[#lorem(17)],
[#lorem(19)],
),
),
subSection(
title: "Personal project II",
titleEnd: "",
subTitle: "",
subTitleEnd: "",
content: list(
[#lorem(15)],
[#lorem(17)],
[#lorem(19)],
),
),
),
),
),
sidebar: (
section(
title: "Skills",
content: (
subSection(
title: "Programing",
content: (
"Rust",
"Typst",
).join(" • "),
),
subSection(
title: "Technologies",
content: (
"Kubernetes",
"Docker",
).join(" • "),
),
subSection(
title: "Language",
content: (
"Chinese",
"English",
"Japanese",
).join(" • "),
),
),
),
section(
title: "Education",
content: (
subSection(
title: "MEng",
titleEnd: "Computer Science",
subTitle: "2018 – 2020",
subTitleEnd: "Stanford Univ.",
),
subSection(
title: "BSc",
titleEnd: "Computer Science",
subTitle: "2014 – 2018",
subTitleEnd: "National Taiwan Univ.",
),
),
),
section(
title: "Awards",
content: (
subSection(
content: list(
"Certified Kubernetes Administrator",
),
),
),
),
section(
title: "Contributions",
content: (
subSection(
title: "Typst maintainer",
subTitleEnd: underline(link("https://github.com/typst/typst", "typst")),
),
subSection(
title: "Bug reporting and fix",
subTitleEnd: underline(link("https://github.com/microsoft/vscode-python/issues", "vscode-python")),
),
),
),
section(
title: "Articles",
content: (
subSection(
content: list(
underline(lorem(10)),
underline(lorem(9)),
underline(lorem(8)),
),
),
),
),
),
)
|
https://github.com/loqusion/typix | https://raw.githubusercontent.com/loqusion/typix/main/docs/api/derivations/common/typst-project-output.md | markdown | MIT License | <!-- markdownlint-disable-file first-line-h1 -->
<!-- ANCHOR: head -->
Destination path for Typst output.
<!-- ANCHOR_END: head -->
<!-- ANCHOR: buildtypstprojectlocal -->
<!-- markdownlint-disable link-fragments -->
If omitted, it will be inferred from
[`typstSource`](#typstsource) — for example,
`page.typ` will become `page.pdf` for PDF output.
<!-- markdownlint-restore -->
<!-- ANCHOR_END: buildtypstprojectlocal -->
<!-- ANCHOR: watchtypstproject -->
<!-- markdownlint-disable link-fragments -->
If omitted, it will be inferred from
[`typstSource`](#typstsource) — for example,
`page.typ` will become `page.pdf` for PDF output.
<!-- markdownlint-restore -->
<!-- ANCHOR_END: watchtypstproject -->
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Philosophie_Argument.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: "Philosophie Argument",
authors: (
"<NAME>",
),
date: "30 Octobre, 2023",
)
#set heading(numbering: "1.1.")
== Question: #emph[Y’a-t-il une différence d’intelligence entre les
garçons et les filles]
<question-ya-t-il-une-différence-dintelligence-entre-les-garçons-et-les-filles>
\
#emph[Les différences cognitives entre garçons et filles sont trop
faible pour conclure qu’il y a un avantage chez un sexe ou un autre]. En
effet l’intelligence d’une personne peut-être mesurer par son Quotion
Intellectuel et par ses capacités cognitives dans de multiples domaines.
Or d’après de nombreuses études les différences hormonales, biologiques
et épigénitiques entre garçons et filles sont inférieur aux différences
entre deux individus quelconque sur les tests cognitifs, 5 points de QI
contre 10 en moyenne. Nous savons néanmoins que en moyenne les garçons
et filles excellent sur des compétences cognitives différentes, mais
cela pourrait être du à l’éducation et les milieux socioculturels et ne
permet pas de conclure une différence entre les sexes. Finalement les
études en neurosciences montre des variations morphologiques dans le
cerveau de chaque sexe mais ces effets tout comme ceux des hormones
sexuelles serait modérée et non déterminantes. Donc il n’y a pas de
différences d’intelligence entre les garçons et les filles.
|
|
https://github.com/Mc-Zen/tidy | https://raw.githubusercontent.com/Mc-Zen/tidy/main/src/utilities.typ | typst | MIT License |
// Matches docstring references of the form `@@otherfunc` or `@@otherfunc()`.
#let reference-matcher = regex(`@@([\w\d\-_\)\(]+)`.text)
/// Take a documentation string (for example a function or parameter
/// description) and process docstring cross-references (starting with `@@`),
/// turning them into links.
///
/// - text (str): Source code.
/// - info (dictionary):
#let process-references(text, info) = {
return text.replace(reference-matcher, match => {
let target = match.captures.at(0)
if info.enable-cross-references {
return "#(tidy.show-reference)(label(\"" + info.label-prefix + target + "\"), \"" + target + "\")"
} else {
return target
}
})
}
/// Evaluate a docstring description (i.e., a function or parameter description)
/// while processing cross-references (@@...) and providing the scope to the
/// evaluation context.
///
/// - docstring (str): Docstring to evaluate.
/// - info (dictionary): Object holding information for cross-reference
/// processing and evaluation scope.
#let eval-docstring(docstring, info) = {
let scope = info.scope
let content = process-references(docstring.trim(), info)
eval(content, mode: "markup", scope: scope)
}
#let get-style-functions(style) = {
// Default implementations for some style functions
let show-reference(label, name, style-args) = link(label, raw(name))
import "styles.typ"
let show-example = styles.default.show-example
let show-variable = styles.default.show-variable
let style-functions = style
if type(style) == "module" {
import style: *
style-functions = (
show-outline: show-outline,
show-type: show-type,
show-function: show-function,
show-parameter-list: show-parameter-list,
show-parameter-block: show-parameter-block,
show-reference: show-reference,
show-example: show-example,
show-variable: show-variable,
)
}
return style-functions
} |
https://github.com/Noxsios/cv | https://raw.githubusercontent.com/Noxsios/cv/main/README.md | markdown | MIT License | # cv
Single-page, clean and simple developer CV written with [typst](https://typst.app/), [tailwindcss colors](https://github.com/kaarmu/typst-palettes/blob/main/doc/main.pdf) and published to GitHub Pages.

## Building Locally
1. Clone this repo:
```bash
git clone https://github.com/noxsios/cv.git
```
2. cd into the repo:
```bash
cd cv
```
3. Install [`typst`](https://github.com/typst/typst) (PT Sans font optional):
```bash
brew install typst
```
4. Compile the cv:
```bash
typst compile cv.typ
```
View the `cv.pdf` file in your favorite pdf viewer!
> Checkout the [`typst` docs](https://typst.app/docs/) for help with the `typst` CLI.
## Inspirations
- <https://github.com/BartoszJarocki/cv>
- <https://github.com/sb2nov/resume>
## License
[MIT](https://choosealicense.com/licenses/mit/)
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/132.%20founders.html.typ | typst | founders.html
What We Look for in Founders
Want to start a startup? Get funded by
Y Combinator.
October 2010
(I wrote this for Forbes, who asked me to write something
about the qualities we look for in founders. In print they had to cut
the last item because they didn't have room.)1. DeterminationThis has turned out to be the most important quality in startup
founders. We thought when we started Y Combinator that the most
important quality would be intelligence. That's the myth in the
Valley. And certainly you don't want founders to be stupid. But
as long as you're over a certain threshold of intelligence, what
matters most is determination. You're going to hit a lot of
obstacles. You can't be the sort of person who gets demoralized
easily.<NAME> and <NAME> of WePay
are a good example. They're
doing a finance startup, which means endless negotiations with big,
bureaucratic companies. When you're starting a startup that depends
on deals with big companies to exist, it often feels like they're
trying to ignore you out of existence. But when <NAME> starts
calling you, you may as well do what he asks, because he is not
going away.
2. FlexibilityYou do not however want the sort of determination implied by phrases
like "don't give up on your dreams." The world of startups is so
unpredictable that you need to be able to modify your dreams on the
fly. The best metaphor I've found for the combination of determination
and flexibility you need is a running back.
He's determined to get
downfield, but at any given moment he may need to go sideways or
even backwards to get there.The current record holder for flexibility may be <NAME> of
Greplin. He applied to YC with
some bad ecommerce idea. We told
him we'd fund him if he did something else. He thought for a second,
and said ok. He then went through two more ideas before settling
on Greplin. He'd only been working on it for a couple days when
he presented to investors at Demo Day, but he got a lot of interest.
He always seems to land on his feet.
3. ImaginationIntelligence does matter a lot of course. It seems like the type
that matters most is imagination. It's not so important to be able
to solve predefined problems quickly as to be able to come up with
surprising new ideas. In the startup world, most good ideas
seem
bad initially. If they were obviously good, someone would already
be doing them. So you need the kind of intelligence that produces
ideas with just the right level of craziness.Airbnb is that kind of idea.
In fact, when we funded Airbnb, we
thought it was too crazy. We couldn't believe large numbers of
people would want to stay in other people's places. We funded them
because we liked the founders so much. As soon as we heard they'd
been supporting themselves by selling Obama and McCain branded
breakfast cereal, they were in. And it turned out the idea was on
the right side of crazy after all.
4. NaughtinessThough the most successful founders are usually good people, they
tend to have a piratical gleam in their eye. They're not Goody
Two-Shoes type good. Morally, they care about getting the big
questions right, but not about observing proprieties. That's why
I'd use the word naughty rather than evil. They delight in
breaking
rules, but not rules that matter. This quality may be redundant
though; it may be implied by imagination.Sam <NAME> Loopt
is one of the most successful alumni, so we
asked him what question we could put on the Y Combinator application
that would help us discover more people like him. He said to ask
about a time when they'd hacked something to their advantage—hacked in the sense of beating the system, not breaking into
computers. It has become one of the questions we pay most attention
to when judging applications.
5. FriendshipEmpirically it seems to be hard to start a startup with just
one
founder. Most of the big successes have two or three. And the
relationship between the founders has to be strong. They must
genuinely like one another, and work well together. Startups do
to the relationship between the founders what a dog does to a sock:
if it can be pulled apart, it will be.<NAME> and <NAME> of Justin.tv
are a good example of close
friends who work well together. They've known each other since
second grade. They can practically read one another's minds. I'm
sure they argue, like all founders, but I have never once sensed
any unresolved tension between them.Thanks to <NAME> and <NAME> for reading drafts of this.
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/bugs/raw-color-overwrite_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
#show raw: set text(fill: blue)
`Hello, World!`
```rs
fn main() {
println!("Hello, World!");
}
``` |
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/align-04.typ | typst | Other | // Error: 8-22 cannot add two horizontal alignments
#align(center + right, [A])
|
https://github.com/brainworkup/neurocog | https://raw.githubusercontent.com/brainworkup/neurocog/main/_extensions/neurocog/typst-template.typ | typst | MIT License | #let script-size = 7.97224pt
#let footnote-size = 8.50012pt
#let small-size = 9.24994pt
#let normal-size = 10.00002pt
#let large-size = 11.74988pt
#let neurocog(
title: none,
date: none,
cols: 1,
paper: "a4",
margin: (x: 25mm, y: 30mm),
lang: "en",
region: "US",
font: (),
fontsize: 12pt,
sectionnumbering: none,
toc: false,
doc,
) = {
set page(
paper: paper,
margin: margin,
numbering: "1/1",
columns: cols,
header: locate(
loc => if [#loc.page()] == [1] {
[]
} else {
[
#set text(9pt)
#smallcaps[
*CONFIDENTIAL* \
Patient Name
]
]
}
)
)
set par(justify: true)
set text(lang: lang,
region: region,
font: font,
size: fontsize)
set heading(numbering: sectionnumbering)
// Save heading and body font families in variables.
let body-font = "Alegreya"
let sans-font = "Alegreya Sans"
// Set body font family.
set text(font: body-font, lang: "en", size: 12pt)
show math.equation: set text(weight: 400)
// Set paragraph spacing.
show par: set block(above: 1.2em, below: 1.2em)
// Set heading font.
show heading: set text(font: sans-font)
// Set run-in subheadings, starting at level 4.
show heading: it => {
if it.level > 3 {
parbreak()
text(10pt, style: "italic", weight: "regular", it.body + ".")
} else {
it
}
}
// Configure lists and links.
set enum(indent: 5pt, body-indent: 5pt)
set list(indent: 5pt, body-indent: 5pt)
show link: set text(font: "New Computer Modern Mono")
// Logo
block(
figure(
image("logo.png"),
)
)
// Title row.
align(center)[
#block(text(font: sans-font, weight: 700, 1.75em, title))
#v(2.2em, weak: true)
]
if date != none {
align(center)[#block(inset: 1em)[
#date
]]
}
if toc {
block(above: 0em, below: 2em)[
#outline(
title: auto,
depth: none
);
]
}
if cols == 1 {
doc
} else {
columns(cols, doc)
}
}
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/github-pages/docs/graphs.typ | typst | Apache License 2.0 | #import "/contrib/typst/diagram.typ": node, arr, commutative_diagram
#import "/docs/cookery/templates/page.typ": main-color, background-color, is-light-theme
#import "@preview/cetz:0.1.2"
#let forest = rgb("43a127")
/// utility functions
#let vadd(x,y) = (x.at(0) + y.at(0), x.at(1) + y.at(1))
#let vdiv(x,y) = (x.at(0) / y, x.at(1) / y)
#let vneg(x) = (-x.at(0), -x.at(1))
#let data-flow-graph(
stroke: main-color,
bg-color: background-color,
light-theme: is-light-theme,
) = {
let arr = arr.with(stroke: stroke)
let adj-green = if light-theme {
forest.darken(10%)
} else {
green
}
commutative_diagram(
node_padding: (70pt, 50pt),
bg-color: bg-color,
node((0, 0), [
Typst Documents
]),
node((0, 2), [
Preprocessed Artifact
]),
node((1, 1), [
#link("https://developer.mozilla.org/en-US/docs/Web/SVG")[SVG Document] ( `<svg/>` )
]),
node((2, 1), [
#link("https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas")[Canvas] ( `<canvas/>` )
]),
arr((0, 0), (0, 2), [
#set text(fill: adj-green)
`precompile with theme and screen settings`
]),
arr((0, 0), (1, 1), label_pos: 0.8em, {
set text(fill: adj-green)
rotate(17deg)[
`compile to svg`
#set text(fill: blue)
#h(-0.5em) $space^dagger$
]
}),
arr((0, 0), (2, 1), label_pos: -0.6em, curve: -25deg, {
set text(fill: blue)
rotate(35deg)[`directly render` #h(-0.5em) $ space^(dagger dot.c dagger.double)$]
}),
arr((0, 2), (1, 1), label_pos: -0.8em, {
set text(fill: blue)
rotate(-17deg)[`render to svg` #h(-0.5em) $ space^dagger.double$]
}),
arr((1, 1), (2, 1), []),
arr((0, 2), (2, 1), label_pos: 0.6em, curve: 25deg, {
set text(fill: blue)
rotate(-35deg)[`render to canvas` #h(-0.5em) $ space^(dagger.double)$]
}),
)
}
#let std-scale = scale
#let ir-feature-graph(
stroke-color: main-color,
bg-color: background-color,
light-theme: is-light-theme,
) = {
let stroke-factor = if light-theme {
1
} else {
0.8
}
let adj-green = if light-theme {
forest.darken(10%)
} else {
green
}
let data-fill = if light-theme {
blue.lighten(60%)
} else {
blue.darken(10%)
}
let preview-img-fill = if light-theme {
blue.lighten(80%)
} else {
blue.darken(20%)
}
let preview-img-fill2 = if light-theme {
green.lighten(80%)
} else {
green.darken(20%)
}
let orange = if light-theme {
yellow.mix(red.lighten(60%))
} else {
yellow.lighten(20%).mix(red.darken(20%))
}
let del-style = if light-theme {
0.5pt + red.lighten(20%)
} else {
(0.5pt * stroke-factor) + red.lighten(20%)
}
// let typst-doc = text(font: "Garamond", [*doc*])
let typst-doc = text(font: "Garamond", [*Typst doc*])
cetz.canvas({
import cetz.draw: *
/// default style
let light-doc-bg = black.lighten(98%)
let dark-doc-bg = rgb("#343541")
let rect = rect.with(stroke: (0.5pt*stroke-factor) + stroke-color)
let circle = circle.with(stroke: (0.5pt*stroke-factor) + stroke-color)
let line = line.with(stroke: (0.5pt*stroke-factor) + stroke-color)
let light-line = line.with(stroke: (0.3pt*stroke-factor) + stroke-color)
let exlight-line = line.with(stroke: (0.2pt*stroke-factor) + stroke-color)
let preview-page = rect((0, 0), (0.8, 1), name: "preview-page", fill: if light-theme {
light-doc-bg
} else {
dark-doc-bg
})
let x-diff = (3.5, 0)
let y-diff = (0, 0.1)
let rect-size = (3, 2)
let data-sharing = (0, 0)
let art-streaming = vadd(data-sharing, x-diff)
let incr-rendering = vadd(art-streaming, x-diff)
let prect(p) = rect(p, vadd(p, rect-size))
// prect(data-sharing)
// prect(art-streaming)
// prect(incr-rendering)
group({
translate(data-sharing)
content(vdiv((rect-size.at(0), 0), 2), std-scale(80%)[
Data sharing
])
translate(y-diff)
let data-rect(q, c, name: "t") = {
rect(q, vadd(q, (0.4, 0.4)), name: name, fill: data-fill)
content(name, std-scale(80%, c))
}
let ref-rect(q, c) = {
circle(vadd(q, (0.2, 0.2)), radius: 0.2, name: "t", fill: orange)
content("t", std-scale(80%, c))
}
let sref-rect(q, name) = {
let r = 0.08
circle(vadd(q, (r, r)), radius: r, name: name, fill: orange, stroke: 0.2pt + stroke-color)
}
let q = (0.1, 1.5)
data-rect(q, [T])
let q = vadd(q, (0.4 + 0.1, 0))
ref-rect(q, [&])
let crect(s: none, fill: black, stroke: 0pt) = rect(vneg(vdiv(s, 2)), vdiv(s, 2), fill: fill, stroke: stroke)
let br = crect.with(s: (3, 1), fill: light-doc-bg, stroke: black + 0.2pt)
let sr = crect.with(s: (2.5, 2), fill: dark-doc-bg, stroke: stroke-color + 0.2pt)
range(0, 7).zip(
(("d", "data-d"), ("e", "data-e"), ("a", "data-a"),
("b", "data-b"), ("f", "data-f"), (br, "data-lr"), (sr, "data-dr"))
).map(((t, c)) => {
let (c, tag) = c
let q = (0.1 + t * 0.4, 0.1)
data-rect(q, name: tag, if type(c) == str {
c
} else {
""
})
if type(c) != str {
group({
translate(vadd(q, (0.2, 0.2)))
scale(1/10)
c()
})
}
}).sum()
group({
translate((0, 1.2))
let q = (0.3, 0)
rect(q, vadd(q, (0.66, 0.22)), fill: light-doc-bg, stroke: black + 0.2pt, name: "light-doc")
content("light-doc", std-scale(40%, [
#set text(fill: black)
dead beef
]))
sref-rect((0.1, 0), "light-doc")
translate((0.29*6, 0))
let q = (0.4, 0)
let t = 0.33
rect(q, vadd(q, (t/4*5, t)), fill: dark-doc-bg, stroke: stroke-color + 0.2pt, name: "dark-doc")
content((v => vadd(v, (-0.05, 0)), "dark-doc"), std-scale(30%, [
#set text(fill: white)
dead #linebreak()
beef
]))
sref-rect((0.1, 0), "dark-doc")
translate((-0.29*6, 0))
let flow-stroke = 0.15pt + stroke-color
translate((0, -0.6))
range(0, 10).zip(("d", "e", "a", "d", "b", "e", "e", "f", "lr", "dr")).map(((t, c)) => {
let q = (0.1 + t * 0.29, 0)
let tag = "ref-l2-" + str(t)
sref-rect(q, tag)
line("ref-l2-" + str(t) + ".top", "data-" + c + ".top", stroke: flow-stroke)
}).sum()
let l2-line(t, tag: "root") = line(tag + ".top", "ref-l2-" + str(t) + ".bottom", stroke: flow-stroke)
translate((0, 0.3))
sref-rect((0.1, 0), "text-fff")
content((0.57, 0.1-0.02), std-scale(40%, [fill=\#fff]))
range(0, 8).map(l2-line.with(tag: "text-fff")).sum()
line("light-doc.top", "text-fff.bottom", stroke: flow-stroke)
group({
translate((0.29*3, 0))
sref-rect((0.1, 0), "text-000")
content((0.57, 0.1-0.02), std-scale(40%, [fill=\#000]))
range(0, 8).map(l2-line.with(tag: "text-000")).sum()
line("dark-doc.top", "text-000.bottom", stroke: flow-stroke)
})
group({
translate((0.29*6, 0))
sref-rect((0.1, 0), "white-bg")
l2-line(8, tag: "white-bg")
line("light-doc.top", "white-bg.bottom", stroke: flow-stroke)
translate((0.29*1, 0))
sref-rect((0.1, 0), "dark-bg")
l2-line(9, tag: "dark-bg")
line("dark-doc.top", "dark-bg.bottom", stroke: flow-stroke)
})
})
})
group({
translate(art-streaming)
content(vdiv((rect-size.at(0), 0), 2), std-scale(80%)[
Artifact Streaming
])
translate(y-diff)
// let q = (1.8, 1.5)
// rect(q, vadd(q, (0.8, 0.4)), name: "typst-doc", stroke: 0pt)
// content("typst-doc", std-scale(80%, typst-doc))
let rect-r = 0.16
let data-rect(q, c, name: "t") = {
rect(q, vadd(q, (rect-r*2, rect-r*2)), name: name, fill: data-fill)
content(name, std-scale(80%, c))
}
let ref-rect(q, c) = {
circle(vadd(q, (rect-r, rect-r)), radius: rect-r, name: "t", fill: orange)
content("t", std-scale(80%, c))
}
let bundle-rect(q, name: "t") = {
let m = (0.05, 0.05)
rect(q, vadd(q, (0.8, 0.4)), name: name)
group({
translate((0.03, 0.03))
data-rect(vadd(q, (0.05*0.4, 0)), [])
let q = vadd(q, (0.4 - 0.05*0.2, 0))
ref-rect(q, [])
})
}
let preview-content0 = {
translate((0.05, 1-0.2))
// title
light-line((0.15, 0), (0.55, 0))
translate((0, -0.08))
exlight-line((0.05, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.4, 0))
}
let preview-content1 = {
translate((0, -0.06))
rect((0.05, 0), (0.65, -0.24), stroke: 0pt, fill: preview-img-fill, name: "picture")
content("picture", std-scale(20%)[$lambda x = integral.double x dif x$])
translate((0, -0.24))
}
translate((-0.05, 1.24))
scale(0.9)
bundle-rect((0.1, 0))
group({
translate((0.1, -1.1))
preview-page
// content("preview-page.top-left", anchor: "top-left", std-scale(7.5%,
// origin: top + left, box(inset: 10pt, width: 280pt, height: auto,
// clip: true, lorem(20))))
preview-content0
})
// text-decender = 0.02
content((1.1, rect-r*2-0.02), std-scale(90%)[..])
translate((1.1, 0))
bundle-rect((0.1, 0))
group({
translate((0.1, -1.1))
preview-page
// content("preview-page.top-left", anchor: "top-left", std-scale(7.5%,
// origin: top + left, box(inset: 10pt, width: 280pt, height: auto,
// clip: true, lorem(20))))
preview-content0
preview-content1
})
// text-decender = 0.02
content((1.1, rect-r*2-0.02), std-scale(90%)[..])
translate((1.1, 0))
bundle-rect((0.1, 0))
group({
translate((0.1, -1.1))
preview-page
// content("preview-page.top-left", anchor: "top-left", std-scale(7.5%,
// origin: top + left, box(inset: 10pt, width: 280pt, height: auto,
// clip: true, lorem(20))))
preview-content0
preview-content1
translate((0, -0.03))
exlight-line((0.05, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.6, 0))
})
})
group({
translate(incr-rendering)
content(vdiv((rect-size.at(0), 0), 2), std-scale(80%)[
Incremental Rendering
])
translate(y-diff)
// let q = (1.8, 1.5)
// rect(q, vadd(q, (0.8, 0.4)), name: "typst-doc", stroke: 0pt)
// content("typst-doc", std-scale(80%, typst-doc))
let rect-r = 0.16
let data-rect(q, c, name: "t") = {
rect(q, vadd(q, (rect-r*2, rect-r*2)), name: name, fill: data-fill)
content(name, std-scale(80%, c))
}
let ref-rect(q, c) = {
circle(vadd(q, (rect-r, rect-r)), radius: rect-r, name: "t", fill: orange)
content("t", std-scale(80%, c))
}
let dd-cross(data-off, data-end) = {
line(data-off, data-end, stroke: del-style)
let (x1, y1) = data-off
let (x2, y2) = data-end
line((x2, y1), (x1, y2), stroke: del-style)
}
let bundle-rect(q, name: "t", dd: false) = {
let m = (0.05, 0.05)
rect(q, vadd(q, (0.8, 0.4)), name: name)
group({
translate((0.03, 0.03))
let data-off = vadd(q, (0.05*0.4, 0))
let data-end = vadd(q, (rect-r*2, rect-r*2))
data-rect(data-off, [])
let ref-off = vadd(q, (0.4 - 0.05*0.2, 0))
let ref-end = vadd(ref-off, (rect-r*2, rect-r*2))
ref-rect(ref-off, [])
if dd {
dd-cross(data-off, data-end)
let sqrt-rect-r = rect-r*(1-calc.sqrt(1/2))
let srr = (sqrt-rect-r, sqrt-rect-r)
dd-cross(vadd(srr, ref-off), vadd(vneg(srr), ref-end))
}
})
}
let preview-content(img-content, fill: none) = {
translate((0.05, 1-0.2))
// title
light-line((0.15, 0), (0.55, 0))
translate((0, -0.08))
exlight-line((0.05, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.4, 0))
translate((0, -0.06))
if fill != none {
rect((0.05, 0), (0.65, -0.24), stroke: 0pt, fill: fill, name: "picture")
content("picture", std-scale(20%, img-content))
}
translate((0, -0.24))
translate((0, -0.03))
exlight-line((0.05, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.7, 0))
translate((0, -0.03))
exlight-line((0.00, 0), (0.6, 0))
}
translate((-0.05, 1.24))
scale(0.9)
bundle-rect((0.1, 0))
group({
translate((0.1, -1.1))
preview-page
// content("preview-page.top-left", anchor: "top-left", std-scale(7.5%,
// origin: top + left, box(inset: 10pt, width: 280pt, height: auto,
// clip: true, lorem(20))))
preview-content(fill: preview-img-fill)[$lambda x = integral.double x dif x$]
})
// text-decender = 0.02
content((1.1, rect-r*2-0.02), std-scale(90%)[..])
translate((1.1, 0))
bundle-rect((0.1, 0), dd: true)
group({
translate((0.1, -1.1))
preview-page
// content("preview-page.top-left", anchor: "top-left", std-scale(7.5%,
// origin: top + left, box(inset: 10pt, width: 280pt, height: auto,
// clip: true, lorem(20))))
preview-content[]
})
// text-decender = 0.02
content((1.1, rect-r*2-0.02), std-scale(90%)[..])
translate((1.1, 0))
bundle-rect((0.1, 0))
group({
translate((0.1, -1.1))
preview-page
// content("preview-page.top-left", anchor: "top-left", std-scale(7.5%,
// origin: top + left, box(inset: 10pt, width: 280pt, height: auto,
// clip: true, lorem(20))))
preview-content(fill: preview-img-fill2)[$lambda = c x^2$]
})
})
})
}
|
https://github.com/Xendergo/wasm-session | https://raw.githubusercontent.com/Xendergo/wasm-session/main/wasm-script.typ | typst | Creative Commons Zero v1.0 Universal | #import "@local/henrys-typst-utils:0.1.0" : *
#set text(0.99em)
= Title
So you're writing a website, right? And you're just thinking to yourself \"Wow, javascript really sucks, I wish I could be using anything else right now.\" Well guess what, you can, and it's called webassembly, and I'm going to teach you all about it in tonights session.
= What am I talking about?
So what will I be talking about?
- What is webassembly?
- Rust
- Mandelbrot set
- Raw
- for crazy people or you want to learn fundamentals
- AoC day 4 part 1
= What am I not talking about?
First, what I won't be talking about are...
- Batteries included frameworks
- Compiles your code into webassembly
- Abstract away webassembly into a technical detail
- I'm teaching webassembly, not a framework
- Super useful if you want to make a whole website in webassembly
= How do websites work?
So first, how do websites work?
1. Put an address into your browser
2. Browser makes HTTP request
3. Returns an HTML file
- Content of the webpage
- Example on the right
- Instructs the browser to download additional files
- CSS
- How your website looks
- Javascript
- Programming language
- What the website should do
- Ex: Making scrolling do something other than actually scrolling
= What problems does Webassembly solve?
So where does webassembly fit into this? Before that I need to explain what problems webassembly attempts to solve.
- Javascript is cursed
- You can compare strings and numbers and it might return true
- Added a triple equals operator when people figured out that made no sense
- No type checking
- Scripting language; Slow as heck
- No rendering fractals
- Running non-web stuff on the web
- FFMPEG
- Your browser doesn't understand assembly
So for these reasons, developers invented Webassembly.
= What is Webassembly?
So now, what is webassembly?
- Standardized machine code
- Compilation target for other languages
- You're not meant to code in it directly, but you totally can and we will
- You can write code for the web in any language you like
- Compiling desktop programs for the web
- Can only interface with javascript
- Importing and exporting functions from/to javascript
- Can't send or receive complex data structures, only numbers
- You need javascript to encode and decoded data directly in your webassembly module's memory
- "Glue code"
- We'll use Rust for our first demo and we'll see that it takes care of this for us.
- No direct access to DOM or standard library
- You need to import from Javascript
- Also taken care of by Rust
= Demo 1!
So now we can start with the first demo!
- Mandelbrot set
- I'm assuming that if you wanted to follow along you set everything up in accordance with the README on the github page.
First, we need to set up the HTML for our page.
== HTML
*`index.html`*
```html
<!doctype html>
<html>
<head>
<title>Mandelbrot</title>
</head>
<body>
<canvas id="canvas" width="800" height="600"></canvas>
<script type="module" src="sketch.js"></script>
</body>
</html>
```
== JS
Now lets write our Javascript code
I'm implementing this in a roundabout way
- JS asks WASM to render a frame
- WASM renders frame
- WASM asks JS to display the rendered frame
- JS asks WASM through a callback to copy the frame data into the canvas buffer
- More straightforward to have WASM return the rendered frame and have JS copy it into the buffer but I want to demo the cool JS interop
*`sketch.js`*
```js
import init, { render_data } from "./pkg/mandelbrot.js";
(async () => {
await init()
showThingy(1);
})()
```
---
```js
function showThingy(scale) {
render_data(scale)
requestAnimationFrame(() => showThingy(scale * 0.99))
}
```
---
```js
export function set_canvas_data(callback) {
let canvas = document.getElementById("canvas");
let ctx = canvas.getContext("2d");
let imageData = ctx.getImageData(0, 0, 800, 600);
callback(imageData.data)
ctx.putImageData(imageData, 0, 0);
}
```
== Rust
Now we can write our Rust code that will actually generate the mandelbrot set.
*`Cargo.toml`*
```toml
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "0.2.74"
js-sys = "0.3.68"
```
---
*`lib.rs`*
```rust
fn mandelbrot_shade_at_pos(c: (f64, f64), count: usize) -> f64 {
let mut z = (0., 0.);
for i in 0..count {
if z.0 * z.0 + z.1 * z.1 > 4. {
return i as f64 / count as f64;
}
z = (z.0 * z.0 - z.1 * z.1 + c.0, z.0 * z.1 * 2. + c.1);
}
return 1.;
}
```
---
```rust
#[wasm_bindgen]
pub fn render_data(scale: f64) {
let mut data = vec![0; 800 * 600 * 4];
let count = (10. * (1. / scale).ln()) as usize + 30;
for x in 0..800 {
for y in 0..600 {
let shade = mandelbrot_shade_at_pos(
(
(x as f64 - 400.) / 200. * scale - 1.5,
(y as f64 - 300.) / 200. * scale,
),
count,
);
data[4 * (x + y * 800) + 0] = (shade * 256.) as u8;
data[4 * (x + y * 800) + 1] = (shade * 256.) as u8;
data[4 * (x + y * 800) + 2] = (shade * 256.) as u8;
data[4 * (x + y * 800) + 3] = 255;
}
}
set_canvas_data(&Closure::once(move |array: Uint8ClampedArray| {
array.copy_from(&data)
}));
}
```
---
```rust
#[wasm_bindgen(raw_module = "/sketch.js")]
extern "C" {
fn set_canvas_data(s: &Closure<dyn FnMut(Uint8ClampedArray) -> ()>);
}
```
== Compiling and running
Now we can actually run it!
```bash
wasm-pack build --target web
python3 -m http.server
```
= WAT
Now observe this meme, it's very important...
Now I know what you're thinking...
WAT?
And you'd be right!
= How does it work?
So how does it work?
== Sections
- Global scope stuff
- Defining memory
- Defining globals
- Importing functions from JS
- Defining functions
- etc.
- The example on the right will be in the demo and I'll explain everything.
== Instructions
- Small instruction set
- Mix of stack and register based
- It has a stack
- But you can define locals at the top of the function
- The size of the stack at any given point is known at parse time
- Can be implemented with a fixed array or with registers
- Control flow constructs are high level
- If/else
- Loops
- Blocks
- No goto
- Will make sense when we get into coding
= Demo
So now for the demo.
- Might get boring or hard to follow
- Feel free to leave or yell at me if you have a question
For this, we'll be doing advent of code, day four, part one.
Basically, we have this table, and we want to find how many of the numbers on the left side are on the right side
- Do the first row
Then each row is worth zero points for zero matches, one for one match, and doubles for each match after that
- That row has four matches so it'll have a score of eight
- One for the first match, then doubled three times for the three next ones.
== Module setup
```wat
(module
(memory (import "js" "mem") 1)
(global $end_of_input (import "js" "endOfInput") i32)
(import "console" "log" (func $log (param i32) (result i32)))
(import "js" "parseNum" (func $parse_num (param i32) (result i32)))
(func (export "solve") (result i32)
)
(func $solve_line (param $start_of_line i32) (param $start_of_scratch i32) (result i64)
)
(func $check_num (param $num i32) (param $winning_numbers_buf_addr i32) (param $buf_end_addr i32) (result i32)
)
)
```
== `check_num`
First let's implement `check_num`, which will check if a number is a winning number.
We have...
- Winning numbers in a block of memory
- A number we want to check if it's a winning number
- `$num` is the number we want to check
- `$winning_numbers_buf_addr` is the address of the start of the list of winning numbers
- `$buf_end_addr` is the address after the end of the winning numbers buffer
- Return `1` if it's a winning number, `0` if it isn't.
- In wasm, $1 = "true"$, $0 = "false"$
```wat
(loop $check_loop
;; Load the number in memory and compare it with the number given
local.get $winning_numbers_buf_addr
i32.load
local.get $num
i32.ne
(if (then
;; Go to the next number
local.get $winning_numbers_buf_addr
i32.const 4
i32.add
local.tee $winning_numbers_buf_addr
;; Continue if we haven't hit the end of the buffer yet
local.get $buf_end_addr
i32.ne
br_if $check_loop
) (else
;; Return if they are equal
i32.const 1
return
))
)
i32.const 0 ;; Return zero if we went through the whole loop and didn't find a match
```
== `solve_line`
- Will involve a lot of parsing, we'll go character by character
- `$start_of_line` will be an address to the start of the line, but we'll use it as the current character position
- When we write the javascript, we'll have it write the string into our module's memory
- `$start_of_scratch` will be an address to random scratch data
- We'll return an i64 where the first four bytes are the card's score and the last four bytes are the position of the next line
```wat
;; I'm using the scratch space to store the winning numbers
(local $winning_number_pos i32)
(local $winning_number_count i32)
;; Skip to the first colon
(loop $skip_to_colon
;; Compare the character
local.get $start_of_line
i32.load8_u
i32.const 58 ;; :
i32.ne
;; Go to next char
local.get $start_of_line
i32.const 1
i32.add
local.set $start_of_line
br_if $skip_to_colon
)
;; Skip the space
local.get $start_of_line
i32.const 1
i32.add
local.set $start_of_line
;; Load the winning numbers
(loop $load_nums_loop
;; Find the address to write the number
local.get $start_of_scratch
local.get $winning_number_pos
i32.add
;; Parse the winning number
local.get $start_of_line
call $parse_num
;; Store it
i32.store
;; Set the memory address for the next winning number
local.get $winning_number_pos
i32.const 4
i32.add
local.set $winning_number_pos
;; Skip to the next number
local.get $start_of_line
i32.const 3
i32.add
local.set $start_of_line
;; Compare the character
local.get $start_of_line
i32.load8_u
i32.const 124 ;; Pipe
i32.ne
br_if $load_nums_loop
)
;; Skip the pipe (land on the space so as we keep adding three we'll land on the newline instead of skipping over it to the next card)
local.get $start_of_line
i32.const 1
i32.add
local.set $start_of_line
;; Check the card numbers
(loop $check_nums_loop
;; Parse the number
local.get $start_of_line
call $parse_num
;; Check the number and maybe increment $winning_number_count
local.get $start_of_scratch
local.get $start_of_scratch
local.get $winning_number_pos
i32.add ;; Add to find the end of the buffer
;; The stack looks like [parsed num, start of winning numbers, end of winning numbers]
call $check_num
;; Increment the winning number count if it is
local.get $winning_number_count
i32.add
local.set $winning_number_count
;; Skip to the next number
local.get $start_of_line
i32.const 3
i32.add
local.set $start_of_line
;; Compare the character
local.get $start_of_line
i32.load8_u
i32.const 10 ;; \n
i32.ne
br_if $check_nums_loop
)
;; Return the result + funny exponent thing
i32.const 1
local.get $winning_number_count
i32.const 1
i32.sub
;; Shift 1 by one minus the amount of winning numbers (if there are zero, it'll shift -1, right shifting out the one)
i32.shl
i64.extend_i32_u
;; Put the new line start in there
local.get $start_of_line
i64.extend_i32_u
i64.const 32
i64.shl
i64.or
```
== `index.html`
Now we can finish it off by writing the JS code to interface with it.
```js
// Create the memory (one page)
const memory = new WebAssembly.Memory({ initial: 1, maximum: 1 });
// Get the memory buffer
const array = new Uint8Array(memory.buffer);
// Write the input into memory
for (let i = 0; i < input.length; i++) {
array[i] = input.charCodeAt(i);
}
// Load the module
let module = await WebAssembly.instantiateStreaming(
fetch("solution.wasm"),
{
js: {
mem: memory,
endOfInput: input.length,
parseNum: (pos) => parseInt(input.slice(pos, pos + 3)),
},
console: { log: (n) => (console.log(n), n) },
},
);
document.getElementById("answer").innerText =
module.instance.exports.solve();
```
== Test it
```bash
wat2wasm solution.wat
python3 -m http.server
```
|
https://github.com/zlfn/zlfn | https://raw.githubusercontent.com/zlfn/zlfn/main/cv/cv.typ | typst | #set page(margin:(x:30pt, y:25pt))
#set text(font:"Wavve PADO TTF", size:16pt)
= 박찬웅 | <NAME> | Kiroo(zlfn)
#set block(spacing: 1.1em)
#set par(first-line-indent:1em, justify:true)
#show link:underline
#set text(font:"Wavve PADO TTF", size:15pt)
#set box(height:11pt)
#let linkedin_icon = box(image("assets/icons/linkedin.svg"))
#let github_icon = box(image("assets/icons/square-github.svg"))
#let email_icon = box(image("assets/icons/square-envelope-solid.svg"))
#let phone_icon = box(image("assets/icons/square-phone-solid.svg"))
#set text(font: "Noto Sans KR", size:11pt)
#block(spacing:10pt, height:3pt)[#align(horizon)[
#box[#email_icon *Email* : <EMAIL>]
#box(width:5pt)
#box[#phone_icon *Phone* : +82 10 3242 7559]
#box(width:5pt)
#box[#github_icon *GitHub* : https://github.com/zlfn]
]]
#set text(font: "Noto Sans KR", size:11pt)
*포항공과대학교* 무은재학부 1학년 재학: 2024.02 \~
#set text(font:"JejuMyeongjo", size:13pt)
#block(height:50pt, inset:0pt)[
유연하면서도 신뢰성이 높은 프로그램 개발을 지향하는 학생 개발자입니다. \
어려운 설계나 도전적인 문제와 마주하는걸 즐깁니다. \
아무도 걸어보지 않은 길을 개척하며 지식을 공유하고 싶습니다.
]
#set text(font:"Wavve PADO TTF", size:15pt)
== 경력
#block(height:68pt)[
#grid(columns:(20%, 80%),
stroke: (x,y) => if x == 0{
(right: (
paint: luma(180),
thickness: 2pt,
dash: "dotted"
))
},[
#set text(font:"Wavve PADO TTF", size:13pt)
프론트엔드 개발\
#set text(font: "Noto Sans KR", size:12pt)
강두영 수학 연구소\
#set text(font: "Noto Sans KR", size:11pt)
2024.04 \~ / 프리랜서\
강남구 대치동, 원격
],[
#box(inset:(x:7pt, y:0pt))[
#set text(font: "Noto Sans KR", size:12pt)
*Typescript / Next.js / Apollo GraphQL*]
#set text(font:"JejuMyeongjo", size:13pt)
#box(height:40pt, inset:(x:7pt, y:2pt))[
수학 학원의 문제 데이터베이스 관리, pdf로 문제집 배포, 온라인 문제 은행 등을 제공하는 LMS 서비스 웹 프론트엔드를 개발하고 있습니다.\
]
])
]
== 기술
#block(inset:0pt, height:65pt)[
#set text(font:"Wavve PADO TTF", size:12pt)
Language:
#set text(font: "Noto Sans KR", size:11pt)
Rust, Python, C++, Typescript, Kotlin, Scala\
#set text(font:"Wavve PADO TTF", size:12pt)
Web:
#set text(font: "Noto Sans KR", size:11pt)
Next.js, axum, rocket.rs, WebSocket\
#set text(font:"Wavve PADO TTF", size:12pt)
Infrastructure:
#set text(font: "Noto Sans KR", size:11pt)
nginx, Docker, SELinux, GCP\
#set text(font:"Wavve PADO TTF", size:12pt)
기타:
#set text(font: "Noto Sans KR", size:11pt)
Git, Neovim, Minecraft, LLVM
]
== 프로젝트
#block(inset:(x:0pt, y:3pt))[=== Rust-GB #box[
#set text(font: "Noto Sans KR", size:10pt)
Rust, Embedded, C, Assembly, LLVM\
]
#block(inset:0pt, spacing:0pt)[
#set text(font: "Noto Sans KR", size:11pt)
#box[#github_icon #box(inset:(y:2pt))[https://github.com/zlfn/rust-gb : *★* 136]]\
#set text(font: "Noto Sans KR", size:11pt)
*Rust Weekly*: https://discu.eu/weekly/rust/2024/38/\
]
#block(height:140pt, inset:(x:8pt, y:-3pt))[
#set text(font:"JejuMyeongjo", size:13pt)
Rust 코드를 닌텐도 게임보이에 컴파일할 수 있는 컴파일러 툴체인과, API를 제공하는 프로젝트입니다. 게임보이의 CPU인 Z80은 LLVM의 정식 타겟이 아니기 때문에, llvm-cbe와 GBDK를 이용하여 Rust->C->ASM의 과정을 거쳐 코드를 컴파일했고, 이 과정에서 각 툴체인간 버전 호환 등 많은 기술적 난관을 극복하였습니다. \
게임보이는 현대의 컴퓨터와 다른 특성을 다수 가지고 있기 때문에 게임보이 API를 Rust로 안전하게 디자인하는 것이 주요 과제가 되었고, 이 디자인을 GitHub Discussion을 통해 토론하며 좋은 API 디자인에 대해 고민할 수 있었습니다. 또한, `no-std` 환경의 러스트를 공부하며 Rust의 표준 라이브러리나 힙 할당이 어떤 과정을 통해 작동하는지 이해할 수 있었습니다. \
]]
#block(inset:(x:0pt, y:3pt))[=== Tritone #box[
#set text(font: "Noto Sans KR", size:10pt)
Kotlin, Rust, Discord\
]
#block(inset:0pt, spacing:0pt)[
#set text(font: "Noto Sans KR", size:11pt)
#box[#github_icon #box(inset:(y:2pt))[https://github.com/iroom-gbs/tritone : *★* 9]]\
]
#block(height:30pt, inset:(x:7pt, y:-7pt))[
#set text(font:"JejuMyeongjo", size:13pt)
Rust 코드를 Kotlin / Java Native Interface를 통해 마인크래프트에 주입하여 게임에 특정 서버 플러그인에 의존하지 않는 음성 대화 기능을 추가하는 프로젝트입니다.
]]
#block(inset:(x:0pt, y:3pt), height:120pt)[=== GBS.WIKI #box[
#set text(font: "Noto Sans KR", size:10pt)
CSS, FastAPI, Nginx, SEO, OAuth2\
]
#block(inset:0pt, spacing:0pt)[
#set text(font: "Noto Sans KR", size:11pt)
#box[#github_icon #box(inset:(y:2pt))[https://github.com/iroom-gbs/GBSWiki : *★* 2]]\
#set text(font: "Noto Sans KR", size:11pt)
*Website*: https://gbs.wiki\
]
#block(inset:(x:7pt, y:-3pt))[
#set text(font:"JejuMyeongjo", size:13pt)
경기북과학고 교내 위키입니다. Google Adsence 등 외부 서비스를 가져오는 방법을 배우고, OAuth API를 연동/제공하는 경험을 할 수 있었습니다. 고등학교를 졸업할 때 후배들에게 인수인계하며 서비스를 인수인계 하는 체계를 만드는 경험도 할 수 있었습니다.
]]
== 리서치
#block(inset:(x:0pt, y:5pt), height:80pt)[
#set text(weight:"bold", font:"PT Serif", size:14pt)
Optimization of 3D convex hull computation using OpenGL compute shaders
#block(inset:(x:7pt, y:10pt), spacing:0pt)[
#set text(font:"JejuMyeongjo", size:13pt)
고등학교 졸업 연구입니다. OpenGL의 ComputeShader를 활용하여 3차원 Point Cloud에서의 Convex Hull을 계산하는 Quick Hull 알고리즘을 GPU 병렬 컴퓨팅으로 연산하여 CPU와의 속도를 비교하였습니다.
]
]
== 오픈소스 기여
=== rust-lang/rust
#block(inset:0pt, spacing:0pt)[
#set text(font: "Noto Sans KR", size:12pt)
*Pull Request*: https://github.com/rust-lang/rust/pull/131730\
]
#block(inset:(x:7pt, y:0pt), above:10pt)[
#set text(font:"JejuMyeongjo", size:13pt)
러스트 언어 `core` 라이브러리의 중복 매크로를 제거하고 코드를 리팩토링하였습니다.\
러스트라는 언어가 만들어지는 과정과 PR에 대한 테스트, PR 자동 병합 등 큰 오픈소스 프로젝트를 관리하는 방법을 배울 수 있었습니다.
]
=== JuliaHubOSS/llvm-cbe
#block(inset:0pt, spacing:0pt)[
#set text(font: "Noto Sans KR", size:12pt)
*Issue*: https://github.com/JuliaHubOSS/llvm-cbe/issues/207 외 다수\
*Pull Request*: https://github.com/JuliaHubOSS/llvm-cbe/pull/210 외 다수\
]
#block(inset:(x:7pt, y:0pt), above:10pt)[
#set text(font:"JejuMyeongjo", size:13pt)
llvm-cbe는 LLVM-IR을 C로 변환하는 백엔드입니다. Rust-GB 프로젝트를 진행하는 과정에서 최신 LLVM-19 지원, 빠진 Intrinsic 구현 등 프로젝트에 필요한 다양한 기여를 하였습니다. 이 과정에서 LLVM의 구조를 이해하고, 마이그레이션 가이드 없이 각 버전간 소스코드만으로 의존성 버전을 마이그레이션하는 방법을 배울 수 있었습니다.
]
=== trilbymedia/grav-plugin-custom-http-headers
#block(inset:0pt, spacing:0pt)[
#set text(font: "Noto Sans KR", size:12pt)
*Issue*: https://github.com/trilbymedia/grav-plugin-custom-http-headers/issues/1\
*Pull Request*: https://github.com/trilbymedia/grav-plugin-custom-http-headers/pull/4\
]
#block(inset:(x:7pt, y:0pt), above:10pt)[
#set text(font:"JejuMyeongjo", size:13pt)
플러그인 기본 설정에서 X-Frame-Options 헤더를 deny로 설정하여 플러그인이 Grav의 기본 기능과 충돌을 일으키는 문제가 있어, 해당 헤더를 config 파일에서 제외하는 기여를 하였습니다.
]
=== 현지화 기여
#block(inset:(x:7pt, y:0pt), height:60pt)[
#set text(font:"Wavve PADO TTF", size:13pt)
Minecraft:
#set text(font:"JejuMyeongjo", size:13pt)
마인크래프트 번역은 유저 참여로 진행되는데, 2022년부터 한국어 번역 Proofreader (오픈소스 프로젝트의 Maintainer와 유사) 중 하나로 활동하고 있습니다.\
#set text(font:"Wavve PADO TTF", size:11pt)
이외에도 Grav, Optimus Manager QT 등 다양한 오픈소스/상용 소프트웨어에 번역 기여를 하였습니다.
]
== 자격 / 시험
#block(inset:(x:7pt, y:0pt))[
#set text(font:"Wavve PADO TTF", size:13pt)
- JLPT N2\
- 운전면허 1종보통 (운전 경력 없음)\
]
|
|
https://github.com/MatheSchool/typst-g-exam | https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/test/grade-table/test-003-sugar.typ | typst | MIT License | #import "../../src/lib.typ": *
#show: g-exam.with(
show-student-data: "first-page",
show-grade-table: true,
)
=? []
==? (points:1) []
==? (points:2) []
=? (points:3)[]
==? (points:1.2)[]
==? (points:1.3)[]
|
https://github.com/typst-doc-cn/tutorial | https://raw.githubusercontent.com/typst-doc-cn/tutorial/main/src/basic/scripting-length-and-layout.typ | typst | Apache License 2.0 | #import "mod.typ": *
#show: book.page.with(title: "度量与布局")
本章我们再度回到排版专题,拓宽制作文档的能力。
== 长度类型
#show quote: it => {
box(
stroke: (
left: 2pt + main-color,
),
inset: (
left: 12pt,
y: 8pt,
),
{
stack(
{
set text(style: "italic")
it.body
},
if "attribution" in it.fields() {
1em
},
if "attribution" in it.fields() {
align(right, [——] + it.attribution)
},
)
},
)
}
Typst有三种长度单位,它们是:绝对长度(absolute length)、相对长度(relative length)与上下文有关长度(context-sensitive length)。
+ 绝对长度:人们最熟知的长度单位。例如,```typc 1cm```恰等于真实的一厘米。
+ 相对长度:与父元素长度相关联的长度单位,例如```typc 70%```恰等于父元素高度或宽度的70%。
+ 上下文有关长度:与样式等上下文有关的长度单位,例如```typc 1em```恰等于当前位置设定的字体长度。
掌握不同种类的长度单位对构建期望的布局非常重要。它们是相辅相成的。
== 绝对长度
目前Typst一共提供四种绝对长度。除了公制长度单位```typc 1cm```与```typc 1mm```与英制长度单位```typc 1in```,Typst还提供排版专用的长度单位“点”,即```typc 1pt```。
#quote(attribution: link("https://zh.wikipedia.org/wiki/%E9%BB%9E_(%E5%8D%B0%E5%88%B7)")[维基百科:点 (印刷)])[
点(英语:point),pt,是印刷所使用的长度单位,用于表示字型的大小,也用于余白(字距、行距)等其他版面构成要素的长度。作为铸字行业内部的一个专用单位,1 点的长度在世界各地、各个时代曾经有过不同定义,并不统一。当代最通行的是广泛应用于桌面排版软件的 DTP 点,72 点等于 1英寸(1 point = 127⁄360 mm = 0.352777... mm)。中国传统字体排印上的字号单位是号,而后采用“点”“号”兼容的体制。
]
Typst会将你提供的任意长度单位都统一成点单位,以便进行长度运算。
#{
set align(center)
let units = ((1pt, "pt"), (1mm, "mm"), (1cm, "cm"), (1in, "in"))
let methods = (length.pt, length.mm, length.cm, length.inches)
table(
columns: 5,
"",
..("pt", "mm", "cm", "in").map(e => raw("=?" + e)),
..units.map(((l, u)) => {
(raw("1" + u, lang: "typc"),) + methods.map(method => [#calc.round(method(l), digits: 2)])
}).flatten(),
)
}
== 绝对长度的运算
长度单位可以参与任意多个浮点值的运算。一个长度表达式是合法的当且仅当运算结果*保持长度量纲*。请观察下列算式,它们都可以编译:
#code(```typ
#(1cm * 3), #(1cm / 3), #(2 * 1cm * 3 / 2), #(1cm + 3in)
```)
请观察下列算式,它们都不能编译:
#(
```typ
#(1cm + 3), #(3 / 1cm), #(1cm * 1cm)
```
)
所谓*保持长度量纲*,即它存在一系列判别规则:
- 由于`1cm`与`3in`量纲均为长度量纲(`m`),它们之间*可以*进行*加减*运算。
- 由于`3`无量纲,`1cm`与`3`之间*不能*进行*加减*运算。
进一步,通过量纲运算,可以判断一个长度算术表达式是否合法:
#{
set align(center)
table(
columns: 4,
[长度表达式],
[量纲运算],
[检查合法性],
[判断结果],
```typc 1cm * 3```,
$bold(sans(m dot 1 = m))$,
$bold(sans(m = m))$,
table.cell(rowspan: 2, align: horizon)[合法],
```typc 1cm / 3```,
$bold(sans(m op(slash) 1 = m))$,
$bold(sans(m = m))$,
```typc 3 / 1cm```,
$bold(sans(1 op(slash) m = m^(-1)))$,
$bold(sans(m^(-1) = m))$,
table.cell(rowspan: 2, align: horizon)[非法],
```typc 1cm * 1cm```,
$bold(sans(m dot m = m^2))$,
$bold(sans(m^2 = m))$,
)
}
== 绝对长度的转换
你可以使用`length`类型上的「方法」实现不同单位到浮点数的转换:
#code(```typ
#1cm 是 #1cm.pt() 点 \
#1cm 是 #1cm.inches() 英尺
```)
你可以使用乘法实现浮点数到长度上的转换,例如```typc 28.3465 * 1pt```:
#code(```typ
#1cm 是 #(28.3465 * 1pt).cm() 厘米
```)
== 相对长度
有两种相对长度(Relative Length),一是百分比(Ratio),一是分数比(Fraction)。
=== 百分比 <reference-type-ratio>
#let p(w, f, ..args) = box(
width: w,
height: 10pt,
fill: f,
..args,
)
#let code = code.with(scope: (p: p))
当「百分比」用作长度时,其实际值取决于父容器宽度:
#code(```typ
#let p(w, f, ..args) = box(
width: w, height: 10pt, fill: f, ..args)
4比6:#p(100pt, blue, p(40%, red))
```)
Typst还支持以「分数比」作长度单位。当分数比作长度单位时,Typst按比例分配长度。
#code(```typ
4比6:#p(100pt, blue,
p(4fr, red) + p(6fr, blue))
```)
结合代码与图例理解,`N fr`代表:在总的比例中,这个元素应当占有其中`N`份长度。
当同级元素既有分数比长度元素,又有其他长度单位元素时,优先将空间分配给其他长度单位元素。
#code(```typ
绿色先占60%: #p(100pt, blue, p(1fr, red) + p(2fr, blue) + p(60%, green)) \
绿色先占110%: #p(100pt, blue, p(1fr, red) + p(1fr, blue) + p(110%, green)) \
红色先占30pt: #p(100pt, blue, p(30pt, red) + p(1fr, blue) + p(110%, green))
```)
建议结合下文中grid布局关于长度的使用,加深对相对长度的理解。
== 上下文有关长度
目前Typst仅提供一种上下文有关长度,即当前上下文中的字体大小。历史上,定义该字体中大写字母`M`的宽度为`1em`,但是现代排版中,`1em`可以比`M`的宽度要更窄或者更宽。
上下文有关长度是与相对长度相区分的。区别是上下文有关长度的取值从「样式链」获取,而相对长度相对于父元素宽度。事实上`1em`的具体值可以通过上下文有关表达式获取:
#code(```typ
#let _1em = context measure(
line(length: 1em)).width
#text(size: 10pt, [1em等于] + _1em) \
#text(size: 20pt, [1em等于] + _1em) \
```)
相比较,`1em`更好用一点,因为`text.size`只允许在上下文有关表达式内部使用。
== 混合长度
以上所介绍的各种长度可以通过「加号」任意混合成单个长度的值,其长度的值为每个分量总和:
#code(```typ
#(1pt + 1em + 100%)
```)
== 长度的内省或评估
你可以通过`measure`获取一个长度在当前位置的具体值:
#let length-of(l) = (measure(line(length: l)).width)
#let code = code.with(scope: (length-of: length-of))
#code(```typ
#let length-of(l) = measure(
line(length: l)).width
#context [长度等于#length-of(1em+1pt)。]
```)
但是该方式是不被推荐的,因为一个长度值中的相对长度分量会被评估为`0pt`,从而导致计算失真:
#code(```typ
长度等于 #context length-of(1em+1pt+100%)。
```)
这是因为在评估的时候,`measure`没有为内容锚定一个“父元素”。
一种更为鲁棒的方法是使用`layout`函数获取`layout`位置的宽度和高度信息:
#code(```typ
长度等于#box(width: 1em+1pt+100%,
layout(l => l.width))
```)
但是使用`layout`会导致布局的多轮迭代,有可能*严重*降低编译性能。
#let absent(content) = underline(offset: 1.5pt, underline(offset: 3pt, text(red, content)))
#let ng(content) = underline(offset: 1.5pt, text(blue, content))
== 布局概览与布局模型
Typst的布局引擎仍未完成,其主要#absent[缺失]或#ng[不足]的内容为:
+ 修饰段落容器的#absent[行]或#ng[字符]的能力。
+ 将段落容器的接口#ng[暴露]给用户的能力。
+ #ng[浮动布局]的能力。
+ #ng[更灵活]的Layout Splitter。目前仅支持`columns`(多栏布局)的能力。
Typst的布局代码风格是用一系列容器函数包装的内容,再将整个内容交给布局引擎反复*迭代*求解。容器就是一类特殊的「元素」,它并不真正具备具体的内容,而仅仅容纳一个或多个「内容」,*以便布局*。这与JSX有些相似。
针对PDF页面模型,Typst构建了完整的容器层次。Todo:用cetz绘制层次:
1. page,一个PDF有很多页。
2. par,一个文档中有很多段。
3. block,一页/段中有很多块。
4. box,一个块中有很多行内元素。
5. sequence,很多个元素可以组成一个元素序列。
6. 各种基础元素。
=== page
每个`page`都单独产生一个单独的页面。并且若你希望将Typst文档导出为PDF,其恰好为PDF中单独的一页。
任何内容都会至少产生新的一页:
```typ
// 第一页
A
```
每个`pagebreak`函数(分页函数)将会产生新的一页:
```typ
// 第一页
A
#pagebreak()
// 第二页
B
```
```typ
// 第一页
A
#pagebreak()
// 第二页
#pagebreak()
// 第三页
B
```
你可以使用`#pagebreak(weak: true)`产生弱的分页。这里弱的意思是:假设当前页面并没有包含任何内容,`pagebreak(weak: true)`就不会创建新的页面。你可以理解为弱的分页意即非必要不分页。
```typ
// 第一页
A
#pagebreak(weak: true)
#pagebreak(weak: true)
// 第二页
B
```
每个`page`函数都会单列新的一页:
```typ
// 第一页
A
#page[
// 第二页
A
]
// 第三页
B
```
如果`page`的前后已经是空页,则`page`不会导致前后产生空页。
```typ
// 这里不分页
#page[
// 第一页
A
] // 这里不分页
#page[
// 第二页
A
] // 这里不分页
```
你可以理解为`page`前后自动产生弱的分页,其前后*非必要不分页*,上例相当于:
```typ
#pagebreak(weak: true)
// 第一页
A
#pagebreak(weak: true)
#pagebreak(weak: true)
// 第二页
A
#pagebreak(weak: true)
```
所以`page`与`pagebreak`是互通的,你可以随意使用你喜欢的风格创建新的页面。
*注意*:设置`page`样式将导致新的弱分页:
```typ
// 第一页
A
#set page(..)
// 第二页
B
```
等价于:
```typ
A
#pagebreak(weak: true)
#set page(..)
#pagebreak(weak: true)
B
```
=== par
每个`par`都单独产生一个单独的段落。
`par`的特性与`page`完全相同,其前后非必要不分段。
#code(```typ
#par[
// 第一段
A
]
```)
`parbreak`与`pagebreak`也是除了同理,除了`parbreak`一定是弱分段,并且没有可以指定的`weak`参数:
#code(```typ
// 第一段
A
#parbreak()
#parbreak()
// 第二段
B
```)
很多元素都会在其前后自动产生新的段落,例如`figure`和`heading`。
=== block
`block`是布局中的块状元素。块状元素会在布局中自成一行。你几乎可以将`block`理解为某种程度上的分段:
#code(```typ
// 第一段
#block(fill: blue)[A]
#block(fill: blue)[B]
```)
事实上`par`本来就由`block`组成。你可以通过对`block`设置规则影响到段间距:
#code(```typ
#set block(spacing: 0.5em)
A
#parbreak()
#parbreak()
B
```)
=== box
`box`是布局中的行内块元素。行内块元素会在布局中自成一行。所谓行内块即其自成一块但不会立即导致换行。如下所示:
#code(```typ
#rect(width: 100pt)[a a a #box(fill: blue)[A A A A A]a a a]
```)
`box`并不意味着不换行。`box`的宽度默认占满父元素内宽度的```typc 100%```。`box`内部的文本在其内部继续换行。如下所示,当文字太多时,将导致其在`box`内部换行:
#code(```typ
#rect(width: 100pt)[#box(fill: blue)[A A A A A A A A A A A A A]]
```)
`box`整体必须处于段落中的同一行:
#code(```typ
#rect(width: 100pt)[a a a a#box(fill: blue, width: 50%)[A A A A A A A A A]a a a]
#rect(width: 100pt)[a a a a a#box(fill: blue, width: 50%)[A A A A A A A A A]a a a]
```)
一个妙用是,你可以将“块元素”包裹一层`box`,使得这些块元素位于段落中的同一行:
#code(```typ
我们之中混入了
#box(rect(width: 100pt)[a a a a#box(fill: blue, width: 50%)[A A A A A A A A A]a a a])
两个矩形
#box(rect(width: 100pt)[a a a a a#box(fill: blue, width: 50%)[A A A A A A A A A]a a a])
```)
=== sequence
`sequence`是布局中最松散的组织。事实上,它正是我们在《基础文档》中就学过的「内容块」。它起不到任何效果,仅仅容纳一系列其他内容。
#code(```typ
#rect(width: 100pt)[#[a a a a a a] #[a a a a a a a a] ]
```)
我们来温习一下。`sequence`主要的作用是可以储存一段内容供函数使用。使用`sequence`的一个好处是允许「标签」准确地选中一段内容。例如,以下代码自制了`highlight`效果:
#code(```typ
#show <fill-blue>: it => {
show regex("[\w]"): it => {
box(place(dx: -0.1em, dy: -0.15em, box(fill: blue, width: 0.85em, height: 0.95em)) + it)
}
it
}
#rect(width: 100pt)[#[a a a a a a] #[a a a a a a a ab] <fill-blue> ]
```)
== 「布局分割及其断点」
「布局分割器」(Splitter)将所持有内容分成多段并放置于页面上。
目前Typst唯一提供的分割器是`columns`,其实现了多栏布局。因为缺乏好用的分割器,有很多布局都*难以*在Typst中实现,例如浮动布局。但注意,这不代表现在的Typst不支持各种特殊布局。已经有外部库帮助你实现了首字母下沉,浮动布局等特殊布局。
你可以使用`columns`在任意容器内创建多栏布局,并用`colbreak`分割每栏。
#code(```typ
#columns(2)[
#lorem(13)
#colbreak()
#lorem(10)
]
```)
尽管还不是很完善,在与页面的结合中,Typst为`page`提供了一个`columns`参数。该`columns`允许你设置跨页的多栏布局。
// #frames(
// ```typ
// #set page(columns: 2)
// #set text(size: 5pt)
// #lorem(130)
// ```,
// prelude: ```typ
// #set page(width: 120pt, height: 120pt)
// ```,
// )
== 「布局编排」
「布局编排器」(Arranger)将多个内容组成一个新的带有布局的整体。目前,Typst提供了两种零维布局`pad`和`align`,一种一维布局`stack`,以及一种二维布局`grid`。
== pad
你可以使用`pad`函数为内部元素设置outer padding。`pad`接受一个内容,返回一个添加padding的新内容。默认情况下,`pad`函数不添加任何padding。
#code(```typ
#let square = rect(fill: blue, width: 15pt, height: 15pt)
#box(fill: red, square)
#box(fill: red, pad(square))
```)
与CSS的`padding`属性一样,你可以使用`left`、`top`、`right`、`bottom`设置四个方向的padding:
#code(```typ
#let square = rect(fill: blue, width: 15pt, height: 15pt)
#box(fill: red, pad(left: 5pt, square))
#box(fill: red, pad(top: 5pt, square))
#box(fill: red, pad(right: 5pt, square))
#box(fill: red, baseline: 5pt, pad(bottom: 5pt, square))
#box(fill: red, pad(left: 5pt, top: 5pt, square))
#box(fill: red, pad(left: 5pt, right: 5pt, square))
```)
特别地,你可以使用`x`同时设置`left`和`right`方向的padding,`y`同时设置`top`和`bottom`方向的padding,以及`rest`设置“其余”方向的padding。
#code(```typ
#let square = rect(fill: blue, width: 15pt, height: 15pt)
#box(fill: red, pad(x: 5pt, square))
#box(fill: red, baseline: 5pt, pad(y: 5pt, square))
#box(fill: red, baseline: 2pt, pad(left: 5pt, rest: 2pt, square))
```)
== align
你可以使用`align`函数为内部元素设置相对于父元素的对齐方式。默认情况下,`align`函数使用默认对齐方式(`start+top`)。
#let square = rect(fill: rgb("c45a65c0"), width: 15pt, height: 15pt)
#let abox = box.with(fill: gradient.radial(..color.map.mako), width: 20pt, height: 20pt)
#let align-scope = (
square: square,
abox: abox,
red: rgb("c45a65c0"),
)
#code(
```typ
#let square = rect(fill: red, width: 15pt, height: 15pt)
#let abox = box.with(fill: gradient.radial(..color.map.mako), width: 20pt, height: 20pt)
#abox(square)
#abox(align(square))
```,
scope: align-scope,
)
与上一节介绍的`pad`类似,你可以使用`left`、`top`、`right`、`bottom`设置四个方向的alignment,并任意使用加号(`+`)组合出你想要的二维对齐方式:
#code(
```typ
#abox(align(left + top, square))
#abox(align(right + top, square)) \
#abox(align(left + bottom, square))
#abox(align(right + bottom, square))
```,
scope: align-scope,
)
除了以上四种基础对齐,Typst还额外提供两套对齐方式。第一套是居中对齐,你可以使用`center`实现水平居中对齐,以及`horizon`实现垂直居中对齐。
#code(
```typ
#abox(align(center, square))
#abox(align(horizon, square))
#abox(align(center + horizon, square))
```,
scope: align-scope,
)
第二套与文本流相关。你可以使用`start`实现与文本流方向一致的对齐,以及`end`实现与文本流方向相反的对齐。
#code(
```typ
#let se = abox(align(start, square)) + abox(align(end, square))
#se \
#set text(dir: rtl)
#se
```,
scope: align-scope,
)
=== stack
与HTML中的`flex`容器类似,`stack`可以帮你实现各种一维布局。顾名思义,`stack`将其内部元素在页面上按顺序按方向排列。
#let rects = (rect(fill: red)[1], rect(fill: blue)[2], rect(fill: green)[3])
#code(
```typ
#let rects = (rect(fill: red)[1], rect(fill: blue)[2], rect(fill: green)[3])
#stack(dir: ltr, ..rects)
```,
scope: (rects: rects),
)
`stack`主要只有两个可以控制的参数。
其一是排列的方向,参数对应为`dir`。一共有四种方向可以选择,分别是:
- `ltr`: 即left to right,从左至右。
- `rtl`: 即right to left,从右至左。
- `ttb`: 即top to bottom,从上至下。
- `btt`: 即bottom to top,从下至上。
方向默认为`ttb`。
#code(
```typ
#columns(2)[
`ltr`: #box(stack(dir: ltr, ..rects)) \ `rtl`: #box(stack(dir: rtl, ..rects))
#colbreak()
`ttb`: #box(stack(/* 默认值为:dir: ttb, */ ..rects)) #h(1em) `btt`: #box(stack(dir: btt, ..rects))
]
```,
scope: (rects: rects, box: box.with(baseline: 50% - 0.25em)),
)
其二是排列的间距,参数对应位`spacing`。你可以使用各种长度为`stack`内部元素制定合适的间距。
#code(
```typ
#let stack = stack.with(dir: ltr)
#let example(s) = box(width: 100pt, stack(spacing: s, ..rects))
`5pt `: #example(5pt ) \
`10% `: #example(10% ) \
`5pt+10%`: #example(5pt+10%) \
`1fr `: #example(1fr ) \
```,
scope: (rects: rects, box: box.with(baseline: 50% - 0.25em)),
)
你也可以直接将长度作为参数传入,为每一个元素前后微调间距。
#code(
```typ
#let stack = stack.with(dir: ltr)
#let r = rect(fill: blue)[ ]
`1fr,0pt`: #box(width: 100pt, stack(r, 1fr, r, r)) \
`1fr,2fr`: #box(width: 100pt, stack(r, 1fr, r, 2fr, r)) \
`10%,40%`: #box(width: 100pt, stack(r, 10%, r, 40%, r)) \
```,
scope: (rects: rects, box: box.with(baseline: 50% - 0.25em)),
)
当同时声明`spacing`参数和长度参数时,长度参数会覆盖`spacing`设置:
#code(
```typ
#show stack: box.with(width: 100pt, stroke: green)
#let stack = stack.with(dir: ltr)
#let r = rect(fill: blue)[ ]
` `: #stack(spacing: 5pt, r, r, r, r, r) \
` 0pt `: #stack(spacing: 5pt, r, r, r, r, 0pt, r) \
`10pt `: #stack(spacing: 5pt, r, r, r, r, 10pt, r) \
`10pt+10pt`: #stack(spacing: 5pt, r, r, r, r, 10pt, 10pt, r) \
```,
scope: (box: box.with(baseline: 50% - 0.25em)),
)
=== stack+align/pad
你可以将`stack`与`align/pad`相结合,实现更多一维布局。以下例子对应CSS相关属性:
#code(
```typ
#let box = box.with(width: 100pt, stroke: green)
#let stack = stack.with(dir: ltr, spacing: 1fr)
#let r = rect(fill: blue)[ ]
`space-around 5pt`: #box(stack(5pt, r, r, 5pt)) \
`space-around 5pt`: #box(pad(x: 5pt, stack(r, r))) \
`justify-content end`: #box(align(end, box(width: 60pt, stack(r, r)))) \
`justify-content center`: #box(align(center, box(width: 60pt, stack(r, r)))) \
```,
scope: (box: box.with(baseline: 50% - 0.25em)),
)
上例提示我们可以组合多种布局容器实现特定的布局效果。
=== grid
与HTML中的`flex`容器类似,`grid`可以帮你实现各种二维布局。如下:
#code(```typ
#show grid: box.with(stroke: green)
#let r = rect(fill: blue, width: 10pt, height: 10pt)
#grid(columns: 3, gutter: 5pt, r, r, r, r, r)
```)
与`stack`相比,`grid`要复杂得多。
其一,`grid`的前$N - 1$行可容纳的元素是有限的,而最后一行与`stack`一样容纳其余所有元素。你可以通过`columns`参数控制这一特性。
#let g-scope = (
r: (n, width: 10pt, height: 10pt) => range(n).map(i => rect(
fill: color.map.rainbow.at(calc.rem(i * 16, 80)),
width: width,
height: height,
)),
)
`columns`要求你给定一个数组,该数组表示一行中每列的宽度。
#code(
```typ
#let r(n, width: 10pt, height: 10pt) = range(n).map(i => rect(fill: color.map.rainbow.at(calc.rem(i * 16, 80)), width: width, height: height))
#grid(columns: (auto, ) * 10, gutter: 5pt, ..r(10)) #h(1em)
#grid(columns: (auto, ) * 8, gutter: 5pt, ..r(10)) #h(1em)
#grid(columns: (auto, ) * 4, gutter: 5pt, ..r(10)) #h(1em)
#grid(columns: (auto, ) * 2, gutter: 5pt, ..r(10))
```,
scope: (..g-scope, grid: (..args) => box(stroke: green, grid(..args))),
)
上例中,当`columns`数组的长度为`N`时,表示每行允许容纳`N`个元素,每列的*最大宽度*为`auto`。长度设定为`auto`,则表示每列宽度始终和该行该列内部元素宽度相等。
每列宽度不仅可以为`auto`,而且可以指定为具体长度:
#code(
```typ
#show grid: box.with(stroke: green, width: 100pt)
#let grid = grid.with(gutter: 5pt, ..r(5, width: auto))
1: #grid(columns: (10pt, 20pt, 30pt)) #h(1em)
2: #grid(columns: (10%, 20%, 30%)) #h(1em)
3: #grid(columns: (1fr, 2fr, 3fr)) #h(1em) \
4: #grid(columns: (10pt, 1fr, 1fr)) #h(1em)
5: #grid(columns: (10pt, 1fr, 2fr)) #h(1em)
```,
scope: g-scope,
)
Typst允许你使用更简便的参数表示。特别地,如果`columns`数组内容恰为$N$个`auto`,那么可以直接传入一个数字。以下两种写法是等价的:
#code(
```typ
#grid(columns: 4, gutter: 5pt, ..r(10)) #h(1em)
#grid(columns: (auto, ) * 4, gutter: 5pt, ..r(10)) #h(1em)
```,
scope: (..g-scope, grid: (..args) => box(stroke: green, grid(..args))),
)
特别地,如果期望`grid`只有一列,`columns`参数允许不传入数组而是单列的长度:
#code(
```typ
#show grid: box.with(stroke: green, width: 20pt)
#let grid = grid.with(gutter: 5pt, ..r(3, width: auto))
#grid(columns: (10pt, )) #h(1em)
#grid(columns: 10pt) #h(1em)
#grid(columns: 50%) #h(1em)
#grid(columns: 80%) #h(1em)
```,
scope: g-scope,
)
特别地,columns的默认值可以理解为`auto`。
其二,`grid`不再允许混杂内容与长度来控制某行或某列元素之间的间隔。取而代之的是三个更为复杂的参数:`gutter`、`row-gutter`和`column-gutter`。这是因为“混杂的gutter”在二维布局中有歧义。
`gutter`参数事实上是`spacing`参数的加强版。它允许通过传入一个长度数组为*每行每列依次*设置间隔:
#code(
```typ
#let grid = grid.with(columns: (auto, ) * 4, ..r(15))
#grid(gutter: 5pt) #h(1em)
#grid(gutter: (5pt, 10pt, 15pt)) #h(1em)
```,
scope: (..g-scope, grid: (..args) => box(stroke: green, grid(..args))),
)
特别地,如果`gutter`参数数组比`rows`参数数组或者`columns`参数数组更短,其余行或列的的间隔以`gutter`参数数组的最后一个长度为准:
#code(
```typ
#let grid = grid.with(columns: (auto, ) * 5, ..r(9))
// 等价为`5pt, 5pt, 5pt, ..`, 一直5pt下去
#grid(gutter: 5pt) #h(1em)
// 等价为`5pt, 5pt, 5pt, ..`, 一直5pt下去
#grid(gutter: (5pt,)) #h(1em)
// 等价为`5pt, 10pt, 10pt, ..`, 一直10pt下去
#grid(gutter: (5pt, 10pt)) #h(1em)
```,
scope: (..g-scope, grid: (..args) => box(stroke: green, grid(..args))),
)
你可以指定`column-gutter`而非`gutter`,从而单独为*每列*设置间隔。`column-gutter`参数的优先级比`gutter`参数要高。
#code(
```typ
#let grid = grid.with(columns: (auto, ) * 4, ..r(15))
#grid(gutter: (5pt, 10pt, 15pt)) #h(1em)
#grid(gutter: 5pt, column-gutter: (5pt, 10pt, 15pt)) #h(1em)
#grid(column-gutter: (5pt, 10pt, 15pt)) #h(1em)
```,
scope: (..g-scope, grid: (..args) => box(stroke: green, grid(..args))),
)
与`column-gutter`同理,你也可以指定`row-gutter`而非`gutter`,从而单独为*每行*设置间隔。
与`columns`同理,你可以指定`rows`从而为每行设置高度。但是请注意,Typst对`rows`参数数组的解释方式与`columns`不同,而与`gutter`相同:
#code(
```typ
#show grid: box.with(stroke: green, height: 120pt)
#let grid = grid.with(columns: 2, gutter: 5pt, ..r(7, height: auto))
// 等价为`10pt, 10pt, 10pt, ..`, 一直10pt下去
1: #grid(rows: (10pt, )) #h(1em)
// 等价为`10pt, 20pt, 20pt, ..`, 一直20pt下去
2: #grid(rows: (10pt, 20pt)) #h(1em)
// 等价为`1fr, 2fr, 2fr, ..`, 一直2fr下去
3: #grid(rows: (1fr, 2fr)) #h(1em)
```,
scope: g-scope,
)
// #grid(gutter: (5pt, 10pt)) #h(1em)
== 「间距」
此类函数的概念引自LaTeX,又称胶水函数。一共有两个方向的间距,分别是水平间距与竖直间距。
水平间距(`h`,horizon)不包含内容,而仅仅在布局中占据一定宽度:
#code(```typ
两句话之间间隔`0pt`#h(0pt)两句话之间间隔`0pt` \
两句话之间间隔`5pt`#h(5pt)两句话之间间隔`5pt` \
两句话之间间隔`1em`#h(1em)两句话之间间隔`1em` \
间隔`1fr`#h(1fr)间隔`1fr` \
间隔`1fr`#h(1fr)间隔`...`#h(2fr)间隔`2fr` \
#h(1fr)夹心的`1fr``...`#h(1fr) \
```)
同理竖直间距(`v`,vertical)不包含内容,而仅仅在布局中占据一定高度。插入竖直间距将会导致强制换行。
#code(```typ
1 2 \
1 \ 2 \
1 #v(-1em) 2
```)
== 「空间变换」
一共有三种类型的空间变换,分别是:
- `move`:移动元素。
- `scale`:拉伸元素。
- `rotate`:旋转元素。
它们都*不会影响布局*,且都会*导致强制换行*。
`move`相对于当前位置移动一段距离。
#code(```typ
#rect(inset: 0pt, move(
dx: 6pt, dy: 6pt,
rect(
inset: 8pt,
fill: white,
stroke: black,
[Abra cadabra]
)
))
```)
你可以使用`box`将其改为行内元素行为:
#code(```typ
#let TeX(width) = {
set text(font: "New Computer Modern", weight: "regular")
box(width: width, {
[T]
box(stroke: red, move(dx: -0.2em, dy: 0.22em)[E])
box(stroke: green, move(dx: -0.4em)[X])
})
}
#TeX(2.2em) is a digital typographical systems. \
#TeX(2.1em) is a digital typographical systems.
```)
`scale`可以拉伸元素,且`scale`会导致强制换行:
#code(```typ
#scale(x: 110%)[This is mirrored.]
#box(scale(x: 100%)[This is scaled.]) 1 \
#box(scale(x: 115%)[This is scaled.]) 1
```)
特别地,你可以指定负长度以反转元素:
#code(```typ
#scale(x: -100%)[This is mirrored.]
```)
`rotate`可以旋转元素:
#code(```typ
#rotate(5deg)[This is rotated.]
```)
== 让「空间变换」函数影响布局
虽然内置的`move`等函数不会影响布局,但是你可以通过`box`模拟子元素对父元素的布局影响:
#code(```typ
#let ac(a) = calc.abs(calc.cos(a))
#let ax(a) = calc.abs(calc.sin(a))
#let rot(x,y,a) = .5*(x*(ac(a)-1)+y*ax(a))
#let rotx(body, angle) = context {
let sz = measure(body)
box(stroke: green, inset: (
x: rot(sz.width, sz.height, angle),
y: rot(sz.height, sz.width, angle)),
rotate(body, angle))
}
#lorem(7) This is a #rotx([Vertical],-90deg) word, and #rotx([this],-7deg) is #rotx([skew.],7deg) It also works with #rotx($e^(-x)$,-95deg). #lorem(20)
```)
例子使用了`measure`函数评估子元素的大小,并强行改变子元素的边界框(bounding box)。
== 「绝对定位布局」
你可以使用`place`完成「绝对定位布局」(absolute positioning)。`place`相对于父元素移动一段距离,其接受一个`alignment`参数,将元素放置在相对于父元素`alignment`的绝对位置。例如下例相对于父元素的右上角放置了一个矩形框:
#code(```typ
#box(height: 30pt, width: 100%)[
Hello, world!
#place(
top + right,
square(
width: 20pt,
stroke: 2pt + blue
),
)
]
```)
`place`会使得子元素脱离父元素布局。对比两例:
#code(```typ
#let TeX(width: 2.2em) = {
set text(font: "New Computer Modern", weight: "regular")
box(width: width, {
[T]
box(stroke: red, move(dx: -0.2em, dy: 0.22em)[E])
box(stroke: green, move(dx: -0.4em)[X])
})
}
#TeX() is a digital typographical systems. \
#let TeX = {
set text(font: "New Computer Modern", weight: "regular")
box(width: 1.7em, {
[T]
place(top, dx: 0.56em, dy: 0.22em, box(stroke: red, [E]))
place(top, dx: 1.1em, box(stroke: green, [X]))
})
}
#TeX is a digital typographical systems.
```)
你可以使用`place(float: true)`以创建相对于父元素的浮动布局。(todo)
== 杂项
+ hide
+ repeat
|
https://github.com/cbr9/CV | https://raw.githubusercontent.com/cbr9/CV/main/metadata.typ | typst | Apache License 2.0 | /* Personal Information */
#let firstName = "Andrés"
#let lastName = "<NAME>"
#let personalInfo = (
github: "cbr9",
phone: "+4917684048732",
email: "<EMAIL>",
linkedin: "andres-cabero-busto",
//gitlab: "mintyfrankie",
//homepage: "jd.me.org",
//orcid: "0000-0000-0000-0000",
//researchgate: "John-Doe",
//extraInfo: "",
)
/* Language-specific */
// Add your own languages while the keys must match the varLanguage variable
#let headerQuoteInternational = (
"": [ML Engineer specialized in Natural Language Processing (NLP) and Automatic Speech Recognition (ASR)],
"en": [ML Engineer specialized in Natural Language Processing (NLP) and Automatic Speech Recognition (ASR)],
"es": [Ingeniero de ML especializado en procesamiento del lenguaje natural (NLP) y reconocimiento del habla (ASR)],
"de": [ML-Ingenieur, spezialisiert auf natürliche Sprachverarbeitung (NLP) und automatische Spracherkennung (ASR)]
)
#let cvFooterInternational = (
"": "Curriculum vitae",
"en": "Curriculum vitae",
"es": "Curriculum vitae",
"de": "Lebenslauf"
)
#let letterFooterInternational = (
"": "Cover Letter",
"en": "Cover Letter",
"es": "Carta de motivación",
"de": ""
)
/* Layout Setting */
#let awesomeColor = "red" // Optional: skyblue, red, nephritis, concrete, darknight
#let profilePhoto = "../src/avatar.jpg" // Leave blank if profil photo is not needed
#let varLanguage = "" // INFO: value must matches folder suffix; i.e "zh" -> "./modules_zh"
#let varEntrySocietyFirst = false // Decide if you want to put your company in bold or your position in bold
#let varDisplayLogo = true // Decide if you want to display organisation logo or not
|
https://github.com/adam-zhang-lcps/papers | https://raw.githubusercontent.com/adam-zhang-lcps/papers/main/c3edit-sr-research-paper.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #let name = [c#super[3]edit]
#let title = [#name: a software framework for real-time cross-editor collaborative editing]
#set document(
title: title,
author: "<NAME>",
date: datetime.today(),
)
#set page(paper: "us-letter")
#set text(font: "New Computer Modern")
#align(center)[
#title
]
= Abstract
Most programmers have editors that they strongly prefer to use over others. With the wide array of choice available within the code editor ecosystem, it is natural that there is a wide variety of code editors in use, with differing levels of specialization, customizability, power, robustness, extensibility, and ease-of-use. While this is no problem for writing and sharing code through other tools such as Git, it means that live cross-editor collaborative editing is impossible. Many editors have live collaborative editing features available, but such solutions only work across the same editor, making it difficult for a team of diverse programmers to utilize together. Thus, just like how collaboration via Git is possible via an external program, I aim to build an external program capable of communication with various thin front-ends implemented for each editor to allow for cross-editor live collaborative editing.
= Problem
Most programmers have editors that they strongly prefer to use over others. With the wide array of choice available within the code editor ecosystem, it is natural that there is a wide variety of code editors in use, with differing levels of specialization, customizability, power, robustness, extensibility, and ease-of-use. The large variety of editors in use means that real-time collaborative editing is usually not an option for team programming, since there is no way to engage in live editing across editors.
= Background
As programming grows ever more ubiquitous in modern society, the need for collaboration tools for teams increases as well. One method of collaboration is real-time collaborative editing (RTCE), which allows for multiple team members to work on the same code together in a synchronous manner. While many solutions for RTCE already exist, these solutions are tied to a specific editor, requiring all team members to be using the same editor for programming. According to the 2024 Stack Overflow Developer Survey, there is a large variety of editors in use by programmers @StackOverflow2024:StackOverflowDeveloperSurvey. Thus, diverse teams are unable to take advantage of RTCE as a tool for collaboration. To solve this, this paper details a new framework, #name, allowing for cross-editor RTCE.
= Significance
Computer science is becoming an increasingly broad field in the modern digital landscape, with more and more people learning programming. As teams grow, new tools will be needed to advance the ability to collaborate. One area that is currently lacking is real-time collaborative editing for teams with members who prefer to work in different editors. Thus, #name will provide tooling in a novel area to help diverse teams collaborate in a new dimension.
= Current Research and Development
The topic of collaborative editing is well-studied by many researchers, and many solutions already exist, such as Microsoft's "Live Share" @Microsoft2024:VisualStudioLiveShare and Zed's built-in functionality @Zed2024:Zed. While the technology is well-understood, none of these options offer a cross-editor solution, which is a critical requirement for usage in diverse teams. The only cross-editor solution I found is Tandem @Team2018:Tandem. However, it appears to be an abandoned project and has a complex architecture that I believe I can improve upon.
= Objectives
- A fully-functioning cross-platform (Windows, Mac, Linux) backend executable capable of interfacing with an arbitrary frontend via standard in/out and communicating with other backends over a network.
- Capable of intelligently managing connections (adding and removing peers) and documents (adding and removing files).
- Resilient to network instability (high ping and packet loss).
- Three fully-functioning frontend implementations for Emacs, Neovim, and Visual Studio Code, capable of utilizing all features of the backend.
- A clear specification for the frontend-backend communication protocol to allow independent developers to implement support for new editors.
- Clear documentation for end users to install, setup, and use the framework to partake in real-time collaborative editing.
= Management Draft
/ October 31: functioning and UX-ready framework implementation in Emacs.
/ November 30: functioning protocol implementation in VSCode.
/ December 9: functioning demonstration of real-time collaboration between two Emacs clients and one VSCode client.
/ December 31: finalize v1.0 of backend-frontend protocol and complete formal specification.
/ January 31: functioning protocol implementation in Neovim.
/ March 31: general cleanup: advance VSCode and Neovim implementations to UX-ready, squash bugs, implement proper error handling and recovery, increase resilience to network instability, implement user flow for connection management.
#pagebreak()
#bibliography("refs.bib", style: "apa", title: [References])
|
https://github.com/Skimmeroni/Appunti | https://raw.githubusercontent.com/Skimmeroni/Appunti/main/Matematica4AI/LinAlg/Bases.typ | typst | Creative Commons Zero v1.0 Universal | #import "../Math4AI_definitions.typ": *
Let ${underline(v_(1)), underline(v_(2)), dots, underline(v_(n))}$ be a
set of $n$ vectors of a vector space $V$, and let $lambda_(1), lambda_(2),
dots, lambda_(n)$ be $n$ real numbers (not necessarely distinct). Every
summation defined as such:
$ sum_(i = 1)^(n) lambda_(i) underline(v_(i)) =
lambda_(1) underline(v_(1)) + lambda_(2) underline(v_(2)) + dots +
lambda_(i) underline(v_(i)) + dots + lambda_(n) underline(v_(n)) $
Is called a *linear combination* of the vectors ${underline(v_(1)),
underline(v_(2)), dots, underline(v_(n))}$, with $lambda_(1), lambda_(2),
dots, lambda_(n)$ as *coefficients*.
A set of vectors ${underline(v_(1)), underline(v_(2)), dots,
underline(v_(n))}$ is said to be *linearly independent* if the
only linear combination of such vectors that equals the null
vector is the one that has $0$ as every coefficient. If there
exists a linear combination of such vectors that is equal to the
null vector and that has at least a non-zero coefficient, those
vectors are said to be *linearly independent*.
#theorem[
Let ${underline(v_(1)), underline(v_(2)), dots, underline(v_(n))}$ be a
set of $n$ vectors of a vector space $V$. If those vectors are linearly
dependent, there exists at least one vector of such set that can be
expressed as a linear combination of the remaining vectors, and vice
versa.
]
#proof[
If such set of vectors is linearly dependent, there must exist a linear
combination of the set that equals the null vector, be it:
$ sum_(i = 1)^(n) lambda_(i) underline(v_(i)) =
lambda_(1) underline(v_(1)) + lambda_(2) underline(v_(2)) + dots +
lambda_(j) underline(v_(j)) + dots + lambda_(n) underline(v_(n)) =
underline(0) $
Where there's at least a non-zero coefficient. Let's assume, without
loss of generality, that the $j$-th coefficient is non-zero (whether
such coefficient is the only one to be non-zero is irrelevant). The
product of such coefficient with the corresponding vector can be
moved to the right side of the equation like so:
$ lambda_(1) underline(v_(1)) + lambda_(2) underline(v_(2)) + dots +
lambda_(n) underline(v_(n)) = -lambda_(j) underline(v_(j)) $
Dividing both sides by $-lambda_(j)$ gives:
$ -frac(lambda_(1), lambda_(j)) underline(v_(1))
- frac(lambda_(2), lambda_(j)) underline(v_(2)) - dots
- frac(lambda_(n), lambda_(j)) underline(v_(n)) = underline(v_(j)) $
Each $-frac(lambda_(i), lambda_(j))$ is itself a real number, and
therefore the expression above is a linear combination that is equal
to a vector of the set.
On the other hand, assume that the $j$-th vector of the set is equal
to a linear combination of the remaining vectors like so:
$ lambda_(1) underline(v_(1)) + lambda_(2) underline(v_(2)) + dots +
lambda_(n) underline(v_(n)) = underline(v_(j)) $
Moving $underline(v_(j))$ to the left gives:
$ lambda_(1) underline(v_(1)) + lambda_(2) underline(v_(2)) + dots
+ (-1)underline(v_(j)) + dots + lambda_(n) underline(v_(n)) =
underline(0) $
Since $-1$ is a real number, the expression on the left side of the
equation is indeed a linear combination of the whole set, that is
equal to the null vector.
]
#exercise[
Consider the vector space $RR^(2)$. Check if the vectors
$underline(v_(1)) = mat(1; 0)$ and $underline(v_(2)) = mat(1; 1)$
are linearly independent or linearly dependent.
]
#solution[
Consider such linear combination:
$ lambda_(1) mat(1; 0) + lambda_(2) mat(1; 1) = mat(0; 0) $
To test whether $underline(v_(1))$ and $underline(v_(2))$ are linearly
dependent or independent, it suffices to solve this system of equations:
$ lambda_(1) mat(1; 0) + lambda_(2) mat(1; 1) = mat(0; 0) =>
mat(lambda_(1); 0) + mat(lambda_(1); lambda_(2)) = mat(0; 0) =>
mat(2 lambda_(1); lambda_(2)) = mat(0; 0) =>
cases(2 lambda_(1) = 0, lambda_(2) = 0) =>
cases(lambda_(1) = 0, lambda_(2) = 0) $
Since the only solution to such system is $lambda_(1) = 0,
lambda_(2) = 0$, $underline(v_(1))$ and $underline(v_(2))$
are linearly independent.
]
#exercise[
Consider the vector space $RR^(2)$. Check if the vectors
$underline(v_(1)) = mat(1; 0)$, $underline(v_(2)) = mat(1; 1)$
and $underline(v_(3)) = mat(2; 0)$ are linearly independent or
linearly dependent.
]
#solution[
Consider such linear combination:
$ lambda_(1) mat(1; 0) + lambda_(2) mat(1; 1) + lambda_(3) mat(2; 0) =
mat(0; 0) $
To test whether $underline(v_(1))$, $underline(v_(2))$ and
$underline(v_(3))$ are linearly dependent or independent,
it suffices to solve this system of equations:
$ lambda_(1) mat(1; 0) + lambda_(2) mat(1; 1) +
lambda_(3) mat(2; 0) = mat(0; 0) =>
cases(lambda_(1) + lambda_(2) + 2 lambda_(3) = 0, lambda_(2) = 0) =>
cases(lambda_(1) = -2 lambda_(3), lambda_(2) = 0) $
Since there are infinite solutions to such system, including non-zero
solutions, $underline(v_(1))$, $underline(v_(2))$ and $underline(v_(3))$
are linearly dependent. For example, setting $lambda_(1) = 1$ results in:
$ 1 mat(1; 0) + 0 mat(1; 1) -frac(1, 2) mat(2; 0) = mat(0; 0) $
Which is, indeed, a correct identity.
]
A set of vectors $S = {underline(s_(1)), dots, underline(s_(n))}$ of a vector
space $V$ is said to *generate* $V$ if every vector of $V$ can be written as
a linear combination of the vectors in $S$. That is to say, $S$ generates $V$
if for every $underline(v) in V$ there exist a set of coefficients $lambda_(1),
dots, lambda_(n)$ such that:
$ underline(v) = sum_(i = 1)^(n) lambda_(i) underline(s_(i)) =
lambda_(1) underline(s_(1)) + dots + lambda_(n) underline(s_(n)) $
#theorem[
Let $S$ be a set of vectors of a vector space $V$ that can generate $V$.
Let $underline(w) in V$ be a random vector of $V$. The set of vectors
$S union {underline(w)}$ is linearly dependent.
]
#proof[
If $S$ can generate $V$ and $underline(w)$ belongs to $V$, there exists a
linear combination of the vectors in $S$ such that:
$ underline(w) = sum_(i = 1)^(n) lambda_(i) underline(s_(i)) =
lambda_(1) underline(s_(1)) + dots + lambda_(n) underline(s_(n)) $
Moving $underline(w)$ to the right side of the equation gives:
$ underline(0) = (-1) underline(w) + lambda_(1) underline(s_(1)) + dots +
lambda_(n) underline(s_(n)) $
The expression on the right side of the equation is indeed a linear
combination of $S union {underline(w)}$, that is equal to the null
vector. Since at least $-1$ is a non zero coefficient, such set
is linearly dependent.
]
A set of vectors that can generate a vector space and is itself linearly
independent is called a *basis* for such vector space. The cardinality of
a basis is called the *dimension* of the corresponding vector space. If a
vector space contains just the null vector, such vector space is said to
have dimension $0$.
#theorem[
A basis of a vector space has the minimum cardinality out of every set
of vectors that can generate it. In other words, if a basis of a vector
space has cardinality $n$, at least $n$ vectors are needed to generate
such space.
]
// #proof[
// To be added
// ]
#exercise[
Consider the vector space $PP_(2)$. Knowing that the sets $cal(B)_(1)
= {1, x, x^(2)}$ and $cal(B)_(2) = {(x + 1), (x - 1), x^(2)}$ are both
bases for $PP_(2)$, write the polynomial $p(x) = 3x^(2) + 2x - 5$ as a
linear combination of each.
]
#solution[
It's trivial to see that, for the first basis, such linear combination
is $p(x)$ itself:
$ lambda_(0) 1 + lambda_(1) x + lambda_(2) x^(2) = -5 + 2x + 3x^(2) =>
cases(lambda_(0) = -5, lambda_(1) = 2, lambda_(2) = 3) $
Regarding the second basis, it can be rewritten as:
$ lambda_(0) (x + 1) + lambda_(1) (x - 1) +
lambda_(2) x^(2) => lambda_(0) x + lambda_(0) +
lambda_(1) x - lambda_(1) + lambda_(2) x^(2) =>
(lambda_(0) - lambda_(1)) + (lambda_(0) + lambda_(1))x +
lambda_(2) x^(2) $
Equating it term by term:
$ (lambda_(0) - lambda_(1)) + (lambda_(0) + lambda_(1))x +
lambda_(2) x^(2) = -5 + 2x + 3x^(2) =>
cases(lambda_(0) - lambda_(1) = -5,
lambda_(0) + lambda_(1) = 2,
lambda_(2) = 3) =>
cases(lambda_(0) = -frac(3, 2),
lambda_(1) = frac(7, 2),
lambda_(2) = 3) $
Therefore:
$ 3x^(2) + 2x - 5 = -frac(3, 2) (x + 1) + frac(7, 2) (x - 1) + 3x^(2) $
]
The basis of a vector space that renders calculations the most "comfortable"
is called the *canonical basis* for such vector space. Such basis is different
from vector space to vector space.
#exercise[
Determine the dimension of $RR^(n)$
]
#solution[
Consider any $n$-dimensional vector of coordinates $a_(1), a_(2), dots,
a_(n)$. It's easy to see that such vector is equal to the following linear
combination:
$ mat(a_(1); a_(2); dots; a_(n)) = a_(1) mat(1; 0; dots; 0) +
a_(2) mat(0; 1; dots; 0) + dots + a_(n) mat(0; 0; dots; 1) $
A set containing such vectors in linearly independent. Infact:
$ lambda_(1) mat(1; 0; dots.v; 0) +
lambda_(2) mat(0; 1; dots.v; 0) + dots +
lambda_(n) mat(0; 0; dots.v; 1) = mat(0; 0; dots.v; 0) =>
cases(
lambda_(1) + 0 + dots + 0 = 0,
0 + lambda_(2) + dots + 0 = 0,
dots.v,
0 + 0 + dots + lambda_(n) = 0)
=> cases(
lambda_(1) = 0,
lambda_(2) = 0,
dots.v,
lambda_(n) = 0) $
This set of vectors is linearly independent and can generate $RR^(n)$,
therefore it's a basis for $RR^(n)$. The dimension of $RR^(n)$ is then
$n$, since such set has cardinality $n$. In particular, this specific
basis is the canonical basis for $RR^(n)$.
]
#exercise[
Determine the dimension of $PP_(n)$
]
#solution[
Consider any polynomial of degree at most $n$ having real coefficients:
$ a_(n) x^(n) + a_(n - 1) x^(n - 1) + dots + a_(1) x + a_(0) $
Each monomial of such polynomial are itself polynomials of degree at
most $n$ having real coefficients. Therefore, the polynomial itself
can be seen as a linear combination of the polynomials ${x^(n), x^(n -1),
dots, x^(1), x^(0)}$ with coefficients $a_(n), a_(n - 1), dots, a_(1),
a_(0)$.
Such set of vectors is linearly independent. Infact:
// Proof missing
This set of vectors is linearly independent and can generate $PP_(n)$,
therefore it's a basis for $PP_(n)$. The dimension of $PP_(n)$ is then
$n + 1$, since such set has cardinality $n + 1$. In particular, this
specific basis is the canonical basis for $PP_(n)$.
]
As stated, any vector can be expressed as a matrix composed by
the coefficients of the linear combination of a basis. In general,
a vector space has more than one basis, and for each basis the
representation is most likely different. Nevertheless, each
representation is connected with the others through a simple
matrix multiplication.
#theorem[
Let $V$ be a vector space, and let $cal(B) = {underline(b_(1)),
underline(b_(2)), dots, underline(b_(n))}$ and $cal(B') =
{underline(b'_(1)), underline(b'_(2)), dots, underline(b'_(n))}$
be two bases of $V$. Any generic vector $underline(x) in V$, can
be represented with respect to both bases:
#grid(
columns: (0.5fr, 0.5fr),
[$ underline(x) <=> mat(x_(1); x_(2); dots.v; x_(n))_(cal(B)) $],
[$ underline(x) <=> mat(x'_(1); x'_(2); dots.v; x'_(n))_(cal(B')) $]
)
There exists an invertible matrix $P$, independent of $underline(x)$,
such that:
#grid(
columns: (0.5fr, 0.5fr),
[$ mat(x_(1); x_(2); dots.v; x_(n)) =
P mat(x'_(1); x'_(2); dots.v; x'_(n)) $],
[$ mat(x'_(1); x'_(2); dots.v; x'_(n)) =
P^(-1) mat(x_(1); x_(2); dots.v; x_(n)) $])
] <Basis-change-is-matrix-multiplication>
#proof[
Being both bases constituted by vectors of the same vector space, it is
possible to express the elements of $cal(B')$ as linear combinations of
the elements of $cal(B)$:
$ cases(
underline(b'_(1)) = p_(1, 1) underline(b_(1)) +
p_(1, 2) underline(b_(2)) + dots + p_(1, n) underline(b_(n)) =
sum_(j = 1)^(n) p_(1, j) underline(b_(j)),
underline(b'_(2)) = p_(2, 1) underline(b_(1)) +
p_(2, 2) underline(b_(2)) + dots + p_(2, n) underline(b_(n)) =
sum_(j = 1)^(n) p_(2, j) underline(b_(j)),
dots.v,
underline(b'_(n)) = p_(n, 1) underline(b_(1)) +
p_(n, 2) underline(b_(2)) + dots + p_(n, n) underline(b_(n)) =
sum_(j = 1)^(n) p_(n, j) underline(b_(j))) $
Therefore:
$ underline(x) =
sum_(j = 1)^(n) x'_(j) underline(b'_(j)) =
sum_(j = 1)^(n) x'_(j) sum_(i = 1)^(n) p_(j, i) underline(b_(i)) =
sum_(i = 1)^(n) x_(i) underline(b_(i)) $
By comparing the third and fourth members of the equality term by term:
$ x_(i) = sum_(j = 1)^(n) p_(i, j) x'_(j) =>
mat(x_(1); x_(2); dots.v; x_(n)) =
mat(
p_(1, 1), p_(1, 2), dots, p_(1, n);
p_(2, 1), p_(2, 2), dots, p_(2, n);
dots.v, dots.v, dots.down, dots.v;
p_(n, 1), p_(n, 2), dots, p_(n, n))
mat(x'_(1); x'_(2); dots.v; x'_(n)) =
P mat(x'_(1); x'_(2); dots.v; x'_(n)) $
Of course, it is also possible to go the other way around, expressing the
elements of $cal(B)$ as linear combinations of the elements of $cal(B')$:
$ cases(
underline(b_(1)) = q_(1, 1) underline(b'_(1)) +
q_(1, 2) underline(b'_(2)) + dots + q_(1, n) underline(b'_(n)) =
sum_(j = 1)^(n) q_(1, j) underline(b'_(j)),
underline(b_(2)) = q_(2, 1) underline(b'_(1)) +
q_(2, 2) underline(b'_(2)) + dots + q_(2, n) underline(b'_(n)) =
sum_(j = 1)^(n) q_(2, j) underline(b'_(j)),
dots.v,
underline(b_(n)) = q_(n, 1) underline(b'_(1)) +
q_(n, 2) underline(b'_(2)) + dots + q_(n, n) underline(b'_(n)) =
sum_(j = 1)^(n) q_(n, j) underline(b'_(j))) $
Therefore:
$ underline(x) =
sum_(j = 1)^(n) x_(j) underline(b_(j)) =
sum_(j = 1)^(n) x_(j) sum_(i = 1)^(n) q_(j, i) underline(b'_(i)) =
sum_(i = 1)^(n) x'_(i) underline(b'_(i)) $
By comparing the third and fourth members of the equality term by term:
$ x'_(i) = sum_(j = 1)^(n) q_(i, j) x_(j) =>
mat(x'_(1); x'_(2); dots.v; x'_(n)) =
mat(
q_(1, 1), q_(1, 2), dots, q_(1, n);
q_(2, 1), q_(2, 2), dots, q_(2, n);
dots.v, dots.v, dots.down, dots.v;
q_(n, 1), q_(n, 2), dots, q_(n, n))
mat(x_(1); x_(2); dots.v; x_(n)) =
Q mat(x_(1); x_(2); dots.v; x_(n)) $
Substituting the one in the expression of the other gives:
#grid(
columns: (0.5fr, 0.5fr),
[$ mat(x_(1); x_(2); dots.v; x_(n)) =
P mat(x'_(1); x'_(2); dots.v; x'_(n)) =
P Q mat(x_(1); x_(2); dots.v; x_(n)) $],
[$ mat(x'_(1); x'_(2); dots.v; x'_(n)) =
Q mat(x_(1); x_(2); dots.v; x_(n)) =
Q P mat(x'_(1); x'_(2); dots.v; x'_(n)) $])
Since the two matrices on the edges of the equalities are the same,
for these equalities to hold both matrix products $P Q$ and $Q P$
must be equal to the identity matrix. In other words, $P$ and $Q$
are the inverse of each other, therefore:
#grid(
columns: (0.5fr, 0.5fr),
[$ mat(x_(1); x_(2); dots.v; x_(n)) =
P mat(x'_(1); x'_(2); dots.v; x'_(n)) $],
[$ mat(x'_(1); x'_(2); dots.v; x'_(n)) =
P^(-1) mat(x_(1); x_(2); dots.v; x_(n)) $])
]
// ADD AN EXAMPLE
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/044%20-%20Innistrad%3A%20Crimson%20Vow/008_The%20Devouring%20House.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Devouring House",
set_name: "Innistrad: Crimson Vow",
story_date: datetime(day: 19, month: 11, year: 2021),
author: "<NAME>",
doc
)
<NAME> had been lucky in his fall: any one of the wooden stakes lining the pit could have pierced him—could have killed him. But he had been bent down looking for the next set of tracks, his cloak gathered around him, and when he'd landed, he'd struck several stakes at once, nearly simultaneously. His cloak was ruined, pierced and torn, and he had a wound in his side, another on his thigh, a third, shallower, along his arm. He was in pain, but at least he hadn't been speared wriggling like an insect on a pin. Yes, he'd been very lucky.
Panting and groaning, he forced his way up and off the stakes. He pushed at the stakes closest to him until they broke or bent to the side and he had a safe place to stand. Up above, he could hear Brandt scurrying about, setting angelic symbols at each corner of the pit. These were clumsily repaired, the stone cemented back together, but they had been blessed: Strefan could feel that. Despite the angel's absence from this Plane, they still made him feel a hint of the old paralyzing fear. But Brandt should have known enough to realize no angel would lend him succor. Not anymore.
#figure(image("008_The Devouring House/01.jpg", width: 100%), caption: [Strefan, Maurer Progenitor | Art by: <NAME>], supplement: none, numbering: none)
#emph[The fool] , thought Strefan contemptuously. The vampire hunter could simply have rushed the pit the moment Strefan fell in and jabbed at him with a long spear from above until he was dead. But Brandt's faith in his own trap was too great, and his faith in the holy was even greater.
"You're mine, fiend!" snarled Brandt leaning over the edge of the pit, his last symbol in place. "At last!"
"Fiend?" Strefan said, talking to buy time. He groped blindly behind him and began to worry the stake there, slowly working it free from the ground. "I'm a better sort of man, Brandt, one who has outrun death. Compared to me, you're a mere beast. Surely you can't believe you could defeat me so easily."
He had the stake loose now. He brought it around, just as Brandt drew back a hand containing a gleaming object and threw it at him. Strefan, more out of reflex than anything else, batted it away with the stake. The glass vial that had been speeding for his head shattered, and he was spattered with the blessed water it contained.
Even without the angel, the water still held some power. He screamed as he felt his exposed skin burn. As he tried desperately to wipe the fluid away, he could smell his flesh cooking. Had the vial hit him squarely, had it not been largely deflected by the stake, he would be writhing, close to death, an easy target.
Despite the pain, he still had the presence of mind to hurl his stake hard at Brandt like a spear, and he was pleased to hear the hunter bellow as it connected and see him vanish from view.
Quickly, Strefan struggled to the pit's edge, snapping stakes, and with one mighty heave, clambered free. No mere symbols could hold him, not in these times.
Brandt was gone, but the stake lay on the frost-bitten leaves, its sharp tip slick with blood. He licked it clean.
He could smell blood in the air, could hear the galloping of Brandt's horse. Bloodlust rising, he rose into the air and rushed in pursuit.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Twice as Brandt rode along the path, Strefan lunged at him to knock him from his horse. The first time, Brandt managed to shake him off and swing him into a passing tree. The second, Strefan sunk his claws into Brandt's arm and lunged for his neck when the man thrust a dirk into his bicep and he was forced to fall back. But Brandt's horse was tiring and so, clearly, was Brandt. Strefan grinned. Brandt was an old man now, shackled to mortal flesh in a way that Strefan no longer was. #emph[Be patient] , Strefan reminded himself, #emph[hunt wisely and hunt well, and soon you'll have your prey.]
Without warning, they reached the edge of the forest. Brandt pounded across the barren, snow-crusted steppe. It was as if the man had experienced a new burst of energy, and Strefan struggled to keep up. Brandt whipped his horse and shouted, and now Strefan could smell the blood of both beast and man as, hell for leather, they barreled ahead.
The horse stumbled and nearly went down but managed somehow to retain its footing. Brandt kept madly whipping it, didn't even slow.
On the other side of the plain was a pile of rocks. Brandt seemed to be making for this. Strefan kept as close as he could, watching for his opening. Brandt was running his horse as fast as it would go, cutting its sides now with the little dirk he had jabbed Strefan with. If he rode much farther, the horse would be dead.
#emph[Not just a heap of rocks] , Strefan had just enough time to notice as they came very close indeed: #emph[a ruin.] And then the horse stumbled and went down for good, throwing Brandt. He rolled when he hit and was, almost immediately, up and running, his feet crunching through the snow. Hissing with pleasure, Strefan rushed after him.
He reached Brandt just as the man darted into the ruin itself. When Strefan groped for him, Brandt turned and slashed again with the dirk. Strefan dodged that slash, only to realize belatedly that it had been a ruse: there was another, longer blade in Brandt's other hand, and this blade tore through his shirt and slashed the muscles of his chest. Strefan cursed and, dizzy with pain, fell back.
He expected Brandt to press his advantage, but instead, the hunter did something entirely unexpected. Smiling all the while, he turned the dirk's blade toward himself and slit his own throat from ear to ear.
Brandt collapsed to the ground, blood gushing from his neck, leaving Strefan appalled. He felt that something had been stolen from him: this should have been #emph[his] kill. He shook his head, uneasy. It was incomprehensible for Brandt to do this. Why had he?
#figure(image("008_The Devouring House/02.jpg", width: 100%), caption: [Depraved Harvester | Art by: <NAME>], supplement: none, numbering: none)
Now that the battle was over, Strefan began to feel the full extent of his wounds. Carefully, he tore his cloak into strips and bound his side, his thigh, his arm. Then he took stock. He needed blood, and he needed it quickly.
As the vampire hunter's blood pooled on the floor, Strefan fell to his knees and desperately lapped at it. Or at least he tried: something very strange was happening. The blood was no longer pooling; it was vanishing into the stones of the ruin, almost as if being swallowed. Soon, not a drop remained. Stranger still, where before there had been the disordered stones of a collapsed ruin, now walls had sprung up around him. He found himself in a mansion that felt vibrant and alive. Rich tapestries covered the walls, a dining table dressed with a rich feast occupied the center of the room, torches danced with a flickering light in their sconces. It looked vaguely familiar to him. Had he been here before?
He thrust the question aside. Slowly, Strefan backed away from the now white and bloodless corpse. Brandt must have been leading him here the whole time. The pit trap must have been a mere waypoint, a means of coaxing Strefan to pursue him to this place without arousing suspicion. This had been Brandt's real trap, his final one.
And Strefan had fallen deeply into it.
He stared at the house that had risen around him. #emph[This is not real] , he told himself, #emph[this is not real.] And yet, it #emph[felt] real. He could feel it around him, palpable and solid.
He did not know what was happening. This was nothing he knew or understood. Brandt must have made some sort of bargain with a demon, or with the house, or with both, and had sealed that bargain with his own blood. What sort of forbidden arts had Brandt delved into, what sort of damnation had he condemned himself to, all so as to wreak vengeance on Strefan? Could this be a blood magic more arcane than anything Strefan himself knew?
He approached the door and reached for its handle. It was there, palpable in his grip, but he couldn't make it turn. He tried, but something held it firmly closed. #emph[No] , he told himself, #emph[this is an illusion: there is no door here at all.] And yet it felt like there #emph[was] a door. When he pushed on it, he heard the wood creak and groan in protest. He pushed harder, then harder still, and then, abruptly, his hands slipped through as if passing through empty air. He fell through the door and into a gray, empty mist, and then found himself lying on the floor of the dining hall, back where he had started.
He stood and approached the door again. This time he braced himself as he pushed, increasing the pressure until once again his hands slipped through and he was engulfed in that same gray mist. He walked tentatively through this, seeing nothing, unable to see even his own hands, until he glimpsed a distant light. He hurried toward this. A moment later, he was back in the dining hall, the door to his back, as if he had just walked in.
He was trapped. Brandt had finally managed it. He stared at the corpse on the floor. What had the hunter's obsession with him been? Why had he pursued Strefan for so many years? There was so much he didn't know about the hunter, so much shrouded in mystery.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Strefan's first encounter with Brandt had come decades before while he was masquerading as human, passing casually through a village searching for prey. He had hardly spared the tow-headed young man watching him a second glance—returning anyone's gaze too avidly would only weaken the power of his glamer. But suddenly, the young man began hollering that there was a vampire in their midst and rushed Strefan with a spear made of fire-hardened ash. It was a clumsy attack, and easily parried, but now other villagers were staring as well, reaching for weapons or grasping their damaged holy symbols. Strefan, irritated, had swiped at Brandt, tearing free part of his ear, marking him, but there were too many villagers, and he had no choice but to flee. Not only was his night's hunt ruined: the village remained on alert and unapproachable for months after.
He'd been pursued by Brandt in the years that had followed until, suddenly, two years ago, Brandt had disappeared—perhaps killed by another vampire, Strefan had guessed. But tonight, when he had taken his usual turn through the village of Shadowgrange, he had heard a clattering of hooves. A moment later, a rider rushed past on a dark, slavering steed, its eyes red and rolling. The few people still on the streets at that hour leaped out of its path. Horse and rider were there just for a moment and then gone, but in that brief instant, the rider turned and caught Strefan's eye. It was a face he was all too familiar with. That gnarled lump of ear, that cruel mien: Brandt.
He tensed, expecting Brandt to rein up and come after him, but the man just galloped on. Either Brandt hadn't seen him or he had somewhere more important to be, someone else to pursue.
It was probably a trap, Strefan knew. It did not pay to underestimate the man. But for the vampire hunter to vanish for several years and then suddenly reappear in this way, as if by chance? This would be his best opportunity in years to do away with Brandt once and for all. He couldn't resist.
Feeling the thrill of the hunt, Strefan had set off in pursuit.
#figure(image("008_The Devouring House/03.jpg", width: 100%), caption: [Path of Peril | Art by: Kasia 'Kafis' Zielińska], supplement: none, numbering: none)
He shuddered. How long had he been standing in the house's foyer? It felt like mere seconds, but he felt weaker, as if hours had passed, as if some vital force had seeped out of him. He needed to feed. He needed, above all, to #emph[leave] .
He was jolted from these reflections when he thought he saw Brandt's fingers twitch. Not much, just barely, just enough to make him mistrust that he was seeing it. It could just be his imagination. Was it?
He stared, kept his eyes locked on the fingers. Yes, there it was again, unmistakable this time, they #emph[had] moved. He was sure of it.
Or, at least, almost sure~
He shook his head. #emph[Impossible] , he told himself. The vampire hunter had been bled dry: he was dead.
He was still thinking this when the body lurched to its feet.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Alarmed, confused, Strefan turned to flee, but the door still wouldn't open for him. There was nowhere to go.
Swaying, Brandt stumbled clumsily toward him. He favored one leg and dragged the other, as if he wasn't entirely adept at operating his body anymore. His eyes, too, darted independently in their sockets. It seemed that Brandt could see him—caught hints of his movements anyway—but his eyes wouldn't focus. With a simple feint, Strefan easily avoided him.
At least at first. After a few turns around the great hall, Brandt was becoming more coordinated, as if he had learned how his body worked again, and became harder to escape.
Finally, Brandt's eyes did focus. He met Strefan's gaze, and Strefan saw that the light in them was all wrong. This wasn't Brandt anymore, but something else. Something worse.
"Who are you?" he found himself asking, before he could stop himself.
At first Brandt didn't answer. The pair continued their idle shuffle. Then Brandt parted his lips and pursued him with his mouth gaping. Sounds began to leak out, but they weren't words at all. They were the sounds that animals made: the whining of a dog, the squealing of a boar, the yipping of a wolf, the childlike screams of a dying rabbit. All sounds of animals in pain and dying, their last cry. #emph[Where has it collected such cries?] Strefan wondered, and then realized he knew, could feel it radiating from the walls that had sprung up around him. These were the sounds of the creatures that this thing, whatever it was, had lured to this place. The beings it had trapped and fed upon.
Just like him.
"Who are you?" Strefan asked again. He was, suddenly, more frightened than he'd been in centuries.
The body opened its mouth again, but this time there were no animal cries. He heard instead the scream of a baby abandoned to die in the cold. The voice deepened, slowed, became less a scream than a moan, and then faded and dropped to become the voice of an adult male. But it was not Brandt's voice at all: it was the wrong timbre, the wrong tone. The sound was enough to make Strefan's skin prickle, despite all he had seen over the years, despite all he had done.
"Please!" cried the voice, just barely human. "Don't kill me! I'll do anything for you, anything you want!"
And then the voice descended into the gurgles of a throat filling with blood. A dying man.
The body was coming closer now, nearly catching him at each revolution. Strefan had to be very careful. He kept the table between them, and for a time, they circled it, and then the creature simply waded through the wood as if the table wasn't there at all. It came directly for him. Strefan scurried out of the way.
How long could he keep evading it? Would it never grow tired?
"Who are you?" he cried for the third time. Though, he realized, perhaps a better question was not who but #emph[what] .
This time dead not-Brandt stopped stock-still. He then lifted his left hand and brought it to his chest and, in a way Strefan could not understand, forced the hand deep enough into his own chest to touch his heart.
He brought out a finger slick with thick arterial blood and began to write on the wall beside him. #emph[Hlad ] he wrote, and then reached back inside for more blood~#emph[vora] , he finished. #emph[Hladvora] .
"Hladvora?" said Strefan aloud. It was not a word he knew, suggested nothing to him. But hearing its name, if a name was what it was, the creature leaped at him, its mouth suddenly filled with row upon row of sharp, needlelike teeth. It was still slightly awkward in this body, but less so now: it was transforming the flesh to make it something it wanted to inhabit. The legs had stretched, becoming more birdlike, the mouth had changed, the face itself had broadened, the eyes drifting to the sides.
Strefan drove it back. He chopped it in the throat and nearly lost fingers to its teeth. It came at him again, and he flung a chair at it, and the chair, solid as it had been when Strefan touched it, passed through the creature as if chair or creature or both did not exist.
The creature stalked him, coming closer, trying to corner him. And then it struck, narrowly missing him and losing its balance, shambling forward. He sidestepped it and hammered it on the back of the head with both fists, bringing it crashing down. He was on top of it now, his hands wrapped around its throat, the creature still gnashing its many rows of teeth, trying to bite his hands, as he held on tightly and tried to strangle the life out of it.
And then, as suddenly as it had sprung to life, it went slack. The eyes were dead and staring and didn't blink. For a moment, Strefan kept choking it, feeling this must be some kind of trick, but it was like choking a slab of meat.
With a quick, sharp movement, he snapped its neck and then let go.
The body just lay there. He prodded it with his foot, but it didn't move. Whatever had been in there before, whatever a Hladvora was, it had abandoned this body.
He struggled to his feet. His arm hurt, his side as well. Blood had started to soak through his bindings. He needed to feed, and sooner rather than later.
He tried the door again, again pushed his way through and experienced the same dizzying sensation that brought him back to where he'd started. This wouldn't be the way out. He would have to search for another exit.
As if responding to his thoughts, a door suddenly appeared in the wall at the far end of the great hall, inviting him to move deeper in.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
He traversed the length of the great hall, moving toward the door at its end. Halfway there everything seemed to tilt a little, and he had to dig in his heels to keep his balance and stop from sliding through the door. Legs braced, he trundled through. Suddenly, the floor was level again, and because his legs were still braced, he almost fell over.
He was in a parlor now, and again, he felt like there was something he should remember. From behind him, he heard a screech, perhaps a baby, perhaps a crow, but when he turned, there was nothing there. The door through which he had entered was gone, only bare wall in its place. He ran his hands over the wall, but found no crack or join, no way back.
He heard a warbling sound and saw that the wallpaper on the far wall of the room had begun to move and swirl and clump together, puckering and rising to form a lump.
#figure(image("008_The Devouring House/04.jpg", width: 100%), caption: [Dread Fugue | Art by: <NAME>], supplement: none, numbering: none)
There was something about the lump that struck him as familiar. Fascinated, he moved cautiously forward.
As it further gathered, it was, he saw, a face, but whose? He could almost make it out, but not quite. He drew closer, and closer, brows furrowed, peering.
He was just reaching out to touch it when the face opened its eyes and grimaced.
He scrambled back, shocked.
#emph[Hello, darling] , the face said. It spoke in a rustling whisper that was not human at all, not remotely, and yet in it, he could still recognize his mother's cadences. He hadn't seen her for millennia, but hearing that voice and seeing that face mimicking hers made the memories come rushing back.
He felt he was a child again. He could smell his mother's perfume, the sweet smell of her breath. As he experienced this, the design of the wallpaper drained from the face and left its surface as white as porcelain.
And then the rest of his mother pushed her way out of the wall, on impossibly long legs and with impossibly long fingers. He could see that, however much her face seemed to suggest otherwise, this was not his mother.
He fled as fast as his little legs could carry him. He was screaming now—what had they done to his real mother? Who and what was this other, false mother?
#emph[Strefan] , the papery voice whispered. #emph[Come here. Mother needs you.]
He fled to a corner of the room, and then, as she teetered toward him on those impossibly long legs, to another corner, and then to a third. His mother gave a tittering laugh.
#emph[There, I have you now, child.]
And indeed, she did. She sidled toward him and spread her hands out wide, fingers outstretched to prevent his escape. He tried to press his head deep into the corner, tried to ignore his fear, ignore her, but he could still feel her coming, closer and closer. Screaming, he turned to face her and saw his chance—he rushed forward, right at her, and as she swiped at him he dove through her legs. He scrambled back up and ran for the door, even though part of him, very deep down was thinking: #emph[Was there a door here before? I don't think there was a door there before. ] Behind him, he heard her tittering laughter—she was enjoying this game, she was enjoying scaring him: his own mother! Only, he reminded himself, she #emph[wasn't] his mother, she was something else, what was it again? It was on the tip of his tongue, why couldn't he remember? La, La, Hla—
And then he was through the door and everything changed. He was no longer a child: he was himself again, thousands of years older. The memory of his fear was still incandescent. He felt exhausted.
No, not just exhausted, he realized: drained. The Hladvora had been feeding on him, drawing on his fear. #emph[He] was the provender this time, the cattle.
And now the creature had drawn him deeper into this accursed place. It was using things from his own mind, twisting them in order to terrify him. Finally, he understood why this place seemed so familiar.
And now it wanted him to believe he was in his father's study, a place that had largely been forbidden him as a boy—he was only allowed to enter if accompanied by his father. Though he had, at times, sneaked in on his own, and had been clever enough not to be caught. He felt the pull on him to believe himself a child again, but steeled himself to resist.
#emph[Was it really Brandt I pursued to this place?] He wondered. Perhaps Brandt had stumbled here on his own, months back, and had fallen victim to the creature. If the creature had toyed with Brandt's memories, it would have discovered Brandt's obsession with him. Perhaps it had taken charge of the husk that was Brandt's body, filled it with its own blood, and gone in search of Strefan.
He looked around the false room. What form would the creature take next? How would it come for him? Would it appear in the tapestries this time? The grain of the wooden floor? Would he open the drawer of his father's desk and find it folded within?
He cautiously stepped forward, his eyes darting over all his father's things: the cabinet of curiosities, the well-appointed desk, the stacks of his books, his ivory-headed cane. He reminded himself it wasn't real, that the creature could be anywhere.
He took another step, still careful, still attentive, still cautious, and then yet another. Or, rather, would have if he hadn't fallen through what appeared to be solid floor.
He fell only a short distance but struck very hard, on his same side as in the pit, his injuries blazing out again. He cried out and, hissing, scrambled to his feet, ready to defend himself from the attack he was sure was coming.
But there was no attack. At least not of the sort he had come to expect.
He took stock of his surroundings. He was in a bedroom. At first he told himself it was supposed to be his childhood bedroom, but this was only because he did not want to see the room for what it really was. Only because he did not want to look too closely, did not want to recognize the dark hangings that signified mourning, above all, did not want to see what was on the bed.
The body lay with its hands crossed over its stomach, just as Strefan had left it. He had washed the corpse, had anointed it with oils, had dressed it in its finest raiment and then laid it out in state upon the bed before leaving it and this house behind forever. Overwhelmed with fear and grief, this death, the pain of it, was what had caused him to make the decision never to die.
"Father," he whispered.
#emph[It's not real] , he told himself. #emph[He's not real] . #emph[It's all in my mind.]
And yet his father seemed real. Strefan felt overwhelmed by that same sadness and hopelessness he had felt the day his father had died. It was as if the death had just happened. He stared, terrified at the corpse, feeling profoundly helpless that he had been able to do nothing to save his father. He had failed his father.
Beneath his gaze, his father stirred and began to open his eyes.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
For one brief moment, Strefan experienced a deep and abiding joy: his father was still alive! He had not died after all! But then his father met his gaze, and he sensed vaguely there was something wrong. He had~seen those eyes before. They were familiar, true, but they did not belong to his father.
He shook his head, tried to clear it, but felt as if he were in a fog.
His father sat up slowly and beckoned to him, calling him forward. It was all that Strefan could do to resist going. But the eyes: something about them still nagged at him. They were the wrong eyes.
He clung to that. #emph[Wrong eyes] , he told himself, #emph[wrong eyes] , reciting the words like a chant. And as he did so, he began to see more wrongness as well. His father's skin was not quite right. Certainly, the face was right, the bones in the right place, the shape right, but the skin on the rest of the body was less precisely deployed. It was loose and flopping on one arm and too tight on the other. As if his father had too hastily slipped it on.
#emph[Slipped it on?] Strefan thought.
He was ensorcelled, he could glimpse that now. #emph[Cling to the wrongness] , he told himself, and each time the eyes tried to masquerade as his father's eyes, each time the skin tried to smooth itself out, he recalled what he had already seen that was wrong and saw it again.
#emph[Strefan] , his father said, his voice little more than a whisper. #emph[Be my good boy and come here.]
#figure(image("008_The Devouring House/05.jpg", width: 100%), caption: [Ghastly Mimicry | Art by: <NAME>], supplement: none, numbering: none)
Again, he felt his body drawn forward, again, he felt the years draining away, but he struggled, resisted. The being in the bed seemed less and less like his father every minute. And here in this chamber, too, he saw in a brief flash as the illusion slipped, the discarded and drained husks of insects, birds, mice, rabbits, a wolf, even a man—it was a den.
But this ruined den was also in the exact shape of his father's room. With horror, he realized for the first time that what was happening to him was more than just the creature plundering his mind and twisting his memories: he really #emph[was ] in the ruins of his family manor. Brandt had brought him back here, to this haunted place, where Strefan was most vulnerable.
Where were the twins? He had placed them here as guards to prevent just this. Had they been consumed by the creature, too? If so, if it could take the twins, he was in even more trouble than he had thought.
And then he blinked, and the husks were gone, the stately deathbed returned. But his father's skin—wait, was it his father? No, no it wasn't, he had to remember this. The skin of that #emph[father-like thing] was becoming more and more translucent. He could see, now, that there was something folded within it, another creature entirely, inhuman. Which was why the skin did not fit.
#emph[Be a good boy and come here] , the false father said again.
The tug was not quite so strong now, now that he had started to see through the enchantment, but Strefan pretended it was. He took a dreamy step forward, a false smile frozen on his face. Then another. And then his hands darted out and caught hold of his father's skin. Weeping, with all his strength, he tore his father open.
There was a great rush of fetid air and fluid. Whatever had been living inside the false father slid off the bed and spilled onto the floor.
At first, he thought it was a wolf, but wolf wasn't exactly the right word—it only looked that way if glimpsed briefly from the right (the wrong?) angle. A werewolf perhaps, caught mid-transformation as it shed its human skin to reveal itself as hairy on the inside? But no, that wasn't quite right either: nothing was quite right.
The creature was red and damp, as if lacking an outer skin. As it struggled to its feet, it left bloody pawprints behind. It seemed malformed, or better yet, half-formed: as if whatever it had been in the process of becoming had been interrupted when Strefan tore its~chrysalis open.
It opened its mouth. A chill ran through Strefan as he saw the same many rows of sharp teeth that he had seen in Brandt's mouth. It hissed at him like a snake, then barked like a dog, then sprang.
It knocked him off his feet and was quickly on top of him. He protected his face with his arms and it bit, taking a good chunk out of one forearm. It was very strong. He punched it hard in the side of the head, his fist making a squelching sound, then landed another punch, making the creature rear back just enough for him to lock his hands around its throat.
He choked it, blood oozing through his fingers, as it snapped and hoarsely snarled and tried to get at him. It was nearly impossible to hold onto. He slid backward on his back, still keeping a tight grip on its throat, while it scrabbled at him with its mangled paws, scratching his arms, his chest. A little further, a little further, his arms tired now, and then he was close enough to the wall behind him to ram the thing's head into it.
But nothing happened. The creature's head passed into the wall without harm, though his hands were stopped by it and couldn't go through. Strefan remembered the table in the dining hall, how Brandt had passed right through it. #emph[It's not real, it's not a real wall.] Slamming the creature into it wouldn't hurt it at all.
With a tremendous effort, he threw the creature from him and then scrambled to his feet. This time when it lunged for him, he was ready, stepping slightly to one side and then falling onto it. It scrabbled and bit and tried to get away, but at last, he had his hands tight around its throat, and this time, he squeezed very tight indeed, pressed his full weight down on it, and held desperately on.
Strefan choked it and choked it, until, suddenly, he could feel the Hladvora weakening, its limbs slowing. He squeezed further, his hands sinking deeper and deeper into its flesh.
And then suddenly it burst into a torrent of blood within his hands. He lunged after the blood, trying to slurp it up, but as before it flowed into the cracks of the floor and was abruptly gone, as if it had never been there at all. He was left hungry, starving.
The walls changed, too, becoming first translucent and then, in the blink of an eye, simply absent. Strefan found himself alone again, at night, in the cold, in the ruins of his family's manor house, in what had once been his father's bedroom.
He struggled to his feet. He had to leave. He had to get out. Weaving, he picked his way through the stones.
He stumbled away, falling face first into the snow as soon as he was clear of the ruin. He lay there a moment, waiting for his heart to slow, and then regained his feet and, limping, began to walk.
He was alive. But he wouldn't remain so for long if he didn't feed soon. Too tired to manage to fly, he stumbled on. Perhaps he would encounter a lost traveler and be able to feed. If he did, perhaps he would recover, would live to fight another day.
#emph[Or then again] —he admitted to himself a little later, lost now in the forest, swaying, barely able to keep on his feet, increasingly aware that he might not have escaped his own mortality after all, that even now, death seemed to be snapping at his heels—#emph[perhaps I won't.]
|
|
https://github.com/liketechnik/aoc2023 | https://raw.githubusercontent.com/liketechnik/aoc2023/main/02.typ | typst | // vim: ft=typst
#set text(
size: 12pt,
font: "STIX Two Text",
lang: "en",
region: "US",
)
#show raw: set text(font: "Recursive Mn Lnr St")
#show math.equation: set text(font: "STIX Two Math")
#set page(
width: auto,
height: auto,
)
#set document(title: "Advent of Code - Day 02", author: "liketechnik")
#let exercise = read("./input02").trim()
#let lines = exercise.split("\n")
#let revelationRegex = regex("([0-9]+) (blue|red|green)")
#let setRegex = regex("(([0-9]+) (blue|red|green)(, )?)+")
#let games = lines.map(line => {
let gameId = line.match(regex("([0-9]+):")).captures.at(0)
let sets = line.matches(setRegex).map(rawSet => {
let revelations = rawSet.text.matches(revelationRegex).map(rawRevelation => {
let color = rawRevelation.captures.at(1)
let count = int(rawRevelation.captures.at(0))
(
color: color,
count: count,
)
})
revelations
})
(
id: int(gameId),
sets: sets,
)
})
#let availableCubes = (
"red": 12,
"green": 13,
"blue": 14,
)
#let possibleGames = games.filter(game => game.sets.fold(true, (valid, s) => if valid {
s.fold(valid, (valid, s) => if valid {
if availableCubes.at(s.color) >= s.count {
true
} else {
false
}
} else {
false
})
} else {
false
}))
#let result1 = possibleGames.map(game => game.id).sum()
#let minimalSets = games.map(game => game.sets.fold((red: 0, green: 0, blue: 0), (minimal, cur) => {
let updateFn(color, minimal) = {
let val = cur.find(cube => cube.color == color)
if val != none and val.count > minimal.at(color) {
minimal.insert(color, val.count)
}
minimal
}
minimal = updateFn("red", minimal)
minimal = updateFn("green", minimal)
minimal = updateFn("blue", minimal)
minimal
}))
#let powers = minimalSets.map(s => s.values().product())
#let result2 = powers.sum()
#figure(caption: "Advent of Code Day 02")[
#table(
columns: (auto, auto),
[Part 1], [Part 2],
[#result1], [#result2],
)
]
|
|
https://github.com/ysthakur/PHYS121-Notes | https://raw.githubusercontent.com/ysthakur/PHYS121-Notes/main/Notes/Ch06.typ | typst | MIT License | = Chapter 6
== Uniform Circular Motion
Speed is constant but not velocity, because direction is constantly changing.
Centripetal acceleration for uniform circular motion: $ a = v^2/r = ((2 pi)/T)^2 r$
*Period:* Time taken to go around circle one time.
*Frequency:* Number of revolutions per second: $ f = 1/T$ (unit is $upright(s^(-1))$)
*Angular velocity:* $omega = 2 pi f$
*Speed:* Time taken to make one revolution: $v = (2 pi r)/T = (2 pi f r) = r omega$
== Dynamics of Uniform Circular Motion
Net force producing the centripetal acceleration of uniform circular motion: $hat(F)_"net" = m hat(a)$ (towards the center of the circle)
When a car turns in an _unbanked_ (horizontal/level) circle, static friction is the force that causes centripetal acceleration.
When a car turns in a _banked_ circle, normal force is the force that causes centripetal acceleration instead.
== Apparent Forces in Circular Motion}
Apparent weight equals normal force.
*Critical speed:* $v_c$ is the speed for which $hat(n) = 0$. \
For roller coaster, $v_c = sqrt(g r)$ \
The critical speed is the slowest speed at which the car can complete a roller coaster circle.
== Circular Orbits and Weightlessness
*Orbit:* If the launch speed of a projectile is sufficiently large, there comes a point at which the curve of the trajectory and the curve of the Earth are parallel. Such a *closed trajectory* is called an orbit.
An orbiting projectile is in free fall.
$v_"orbit" = sqrt(g r)$ - satellites need to maintain this speed to avoid falling into the planet.
== Newton's Law of Gravity
$ F_g = (G m_1 m_2)/r^2$
*Gravitational constant:* $G = 6.67 times 10^(-11) upright((N m^2) / "kg"^2)$
$ g_"planet" = (G M_"planet")/(R_"planet"^2)$
== Gravity and Orbits
|
https://github.com/jassielof/typst-templates | https://raw.githubusercontent.com/jassielof/typst-templates/main/upsa-bo/estudio-de-factibilidad/template/capítulos/14.conclusiones%20y%20recomendaciones.typ | typst | MIT License | = Conclusiones y Recomendaciones
== Conclusiones
== Recomendaciones
|
https://github.com/ustctug/ustc-thesis-typst | https://raw.githubusercontent.com/ustctug/ustc-thesis-typst/main/chapters/notation.typ | typst | MIT License | #block[
#block[
2em
The number of angels per unit area
The number of angels per needle point
The area of the needle point
The total mass of angels per unit area
The mass of one angel
The sum of $a_i$
]
]
|
https://github.com/mimed95/typst-cv-template | https://raw.githubusercontent.com/mimed95/typst-cv-template/main/README.md | markdown | MIT License | # typst-cv-template
Template migration from Latex to Typst in progress for my CV
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/036%20-%20Guilds%20of%20Ravnica/013_The%20Gathering%20Storm%3A%20Chapter%208.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Gathering Storm: Chapter 8",
set_name: "Guilds of Ravnica",
story_date: datetime(day: 31, month: 07, year: 2019),
author: "<NAME>",
doc
)
Not quite twelve hours later, Ral stepped off the deck of a very different skyship onto the dock jutting from what they now called the Beacon Tower.
The skyship was part of the small Azorius fleet, done up in the Senate colors and comfortably appointed for hauling dignitaries quickly around the city. The crew had worked the ropes with quiet efficiency, and a formation of thopters had flown escort as the vessel ascended, watching with unblinking camera eyes. Ral frowned at the machines, which hovered overhead as he strode down the gangplank. Here in Azorius territory they were as thick as flies on a corpse, and he doubted anyone came or went without their knowledge.
<NAME> was waiting at the foot of the dock, wearing a red and blue robe that set off his dusty blue skin, hands clasped at the small of his back. His calm seemed preternatural, even for the notoriously even-tempered vedalken. He gave a very slight bow to Ral, which Ral returned, holding his coat to keep it from flapping in the wind. They were at least twenty floors up, and though yesterday’s storm had abated heavy clouds still raced across the sky, bringing a fitful drizzle.
"<NAME>," Dovin said.
"Master Baan." Ral nodded at the skyship. "Thank you for the ride."
"Ascending the stairs is an inefficient use of time," Dovin said. "Your people have installed some sort of slingshot-and-bucket device for reaching the top quickly, but I understand it is still unreliable."
"Has anyone been killed yet?" Ral said.
"I don’t believe so. One goblin suffered several broken limbs, and proclaimed that it was ‘awesome’ and she wished to ‘try another ride.'" Dovin raised one elegant eyebrow, and Ral fought back a grin.
"Sounds reliable enough to me," he said. "You didn’t have to meet me here, you know. I’m sure the foreman can tell me what I need to know."
"It seemed respectful," Dovin said. "I am a stranger on your world, as you know."
"Well." Ral shrugged. "Lead the way, then."
Dovin pointed, and Ral followed. The vedalken walked so smoothly he almost seemed to glide, as though he’d perfected this simple movement to the very utmost. Everything about him was like that—smooth, effortless, #emph[perfect] . It was unnerving.
"You’re very open about being a Planeswalker," Ral said.
"There is little reason to hide it, now that you have made the secret public."
"Why come here to stay? Bored of your homeworld—Kaladesh, was it?"
"I don’t bore easily, <NAME>," Dovin said. "The smallest system, fully studied, can hold as much interest as the largest. No, my departure from Kaladesh was the result of . . . unfortunate local politics, let us say."
"You’ve settled in nicely here, then."
"I am very grateful to Supreme Judge Isperia," the vedalken said. "I visited a number of worlds before coming to Ravnica, and she was the first to make me feel as though I might have a place. I am grateful for the chance to exercise my talents in her service."
"And what are your talents, exactly?"
"Perfection," Dovin said simply. "The ability to refine a thing, little by little, until it becomes a true exemplar of what it was meant to be. A machine, a bureaucracy, a dance—the form matters little, only the process." His face took on a blissful look, the first emotion Ral had seen him show. "Supreme Judge Isperia has been kind enough to let me work within the Azorius, and I believe she has been very pleased by the results."
"Evidently," Ral murmured. He thought of the ever-watching thopters, which by all account were an invention Dovin had brought with him. #emph[It must help with perfection when you know what everyone is doing all the time.]
Ral was finding it very difficult to like <NAME>.
"Have our people been giving you any trouble?" he said, changing the subject as they passed indoors. The Beacon Tower was topped by a broad copper dome, pierced by a number of small doorways, and Dovin unlocked one of these with a key on his belt.
"They have made some unusual requests," Dovin admitted, "but I have done my best to fulfill them. In some cases, I believe I have become the target of some variety of humor." He pronounced the word carefully, as though it were an alien thing that needed careful watching. "I do not understand the utility of an alligator sandwich in this project, even if it is delivered especially quickly, but I—"
"I’ll speak to them," Ral said, groaning inwardly.
"It’s no trouble. I believe they were quite surprised when I brought them one within the hour." Ral couldn’t be certain, but he #emph[thought] the ghost of a smile crossed the vedalken’s lips. #emph[Not quite as oblivious as he puts on, then.] Dovin gestured at a door ahead of them. "This is the primary chamber."
The placement of the Planar Beacon had been dictated by the complex metaphysical geography of Ravnica, the same currents of energy that had powered the Implicit Maze. There had only been a few places that were suitable, according to the plans Niv-Mizzet had provided, and only this one, an Azorius outpost and skyship dock, had a ready-built tower of the requisite height. Isperia had consented to an Izzet crew moving in and taking over the top floors of the tower, constructing the great machine to the Firemind’s specifications.
Building the beacon had been part of Ral’s assigned tasks, but he’d left it to subordinates for too long, busy as he’d been coordinating the guild summit. For now, though, that task seemed well in hand. The raid on the Orzhov Cathedral had been a success. Hekara was still recovering in the Izzet infirmary, where Ral imagined she was having fun—the medics had a tendency to test their latest inventions on the patients, but he suspected they’d meet their match in the cheerfully fearless Rakdos emissary. Vraska had returned to her underground empire to prepare for the summit. And while they hadn’t heard from Kaya herself, Teysa had sent messengers to Isperia, indicating that the Orzhov would attend the summit after all. The sphinx was busy coordinating the myriad diplomatic details, but it really looked as though the meeting was going to happen.
#emph[Which doesn’t mean it will be a success.] Getting the guilds to agree on #emph[anything] was hard enough, without even taking into account the possibility that some of them had been infiltrated by Bolas’s agents. Lazav was still a likely candidate for that, in spite of his protests, and Lavinia didn’t trust Vraska in spite of her performance at the cathedral. Ral, oddly, found himself warming to the gorgon.
In any event, Niv-Mizzet still demanded a backup plan, and so construction on the beacon was proceeding apace. The space inside the copper dome with thick with wires, mizzium coils, and huge resonator crystals spaced at regular intervals. A smaller inner dome enclosed an area the size of a large room, with a single heavily shielded door leading inside. This was what Dovin now opened, leading the way into the heart of the machine.
When you assigned a task to the chemisters of the Izzet, you usually only had the vaguest idea what you were actually going to get. In this case, Ral was pleased to see that they’d stuck fairly closely to Niv-Mizzet’s design, with only a few decorative touches added on. The center of the beacon was a single metal stool, with a half-circle of steel control board curved around it, covered with an array of switches, buttons, and dials. A series of ivory keys, like a section of a piano keyboard, occupied the center. Wires curved away, up to the ceiling and out to the machinery between the domes.
Several humans, a goblin, and a viashino drew themselves up in front of the control board, bowing as Ral approached. Dovin looked on impassively.
"<NAME>!" the goblin said. "Chief Chemister Varryvort, sir. Glad you could come to visit. Good timing, actually."
"Thank you, Chief Chemister," Ral said. "Why?"
"It’s time to set the final security lockout, sir. We thought that you should choose the sequence, for safety’s sake."
"Ah." Ral glanced at Dovin, who had a questioning look. "Activating the beacon is potentially very dangerous," he explained. "So there’s a kind of key, a sequence that only Niv-Mizzet and I will know. Just in case."
"Very wise," Dovin said.
"You’ve finished the inner works, then?" Ral said to Varryvort.
"Yes, sir. All that’s left is calibrating the resonators and modulating the primary power couplings. Give it a few more days and we’ll be ready to go."
"For a machine that can only be either on or off, it seems to have a lot of controls."
"Most of these are for testing purpose, sir. We check the components individually, since we can’t run a full-scale system test." The goblin pushed Ral toward the stool and indicated a single large switch. "Throw that switch, enter your sequence, and lock the switch back into place, and the beacon will be activated. As per the Firemind’s design, it will #emph[stay] activated until its internal power reserves run down, no matter what anyone does."
"Good." Varryvort seemed dubious, but Ral understood. #emph[If we have to turn on the beacon, we may have already failed. I don’t want to leave Bolas a way of shutting it off.] "The security sequence?"
"Ah, yes." The goblin ran around the rear of the board and punched some buttons, and the piano-like keyboard lit up. "Go ahead. Seven keys, in any order. #emph[Please] don’t forget, or I’ll have to tear this thing apart to get at the override."
"I understand," Ral said. He glanced over his shoulder, but Dovin was standing a respectful distance to the rear. Ral bent over the keyboard and entered a sequence, a bit of piano doggerel Elias had written for him long ago. The light brightened, then went out.
"It occurs to me," Dovin said as Ral stood, "that this system is a bit fragile. What if you were to be incapacitated? Would it not be better to have a few individuals with knowledge of the code?"
"I’ll tell Niv-Mizzet," Ral said. "If anyone gets to #emph[him] , I think we have bigger problems."
"Ah, yes," Dovin said. "I do hope I have the opportunity to speak to your Firemind at some point. I’m sure I would find the experience fascinating."
"I’m sure you would." Ral shook his head. "Okay. The backup plan is on track. Let’s try to make sure we don’t need it."
"Supreme Judge Isperia is hard at work." Dovin gave another slight bow. "She will bring the guilds together, depend on it."
#emph[I certainly hope so.] For some reason, Ral saw Garo’s face, speaking Bolas’s words, and shook his head.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kaya awoke, and immediately wished she hadn’t.
Everything seemed to hurt, from pain in her chest when she breathed too deep to an egg-sized lump on the back of her head. #emph[Remind me not to get punched by any more giants.] More worrying, though, was the feeling of being #emph[bound] , as though something had grabbed her on the metaphysical level and refused to let go. #emph[Those damned ghosts ] did#emph[ something to me. A curse, maybe?] She’d heard of death-curses, but not undeath-curses. #emph[I suppose anything’s possible.]
With a sigh, she opened her eyes. She found herself in an elaborately decorated bedroom, the somber tones and excessive gilt indicating that she was still somewhere in the Orzhov Cathedral. She lay on her back in a four-poster bed, with silk sheets and pillows dripping with tassels and fringes of pearls. The rest of the room was furnished in a similarly elaborate style. #emph[Which means we won, I guess. This certainly isn’t a prison cell.]
After a moment, the door opened, and a gray-clad serving woman came in with a pitcher of water. She gave a start when Kaya sat up, or tried to. Kaya settled for propping herself on her elbows.
"You’re awake!" The woman regained her decorum and bowed deeply. "My apologies, Guildmaster. Is there anything you require?"
"That water would be nice," Kaya said. Then, after a moment, "What do you mean, ‘guildmaster?'"
The servant poured a glass of water in silence and brought it to Kaya’s bedside, leaving the pitcher on a low table. Kaya drank greedily and pulled herself further up.
"How long have I been unconscious?" she said.
"Most of a day." The servant bobbed nervously. "Excuse me, Guildmaster, but <NAME> requested that we inform her as soon as you awoke, so that she could attend you. Do I have your permission to fetch her?"
"Not until you tell me why you’re calling me ‘guildmaster.'"
"Mistress Teysa will explain everything," the woman said, with a pleading look.
Kaya sighed and waved her away. She drank more of the water, stretching her arms and testing her range of motion, wincing when her chest twinged. After a few minutes, the door opened again, and Teysa came in. She was dressed in her full guild regalia, black hair blending into an unrelieved black uniform, and cut quite a figure.
"Kaya," she said. "How do you feel?"
"Hurt," Kaya said, "and a little confused. What’s going on?"
"We won," Teysa said, pulling a gilded chair across the room and sitting beside Kaya’s bedside. "The Ghost Council is no more, and the high officials of the guild have accepted the fait accompli."
"I figured, since I’m in here and not rotting on a spike somewhere. So why are your servants calling me guildmaster? #emph[You] are supposed to the heir, aren’t you?"
Teysa pursed her lips, and looked over her shoulder to make certain the door was firmly closed. She leaned closer, speaking in low tones.
"There have been . . . complications."
"I gathered," Kaya said dryly. "What #emph[kind] of complications?"
"The guild is party to a great many contracts, which are given force by our law mages," Teysa said. "I believed—most of the guild officials believed—that most of those contracts were held by the guild as a legal entity, which means they would be unaffected by any changes in leadership. Unfortunately, it appears my Grandfather held a great many agreements #emph[personally] . Perhaps the majority."
"I’m not sure I’m following this."
"When you destroyed him, those agreements transferred to you," Teysa said. "That’s what knocked you out. You are now, effectively, the counterparty to most of the financial obligations routed through the Orzhov bank, as well as the holder of much of the debt of the Tenth District. To put it bluntly, you #emph[are] the Orzhov, in every way that matters. The guild had no choice but to acknowledge you as guildmaster."
"#emph[What] ?" Kaya shook her head. "You have got to be kidding."
"I assure you I’m not," Teysa said. Her expression was grim. "It took some effort on my part, believe me."
"Why?"
"Because the alternative would have been to kill you while you slept. We don’t know if the contract transfer would work the same way with a living person as it did with a ghost, but some of the guild officials were willing to try rather than acknowledge the authority of an outsider."
"Oh." Kaya hesitated. "Thanks, I guess."
"Don’t mention it," Teysa said dryly. "It seemed a poor way to repay you. And, in any case, I won’t risk the future of the guild on assumptions about how unknown magic functions."
"Okay," Kaya said. "Obviously, now that I’m awake, we can solve this problem. I hereby give everything to you, right?" She looked down at herself, hopefully, but the strange feeling of being bound didn’t change.
"It’s not that simple," Teysa said with a sigh. "I have our law mages working on the problem as we speak, but most of these contracts were concluded on a personal basis. They can’t be transferred without being broken."
"I can’t #emph[stay] here," Kaya said, suddenly feeling frantic. "This job is over. I have debts of my own to collect."
"I know, but please." Teysa grabbed her hand. "You #emph[cannot] leave, not yet. You cannot . . . planeswalk, you understand? That’s why I had them fetch me as soon as you awoke. If you vanish, it could be catastrophic, both for the Orzhov and for you."
"For #emph[me] ? Why?"
"Backlash." Teysa shook her head. "These contracts were created to be #emph[enforceable] . If they are all released at once, the combined force could easily kill you, or drive you mad."
"You have #emph[got] to be joking." Kaya sat up straighter, wincing. "So I’m #emph[stuck] here? As . . . guildmaster of this weird cult-bank thing? And—" She started coughing, which only made her hurt more, doubling over in agony.
"I #emph[know] ," Teysa said. "Believe me, I am trying as hard as I can to fix this. We #emph[will] get you out, I swear it." Teysa waited until Kaya’s cough had subsided, and handed her the glass of water. "I owe you an enormous debt, Kaya. I would not be free, or even alive, if it were not for you. But . . . it will take time."
"I don’t #emph[have] time." Bolas had promised her he would heal the sky. Back home, people were suffering. #emph[They trusted me.]
"You don’t have a choice." Teysa took a deep breath. "For now, you must act as guildmaster. I will . . . assist, of course, but you must make a few public appearances. Otherwise the voices in the guild who want to kill you and face the consequences will grow louder."
"You have got to be . . ." Kaya shook her head. "You’re not. Obviously."
"I’m sorry. I didn’t anticipate this."
"I should damn well hope not." Kaya grit her teeth. "Get out."
"Will you—"
"I’m going to get some rest. Then I’m going to think about this some more." Kaya lay on her side, facing away from Teysa. "Now get out. The guildmaster commands."
"As you wish." Teysa got to her feet. "Again. I’m sorry."
Kaya said nothing as Teysa walked away, and she heard the door open and close.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
She did manage to sleep, a little. Kaya dreamed of a blue sky shot through with scintillating cracks, like a zig-zagging rainbow, and of a world that went a little madder every year. Several times, she woke to the sound of servants entering, quietly going about their business. #emph[Apparently guildmasters don’t get privacy.]
Finally, she ached too badly to stay in bed. Kaya rolled over with a sigh, and froze. An old man with a missing tooth and wild white hair, dressed in the gray robe of an Orzhov menial, sat in the chair Teysa had vacated, staring at her with his chin in his hands. Kaya felt a simultaneous urge to hide from his scrutiny and punch his remaining teeth out.
Instead she said, "Is there a problem?"
"No," he said. "No problem. I just wanted to congratulate you on your ascent to guildmaster. I’m so glad you’ll be staying a little longer on Ravnica."
"#emph[What?] " Kaya sat up, her hand automatically going for a dagger that wasn’t there. #emph[Where did they put those, anyway?] "Who are you?"
"Just a poor debtor, come to check on the terms of his bargain." The old man smiled, a shark-like grin that seemed #emph[wrong] in his wizened face. There was something about his voice, too, that seemed familiar. Kaya breath caught in her throat.
"#emph[Bolas?] "
"In a manner of speaking. Only a poor messenger, in truth, but enough to be getting on with."
"You bastard," she growled. "You knew this would happen, didn’t you? You hired me to kill the Ghost Council for you, but you knew I’d get #emph[stuck] here."
"I had my suspicions, let us say. <NAME> was never the trusting sort." The old man, Bolas’s vessel, gave a one-shouldered shrug. "It does position us perfectly for the next part of your service."
"There is no #emph[next] part, you snake. That wasn’t part of the deal."
"Ah, but you now require additional services from #emph[me] , do you not? Aid for your poor, broken home plane, as we originally agreed, but also extrication from your current predicament."
Kaya paused. "You can get me out of here?" Her voice was leaden; she knew the answer to the question.
"Law magic has been part of my repertoire for millennia," Bolas said, his soft purr of a voice sounding unnatural coming from the old man. "I can shift your burden, yes. But first you must do something for me."
Kaya took a deep breath, winced, and let it out slowly. "What do you want?"
"There is to be a conference," Bolas said, leaning closer. "One that you will attend, as the Orzhov representative . . ."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
In Ral’s dream, he was twenty years old again.
"Elias?" He poked his head into their shared bedroom, where the floor was covered in discarded clothes. It was empty, as was the study, where Elias’s writing desk was surrounded by increasingly precarious stacks of books.
"Down here!" Elias called.
Ral went down the stairs. They’d lived in the townhouse—a newly renovated, three-story extravagance, in the very heart of Tovrna—for nearly a year now, and it still seemed much too large to him. He had dreams of finding new rooms, full of inexplicable things, hiding around some forgotten corner.
He found Elias in the dining room with their two footmen, fussing over the dinner arrangements. The table would comfortably seat ten, but Elias appeared to be trying to cram in fourteen, with one of the servants holding a fifteenth chair in readiness. #emph[His latest poem must really be bringing in the admirers.]
In the last three years, Elias’s career had taken off in a way neither of them had imagined possible. The doors of Tovrna’s oldest and most staid artistic societies had opened to him, and critics who looked down on anything written in the last century had suddenly taken an interest in his work. Elias wrote furiously, words practically dripping from his pen, and he was now acknowledged as the leading light of the fashionable set. He dined with oligarchs, and his own dinners were attended by the elite.
For Elias, it was all a mystery, the smile of some deity who had frowned on him his whole life. Only Ral knew the truth. No divine providence was involved, only the hidden hand of <NAME>, which seemed to reach into every level of society with an effortless ease.
#emph[It can’t ] all#emph[ be Bolas] , Ral told himself, as he watched Elias work. #emph[He only opened the door. If Elias didn’t have his own talent, surely he couldn’t have gotten anywhere.] But, in his darker moments, he sometimes wondered.
The money coming in from Elias writing, along with Ral’s own work, allowed them to live as befit their new status. Ral had expected to encounter trouble with their aristocratic neighbors, but even there his patron seemed to be smoothing the way. Everyone had simply taken it for granted that these two young men were to be accepted.
It was everything Elias had ever wanted. #emph[Which means it’s everything that ] I#emph[ have ever wanted.] And if there was a cost, then Elias would never know.
"Ral!" Elias said, rushing over and giving him a quick kiss. "This is driving me mad. Tell me, would you rather sit next to <NAME> or that nice young woman from the sculpture studio?"
"Neither, I’m afraid," Ral said. He gave Elias a moment to take in his rough clothes and long leather coat. The expression on his lover’s face tugged at his heart.
"You’re going out?" Elias said.
"You know I have to," Ral said quietly.
"But last night you told me—"
"I know." Ral shifted uncomfortably. "I got word just an hour ago that they need me again."
"#emph[I] need you," Elias said. "When was the last time you came to one of my dinners?"
"I can’t remember," Ral said honestly. "But you know I’d just embarrass myself anyway." He reached for Elias’s arm. "If I had to choose, I’d rather spend time with you alone—"
Elias jerked away. "Don’t."
"Sorry." Ral shook his head. "I’ll talk to the boss. Ask him if I can take a month off. Would that help?"
"It might." Elias’s lip quirked slightly. "You’ll come to my parties?"
"Every night."
"Well. Maybe not #emph[every] night." Elias sighed and gave Ral another quick kiss. "All right. Stay safe."
"Always."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Outside, the sun had already set behind the row of townhouses, and color was draining from the sky. Ral pulled his coat a little tighter against the chill. He turned his steps away from the center of town, walking past the rows of elegant townhouses and the neat little parks, past even the ring of genteel poverty where he and Elias had struggled to survive, into the shadowy tenements that surrounded the bright center of Tovrna like a ring of bloated tumors.
Here, the apartments were small, but nonetheless packed with as many bodies as they could fit. Men slept in shifts, matching the endless work hours at the factories. Clotheslines crisscrossed the narrow alleys like spiderwebs, hoping vainly to eke out a few rays of sun. During the day, swarms of children ran wild, miniature gangs led by the biggest and strongest.
At night, of course, the #emph[real] gangs took to the streets. Ral had grown up here, and he’d always known the slums were carved up into pieces of turf as intricate as any feudal kingdom. What he #emph[hadn’t] known, back then, was that those gangs ultimately paid allegiance to the oligarch families of Tovrna. It made sense—it was just another type of business, another investment, and the people involved were often the same workers who toiled in the noble-owned factories.
Ral still had no idea whether Bolas was a nobleman himself, or simply worked for one. He’d never seen him in public, and no one else seemed to know him. But his reach was vast. Working for him, Ral had learned, turning the tiny sparks of lightning he could generate with his power into a weapon with deadly potential. He directed that weapon as Bolas demanded, mostly against the thugs who worked for the other noble houses.
That was where Ral felt truly happy, working against the interests of people like the count and bloodying the noses of anyone who tried to stop him. He hoped that someday he’d run into Gunther again, and show him what the "rain mage" had made of himself. Even the thought made small crackles of static crawl over his hands.
Some nights, though, the work was different. Like tonight.
#emph[It’s all for Elias’s sake, anyway] , Ral thought, as he rounded the corner and found the building he wanted. It was a big hive of tiny apartments, hundreds of people living cheek-by-jowl. An old man with only one leg sat on the stoop, and stared rheumily at Ral as he entered.
Elias didn’t know what Ral did, not exactly. He knew Ral had a job that took him out nights, doing important work for one of the noble families, but Ral had worked hard to keep him from finding out that the work mostly involved hurting people. #emph[He doesn’t need to know.] While Elias brought in some money with his writing, he spent with a lavish hand, and without the salary Bolas paid him the pair of them would be right back in the gutter, no matter how many fancy friends acclaim had bought them. #emph[He’s the one with talent. I’ll do what needs to be done, as long as he’s happy.]
He climbed up the steps to the third floor, then walked down a grubby corridor, peering closely at the number plates. When he found the one he wanted, he tried the knob. #emph[Locked.] He glanced up and down, but no one was watching; Ral had grown up in a place like this, and knew that everyone learned to mind their own business. He carefully channeled power into the lock, until the cheap metal heated up enough that it bent easily when he pressed it inward. The door opened with a slight creak, and he stepped inside.
This was a large apartment, by the standards of the slums. It had two rooms, one for eating and one for sleeping. The former was mostly occupied by a table and a couple of chairs, and Ral found a young woman in dusty gray sitting in one corner, working with a pair of knitting needles. Ral knew all about that, too. In the slums, the wage the factory paid was just enough to buy food and keep a roof over your head. If you wanted anything else—clothes, medicine, books—you either made it yourself, or used your off-hours to work at a craft you could sell or trade. All the women in his mother’s building had knitted, or sewn, or hand-copied documents for scholars too cheap to set type.
The woman was so absorbed in her work that she didn’t look up until Ral cleared his throat. Her face was as haggard and gray as the rest of her, and she gave a little gasp at the sight of him.
"<NAME>?" he said.
"I . . ." She looked like she was on the point of denying it. "Yes. I suppose. Who are you?"
"I work for Master Venati," he said. "He asked me to come by and check on your payment for this month."
This was the part Ral hated, the slowly dawning realization in their eyes. The smarter ones got it at once, and this woman was one of the smarter ones. He was glad for that. He didn’t have to explain what came next; that Master Venati expected prompt payments on his debts, and that when Master Venati was unhappy, people got hurt.
#emph[They all made the choice] , Ral told himself. Even at his poorest, he’d known better than to get involved with loan sharks. #emph[And if it wasn’t me, it would be someone else.] Some of his colleagues positively hoped their clients wouldn’t pay. #emph[Better me that Big Sal, or Nak the Ripper.]
"I . . ." Anne’s voice broke. "I don’t have it. I’d have paid if I did, I swear it."
"Master Venati is always happy to renegotiate your terms," Ral said.
"Whenever I do that, he doubles my debt," Anne said. "Please. Give me another month." She indicated her knitting. "I’m working hard, I swear. I hardly sleep. But food and medicine are so expensive—"
"This isn’t the first time you’ve been late." Ral took a step forward, raising one crackling hand.
"Please—"
"Leave her alone!"
Ral hadn’t really intended to hurt the woman, or so he told himself later. Injured people couldn’t earn the money to pay their debts, after all. Mostly the clients just needed scaring, so that they had the proper motivation. But he kept himself ready, because sometimes they got violent. He wasn’t taken #emph[totally] by surprise when someone burst out of the bedroom doorway and came straight for him.
He was surprised, though, to find that it was a ten-year-old boy.
That made him hesitate just long enough for the boy to get inside his reach. Ral felt a sharp pain in his side, and instinctively slammed his hands down to shove the child away. His power leapt out as soon as he touched the boy, crackling through him in a vicious arc that set his limbs jerking and hurled him into the wall. He collapsed, twitching, as the woman screamed.
Ral stared down at his side, where a short-bladed knife had been driven in to the hilt. He wrenched it out and tossed it away, scattering blood. The woman had run to her son’s side. Ral knelt beside her, bending over the child, feeling like he was in a dream. She screamed something at him, pounded her fists against his shoulder, but he ignored her.
He put one hand over the boy’s heart. It was pounding wildly but irregularly, as current still coursed through his system. Ral closed his eyes and drew the electricity to himself, pulling whatever he could from the boy’s small body. His shocks normally weren’t fatal—he hadn’t yet had to kill anyone in Bolas’s service. #emph[But I don’t usually hit kids, either.]
Slowly, he felt the boy’s heartbeat return to normal. The woman had left off hitting him, and gone back to shaking her son, who suddenly coughed and breathed in with a ragged gasp. She picked him up, cradling him in her arms.
"Tell him I’ll pay," she said, her voice raw. "I’ll pay, I’ll pay, I’ll pay. Just don’t hurt my boy."
Ral got to his feet, in a daze. He pressed one hand against his side, and felt blood dripping past his palm. He turned away without a word and staggered out into the hall.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Ral never knew how he made it back to the townhouse, only that it took him some time. By the time he reached his own door, most of the lights on the street were out, and the carriages in front of the house were gone. Ral’s left hand was slick with blood. He fumbled with the latch for a moment before it clicked open, letting him stumble into the hall.
#emph[This is bad.] His thoughts came dully. At first he’d thought the wound a minor one, but the bleeding wouldn’t stop. #emph[Nicked an artery, maybe.] He couldn’t seem to get a decent breath.
"Elias." He didn’t have the energy to shout. "Elias . . ."
There was laughter from the sitting room, then silence. Ral took a step in that direction, then another. Drops of blood spattered the carpet.
He closed his eyes for a moment, and saw the boy’s limbs jerk spastically. Heard the woman’s desperate pleading.
#emph["I’ll pay . . ."]
As though he’d meant to do it. As though he’d hurt a child for Bolas.
#emph["I’ll pay . . ."]
He reached the sitting room door. Heard a giggle, and pushed it open.
Elias stood against the wall beside a fireplace. Another man was with him, a tall, handsome man with well-coiffed white hair. For a confused moment Ral thought Elias was being attacked, couldn’t understand what his eyes were telling him.
They were kissing, fast and hungry. The other man had his hands under Elias’s shirt, and Elias gave that soft little sigh that he only ever made for Ral—
Some sound must have escaped Ral, because Elias jerked up straighter, pushing the other man away.
"Ral!" he said.
"You . . ." Ral stood in the doorway, swaying. "You were . . ."
#emph[It was all for you. I did everything for you.] #emph[] #linebreak The woman pleaded. The boy’s limbs jerked.#linebreak #emph[ ] #emph[ ] #emph[] #emph[I sold my soul for you.] #emph[] #linebreak "I . . ." Elias shook his head, his eyes filling with tears. "What was I supposed to do, Ral? You’re never even #emph[here] and I just got . . . lonely, and . . ." His face screwed up into a rage. "What’s wrong with you? Are you #emph[drunk] ?"
"I think he’s hurt," the other man said. "Is that blood?"
Elias gasped, but Ral was no longer listening. Something inside him had given way, some primal instinct to #emph[get away] , as far away as he could manage. And, it turned out, that was very far indeed. A spark blazed to life, ripping a hole in the world, and in an instant Ral Zarek was gone.
|
|
https://github.com/cadojo/correspondence | https://raw.githubusercontent.com/cadojo/correspondence/main/_extensions/exploration/typst-template.typ | typst | MIT License | #import "_src/hermes/hermes.typ": * |
https://github.com/augustebaum/epfl-thesis-typst | https://raw.githubusercontent.com/augustebaum/epfl-thesis-typst/main/example/head/preface.typ | typst | MIT License | = Preface
A preface is not mandatory. It would typically be written by some other person
(eg your thesis director).
#lorem(200)
// #parbreak()
// #v(10pt)
// #bigskip()
#grid(
columns: 2 * (1fr,), align: (left, right), [_Lausanne, 12 Mars 2011_], [<NAME>.],
)
|
https://github.com/Gewi413/typst-autodoc | https://raw.githubusercontent.com/Gewi413/typst-autodoc/master/README.md | markdown | MIT License | # typst-autodoc
Automaticaly generate a documentation pdf for your library using java docstring format
```typst
/**
* this will render as info
* @param this as a parameter
*/
#let foo(this)= {}
#import "typst-autodoc.typ": main
#main("this.typ")
```

Supported : `@param`, `@see`, `@version`, `@returns`, more if needed
example.pdf coincidentally also documents the (few) functions of the library itself
## Features
unticked boxes aren't supported (currently)
- [x] parse basic function /**
- [x] render the docstrings with typst syntax (WARNING: `eval`)
- [x] automatically insert [links]()
- [ ] ignore trailing docstrings
- [ ] parse nested comments
- [ ] parse arguments with default arrays/dictionariess
- [ ] parse variables |
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/par-indent-04.typ | typst | Other | #set par(hanging-indent: 2em)
#set text(dir: rtl)
لآن وقد أظلم الليل وبدأت النجوم
تنضخ وجه الطبيعة التي أعْيَتْ من طول ما انبعثت في النهار
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/haw-hamburg/0.1.0/examples/bachelor-thesis/glossary.typ | typst | Apache License 2.0 | #import "dependencies.typ": print-glossary
#set heading(numbering: none)
= Glossary
#print-glossary((
(
key: "freedom",
short: "freedom",
desc: "Freedom is the power or right to speak, act and change as one wants without hindrance or restraint. Freedom is often associated with liberty and autonomy in the sense of \"giving oneself one's own laws\"",
),
))
|
https://github.com/PA055/5839B-Notebook | https://raw.githubusercontent.com/PA055/5839B-Notebook/main/packages.typ | typst | #import "@local/notebookinator:1.0.0"
#import "@preview/codetastic:0.2.2"
#import "@preview/diagraph:0.1.0" |
|
https://github.com/xiongyaohua/typst-template-swjtu-thesis | https://raw.githubusercontent.com/xiongyaohua/typst-template-swjtu-thesis/main/lib.typ | typst | #import "modules/common.typ": 占位, 正文开始, 结论开始, 附录开始
#import "modules/pages.typ": *
// 生成源码和排版结果对照
//
// 应该放在顶层目录中,样例中的image函数才能直接访问images目录。
#let 示例(code) = {
set heading(outlined: false, numbering: none)
show heading: it => {
set text(font: 字体.黑体)
block[
#it.body
]
}
show raw.where(block: true): it => {
set block(width: 100%)
it
}
show figure: set block(breakable: false)
//show table: set block(breakable: true)
figure(numbering: none, table(
columns: (1fr,1fr), align: left,
[#h(1fr)源码#h(1fr)], [#h(1fr)排版结果#h(1fr)],
box(width: 100%, raw(code, lang: "typ", block: true)),
eval(code)
))
par(leading: 0em, hide(text(size: 0pt)[xx])) // 保证下一段提行
}
#let 添加页眉(body) = {
set page(
header: [
#move(
dy: 8pt,
text(
font: 字体.黑体,
size: 字号.小四
)[#h(1fr)西南交通大学本科毕业设计(论文)#h(1fr)]
)
#box(
width: 100%,
line(length: 100%)
)
]
)
body
}
#let 正文(body) = {
正文开始()
set page(footer: [
#set align(center)
#counter(page).display(
"第 1 页",
both: false,
)
])
set heading(numbering: (..nums) => {
if nums.pos().len() == 1 {
numbering("第 1 章", ..nums)
} else {
numbering("1. 1", ..nums)
}
})
set math.equation(numbering: num => {
locate(loc => {
let chapter = counter(heading).at(loc).at(0)
[(#{chapter}--#num)]
})
})
set figure(numbering: num => {
locate(loc => {
let chapter = counter(heading).at(loc).at(0)
[#{chapter}--#num]
})
})
set par(first-line-indent: 2em, leading: 1em)
set list(indent: 2em, tight: false)
set enum(indent: 2em, tight: false)
counter(page).update(1)
body
}
#let 结论(body) = {
结论开始()
set heading(numbering: none)
body
}
#let 附录(body) = {
附录开始()
counter(heading).update(0)
set heading(numbering: (..nums) => {
if nums.pos().len() == 1 {
numbering("附录 A ", ..nums)
} else {
numbering("A. 1 ", ..nums)
}
})
set math.equation(numbering: num => {
locate(loc => {
let chapter = counter(heading).at(loc).at(0)
[(#{numbering("A", chapter)}--#num)]
})
})
set figure(numbering: num => {
locate(loc => {
let chapter = counter(heading).at(loc).at(0)
[#{numbering("A", chapter)}--#num]
})
})
body
}
#let 论文(
题目: 占位[XXXXXXXXXXXX],
年级: 占位[XXXX],
学号: 占位[XXXXXX],
姓名: 占位[XXX],
专业: 占位[XXXX],
指导教师: 占位[XXX],
发题日期: auto,
完成日期: auto,
目的意义: 占位[
#lorem(100)
],
任务: 占位[
#lorem(100)
],
达成度: 占位[
#lorem(100)
],
时间分配: 占位[
#lorem(100)
],
备注: 占位[
#lorem(100)
],
中文关键词: 占位[XXX, XXX],
中文摘要: 占位[
#lorem(100)
],
英文关键词: 占位[XXX, XXX],
英文摘要: 占位[
#lorem(100)
],
body
) = {
let 信息 = arguments(
题目: 题目,
年级: 年级,
学号: 学号,
姓名: 姓名,
专业: 专业,
指导教师: 指导教师,
发题日期: 发题日期,
完成日期: 完成日期,
目的意义: 目的意义,
任务: 任务,
达成度: 达成度,
时间分配: 时间分配,
备注:备注,
中文关键词: 中文关键词,
中文摘要: 中文摘要,
英文关键词: 英文关键词,
英文摘要: 英文摘要
)
show: 全局样式
扉页(
..信息
)
pagebreak(to: "odd")
诚信声明()
授权书()
show: 添加页眉
{
set page(numbering: "第 I 页")
counter(page).update(1)
任务书(
..信息,
)
摘要(
英文: false,
关键词: 信息.named().中文关键词,
信息.named().中文摘要
)
摘要(
英文: true,
关键词: 信息.named().英文关键词,
信息.named().英文摘要
)
show outline.entry: it => {
let font = 字体.宋体
if it.level == 1 {
font = 字体.黑体
}
set text(font: font)
it.body
h(1em)
box(width: 1fr, it.fill)
h(1em)
link(it.element.location(), it.page)
box(width: 0em, height: 1.4em) // Gutter
}
outline(
title: [目#h(1em)录],
depth: 3,
indent: n => {
if n < 2 {
0em
} else {
2em * (n - 1)
}
}
)
pagebreak(weak: true)
}
show: 正文
body
}
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/036%20-%20Guilds%20of%20Ravnica/011_The%20Gathering%20Storm%3A%20Chapter%205.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Gathering Storm: Chapter 5",
set_name: "Guilds of Ravnica",
story_date: datetime(day: 03, month: 07, year: 2019),
author: "<NAME>",
doc
)
<NAME> had never been much for pets.
Once, in his much younger days, he and Elias had owned a puppy. This had been shortly after Ral had begun working for Bolas, and Elias’s poetic career had begun to take off under the dragon’s hidden patronage. Combined with the income from Ral’s work, they had enough to move to apartments that weren’t actually falling to pieces, and Elias had insisted on the dog. Having a small dog was the done thing at the time among the literary set, and ultimately Ral had never been able to refuse Elias anything.
He’d ended up doing most of the work, of course, feeding and cleaning up after the thing, and especially walking it, a task to which the frail Elias was constitutionally unsuited. More years had passed since that time than Ral cared to admit, but he could still remember the feeling of trying to proceed down the street with a modicum of dignity, while being pulled back and forth by the mad dashes of that half-crazed animal.
The #emph[point] was that walking with Hekara was a very similar experience. While they weren’t actually attached by a leash, Ral felt obliged to wait for her when she got distracted, which was constantly. As they walked toward Vitu-Ghazi, the great world-tree that was the center of the Selesnya’s power, they passed onto a network of elevated roadways called the Grand Concourse. On holy days these would be lined with nature worshippers, but today they served as an impromptu market, where Selesnya adherents and outsiders could mingle, and guild members could sell their produce. Men and women knelt on blankets, with the wares spread out in front of them. Every ten feet, Hekara dashed off, spotting another strange fruit or unusual spice she simply had to examine.
#emph[Maybe I ] should#emph[ get her a leash.] Rakdos cultists had worn stranger things. And while the puppy had eventually gotten away from Elias’s unreliable attention and escaped to greener pastures—much to Ral’s relief—for the moment he couldn’t afford for the same to happen to Hekara.
"See these?" she said, as he came up behind her. She gestured down at an arrangement of unusually shaped gourds. "You can dice them with peppers, an’ some other stuffs, an’ it comes out like #emph[mmmmm] ." She turned to him with a bright smile. "Also I once killed this one guy with one of ’em. The trick is, if you snap it off at the stem, it fits right—"
"Hekara," Ral said. "They’re expecting me."
"Right." Hekara waved to the shocked-looking Selesnya woman behind the gourds, who seemed to be examining her merchandise in a new light. "Keen. Let’s move!"
They started walking again. Vitu-Ghazi loomed over everything here, a mammoth tree nearly as tall as New Prahv. Buildings shaped from the living wood nestled in its huge, curving branches, connected by an intricate network of hanging bridges and ladder. Inside the main trunk, Ral knew, there was a cathedral to nature, every bit the size of the Orzhov’s stone-and-glass version. The leaves of the overhanging tree kept the rain off, at least, the water funneling down through carefully designed gutters.
"Hekara an’ Ral," Hekara said in a happy sing-song as they walked. "Partners! Mates! Comrades—"
"Hekara."
"What?"
"We are not partners." Ral blew out a breath. "I am doing my job, and you are here to observe. When we get inside, please #emph[observe] , and don’t contribute."
"What do you mean?"
"I mean #emph[be quiet] ."
After another few steps, he risked a glance over his shoulder. Hekara was still following, her eyes big and forlorn. The puppy had looked at him like that, he recalled. Usually when it had pissed somewhere it wasn’t supposed to and he was trying to chastise it.
#emph[I knew this was a bad idea.]
"Hey," she said, after another minute.
"#emph[What?] " Ral growled.
"We’re not inside yet, so can I contribute something?"
"If you must."
"Somebody’s following us."
Ral glanced over his shoulder again.
"The woman in the black coat," Hekara said. "She’s a ways back, but she’s been there since we got to the Concourse." Her face brightened. "You want me to kill her?"
"No." Ral locked eyes with the figure in black, and got a nod. #emph[Lavinia.] "I’ll talk to her. Stay here."
"I should—"
"I said stay."
Hekara gave a huge sigh and wandered over to the blankets by the side of the street. Ral turned and walked back to where Lavinia stood, arms crossed under her dark coat. He spotted the gleam of metal at her side.
"I thought you didn’t want to be seen with me," Ral said.
"You didn’t give me much of a choice," Lavinia said. "I was making sure I was the only one on your tail."
"And?"
"You’re clear, for the moment. The Selesnya have a surprisingly good counter-intelligence arm." She glanced at Hekara. "Who’s your companion?"
Ral grimaced. "The emissary from Rakdos. The old monster insisted she accompany me so he can be sure we’re not plotting against him."
"That sounds like Rakdos." Lavinia smiled slightly. "You’re having greater success than I anticipated."
"So far." Ral nodded at the world-tree. "We’ll see."
"I wanted to warn you. Bolas’s people have something planned for Selesnya."
"‘Something’ meaning what?"
"I don’t know. I can only intercept a fraction of their communications. But there have definitely been several messages related to something going on here, and soon. It may be timed to coincide with your visit."
"Wonderful. So I need to be careful, but you can’t tell me how or what to do about it."
"Welcome to my world," Lavinia said. "They’re clever, determined, and extremely well-funded. I’m doing the best I can."
The strain was obvious in her pale face, dark circles blooming under her eyes, and Ral felt an unexpected pang of sympathy. He’d always thought of Lavinia as the tireless enforcer of justice, an invincible pillar of the Azorius, but now she was operating outside her former guild and against a much more dangerous opponent.
"All right," he said, more gently. "I’ll do my best. And you be careful, too."
"Of course." She pulled her coat tighter.
"Actually," he said. "I wanted to ask you something."
"What?"
"Vraska," he said. "The new queen of the Golgari. How much do you know about her?"
"She tried to kill Beleren once. Not much else off the top of my head. Why?"
"She wants to meet," Ral said. "I need to know what her position is now."
"I’ll see what I can find out," Lavinia said. "Nothing’s for certain."
"Of course." Ral inclined his head. "Thanks for the warning."
Lavinia turned and walked away, fading into the crowd. Up ahead, Hekara was in a shouting match with an elf girl over some delicate glass ornaments the Rakdos emissary had apparently broken by accident. Ral rolled his eyes and heaved a sigh.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
A centaur woman, clad in flexible wooden armor, greeted Ral and Hekara at the entrance and took them away from the main cathedral, toward the smaller buildings alongside the great tree. She moved at an easy walk, ascending a long, curving stair that was clearly designed with her race in mind.
"Don’t ask," Ral said, when he saw Hekara staring at their escort.
"Why not?"
"Because asking a centaur if you can ride her is a good way to get your head kicked in," Ral said quietly. "Trust me."
"Yeah? Keen, good advice." Hekara looked around curiously. "Lot of blades around, don’t you think?"
"Mmm," Ral said noncommittally.
He’d noticed the heavy military presence himself. Soldiers in green-and-brown armor were everywhere, humans and elves for the most part, but also centaurs and elephant-headed loxodons. On his few previous visits to the world-tree, he didn’t remember such heavy security. #emph[Maybe they got wind of whatever Lavinia was worried about, too.]
<NAME> was waiting for them outside a multi-story building wrapping in a spiral around an enormous branch. She was tall, slim, and graceful, with a mass of golden hair, wearing a shimmering green dress that made her look like a part of the tree herself. Hekara raised her eyebrows appreciatively.
"Remember," Ral hissed. "#emph[Observe.] "
"Right."
A squad of soldiers flanked Emmara, led by a frowning sergeant, their hands on their weapons. She stepped forward to bow to Ral, and he returned the gesture, keeping his expression formal. He hadn’t met Emmara since the Implicit Maze debacle, and while they hadn’t been #emph[precisely] enemies, she’d been close with Beleren and Ral doubted he’d made a good impression.
"<NAME>," she said, in a musical voice. "Thank you for agreeing to see me. I know you must be busy."
"Of course," Ral said. "I’m hoping we can reach an agreement for your guild to participate in the summit."
"I would like that very much," Emmara said, and he caught a hint of frustration in her voice. "Why don’t you come inside?"
The sergeant stepped forward and cleared his throat. "You’ll have to surrender your weapons, sir."
Ral glanced at Emmara, then shrugged. He undid the straps on his bracers and the accumulator, and handed them over to one of the soldiers.
"That’s the latest model," Ral said. "Be careful with it."
"You’ll get your gadgets back safe and sound," the sergeant said dismissively.
"I hope so," Ral said. "They’ve been known explode if they get knocked around."
The sergeant and his men exchanged a worried look, and Ral kept a straight face. It wasn’t true, but the Izzet #emph[did] have that reputation. Another soldier approached Hekara, nervously, and she spread her arms and twirled in a circle, bell tinkling in her hair.
"Nothing but me, yeah?" She grinned at him. "That’s dangerous enough."
The soldiers seemed satisfied. They stood aside to let Ral and Hekara join Emmara, and together they walked through the open door into the building. Like all Selesnya structures, it had a curved, organic look, walls and partitions growing smoothly down from the floor and ceiling. Instead of glass windows, a dense screen of thin branches and leaves let in a soft, friendly light. In the intersection between two corridors, a small, organic fountain burbled quietly.
"I’m sorry about that," Emmara said. "<NAME> has insisted on increased security."
"Any particular reason?" Ral said.
"It’s . . . complicated." She went quiet as a group of soldiers passed by. "I’ll explain in private." She glanced back at Hekara. "Who’s your companion?"
"Oh." Ral took a deep breath. "This is Hekara, the emissary from Rakdos. Hekara, this is <NAME>."
"Keen!" Hekara nodded enthusiastically, producing a gentle tinkling. "So you’re like, the head elf in these parts?"
"Not exactly," Emmara said, with a quiet smile. "We don’t have much formal hierarchy in Selesnya. I have some influence, but . . ." She stopped again as a robed loxodon clomped heavily past, then pointed to a closed door. "In here."
They’d climbed at least two stories up a curving ramp to reach this room, Ral guessed. It was a simple sitting room, with chairs woven from dried branches and a couple of spindly tables. A serving girl was cleaning when they arrived, but she bowed hurriedly to Emmara and rushed out, leaving them alone.
"Sorry," Emmara said, when they were alone. "As I said, things are . . . complicated."
"Evidently," Ral murmured. "I’ve never heard of dissension in Selesnya."
"The current situation is unprecedented." Emmara motioned for them to sit. Ral did, while Hekara wandered over to the window and started trying to pry the weave of branches apart. After a moment, Emmara shrugged and took the seat next to Ral. "Ordinarily, the dryads interpret the will of #emph[Mat’Selesnya] , the Worldsoul, and guide guild policy, with the Trostani at their head."
"It’s a triumvirate, yes?" Ral said. "A council of three dryads who rule Selesnya."
"Not exactly." Emmara sighed. "It’s so hard to explain to outsiders. The Trostani are not three separate beings, but three aspects of the #emph[same] being, a single entity that moves according to the world spirit’s desires. Their three aspects embody Life, Order, and Harmony. Sometimes the needs of one aspect clash with another, but it is never long until they regain consensus."
"Until now?" Ral said.
"Until now," Emmara said sorrowfully. "Harmony has withdrawn entirely, and Life and Order are at cross purposes. The dryads are paralyzed, and we have no way to know the will of Mat’Selesnya. It has thrown the guild into chaos."
"Oh!" Hekara said from by the window. "Have you tried killing two of them? That might help."
"I . . ." Emmara glanced at Ral, then shook her head. "I do not think that would be useful."
"Really? Usually fixes #emph[my] problems." Hekara shrugged.
"While the deadlock continues," Ral said, "who rules Selesnya?"
"As I said, no one #emph[rules] ." Emmara pursed her lips. "I have . . . some influence. Many who believe the guild should be more involved in the affairs of Ravnica agree with my ideas. But Glademaster Garo also has his followers, and he thinks the most prudent course would be to retreat into our enclaves and defend our borders until the trouble has passed."
"The trouble isn’t going to just pass," Ral said. "Not this time. This is #emph[Nicol Bolas] . I know it’s hard to understand what that means, where he comes from, but—"
"That he’s a Planeswalker?" Emmara looked thoughtful. "The idea isn’t as disturbing as I thought it might be. It feels . . . familiar." She shifted uncomfortably. "But Garo doesn’t see why we should risk working with the other guilds when we might not even be threatened."
"Then I need to speak to Garo," Ral said. "I’ll convince him otherwise."
"I asked him to attend this meeting," Emmara said unhappily. "But he refuses."
Ral frowned. "The soldiers are his?"
"They serve the Conclave," Emmara said. "But yes, many of our more martial members count themselves as his adherents."
"Then it seems like he has the whip hand."
"What?" Emmara’s brow wrinkled, and then she laughed. "Oh, no. Garo would not attempt to settle this by the blade. He is not a bad person, <NAME>, please believe me. Only . . . somewhat more cautious then I would like, and firm in his convictions."
Ral let out a breath, fighting frustration. "All right. So what do we do?"
"I am hopeful that you can speak to a few influential people while you’re here. It may serve to tip the balance—"
The door opened, quietly, and the serving girl re-entered, bearing a tray with a steaming pot of tea. Emmara looked up.
"That’s not necessary," she said. "Please, leave us be."
"Sorry, <NAME>." The girl came over and set the tray on one of the tables. "I didn’t mean to interrupt."
Emmara waved a hand, dismissively, and the girl turned to go. Turned—
And reached behind her back—
Ral moved fast, leaping out of his chair and throwing himself toward Emmara. The girl’s hand emerged with a long, slim dagger, which she swung overhand in an arc that would bury it in Emmara’s breast. Emmara herself was looking up, startled, as it came down.
His arm took her around the waist, pulling her down and knocking the lightweight chair out of the way. The assassin’s dagger missed its target, slashing a line of red across Emmara’s upper arm instead. Emmara hit the floor, eyes wide with shock, and Ral turned away from her to find the girl raising her blade for another strike. He brought his hand up, electricity crackling between his fingers, cursing the officious sergeant who’d taken his accumulator—
And then Hekara was standing behind the assassin, as casually as if she’d never moved at all. The Rakdos emissary raised a hand, and steel gleamed between her fingers. She brought the blade down and across in a single smooth motion. A moment later, a crimson line drew itself across the Selesnya girl’s throat. The assassin clutched her neck, blood forcing its way between her fingers. She fell to her knees, then toppled, shuddering.
"Keen!" Hekara said. She tossed her bloody knife into the air, and it vanished before it came down.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"Emmara!" Ral said.
"I’m all right," Emmara said through gritted teeth. She sat up, prodding her bleeding forearm. "It’s not deep."
"Was she one of Garo’s people?"
Emmara glanced at the dead servant and shook her head. "I told you, Garo would never do such a thing. He has been an honorable defender of the Conclave for years."
"Hekara?" Ral said. "Can you poke your head out and see if anything’s going on?"
"Yessir!" Hekara said, with an exaggerated salute. She rushed to the door and peered out into the hall. "Lots of soldiers around. Not going anywhere, just sort of waiting. Nobody else."
"This is a coup," Ral said, shaking his head when Emmara started to object. "Maybe Garo’s not as honorable as you think he is, or maybe someone’s pulling his strings. Doesn’t matter. We need to get out of here—"
Hekara danced back from the door as it opened. An elven soldier in wooden armor came in, his eyes widening at the sight of the bloody mess on the floor. Another pair were close behind him, but Hekara threw herself at the door, slamming it shut in their faces. Ral rushed the man who’d gotten inside. The elf went for his sword, but Ral’s lightning was faster, arcing out from his hand to shimmer briefly across the man’s body. It was a light burst, toppling him to the floor and leaving him shuddering but conscious.
Emmara, who’d gotten to her feet, had torn a strip from her ethereal gown and tied it into a makeshift bandage around her wound. She came over to where the stricken soldier lay, and waved one hand, glowing a brilliant green. Wooden tendrils grew out of the floor, wrapping around the man’s wrists and ankles and fixing him in place.
"What in the name of the Worldsoul is going on?" she demanded. "By whose authority are you here? What do you know about this?"
"I—" The elf shook his head frantically. "You were—we were told—"
"What were you told?" Ral said, electricity crackling dangerous between his fingers. "And by whom?"
"Glademaster Garo said that Mistress Emmara had been murdered!" the elf said. His eyes went to Ral. "By, um, you, <NAME>."
"Clearly I have #emph[not] been murdered," Emmara said, rubbing her arm, "although it was a near thing. Where is Garo now?"
"Upstairs, in the council room."
Emmara got to her feet. "I will go and see him."
"Don’t be foolish," Ral said. He grabbed her uninjured arm and pulled her away from the bound soldiers. "He’s already tried to kill you once. If you walk in there, I guarantee you’re not going to walk out again."
"And if I flee?" Emmara said. "What then? Civil war? I will not have it." She shook her head, and Ral saw tears at the corners of her eyes. "I will confront him #emph[now] , while we can still stop this."
"Ah, Ral?" Hekara said.
"One moment," Ral growled.
"I know I’m supposed to observe," she said, "but these guys are #emph[really] interested in getting through this door. So if you don’t want ’em to get in here, it’d be keen if you helped me out?"
Ral turned. Hekara was leaning against the door with all her weight, and it shook and shuddered under repeated blows from the other side. Her boots scraped up splinters from the floor as she was pushed slowly back.
"At least," Ral hissed, "let me get my equipment back before you confront him. Then I can defend you."
"I can defend myself." Emmara made a half-circle in the air, and the wood of the walls flowed down and around the door, locking it in place. Hekara stepped back with a sigh of relief and stuck her tongue out at the soldiers beyond. "But your assistance would be welcome. The security office is on the first floor."
"How do we get there?" Ral said.
"Out the window?!" Hekara said, bouncing with excitement. "Right?! Keen!"
Emmara nodded. Another gesture sent the branches that sealed off the window bending away, leaving a clear space. The Rakdos emissary ran happily over, doing an impromptu cartwheel in a storm of jingling bells, and threw herself outside.
"I . . . was going to offer to grow us some handholds," Emmara said, looking after her.
"She’ll be fine." Ral looked out at the drop, which was considerable—three stories of building, and hundreds of feet more through the branches of the tree to the city below. "But I’ll take you up on it."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Fortunately, the wood of the world-tree was as easily molded as clay, at least in Emmara’s hands, and so the climb down the outside of the building was not particularly difficult. Hekara managed by producing small blades and jamming them into the wood as she went, which made Emmara wince every time. They bypassed the second-floor windows, working their way around the opposite side of the spiraling building from the front entrance. The grounds, Ral could see, were swarming with soldiers.
On the first floor, Emmara found a window that led to an unoccupied corridor and let them in. Hekara was still bouncing in excitement.
"Where’s the security office?" Ral said.
"Around that corner," Emmara said. "But there will be guards."
Ral looked at his hands, feeling the coiled power within them. "I can handle one or two. Hekara?"
"Hmmmm?" She grinned at him. "Can I help somehow?"
"How many of those little knives have you got?" He frowned. "Where were you keeping them, anyway?"
Hekara blinked. "I’m a razorwitch. I didn’t tell you?"
She held up an empty hand, twisted it with a flourish, and was suddenly holding a double-ended, diamond-shaped blade by the tip. Another flourish, and there was a second one beside it, then a third and a fourth. She opened her hand, and the steel had vanished before it hit the ground.
"That’s handy," Ral muttered. The blades were sharp on both sides, he noted, and up close he could see her fingers were thickly cross-hatched with tiny cuts. #emph[All Rakdos are mad.] "All right. Try not to kill anyone if you don’t have to. We don’t know who is actually working with Garo and who’s just doing their jobs."
"Sigh," Hekara said aloud. "Buzzkill."
"Come on." He beckoned to Emmara, and the three of them went around the corner.
A single door led into the security office, with an armored soldier standing on either side of it. Ral strode up to the first one in a business-like fashion, and before he could bark out a warning Ral slapped a palm against his chest, giving him a sharp jolt of electricity that had him flopping like a landed fish. Emmara gestured sharply at the other, and the wood of the wall reached out and wrapped around his hand as he went for his sword. Ral ignored his shout of alarm and kicked the door.
Two more men sat on either side of a desk in the office, already drawing their weapons. Ral raised his hand, but instead of a lightning bolt only a weak spark crackled between his fingers. He swore and threw himself sideways as the soldier lunged. There was a rapid #emph[thunk-thunk-thunk] sound, knives biting into wood. Emmara grabbed the man who’d attacked by the wrist and used his own momentum against him, tossing him over her shoulder to land in the corner with a clatter. At a gesture, wood rose around him, sealing him in place. When Ral got up, he could see the other soldier was pinned to the opposite wall by a blade thrown into the palm of his hand, and two more bracketed his head. His eyes were as wide as saucers.
"Don’t mind us," Hekara said gayly.
Ral spotted his accumulator and bracers in the corner and snatched them up. Slinging the thing across his back felt like a drink of cold water after a long, thirsty run. He felt his hair rising into its customary frizz, and power crackled over the bracer’s mizzium studs as he strapped them on. Emmara raised a questioning eyebrow.
"All right," Ral said. "#emph[Now] we can go and find Garo."
There were more soldiers in the hall outside, but Emmara held up her hands before they could attack. Their leader, the sergeant Ral had seen earlier, hesitated.
"I don’t know what you’ve been told," Emmara said, "but there has been a terrible misunderstanding. I am going upstairs at this moment to confer with <NAME>."
"What about them?" the sergeant said. "I’ve got orders to arrest them."
"For my murder?" Emmara said.
"I . . ." The sergeant frowned.
"They will be coming with me. Everyone else, please remain at your posts."
She swept up the ramp, dress trailing dramatically behind her. Ral found himself smiling as he hurried along in her wake. #emph[I can always appreciate a good sense of drama.] Two floors up, there was a similar scene, and again the soldiers fell back at Emmara’s command. #emph[Maybe she’s right. Maybe just the one girl was paid off, and this isn’t a full-scale coup.]
On the top floor, a double door led into a wide circular chamber with a large table growing out of the floor in the center of it. At one end of the table was a mess of maps, and a man and a woman stood looking down at them. The man wore living wooden armor, more elaborate than most of the Selesnya soldiers. This, Ral assumed, was Glademaster Garo. The woman beside him was a human in a green robe, red curls spilling out from her head as she leaned over the table. Behind the pair, two heavily armored soldiers waited.
"Garo!" Emmara said.
Garo looked up. It was hard to judge ages, with elves, but his face was more heavily lined than most Ral had seen, and his long white hair was pulled back in a neat queue. For a moment, their gazes met, and Ral felt something deeply #emph[wrong] in the man’s eyes. There was something dead there, as though his skull had been hollowed out and replaced with something vile.
"Emmara," he said. "I had hoped my reports were wrong. Thank goodness you’re all right."
"What is going on?" Emmara said. "Someone tried to kill me!"
"I know," Garo said. "<NAME>. Thankfully, we have him close to hand."
"What?" Emmara’s eyes narrowed. "You . . ."
The red-haired woman gestured, and the doors slammed behind them, wood flowing across them. Garo nodded in their direction.
"Since you’ve so conveniently brought yourself to my doorstep," he said, "we can dispense with the pleasantries. Kill them all, please. Although I’d prefer Zarek’s body be reasonably intact, for display."
Emmara gave a shout of rage and raised her hand, circles of green energy shimmering into life around her. The wooden table groaned and began to twist out of shape, long tendrils winding over and around one another, building up a crude simulacrum of the human form. The red-haired mage made a similar gesture, and another elemental began taking shape in front of her, the two hulking shapes rising up simultaneously.
The two armored soldiers split up, moving around the table in opposite directions. Ral gestured Hekara to the right, and took the other man for himself. The elf closed in, drawing his sword, and Ral sent a bolt of lightning slamming out from one bracer. It connected them in an arc of coruscating electricity, but the blue-white tendrils spun and danced on a sphere centered on the soldier, not quite reaching him.
#emph[Warded.] Ral permitted himself a tight smile. #emph[But they weren’t prepared for ] me#emph[.] Ral poured power into the blast, making the hissing, spitting line of power twitch and writhe like a frantic snake, and he felt the elf’s protections start to crumble. With an almighty #emph[bang] , the shield collapsed, and the concussion blew the soldier across the room. He hit the wall beside Garo and slumped motionless to the floor, gouts of smoke rising from gaps in his armor.
Across the room, Hekara was dancing around the second Selesnya soldier, avoiding his long blade and slicing nimbly at the joints in his armor with her knives. A steady patter of blood already coated the floor beneath him. In the center of the room, the two elementals thrashed, huge wooden limbs ripping and tearing at one another. Emmara and the red-haired mage stood on opposite sides, leaning in as though physically pressed against one another, green energy flaring.
That left Garo. The glademaster frowned and drew his sword, a wooden blade as thin as a razor and etched with glowing runes. Ral aimed a lightning bolt at his head, but he intercepted with his blade, the energy crackling harmlessly over the weapon before dissipating.
"<NAME>." Garo closed, and Ral’s bracers rippled with power. "I should have known you’d cause trouble."
"I’m sorry," Ral said. "Have we met?"
"Oh, yes." Garo smiled. "You don’t remember?"
The elf attacked, smooth and fast. Ral backed away from the first slash and took the second on a bracer, lightning thrashing over the elf’s sword arm. He slashed his hand, and Garo had to duck a wave of lightning and retreat a step. The elf began to circle.
"I think I would recall," Ral said. "Give it up. You’re finished."
"Far from it. I’ve only just begun."
Garo came at him again, a slashing, vicious assault that forced Ral to give ground, blocking with his bracers and countering with slashing waves of plasma. The elf’s attacks grew ever more wild, until he finally left a clear opening, swinging his blade wide and letting Ral slam a shoulder into him and knock him off balance. Before Garo could recover, Ral struck, white-hot power tearing through his wooden armor. Garo let his blade clatter to the ground, sagging against Ral. He coughed, and then smiled, teeth stained crimson.
"You still owe me, <NAME>. Oh, yes." The dying elf coughed again. "And you’re going to pay. One way . . . or the other . . ."
The voice was different. But the tone, the cadence, were all the same. Ral went still.
"Bolas," he breathed.
"Not quite," Garo said. "But . . . the next best thing." Blood poured from his mouth, staining Ral’s shoulder, and he fell to his knees. "See you . . . #emph[soon] ."
Garo collapsed. Ral raised his head, shakily, and saw that the fight was over. One of the elementals had been torn to splinters, and Emmara and her own creature stood over the red-haired mage, who had fallen to her knees, gasping for breath. The second armored soldier was down, too, in a pool of blood. Hekara prodded him, idly, like a cat toying with a dead mouse.
"This . . ." Emmara looked at Ral, then down at Garo. "This is a tragedy."
"It would have been more of a tragedy if he’d succeeded," Ral said. #emph[Kill Emmara, blame me for it, and you’d derail the entire summit. Exactly what Bolas would want.]
#emph[See you soon . . .]
"I agree," Emmara said. She was breathing hard, but there was a hard, wild look in her eyes. "Clearly we have some . . . housekeeping to do. But rest assured, <NAME>, Selesnya will be at your summit."
"Good." Ral leaned against the wall and ran one hand through his hair with a static crackle, restoring its frizz. "Now we’re getting somewhere."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#linebreak "This is ridiculous," Kaya said. "I look ridiculous."
"Would you be quiet?" Tomik said, fiddling with his glasses. "The gray sisters don’t talk."
"The gray sisters are withered corpses," Kaya said. "Someone is going to notice that I’m still, you know. Plump."
"Just keep your head down. Next time you can climb up the outside of the tower again."
Kaya snorted, but stayed quiet. They were back in Orzhova, climbing toward the high cell where Teysa was held. Bringing Kaya through in disguise had been Tomik’s idea. The gray sisters were robed nuns who handled all the menial chores in the cathedral, and could therefore come and go as they pleased. Unfortunately, they were exclusively recruited from deceased worshippers. The robe they’d stolen hadn’t been cleaned since it was last used, Kaya was certain. The smell seemed to be getting worse by the minute.
"Last guard," Tomik muttered.
Kaya kept her head down, saying nothing as Tomik exchanged greetings with the armored soldier. The man let them pass with barely a grunt. As Teysa’s personal secretary, Tomik was the only one allowed in to see her. "Mostly," he’d told Kaya downstairs, "because I’m too unimportant to bother anyone."
Teysa was waiting when they entered, drumming her fingers impatiently on the table. She jumped up as Tomik closed the door. Kaya concentrated for a moment and stepped out through the robe, letting the filthy thing fall to the floor.
"You’re late," Teysa said.
"Sorry," Tomik said. "They’ve increased security since last time."
"So what’s so important that we need to risk a meeting?" Kaya said. "I thought you didn’t want me in here until you were ready."
"I would like to know that as well," Teysa said, looking at Tomik. "You’re the one who suggested this."
"You are?" Kaya looked at the secretary, who gave an uncomfortable shrug.
"I have . . . an idea. A plan, maybe. I don’t like it, but I can’t think of anything better." He took a deep breath. "I might be able to get us the distraction we need to give Kaya a shot at the Ghost Council."
"And keep me alive in the process?" Teysa said. "I’m listening."
"I would prefer to remain alive, too," Kaya said. "If that’s important to your planning. What’s your distraction?"
A pained look passed over Tomik’s face. "<NAME>."
Teysa frowned. "The Izzet guildmage?"
"Yes." Tomik’s cheeks flushed. "He and I are . . . close."
"Close?" Teysa said.
"He means they’re sleeping together," Kaya advised her, in a stage whisper.
Tomik’s blushed deepened further, but he nodded. "Ral has a position of considerable authority at the Izzet. If he were to arrange for an attack on the cathedral, that would certainly give us the opening we’re looking for."
"And potentially start a guild war," Teysa said.
"Not if you become guildmaster afterward," Tomik said.
"Question," Kaya said, raising her hand. "Is this Zarek so desperately in love with you that he’d commit guild forces to this just because you asked him to?"
"I . . . doubt it." Tomik shook his head. "We have to offer him something."
"Gold?" Teysa said.
"He doesn’t care about gold. But he’s arranging a guild summit, and he needs all ten guilds to participate. I know the Obzedat has rejected his invitation outright. If you were to promise to accept it . . ."
"Then he’d have every incentive to help us," Kaya finished. "I like it. Everyone wins."
"Except Grandfather." Teysa grinned. "What’s the subject of the summit?"
"Ral believes that Ravnica will soon be under attack by an ancient dragon named <NAME>," Tomik said. "He wants to organize a common defense of some kind." He shrugged nervously. "At least, that’s the word on the street."
Kaya felt as though someone had removed a wall she’d been leaning against, leaving her stumbling forward. #emph[An ] attack#emph[ by Bolas? He’s coming ] here#emph[?] She exchanged a look with Teysa, but the Orzhov heir had more practice concealing her emotions. Her face was unreadable.
"I’m certain that’s a topic that’s worthy of . . . discussion," she said. "As long as Kaya is amenable?"
"Yeah. Sure." Kaya shook her head. #emph[I need to think about this.] "Sounds fine to me."
"All right." Tomik pushed nervously at his glasses. "I’ll ask him, then."
"Would you rather I do it?" Kaya said. She could tell this wasn’t easy for the secretary. #emph[He’s braver than he looks.] #emph[] #emph[] "No," Tomik said, a little sadly. "Ral trusts me."
|
|
https://github.com/alimitedgroup/alimitedgroup.github.io | https://raw.githubusercontent.com/alimitedgroup/alimitedgroup.github.io/main/verbali/interni/2024-10-18.typ | typst | // VI 18-10-2024
#import "../../lib.typ": *
#set text(lang: "it")
#show: doc => verbale(
regmodifiche: (("0.1.0", "22-10", "<NAME>", "-", "Modifica e verifica documento"),("0.0.2", "21-10", "<NAME>", "-", "Redazione documento"),("0.0.1", "21-10", "<NAME>", "-", "Creazione struttura e template documento"),),
data: [18-10-2024],
versione: [0.1.0],
stato: [Verificato],
presenze: (
"<NAME>",
"<NAME>",
"<NAME>",
"<NAME>",
"<NAME>",
"<NAME>",
"<NAME>",
),
odg: [Seconda riunione di _ALimitedGroup_: vengono discusse le tecnologie da utilizzare durante tutto il progetto, viene confermato quanto discusso nella precedente riunione],
doc,
)
= Informazioni generali
#inizio-verbale-interno([*virtuale*], [*18 Ottobre 2024*], [*17.00*], [*19.30*])
+ Conferma delle decisioni intraprese durante la riunione del 15 Ottobre 2024
+ Discussione sul repository GitHub dedicato alla documentazione
+ Ulteriori discussioni sulla redazione dei verbali
+ Discussione aggiuntiva sui capitolati
#pagebreak()
= Dettaglio riunione
== Conferma delle decisioni
Durante la riunione <NAME> si è detto d'accordo sulle decisioni intraprese nella riunione svoltasi in data 15 Ottobre 2024.
Sono dunque confermate le decisioni descritte al capitolo 2 sezioni 1, 2, 3, 4 e 5 del verbale denominato 2024-10-15.pdf.
In merito alla sezione 6 del capitolo 2 si veda la @capitolati del presente documento.
== Discussione sul _repository GitHub_ dedicato alla documentazione
Durante la riunione è stato deciso di realizzare un _repository_ GitHub dedicato a raccogliere la documentazione relativa al progetto didattico. \
È stato altresì deciso di realizzare un sito web che sarà hostato mediante l'utilizzo di _GitHub Pages_.
Tale _repository_ dovrà in conclusione contenere:
- i _file .typst_ riguardanti la struttura dei verbali
- i _file .typst_ relativi ai singoli verbali
- ulteriori _file_ a supporto dei verbali
- tutti i _file_ relativi al sito web
== Ulteriori discussioni sulla redazione dei verbali
È stato deciso, dopo alcune prove realizzate dal 15 Ottobre 2024 al 17 Ottobre 2024, di utilizzare il linguaggio Typst per la redazione dei documenti.
La struttura dei verbali dovrà contenere, nel seguente ordine:
+ Immagine di copertina formata da logo del gruppo, tipologia di documento (verbale), data svolgimento della riunione, stato del documento, versione, presenti e informazioni riguardanti la distribuzione;
+ Registo delle modifiche, formato da una tabella riportante, per ogni modifica, nuova versione del documento, data della modifica, autore, ruolo attuale dell'autore e descrizione dei cambiamenti;
+ Indice dei contenuti;
+ Capitolo relativo all'informazioni generali della riunone tra cui data, modalità di svolgimento (in presenza o virtuale, da intendersi mediante piattaforma Discord come stabilito dalla sezione 4 del capitolo 2 del verbale nominato 2024-10-15.pdf) e ordine del giorno;
+ riassunto di quanto discusso per ogni punto dell'ordine del giorno;
+ Esiti della riunione.
== Discussione aggiuntiva sui capitolati <capitolati>
Nell'ultima parte della riunione è stato discusso l'interessamento del gruppo verso altri capitolati.\
Il gruppo ha preso in maggiore considerazione il seguente capitolato:\
#align(center)[ C4 = *NearYou - Smart custom advertising platform*] avente come proponente *SyncLab*.
Dopo il sorgere di alcuni dubbi, il gruppo ha rivalutato la possibilità di aderire al capitolato \
#align(center)[C2 = *Vimar GENIALE*] avente come proponente *VIMAR*, perciò si è deciso di ridiscutere alla prossima riunione di tale capitolato per un'analisi più approfondita.
= Esiti della riunione
Il gruppo conclude la riunione stabilendo la necessità di analizzare in maniera asincrona i capitolati alla ricerca di eventuali domande da proporre ad eventuali incontri con altre aziende proponenti.
Decide altresì di realizzare alcuni primi test riguardanti il _repository_ dei documenti e il sito web.
In ultima istanza, a seguito delle decisioni intraprese in merito alla struttura dei verbali, sarà redatto in maniera definitiva il verbale della riunione svolta il 15 Ottobre 2024. |
|
https://github.com/floriandejonckheere/utu-thesis | https://raw.githubusercontent.com/floriandejonckheere/utu-thesis/master/thesis/figures/08-case-study/microservice-size.typ | typst | #import "@preview/cetz:0.2.2": canvas, chart, draw
#let microservice_size_chart = (key) => [
#let data = yaml("/data/" + key + ".yml").at("clusters").at("size").sorted().rev().enumerate(start: 1).map(x => (str(x.at(0)), x.at(1)))
#let total = data.map(p => p.at(1)).sum()
#canvas(length: .75cm, {
let colors = (
cmyk(0%, 75%, 79%, 0%),
cmyk(0%,54%, 52%, 11%),
cmyk(0%,36%, 28%, 24%),
cmyk(0%,20%, 5%, 36%),
cmyk(17%,22%, 0%, 32%),
cmyk(42%,30%, 0%, 24%),
cmyk(85%,40%, 0%, 15%),
cmyk(78%,25%, 0%, 22%),
cmyk(71%,11%, 0%, 29%),
cmyk(65%,0%, 2%, 35%),
cmyk(70%,0%, 17%, 30%),
cmyk(65%,0%, 33%, 25%),
cmyk(62%,0%, 55%, 20%),
cmyk(41%,0%, 58%, 18%),
cmyk(27%,0%, 62%, 17%),
cmyk(16%,0%, 65%, 16%),
cmyk(6%,0%, 70%, 15%),
cmyk(0%,4%, 79%, 10%),
)
chart.piechart(
data,
clockwise: false,
value-key: 1,
label-key: 0,
radius: 3,
slice-style: colors,
inner-radius: 1,
inner-label: (content: (value, label) => if value > 2 [#text(white, str(value))] else [], radius: 100%),
// outer-label: (content: none),
outer-label: (content: (value, label) => if value < 3 [#text(size: 8pt, str(value))] else [], radius: 110%)
)
})
]
|
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/math/frac.typ | typst | // Test fractions.
--- math-frac-baseline ---
// Test that denominator baseline matches in the common case.
$ x = 1/2 = a/(a h) = a/a = a/(1/2) $
--- math-frac-paren-removal ---
// Test parenthesis removal.
$ (|x| + |y|)/2 < [1+2]/3 $
--- math-frac-large ---
// Test large fraction.
$ x = (-b plus.minus sqrt(b^2 - 4a c))/(2a) $
--- math-binom ---
// Test binomial.
$ binom(circle, square) $
--- math-binom-multiple ---
// Test multinomial coefficients.
$ binom(n, k_1, k_2, k_3) $
--- math-binom-missing-lower ---
// Error: 3-13 missing argument: lower
$ binom(x^2) $
--- math-dif ---
// Test dif.
$ (dif y)/(dif x), dif/x, x/dif, dif/dif \
frac(dif y, dif x), frac(dif, x), frac(x, dif), frac(dif, dif) $
--- math-frac-associativity ---
// Test associativity.
$ 1/2/3 = (1/2)/3 = 1/(2/3) $
--- math-frac-precedence ---
// Test precedence.
$ a_1/b_2, 1/f(x), zeta(x)/2, "foo"[|x|]/2 \
1.2/3.7, 2.3^3.4 \
🏳️🌈[x]/2, f [x]/2, phi [x]/2, 🏳️🌈 [x]/2 \
+[x]/2, 1(x)/2, 2[x]/2 \
(a)b/2, b(a)[b]/2 \
n!/2, 5!/2, n !/2, 1/n!, 1/5! $
|
|
https://github.com/lphoogenboom/typstThesisDCSC | https://raw.githubusercontent.com/lphoogenboom/typstThesisDCSC/master/typFiles/titlepage.typ | typst | // !!!!
// STUDENTS, DO NOT EDIT THIS FILE!
// !!!!
#import "../projectInfo.typ": student, report
#let coverUnit = 398.38567pt/0.9 // derived from latex template
#let cu = coverUnit // shorthand
#let pageHeight = 841.89pt
#let white = rgb(255,255,255)
#let black-ish = rgb(6, 6, 12)
#let cyan = rgb(0, 185, 242)
#let imgHeight(image) = context{ // function to measure image height
let measurement = measure(image)
[#measurement.height]
}
#let titlepage( // Cover page function definition
title: "Thesis Title",
subtitle: "Optional Subtitle",
studentName: "<NAME>",
coverIMG: "graphics/COVER.jpg",
body,
) = { //function maps to output
set page(background: none)
set page( // Set page margins for titlepage
margin: (left: (21cm-cu*0.975)/2, right: (21cm-cu*0.975)/2, top: auto, bottom: auto)
)
set align(top+center)
pagebreak()
text(24.88pt, font: "New Computer Modern Sans", weight: 600)[#report.title]; linebreak()
text(14.4pt, font: "New Computer Modern Sans", weight: "semibold")[#report.subtitle]; linebreak(); v(1cm)
smallcaps(text(size: 14.4pt )[#report.type]); linebreak(); v(7cm)
text(14.4pt)[#student.name]; linebreak(); v(1cm)
text(14.4pt)[#datetime.today().display("[month repr:long] [day padding:none], [year]")]; linebreak()
align(bottom)[#text()[Faculty of Mechanical, Maritime and Materials Engineering (ME) · Delft University of
Technology]]
pagebreak()
set text(size: 12pt)
set align(bottom+left)
stack(
dir: ltr,
spacing: 5%,
image("../graphics/template/EXAMPLELOGO.png", width: 25%),
align(horizon)[
#block(
fill: none,
inset: 4pt,
radius: 0pt,
clip: true,
width: 70%,
[The work in this thesis was supported by Aqueduct Swimming Supplies Incorporated. Their cooperation is hereby gratefully acknowledged.]
)]
)
v(1cm)
stack(
dir: ltr,
image("../graphics/template/TU_LOGO.png"),
align(horizon+right)[
#image(
"../graphics/template/DCSCnew.png",
height: 42.27pt
)]
)
[Copyright #sym.copyright]; linebreak()
[All Rights Reserved. ]
body
} |
|
https://github.com/henry-zwart/uva-report-unofficial | https://raw.githubusercontent.com/henry-zwart/uva-report-unofficial/main/lib.typ | typst | MIT License | /*The titlepage template is heavily inspired by the 'Red Agora' title page template:
https://github.com/essmehdi/ensias-report-template/ */
#let titlepage(
title: "",
subtitle: none,
student_name: "",
student_id: "",
lecturer: "",
course_name: "",
course_code: "",
programme: none,
academic_year: none,
school_logo: "resources/uva_logo_nl.svg",
) = {
set line(length: 100%, stroke: 0.5pt)
// Display university logo
block(
height: 20%, width: 100%,
align(center + horizon)[#image(school_logo, width: 70%)]
)
// Title
align(center)[
#if subtitle != none {
text(16pt, tracking: 2pt)[#smallcaps[#subtitle]]
}
#line()
#if title != none {
text(22pt, weight: "bold")[#title]
}
#line()
#text(16pt)[#smallcaps[
#datetime.today().display("[day] [month repr:long] [year]")
]]
]
// Student, lecturer, course details
h(1fr)
grid(
columns: (auto, 1fr, auto),
[
// Student
#text(weight: "bold")[Student] \
#student_name \
#student_id
],
[
// Lecturer
#align(right)[
#text(weight: "bold")[Lecturer] \
#lecturer
]
// Course
#align(right)[
#text(weight: "bold")[Course] \
#course_name \
#course_code
]
]
)
// Programme, academic year
if (programme != none and academic_year != none) {
align(center + bottom)[
#programme \
#text[Academic year: #academic_year]
]
}
}
#let uva-report(
body,
abstract: "",
title: "",
subtitle: none,
student_name: "",
student_id: "",
lecturer: "",
course_name: "",
course_code: "",
programme: none,
academic_year: none,
bibliography_path: none,
school_logo: "resources/uva_logo_nl.svg",
font: "Georgia",
fontsize: 12pt,
) = {
// Set document properties
set document(author: student_name, title: title)
// Display title page first with separate formatting
titlepage(
title: title,
subtitle: subtitle,
student_name: student_name,
student_id: student_id,
lecturer: lecturer,
course_name: course_name,
course_code: course_code,
programme: programme,
academic_year: academic_year,
school_logo: school_logo,
)
let logo = image(school_logo, width: 60%)
let header_title = {
if subtitle != none {
subtitle
} else {
title
}
}
// Page setup
set page(
header: grid(
columns: (auto, 1fr, auto),
align: (left, center, right + top),
box[#logo],
h(1fr),
text(size: 11pt, weight: 100)[#header_title]
),
numbering: "1",
)
set heading(numbering: "1.")
set par(justify: true)
set text(font: font, size: fontsize)
set figure(placement: none)
// Make image caption font size small
show figure.where(kind: image): it => {
set text(size: 9pt)
it
}
// Ensure level-1 headings start on a new page
show heading.where(level: 1): it => {
pagebreak()
it
}
// Contents page: bold main sections, show level 2 indented
set outline(depth: 2, indent: auto)
show outline.entry.where(
level: 1
): it => {
v(12pt, weak: true)
strong(it)
}
// Reset page counter to 1 and display abstract
counter(page).update(1)
{
set par(justify: false)
heading(outlined: false, numbering: none)[Abstract]
abstract
}
// Show table of contents
outline(depth: 2, indent: auto)
body
if bibliography_path != none {
bibliography(bibliography_path)
}
}
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/08-adv-features/boundary.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/components.typ": note
#import "/lib/glossary.typ": tr
#show: web-page-template
// ## Boundary detection
== 边界检测
// ### Name of Allah
=== 真主之名
|
https://github.com/jcbhmr/typst.aur | https://raw.githubusercontent.com/jcbhmr/typst.aur/main/README.md | markdown | <p align=center>
<b><a href="https://archlinux.org/packages/extra/x86_64/typst/">archlinux.org/packages/extra/x86_64/typst</a></b>
</p>
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/linebreak-02.typ | typst | Other | // Test that there are no unwanted line break opportunities on run change.
This is partly emp#emph[has]ized.
|
https://github.com/kunalchandan/resume | https://raw.githubusercontent.com/kunalchandan/resume/main/conf.typ | typst | #let main_font_size = 9pt
#let caption_font_size = 10pt
#let name_font_size = 17pt
#let heading_font_size = 11pt
#let accent_1 = rgb("#57058B")
#let accent_10 = rgb("#BE33DA")
#let accent_2 = rgb("#787878")
#set text(font: ("Jost"), weight: "extralight", size: main_font_size)
#let page_heading(
name : (),
caption : none,
) = {
set align(center)
text(
weight: "extralight",
size: name_font_size,
)[
#name.first
]
text(
size: name_font_size,
fill: accent_1,
weight: "medium",
)[
#name.last
]
linebreak()
text(
size: caption_font_size,
style: "italic",
// fill: rgb(50%, 50%, 50%),
)[
#name.caption
]
linebreak()
text(
size: caption_font_size,
)[
// Consider replacing with a stack?
#link("https://" + name.website)[#name.website]
#h(2fr)
#text(
size: caption_font_size,
style: "italic",
)[
#name.subcaption
]
#h(2fr)
#link("tel:" + name.phone)[#name.phone]
]
linebreak()
text(
size: caption_font_size,
)[
// Consider replacing with a stack?
#link("https://www.github.com/" + name.github)[github/#name.github]
#h(2fr)
#link("mailto:" + name.email)[#name.email]
#h(2fr)
#link("https://www.linkedin.com/in/" + name.linkedin)[linkedin/#name.linkedin]
]
line(
length: 100%,
stroke:0.5pt,
)
}
#let _company_fmt(company) = {
text(
weight: "regular",
size: 10pt,
fill: accent_2,
company
)
}
#let _dates_fmt(dates) = {
text(
weight: "regular",
size: 10pt,
fill: accent_2,
dates
)
}
#let _location_fmt(location) = {
text(
weight: "regular",
size: 10pt,
fill: accent_2,
location
)
}
#let _description_fmt(description) = {
text(
size: main_font_size,
weight: "light",
description
)
}
/// Experience call all sub-bullets given by arrays must have a preceeding content
#let experience(
title : "",
website : "",
company : "",
dates : (
start : "",
end : "",
),
location : "",
description : (),
) = {
if title != "" {
box(heading(
level: 2,
link(website, title)
))
if company != "" {
// For 2 column you'll probably want to change this
linebreak()
// " | "
}
}
if company != "" {
_company_fmt(company)
}
if website != "" {
h(1em)
link(website, box(image("icons/Editor/link.svg", height: heading_font_size*0.7)))
}
// if title != "" and company != "" {
// linebreak()
// }
if dates.start != "" and dates.end != "" {
h(1fr)
_dates_fmt(dates.start + " - " + dates.end + " | ")
}
if location != "" {
_location_fmt(location)
linebreak()
}
_description_fmt(
for (i, desc) in description.enumerate() {
if type(description.at(default : "", i+1)) == "array" {
list(desc + "" + description.at(i+1).map(list).join())
} else if type(desc) == "array" {
} else {
list(desc)
}
}
)
}
// #let exp_list(title : "", items : ()) = {
// for value in items {
// value
// }
// } |
|
https://github.com/UriMtzF/typst-templates | https://raw.githubusercontent.com/UriMtzF/typst-templates/main/uaemex-full-page/main.typ | typst | MIT License | #import "lib.typ": *
#show: project.with(
subject: "Materia",
title: "Título",
authors: (
"Autor 1",
"Autor 2"
),
date: (
year: 2024,
month: 2,
day: 27
),
isIndexed: true
) |
https://github.com/lkoehl/typst-boxes | https://raw.githubusercontent.com/lkoehl/typst-boxes/main/examples/outline-colorbox.typ | typst | MIT License | #import "@dev/colorful-boxes:1.3.1": *
#set page(paper: "a4", margin: 0.5cm, height: auto)
#outline-colorbox(title: lorem(5))[
#lorem(50)
]
#outline-colorbox(title: lorem(5), centering: true, color: "green")[
#lorem(50)
] |
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/par-03.typ | typst | Other | // While we're at it, test the larger block spacing wins.
#set block(spacing: 0pt)
#show raw: set block(spacing: 15pt)
#show list: set block(spacing: 2.5pt)
```rust
fn main() {}
```
- List
Paragraph
|
https://github.com/noahjutz/AD | https://raw.githubusercontent.com/noahjutz/AD/main/notizen/sortieralgorithmen/heapsort/heapify.typ | typst | #import "/components/lefttree.typ": lefttree, connect, box_around, draw_node, bent_line, polygon_around
#import "/components/num_row.typ": single_num_row
#import "/config.typ": theme
#import "@preview/cetz:0.3.0"
#let nums = (34, 45, 38, 43, 23, 18, 12, 17, 34, 7)
#single_num_row(
(34, 45, 38, 43, 23, 18, 12, 17, 34, 7),
hl_primary: 0,
hl_success: range(nums.len()).slice(1)
)
#cetz.canvas({
import cetz.draw: *
import cetz.tree: tree
tree(
lefttree(nums.map(n => str(n))),
draw-node: draw_node.with(hl_primary: 0),
spread: 1.5,
name: "tree",
)
connect(
0, 3,
bent_line.with(bend: -.5, mark: (end: ">"), stroke: theme.fg_light)
)
connect(
1, 3,
bent_line.with(bend: .5, mark: (start: ">"), stroke: theme.fg_light)
)
connect(
0, 1,
bent_line.with(bend: .5, mark: (start: ">"), stroke: theme.fg_light)
)
on-layer(-1, {
box_around(
1, 3, 4, 7, 8, 9,
rect.with(fill: theme.success_light, stroke: none, radius: 14pt)
)
box_around(
2, 5, 6,
rect.with(fill: theme.success_light, stroke: none, radius: 14pt)
)
})
hide(
box_around(
1, 3, 4, 7, 8, 9,
(tl, br) => {
rect(tl, br, name: "heap_l")
}
)
)
hide(
box_around(
2, 5, 6,
(tl, br) => {
rect(tl, br, name: "heap_r")
}
)
)
let d(a) = (rel: (0, -4pt), to: a)
cetz.decorations.flat-brace(
d("heap_l.south-east"),
d("heap_l.south-west"),
name: "left"
)
content("left.content")[Heap]
cetz.decorations.flat-brace(
d("heap_r.south-east"),
d("heap_r.south-west"),
name: "right"
)
content("right.content")[Heap]
}) |
|
https://github.com/kotfind/hse-se-2-notes | https://raw.githubusercontent.com/kotfind/hse-se-2-notes/master/prob/homeworks/to-2024-09-16.typ | typst | = ДЗ 1
== Задача 25 (1)
- (а)
+ При $k > 17$ все карманы пусты. $ P = 1 $
+ При $k <= 17$, $k - 1$ карманов пусты, всего карманов $17$. $ P = (k - 1)/17 $
- (б) $ P = 2/17 dot 1/16 dot 15/15 dot 14/14 = 2/17 dot 1/16 = 1/136 $
- (в) $ P = 1/10 dot 1/10 = 1/100 $
== Задача 26 (4)
- (A)
+ Способов выбрать два туза для первой пачки: $C^2_4$
+ Способов выбрать остальные карты для первой пачки: $C^24_48$
+ Всего способов разделить на две части: $C^26_52$
+ Итого, $ P = (C^2_4 C^24_48)/(C^26_52) $
- (B) Все тузы либо в первой пачке, либо во второй:
$ P=(C^22_48 + C^26_48)/(C^26_52) $
- (C) Либо в первой один туз, а во второй --- три, либо наоборот. Выберем
первую:
$ P=(2 dot C^1_4 C^25_48) / (C^26_54) $
== Задача 27 (5)
- Первый человек родился в некий день из $365$
- Под второго осталось $365 - 1 = 364$
- Под третьего --- $365 - 2 = 363$
- ...
- Под $r$-того --- $365 - r + 1$
$ P = 365/365 dot 364/365 dot ... dot (365 - r + 1)/365 $
При $r = 23: P approx 0.49$
== Задача 28 (6)
#figure(
caption: [Число перестановок],
table(
columns: 2,
[Всего], $6!$,
[Буквы А], $3!$,
[Буквы Н], $2!$,
[Буквы С], $1!$,
[*Различных*], $(6!)/(3! 2! 1!) = 60$,
[*Подходящих*], $1$,
)
)
$ P = 1/60 $
== Задача 29 (7)
Аналогично задаче 5.
$ P = 30/30 dot 29/30 dot ... dot 26/30 = 0.7037(3) $
== Задача 30 (11)
Выбрать получивших номера: $C^6_10$
- (а) Выбрать 6 мужчин: $C^6_6 = 1$. $ P = 1/C^6_10 = 1/210 $
- (б) Выбрать 4 муж --- $C^4_6$, 2 жен --- $C^2_4$.
$ P=(C^4_6 C^2_4)/C^6_10 = 3/7 $
- (в) Обратно пункту а. $ P = 1 - 1/210 = 209/210 $
== Задача 31 (12)
Не все из 12-ти комбинаций равновероятны. Так, например, комбинация `6-4-1`
соответствует шести ситуациям:
#table(
columns: 3,
table.header[*1-ая кость*][*2-ая кость*][*3-ая кость*],
$1$, $4$, $6$,
$1$, $6$, $4$,
$4$, $1$, $6$,
$4$, $6$, $1$,
$6$, $1$, $4$,
$6$, $4$, $1$,
)
Комбинация `4-4-3` --- трем:
#table(
columns: 3,
table.header[*1-ая кость*][*2-ая кость*][*3-ая кость*],
$3$, $4$, $4$,
$4$, $3$, $4$,
$4$, $4$, $3$,
)
А комбинация `4-4-4` --- только одной:
#table(
columns: 3,
table.header[*1-ая кость*][*2-ая кость*][*3-ая кость*],
$4$, $4$, $4$,
)
== Задача 32 (13)
- (а) выберем в одну (первую или вторую) из подгрупп шесть лидирующих и ещё три не лидирующие:
$ P = (2 dot C^6_6 dot C^3_12) / C^9_18 = (2 dot C^3_12) / C^9_18 $
- (б) выберем три лидирующие команды и шесть не лидирующих команд в первую группу:
$ P = (C^3_6 dot C^6_12) / C^9_18 $
== Задача 33 (14)
#table(
columns: 4,
stroke: none,
[шампанское], $5$, $->$, $4$,
[белое вино], $3$, $->$, $2$,
[красное вино], $2$, $->$, $1$,
table.hline(),
[всего], $10$, $->$, $7$,
)
$ P = (C^4_5 dot C^2_3 dot C^1_2) / C^7_10 $
== Задача 34 (15)
- (а) Рассмотрим обратное событие:
#table(
columns: 4,
stroke: none,
[Айова], $2$, $->$, $0$,
[Остальные], $98$, $->$, $50$,
table.hline(),
[Всего], $100$, $->$, $50$,
)
$ P = 1 - (C^0_2 dot C^50_98) / C^50_100 = 1 - C^50_98 / C^50_100 $
- (б)
#table(
columns: 4,
stroke: none,
[Штат 1], $2$, $->$, $1$,
[Штат 2], $2$, $->$, $1$,
table.cell(colspan: 4)[...],
[Штат 50], $2$, $->$, $1$,
table.hline(),
[Всего], $100$, $->$, $50$,
)
$ P = (C^1_2)^50 / C^50_100 = 2^50 / C^50_100 $
== Задача 35
Рассмотрим обратное событие: все ботинки из разных пар.
$ P = 1 - 20/20 dot 18/19 dot 16/18 dot 14/17 $
|
|
https://github.com/pedrofp4444/BD | https://raw.githubusercontent.com/pedrofp4444/BD/main/report/content/[1] Definição do sistema/contexto.typ | typst | #let contexto = {
[
== Contexto de aplicação
Num passado não muito distante, Vizela mantinha-se como uma cidade pequena e remota no norte de Portugal. A vida da população seguia o seu curso tranquilamente e, devido à natureza pacífica da comunidade, a intervenção judicial era mínima. Os crimes esporádicos, que pontuavam a rotina da cidade, eram tratados com eficácia pela modesta "Casa do Xerife”, comandada pelo xerife Vítor <NAME>, indicando uma realidade onde a simplicidade prevalecia na resolução de questões criminais.
Nesse cenário, a pequena “Casa do Xerife” desempenhava um papel vital no controlo do fluxo criminal da cidade. Localizada numa rua modesta, era o ponto central para a administração da justiça local. Os crimes eram resolvidos com relativa rapidez, muitas vezes através de julgamentos informais que refletiam os valores e tradições da comunidade.
Porém, o curso tranquilo da vida em Vizela estava prestes a ser alterado de maneira irreversível. A descoberta dos minerais raros, _nunium_ e _edium_, transformou essa cidade remota num centro de atenção internacional. O que tornava essa descoberta ainda mais extraordinária era a sua capacidade única. A combinação desses minerais resultava na formação de diamantes, um tesouro valioso que despertou a cobiça e o interesse de investidores ao redor do globo.
O influxo económico resultante dessa descoberta não mudou apenas a paisagem de Vizela, mas também trouxe consigo a criação da maior empresa de mineração da Península Ibérica, _Lusium_. Os seus terrenos antes tranquilos e pouco explorados eram agora cobiçados locais de riqueza, gerando uma corrida frenética pela extração desses minérios preciosos.
A prosperidade económica não se limitou apenas à indústria de mineração. Inúmeros comerciantes de joalharias, atraídos pela matéria-prima única disponível em Vizela, estabeleceram-se pela cidade. O brilho dos diamantes criados pela combinação de _nunium_ e _edium_ adornava as vitrines das lojas, transformando Vizela num destino renomeado para os amantes de jóias exclusivas.
Contudo, nem tudo eram rosas na cidade agora florescente. Com a crescente demanda por _nunium_ e _edium_, os roubos aos terrenos repletos de riquezas naturais, administrados pela Lusium, aumentaram significativamente. O xerife <NAME>, que anteriormente conseguia controlar eficazmente os crimes esporádicos, viu-se agora sobrecarregado diante dos desafios impostos pela nova realidade.
Os casos de roubo e furto tornaram-se mais complexos e frequentes, ultrapassando a capacidade da antiga “Casa do Xerife”. A cidade remota de Vizela, outrora conhecida pela sua tranquilidade, agora enfrentava dilemas de segurança e ordem pública, demandando uma abordagem mais estruturada e sofisticada para lidar com os casos crescentes de criminalidade.
]
}
|
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/docs/tinymist/crate-docs.typ | typst | Apache License 2.0 | #import "mod.typ": *
#show: book-page.with(title: "Crate Docs")
#cross-link("/rs/tinymist/index.typ")[Tinymist Crate Docs (for Developers)]
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/009.%20road.html.typ | typst | #set page(
paper: "a5",
margin: (x: 1.8cm, y: 1.5cm),
)
#set text(
font: "Liberation Serif",
size: 10pt,
hyphenate: false
)
#set par(justify: true)
#v(10pt)
= The Other Road Ahead
#v(10pt)
_September 2001_
_(This article explains why much of the next generation of software may be server-based, what that will mean for programmers, and why this new kind of software is a great opportunity for startups. It's derived from a talk at BBN Labs.)_
In the summer of 1995, my friend <NAME> and I decided to start a startup. The PR campaign leading up to Netscape's IPO was running full blast then, and there was a lot of talk in the press about online commerce. At the time there might have been thirty actual stores on the Web, all made by hand. If there were going to be a lot of online stores, there would need to be software for making them, so we decided to write some.
For the first week or so we intended to make this an ordinary desktop application. Then one day we had the idea of making the software run on our Web server, using the browser as an interface. We tried rewriting the software to work over the Web, and it was clear that this was the way to go. If we wrote our software to run on the server, it would be a lot easier for the users and for us as well.
This turned out to be a good plan. Now, as Yahoo Store, this software is the most popular online store builder, with about 14,000 users.
When we started Viaweb, hardly anyone understood what we meant when we said that the software ran on the server. It was not until Hotmail was launched a year later that people started to get it. Now everyone knows that this is a valid approach. There is a name now for what we were: an Application Service Provider, or ASP.
I think that a lot of the next generation of software will be written on this model. Even Microsoft, who have the most to lose, seem to see the inevitablity of moving some things off the desktop. If software moves off the desktop and onto servers, it will mean a very different world for developers. This article describes the surprising things we saw, as some of the first visitors to this new world. To the extent software does move onto servers, what I'm describing here is the future.
== The Next Thing?
When we look back on the desktop software era, I think we'll marvel at the inconveniences people put up with, just as we marvel now at what early car owners put up with. For the first twenty or thirty years, you had to be a car expert to own a car. But cars were such a big win that lots of people who weren't car experts wanted to have them as well.
Computers are in this phase now. When you own a desktop computer, you end up learning a lot more than you wanted to know about what's happening inside it. But more than half the households in the US own one. My mother has a computer that she uses for email and for keeping accounts. About a year ago she was alarmed to receive a letter from Apple, offering her a discount on a new version of the operating system. There's something wrong when a sixty-five year old woman who wants to use a computer for email and accounts has to think about installing new operating systems. Ordinary users shouldn't even know the words "operating system," much less "device driver" or "patch."
There is now another way to deliver software that will save users from becoming system administrators. Web-based applications are programs that run on Web servers and use Web pages as the user interface. For the average user this new kind of software will be easier, cheaper, more mobile, more reliable, and often more powerful than desktop software.
With Web-based software, most users won't have to think about anything except the applications they use. All the messy, changing stuff will be sitting on a server somewhere, maintained by the kind of people who are good at that kind of thing. And so you won't ordinarily need a computer, per se, to use software. All you'll need will be something with a keyboard, a screen, and a Web browser. Maybe it will have wireless Internet access. Maybe it will also be your cell phone. Whatever it is, it will be consumer electronics: something that costs about \$200, and that people choose mostly based on how the case looks. You'll pay more for Internet services than you do for the hardware, just as you do now with telephones. #footnote[Realizing that much of the money is in the services, companies building lightweight clients have usually tried to combine the hardware with an online service. This approach has not worked well, partly because you need two different kinds of companies to build consumer electronics and to run an online service, and partly because users hate the idea. Giving away the razor and making money on the blades may work for Gillette, but a razor is much smaller commitment than a Web terminal. Cell phone handset makers are satisfied to sell hardware without trying to capture the service revenue as well. That should probably be the model for Internet clients too. If someone just sold a nice-looking little box with a Web browser that you could use to connect through any ISP, every technophobe in the country would buy one.]
It will take about a tenth of a second for a click to get to the server and back, so users of heavily interactive software, like Photoshop, will still want to have the computations happening on the desktop. But if you look at the kind of things most people use computers for, a tenth of a second latency would not be a problem. My mother doesn't really need a desktop computer, and there are a lot of people like her.
== The Win for Users
Near my house there is a car with a bumper sticker that reads "death before inconvenience." Most people, most of the time, will take whatever choice requires least work. If Web-based software wins, it will be because it's more convenient. And it looks as if it will be, for users and developers both.
To use a purely Web-based application, all you need is a browser connected to the Internet. So you can use a Web-based application anywhere. When you install software on your desktop computer, you can only use it on that computer. Worse still, your files are trapped on that computer. The inconvenience of this model becomes more and more evident as people get used to networks.
The thin end of the wedge here was Web-based email. Millions of people now realize that you should have access to email messages no matter where you are. And if you can see your email, why not your calendar? If you can discuss a document with your colleagues, why can't you edit it? Why should any of your data be trapped on some computer sitting on a faraway desk?
The whole idea of "your computer" is going away, and being replaced with "your data." You should be able to get at your data from any computer. Or rather, any client, and a client doesn't have to be a computer.
Clients shouldn't store data; they should be like telephones. In fact they may become telephones, or vice versa. And as clients get smaller, you have another reason not to keep your data on them: something you carry around with you can be lost or stolen. Leaving your PDA in a taxi is like a disk crash, except that your data is handed to someone else instead of being vaporized.
With purely Web-based software, neither your data nor the applications are kept on the client. So you don't have to install anything to use it. And when there's no installation, you don't have to worry about installation going wrong. There can't be incompatibilities between the application and your operating system, because the software doesn't run on your operating system.
Because it needs no installation, it will be easy, and common, to try Web-based software before you "buy" it. You should expect to be able to test-drive any Web-based application for free, just by going to the site where it's offered. At Viaweb our whole site was like a big arrow pointing users to the test drive.
After trying the demo, signing up for the service should require nothing more than filling out a brief form (the briefer the better). And that should be the last work the user has to do. With Web-based software, you should get new releases without paying extra, or doing any work, or possibly even knowing about it.
Upgrades won't be the big shocks they are now. Over time applications will quietly grow more powerful. This will take some effort on the part of the developers. They will have to design software so that it can be updated without confusing the users. That's a new problem, but there are ways to solve it.
With Web-based applications, everyone uses the same version, and bugs can be fixed as soon as they're discovered. So Web-based software should have far fewer bugs than desktop software. At Viaweb, I doubt we ever had ten known bugs at any one time. That's orders of magnitude better than desktop software.
Web-based applications can be used by several people at the same time. This is an obvious win for collaborative applications, but I bet users will start to want this in most applications once they realize it's possible. It will often be useful to let two people edit the same document, for example. Viaweb let multiple users edit a site simultaneously, more because that was the right way to write the software than because we expected users to want to, but it turned out that many did.
When you use a Web-based application, your data will be safer. Disk crashes won't be a thing of the past, but users won't hear about them anymore. They'll happen within server farms. And companies offering Web-based applications will actually do backups -- not only because they'll have real system administrators worrying about such things, but because an ASP that does lose people's data will be in big, big trouble. When people lose their own data in a disk crash, they can't get that mad, because they only have themselves to be mad at. When a company loses their data for them, they'll get a lot madder.
Finally, Web-based software should be less vulnerable to viruses. If the client doesn't run anything except a browser, there's less chance of running viruses, and no data locally to damage. And a program that attacked the servers themselves should find them very well defended. #footnote[Security always depends more on not screwing up than any design decision, but the nature of server-based software will make developers pay more attention to not screwing up. Compromising a server could cause such damage that ASPs (that want to stay in business) are likely to be careful about security.]
For users, Web-based software will be less stressful. I think if you looked inside the average Windows user you'd find a huge and pretty much untapped desire for software meeting that description. Unleashed, it could be a powerful force.
== City of Code
To developers, the most conspicuous difference between Web-based and desktop software is that a Web-based application is not a single piece of code. It will be a collection of programs of different types rather than a single big binary. And so designing Web-based software is like desiging a city rather than a building: as well as buildings you need roads, street signs, utilities, police and fire departments, and plans for both growth and various kinds of disasters.
At Viaweb, software included fairly big applications that users talked to directly, programs that those programs used, programs that ran constantly in the background looking for problems, programs that tried to restart things if they broke, programs that ran occasionally to compile statistics or build indexes for searches, programs we ran explicitly to garbage-collect resources or to move or restore data, programs that pretended to be users (to measure performance or expose bugs), programs for diagnosing network troubles, programs for doing backups, interfaces to outside services, software that drove an impressive collection of dials displaying real-time server statistics (a hit with visitors, but indispensable for us too), modifications (including bug fixes) to open-source software, and a great many configuration files and settings. <NAME> wrote a spectacular program for moving stores to new servers across the country, without shutting them down, after we were bought by Yahoo. Programs paged us, sent faxes and email to users, conducted transactions with credit card processors, and talked to one another through sockets, pipes, http requests, ssh, udp packets, shared memory, and files. Some of Viaweb even consisted of the absence of programs, since one of the keys to Unix security is not to run unnecessary utilities that people might use to break into your servers.
It did not end with software. We spent a lot of time thinking about server configurations. We built the servers ourselves, from components -- partly to save money, and partly to get exactly what we wanted. We had to think about whether our upstream ISP had fast enough connections to all the backbones. We serially dated RAID suppliers.
But hardware is not just something to worry about. When you control it you can do more for users. With a desktop application, you can specify certain minimum hardware, but you can't add more. If you administer the servers, you can in one step enable all your users to page people, or send faxes, or send commands by phone, or process credit cards, etc, just by installing the relevant hardware. We always looked for new ways to add features with hardware, not just because it pleased users, but also as a way to distinguish ourselves from competitors who (either because they sold desktop software, or resold Web-based applications through ISPs) didn't have direct control over the hardware.
Because the software in a Web-based application will be a collection of programs rather than a single binary, it can be written in any number of different languages. When you're writing desktop software, you're practically forced to write the application in the same language as the underlying operating system -- meaning C and C++. And so these languages (especially among nontechnical people like managers and VCs) got to be considered as the languages for "serious" software development. But that was just an artifact of the way desktop software had to be delivered. For server-based software you can use any language you want. #footnote[In 1995, when we started Viaweb, Java applets were supposed to be the technology everyone was going to use to develop server-based applications. Applets seemed to us an old-fashioned idea. Download programs to run on the client? Simpler just to go all the way and run the programs on the server. We wasted little time on applets, but countless other startups must have been lured into this tar pit. Few can have escaped alive, or Microsoft could not have gotten away with dropping Java in the most recent version of Explorer.] Today a lot of the top hackers are using languages far removed from C and C++: Perl, Python, and even Lisp.
With server-based software, no one can tell you what language to use, because you control the whole system, right down to the hardware. Different languages are good for different tasks. You can use whichever is best for each. And when you have competitors, "you can" means "you must" (we'll return to this later), because if you don't take advantage of this possibility, your competitors will.
Most of our competitors used C and C++, and this made their software visibly inferior because (among other things), they had no way around the statelessness of CGI scripts. If you were going to change something, all the changes had to happen on one page, with an Update button at the bottom. As I've written elsewhere, by using Lisp, which many people still consider a research language, we could make the Viaweb editor behave more like desktop software.
== Releases
One of the most important changes in this new world is the way you do releases. In the desktop software business, doing a release is a huge trauma, in which the whole company sweats and strains to push out a single, giant piece of code. Obvious comparisons suggest themselves, both to the process and the resulting product.
With server-based software, you can make changes almost as you would in a program you were writing for yourself. You release software as a series of incremental changes instead of an occasional big explosion. A typical desktop software company might do one or two releases a year. At Viaweb we often did three to five releases a day.
When you switch to this new model, you realize how much software development is affected by the way it is released. Many of the nastiest problems you see in the desktop software business are due to catastrophic nature of releases.
When you release only one new version a year, you tend to deal with bugs wholesale. Some time before the release date you assemble a new version in which half the code has been torn out and replaced, introducing countless bugs. Then a squad of QA people step in and start counting them, and the programmers work down the list, fixing them. They do not generally get to the end of the list, and indeed, no one is sure where the end is. It's like fishing rubble out of a pond. You never really know what's happening inside the software. At best you end up with a statistical sort of correctness.
With server-based software, most of the change is small and incremental. That in itself is less likely to introduce bugs. It also means you know what to test most carefully when you're about to release software: the last thing you changed. You end up with a much firmer grip on the code. As a general rule, you do know what's happening inside it. You don't have the source code memorized, of course, but when you read the source you do it like a pilot scanning the instrument panel, not like a detective trying to unravel some mystery.
Desktop software breeds a certain fatalism about bugs. You know that you're shipping something loaded with bugs, and you've even set up mechanisms to compensate for it (e.g. patch releases). So why worry about a few more? Soon you're releasing whole features you know are broken. Apple did this earlier this year. They felt under pressure to release their new OS, whose release date had already slipped four times, but some of the software (support for CDs and DVDs) wasn't ready. The solution? They released the OS without the unfinished parts, and users will have to install them later.
With Web-based software, you never have to release software before it works, and you can release it as soon as it does work.
The industry veteran may be thinking, it's a fine-sounding idea to say that you never have to release software before it works, but what happens when you've promised to deliver a new version of your software by a certain date? With Web-based software, you wouldn't make such a promise, because there are no versions. Your software changes gradually and continuously. Some changes might be bigger than others, but the idea of versions just doesn't naturally fit onto Web-based software.
If anyone remembers Viaweb this might sound odd, because we were always announcing new versions. This was done entirely for PR purposes. The trade press, we learned, thinks in version numbers. They will give you major coverage for a major release, meaning a new first digit on the version number, and generally a paragraph at most for a point release, meaning a new digit after the decimal point.
Some of our competitors were offering desktop software and actually had version numbers. And for these releases, the mere fact of which seemed to us evidence of their backwardness, they would get all kinds of publicity. We didn't want to miss out, so we started giving version numbers to our software too. When we wanted some publicity, we'd make a list of all the features we'd added since the last "release," stick a new version number on the software, and issue a press release saying that the new version was available immediately. Amazingly, no one ever called us on it.
By the time we were bought, we had done this three times, so we were on Version 4. Version 4.1 if I remember correctly. After Viaweb became Yahoo Store, there was no longer such a desperate need for publicity, so although the software continued to evolve, the whole idea of version numbers was quietly dropped.
== Bugs
The other major technical advantage of Web-based software is that you can reproduce most bugs. You have the users' data right there on your disk. If someone breaks your software, you don't have to try to guess what's going on, as you would with desktop software: you should be able to reproduce the error while they're on the phone with you. You might even know about it already, if you have code for noticing errors built into your application.
Web-based software gets used round the clock, so everything you do is immediately put through the wringer. Bugs turn up quickly.
Software companies are sometimes accused of letting the users debug their software. And that is just what I'm advocating. For Web-based software it's actually a good plan, because the bugs are fewer and transient. When you release software gradually you get far fewer bugs to start with. And when you can reproduce errors and release changes instantly, you can find and fix most bugs as soon as they appear. We never had enough bugs at any one time to bother with a formal bug-tracking system.
You should test changes before you release them, of course, so no major bugs should get released. Those few that inevitably slip through will involve borderline cases and will only affect the few users that encounter them before someone calls in to complain. As long as you fix bugs right away, the net effect, for the average
user, is far fewer bugs. I doubt the average Viaweb user ever saw a bug.
Fixing fresh bugs is easier than fixing old ones. It's usually fairly quick to find a bug in code you just wrote. When it turns up you often know what's wrong before you even look at the source, because you were already worrying about it subconsciously. Fixing a bug in something you wrote six months ago (the average case if you release once a year) is a lot more work. And since you don't understand the code as well, you're more likely to fix it in an ugly way, or even introduce more bugs. #footnote[This point is due to <NAME>, who adds "the cost of writing software goes up more than linearly with its size. Perhaps this is mainly due to fixing old bugs, and the cost can be more linear if all bugs are found quickly."]
When you catch bugs early, you also get fewer compound bugs. Compound bugs are two separate bugs that interact: you trip going downstairs, and when you reach for the handrail it comes off in your hand. In software this kind of bug is the hardest to find, and also tends to have the worst consequences. #footnote[The hardest kind of bug to find may be a variant of compound bug where one bug happens to compensate for another. When you fix one bug, the other becomes visible. But it will seem as if the fix is at fault, since that was the last thing you changed.] The traditional "break everything and then filter out the bugs" approach inherently yields a lot of compound bugs. And software that's released in a series of small changes inherently tends not to. The floors are constantly being swept clean of any loose objects that might later get stuck in something.
It helps if you use a technique called functional programming. Functional programming means avoiding side-effects. It's something you're more likely to see in research papers than commercial software, but for Web-based applications it turns out to be really useful. It's hard to write entire programs as purely functional code, but you can write substantial chunks this way. It makes those parts of your software easier to test, because they have no state, and that is very convenient in a situation where you are constantly making and testing small modifications. I wrote much of Viaweb's editor in this style, and we made our scripting language, RTML, a purely functional language.
People from the desktop software business will find this hard to credit, but at Viaweb bugs became almost a game. Since most released bugs involved borderline cases, the users who encountered them were likely to be advanced users, pushing the envelope. Advanced users are more forgiving about bugs, especially since you probably introduced them in the course of adding some feature they were asking for. In fact, because bugs were rare and you had to be doing sophisticated things to see them, advanced users were often proud to catch one. They would call support in a spirit more of triumph than anger, as if they had scored points off us.
== Support
When you can reproduce errors, it changes your approach to customer support. At most software companies, support is offered as a way to make customers feel better. They're either calling you about a known bug, or they're just doing something wrong and you have to figure out what. In either case there's not much you can learn from them. And so you tend to view support calls as a pain in the ass that you want to isolate from your developers as much as possible.
This was not how things worked at Viaweb. At Viaweb, support was free, because we wanted to hear from customers. If someone had a problem, we wanted to know about it right away so that we could reproduce the error and release a fix.
So at Viaweb the developers were always in close contact with support. The customer support people were about thirty feet away from the programmers, and knew that they could always interrupt anything with a report of a genuine bug. We would leave a board meeting to fix a serious bug.
Our approach to support made everyone happier. The customers were delighted. Just imagine how it would feel to call a support line and be treated as someone bringing important news. The customer support people liked it because it meant they could help the users, instead of reading scripts to them. And the programmers liked it because they could reproduce bugs instead of just hearing vague second-hand reports about them.
Our policy of fixing bugs on the fly changed the relationship between customer support people and hackers. At most software companies, support people are underpaid human shields, and hackers are little copies of God the Father, creators of the world. Whatever the procedure for reporting bugs, it is likely to be one-directional: support people who hear about bugs fill out some form that eventually gets passed on (possibly via QA) to programmers, who put it on their list of things to do. It was very different at Viaweb. Within a minute of hearing about a bug from a customer, the support people could be standing next to a programmer hearing him say "Shit, you're right, it's a bug." It delighted the support people to hear that "you're right" from the hackers. They used to bring us bugs with the same expectant air as a cat bringing you a mouse it has just killed. It also made them more careful in judging the seriousness of a bug, because now their honor was on the line.
After we were bought by Yahoo, the customer support people were moved far away from the programmers. It was only then that we realized that they were effectively QA and to some extent marketing as well. In addition to catching bugs, they were the keepers of the knowledge of vaguer, buglike things, like features that confused users. #footnote[Within Viaweb we once had a contest to describe the worst thing about our software. Two customer support people tied for first prize with entries I still shiver to recall. We fixed both problems immediately.] They were also a kind of proxy focus group; we could ask them which of two new features users wanted more, and they were always right.
== Morale
Being able to release software immediately is a big motivator. Often as I was walking to work I would think of some change I wanted to make to the software, and do it that day. This worked for bigger features as well. Even if something was going to take two weeks to write (few projects took longer), I knew I could see the effect in the software as soon as it was done.
If I'd had to wait a year for the next release, I would have shelved most of these ideas, for a while at least. The thing about ideas, though, is that they lead to more ideas. Have you ever noticed that when you sit down to write something, half the ideas that end up in it are ones you thought of while writing it? The same thing happens with software. Working to implement one idea gives you more ideas. So shelving an idea costs you not only that delay in implementing it, but also all the ideas that implementing it would have led to. In fact, shelving an idea probably even inhibits new ideas: as you start to think of some new feature, you catch sight of the shelf and think "but I already have a lot of new things I want to do for the next release."
What big companies do instead of implementing features is plan them. At Viaweb we sometimes ran into trouble on this account. Investors and analysts would ask us what we had planned for the future. The truthful answer would have been, we didn't have any plans. We had general ideas about things we wanted to improve, but if we knew how we would have done it already. What were we going to do in the next six months? Whatever looked like the biggest win. I don't know if I ever dared give this answer, but that was the truth. Plans are just another word for ideas on the shelf. When we thought of good ideas, we implemented them.
At Viaweb, as at many software companies, most code had one definite owner. But when you owned something you really owned it: no one except the owner of a piece of software had to approve (or even know about) a release. There was no protection against breakage except the fear of looking like an idiot to one's peers, and that was more than enough. I may have given the impression that we just blithely plowed forward writing code. We did go fast, but we thought very carefully before we released software onto those servers. And paying attention is more important to reliability than moving slowly. Because he pays close attention, a Navy pilot can land a 40,000 lb. aircraft at 140 miles per hour on a pitching carrier deck, at night, more safely than the average teenager can cut a bagel.
This way of writing software is a double-edged sword of course. It works a lot better for a small team of good, trusted programmers than it would for a big company of mediocre ones, where bad ideas are caught by committees instead of the people that had them.
== Brooks in Reverse
Fortunately, Web-based software does require fewer programmers. I once worked for a medium-sized desktop software company that had over 100 people working in engineering as a whole. Only 13 of these were in product development. All the rest were working on releases, ports, and so on. With Web-based software, all you need (at most) are the 13 people, because there are no releases, ports, and so on.
Viaweb was written by just three people. #footnote[<NAME> wrote the ordering system, which shoppers used to place orders. <NAME> wrote the image generator and the manager, which merchants used to retrieve orders, view statistics, and configure domain names etc. I wrote the editor, which merchants used to build their sites. The ordering system and image generator were written in C and C++, the manager mostly in Perl, and the editor in Lisp.] I was always under pressure to hire more, because we wanted to get bought, and we knew that buyers would have a hard time paying a high price for a company with only three programmers. (Solution: we hired more, but created new projects for them.)
When you can write software with fewer programmers, it saves you more than money. As <NAME> pointed out in _The Mythical Man-Month_, adding people to a project tends to slow it down. The number of possible connections between developers grows exponentially with the size of the group. The larger the group, the more time they'll spend in meetings negotiating how their software will work together, and the more bugs they'll get from unforeseen interactions. Fortunately, this process also works in reverse: as groups get smaller, software development gets exponentially more efficient. I can't remember the programmers at Viaweb ever having an actual meeting. We never had more to say at any one time than we could say as we were walking to lunch.
If there is a downside here, it is that all the programmers have to be to some degree system administrators as well. When you're hosting software, someone has to be watching the servers, and in practice the only people who can do this properly are the ones who wrote the software. At Viaweb our system had so many components and changed so frequently that there was no definite border between software and infrastructure. Arbitrarily declaring such a border would have constrained our design choices. And so although we were constantly hoping that one day ("in a couple months") everything would be stable enough that we could hire someone whose job was just to worry about the servers, it never happened.
I don't think it could be any other way, as long as you're still actively developing the product. Web-based software is never going to be something you write, check in, and go home. It's a live thing, running on your servers right now. A bad bug might not just crash one user's process; it could crash them all. If a bug in your code corrupts some data on disk, you have to fix it. And so on. We found that you don't have to watch the servers every minute (after the first year or so), but you definitely want to keep an eye on things you've changed recently. You don't release code late at night and then go home.
== Watching Users
With server-based software, you're in closer touch with your code. You can also be in closer touch with your users. Intuit is famous for introducing themselves to customers at retail stores and asking to follow them home. If you've ever watched someone use your software for the first time, you know what surprises must have awaited them.
Software should do what users think it will. But you can't have any idea what users will be thinking, believe me, until you watch them. And server-based software gives you unprecedented information about their behavior. You're not limited to small, artificial focus groups. You can see every click made by every user. You have to consider carefully what you're going to look at, because you don't want to violate users' privacy, but even the most general statistical sampling can be very useful.
When you have the users on your server, you don't have to rely on benchmarks, for example. Benchmarks are simulated users. With server-based software, you can watch actual users. To decide what to optimize, just log into a server and see what's consuming all the CPU. And you know when to stop optimizing too: we eventually got the Viaweb editor to the point where it was memory-bound rather than CPU-bound, and since there was nothing we could do to decrease the size of users' data (well, nothing easy), we knew we might as well stop there.
Efficiency matters for server-based software, because you're paying for the hardware. The number of users you can support per server is the divisor of your capital cost, so if you can make your software very efficient you can undersell competitors and still make a profit. At Viaweb we got the capital cost per user down to about \$5. It would be less now, probably less than the cost of sending them the first month's bill. Hardware is free now, if your software is reasonably efficient.
Watching users can guide you in design as well as optimization. Viaweb had a scripting language called RTML that let advanced users define their own page styles. We found that RTML became a kind of suggestion box, because users only used it when the predefined page styles couldn't do what they wanted. Originally the editor put button bars across the page, for example, but after a number of users used RTML to put buttons down the left side, we made that an option (in fact the default) in the predefined page styles.
Finally, by watching users you can often tell when they're in trouble. And since the customer is always right, that's a sign of something you need to fix. At Viaweb the key to getting users was the online test drive. It was not just a series of slides built by marketing people. In our test drive, users actually used the software. It took about five minutes, and at the end of it they had built a real, working store.
The test drive was the way we got nearly all our new users.I think it will be the same for most Web-based applications. If users can get through a test drive successfully, they'll like the product. If they get confused or bored, they won't. So anything we could do to get more people through the test drive would increase our growth rate.
I studied click trails of people taking the test drive and found that at a certain step they would get confused and click on the browser's Back button. (If you try writing Web-based applications, you'll find that the Back button becomes one of your most interesting philosophical problems.) So I added a message at that point, telling users that they were nearly finished, and reminding them not to click on the Back button. Another great thing about Web-based software is that you get instant feedback from changes: the number of people completing the test drive rose immediately from 60% to 90%. And since the number of new users was a function of the number of completed test drives, our revenue growth increased by 50%, just from that change.
== Money
In the early 1990s I read an article in which someone said that software was a subscription business. At first this seemed a very cynical statement. But later I realized that it reflects reality: software development is an ongoing process. I think it's cleaner if you openly charge subscription fees, instead of forcing people to keep buying and installing new versions so that they'll keep paying you. And fortunately, subscriptions are the natural way to bill for Web-based applications.
Hosting applications is an area where companies will play a role that is not likely to be filled by freeware. Hosting applications is a lot of stress, and has real expenses. No one is going to want to do it for free.
For companies, Web-based applications are an ideal source of revenue. Instead of starting each quarter with a blank slate, you have a recurring revenue stream. Because your software evolves gradually, you don't have to worry that a new model will flop; there never need be a new model, per se, and if you do something to the software that users hate, you'll know right away. You have no trouble with uncollectable bills; if someone won't pay you can just turn off the service. And there is no possibility of piracy.
That last "advantage" may turn out to be a problem. Some amount of piracy is to the advantage of software companies. If some user really would not have bought your software at any price, you haven't lost anything if he uses a pirated copy. In fact you gain, because he is one more user helping to make your software the standard -- or who might buy a copy later, when he graduates from high school.
When they can, companies like to do something called price discrimination, which means charging each customer as much as they can afford. #footnote[Price discrimination is so pervasive (how often have you heard a retailer claim that their buying power meant lower prices for you?) that I was surprised to find it was outlawed in the U.S. by the Robinson-Patman Act of 1936. This law does not appear to be vigorously enforced.] Software is particularly suitable for price discrimination, because the marginal cost is close to zero. This is why some software costs more to run on Suns than on Intel boxes: a company that uses Suns is not interested in saving money and can safely be charged more. Piracy is effectively the lowest tier of price discrimination. I think that software companies understand this and deliberately turn a blind eye to some kinds of piracy. #footnote[In No Logo, <NAME> says that clothing brands favored by "urban youth" do not try too hard to prevent shoplifting because in their target market the shoplifters are also the fashion leaders.] With server-based software they are going to have to come up with some other solution.
Web-based software sells well, especially in comparison to desktop software, because it's easy to buy. You might think that people decide to buy something, and then buy it, as two separate steps. That's what I thought before Viaweb, to the extent I thought about the question at all. In fact the second step can propagate back into the first: if something is hard to buy, people will change their mind about whether they wanted it. And vice versa: you'll sell more of something when it's easy to buy. I buy more books because Amazon exists. Web-based software is just about the easiest thing in the world to buy, especially if you have just done an online demo. Users should not have to do much more than enter a credit card number. (Make them do more at your peril.)
Sometimes Web-based software is offered through ISPs acting as resellers. This is a bad idea. You have to be administering the servers, because you need to be constantly improving both hardware and software. If you give up direct control of the servers, you give up most of the advantages of developing Web-based applications.
Several of our competitors shot themselves in the foot this way -- usually, I think, because they were overrun by suits who were excited about this huge potential channel, and didn't realize that it would ruin the product they hoped to sell through it. Selling Web-based software through ISPs is like selling sushi through vending machines.
== Customers
Who will the customers be? At Viaweb they were initially individuals and smaller companies, and I think this will be the rule with Web-based applications. These are the users who are ready to try new things, partly because they're more flexible, and partly because they want the lower costs of new technology.
Web-based applications will often be the best thing for big companies too (though they'll be slow to realize it). The best intranet is the Internet. If a company uses true Web-based applications, the software will work better, the servers will be better administered, and employees will have access to the system from anywhere.
The argument against this approach usually hinges on security: if access is easier for employees, it will be for bad guys too. Some larger merchants were reluctant to use Viaweb because they thought customers' credit card information would be safer on their own servers. It was not easy to make this point diplomatically, but in fact the data was almost certainly safer in our hands than theirs. Who can hire better people to manage security, a technology startup whose whole business is running servers, or a clothing retailer? Not only did we have better people worrying about security, we worried more about it. If someone broke into the clothing retailer's servers, it would affect at most one merchant, could probably be hushed up, and in the worst case might get one person fired. If someone broke into ours, it could affect thousands of merchants, would probably end up as news on CNet, and could put us out of business.
If you want to keep your money safe, do you keep it under your mattress at home, or put it in a bank? This argument applies to every aspect of server administration: not just security, but uptime, bandwidth, load management, backups, etc. Our existence depended on doing these things right. Server problems were the big no-no for us, like a dangerous toy would be for a toy maker, or a salmonella outbreak for a food processor.
A big company that uses Web-based applications is to that extent outsourcing IT. Drastic as it sounds, I think this is generally a good idea. Companies are likely to get better service this way than they would from in-house system administrators. System administrators can become cranky and unresponsive because they're not directly exposed to competitive pressure: a salesman has to deal with customers, and a developer has to deal with competitors' software, but a system administrator, like an old bachelor, has few external forces to keep him in line. #footnote[Companies often wonder what to outsource and what not to. One possible answer: outsource any job that's not directly exposed to competitive pressure, because outsourcing it will thereby expose it to competitive pressure.] At Viaweb we had external forces in plenty to keep us in line. The people calling us were customers, not just co-workers. If a server got wedged, we jumped; just thinking about it gives me a jolt of adrenaline, years later.
So Web-based applications will ordinarily be the right answer for big companies too. They will be the last to realize it, however, just as they were with desktop computers. And partly for the same reason: it will be worth a lot of money to convince big companies that they need something more expensive.
There is always a tendency for rich customers to buy expensive solutions, even when cheap solutions are better, because the people offering expensive solutions can spend more to sell them. At Viaweb we were always up against this. We lost several high-end merchants to Web consulting firms who convinced them they'd be better off if they paid half a million dollars for a custom-made online store on their own server. They were, as a rule, not better off, as more than one discovered when Christmas shopping season came around and loads rose on their server. Viaweb was a lot more sophisticated than what most of these merchants got, but we couldn't afford to tell them. At \$300 a month, we couldn't afford to send a team of well-dressed and authoritative-sounding people to make presentations to customers.
A large part of what big companies pay extra for is the cost of selling expensive things to them. (If the Defense Department pays a thousand dollars for toilet seats, it's partly because it costs a lot to sell toilet seats for a thousand dollars.) And this is one reason intranet software will continue to thrive, even though it is probably a bad idea. It's simply more expensive. There is nothing you can do about this conundrum, so the best plan is to go for the smaller customers first. The rest will come in time.
== Son of Server
Running software on the server is nothing new. In fact it's the old model: mainframe applications are all server-based. If server-based software is such a good idea, why did it lose last time? Why did desktop computers eclipse mainframes?
At first desktop computers didn't look like much of a threat. The first users were all hackers -- or hobbyists, as they were called then. They liked microcomputers because they were cheap. For the first time, you could have your own computer. The phrase "personal computer" is part of the language now, but when it was first used it had a deliberately audacious sound, like the phrase "personal satellite" would today.
Why did desktop computers take over? I think it was because they had better software. And I think the reason microcomputer software was better was that it could be written by small companies.
I don't think many people realize how fragile and tentative startups are in the earliest stage. Many startups begin almost by accident -- as a couple guys, either with day jobs or in school, writing a prototype of something that might, if it looks promising, turn into a company. At this larval stage, any significant obstacle will stop the startup dead in its tracks. Writing mainframe software required too much commitment up front. Development machines were expensive, and because the customers would be big companies, you'd need an impressive-looking sales force to sell it to them. Starting a startup to write mainframe software would be a much more serious undertaking than just hacking something together on your Apple II in the evenings. And so you didn't get a lot of startups writing mainframe applications.
The arrival of desktop computers inspired a lot of new software, because writing applications for them seemed an attainable goal to larval startups. Development was cheap, and the customers would be individual people that you could reach through computer stores or even by mail-order.
The application that pushed desktop computers out into the mainstream was _VisiCalc_, the first spreadsheet. It was written by two guys working in an attic, and yet did things no mainframe software could do. #footnote[The two guys were <NAME> and <NAME>. Dan wrote a prototype in Basic in a couple days, then over the course of the next year they worked together (mostly at night) to make a more powerful version written in 6502 machine language. Dan was at Harvard Business School at the time and Bob nominally had a day job writing software. "There was no great risk in doing a business," Bob wrote, "If it failed it failed. No big deal."] VisiCalc was such an advance, in its time, that people bought Apple IIs just to run it. And this was the beginning of a trend: desktop computers won because startups wrote software for them.
It looks as if server-based software will be good this time around, because startups will write it. Computers are so cheap now that you can get started, as we did, using a desktop computer as a server. Inexpensive processors have eaten the workstation market (you rarely even hear the word now) and are most of the way through the server market; Yahoo's servers, which deal with loads as high as any on the Internet, all have the same inexpensive Intel processors that you have in your desktop machine. And once you've written the software, all you need to sell it is a Web site. Nearly all our users came direct to our site through word of mouth and references in the press. #footnote[It's not quite as easy as I make it sound. It took a painfully long time for word of mouth to get going, and we did not start to get a lot of press coverage until we hired a PR firm (admittedly the best in the business) for \$16,000 per month. However, it was true that the only significant channel was our own Web site.]
Viaweb was a typical larval startup. We were terrified of starting a company, and for the first few months comforted ourselves by treating the whole thing as an experiment that we might call off at any moment. Fortunately, there were few obstacles except technical ones. While we were writing the software, our Web server was the same desktop machine we used for development, connected to the outside world by a dialup line. Our only expenses in that phase were food and rent.
There is all the more reason for startups to write Web-based software now, because writing desktop software has become a lot less fun. If you want to write desktop software now you do it on Microsoft's terms, calling their APIs and working around their buggy OS. And if you manage to write something that takes off, you may find that you were merely doing market research for Microsoft.
If a company wants to make a platform that startups will build on, they have to make it something that hackers themselves will want to use. That means it has to be inexpensive and well-designed. The Mac was popular with hackers when it first came out, and a lot of them wrote software for it. #footnote[If the Mac was so great, why did it lose? Cost, again. Microsoft concentrated on the software business, and unleashed a swarm of cheap component suppliers on Apple hardware. It did not help, either, that suits took over during a critical period.] You see this less with Windows, because hackers don't use it. The kind of people who are good at writing software tend to be running Linux or FreeBSD now.
I don't think we would have started a startup to write desktop software, because desktop software has to run on Windows, and before we could write software for Windows we'd have to use it. The Web let us do an end-run around Windows, and deliver software running on Unix direct to users through the browser. That is a liberating prospect, a lot like the arrival of PCs twenty-five years ago.
== Microsoft
Back when desktop computers arrived, IBM was the giant that everyone was afraid of. It's hard to imagine now, but I remember the feeling very well. Now the frightening giant is Microsoft, and I don't think they are as blind to the threat facing them as IBM was. After all, Microsoft deliberately built their business in IBM's blind spot.
I mentioned earlier that my mother doesn't really need a desktop computer. Most users probably don't. That's a problem for Microsoft, and they know it. If applications run on remote servers, no one needs Windows. What will Microsoft do? Will they be able to use their control of the desktop to prevent, or constrain, this new generation of software?
My guess is that Microsoft will develop some kind of server/desktop hybrid, where the operating system works together with servers they control. At a minimum, files will be centrally available for users who want that. I don't expect Microsoft to go all the way to the extreme of doing the computations on the server, with only a browser for a client, if they can avoid it. If you only need a browser for a client, you don't need Microsoft on the client, and if Microsoft doesn't control the client, they can't push users towards their server-based applications.
I think Microsoft will have a hard time keeping the genie in the bottle. There will be too many different types of clients for them to control them all. And if Microsoft's applications only work with some clients, competitors will be able to trump them by offering applications that work from any client. #footnote[One thing that would help Web-based applications, and help keep the next generation of software from being overshadowed by Microsoft, would be a good open-source browser. Mozilla is open-source but seems to have suffered from having been corporate software for so long. A small, fast browser that was actively maintained would be a great thing in itself, and would probably also encourage companies to build little Web appliances.
Among other things, a proper open-source browser would cause HTTP and HTML to continue to evolve (as e.g. Perl has). It would help Web-based applications greatly to be able to distinguish between selecting a link and following it; all you'd need to do this would be a trivial enhancement of HTTP, to allow multiple urls in a request. Cascading menus would also be good.
If you want to change the world, write a new Mosaic. Think it's too late? In 1998 a lot of people thought it was too late to launch a new search engine, but Google proved them wrong. There is always room for something new if the current options suck enough. Make sure it works on all the free OSes first -- new things start with their users.]
In a world of Web-based applications, there is no automatic place for Microsoft. They may succeed in making themselves a place, but I don't think they'll dominate this new world as they did the world of desktop applications.
It's not so much that a competitor will trip them up as that they will trip over themselves. With the rise of Web-based software, they will be facing not just technical problems but their own wishful thinking. What they need to do is cannibalize their existing business, and I can't see them facing that. The same single-mindedness that has brought them this far will now be working against them. IBM was in exactly the same situation, and they could not master it. IBM made a late and half-hearted entry into the microcomputer business because they were ambivalent about threatening their cash cow, mainframe computing. Microsoft will likewise be hampered by wanting to save the desktop. A cash cow can be a damned heavy monkey on your back.
I'm not saying that no one will dominate server-based applications. Someone probably will eventually. But I think that there will be a good long period of cheerful chaos, just as there was in the early days of microcomputers. That was a good time for startups. Lots of small companies flourished, and did it by making cool things.
== Startups but More So
The classic startup is fast and informal, with few people and little money. Those few people work very hard, and technology magnifies the effect of the decisions they make. If they win, they win big.
In a startup writing Web-based applications, everything you associate with startups is taken to an extreme. You can write and launch a product with even fewer people and even less money. You have to be even faster, and you can get away with being more informal. You can literally launch your product as three guys sitting in the living room of an apartment, and a server collocated at an ISP. We did.
Over time the teams have gotten smaller, faster, and more informal. In 1960, software development meant a roomful of men with horn rimmed glasses and narrow black neckties, industriously writing ten lines of code a day on IBM coding forms. In 1980, it was a team of eight to ten people wearing jeans to the office and typing into vt100s. Now it's a couple of guys sitting in a living room with laptops. (And jeans turn out not to be the last word in informality.)
Startups are stressful, and this, unfortunately, is also taken to an extreme with Web-based applications. Many software companies, especially at the beginning, have periods where the developers slept under their desks and so on. The alarming thing about Web-based software is that there is nothing to prevent this becoming the default. The stories about sleeping under desks usually end: then at last we shipped it and we all went home and slept for a week. Web-based software never ships. You can work 16-hour days for as long as you want to. And because you can, and your competitors can, you tend to be forced to. You can, so you must. It's Parkinson's Law running in reverse.
The worst thing is not the hours but the responsibility. Programmers and system administrators traditionally each have their own separate worries. Programmers have to worry about bugs, and system administrators have to worry about infrastructure. Programmers may spend a long day up to their elbows in source code, but at some point they get to go home and forget about it. System administrators never quite leave the job behind, but when they do get paged at 4:00 AM, they don't usually have to do anything very complicated. With Web-based applications, these two kinds of stress get combined. The programmers become system administrators, but without the sharply defined limits that ordinarily make the job bearable.
At Viaweb we spent the first six months just writing software. We worked the usual long hours of an early startup. In a desktop software company, this would have been the part where we were working hard, but it felt like a vacation compared to the next phase, when we took users onto our server. The second biggest benefit of selling Viaweb to Yahoo (after the money) was to be able to dump ultimate responsibility for the whole thing onto the shoulders of a big company.
Desktop software forces users to become system administrators. Web-based software forces programmers to. There is less stress in total, but more for the programmers. That's not necessarily bad news. If you're a startup competing with a big company, it's good news. #footnote[<NAME>, who probably knows more about this from personal experience than anyone, writes:
#quote(attribution: [<NAME>])["I would go farther in saying that because server-based software is so hard on the programmers, it causes a fundamental economic shift away from large companies. It requires the kind of intensity and dedication from programmers that they will only be willing to provide when it's their own company. Software companies can hire skilled people to work in a not-too-demanding environment, and can hire unskilled people to endure hardships, but they can't hire highly skilled people to bust their asses. Since capital is no longer needed, big companies have little to bring to the table."]] Web-based applications offer a straightforward way to outwork your competitors. No startup asks for more.
== Just Good Enough
One thing that might deter you from writing Web-based applications is the lameness of Web pages as a UI. That is a problem, I admit. There were a few things we would have really liked to add to HTML and HTTP. What matters, though, is that Web pages are just good enough.
There is a parallel here with the first microcomputers. The processors in those machines weren't actually intended to be the CPUs of computers. They were designed to be used in things like traffic lights. But guys like <NAME>, who designed the _Altair_, realized that they were just good enough. You could combine one of these chips with some memory (256 bytes in the first Altair), and front panel switches, and you'd have a working computer. Being able to have your own computer was so exciting that there were plenty of people who wanted to buy them, however limited.
Web pages weren't designed to be a UI for applications, but they're just good enough. And for a significant number of users, software that you can use from any browser will be enough of a win in itself to outweigh any awkwardness in the UI. Maybe you can't write the best-looking spreadsheet using HTML, but you can write a spreadsheet that several people can use simultaneously from different locations without special client software, or that can incorporate live data feeds, or that can page you when certain conditions are triggered. More importantly, you can write new kinds of applications that don't even have names yet. VisiCalc was not merely a microcomputer version of a mainframe application, after all -- it was a new type of application.
Of course, server-based applications don't have to be Web-based. You could have some other kind of client. But I'm pretty sure that's a bad idea. It would be very convenient if you could assume that everyone would install your client -- so convenient that you could easily convince yourself that they all would -- but if they don't, you're hosed. Because Web-based software assumes nothing about the client, it will work anywhere the Web works. That's a big advantage already, and the advantage will grow as new Web devices proliferate. Users will like you because your software just works, and your life will be easier because you won't have to tweak it for every new client. #footnote[In the original version of this essay, I advised avoiding Javascript. That was a good plan in 2001, but Javascript now works.]
I feel like I've watched the evolution of the Web as closely as anyone, and I can't predict what's going to happen with clients. Convergence is probably coming, but where? I can't pick a winner. One thing I can predict is conflict between AOL and Microsoft. Whatever Microsoft's .NET turns out to be, it will probably involve connecting the desktop to servers. Unless AOL fights back, they will either be pushed aside or turned into a pipe between Microsoft client and server software. If Microsoft and AOL get into a client war, the only thing sure to work on both will be browsing the Web, meaning Web-based applications will be the only kind that work
everywhere.
How will it all play out? I don't know. And you don't have to know if you bet on Web-based applications. No one can break that without breaking browsing. The Web may not be the only way to deliver software, but it's one that works now and will continue to work for a long time. Web-based applications are cheap to develop, and easy for even the smallest startup to deliver. They're a lot of work, and of a particularly stressful kind, but that only makes the odds better for startups.
== Why Not?
<NAME> was amused to learn from a farmer friend that many electrified fences don't have any current running through them. The cows apparently learn to stay away from them, and after that you don't need the current. "Rise up, cows!" he wrote, "Take your liberty while despots snore!"
If you're a hacker who has thought of one day starting a startup, there are probably two things keeping you from doing it. One is that you don't know anything about business. The other is that you're afraid of competition. Neither of these fences have any current in them.
There are only two things you have to know about business: build something users love, and make more than you spend. If you get these two right, you'll be ahead of most startups. You can figure out the rest as you go.
You may not at first make more than you spend, but as long as the gap is closing fast enough you'll be ok. If you start out underfunded, it will at least encourage a habit of frugality. The less you spend, the easier it is to make more than you spend. Fortunately, it can be very cheap to launch a Web-based application. We launched on under \$10,000, and it would be even cheaper today. We had to spend thousands on a server, and thousands more to get SSL. (The only company selling SSL software at the time was Netscape.) Now you can rent a much more powerful server, with SSL included, for less than we paid for bandwidth alone. You could launch a Web-based application now for less than the cost of a fancy office chair.
As for building something users love, here are some general tips. Start by making something clean and simple that you would want to use yourself. Get a version 1.0 out fast, then continue to improve the software, listening closely to the users as you do. The customer is always right, but different customers are right about different things; the least sophisticated users show you what you need to simplify and clarify, and the most sophisticated tell you what features you need to add. The best thing software can be is easy, but the way to do this is to get the defaults right, not to limit users' choices. Don't get complacent if your competitors' software is lame; the standard to compare your software to is what it could be, not what your current competitors happen to have. Use your software yourself, all the time. Viaweb was supposed to be an online store builder, but we used it to make our own site too. Don't listen to marketing people or designers or product managers just because of their job titles. If they have good ideas, use them, but it's up to you to decide; software has to be designed by hackers who understand design, not designers who know a little about software. If you can't design software as well as implement it, don't start a startup.
Now let's talk about competition. What you're afraid of is not presumably groups of hackers like you, but actual companies, with offices and business plans and salesmen and so on, right? Well, they are more afraid of you than you are of them, and they're right. It's a lot easier for a couple of hackers to figure out how to rent office space or hire sales people than it is for a company of any size to get software written. I've been on both sides, and I know. When Viaweb was bought by Yahoo, I suddenly found myself working for a big company, and it was like trying to run through waist-deep water.
I don't mean to disparage Yahoo. They had some good hackers, and the top management were real butt-kickers. For a big company, they were exceptional. But they were still only about a tenth as productive as a small startup. No big company can do much better than that. What's scary about Microsoft is that a company so big can develop software at all. They're like a mountain that can walk.
Don't be intimidated. You can do as much that Microsoft can't as they can do that you can't. And no one can stop you. You don't have to ask anyone's permission to develop Web-based applications. You don't have to do licensing deals, or get shelf space in retail stores, or grovel to have your application bundled with the OS. You can deliver software right to the browser, and no one can get between you and potential users without preventing them from browsing the Web.
You may not believe it, but I promise you, Microsoft is scared of you. The complacent middle managers may not be, but Bill is, because he was you once, back in 1975, the last time a new way of delivering software appeared.
|
|
https://github.com/Area-53-Robotics/53B-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53B-Notebook-Over-Under-2023-2024/master/entries/early_season/scrim.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/templates/entries.typ": *
#import "/templates/headers.typ": *
#import "/templates/text.typ": *
#create_default_entry(
title: [Scrimmage],
date: [October 21st, 2023],
witness: [],
design: [],
content: [
#box_header(
title: [Scrim],
color: red.lighten(60%)
) \
#entry_text()
Today was the scrim held by our team. We had four qualification matches and ended 2nd place out of the six teams present. During these qualifications we found that we should probably get an auton, figure out how to place the triball in the same place every time, and maximize the distance we can launch the triballs. For the elimination alliance, we got chosen by 53F but we rejected and then made an alliance with 53E. For our first elimination match we went against 53D and the guest team. Here we would figure out how rigorous defense can be and we would result in losing, this was because 53D got under us and we got stuck in the corner of the field. Something that we noticed is that if we had played more aggressively and pushed more acorns into our side than we would have won instead of playing defensively since our alliance's battery fell out and we had no one scoring. We had also realized that our motors were not protected enough on the bottom of the bot since 53D being under us had potential to really mess up our motors. We added a crossbar in the mid section of the bottom of our bot in order to protect our motors from being so easily accessed.
]
) |
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Maths_Expertes_Ex_19_12_2023.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Maths Expertes Ex 19 12 2023",
authors: (
"<NAME>",
),
date: "17 Décembre, 2023",
)
#set heading(numbering: "1.1.")
=== Exercice 18 p43
<exercice-18-p43>
+ $ z_1 eq minus i $ $ lr(|z_1|) eq sqrt(lr((minus 1))^2) eq 1 $
+ $ z_2 eq minus 2 $ $ lr(|z_2|) eq sqrt(lr((minus 2))^2) eq 2 $
+ $ z_3 eq 3 $ $ lr(|z_3|) eq sqrt(lr((3))^2) eq 3 $
+ $ z_4 eq 18 $ $ lr(|z_4|) eq sqrt(lr((18))^2) eq 18 $
=== Exercice 19 p43
<exercice-19-p43>
$ lr(|z_A|) eq 3 $ $ lr(|z_B|) eq 2 $ $ lr(|z_C|) eq 3 $
$ lr(|z_D|) eq 4 $ $ lr(|z_E|) eq 2 $
$ lr(|z_F|) eq sqrt(2^2 plus lr((minus 2))^2) eq 2 sqrt(2) $
=== Exercice 20 p43
<exercice-20-p43>
+ $ z_1 eq lr((5 plus 2 i)) minus 4 lr((2 plus 3 i)) $
$ z_1 eq 5 plus 2 i minus 8 minus 12 i $ $ z_1 eq minus 3 minus 10 i $
$ lr(|z_1|) eq sqrt(lr((minus 3))^2 plus lr((minus 10))^2) eq sqrt(109) $
+ $ z_2 eq sqrt(3) minus 2 i $
$ lr(|z_2|) eq sqrt(sqrt(3)^2 plus lr((minus 2))^2) eq sqrt(7) $
+ $ z_3 eq lr((1 plus 2 i)) times 5 lr((2 minus 3 i)) $
$ z_3 eq lr((1 plus 2 i)) lr((10 minus 15 i)) $ $ z_3 eq 40 plus 5 i $
$ lr(|z_3|) eq sqrt(40^2 plus 5^2) eq 5 sqrt(65) $
+ $ z_4 eq minus 2 lr((sqrt(3) minus i)) plus 4 lr((6 minus i)) $
$ z_4 eq minus 2 sqrt(3) plus 2 i plus 24 minus 4 i $
$ z_4 eq 24 minus 2 sqrt(3) minus 2 i $
$ lr(|z_4|) eq sqrt(lr((24 minus 2 sqrt(3)))^2 plus lr((minus 2 i))^2) eq sqrt(592 minus 96 sqrt(3)) $
=== Exercice 21 p43
<exercice-21-p43>
$ z_(arrow(u)) eq minus 4 plus 2 i $
$ lr(|z_(arrow(u))|) eq sqrt(lr((minus 4))^2 plus 2^2) eq 2 sqrt(5) $
$ lr(|z_(arrow(u))|) eq parallel arrow(u) parallel $
$ parallel arrow(u) parallel eq 2 sqrt(5) $
=== Exercice 22 p43
<exercice-22-p43>
$ z_A eq minus 3 plus i $ $ z_B eq 2 minus 4 i $
$ A B eq parallel arrow(A B) parallel eq lr(|z_(arrow(A B))|) eq lr(|z_B minus z_A|) $
$ lr(|z_B minus z_A|) eq lr(|2 plus 3 minus 4 i minus i|) eq lr(|5 minus 5 i|) $
$ lr(|z_(arrow(A B))|) eq sqrt(5^2 plus lr((minus 5))^2) eq 5 sqrt(2) $
$ A B eq 5 sqrt(2) $
=== Exercice 24 p43
<exercice-24-p43>
+ $ z_1 eq 1 / 4 plus 1 / 4 i $
$ lr(|z_1|) eq sqrt(lr((1 / 4))^2 plus lr((1 / 4))^2) eq sqrt(2 / 16) eq sqrt(2) / 4 $
Donc $lr(|z_1|) eq.not 1$ soit $z_1 in.not bb(U)$
+ $ z_2 eq frac(minus 3, 4) plus sqrt(7) / 4 i $
$ lr(|z_2|) eq sqrt(lr((frac(minus 3, 4)))^2 plus lr((sqrt(7) / 4))^2) eq sqrt(16 / 16) eq 1 $
Donc $lr(|z_2|) eq 1$ soit $z_2 in bb(U)$
#block[
#set enum(numbering: "1.", start: 3)
+ $ z_3 eq frac(2 sqrt(6), 5) plus 1 / 5 i $
$ lr(|z_3|) eq sqrt(lr((frac(2 sqrt(6), 5)))^2 plus lr((1 / 5))^2) $
$ lr(|z_3|) eq sqrt(25 / 25) eq 1 $
]
Donc $lr(|z_3|) eq 1$ soit $z_3 in bb(U)$
#block[
#set enum(numbering: "1.", start: 4)
+ $ z_4 eq sqrt(5) / 2 minus 1 / 2 i $
$ lr(|z_4|) eq sqrt(lr((sqrt(5) / 2))^2 plus lr((minus 1 / 2))^2) $
$ lr(|z_4|) eq sqrt(6 / 4) eq sqrt(6) / 2 $ Donc $lr(|z_4|) eq.not 1$
soit $z_4 in.not bb(U)$
]
=== Exercice 32 p43
<exercice-32-p43>
Un losange est un quadrilatère avec ses côtés de même longeur. Il s’agit
donc de montrer que $ A B eq D C $
$ arrow.r.double parallel arrow(A B) parallel eq parallel arrow(D C) parallel $
$ arrow.r.double lr(|z_B minus z_A|) eq lr(|z_C minus z_D|) $
On a d’une part :
$ lr(|z_B minus z_A|) eq lr(|7 plus 2 i minus lr((6 plus 5 i))|) eq lr(|1 minus 3 i|) $
$ lr(|z_B minus z_A|) eq lr(|1 minus 3 i|) eq sqrt(1^2 plus lr((minus 3))^2) eq sqrt(10) $
D’autre part :
$ lr(|z_C minus z_D|) eq lr(|10 plus i minus lr((9 plus 4 i))|) eq lr(|1 minus 3 i|) $
$ lr(|z_C minus z_D|) eq lr(|1 minus 3 i|) eq sqrt(1^2 plus lr((minus 3))^2) eq sqrt(10) $
Par conséquent $ lr(|z_B minus z_A|) eq lr(|z_C minus z_D|) $
$ arrow.r.double A B eq D C $ Les côtés du quadrilatère sont de même
longeur donc ABCD est un losange.
|
|
https://github.com/noriHanda/my-resume | https://raw.githubusercontent.com/noriHanda/my-resume/main/modern-resume.typ | typst | The Unlicense | #import "icons.typ": icon, linkIcon
#let colors = (
primary: rgb("#313C4E"),
secondary: rgb("#222A33"),
accentColor: rgb("#449399"),
textPrimary: black,
textSecondary: rgb("#7C7C7C"),
textTertiary: white,
)
#let pageMargin = 16pt
#let textSize = (
Large: 24pt,
large: 14pt,
normal: 11pt,
small: 9pt,
)
#let infoItem(iconName, msg) = {
text(colors.textTertiary, [#icon(iconName, baseline: 0.25em) #msg])
}
#let circularAvatarImage(imagepath) = {
block(
radius: 50%,
clip: true,
stroke: 4pt + colors.accentColor
)[
#image(imagepath, width: 2cm)
]
}
#let headline(name, title, bio, imagepath: "") = {
grid(
columns: (1fr, auto),
align(bottom)[
#text(colors.textTertiary, name, size: textSize.Large)\
#text(colors.accentColor, title)\
#text(colors.textTertiary, bio)
],
if imagepath != "" {
circularAvatarImage(imagepath)
}
)
}
#let contactDetails(contactOptionsDict) = {
if contactOptionsDict.len() == 0 {
return
}
let contactOptionKeyToIconMap = (
linkedin: "linkedin",
email: "envelope",
github: "github",
mobile: "mobile",
location: "location-dot",
website: "globe",
)
// Evenly distribute the contact options among two columns.
let contactOptionDictPairs = contactOptionsDict.pairs()
let midIndex = calc.ceil(contactOptionsDict.len() / 2)
let firstColumnContactOptionsDictPairs = contactOptionDictPairs.slice(0, midIndex)
let secondColumnContactOptionsDictPairs = contactOptionDictPairs.slice(midIndex)
let renderContactOptions(contactOptionDictPairs) = [
#for (key, value) in contactOptionDictPairs [
#infoItem(contactOptionKeyToIconMap.at(key), value)\
]
]
grid(
columns: (.5fr, .5fr),
renderContactOptions(firstColumnContactOptionsDictPairs),
renderContactOptions(secondColumnContactOptionsDictPairs),
)
}
#let headerRibbon(color, content) = {
block(
width: 100%,
fill: color,
inset: (
left: pageMargin,
right: 8pt,
top: 8pt,
bottom: 8pt,
),
content
)
}
#let header(data) = {
grid(
columns: 1,
rows: (auto, auto),
headerRibbon(
colors.primary,
headline(data.name, data.jobTitle, data.at("bio", default: ""), imagepath: data.at("avatarImagePath", default: ""))
),
headerRibbon(
colors.secondary,
contactDetails(data.at("contactOptions", default: ()))
)
)
}
#let pill(msg, fill: false) = {
let content
if fill {
content = rect(
fill: colors.primary.desaturate(1%),
radius: 15%)[
#text(colors.textTertiary)[#msg]
]
} else {
content = rect(
stroke: 1pt + colors.textSecondary.desaturate(1%),
radius: 15%)[#msg]
}
[
#box(content)~
]
}
#let experience(
title: "",
subtitle: "",
facilityDescription: "",
taskDescription: "",
dateFrom: "Present",
dateTo: "Present",
taskDescriptionLabel: "Courses") = [
#text(size: textSize.large)[*#title*]\
#subtitle\
#text(style: "italic")[
#text(colors.accentColor)[#dateFrom - #dateTo]\
#if facilityDescription != "" [
#set text(colors.textSecondary)
#facilityDescription\
]
#text(colors.accentColor)[#taskDescriptionLabel]\
]
#taskDescription
]
#let educationalExperience(..args) = {
experience(..args, taskDescriptionLabel: "Courses")
}
#let workExperience(..args) = {
experience(..args, taskDescriptionLabel: "Achievements/Tasks")
}
#let project(title: "", description: "", subtitle: "", dateFrom: "", dateTo: "") = {
let date = ""
if dateFrom != "" and dateTo != "" {
date = text(style: "italic")[(#dateFrom - #dateTo)]
} else if dateFrom != "" {
date = text(style: "italic")[(#dateFrom)]
}
text(size: textSize.large)[#title #date\ ]
if subtitle != "" {
set text(colors.textSecondary, style: "italic")
text()[#subtitle\ ]
}
if description != "" {
[#description]
}
}
#let modern-resume(data, body) = {
// Configuration
set page(
paper: "a4",
margin: (
top: 0cm,
left: 0cm,
right: 0cm,
bottom: 1cm,
),
)
set text(
font: "Roboto",
size: textSize.normal,
)
set list(marker: (text(colors.accentColor)[•], text(colors.accentColor)[--]))
show heading: it => {
set text(colors.accentColor)
pad(bottom: 0.5em)[
#underline(stroke: 2pt + colors.accentColor, offset: 0.25em)[
#upper(it.body)
]
]
}
// Header
{
show link: it => [
#it #linkIcon("arrow-up-right-from-square")
]
header(data)
}
// Main content
{
show link: it => [
#it #linkIcon("arrow-up-right-from-square", color: colors.accentColor)
]
pad(
left: pageMargin,
right: pageMargin,
top: 8pt
)[#columns(2, body)]
}
}
|
https://github.com/Heinenen/discourse-typst-wasm | https://raw.githubusercontent.com/Heinenen/discourse-typst-wasm/main/README.md | markdown | MIT License | # disource-typst-wasm
This project is used to render Typst documents in Discourse.
It depends on the Typst compiler and provides a suiting imlementation of `typst::World`.
The project is not intended to be used without https://github.com/Heinenen/discourse-typst.
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/meta/document.typ | typst | Apache License 2.0 | // Test document and page-level styles.
---
// This is okay.
#set document(title: "Hello")
What's up?
---
// This, too.
// Ref: false
#set document(author: ("A", "B"), date: datetime.today())
---
// Error: 21-28 expected datetime, none, or auto, found string
#set document(date: "today")
---
// This, too.
// Error: 23-29 expected string, found integer
#set document(author: (123,))
What's up?
---
Hello
// Error: 2-30 document set rules must appear before any content
#set document(title: "Hello")
---
// Error: 10-12 can only be used in set rules
#document()
---
#box[
// Error: 4-32 document set rules are not allowed inside of containers
#set document(title: "Hello")
]
---
#box[
// Error: 4-18 page configuration is not allowed inside of containers
#set page("a4")
]
---
#box[
// Error: 4-15 pagebreaks are not allowed inside of containers
#pagebreak()
]
|
https://github.com/atlanswer/typst-template-ieee | https://raw.githubusercontent.com/atlanswer/typst-template-ieee/main/full.typ | typst | MIT License | #import "ieee_template_full.typ": ieee_full
#show: ieee_full.with(
title: [Preparation of Papers for IEEE TRANSATIONS and JOURNALS (February 2017)],
authors: (
(name: "<NAME>", ieee_membership: "Fellow, IEEE"),
(name: "<NAME>"),
(name: "<NAME>.", ieee_membership: "Member, IEEE"),
),
thanks: (
[This paragraph of the first footnote will contain the date on which you
submitted your paper for review. It will also contain support information,
including sponsor and financial support acknowledgment. For example, "This work
was supported in part by the U.S. Department of Commerce under Grant BS123456."],
[The next few paragraphs should contain the authors' current affiliations,
including current address and e-mail. For example, <NAME> is with the
National Institute of Standards and Technology, Boulder, CO 80305 USA (e-mail:
<EMAIL>).],
[<NAME>., was with Rice University, Houston, TX 77005 USA. He is now
with the Department of Physics, Colorado State University, Fort Collins, CO
80523 USA (e-mail: <EMAIL>).],
[<NAME> is with the Electrical Engineering Department, University of
Colorado, Boulder, CO 80309 USA, on leave from the National Research Institute
for Metals, Tsukuba, Japan (e-mail: <EMAIL>).],
),
abstract: [
These instructions give you guidelines for preparing papers for IEEE
Transactions and Journals. Use this document as a template if you are using
Typst. Otherwise, use this document as an instruction set. The electronic file
of your paper will be formatted further at IEEE. Paper titles should be written
in uppercase and lowercase letters, not all uppercase. Avoid writing long
formulas with subscripts in the title; short formulas that identify the elements
are fine (e.g., "Nd--Fe--B"). Do not write "(Invited)" in the title. Full names
of authors are preferred in the author field, but are not required. Put a space
between authors' initials. The abstract must be a concise yet comprehensive
reflection of what is in your article. In particular, the abstract must be
self-contained, without abbreviations, footnotes, or references. It should be a
microcosm of the full article. The abstract must be between 150--250 words. Be
sure that you adhere to these limits; otherwise, you will need to edit your
abstract accordingly. The abstract must be written as one paragraph, and should
not contain displayed mathematical equations or tabular material. The abstract
should include three or four different keywords or phrases, as this will help
readers to find it. It is important to avoid over-repetition of such phrases as
this can result in a page being rejected by search engines. Ensure that your
abstract reads well and is grammatically correct.
],
// index-terms: (),
bibliography: bibliography("refs.bib"),
)
= Introduction <sec:introduction>
This document is a template for Typst. If you are reading a paper or PDF version
of this document, please download the electronic file, trans\_jour.tex, from the
IEEE Web site at
#underline("http://www.ieee.org/authortools/trans_jour.tex")
so you can use it to prepare your manuscript. If you would prefer to use LaTeX,
download IEEE's LaTeX style and sample files from the same Web page. You can
also explore using the Overleaf editor at
#underline(
"https://www.overleaf.com/blog/278-how-to-use-overleaf-with-ieee-collabratec-your-quick-guide-to-getting-started#.xsVp6tpPkrKM9",
)
If your paper is intended for a conference, please contact your conference
editor concerning acceptable word processor formats for your particular
conference.
IEEE will do the final formatting of your paper. If your paper is intended for a
conference, please observe the conference page limits.
== Abbreviations and Acronyms
Define abbreviations and acronyms the first time they are used in the text, even
after they have already been defined in the abstract. Abbreviations such as
IEEE, SI, ac, and dc do not have to be defined. Abbreviations that incorporate
periods should not have spaces: write "C.N.R.S.," not "<NAME>." Do not use
abbreviations in the title unless they are unavoidable (for example,
"IEEE" in the title of this article).
== Other Recommendations
Use one space after periods and colons. Hyphenate complex modifiers:
"zero-field-cooled magnetization." Avoid dangling participles, such as, "Using
@eq:1, the potential was calculated." [It is not clear who or what used @eq:1.]
Write instead, "The potential was calculated by using @eq:1," or "Using @eq:1,
we calculated the potential."
Use a zero before decimal points: "0.25," not ".25." Use "cm#super[3]," not
"cc." Indicate sample dimensions as "0.1 cm
#math.times 0.2 cm," not "0.1 #math.times 0.2 cm#super[2]." The abbreviation for "seconds"
is "s," not "sec." Use "Wb/m#super[2]" or "webers per square meter," not "webers/m#super[2]."
When expressing a range of values, write "7 to 9" or "7--9," not "7#(math.tilde.op)9."
A parenthetical statement at the end of a sentence is punctuated outside of the
closing parenthesis (like this). (A parenthetical sentence is punctuated within
the parentheses.) In American English, periods and commas are within quotation
marks, like "this period." Other punctuation is "outside"! Avoid contractions;
for example, write "do not" instead of "don't." The serial comma is preferred: "A,
B, and C" instead of "A, B and C."
If you wish, you may write in the first person singular or plural and use the
active voice ("I observed that #math.dots.h" or "We observed that #math.dots.h"
instead of "It was observed that #math.dots.h"). Remember to check spelling. If
your native language is not English, please get a native English-speaking
colleague to carefully proofread your paper.
Try not to use too many typefaces in the same article. You're writing scholarly
papers, not ransom notes. Also please remember that MathJax can't handle really
weird typefaces.
== Equations
Number equations consecutively with equation numbers in parentheses flush with
the right margin, as in @eq:1. To make your equations more compact, you may use
the solidus (~/~), the exp function, or appropriate exponents. Use parentheses
to avoid ambiguities in denominators. Punctuate equations when they are part of
a sentence, as in
$ E = m c^2 $ <eq:1>
Be sure that the symbols in your equation have been defined before the equation
appears or immediately following. Italicize symbols ($T$ might refer to
temperature, but T is the unit tesla). Refer to "@eq:1," not "Eq. @eq:1" or
"equation @eq:1," except at the beginning of a sentence: "Equation @eq:1 is #math.dots.h ."
|
https://github.com/Axot017/CV | https://raw.githubusercontent.com/Axot017/CV/master/modules_en/projects.typ | typst | #import "@preview/brilliant-cv:2.0.2": cvSection, cvEntry
#let metadata = toml("../metadata.toml")
#let cvSection = cvSection.with(metadata: metadata)
#let cvEntry = cvEntry.with(metadata: metadata)
#cvSection("Selected Projects")
#cvEntry(
title: [],
society: [Lottery System],
date: [],
location: [],
description: [
#v(-8pt)
The platform let people buy tickets, play games, and win prizes.
Some of the tasks were selling tickets, generating reports, managing wallets, and calculating winnings.
*Technologies:* Java, Spring, Spock, MongoDB, Keycloak, Golang, MySQL, Docker, GCP, Kubernetes
]
)
#cvEntry(
title: [],
society: [InPost Fresh],
date: [],
location: [],
description: [
#v(-8pt)
An M-commerce servicelication that allows users to shop for groceries from the comfort of their homes.
Users can select the products they need and have them delivered to their doorstep by a courier.
*Technologies:* Flutter, Dart, REST, Firebase, Bitrise, Codemagic
]
)
#cvEntry(
title: [],
society: [Hashiona],
date: [],
location: [],
description: [
#v(-8pt)
A mobile application designed for people suffering from Hashimoto’s disease.
The application allows users to track their symptoms, reminds them to take their medications and supplements, and provides access to a database of articles written by health experts.
*Technologies:* Kotlin, Ktor, MySQL, GCP App Engine, Flutter, Dart, Firebase, Bitrise
]
)
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-0F00.typ | typst | Apache License 2.0 | #let data = (
("TIBETAN SYLLABLE OM", "Lo", 0),
("TIBETAN MARK GTER YIG MGO TRUNCATED A", "So", 0),
("TIBETAN MARK GTER YIG MGO -UM RNAM BCAD MA", "So", 0),
("TIBETAN MARK GTER YIG MGO -UM GTER TSHEG MA", "So", 0),
("TIBETAN MARK INITIAL YIG MGO MDUN MA", "Po", 0),
("TIBETAN MARK CLOSING YIG MGO SGAB MA", "Po", 0),
("TIBETAN MARK CARET YIG MGO PHUR SHAD MA", "Po", 0),
("TIBETAN MARK YIG MGO TSHEG SHAD MA", "Po", 0),
("TIBETAN MARK SBRUL SHAD", "Po", 0),
("TIBETAN MARK BSKUR YIG MGO", "Po", 0),
("TIBETAN MARK BKA- SHOG YIG MGO", "Po", 0),
("TIBETAN MARK INTERSYLLABIC TSHEG", "Po", 0),
("TIBETAN MARK DELIMITER TSHEG BSTAR", "Po", 0),
("TIBETAN MARK SHAD", "Po", 0),
("TIBETAN MARK NYIS SHAD", "Po", 0),
("TIBETAN MARK TSHEG SHAD", "Po", 0),
("TIBETAN MARK NYIS TSHEG SHAD", "Po", 0),
("TIBETAN MARK RIN CHEN SPUNGS SHAD", "Po", 0),
("TIBETAN MARK RGYA GRAM SHAD", "Po", 0),
("TIBETAN MARK CARET -DZUD RTAGS ME LONG CAN", "So", 0),
("TIBETAN MARK GTER TSHEG", "Po", 0),
("TIBETAN LOGOTYPE SIGN CHAD RTAGS", "So", 0),
("TIBETAN LOGOTYPE SIGN LHAG RTAGS", "So", 0),
("TIBETAN ASTROLOGICAL SIGN SGRA GCAN -CHAR RTAGS", "So", 0),
("TIBETAN ASTROLOGICAL SIGN -KHYUD PA", "Mn", 220),
("TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS", "Mn", 220),
("TIBETAN SIGN RDEL DKAR GCIG", "So", 0),
("TIBETAN SIGN RDEL DKAR GNYIS", "So", 0),
("TIBETAN SIGN RDEL DKAR GSUM", "So", 0),
("TIBETAN SIGN RDEL NAG GCIG", "So", 0),
("TIBETAN SIGN RDEL NAG GNYIS", "So", 0),
("TIBETAN SIGN RDEL DKAR RDEL NAG", "So", 0),
("TIBETAN DIGIT ZERO", "Nd", 0),
("TIBETAN DIGIT ONE", "Nd", 0),
("TIBETAN DIGIT TWO", "Nd", 0),
("TIBETAN DIGIT THREE", "Nd", 0),
("TIBETAN DIGIT FOUR", "Nd", 0),
("TIBETAN DIGIT FIVE", "Nd", 0),
("TIBETAN DIGIT SIX", "Nd", 0),
("TIBETAN DIGIT SEVEN", "Nd", 0),
("TIBETAN DIGIT EIGHT", "Nd", 0),
("TIBETAN DIGIT NINE", "Nd", 0),
("TIBETAN DIGIT HALF ONE", "No", 0),
("TIBETAN DIGIT HALF TWO", "No", 0),
("TIBETAN DIGIT HALF THREE", "No", 0),
("TIBETAN DIGIT HALF FOUR", "No", 0),
("TIBETAN DIGIT HALF FIVE", "No", 0),
("TIBETAN DIGIT HALF SIX", "No", 0),
("TIBETAN DIGIT HALF SEVEN", "No", 0),
("TIBETAN DIGIT HALF EIGHT", "No", 0),
("TIBETAN DIGIT HALF NINE", "No", 0),
("TIBETAN DIGIT HALF ZERO", "No", 0),
("TIBETAN MARK BSDUS RTAGS", "So", 0),
("TIBETAN MARK NGAS BZUNG NYI ZLA", "Mn", 220),
("TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN", "So", 0),
("TIBETAN MARK NGAS BZUNG SGOR RTAGS", "Mn", 220),
("TIBETAN MARK CHE MGO", "So", 0),
("TIBETAN MARK TSA -PHRU", "Mn", 216),
("TIBETAN MARK GUG RTAGS GYON", "Ps", 0),
("TIBETAN MARK GUG RTAGS GYAS", "Pe", 0),
("TIBETAN MARK ANG KHANG GYON", "Ps", 0),
("TIBETAN MARK ANG KHANG GYAS", "Pe", 0),
("TIBETAN SIGN YAR TSHES", "Mc", 0),
("TIBETAN SIGN MAR TSHES", "Mc", 0),
("TIBETAN LETTER KA", "Lo", 0),
("TIBETAN LETTER KHA", "Lo", 0),
("TIBETAN LETTER GA", "Lo", 0),
("TIBETAN LETTER GHA", "Lo", 0),
("TIBETAN LETTER NGA", "Lo", 0),
("TIBETAN LETTER CA", "Lo", 0),
("TIBETAN LETTER CHA", "Lo", 0),
("TIBETAN LETTER JA", "Lo", 0),
(),
("TIBETAN LETTER NYA", "Lo", 0),
("TIBETAN LETTER TTA", "Lo", 0),
("TIBETAN LETTER TTHA", "Lo", 0),
("TIBETAN LETTER DDA", "Lo", 0),
("TIBETAN LETTER DDHA", "Lo", 0),
("TIBETAN LETTER NNA", "Lo", 0),
("TIBETAN LETTER TA", "Lo", 0),
("TIBETAN LETTER THA", "Lo", 0),
("TIBETAN LETTER DA", "Lo", 0),
("TIBETAN LETTER DHA", "Lo", 0),
("TIBETAN LETTER NA", "Lo", 0),
("TIBETAN LETTER PA", "Lo", 0),
("TIBETAN LETTER PHA", "Lo", 0),
("TIBETAN LETTER BA", "Lo", 0),
("TIBETAN LETTER BHA", "Lo", 0),
("TIBETAN LETTER MA", "Lo", 0),
("TIBETAN LETTER TSA", "Lo", 0),
("TIBETAN LETTER TSHA", "Lo", 0),
("TIBETAN LETTER DZA", "Lo", 0),
("TIBETAN LETTER DZHA", "Lo", 0),
("TIBETAN LETTER WA", "Lo", 0),
("TIBETAN LETTER ZHA", "Lo", 0),
("TIBETAN LETTER ZA", "Lo", 0),
("TIBETAN LETTER -A", "Lo", 0),
("TIBETAN LETTER YA", "Lo", 0),
("TIBETAN LETTER RA", "Lo", 0),
("TIBETAN LETTER LA", "Lo", 0),
("TIBETAN LETTER SHA", "Lo", 0),
("TIBETAN LETTER SSA", "Lo", 0),
("TIBETAN LETTER SA", "Lo", 0),
("TIBETAN LETTER HA", "Lo", 0),
("TIBETAN LETTER A", "Lo", 0),
("TIBETAN LETTER KSSA", "Lo", 0),
("TIBETAN LETTER FIXED-FORM RA", "Lo", 0),
("TIBETAN LETTER KKA", "Lo", 0),
("TIBETAN LETTER RRA", "Lo", 0),
(),
(),
(),
(),
("TIBETAN VOWEL SIGN AA", "Mn", 129),
("TIBETAN VOWEL SIGN I", "Mn", 130),
("TIBETAN VOWEL SIGN II", "Mn", 0),
("TIBETAN VOWEL SIGN U", "Mn", 132),
("TIBETAN VOWEL SIGN UU", "Mn", 0),
("TIBETAN VOWEL SIGN VOCALIC R", "Mn", 0),
("TIBETAN VOWEL SIGN VOCALIC RR", "Mn", 0),
("TIBETAN VOWEL SIGN VOCALIC L", "Mn", 0),
("TIBETAN VOWEL SIGN VOCALIC LL", "Mn", 0),
("TIBETAN VOWEL SIGN E", "Mn", 130),
("TIBETAN VOWEL SIGN EE", "Mn", 130),
("TIBETAN VOWEL SIGN O", "Mn", 130),
("TIBETAN VOWEL SIGN OO", "Mn", 130),
("TIBETAN SIGN RJES SU NGA RO", "Mn", 0),
("TIBETAN SIGN RNAM BCAD", "Mc", 0),
("TIBETAN VOWEL SIGN REVERSED I", "Mn", 130),
("TIBETAN VOWEL SIGN REVERSED II", "Mn", 0),
("TIBETAN SIGN NYI ZLA NAA DA", "Mn", 230),
("TIBETAN SIGN SNA LDAN", "Mn", 230),
("TIBETAN MARK HALANTA", "Mn", 9),
("TIBETAN MARK PALUTA", "Po", 0),
("TIBETAN SIGN LCI RTAGS", "Mn", 230),
("TIBETAN SIGN YANG RTAGS", "Mn", 230),
("TIBETAN SIGN LCE TSA CAN", "Lo", 0),
("TIBETAN SIGN MCHU CAN", "Lo", 0),
("TIBETAN SIGN GRU CAN RGYINGS", "Lo", 0),
("TIBETAN SIGN GRU MED RGYINGS", "Lo", 0),
("TIBETAN SIGN INVERTED MCHU CAN", "Lo", 0),
("TIBETAN SUBJOINED SIGN LCE TSA CAN", "Mn", 0),
("TIBETAN SUBJOINED SIGN MCHU CAN", "Mn", 0),
("TIBETAN SUBJOINED SIGN INVERTED MCHU CAN", "Mn", 0),
("TIBETAN SUBJOINED LETTER KA", "Mn", 0),
("TIBETAN SUBJOINED LETTER KHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER GA", "Mn", 0),
("TIBETAN SUBJOINED LETTER GHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER NGA", "Mn", 0),
("TIBETAN SUBJOINED LETTER CA", "Mn", 0),
("TIBETAN SUBJOINED LETTER CHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER JA", "Mn", 0),
(),
("TIBETAN SUBJOINED LETTER NYA", "Mn", 0),
("TIBETAN SUBJOINED LETTER TTA", "Mn", 0),
("TIBETAN SUBJOINED LETTER TTHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER DDA", "Mn", 0),
("TIBETAN SUBJOINED LETTER DDHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER NNA", "Mn", 0),
("TIBETAN SUBJOINED LETTER TA", "Mn", 0),
("TIBETAN SUBJOINED LETTER THA", "Mn", 0),
("TIBETAN SUBJOINED LETTER DA", "Mn", 0),
("TIBETAN SUBJOINED LETTER DHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER NA", "Mn", 0),
("TIBETAN SUBJOINED LETTER PA", "Mn", 0),
("TIBETAN SUBJOINED LETTER PHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER BA", "Mn", 0),
("TIBETAN SUBJOINED LETTER BHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER MA", "Mn", 0),
("TIBETAN SUBJOINED LETTER TSA", "Mn", 0),
("TIBETAN SUBJOINED LETTER TSHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER DZA", "Mn", 0),
("TIBETAN SUBJOINED LETTER DZHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER WA", "Mn", 0),
("TIBETAN SUBJOINED LETTER ZHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER ZA", "Mn", 0),
("TIBETAN SUBJOINED LETTER -A", "Mn", 0),
("TIBETAN SUBJOINED LETTER YA", "Mn", 0),
("TIBETAN SUBJOINED LETTER RA", "Mn", 0),
("TIBETAN SUBJOINED LETTER LA", "Mn", 0),
("TIBETAN SUBJOINED LETTER SHA", "Mn", 0),
("TIBETAN SUBJOINED LETTER SSA", "Mn", 0),
("TIBETAN SUBJOINED LETTER SA", "Mn", 0),
("TIBETAN SUBJOINED LETTER HA", "Mn", 0),
("TIBETAN SUBJOINED LETTER A", "Mn", 0),
("TIBETAN SUBJOINED LETTER KSSA", "Mn", 0),
("TIBETAN SUBJOINED LETTER FIXED-FORM WA", "Mn", 0),
("TIBETAN SUBJOINED LETTER FIXED-FORM YA", "Mn", 0),
("TIBETAN SUBJOINED LETTER FIXED-FORM RA", "Mn", 0),
(),
("TIBETAN KU RU KHA", "So", 0),
("TIBETAN KU RU KHA BZHI MIG CAN", "So", 0),
("TIBETAN CANTILLATION SIGN HEAVY BEAT", "So", 0),
("TIBETAN CANTILLATION SIGN LIGHT BEAT", "So", 0),
("TIBETAN CANTILLATION SIGN CANG TE-U", "So", 0),
("TIBETAN CANTILLATION SIGN SBUB -CHAL", "So", 0),
("TIBETAN SYMBOL DRIL BU", "So", 0),
("TIBETAN SYMBOL RDO RJE", "So", 0),
("TIBETAN SYMBOL PADMA GDAN", "Mn", 220),
("TIBETAN SYMBOL RDO RJE RGYA GRAM", "So", 0),
("TIBETAN SYMBOL PHUR PA", "So", 0),
("TIBETAN SYMBOL NOR BU", "So", 0),
("TIBETAN SYMBOL NOR BU NYIS -KHYIL", "So", 0),
("TIBETAN SYMBOL NOR BU GSUM -KHYIL", "So", 0),
("TIBETAN SYMBOL NOR BU BZHI -KHYIL", "So", 0),
(),
("TIBETAN SIGN RDEL NAG RDEL DKAR", "So", 0),
("TIBETAN SIGN RDEL NAG GSUM", "So", 0),
("TIBETAN MARK BSKA- SHOG GI MGO RGYAN", "Po", 0),
("TIBETAN MARK MNYAM YIG GI MGO RGYAN", "Po", 0),
("TIBETAN MARK NYIS TSHEG", "Po", 0),
("TIBETAN MARK INITIAL BRDA RNYING YIG MGO MDUN MA", "Po", 0),
("TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA", "Po", 0),
("RIGHT-FACING SVASTI SIGN", "So", 0),
("LEFT-FACING SVASTI SIGN", "So", 0),
("RIGHT-FACING SVASTI SIGN WITH DOTS", "So", 0),
("LEFT-FACING SVASTI SIGN WITH DOTS", "So", 0),
("TIBETAN MARK LEADING MCHAN RTAGS", "Po", 0),
("TIBETAN MARK TRAILING MCHAN RTAGS", "Po", 0),
)
|
https://github.com/poopsicles/bachelors-typst-template | https://raw.githubusercontent.com/poopsicles/bachelors-typst-template/main/README.md | markdown | MIT License | # bach-typst-temp
> [!CAUTION]
> this ~~is undergoing massive revamping due to last minute changes and~~ will no longer be updated here.
>
> check the [codeberg repo](https://codeberg.org/fumnanya/bachelors-typst) instead.
a [typst](https://typst.app) template for my [final year project](https://github.com/poopsicles/bachelors) here at [covenant university](https://en.wikipedia.org/wiki/Covenant_University).
very opinonated, crossed-out ~~items~~ mean i didn't like what they said we should do in the [word doc](word_template.docx) (items marked with * can be reverted with print mode).
- [font](bach.typ#L65)*: ~~Times New Roman~~ New Computer Modern
- [14pt](bach.typ#L112) - heading 1
- [13pt](bach.typ#L113) - other headings
- [12pt](bach.typ#L114) - body text
- [justify](bach.typ#L62): full
- [margins](bach.typ#L61):
- top, bottom, right - 1in
- left: 1.5in
- [line spacing](bach.typ#L62): 1.5 line spacing in Word, [translates to 175% leading](https://practicaltypography.com/line-spacing.html) - 0.75em (not even sure about this tbh, word is hell)
- headings*: centred, ~~all caps~~ small caps
- [page numbers](bach.typ#L187)*: ~~centred~~ right-aligned
- [footer](bach.typ#L81)*: ~~30% line~~ dots
- table of contents: headings 1 ~~all caps~~ sentence case
apart from the template, this also provides:
- `blankify()` which shows either passed-in content or a "this page left blank" message.
- `code-figure(caption, code)` shows the passed-in code as an image figure.
- `table-figure(caption, table)` shows the passed-in table as a table figure (without justification).
## how to use:
- template:
1. get [typst](https://typst.app) and [fira code nerd font](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/FiraCode.zip).
2. get the files:
```sh
$ git submodule add https://github.com/poopsicles/bach-typst-temp template
```
3. make sure your folder looks like this (`project.typ` is your main typst file, `references.yml` is your [bibliography](https://typst.app//docs/reference/model/bibliography)):
```text
.
├── project.typ
├── references.yml
└── template
├── bach.typ
├── covenant.png
├── LICENSE
└── README.md
```
4. in `project.typ`, import the function and use it:
```text
#import "template/bach.typ": bach
#show: content => bach(
title: "On instant noodles.",
author: "Fumnanya",
matric: "30XX123456",
supervisor: "Dr. Supervisor",
reference-path: "../references.yml",
content,
)
= Introduction
We begin, as all things should, with a word salad.
#lorem(100)
// put in the rest of your content
```
5. In the function call, the following fields can be added (if they're not, then a blank space/page will be shown instead, except for `print` which reverts some opinionated settings):
```text
bach(
title: "On instant noodles",
author: "Fumnanya",
matric: "30XX123456",
supervisor: "Dr. Supervisor",
date: datetime(year: 2024, month: 4, day: 1),
abstract: [
We attempt to make the perfect bowl of noodles.
],
dedication: [
To all who have fallen during the climb.
],
acknowledgements: [
No one else had a hand in this.
],
print: true,
content,
)
```
A rendering of this can be found [here](examples/example.pdf).
> [!IMPORTANT]
> Make sure you set `print` to true ONLY when you're about to export a print-ready PDF (that will use their template settings including Times, centred page numbers, the default footer, and bare links).
>
> From the [Style and Grammar Guidelines](https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls):
>
> *It is acceptable to use either the default display settings for hyperlinks in your word-processing program (e.g., usually blue font, underlined) or plain text that is not underlined.*
>
> *Leave links live if the work is to be published or read online.*
>
> |_pretty_|_print_|
> |:-:|:-:|
> |||
- `blankify()`:
give it a thing and it'll return the thing:
```text
#blankify([hi])
// hi
```
give it nothing and it'll show the page blank message:
```text
#blankify(none)
// this page left blank
```
- `code-figure(caption, code)`:
just use it like a regular figure:
````text
#code-figure(
"International Scheme code in Bosnian",
```scm
(definiši (zdravo-svjete)
(prikaži "Zdravo, Svjete!"))
```
)
````

- `table-figure(caption, table)`:
just use it like a regular figure:
````text
#table-figure(
"a table?",
table(
columns: 2,
table.header[Amount][Ingredient],
[360g], [Baking flour],
)
)
````

|
https://github.com/dead-summer/math-notes | https://raw.githubusercontent.com/dead-summer/math-notes/main/notes/ScientificComputing/ch1-intro-to-scicomp/faster-higher-and-stronger.typ | typst | #import "/book.typ": book-page
#show: book-page.with(title: "Modelling, Discretization and Implementation")
= 2 Faster, Higher and Stronger
There are three themes in scientific computing. They are efficiency, accuracy and stability, associated with which is the spirit of numerics: "faster, higher and stronger".
- *Faster*. faster (larger speed) in efficiency
- *Higher*. higher order in accuracy
- *Stronger*. stronger in stability (robustness)
An inefficient, inaccurate or unstable method may lead to bad accumulation of discretization and implementation errors, and yield totally wrong results. |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/tuhi-exam-vuw/0.1.0/template/main.typ | typst | Apache License 2.0 | #import "@preview/tuhi-exam-vuw:0.1.0": tuhi-exam-vuw, mark, fin
// use the template
#show: tuhi-exam-vuw.with(
coursetitle: "scientific basis of murphy's laws",
coursecode: "murph101",
date: datetime(year: 2023, month: 8, day: 3),
year: "2023",
trimester: "2",
timeallowed: "three hours",
openorclosed: "open book",
permitted: "Any materials except communication via electronic devices.",
instructions: text[Attempt ALL *5* questions
The exam will be marked out of a total of *20* marks.
You can use the formulas listed at the end without rederiving them, unless explicitly requested.],
logo: image("logo.svg", width: 80mm))
= PART 1
_In multiple-choice questions, briefly justify your answer if unsure. On second thought, scratch that — rewrite the question if you find it makes no sense._ `¯\_(ツ)_/¯`
+ In the context of dermodynamics, point your finger at the true statement(s). #mark(8)
+ The first law of dermodynamics states that fingerprints can only be transferred.
+ The second law of dermodynamics states that fingerprints tend to appear on shiny surfaces.
+ The third law of dermodynamics states that wrinkles always increase in a bath tub.
+ The zeroth law of dermodynamics nails down the concept of absolute zero.
+ Explain the concept of quantum tunneling in the context of pub physics. Provide an equation and discuss the factors that influence the probability of quantum tunneling in a half-full / half-empty pint. Would you bet that the pint circumference is greater than $pi$?\ #mark(5)
+ What is the _Système International_ unit of cheese ($F$)? #mark(1)
#grid(columns: (1fr, auto),
column-gutter: 5mm,
text[
+ Coulommiers ($C$)
+ Tome ($Omega$)
+ Vieux pané ($V$)
+ Aiguille d'Orcières ($A$)
], image("figures/roquefort.png", width: 3.5in))
+ Describe the _German Specialty_ principle attributed to a _gedanken experiment_ about <NAME> writing a famous baking textbook. Explain the meaning of the equation $ E eq m c^2 $ and how it revolutionised our understanding of fast food. Provide examples of its applications in the theory of black ovens. Is the cake in the oven when no-one is watching? #mark(8)
#colbreak() // indentation matters, otherwise numbering restarts
+ Ray was arrested by Alice and Bob and is trapped under total internal incarceration. Which of the following phenomena is responsible for the change in Ray's trajectory, and ultimate rehabilitation from the darkness whence Ray came? #mark(0.2)
+ Retraction
+ Deflexion
+ Ray's
+ Someone else's
+ Superstition
+ Infraction
#fin
#include "appendix.typ"
|
https://github.com/linhduongtuan/BKHN-Thesis_template_typst | https://raw.githubusercontent.com/linhduongtuan/BKHN-Thesis_template_typst/main/template/toc.typ | typst | Apache License 2.0 | #import "font.typ": *
// Abbreviations
#show heading : it => {
set align(center)
set text(font: arial, size: font_size.large)
it
par(leading: 1.5em)[#text(size:0.0em)[#h(0.0em)]]
}
#heading(level: 1, outlined: false)[ABBREVIATIONS]
#v(2em)
#show outline: it => {
set text(font: arial, size: font_size.footnotesize)
set align(center)
set par(leading: 1em )
it
}
#figure(
table(
columns: (auto, auto, auto),
[Chữ viết tắt], [Tiếng Anh], [Tiếng Việt],
[DNA], [Deoxy Nucleotide Acid], [Acid Deoxy Nucleotide],
[PCR], [Polymerase Chain Reaction], [Phản ứng chuỗi trùng hợp],
[AI], [Artificial Intelligence], [Trí tuệ nhân tạo],
[SNP], [Single nucleotide polymorphism], [Tính đa hình nucleotide đơn],
[ML], [Machine Learning], [Học Máy]
),
//caption: [ABBREVIATIONS],
)
#pagebreak()
#show heading: it => {
set align(center)
set text(font: arial, size: font_size.large)
it
par(leading: 1.5em)[#text(size:0.0em)[#h(0.0em)]]
}
#set page(footer: [
#set align(center)
#set text(size: 10pt, baseline: -3pt)
#counter(page).display(
"I",
)
] )
// List of Figures
#heading(level: 1, outlined: true)[List of Figures]
#v(2em)
/*
#show outline: it => {
set heading(numbering: "1.1")
set text(font: arial, size: font_size.footnotesize)
set par(leading: 1em )
it
}
#outline(
title: none,
target: figure.where(kind: image),
indent : true,
)
*/
#show outline: it => {
set heading(numbering: "1.1.1")
set text(font: arial, size: font_size.footnotesize)
set par(leading: 1em )
it
}
#outline(
depth: 3,
title: none,
target: figure.where(kind: image),
indent: true,
)
#pagebreak()
// List of Tables
#heading(level: 1, outlined: true)[List of Tables]
#v(2em)
#show outline: it => {
set heading(numbering: "1.1.1")
set text(font: arial, size: font_size.footnotesize)
set par(leading: 1em )
it
}
#outline(
depth: 3,
title: none,
target: figure.where(kind: table),
indent: true,
)
#pagebreak()
// TODO: List of Formulas
#heading(level: 1, outlined: false)[List of Equations]
#v(2em)
#show outline: it => {
set text(font: arial, size: font_size.footnotesize)
set par(leading: 1em )
it
}
#outline(
depth: 3,
title: none,
//target: figure.where(kind: equation),
target: math.equation,
indent: true,
)
#pagebreak()
// Table of Contents
#heading(level: 1, outlined: false)[Table of Contents]
#v(2em)
#{
set align(left)
set text(font: arial, size: font_size.footnotesize)
set par(first-line-indent: 0pt)
[TÓM TẮT ] + [.] * 135 + [ I]
set par(leading: 1em)
[ABSTRACT ] + [.] * 132 + [ II]
set par(leading: 1em)
[ABBREVIATIONS ] + [.] * 121 + [ III]
set par(leading: 1em)
[LIST OF FIGURES ] + [.] * 120 + [ IV]
set par(leading: 1em)
[LIST OF TABLES ] + [.] * 123 + [ V]
set par(leading: 1em)
[LIST OF FORMULAS ] + [.] * 115 + [ VI]
set par(leading: 1em)
[LIST OF EQUATIONS ] + [.] * 114 + [ VI]
set par(leading: 1em)
[TABLE OF CONTENTS ] + [.] * 110 + [ VII]
}
#show outline: it => {
set text(font: arial, size: font_size.footnotesize)
set par(leading: 1em )
it
}
#outline(
title: none,
indent: true,
)
|
https://github.com/soul667/typst | https://raw.githubusercontent.com/soul667/typst/main/PPT/MATLAB/touying/docs/i18n/zh/docusaurus-plugin-content-docs/current/themes/dewdrop.md | markdown | ---
sidebar_position: 3
---
# Dewdrop 主题

这个主题的灵感来自 <NAME> 创作的 [BeamerTheme](https://github.com/zbowang/BeamerTheme),由 [OrangeX4](https://github.com/OrangeX4) 改造而来。
这个主题拥有优雅美观的 navigation,包括 `sidebar` 和 `mini-slides` 两种模式。
## 初始化
你可以通过下面的代码来初始化:
```typst
#import "@preview/touying:0.2.1": *
#let s = themes.dewdrop.register(
s,
aspect-ratio: "16-9",
footer: [Dewdrop],
navigation: "mini-slides",
// navigation: "sidebar",
// navigation: none,
)
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init
#show strong: alert
```
其中 `register` 接收参数:
- `aspect-ratio`: 幻灯片的长宽比为 "16-9" 或 "4-3",默认为 "16-9"。
- `navigation`: 导航栏样式,可以是 `"sidebar"`、`"mini-slides"` 和 `none`,默认为 `"sidebar"`。
- `sidebar`: 侧边导航栏设置,默认为 `(width: 10em)`。
- `mini-slides`: mini-slides 设置,默认为 `(height: 2em, x: 2em, section: false, subsection: true)`。
- `height`: mini-slides 高度,默认为 `2em`。
- `x`: mini-slides 的 x 轴 padding,默认为 `2em`。
- `section`: 是否显示 section 之后,subsection 之前的 slides,默认为 `false`。
- `subsection`: 是否根据 subsection 分割 mini-slides,设置为 `false` 挤压为一行,默认为 `true`。
- `footer`: 展示在页脚的内容,默认为 `[]`,也可以传入形如 `self => self.info.author` 的函数。
- `footer-right`: 展示在页脚右侧的内容,默认为 `states.slide-counter.display() + " / " + states.last-slide-number`。
- `primary`: primary 颜色,默认为 `rgb("#0c4842")`。
- `alpha`: 透明度,默认为 `70%`。
并且 Dewdrop 主题会提供一个 `#alert[..]` 函数,你可以通过 `#show strong: alert` 来使用 `*alert text*` 语法。
## 颜色主题
Dewdrop 默认使用了
```typst
#let s = (s.methods.colors)(
self: s,
neutral-darkest: rgb("#000000"),
neutral-dark: rgb("#202020"),
neutral-light: rgb("#f3f3f3"),
neutral-lightest: rgb("#ffffff"),
primary: primary,
)
```
颜色主题,你可以通过 `#let s = (s.methods.colors)(self: s, ..)` 对其进行修改。
## slide 函数族
Dewdrop 主题提供了一系列自定义 slide 函数:
```typst
#title-slide(extra: none, ..args)
```
`title-slide` 会读取 `self.info` 里的信息用于显示,你也可以为其传入 `extra` 参数,显示额外的信息。
---
```typst
#slide(
repeat: auto,
setting: body => body,
composer: utils.side-by-side,
section: none,
subsection: none,
// Dewdrop theme
footer: auto,
)[
...
]
```
默认拥有导航栏和页脚的普通 slide 函数,页脚为您设置的页脚。
---
```typst
#focus-slide[
...
]
```
用于引起观众的注意力。背景色为 `self.colors.primary`。
## 特殊函数
```typst
#d-outline(enum-args: (:), list-args: (:), cover: true)
```
显示当前的目录,`cover` 参数用于指定是否要隐藏处于 inactive 状态的 sections。
---
```typst
#d-sidebar()
```
内部函数,用于显示侧边栏。
---
```typst
#d-mini-slides()
```
内部函数,用于显示 mini-slides。
## `slides` 函数
`slides` 函数拥有参数
- `title-slide`: 默认为 `true`。
- `outline-slide`: 默认为 `true`。
- `outline-title`: 默认为 `[Outline]`。
可以通过 `#show: slides.with(..)` 的方式设置。
```typst
#import "@preview/touying:0.2.1": *
#let s = themes.dewdrop.register(s, aspect-ratio: "16-9", footer: [Dewdrop])
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let s = (s.methods.enable-transparent-cover)(self: s)
#let (init, slide, slides, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init
#show strong: alert
#show: slides
= Title
== First Slide
Hello, Touying!
#pause
Hello, Typst!
```

## 示例
```typst
#import "@preview/touying:0.2.1": *
#let s = themes.dewdrop.register(
s,
aspect-ratio: "16-9",
footer: [Dewdrop],
navigation: "mini-slides",
// navigation: "sidebar",
// navigation: none,
)
#let s = (s.methods.info)(
self: s,
title: [Title],
subtitle: [Subtitle],
author: [Authors],
date: datetime.today(),
institution: [Institution],
)
#let s = (s.methods.enable-transparent-cover)(self: s)
// #let s = (s.methods.appendix-in-outline)(self: s, false)
#let (init, slide, title-slide, focus-slide, touying-outline, alert) = utils.methods(s)
#show: init
#show strong: alert
#title-slide()
#slide[
== Outline
#touying-outline(cover: false)
]
#slide(section: [Section A])[
== Outline
#touying-outline()
]
#slide(subsection: [Subsection A.1])[
== Title
A slide with equation:
$ x_(n+1) = (x_n + a/x_n) / 2 $
]
#slide(subsection: [Subsection A.2])[
== Important
A slide without a title but with *important* infos
]
#slide(section: [Section B])[
== Outline
#touying-outline()
]
#slide(subsection: [Subsection B.1])[
== Another Subsection
#lorem(80)
]
#focus-slide[
Wake up!
]
// simple animations
#slide(subsection: [Subsection B.2])[
== Dynamic
a simple #pause dynamic slide with #alert[alert]
#pause
text.
]
// appendix by freezing last-slide-number
#let s = (s.methods.appendix)(self: s)
#let (slide,) = utils.methods(s)
#slide(section: [Appendix])[
== Outline
#touying-outline()
]
#slide[
appendix
]
```
|
|
https://github.com/katamyra/Notes | https://raw.githubusercontent.com/katamyra/Notes/main/Compiled%20School%20Notes/CS1332/Modules/Heaps.typ | typst | #import "../../../template.typ": *
= Heaps
#definition(footer: "This property is what makes heaps easy to implement with arrays")[
*Heaps* have the shape property of a binary tree (having 0-2 children), but heaps must also be _complete_.
]
== Min Heap
#definition[
In *minheap*, the smallest data lives in the root and each child is greater than its parents value. There is no relationship between siblings
]
Heaps can be illustrated and _backed_ as an array given their characteristics, displayed in level order.
#definition[
*Given data at index n*:
- Left child: $2 * n$
- Right child: $2 * n + 1$
- Parent: $n/2$
- Should be truncated if not an integer
]
#image("Images/Heaps.png")
#example[
*Heaps Use Cases*
- Not designed for arbitrary searching, mostly designed for accessing root
- They are no better than just searching an arraylist (O(n))
- Heaps are often used to back priority queues
]
== Heap Operations
=== Add Algorithm
- Add to the next spot in the array to maintain completeness
- this would be index[size]
#note[
We do not use *index zero* for heaps
]
- Up heap starting from the new data to fix order property
- Compare the data with the parent, and swap the data with the parent as necessary until we read the top or no swap is needed. _This differs for min heap and max heap_.
#theorem[
Time complexity of adding a new element is *O(logn)*. While adding to end of array is O(1), the up-heap process is O(logn).
]
=== Remove Algorithm
- Move the last element of the heap and use it to replace the root (since we want to delete root)
- Down heap starting from the root to fix the order property. If two children, compare data with larger or smaller priority child, depending on if it is a min or max heap.
#theorem[
Time complexity of removing an element is *O(logn)* due to the down-heap process.
]
=== Build Heap Operation
We use the *buildheap operation* for taking an unsorted, unordered data and turning it into a heap.
- First we put the data into an array, which will satisfy the _shape property_
- Then, in order to satisfy order property we look at the sub-heaps and down heap through the valid sub-heaps
We loop starting at `index size/2`, since this is the last element that has a child, and we go up to index 1 and repeatedly calling the down-heap method. For the rest of the array we don't need down heap if its already valid (?)
#theorem[
There is more data in the bottom half of the tree than the top half, so as we go down each time the data doubles, meaning we have exponential grown in data as we go down.
The down-heap cost is *O(1)* at the bottom of the tree but increases linearly as we go up the tree meaning most of the data at the top is *O(logn)*, so it balances out to be *O(n)* if you do the summation of the series.
] |
|
https://github.com/j10ccc/zjut-social-practice-report-typst | https://raw.githubusercontent.com/j10ccc/zjut-social-practice-report-typst/main/layout/catalog.typ | typst | #import "/constants/fonts.typ": font_family
#let catalog() = {
set text(font: font_family.songti, size: 12pt)
show outline.entry.where(
level: 1
): it => {
text(it, weight: "bold")
v(.4em, weak: true)
}
show outline.entry.where(
level: 2
): it => {
text(it)
v(.2em, weak: true)
}
align(center)[
#text("目录", size: 18pt, weight: "bold")
#v(36pt)
]
outline(
title: none,
indent: auto
)
} |
|
https://github.com/suspenss/Undergraduate-mathematics | https://raw.githubusercontent.com/suspenss/Undergraduate-mathematics/main/setup/theorem.typ | typst | #import "@preview/ctheorems:1.1.0": *
#let chnamefmt = it => [#text(style: "normal")[(#it)]]
#let no_fill_thmbox = thmbox.with(
inset: (x: 1.2em, top: 0.0em, bottom: 0.0em),
separator: [],
base_level: 1,
)
#let no_fill_thmplain = thmplain.with(
// inset: (x: 1.2em, top: 0.5em, bottom: 0.5em,left: 0em, right: 0em),
separator: [],
base_level: 1,
)
#let corollary = no_fill_thmbox(
"corollary",
"Corollary",
// base: "theorem",
titlefmt: strong
)
#let example = no_fill_thmbox(
"example",
"Example",
titlefmt : strong,
).with(numbering: none)
#let proof = no_fill_thmplain(
"proof",
"Proof",
// text("证明", font: "Kai"),
base: "theorem",
bodyfmt: body => [#body #h(1fr) $square$],
separator: [#h(0.2em)_:_#h(0.2em)],
).with(numbering: none)
#let properties = no_fill_thmbox(
"properties",
"Properties",
titlefmt: strong,
namefmt : chnamefmt,
)
#let formula = no_fill_thmbox(
"formula",
"Formula",
titlefmt: strong,
// inset: (x: 1.2em, top: 0.5em, bottom: 0.5em),
namefmt : chnamefmt,
)
// #let theorem = thmbox(
// "theorem",
// "Theorem",
// // fill: rgb("#e8e8f8")
// // fill: rgb("#eeffee")
// )
#let theorem = no_fill_thmbox(
"theorem",
"Theorem",
titlefmt: strong,
// inset: (x: 1.2em, top: 0.5em, bottom: 0.5em),
namefmt : chnamefmt,
// fill: rgb("#e8e8f8"),
// separator: [#h(0.1em):#h(0.2em)],
)
#let lemma = no_fill_thmbox(
"lemma",
"Lemma",
// fill: rgb("#e8e8f8")
titlefmt: strong,
namefmt: chnamefmt
)
#let definition = no_fill_thmbox(
"definition",
"Definition",
titlefmt: strong,
namefmt : chnamefmt,
)
#let annotation = no_fill_thmbox(
"annotation",
"Annotation",
titlefmt: strong,
namefmt : chnamefmt,
)
#let proposition = no_fill_thmbox(
"proposition",
"Proposition",
titlefmt: strong,
namefmt : chnamefmt,
)
#let base = no_fill_thmbox(
"base",
"Base",
titlefmt: strong,
namefmt : chnamefmt,
)
#let exercise = base.with(title: "Exercise")
#let axiom = base.with(title: "Axiom")
#let corollary = base.with(title: "Corollary") |
|
https://github.com/k4zuy/Typst-Template-HTW | https://raw.githubusercontent.com/k4zuy/Typst-Template-HTW/main/common/metadata.typ | typst | // Enter your thesis data here:
#let titleEnglish = "(Title English)"
#let titleGerman = "Titel"
#let degree = "Abschluss"
#let program = "Studiengang"
#let supervisor = "Professor"
#let advisors = ("Betreuer, M.Sc.",)
#let author = "Autor"
#let studentNumber = "0000"
#let startDate = "01.01.2000"
#let submissionDate = "xxx" |
|
https://github.com/hugoledoux/msc_geomatics_thesis_typst | https://raw.githubusercontent.com/hugoledoux/msc_geomatics_thesis_typst/main/front/acknowledgement.typ | typst | MIT License | #import "../template.typ": *
#heading(outlined: false)[Acknowledgements]
Thanks to everyone, especially to my supervisors and my dog (in that order).
And obviously to the ones who made that great template.
Lemongrass frosted gingerbread bites banana bread orange crumbled lentils sweet potato black bean burrito green pepper springtime strawberry ginger lemongrass agave green tea smoky maple tempeh glaze enchiladas couscous. Cranberry spritzer Malaysian cinnamon pineapple salsa apples spring cherry bomb bananas blueberry pops scotch bonnet pepper spiced pumpkin chili lime eating together kale blood orange smash arugula salad. Bento box roasted peanuts pasta Sicilian pistachio pesto lavender lemonade elderberry Southern Italian citrusy mint lime taco salsa lentils walnut pesto tart quinoa flatbread sweet potato grenadillo.
Thai super chili apricot salad cocoa dark chocolate vitamin glow mushroom risotto red amazon pepper simmer udon noodles soba noodles dragon fruit cherries strawberry mango smoothie basil chickpea crust pizza cauliflower cherry bomb pepper mediterranean street style Thai basil tacos. Balsamic vinaigrette Indian spiced kimchi tofu sandwiches smoked tofu apple vinaigrette salty Thai sun pepper cayenne four-layer fiery fruit peach strawberry mango vegan Bulgarian carrot Italian linguine puttanesca green bowl lemon red lentil soup overflowing berries habanero golden one bowl. |
https://github.com/ammar-ahmed22/typst-resume | https://raw.githubusercontent.com/ammar-ahmed22/typst-resume/main/src/utils/resume.typ | typst | #import "./icons.typ": iconUnicode
#import "./init.typ": init
#let contactInfo(data, accentColor) = {
let parsed = data.contact.map(c => {
let blockContent
if ("link" in c) {
blockContent = link(c.link)[#c.text]
} else {
blockContent = text(c.text)
}
box([#if ("icon" in c) {iconUnicode(c.icon.unicode, size: 8pt, color: accentColor)} else { none } #blockContent])
})
block(width: 100%)[
#align(center)[
#pad(x: 0em)[
#parsed.join([#sym.space.en #sym.space.en])
]
]
]
}
#let createLocation(content) = {
let location = ()
if ("location" in content) {
if ("city" in content.location) { location.push(content.location.city)}
if ("region" in content.location) { location.push(content.location.region)}
if ("country" in content.location) { location.push(content.location.country)}
}
location.join(", ")
}
#let createDate(content) = {
let date = [
#content.start.month #content.start.year #sym.dash.en #if ("end" in content) [ #content.end.month #content.end.year] else [ Present]
]
date
}
#let experienceContent(content, accentColor) = {
block()[
#text(weight: "semibold", fill: accentColor, if ("link" in content.org) { link(content.org.link)[#content.org.name]} else { content.org.name}) #h(1fr) *#createLocation(content)*\
#text(weight: "semibold", content.position) | #text(style: "italic", content.skills.join(", ")) #h(1fr) #createDate(content) \
#list(indent: 0.5em, ..content.info.map(i => [#eval(i, mode: "markup")]))
]
}
#let projectContent(content, accentColor) = {
block()[
#text(weight: "semibold", fill: accentColor, if ("link" in content) { link(content.link)[#content.name #iconUnicode(symbol("\u{f0c1}"), size: 8pt, color: accentColor)]} else { content.name }) | #text(style: "italic", content.skills.join(", ")) #h(1fr) #content.date.month #content.date.year \
#list(indent: 0.5em, ..content.info.map(i => eval(i, mode: "markup")))
]
}
#let educationContent(content, accentColor) = {
block()[
#text(weight: "semibold", content.institution) #h(1fr) *#createLocation(content)* \
#content.degree #h(1fr) #createDate(content)
]
}
#let skillsContent(content, accentColor) = {
block()[
#text(weight: "semibold", fill: accentColor, content.name): #content.skills.join(", ") #v(-0.5em)
]
}
#let awardContent(content, accentColor) = {
block()[
#text(weight: "semibold", fill: accentColor, content.name) | #text(style: "italic", content.org) #h(1fr) #content.date.month #content.date.year \
#list(indent: 0.5em, ..content.info.map(i => eval(i, mode: "markup")))
]
}
#let sectionContent(section, accentColor) = {
if (section.type == "Experience") {
for content in section.content {
experienceContent(content, accentColor)
}
} else if (section.type == "Education") {
for content in section.content {
educationContent(content, accentColor)
}
} else if (section.type == "Project") {
for content in section.content {
projectContent(content, accentColor)
}
} else if (section.type == "Skills") {
for content in section.content {
skillsContent(content, accentColor)
}
} else if (section.type == "Awards") {
for content in section.content {
awardContent(content, accentColor)
}
}
}
#let resume(data, accentColor: black) = {
show: doc => init(doc, accentColor: accentColor, fontSize: 10pt)
heading(level: 1, data.name)
block()[
#contactInfo(data, accentColor)
#for section in data.sections {
heading(level: 2, section.name)
sectionContent(section, accentColor)
}
]
} |
|
https://github.com/EpicEricEE/typst-quick-maths | https://raw.githubusercontent.com/EpicEricEE/typst-quick-maths/master/src/lib.typ | typst | MIT License | #import "quick-maths.typ": shorthands
|
https://github.com/Jollywatt/typst-fletcher | https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/tests/node-layer/test.typ | typst | MIT License | #set page(width: auto, height: auto, margin: 1em)
#import "/src/exports.typ" as fletcher: diagram, node, edge
#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, layer: -2),
edge((-2,0), "r,d,r", "-|>", $g$),
node((0,-1), $F(s)$, fill: white, layer: -2),
node((0,+1), $G(s)$, fill: white),
edge((0,+1), (1,0), "-|>", corner: left),
edge((0,-1), (1,0), "..|>", corner: right, layer: -2),
node((1,0), text(white, $ plus.circle $), inset: 2pt, fill: black),
edge("-|>"),
node(
enclose: ((0,+1), (0,-1)),
fill: rgb("fa6c"),
stroke: none,
inset: 10pt,
snap: false,
),
) |
https://github.com/r8vnhill/apunte-bibliotecas-de-software | https://raw.githubusercontent.com/r8vnhill/apunte-bibliotecas-de-software/main/Unit3/StaticAnalysis.typ | typst | == Análisis Estático
El análisis estático de código es un método crítico utilizado en el desarrollo de software para
examinar el código fuente sin ejecutarlo. Esta técnica contrasta con el análisis dinámico, que
analiza el programa en ejecución. El análisis estático se realiza generalmente con herramientas
especializadas diseñadas para inspeccionar automáticamente el código en busca de errores y problemas
de calidad.
=== Objetivos del Análisis Estático
1. *Detección Temprana de Errores*: Identificar y corregir errores de programación tempranamente
en el ciclo de desarrollo, como uso incorrecto de tipos, referencias nulas y violaciones de
sintaxis. Esto ayuda a prevenir fallos en etapas posteriores del desarrollo o después de la
implementación del software.
2. *Cumplimiento de Estándares*: Asegurar que el código fuente cumpla con estándares de programación
y mejores prácticas establecidas. Esto incluye convenciones de codificación, estructuras de datos
adecuadas y uso eficiente de patrones de diseño, lo cual mejora la legibilidad y mantenibilidad
del código.
3. *Seguridad*: Descubrir y mitigar vulnerabilidades de seguridad potenciales. Al analizar el
código en busca de patrones conocidos de riesgos de seguridad, las herramientas de análisis
estático ayudan a proteger la aplicación contra ataques y fallos de seguridad.
=== Detekt
_Detekt_ es una herramienta de análisis estático robusta y configurable diseñada específicamente
para el lenguaje de programación Kotlin. Es ampliamente utilizada para mejorar la calidad del código
identificando problemas relacionados con la complejidad del código, estilo de codificación, posibles
bugs y patrones de código no recomendados.
*Características Principales*
1. *Configuración Flexible*: Detekt ofrece opciones de configuración extensas que permiten
personalizar el análisis según las necesidades específicas de cada proyecto. Esto incluye
habilitar o deshabilitar ciertas reglas y modificar los umbrales de complejidad del código.
2. *Reglas Predefinidas y Personalizables*:
- Viene con un amplio conjunto de reglas predefinidas que cubren varios aspectos del desarrollo
de software, desde el estilo de codificación hasta la complejidad del código y los riesgos de
seguridad.
- Lxs desarrolladorxs pueden crear y añadir sus propias reglas personalizadas, lo que permite
adaptar Detekt a las políticas de codificación específicas de un equipo o empresa.
3. *Identificación de Problemas de Calidad de Código*: Analiza el código para detectar
antipatrones, uso ineficiente de la sintaxis de Kotlin, redundancias, complejidad innecesaria y
otros problemas que pueden degradar la calidad del código.
Detekt se puede ejecutar como una tarea independiente desde la línea de comandos o integrarse en el
ciclo de vida del build de Gradle. Esto facilita su incorporación en procesos de integración
continua y revisión de código automatizada.
- En sistemas Unix:
```bash
./gradlew detekt
```
- En sistemas Windows:
```powershell
.\gradlew.bat detekt
```
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/km/0.1.0/sample.typ | typst | Apache License 2.0 | #import "./lib.typ": karnaugh
#set text(font: "Kabel", weight: "bold")
#show raw: set text(weight: "regular")
#show math.equation: set text(font: "New Computer Modern Math")
#align(center)[
= Samples of Karnaugh–Veitch Maps
]
#let descriptions = (
"Fig. 1. Map of an incompletely specified function",
"Fig. 2. Zeros are not ignored",
"Fig. 3. Crossing implicant"
)
#set figure(supplement: none)
#let samples = (
```
import "./lib.typ": karnaugh
let x = -1
karnaugh(("AB", "CD"), // Labels in string
implicants: (
// (x, y, length/width, optional height)
(1, 1, 2),
(2, 0, 2)
),
(
// Any number that is neither 0 or 1 will
// be treated as don't-care.
(0, 0, 0, x),
(0, 1, x, 0),
(1, 1, 1, 0),
(x, 1, 0, x),
)
)
```,
```
import "./lib.typ": karnaugh
karnaugh(("C", "AB"),
implicants: (
(0, 1, 1, 2),
(1, 2, 2, 1),
),
(
(0, 1, 0, 0),
(0, 1, 1, 1),
),
// Allow zero to appear
show-zero: true
)
```,
```
import "./lib.typ": karnaugh
karnaugh(
(
// Labels in math mode
($I_2$,), ($I_1$, $I_0$)
),
implicants: (
// `(0, 3, 2)` moves outside the frame
// but will come back
(0, 3, 2),
(1, 0, 4, 1),
),
(
(1, 0, 0, 1),
(1, 1, 1, 1),
)
)
```
)
#for i in range(samples.len()) [
#grid(
columns: (1fr, auto),
align: horizon,
raw(lang: "typc", samples.at(i).text.split("\n").slice(1).join("\n")),
figure(
eval(samples.at(i).text),
caption: descriptions.at(i)
)
)
]
|
https://github.com/AxiomOfChoices/Typst | https://raw.githubusercontent.com/AxiomOfChoices/Typst/master/TA/Fall%202023/Math%20314/Tutorial%208/solutions.typ | typst | #import "../../../../Templates/generic.typ": generic
#import "../../../../Templates/question.typ": question_heading
#show: doc => generic(title: "Tutorial 8 Solutions", name: "<NAME>", doc)
#show: doc => question_heading(doc)
#let ve = $epsilon$
#let vect(symbol) = { [#math.upright(math.bold(symbol))] }
= Question 1
== Statement
Evaluate the following line integrals
- $integral_C y dif s$ where $C : x = t^2, y = 2t, 0 <= t <= 3$.
- $integral_C x y^4 dif s$ where $C$ is the right half of the circle $x^2 + y^2 = 16$.
- $integral_C (x^2 y + sin x) dif y$, where $C$ is the arc of the parabola $y = x^2$ from $(0,0)$ to $(pi, pi^2)$.
== Solution
- First we need to calculate the length element $dif s$. We use the formula
$ dif s
= sqrt( ((diff x)/(diff t))^2 + ((diff y)/(diff t))^2 ) dif t
= sqrt((2t)^2 + (2)^2) dif t
= 2 sqrt(1 + t^2) dif t $
we then can compute the integral
$
integral_C y dif s
= integral_0^3 2t (2 sqrt(1 + t^2)) dif t
= integral_1^10 2 sqrt(u) dif u
= [ 4/3 u^(2/3) ]^10_1
= 4/3 (10 sqrt(10) - 1)
$
- First thing we want to do is to parametrize the circle, this is almost always done with polar coordinates with $r$ fixed, for us this will be $x = 4 cos(t), y = 4 sin(t)$. Now the whole circle is given by $0 <= t <= 2pi$, but since we only want the right part we will instead want $-pi/2 <= t <= pi/2$.
With this parametrization we get that
$
dif s = sqrt( ((diff x)/(diff t))^2 + ((diff y)/(diff t))^2 ) dif t
= sqrt((4 cos t)^2 + (4 sin t)^2) dif t
= 4 dif t
$
and so we can compute
$
integral_C x y^4 dif s
= integral_(-pi/2)^(pi/2) 4 cos(t) (4 sin(t))^4 4 dif t
= 4^6 integral_(-1)^(1) u^4 dif u
= (2 dot 4^6)/5
$
#pagebreak(weak: true)
- This time our parametrization is easy since we can simply use $x = t, y = t^2$. Note that our integration now is with respect to $dif y$ which we compute to be
$
dif y = (diff y)/(diff t) dif t
= 2t dif t
$
This then gives us
$
integral_0^pi ((t)^2 (t^2) + sin t) 2t dif t
&=
2 integral_0^pi t^5 + t sin t dif t
=
1/3 pi^6 + 2 integral_0^pi t sin t dif t
\ &=
1/3 pi^6 + 2 [t (-cos t)]^pi_0 - 2 integral_0^pi (- cos t) dif t
\ &=
1/3 pi^6 + 2 pi
$
= Question 2
== Statement
Evaluate the following line integrals
- $integral_C y^2 z dif s$, where $C$ is the line segment from $(3,0,2)$ to $(1,2,5)$.
- $integral_C x y e^(y z) dif y$, where $C: x = t, y = t^2, z = t^3, 0 <= t <= 1$.
- $integral_C z dif x + x y dif y + y^2 dif z$, where $C: x = sin(t), y = cos(t), z = tan(t), -pi/4 <= t <= pi / 4$
== Solution
- Our first job is to parametrize the line segment, for line segments there is a nice formula and it is $ (3,0,2) (1-t) + (1,2,5) t = (3 - 2t, 2t, 2 + 3t) $ with $0 <= t <= 1$.
This then gives us
$
dif s
= sqrt(
((diff x)/(diff t))^2
+
((diff y)/(diff t))^2
+
((diff z)/(diff t))^2
) dif t
= sqrt(
(-2)^2
+
(2)^2
+
(3)^2
) dif t
= sqrt(
17
) dif t
$
and so we can compute
$
sqrt(17) integral_0^1 (2t)^2 (2 + 3t) dif t
&=
sqrt(17) integral_0^1 8t^2 + 12t^3 dif t
=
sqrt(17) [8/3 t^3 + 3t^4]^1_0
\ &=
sqrt(17) [8/3 + 3]
= (17sqrt(17))/3
$
- Here our parametrization is given and the integral is with respect to $dif y$ and so we calculate
$
dif y =
(diff y)/(diff t) dif t =
2 t dif t
$
which then lets us compute
$
integral_0^1 t^3 e^(t^5) 2t dif t
=
2/5 integral_0^1 e^u dif u
=
2/5 (e - 1)
$
- Again the parametrization is given and so we simply compute
$
dif x = cos(t) dif t, quad
dif y = - sin(t) dif t, quad
dif z = sec^2(t) dif t
$
this then gives us
$
integral_(-pi/4)^(pi/4) (tan(t) cos(t) - sin^2(t) cos(t) + cos^2(t) sec^2(t)) dif t
$
and so after simplifying we get
$
integral_(-pi/4)^(pi/4) (sin(t) - sin^2(t) cos(t) + 1) dif t
$
we split this integral up into 3 parts and we get
$
integral_(-pi/4)^(pi/4) 1 dif t = pi/2
quad quad
integral_(-pi/4)^(pi/4) sin(t) dif t
=
0
quad quad
integral_(-pi/4)^(pi/4) sin^2(t) cos(t) dif t
=
integral_(-sqrt(2)/2)^(sqrt(2)/2) u^2 dif u
=
1/(3 sqrt(2))
$
giving us
$
pi/2 + 1/(3 sqrt(2))
$
#pagebreak(weak: true);
= Question 3
== Statement
Evaluate the line integral $integral_C F dot dif r$ (there were some typos here in the original questions).
- $F(x,y) = x y^2 vect(i) - x^2 vect(j)$ where $C$ is the curve $r(t) = t^3 vect(i) + t^2 vect(j), 0 <= t <= 1$.
- $F(x,y,z) = sin x vect(i) + cos y vect(j) + x z vect(k)$ where $C$ is the curve #linebreak() $r(t) = t^3 vect(i) - t^2 vect(j) + t vect(k), 0 <= t <= 1$.
- $F(x,y,z) = x z vect(i) + z^3 vect(j) + y vect(k)$ where $C$ is the curve $r(t) = e^t vect(i) - e^(2t) vect(j) + e^(-t) vect(k), -1 <= t <= 1$.
== Solution
- First we will compute the velocity of $C$,
$
(diff r)/(diff t) = (3t^2, 2t)
$
and we also have
$
F(x(t),y(t)) = (t^5, -t^6)
$
and so we can compute
$
integral_C F dot dif r
=
integral_0^1 (3t^2, 2t) dot (t^5, -t^6) dif t
=
integral_0^1 (3t^7 - 2t^7) dif t
=
1/8
$
- Again we first compute the velocity of $C$,
$
(diff r)/(diff t)
=
(3t^2, -2t, 1)
$
as well as
$
F(x(t),y(t),z(t))
=
sin (t^3) vect(i) + cos(t^2) vect(j) + t^4 vect(k)
$
giving us
$
integral_0^1 sin(t^3) 3t^2 - cos(t^2) 2t + t^4 dif t
&=
integral_0^1 sin(u) dif u
-
integral_0^1 cos(u) dif u
+
integral_0^1 t^4 dif t
\ &=
1 - cos(1) - sin(1) + 1/5
\ &=
6/5 - cos(1) - sin(1)
$
- Finally we one agian compute the velocity of $C$,
$
(diff r)/(diff t)
=
(e^t, 2e^(2t), -e^(-t))
$
and also get
$
F(x(t),y(t),z(t))
=
1 vect(i) + e^(-3t) vect(j) + e^(2t) vect(k)
$
giving us
$
integral_(-1)^1
e^t + 2 e^(-t) - e^t
dif t
=
integral_(-1)^1
2 e^(-t)
dif t
= 2(e^1 - e^(-1))
$ |
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/numbering_07.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
//
// // Error: 17-19 number must be at least zero
// #numbering("1", -1) |
https://github.com/KmaEE/ee | https://raw.githubusercontent.com/KmaEE/ee/main/ee.typ | typst | #import "@preview/cetz:0.2.2"
#import "@preview/wordometer:0.1.2": word-count, total-words
#show par: set block(spacing: 1.5em)
#set par(
justify: true,
leading: 0.75em
)
#show heading: set block(below: 0.75em)
#set page(numbering: "1", number-align: right)
#set text(font: "IBM Plex Sans")
#v(1fr)
#align(center, text(17pt)[
*Securing Data Transfer with Elliptic Curves*
])
#align(center, text(10.7pt)[
To what extent can elliptic curves be used to establish a shared secret over an insecure channel?
])
#v(3fr)
Mathematics
Word count: #show: word-count.with(exclude: (heading, figure.caption))
#total-words
#pagebreak()
#outline(indent: 2em)
#pagebreak()
= Introduction
As Alice tries to talk to Bob through her laptop, an adversary named Eve tries to eavesdrop their communication and steal sensitive information. Alice and Bob decide to use Diffie-Hellman Key Exchange, which allows them to establish a password for future communication, one that Eve cannot obtain even if she can intercept everything transmitted.
Diffie-Hellman is an important element in the collection of cryptographic methods that secure Internet connections. 99.3% of the top 1 million websites prefer using Diffie-Hellman over others when it comes to establishing a shared secret @warburton_2021_2021.
Much of cryptography is developed on the need to communicate messages securely in that other people cannot know what messages are being sent. Password-based, or _symmetric_ cryptography uses a secret key known between two parties to communicate messages safely @sako_public_2005.
#figure(image("Safe.svg", width: 70%), caption: [Diagram by author, derived from @pdclipartorg_safe_2009.])
Under an analogy using safes, if Alice and Bob both know a secret combination number, they can send each other secret messages within safes configured with that combination, protecting their messages from being inspected by anyone else. Symmetric cryptography is then concerned with the mathematical processes that can be used to construct such a safe.
Diffie-Hellman arises from a need for Alice and Bob to quickly agree on a combination to use even if their own form of communication is one that can be eavesdropped by third parties like Eve @just_diffiehellman_2005. This is at the core of securing Internet connections, since visitors of a website should not be forced to physically visit a company in order to establish a secret key for communication. Diffie-Hellman is designed specifically so that people can establish a shared secret (the combination between Alice and Bob) over an insecure channel (a communication method that Eve can eavesdrop).
Diffie-Hellman takes on different forms. There is Finite Field Diffie-Hellman and Elliptic Curve Diffie-Hellman. To answer our research question, we'll compare the two methods in terms of how efficient they are (how much data do Alice and Bob need to send to each other?) and how fast they are (how quickly can Alice and Bob calculate the shared password in an exchange?) to show the effectiveness of elliptic curves.
#pagebreak()
= Group Theory
Much of the math required to understand elliptic curves and how they help establish shared secrets utilizes group theory. This section is a short discussion on it.
== $ZZ_p^times$: The Multiplicative Group Over a Prime
Fermat's Little Theorem suggests the following to be true for any non-zero integer $a$ and prime $p$:
$
a^(p-1) equiv 1 " " (mod p)
$
Extracting a factor of $a$, we get:
$
a dot a^(p-2) equiv 1 " " (mod p)
$
Thus, under multiplication modulo $p$, any non-zero integer $a$ multiplied by $a^(p-2)$ results in $1$. As $1$ is the multiplicative identity ($1 dot x = x$), $a^(p-2)$ is said to be $a$'s _multiplicative inverse_. Consider the set of numbers from $1$ to $p - 1$. Every number $a$ has a multiplicative inverse ($a^(p-2)$) modulo $p$; the set contains an identity element ($1$); multiplication is associative ($a dot (b dot c) = (a dot b) dot c$); and each multiplication will always result in a number between $1$ to $p - 1$ since it is performed modulo $p$ (closure). These properties, existence of an identity element and inverses, associativity, and the closure of operations, are exactly the properties that define a group @shemanske_modern_2017[pp.~73-76].
A group is a set equipped with an operation. Therefore, the $in$ symbol and the word _element_ applies to groups too. We will refer to the specific group we discussed above as $ZZ_p^times$. In a similar vein, $ZZ_p^+$ specifies addition modulo $p$ as its group operation.
The _order_ of a group refers to the number of elements in that group. For $ZZ_p^times$, the order is $p - 1$ since its elements are $1, 2, ..., p - 1$. Hence $|ZZ_p^times| = p - 1$. The additive group includes zero as the identity, therefore $|ZZ_p^+| = p$.
The _order_ of a specific element $x$, refers to the smallest integer $k$ such that $x^k = 1$, where $1$ is the identity element. For example, the order of $17$ in $ZZ_1009^times$ is $1008$, because $a = 1008$ is the smallest $a$ such that $17^a equiv 1 " " (mod 1009)$, whereas the order of $2$ in $ZZ_1009^times$ is $504$, since $b = 504$ is the smallest $b$ such that $2^b equiv 1 " " (mod 1009)$ . Therefore, $|17| = 1008$ and $|2| = 504$.
As groups are used extensively in cryptographic techniques, the order of groups and elements becomes important as it is related to the difficulty of obtaining a shared secret secured using specific groups and elements.
== The Discrete Log Problem
Under $ZZ_1009^times$, we are asked to find the smallest integer $n$ for which $17^n equiv 24$. In this case,
$
17^(456) equiv 24 " " (mod 1009)
$
And $456$ is the first exponent for which the equivalence holds. Therefore $n = 456$ is the solution. More generally, the discrete log problem (DLP) asks for a smallest exponent $n$ in a group $G$ and $a, b in G$ such that $a^n = b$.
The brute-force approach to this problem would be repeatedly performing the group multiplication, calculating $a^2$, $a^3$, $a^4$ and checking if any of them matches $b$. In the example problem, it would take $455$ multiplications before finally arriving at the answer. If we tried to solve DLP repeatedly with the exponent $n$ taken at random, brute-forcing would take on average $1/2|a|$ operations since answers are in the range of $0$ to $|a| - 1$. As the order $|a|$ gets big (towards numbers as big as $2^200$), this approach quickly becomes infeasible.
Assuming that DLP is non-trivial to solve, exponentiation of elements in $ZZ_n^times$ can be characterized as a one-way function, where computing exponentiation is trivial, but finding the discrete log (the inverse) is much more difficult @robshaw_one-way_2011. Building upon this property, we will show how it can be used to ensure information reaches the right person with cryptography.
= Finite Field Cryptography and Attacks
== Diffie-Hellman Key Exchange
Building off the previous example, suppose we're given the numbers $17$, $407$ and $24$ in $ZZ_1009^times$. Assume $
17^a equiv 407 " " (mod 1009)\
17^b equiv 24 " " (mod 1009)
$
Can we find $17^(a b)$? If we know $a = 123$, we can raise $24$ to $123$.
$
17^b equiv 24" " (mod 1009)\
a = 123\
17^(a b) equiv (17^b)^a equiv 24^123 equiv 578" " (mod 1009)
$
More generally, if we know $17^a$ and the exponent $b$, or if we know $17^b$ and the exponent $a$, it would be possible for us to know $17^(a b)$. However, given just $17^a$ and $17^b$, there is no trivial way to find the answer.
Finding $x^(a b)$ when just given $x$, $x^a$, and $x^b$ is named the Diffie-Hellman problem. The difficulty of this problem relates to the difficulty of DLP, since solving the Discrete Log would give us the answer. Assuming the Diffie-Hellman problem is difficult, we can use this to setup a cryptographic exchange.
/*
Given a known base $x$ within a group $G$, one cannot trivially obtain $x^(a b)$ from just $x^a$ and $x^b$ if the integers $a$ and $b$ are not known. (Exponentiation here means repeated application of the group operation. In groups where the operation is normally known as addition (such as elliptic curves), we will write $a x$ and $b x$ instead.)
This is named the Diffie-Hellman problem. If the discrete log problem can be solved trivially, one can simply obtain $b$ from $x^b$ and $x$, then exponentiate $(x^a)^b = x^(a b)$. As such, the difficulty of the Diffie-Hellman problem in a group is partially related to the difficulty of solving DLP in the same group.
*/
Consider the following case within $ZZ_1009^times$ where anything sent between Alice and Bob can be seen by Eve. Alice calculates $17^123 equiv 407$, and only sends Bob $407$. Bob calculates $17^456 equiv 24$, and only sends Alice $24$. After exchanging their information, Alice can compute $24^123 equiv 578$, and Bob can also compute $407^456 equiv 578$. Eve, only intercepting the numbers $17, 407, 24$ in their communication, is unable to calculate the secret number $578$ without solving the Diffie-Hellman problem.
#figure(image("Diffie-Hellman.svg", width: 80%), caption: [Diagram by author, a description of the Diffie-Hellman Key Exchange process.])
To generalize, the Diffie-Hellman Key Exchange utilizes the difficulty of the Diffie-Hellman problem. Under an agreed upon group $G$ and base $x in G$, Alice and Bob can establish a shared secret. Alice can generate a secret exponent $a$ and send Bob $x^a$, while Bob can generate a secret exponent $b$ and send Alice $x^b$. Together, they can both compute $x^(a b)$ as their shared secret securely, even if Eve is able to intercept this communication.
The specific example was done in $ZZ_1009^times$. In reality, the size of the group will be much larger to prevent anyone from trivially breaking the exchange and finding the secret @friedl_diffie-hellman_2006@velvindron_increase_2017. The more general technique of performing Diffie-Hellman on the group of multiplication modulo a prime is called Finite Field Diffie-Hellman. We first consider one way to break this, and afterwards show that elliptic curves would take more effort to break.
== Index Calculus
Diffie-Hellman Key Exchange with modular multiplication normally uses groups $ZZ_p^times$ where $2^2048 < p < 2^8192$ @friedl_diffie-hellman_2006@velvindron_increase_2017. The large size of the prime ensures that solving DLP is inefficient. For smaller groups, the Diffie-Hellman Key Exchange is less secure because DLP can be solved faster using Index Calculus.
Let's solve the following:
$
17^n equiv 24" (mod 1009)"
$
To find $n$, we first define a logarithm function $L$. $L(x)$ is defined such that
$
17^L(x) equiv x" (mod 1009)"
$
Therefore, our goal is to find $L(24)$.
#pagebreak()
With
$
17^(L(x) + L(y)) equiv 17^(L(x)) dot 17^(L(y)) equiv x y &equiv 17^(L(x y))&" (mod 1009)"\
17^(L(x) + L(y)) dot 17^(-L(x y)) equiv 17^(L(x) + L(y) - L(x y)) &equiv 1&" (mod 1009)"
$
Since $|17| = 1008$, we have (notice the change in modulus)
$
L(x) + L(y) - L(x y) &equiv 0&" (mod 1008)"\
L(x) + L(y) &equiv L(x y)&" (mod 1008)"
$
As such, we have a relation analogous to the laws of logarithm on real numbers. Since every number can be factorized into primes, the idea is to obtain $L(p)$ for small primes $p$, then figure out $L(24)$ afterwards. We first try to factorize exponents of $17$ into primes up to $13$:
$
17^15 &equiv 2^2 dot 5 dot 13&" (mod 1009)"\
17^16 &equiv 2^7 dot 3&" (mod 1009)"\
17^24 &equiv 2 dot 11^2&" (mod 1009)"\
17^25 &equiv 2 dot 3 dot 13&" (mod 1009)"\
17^33 &equiv 2^2 dot 3^2 dot 11&" (mod 1009)"\
17^36 &equiv 2^2 dot 7^2&" (mod 1009)"\
$
Applying $L$ to both sides of the congruences, we obtain
$
15 &equiv 2 L(2) + L(5) + L(13)&" (mod 1008)"\
16 &equiv 2 L(7) + L(3)&" (mod 1008)"\
24 &equiv L(2) + 2L(11)&" (mod 1008)"\
25 &equiv L(2) + L(3) + L(13)&" (mod 1008)"\
33 &equiv 2 L(2) + 2 L(3) + L(11)&" (mod 1008)"\
36 &equiv 2 L(2) + 2 L(7) &" (mod 1008)"\
$
There are six unknowns $L(2), L(3), L(5), L(7), L(11), L(13)$ and six congruences, using linear algebra methods, we can arrive at the solution
$
L(2) = 646, L(3) = 534, L(5) = 886, L(7) = 380, L(11) = 697, L(13) = 861
$
Next, the idea is to find $17^x dot 24$ for some $x$ that can factorize over primes up to 13. (Note that $x = 0$ works here since $24$ can be easily factorized, but in most cases it won't) Indeed, we have $17^2 dot 24 equiv 2 dot 3^2 dot 7^2" (mod 1009)"$, so then we have
$
L(17^2 dot 24) equiv L(2 dot 3^2 dot 7^2)" (mod 1008)"\
2 + L(24) equiv L(2) + 2L(3) + 2L(7)" (mod 1008)"\
L(24) equiv -2 + 646 + 2 dot 534 + 2 dot 380" (mod 1008)"\
L(24) = 456
$
We arrive at the answer $n = 456$.
#pagebreak()
Index Calculus finds $n$ in $a^n equiv b" (mod " p")"$ @washington_elliptic_2008[pp.~144-146] with this procedure:
- Find $a^i$ for various $i$ that can be factorized with small primes up to a certain limit (in our example, the factor base was up to $13$).
- Solve $L(p_n)$ for these small primes with system of equations.
- Calculate $a^x dot b$ for various $x$ until it can be factored with our factor base. Then find $L(b)$ by the following procedure:
$
a^x dot b equiv p_1^c_1 dot p_2^c_2 dot ... dot p_n^c_n" (mod " p")"\
x + L(b) equiv c_1 L(p_1) + c_2 L(p_2) + ... + c_n L(p_n)" (mod " |a|")"\
L(b) equiv -x + c_1 L(p_1) + c_2 L(p_2) + ... + c_n L(p_n)" (mod " |a|")"
$
This method relies on prime factorizations always existing for integers, which in general does not apply to ellpitic curve points @washington_elliptic_2008[pp.~154-157].
For the example above, we examined exponents of $17$ up to $17^36$, and also computed $17 dot 24$ and $17^2 dot 24$. This took significantly less time than enumerating $17^n$ for all $n$ until we reach 456. Therefore, Index Calculus is much more efficient than brute-forcing.
An improved method called General Number Field Sieve, based on Index Calculus, is more efficient than the latter for large primes @nguyen_index_2005. The expected running time for the GNFS algorithm is proportional to @lenstra_l-notation_2005:
$
exp((64\/9)^(1\/3)(ln p)^(1\/3)(ln ln p)^(2\/3))
$
where $p$ is the prime that defines the group $ZZ_p^times$. Assuming that for $p = 3$ the GNFS runs in one nanosecond or $10^(-9)$ seconds, solving DLP for $p = 2^2048$ with GNFS would take about
$
exp((64\/9)^(1\/3)(ln 2^2048)^(1\/3)(ln ln 2^2048)^(2\/3))/exp((64\/9)^(1\/3)(ln 3)^(1\/3)(ln ln 3)^(2\/3)) dot 10^(-9) approx 1.02 dot 10^26 "seconds"
$
or
$
1.02 dot 10^26 dot 1/60 dot 1/60 dot 1/24 dot 1/365.2425 approx 3.22 dot 10^18 "years"
$
In later sections, we will take a look at Diffie-Hellman done on elliptic curves and how the time needed to solve DLP on elliptic curves compares with Diffie-Hellman on finite fields.
= Elliptic Curve Cryptography
The equation $C: y^2 = x^3 + A x + B$ (named the short Weierstrass form), where $A$ and $B$ are constants, defines an elliptic curve $C$. Elliptic curves are symmetric about the $x$-axis, since $
(x,y) in C <==> (x, -y) in C
$
Elliptic curves can be over a field, which is a set that forms a group under addition, forms a group under multiplication with non-zero elements, and where multiplication is distributive: $a(b + c) = a b + a c$ @kaliski_field_2011@kaliski_ring_2011. Finite fields denoted as $FF_p$ can be represented with integers $0$ to $p-1$ with addition and multiplication modulo $p$ @kaliski_finite_2011. A curve is over a finite field $FF_p$ if $x, y in FF_p$.
Since Diffie-Hellman works on any group, if we can show that points on an elliptic curve form a group, we can use elliptic curve and their points to establish shared secrets too. Furthermore, we will show that using ellptic curve points as the group for Diffie-Hellman provides quantifiable benefits.
#figure(image("Screenshot_20241022_160949.png", width: 70%), caption: [Diagram by author])
Since a group requires a binary operation, starting with two points $P$ and $Q$, one might try drawing a line between them and finding the third point of intersection on the curve. This can be denoted as $P * Q$. However, $*$ does not create a group. With $+$ computed as flipping the $y$-coordinate of the resulting point however, a group can be defined.
We now summarize the steps for defining a group law with $+$ as shown in @washington_elliptic_2008[pp.~12-15].
Let $P = (x_1,y_1)$ and $Q = (x_2,y_2)$ be distinct points on the curve, where $x_1 != x_2$. We can find a new point on the curve by drawing a line that goes across the two points, with
$
m = (y_2 - y_1)/(x_2 - x_1)\
y = m(x-x_1) + y_1
$
We substitute this into the equation of the curve and try to solve for $x$:
$
(m(x-x_1) + y_1)^2 = x^3 + A x + B
$
Expanding and rearranging gives:
$
x^3 - m^2 x^2 + (2m^2 x_1 - 2y_1m + A)x + 2y_1 m x_1 - m^2 x_1^2 - y_1 = 0
$
With Vieta's formulas, the sum of roots for the cubic is $m^2$. We already know two distinct roots of this polynomial as $x_1$ and $x_2$, so we can find the $x$ coordinate of the third point:
$
x_3 = m^2 - x_1 - x_2
$
To find the $y$-coordinate, we use the original line equation, but flip the resulting $y$-coordinate @silverman_rational_2015[p.~12].
$
y_3 = -(m(x_3 - x_1) + y_1) = m(x_1-x_3) - y_1
$
Therefore, we have arrived at $R = (x_3, y_3)$, a third point distinct from $P$ and $Q$.
#figure(image("Screenshot_20241022_160855.png", width: 70%), caption: [Diagram by author])
If one point $P = (x_1, y_1)$ is known, we can use implicit differentiation to find the tangent line:
$
y^2 = x^3 + A x + B\
2 y (dif y)/(dif x) = 3x^2 + A\
m = (dif y)/(dif x) = (3x^2 + A)/(2y) = (3x_1^2 + A)/(2 y_1)
$
With the same line equation $y = m(x - x_1) + y_1$, with the same expanded formula:
$
x^3 - m^2 x^2 + (2m^2 x_1 - 2y_1m + A)x + 2y_1 m x_1 - m^2 x_1^2 - y_1 = 0
$
This time, the line only intersects with two points on the curve, as it intersects with $P$ at a tangent, so $x_1$ is a repeated root in the equation.
We can find the third point with
$
x_3 = m^2 - 2 x_1\
y_3 = -(m(x_3 - x_1) + y_1) = m(x_1 - x_3) - y_1
$
We can then develop a group law for points on elliptic curves. For special cases, such as adding two points on a vertical line, a "point at infinity" is added to the normal set of points on the curve, so that the group is well-defined for operations for all elements. This is studied more rigorously in projective geometry, though we incorporate this concept for simply defining the group law on elliptic curves @washington_elliptic_2008[p.~11].
For an elliptic curve $C: y^2 = x^3 + A x + B$ over a field $FF$ we define the following set:
$
E(C) = {bold(0)} union {(x, y) | y^2 = x^3 + A x + B, #h(6pt) x,y in FF}
$
Where $bold(0)$ is the "point at infinity". We now show that $E(C)$ forms a group.
#figure(image("ECClines-2.svg"), caption: [Diagram from @supermanu_ecclines-2_2007, an illustration of the group operation defined on elliptic curves]) <illust>
Let $P$ and $Q$ be two points from $E(C)$. Define $+$ to be as follows:
- If $P = Q = (x_1, 0)$, let $P + Q = bold(0)$. (\#4 from @illust)
- If $P = Q = (x_1, y_1)$ where $y != 0$ (\#2 from @illust), let
$
m = (3x_1^2 + A)/(2y_1)\
x_3 = m^2 - 2x_1\
P + Q = (x_3, m(x_1-x_3)-y_1)
$
- If $P = (x_1, y_1), Q = (x_2, y_2)$ where $x_1 = x_2, y_1 != y_2$ (\#3 from @illust): let $P + Q = bold(0)$.
#pagebreak()
- If $P = (x_1, y_1), Q = (x_2, y_2)$ (\#1 from @illust), let
$
m = (y_2 - y_1)/(x_2 - x_1)\
x_3 = m^2 - x_1 - x_2\
P + Q = (x_3, m(x_1-x_3)-y_1)
$
- If $Q = bold(0)$, $P + Q = P$.
- If $P = bold(0)$, $P + Q = Q$.
== Proof of Associativity
Perhaps the most surprising result of defining this operation is that the operation is associative, that is, $(P + Q) + R = P + (Q + R)$ for any three points $P, Q, R in E(C)$. If we can prove that the $+$ operation is associative, then we can show that $E(C)$ forms a group, and Diffie-Hellman can be performed on $E(C)$. Proving this algebraicly becomes tedious, but there is a geometric argument from @silverman_rational_2015[pp.~8-15] using cubic space curves and Bézout's theorem for a specific case where the points have distinct $x$ coordinates which is outlined below.
A cubic space curve is given with the following formula:
$
a x^3 + b x^2 y + c x y^2 + d y^3 + e x^2 + f x y + g y^2 + h x + i y + j = 0
$
Therefore, an elliptic curve $x^3 + A x + B - y^2 = 0$ is a cubic space curve. The union of three lines $ (y - (m_1 x + b_1))(y - (m_2 x + b_2))(y - (m_3 x + b_3)) = 0 $ is also a cubic space curve.
A consequence of Bézout's theorem is that two cubic space curves intersect at 9 points. The nine points could include the point at infinity in projective geometry, counting multiplicities as more than one point of intersection such as when at a tangent, and allows complex numbers as coordinates. For simplicity, the proof ignores these technicalities.
*Proposition:*
Let $C$, $C_1$, $C_2$ be cubic space curves. Suppose $C$ goes through eight of the nine intersection points between $C_1$ and $C_2$. Then $C$ also goes through the ninth intersection point.
*Proof:* A total of 10 coefficients were used in the formula for a cubic space curve: $a, b, c, d, e, f, g, h, i, j$. Since scaling the equation by a linear factor results in the same curve, the curve can be said to be constrained by nine linear factors, or 9-dimensional. Suppose we constrained the curve such that it needs to go through a specific point. The number of linear factors that are allowed to vary would be decreased by one (similar to interpolating polynomials where adding another point requires a higher degree polynomial, this is in the other direction). If we constrain a cubic curve to go through eight specific points, the number of linear factors that are free to vary would be $9 - 8 = 1$. In other words, the set of all cubic curves that go through eight specific points is one-dimensional.
Let $C_1$ be specified by the equation $F_1(x, y) = 0$ and $C_2$ by $F_2(x, y) = 0$. We know that the set of all possible curves $C$ that go through eight intersection points between $C_1$ and $C_2$ is one-dimensional.
A linear combination of $F_1$ and $F_2$ results in a cubic space curve that goes through the eight intersection points: $F_3 = lambda_1 F_1 + lambda_2 F_2$ with $F_3(a, b) = 0$ since any intersection point $(a,b)$ will satisfy $F_1(a, b) = F_2(a, b) = 0$. $F_3$ is also free to vary by a single linear factor $lambda_2\/lambda_1$ (accounting for scaling) so it represents a one-dimensional family of cubic space curves. Since both $C$ and $F_3$ are one-dimensional, all curves $C$ can be represented with the form $F_3(x, y) = 0$ for some $lambda_1$ and $lambda_2$.
The ninth intersection point also satisfies $F_3(x, y) = 0$, therefore $C$ must go through the ninth intersection point. $square$
#figure(image("Screenshot_20240626_152533.png"), caption: [By author, graphical proof of associativity]) <graphical_proof>
Normally, the point at infinity is not shown in diagrams, but since it is treated as one of the points of intersection in Bézout's theorem, the point will be denoted as $O$.
*Proposition:* Let $P, Q, R in E(C)$ with binary operations $+$ and $*$ as defined previously. Then $(P + Q) * R = P * (Q + R)$. (flipping the $y$-coordinate of points on both sides would give $(P + Q) + R = P + (Q + R)$, proving the associativity of $+$)
*Proof:* With @graphical_proof, we start with three arbitrary points on the elliptic curve, $P$, $Q$, and $R$. By drawing a black line, we find $Q * R$ from $Q$ and $R$. $P * Q$ is found from $P$ and $Q$ with a blue line. To find $Q + R$, we draw a blue line from $Q * R$ to $O$, then take the third intersection point, equivalent to "flipping" the intersection point used in the definition of elliptic curve addition. We find $P + Q$ by drawing a black line that goes through $P * Q$ and $O$.
A blue line is drawn from $P + Q$ and $R$ to find $(P + Q) * R$. A black line is drawn from $P$ and $Q + R$ to find $P * (Q + R)$.
We can group the union of three blue lines as $C$ and group the union of three black lines as $C_2$, and let $C_1$ be the elliptic curve. Note that both $C_2$ and $C$ intersect with $C_1$ at $P$, $Q$, $R$, $Q*R$, $Q+R$, $P*R$, $P+Q$, and $O$ by the way we have drawn the lines. The only difference is that the ninth intersection between $C_1$ and $C$ is known as $(P + Q) * R$, where the ninth intersection between $C_1$ and $C_2$ is known as $P * (Q + R)$.
Since $C$, $C_1$, $C_2$ are cubic space curves, we can use the proposition from earlier. $C$ (the blue lines) goes through eight of the nine intersection points between $C_1$ (the ellptic curve) and $C_2$ (the black lines). $C$ must also go through the ninth intersection point between $C_1$ and $C_2$ known as $P * (Q + R)$. From drawing the blue lines, the ninth intersection point is also known as $(P + Q) * R$, so it must be that $(P + Q) * R = P * (Q + R)$. $square$
This is deliberately an incomplete proof, since we did not cover corner cases such as when two of the three points have the same $x$-coordinate, a more complete proof can be seen in @washington_elliptic_2008[pp.~20-32], we will assume associativity is true in general here.
== Group of elliptic curve points
Therefore, $E(C)$ forms a group:
1. The operation $+$ is well-defined, closed and associative.
2. $bold(0)$ is the identity, where $P + bold(0) = P$ for all $P in E(C)$.
3. Existence of inverse: let $P = (x, y)$, its inverse is $-P = (x, -y)$ since $(x, y) + (x, -y) = bold(0)$.
Now that we have shown that elliptic curve points form a group, we can apply the Diffie-Hellman Key Exchange to elliptic curves as well.
== Elliptic Curve Diffie-Hellman
Elliptic curve operations and modular multiplicative group operations differ in notation. In elliptic curves, the operation is commonly represented as addition of two points. Therefore $A + B$ is the normal operation on two points $A$ and $B$ while $k A$ is the operation repeated ($2A = A + A$). In the multiplicative group modulo $p$, it corresponds to $A B$ and $A^k$. Thus, an operation in previous sections such as $A^k$ will now be written as $k A$ in the context of elliptic curves.
With that note, Diffie-Hellman in elliptic curves follows the exact same procedure: two parties agree on a curve group to use, then decide on a base point $P$. Alice generates a secret integer $a$ and sends Bob $a P$. Bob generates a secret integer $b$ and sends Alice $b P$. They can now both calculate $a b P$, which cannot be known by third parties unless they can solve the discrete log problem in elliptic curves.
A short example is as follows: Alice and Bob agree to use the curve $y^2 = x^3 + 6692x + 9667$ in $FF_10037$, with the base point $P = (3354, 7358)$ (from @silverman_rational_2015[p.~164]). Alice generates $a = 1277$ and sends $Q = a P = (5403, 5437)$ to Bob. Bob generates $b = 1337$ and sends $R = b P = (7751, 1049)$ to Alice. Alice calculates $a R = a b P = (8156, 1546)$, and Bob calculates $b Q = b a P = (8156, 1546)$ as their shared secret.
To figure out this shared secret, Eve could try to break the discrete log for $Q = a P$.
== Finding the Discrete Log with Pollard's $rho$ algorithm
Pollard's $rho$ algorithm is a general algorithm for solving the discrete log problem for any Abelian (commutative) group. It is less efficient than the general number field sieve on discrete log in finite fields, taking $O(sqrt(N))$ time on average in a group $G$ where $|G| = N$ @washington_elliptic_2008[pp.~147-150].
Pollard's $rho$ can be used to solve the problem above: for the curve $y^2 = x^3 + 6692x + 9667$ in $FF_10037$, with $P = (3354, 7358)$, $Q = (5403, 5437)$. Find $k$ such that $k P = Q$.
Generate 10 random points on the curve based on multiples of $P$ and $Q$:
$
M_0 = 42P + 37Q #h(25pt) M_1 = 21P + 12Q #h(25pt) M_2 = 25P + 20Q\
M_3 = 39P + 15Q #h(25pt) M_4 = 23P + 29Q #h(25pt) M_5 = 45P + 25Q\
M_6 = 14P + 37Q #h(25pt) M_7 = 30P + 12Q #h(25pt) M_8 = 45P + 49Q #h(25pt) M_9 = 40P + 45Q\
$
Then pick, in the same way, a random initial point:
$
A_0 = 15P + 36Q = (7895, 3157)
$
Then, choose an $M_i$ point to add to based on the ones digit of the $x$ coordinate of the point. As $A_0$ has $x = 7895$, $A_1 = A_0 + M_5 = (7895, 3157) + (5361, 3335) = (6201, 273)$.
Formally, define $
A_(n+1) = A_n + M_i" where " i equiv x_n" (mod 10)"
$
for $A_n = (x_n,y_n)$. The choice of random $M_i$ points creates a kind of "random walk" of the points in the elliptic curve. As we keep calculating, we get:
$
A_0 &= (7895, 3157), A_1 &=& (6201, 273), ...,\
A_95 &= (170, 7172), A_96 &=& (7004, 514), ...,\
A_100 &= (170, 7172), A_101 &=& (7004, 514)
$
We reach a cycle with $A_95 = A_100$. Since we know the multiples of $P$ and $Q$ for all of the $M_i$ points and thus all $A_n$ points, keeping track of them gives us $A_95 = 3126P + 2682Q$ and $A_100 = 3298P + 2817Q$. With $3126P + 2682Q = 3298P + 2817Q$, and knowing that $|P| = 10151$, we have:
$
bold(0) = 172P + 135Q = (172 + 135n)P\
172 + 135n equiv 0" (mod 10151)"\
n equiv 1277" (mod 10151)"
$
We can verify that $1277P = Q$, and we can then calculate $1277R = (8156, 1546)$ in order to find the shared secret on the example above.
#figure(image("Pollard_rho_cycle.svg", width:60%), caption: [Diagram from @_pollard_2021, a visual explanation for the name ($rho$) of the algorithm])
Therefore, Pollard's $rho$ operates with the following steps:
- For finding $k$ where $k P = Q$, first generate a random set of elements consisting of $M_i = x_i P + y_i Q$, then generate the initial point $A_0 = x_a P + y_a Q$
- With a specific criteria, do a random walk based on some property of $A_n$ to make $A_(n+1)$ (In our case, we used the ones digit)
- When a cycle is reached, we can tabulate all the coefficients in making the random walk to have a form like $a P + b Q = (a + c)P + (b + d) Q$, then
$
c P + d Q = bold(0)\
(c + k d)P = bold(0)
$
And then $k$ can be solved through $c$ and $d$ based on $|P|$.
= Evaluation
Pollard's $rho$ algorithm on elliptic curve groups works on average with $sqrt(pi/4 N)$ elliptic curve additions with $N = |P|$ @bernstein_correct_2011. The GNFS for finite fields has time complexity $exp((64\/9)^(1\/3)(ln p)^(1\/3)(ln ln p)^(2\/3))$ in a prime field with order $p$. Assigning real numbers to these expressions, we can evaluate the current industry standards.
== Diffie-Hellman in TLS 1.3
Transport Layer Security (TLS) is the protocol used in virtually all internet connections secured through cryptography @heinrich_transport_2011, with the latest version being TLS 1.3. One important part of this protocol is Diffie-Hellman Key Exchange. We shall now examine the Diffie-Hellman methods it supports.
=== Finite Field Diffie-Hellman
The smallest finite field used by TLS for Diffie-Hellman is named ffdhe2048 @rescorla_transport_2018, with the prime modulus defined as $
p = 2^2048 - 2^1984 + (floor(2^1918 dot e) + 560316) dot 2^64 - 1
$
The base is $2$, with $|2| = (p - 1) \/ 2$. If we computed the expected running time for the general number field sieve to run, it requires about $1.00 dot 10^35 approx 2^116$ times than it would take for GNFS to run with order 3, providing about 116 bits of security. The original definition of ffdhe2048 gives a more conservative estimate that this provides 103 bits of security @gillmor_negotiated_2016.
As this field uses a prime 2048 bits of size, each group element requires 2048 bits of storage.
=== Elliptic Curve Diffie-Hellman
The elliptic curve with the smallest element size supported by TLS is curve25519, using the prime $p = 2^255 - 19$ as the field $FF_p$ the elliptic curve is over, and the curve $y^2 = x^3 + 486662 x^2 + x$. The base point is $x = 9$, and the order of that point is $2^252 + 27742317777372353535851937790883648493$. As per @hankerson_elliptic_2011 the fastest known method to break DLP (a modified Pollard's $rho$ algorithm) takes $sqrt(pi/4 N)$ group operations, this specific curve requires approximately $7.54 dot 10^37 approx 2^126$ operations to solve DLP, or providing approximately 126 bits of security.
As elliptic curve points have coordinates under the prime field $2^255 - 19$, each coordinate value requires 255 bits of storage, therefore an entire point (both $x$ and $y$ coordinates) would take about 510 bits of storage.
== Performance of group operations
Assume that multiplying two $256$-bit integers has cost $bold(C)$. Multiplication of two $2048$-bit integers thus will cost $64bold(C)$ as each $2048$-bit integer has $8$ $256$-bit digits and each of the eight digits from the first number needs to multiply with the eight from the second number @pudlak_complexity_2013[p.~398].
The story in elliptic curves is much more complicated. Curve25519 follows the form $B y^2 = x^3 + A x^2 + x$ called a Montgomery curve. All curves of that form can be transformed into the short Weierstrass form we used but not the other way around. Diffie-Hellman for curves in that form could be designed so that only the $x$-coordinate of each point in the process is needed, which simplifies the process by removing the need to compute $y$ coordinates @costello_montgomery_2018.
Under Montgomery arithmetic where only the $x$ coordinates of curve points are involved, adding two curve points costs $3M + 2S + 3a + 3s$, where $M, S, a, s$ are costs for multiplying two numbers, squaring a number, adding two numbers, subtracting two numbers in the field the curve is over respectively. Assuming that the cost for addition and subtraction is negligible compared to multiplication, and assuming that squaring has approximately equal cost as multiplying two numbers, the cost for adding two curve points is approximately $5M$. Note that the field is $2^255 - 19$, so the cost of a multiplication $M$ (for two $255$-bit integers) can be considered as less than the cost of multiplying two $256$-bit integers. So we have $M < bold(C)$.
Adding two curve points with curve25519 only costs $5M$, while multiplying in ffdhe2048 costs $64bold(C)$. (approximately 13x difference) As performing the group operation is the primary backbone behind Diffie-Hellman Key Exchange, this performance difference can have huge implications.
== Comparison
The specific methods we have chosen to evaluate provide a general insight into the efficiencies of different methods of Diffie-Hellman Key Exchange.
Curve25519 only requires about 512 bits of storage for a full point, about 256 bits if only storing the $x$-coordinate, while in ffdhe2048, each element requires 2048 bits of storage, taking 8x as much storage than curve25519.
Adding two curve points in those groups compared to multiplying two finite field elements provide similar benefits in performance as well, with an approximate 13x difference in the number of operations required.
Both of these advantages can be seen from the fact that the Discrete Log Problem is much harder on elliptic curves than in finite fields in general, which we have shown above through comparing the General Number Field Sieve and Pollard's $rho$ algotithm. As a consequence, larger Finite Fields are required to provide the same level of security, which makes elliptic curves more efficient in comparison.
= Conclusion
Elliptic Curve Cryptography offers a much better alternative to other existing cryptographic methods for establishing secrets through an insecure channel. This is partly because of the difficulty of the Discrete Log Problem for elliptic curves compared to other groups, which allows it to provide the same level of security while being more efficient. We theorize that using Elliptic Curves takes 8 times less storage than Finite Fields for Diffie-Hellman, and performs about 13 times faster.
#bibliography("shortlist.bib") |
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/001_Magic%202013.typ | typst | #import "@local/mtgset:0.1.0": conf
#show: doc => conf("Magic 2013", doc)
#include "./001 - Magic 2013/001_Odric, Master Tactician.typ"
#include "./001 - Magic 2013/002_Xathrid Gorgon.typ"
#include "./001 - Magic 2013/003_Chronomaton.typ"
#include "./001 - Magic 2013/004_Krenko, Mob Boss.typ"
#include "./001 - Magic 2013/005_Threadbare.typ"
#include "./001 - Magic 2013/006_Talrand, Sky Summoner.typ"
#include "./001 - Magic 2013/007_The Stonekiller.typ"
#include "./001 - Magic 2013/008_The Stonekiller, Part 2.typ"
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-FE70.typ | typst | Apache License 2.0 | #let data = (
("ARABIC FATHATAN ISOLATED FORM", "Lo", 0),
("ARABIC TATWEEL WITH FATHATAN ABOVE", "Lo", 0),
("ARABIC DAMMATAN ISOLATED FORM", "Lo", 0),
("ARABIC TAIL FRAGMENT", "Lo", 0),
("ARABIC KASRATAN ISOLATED FORM", "Lo", 0),
(),
("ARABIC FATHA ISOLATED FORM", "Lo", 0),
("ARABIC FATHA MEDIAL FORM", "Lo", 0),
("ARABIC DAMMA ISOLATED FORM", "Lo", 0),
("ARABIC DAMMA MEDIAL FORM", "Lo", 0),
("ARABIC KASRA ISOLATED FORM", "Lo", 0),
("ARABIC KASRA MEDIAL FORM", "Lo", 0),
("ARABIC SHADDA ISOLATED FORM", "Lo", 0),
("ARABIC SHADDA MEDIAL FORM", "Lo", 0),
("ARABIC SUKUN ISOLATED FORM", "Lo", 0),
("ARABIC SUKUN MEDIAL FORM", "Lo", 0),
("ARABIC LETTER HAMZA ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM", "Lo", 0),
("ARABIC LETTER ALEF WITH HAMZA ABOVE ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ALEF WITH HAMZA ABOVE FINAL FORM", "Lo", 0),
("ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM", "Lo", 0),
("ARABIC LETTER WAW WITH HAMZA ABOVE FINAL FORM", "Lo", 0),
("ARABIC LETTER ALEF WITH HAMZA BELOW ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ALEF WITH HAMZA BELOW FINAL FORM", "Lo", 0),
("ARABIC LETTER YEH WITH HAMZA ABOVE ISOLATED FORM", "Lo", 0),
("ARABIC LETTER YEH WITH HAMZA ABOVE FINAL FORM", "Lo", 0),
("ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM", "Lo", 0),
("ARABIC LETTER YEH WITH HAMZA ABOVE MEDIAL FORM", "Lo", 0),
("ARABIC LETTER ALEF ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ALEF FINAL FORM", "Lo", 0),
("ARABIC LETTER BEH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER BEH FINAL FORM", "Lo", 0),
("ARABIC LETTER BEH INITIAL FORM", "Lo", 0),
("ARABIC LETTER BEH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER TEH MARBUTA ISOLATED FORM", "Lo", 0),
("ARABIC LETTER TEH MARBUTA FINAL FORM", "Lo", 0),
("ARABIC LETTER TEH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER TEH FINAL FORM", "Lo", 0),
("ARABIC LETTER TEH INITIAL FORM", "Lo", 0),
("ARABIC LETTER TEH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER THEH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER THEH FINAL FORM", "Lo", 0),
("ARABIC LETTER THEH INITIAL FORM", "Lo", 0),
("ARABIC LETTER THEH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER JEEM ISOLATED FORM", "Lo", 0),
("ARABIC LETTER JEEM FINAL FORM", "Lo", 0),
("ARABIC LETTER JEEM INITIAL FORM", "Lo", 0),
("ARABIC LETTER JEEM MEDIAL FORM", "Lo", 0),
("ARABIC LETTER HAH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER HAH FINAL FORM", "Lo", 0),
("ARABIC LETTER HAH INITIAL FORM", "Lo", 0),
("ARABIC LETTER HAH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER KHAH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER KHAH FINAL FORM", "Lo", 0),
("ARABIC LETTER KHAH INITIAL FORM", "Lo", 0),
("ARABIC LETTER KHAH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER DAL ISOLATED FORM", "Lo", 0),
("ARABIC LETTER DAL FINAL FORM", "Lo", 0),
("ARABIC LETTER THAL ISOLATED FORM", "Lo", 0),
("ARABIC LETTER THAL FINAL FORM", "Lo", 0),
("ARABIC LETTER REH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER REH FINAL FORM", "Lo", 0),
("ARABIC LETTER ZAIN ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ZAIN FINAL FORM", "Lo", 0),
("ARABIC LETTER SEEN ISOLATED FORM", "Lo", 0),
("ARABIC LETTER SEEN FINAL FORM", "Lo", 0),
("ARABIC LETTER SEEN INITIAL FORM", "Lo", 0),
("ARABIC LETTER SEEN MEDIAL FORM", "Lo", 0),
("ARABIC LETTER SHEEN ISOLATED FORM", "Lo", 0),
("ARABIC LETTER SHEEN FINAL FORM", "Lo", 0),
("ARABIC LETTER SHEEN INITIAL FORM", "Lo", 0),
("ARABIC LETTER SHEEN MEDIAL FORM", "Lo", 0),
("ARABIC LETTER SAD ISOLATED FORM", "Lo", 0),
("ARABIC LETTER SAD FINAL FORM", "Lo", 0),
("ARABIC LETTER SAD INITIAL FORM", "Lo", 0),
("ARABIC LETTER SAD MEDIAL FORM", "Lo", 0),
("ARABIC LETTER DAD ISOLATED FORM", "Lo", 0),
("ARABIC LETTER DAD FINAL FORM", "Lo", 0),
("ARABIC LETTER DAD INITIAL FORM", "Lo", 0),
("ARABIC LETTER DAD MEDIAL FORM", "Lo", 0),
("ARABIC LETTER TAH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER TAH FINAL FORM", "Lo", 0),
("ARABIC LETTER TAH INITIAL FORM", "Lo", 0),
("ARABIC LETTER TAH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER ZAH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ZAH FINAL FORM", "Lo", 0),
("ARABIC LETTER ZAH INITIAL FORM", "Lo", 0),
("ARABIC LETTER ZAH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER AIN ISOLATED FORM", "Lo", 0),
("ARABIC LETTER AIN FINAL FORM", "Lo", 0),
("ARABIC LETTER AIN INITIAL FORM", "Lo", 0),
("ARABIC LETTER AIN MEDIAL FORM", "Lo", 0),
("ARABIC LETTER GHAIN ISOLATED FORM", "Lo", 0),
("ARABIC LETTER GHAIN FINAL FORM", "Lo", 0),
("ARABIC LETTER GHAIN INITIAL FORM", "Lo", 0),
("ARABIC LETTER GHAIN MEDIAL FORM", "Lo", 0),
("ARABIC LETTER FEH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER FEH FINAL FORM", "Lo", 0),
("ARABIC LETTER FEH INITIAL FORM", "Lo", 0),
("ARABIC LETTER FEH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER QAF ISOLATED FORM", "Lo", 0),
("ARABIC LETTER QAF FINAL FORM", "Lo", 0),
("ARABIC LETTER QAF INITIAL FORM", "Lo", 0),
("ARABIC LETTER QAF MEDIAL FORM", "Lo", 0),
("ARABIC LETTER KAF ISOLATED FORM", "Lo", 0),
("ARABIC LETTER KAF FINAL FORM", "Lo", 0),
("ARABIC LETTER KAF INITIAL FORM", "Lo", 0),
("ARABIC LETTER KAF MEDIAL FORM", "Lo", 0),
("ARABIC LETTER LAM ISOLATED FORM", "Lo", 0),
("ARABIC LETTER LAM FINAL FORM", "Lo", 0),
("ARABIC LETTER LAM INITIAL FORM", "Lo", 0),
("ARABIC LETTER LAM MEDIAL FORM", "Lo", 0),
("ARABIC LETTER MEEM ISOLATED FORM", "Lo", 0),
("ARABIC LETTER MEEM FINAL FORM", "Lo", 0),
("ARABIC LETTER MEEM INITIAL FORM", "Lo", 0),
("ARABIC LETTER MEEM MEDIAL FORM", "Lo", 0),
("ARABIC LETTER NOON ISOLATED FORM", "Lo", 0),
("ARABIC LETTER NOON FINAL FORM", "Lo", 0),
("ARABIC LETTER NOON INITIAL FORM", "Lo", 0),
("ARABIC LETTER NOON MEDIAL FORM", "Lo", 0),
("ARABIC LETTER HEH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER HEH FINAL FORM", "Lo", 0),
("ARABIC LETTER HEH INITIAL FORM", "Lo", 0),
("ARABIC LETTER HEH MEDIAL FORM", "Lo", 0),
("ARABIC LETTER WAW ISOLATED FORM", "Lo", 0),
("ARABIC LETTER WAW FINAL FORM", "Lo", 0),
("ARABIC LETTER ALEF MAKSURA ISOLATED FORM", "Lo", 0),
("ARABIC LETTER ALEF MAKSURA FINAL FORM", "Lo", 0),
("ARABIC LETTER YEH ISOLATED FORM", "Lo", 0),
("ARABIC LETTER YEH FINAL FORM", "Lo", 0),
("ARABIC LETTER YEH INITIAL FORM", "Lo", 0),
("ARABIC LETTER YEH MEDIAL FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM", "Lo", 0),
("ARABIC LIGATURE LAM WITH ALEF FINAL FORM", "Lo", 0),
(),
(),
("ZERO WIDTH NO-BREAK SPACE", "Cf", 0),
)
|
https://github.com/kaarmu/splash | https://raw.githubusercontent.com/kaarmu/splash/main/src/palettes/misc.typ | typst | MIT License | /* The gruvbox color palette.
*
* Source: https://github.com/morhetz/gruvbox
* Accessed: 2023-03-31
*/
#let gruvbox = (
dark0-hard : rgb("#1d2021"),
dark0 : rgb("#282828"),
dark0-soft : rgb("#32302f"),
dark1 : rgb("#3c3836"),
dark2 : rgb("#504945"),
dark3 : rgb("#665c54"),
dark4 : rgb("#7c6f64"),
dark4-256 : rgb("#7c6f64"),
gray-245 : rgb("#928374"),
gray-244 : rgb("#928374"),
light0-hard : rgb("#f9f5d7"),
light0 : rgb("#fbf1c7"),
light0-soft : rgb("#f2e5bc"),
light1 : rgb("#ebdbb2"),
light2 : rgb("#d5c4a1"),
light3 : rgb("#bdae93"),
light4 : rgb("#a89984"),
light4-256 : rgb("#a89984"),
bright-red : rgb("#fb4934"),
bright-green : rgb("#b8bb26"),
bright-yellow : rgb("#fabd2f"),
bright-blue : rgb("#83a598"),
bright-purple : rgb("#d3869b"),
bright-aqua : rgb("#8ec07c"),
bright-orange : rgb("#fe8019"),
neutral-red : rgb("#cc241d"),
neutral-green : rgb("#98971a"),
neutral-yellow : rgb("#d79921"),
neutral-blue : rgb("#458588"),
neutral-purple : rgb("#b16286"),
neutral-aqua : rgb("#689d6a"),
neutral-orange : rgb("#d65d0e"),
faded-red : rgb("#9d0006"),
faded-green : rgb("#79740e"),
faded-yellow : rgb("#b57614"),
faded-blue : rgb("#076678"),
faded-purple : rgb("#8f3f71"),
faded-aqua : rgb("#427b58"),
faded-orange : rgb("#af3a03"),
)
|
https://github.com/dssgabriel/master-thesis | https://raw.githubusercontent.com/dssgabriel/master-thesis/main/src/acknowledgments.typ | typst | Apache License 2.0 | = Acknowledgments
#h(1.8em)
I want to express my most sincere appreciation for my supervisor at CEA, <NAME>, who supported me throughout this internship and always provided me with good advice on how to improve. His deep technical insight into efficient software engineering and expert knowledge of modern hardware architectures were of tremendous help when I got stuck on challenging problems.
I am also especially grateful to my co-supervisor, <NAME>, for his help and advice whenever I had questions. He accompanied me throughout my internship and this endeavor would not have been possible without him.
Thanks should also go to Thao, Hélène, Nathalie, and all the Teratec Campus staff who welcomed me daily, for their availability and cheerfulness.
I am also thankful to my family who supported me during those six months. A special thanks to my girlfriend who put her graphic design skills to good use and helped me make some of the diagrams and figures presented in this report.
Finally, I would like to have a word for my fellow interns who have paced my days and with whom I was able to have deeply nerdy conversations that sparked brilliant ideas for my work. Many thanks for all the coffee breaks and the intense board games after lunch!
|
https://github.com/binhtran432k/ungrammar-docs | https://raw.githubusercontent.com/binhtran432k/ungrammar-docs/main/contents/appendix/documentation.typ | typst | = Ungrammar Language Features Documentation <apx-doc>
#link("https://github.com/rust-analyzer/ungrammar")[Ungrammar] is a novel data
format for defining concrete syntax trees. This project aims to integrate
Ungrammar language support into VS Code, providing features to streamline the
creation and modification of `.ungram` files. By offering a dedicated language
experience within the editor, we aim to simplify the development process for
users working with this syntax definition format.
#figure(
image(
"/assets/main.png",
width: 80%,
),
caption: [Ungrammar within VS Code],
)
== Features
=== IntelliSense and Validation
We offer up node name suggestions as you type with IntelliSense. You can also
manually see suggestions with the Trigger Suggestions command (`Ctrl+Space`).
We also perform structural and value verification giving you red squiggles.
To disable validation, use the `ungrammar.validate.enable`
#link("https://code.visualstudio.com/docs/getstarted/settings")[setting].
#figure(
image(
"/assets/validation.png",
width: 80%,
),
caption: [IntelliSense],
)
=== Quick Navigation
Ungrammar files can get large and we support quick navigation to properties
using the Go to Symbol command (`Ctrl+Shift+O`).
#figure(
image(
"/assets/quick.png",
width: 80%,
),
caption: [Quick Navigation],
)
=== Hovers
When hovering over nodes within an Ungrammar data structure, detailed
context-specific information is displayed, aiding in understanding the code's
structure and relationships.
#figure(
image(
"/assets/hover.png",
width: 60%,
),
caption: [Hover],
)
=== Formatting
You can format your Ungrammar document using `Shift+Alt+F` or Format Document
from the context menu. To disable validation, use the `ungrammar.format.enable`
#link("https://code.visualstudio.com/docs/getstarted/settings")[setting].
Before formatting:
#figure(
image(
"/assets/format.png",
width: 80%,
),
caption: [Before Formatting],
)
After formatting:
#figure(
image(
"/assets/format2.png",
width: 70%,
),
caption: [After Formatting],
)
=== Folding
You can fold regions of source code using the folding icons on the gutter
between line numbers and line start. Folding regions are available for all
object and array elements.
Before folding:
#figure(
image(
"/assets/folding.png",
width: 80%,
),
caption: [Before Folding],
)
After folding:
#figure(
image(
"/assets/folding2.png",
width: 60%,
),
caption: [After Folding],
)
=== Annotations
We provide informative annotations displayed above code elements to aid in code
comprehension. These annotations offer quick access to references,
implementation details, and other relevant context, enhancing code navigability
and understanding.
#figure(
image(
"/assets/annotation.png",
width: 60%,
),
caption: [Annotation],
)
=== Expand and Shrink Selection
You can extend (`Alt+Shift+→`) or shrink (`Alt+Shift+←`) the current selection
to the encompassing syntactic construct (node, alternative, sequence, group,
etc). It works with multiple cursors.
#figure(
image(
"/assets/expand.png",
width: 60%,
),
caption: [Expand 1],
)
#figure(
image(
"/assets/expand2.png",
width: 50%,
),
caption: [Expand 2],
)
#figure(
image(
"/assets/expand3.png",
width: 50%,
),
caption: [Expand 3],
)
#figure(
image(
"/assets/expand4.png",
width: 60%,
),
caption: [Expand 4],
)
#figure(
image(
"/assets/expand5.png",
width: 60%,
),
caption: [Expand 5],
)
=== Find All References
You can find all references using `Shift+Alt+F12` to show all references of the
item at the cursor location.
#figure(
image(
"/assets/references.png",
width: 80%,
),
caption: [Find All References],
)
=== Go to Definition
You can navigate to the definition of an node using `F12`.
Before Go to Definition, we are at line 657:
#figure(
image(
"/assets/definition.png",
width: 80%,
),
caption: [Before Go to Definition],
)
After Go to Definition, we are at line 588:
#figure(
image(
"/assets/definition2.png",
width: 80%,
),
caption: [After Go to Definition],
)
=== Highlight Related
You can highlight related constructs upon hovering over a node. This feature
displays all references to the selected node within the current file, enhancing
code navigation and understanding.
#figure(
image(
"/assets/related.png",
width: 60%,
),
caption: [Highlight Related],
)
=== Rename
You can efficiently rename symbols across your codebase using the `F2`.
This powerful feature automatically updates all references to the selected
symbol, ensuring consistency and reducing the potential for errors.
#figure(
image(
"/assets/rename.png",
width: 80%,
),
caption: [Rename],
)
=== Code Actions
You can enhance your code formatting with our powerful code actions. Quickly
and easily rename nodes to specific casing styles including `snake_case`,
`CONSTANT_CASE`, `camelCase`, and `PascalCase`, ensuring consistent naming
conventions throughout your project.
#figure(
image(
"/assets/action.png",
width: 60%,
),
caption: [Provide Code Actions],
)
=== Semantic Syntax Highlighting
We highlight the code semantically. For example, "Rule" might be colored
differently depending on whether "Rule" is an `Definition` or a `Identifier`. We
does not specify colors directly, instead it assigns a tag (like variable) and
a set of modifiers (like definition) to each token. It's up to the client to
map those to specific colors.
#figure(
image(
"/assets/syntax.png",
width: 80%,
),
caption: [Semantic Syntax Highlighting],
)
|
|
https://github.com/AxiomOfChoices/Typst | https://raw.githubusercontent.com/AxiomOfChoices/Typst/master/Templates/monograph.typ | typst | #import "@preview/outrageous:0.1.0"
#import "/Templates/generic.typ" : latex
#let style(doc) = {
show heading.where(level: 1): set text(size: 24pt)
show heading.where(level: 2): set text(size: 18pt)
show heading.where(level: 3): set text(size: 18pt)
set text(size: 12pt)
show heading: set block(above: 0.9em, below: 1em)
doc
}
#let start_outline(doc) = {
outline()
set page(numbering: "i")
counter(page).update(1)
doc
}
#let chapter_headings(doc) = {
set heading(numbering: "1.1")
set page(numbering: "1")
counter(page).update(1)
show heading.where(level: 1): it => {
if it.numbering == "1.1" {
[
#set text(size: 24pt)
Chapter #counter(heading).display() #block(it.body)
]
} else {
it
}
}
doc
}
#let outline_style(doc) = {
show outline.entry: outrageous.show-entry.with(
..outrageous.presets.typst,
fill: (none, none),
)
show outline.entry: it => {
if it.element.numbering == "1.1" {
show outline.entry: outrageous.show-entry.with(
// the typst preset retains the normal Typst appearance
..outrageous.presets.typst,
// we only override a few things:
// level-1 entries are italic, all others keep their font style
font-weight: ("bold", auto),
// no fill for level-1 entries, a thin gray line for all deeper levels
fill: (none, line(length: 100%, stroke: gray + .5pt)),
)
it
}
else {
it
}
}
set outline(indent: auto)
doc
}
#let frontpage(
toptitle: none,
name: none,
middletitle: none,
bottomtitle: none,
info: none,
doc
) = {
show: doc => latex(doc)
v(10%)
align(center)[
#text(smallcaps(toptitle), weight: "bold", size: 20pt)
#v(10%)
#name
#v(10%)
#middletitle
#v(5%)
#datetime.today().display("[month repr:long] [day padding:none], [year]")
#v(5%)
#bottomtitle
#v(10%)
#info
]
pagebreak(weak: true)
doc
}
|
|
https://github.com/sa-concept-refactoring/doc | https://raw.githubusercontent.com/sa-concept-refactoring/doc/main/chapters/conclusion.typ | typst | = Conclusion <conclusion>
To summarize this thesis this conclusion describes the most important parts of the project.
@learnings looks into what was learned working on this project.
In @outlook it is described how this project could be extended and what the future of the language server looks like.
// COR Hier fällt die passive Form der Formulierungen besonders auf.
In this thesis, it was analyzed how the clangd language server works and how additional refactoring features can be added.
When first looking at the LLVM project it can be overwhelming at first but once it is clear how it is put together it is easy to get around with.
Two new refactoring features were implemented according to the analysis and were submitted to LLVM (pull requests are opened).
The intention for these implementation is to be contributed to the clangd language server which should help C++ 20 developers to work with the concepts for which there was no refactoring beforehand.
// COR Reflection on the state of the refactorings?
/ Inline Concept Requirement : #[
Transforms the concept containing a `requires` clause into a restricted function template.
This transformation results in a less complex and shorter code.
]
/ Abbreviate Function Template : #[
Transforms the function template to its abbreviated form.
The template parameter types are replaced with the `auto` keyword where possible.
This transformation results in less code as the `template` declaration will be removed.
]
Unfortunately, the opened pull requests were not merged until this thesis was handed in therefore the added refactorings are not yet available in the current version of clangd.
== Learnings <learnings>
Overall this project was very interesting and enriched working on an open source project like LLVM.
For future projects, it should be considered to spend more time on the analysis part.
The implementation was started before all the necessary research was done, resulting in some avoidable pitfalls and slowing down the development process.
Most of these cases came up during the second refactoring @abbreviate_function_template and were related to parameter types that were not considered, such as array types and function pointers.
Those issues could probably have been avoided if more time were spent analyzing which parameter types exist and properly documenting them.
Also, the documentation part of this project was underestimated a lot and it would have been good to start documenting the analysis part in the beginning.
Finding a good structure for the documentation was hard and it was changed many times.
#pagebreak()
== Outlook <outlook>
The content of this project could have been extended a lot more as there are almost unlimited options to add new refactorings.
As long as the C++ language is evolving more refactorings can be added to help support the developers.
In the case of this thesis, an option would have been possible to switch between different forms of concepts.
That feature could have connected the two refactoring implemented but this also would have taken way longer than it already did.
The LLVM project is an active open source project that receives a lot of pull requests each day.
This is giving hope, that it will continue to grow in the future.
Hopefully, the open pull requests will be accepted so the new refactorings will be available on the clangd language server.
// COR I would doubt that for open-source projects.
But it remains unclear if the usage of language servers will increase or if IDEs are going back to implementing their own code support as JetBrains has already announced that they might. @jetbrains_blog
|
|
https://github.com/heinwol/master-thesis | https://raw.githubusercontent.com/heinwol/master-thesis/main/thoughts.md | markdown | ## Откуда что брать:
### Нормативное
- гост для того чтобы понять как писать: https://docs.cntd.ru/document/1200026224
### Typst
- какой-то темплейт для тезиса https://github.com/Dherse/masterproef/blob/main/masterproef/ugent-template.typ
-
### Что может надо будет исправить:
- фамилия и инициалы: до или после
- тире перенос: надо ли дублировать?
- упоминание рисунка после/до рисунка? (рыжий)
---
## Презентация
- добавить про актуальность
|
|
https://github.com/EliasRothfuss/vorlage_typst_doku-master | https://raw.githubusercontent.com/EliasRothfuss/vorlage_typst_doku-master/main/config.typ | typst | // Information about the Thesis
#let data = (
title: "Titel der Projekt- / Studien- / Haus- oder Bachelorarbeit",
subtitle: "ggf. Untertitel mit ergänzenden Hinweisen",
arbeit: "Projektarbeit T3_1000 / Projektarbeit T3_2000 / Studienarbeit T3_3100 / Hausarbeit T3_3000 / Studienarbeit T3_3200 / Bachelorarbeit T3_3300",
author: "Autor",
kurs: "Kurs",
studiengang: "Studiengang",
studienrichtung: "Studienrichtung",
abgabe: "Datum der Abgabe",
matrikelnr: "Matrikelnummer",
dualer_partner: "Dualer Partner",
ort: "Ort der Abgabe",
bearbeitungszeitraum: "Bearbeitungszeitraum",
betreuer: "Betreuerin / Betreuer",
gutachter: "Gutachterin / Gutachter",
)
|
|
https://github.com/tingerrr/chiral-thesis-fhe | https://raw.githubusercontent.com/tingerrr/chiral-thesis-fhe/main/src/utils.typ | typst | #import "/src/packages.typ" as _pkg
#import "utils/token.typ"
#import "utils/assert.typ"
#import "utils/state.typ"
#let _std = (numbering: numbering)
#let chapter = heading.with(level: 1, supplement: [Kapitel])
#let smart-caption(short, long, _state: state.outline) = context if _state.get() {
short
} else {
long
}
#let quote-omission(body) = [\[#body\]]
#let i18n(de: none, en: none) = context if text.lang == "de" { de } else { en }
#let sentinel-or(sentinel, value, default) = if value == sentinel {
value
} else {
default()
}
#let marker(name) = if type(name) == str {
[#metadata(())#label(name)]
} else if type(name) == label {
[#metadata(())#name]
} else {
panic(_pkg.oxifmt.strfmt("Can't use `{}` as a marker", name))
}
#let none-or = sentinel-or.with(none)
#let auto-or = sentinel-or.with(auto)
// BUG: this and its usages can't respect appendix numbering beacuse the pattern doesn't react to the styles to synthesize it's pattern
#let chapter-relative-numbering(numbering, ..args) = {
(_std.numbering)(numbering, counter(heading).get().first(), ..args)
}
#let date-time-en-to-de = (
Jan: "Jan",
Feb: "Feb",
Mar: "Mär",
Jun: "Jun",
Jul: "Jul",
Aug: "Aug",
Sep: "Sep",
Oct: "Okt",
Nov: "Nov",
Dec: "Dez",
January: "Januar",
February: "Februar",
March: "März",
May: "Mai",
June: "Juni",
July: "Juli",
August: "August",
September: "September",
October: "Oktober",
November: "November",
December: "Dezember",
Mon: "Mo",
Tue: "Di",
Wed: "Mi",
Thu: "Do",
Fri: "Fr",
Sat: "Sa",
Sun: "So",
Monday: "Montag",
Tuesday: "Dienstag",
Wednesday: "Mittwoch",
Thursday: "Donnerstag",
Friday: "Freitag",
Saturday: "Samstag",
Sunday: "Sontag",
)
#let format-date(date, format: "[day].[month].[year]") = {
date
.display(format)
.replace(regex("[a-zA-Z]+"), m => date-time-en-to-de.at(m.text))
}
|
|
https://github.com/piepert/philodidaktik-hro-phf-ifp | https://raw.githubusercontent.com/piepert/philodidaktik-hro-phf-ifp/main/src/parts/ephid/unterrichtsplanung/modelle.typ | typst | Other | #import "/src/template.typ": *
== #ix("Modelle für den Stundenaufbau", "Stundenaufbau", "Ablaufplanmodelle", "Stundenmodelle", "Unterrichtsstundenmodelle")
#def("Problem")[
Der Problembegriff bezeichnet in der Fachdidaktik eine "bestimmte Art von Schwierigkeit und enthält -- das ist wichtig -- eine Art Suchanleitung für den Lösungsversuch: Er lenkt nämlich den Blick auf die beiden anscheinend widersprüchlichen Thesen und ihr Verhältnis zueinander."#en[@Engels1990_Problembegriff[S. 126-134]]
]
#def("Problemorientierung")[
Problemorientierter Unterricht bezeichnet eine Art und Weise, in der der Unterricht mit Fokus auf ein bestimmtes philosophisches Problem gerichtet ist. Zu Beginn der Stunde steht eine Problemfrage, am Ende der Stunde wird diese nach bestimmten Kriterien beantwortet.#en[Vgl. @Beugholt2021_ProblemorientierterPU[S. 117]]
]
Es folgen einige standardmäßige Modelle für den Aufbau einer Unterrichtsstunde.
#show grid.cell.where(x: 1): set align(right)
#orange-list-with-body[*#ix("Methodenschlange"):*#en[@Martens2003_MethodenPU[S. 55-58]] #h(1fr) #ix("Martens", "<NAME>")][
#grid(columns: (1fr, 10%), column-gutter: 1em, [
Mit der Einteilung der #ix("Methoden", "Methode") in #ix("sokratisch-aristotelische Kategorien", "Kategorien, sokratisch-aristotelisch"), entfaltet #ix("Martens", "<NAME>") das Prinzip seiner Unterrichtsplanung: die #ix("Methodenschlange"). Martens sieht hier die folgende Reihenfolge der philosophischen Methoden als sinnvoll, jedoch nicht als notwendig an.#en[Vgl. @Martens2003_MethodenPU[S. 56]] Die angegebenen Methoden sind die wichtigsten, jedoch nicht die einzigen, die folgende Liste wird als erweiterbar und veränderbar angesehen:#en[Vgl. @Martens2003_MethodenPU[S. 56]]
1. *phänomenologische Methode*: Zuerst wird das philosophische Problem phänomenologisch betrachtet. Die Eindrücke der SuS sind hier von Bedeutung.
2. *hermeneutische Methode*: Danach wird das Problem gedeutet, Verständnisfragen geklärt und es in einen Kontext eingebettet.
3. *analytische Methode*: Die vorkommenden Begriffe und Argumente werden geklärt.
4. *dialektische Methode*: Die verschiedenen Perspektiven werden dialektisch gegenübergestellt.
5. *spekulative Methode*: Eigene Lösungsvorschläge und Ideen kommen hinzu.
], image("mod_methodenschlange.png", height: 3cm)+en[@Martens2003_MethodenPU[S. 57]])
][*#ix("Bonbon-Modell"):* #h(1fr) #ix("Sistermann", "<NAME>")][
#grid(columns: (1fr, 10%), column-gutter: 1em, [
Das #ix("Bonbon-Modell") nach #ix("Sistermann", "<NAME>") ist ein Kernmodell für den #ix("problemorientierten", "Problemorientierung") Philosophieunterricht. Es unterscheidet sechs Phasen, die besonders das Interesse und die Probleme der SuS in den Vordergrund stellen und diese dazu anleiten, selbständig Lösungen zu finden, jedoch auch bekannte Positionen mit einbeziehen können. Die sechs Phasen sehen wie folgt aus:#todo[Zitation für Sistermann fehlt, bisher nur unseriöse Quellen/graue Literatur vorhanden.]
1. *Hinführung:* Das Interesse der SuS wird als Grundlegung für folgende Phasen aktiviert, ein geeignetes philosophisches Problem wird herausgestellt.
2. *Problemstellung:* Aus den Interessen wird eine verständliche Problemstellung erarbeitet.
3. *selbstgesteuerte, intuitive Problemösung:* Das Vorwissen der SuS zur Beantwortung der Frage in Probierbewegungen wird aktiviert, sodass diese selbständig einzeln oder gemeinsam die Problemstellung bearbeiten können.
4. *angeleitete, kontrollierte Problemlösung:* Es wird eine Auseinandersetzung mit bereits bestehenden philosophischen Lösungsansätzen ermöglicht.
5. *Festigung (Sicherung):* Die Lösungsversuche der kontrollierten Phase werden verglichen und mit den Lösungsversuchen der intuitiven Phase in Verbindung gesetzt. Fehlversuche werden eliminiert und gelungene Lösungen herorgehoben.
6. *Transfer/Stellungnahme:* Die SuS wenden das Gelernte zuerst mit Rückbezug auf die ursprüngliche Problemfrage und dann auf neue Beispiele oder offene Fragen an und/oder beziehen kritisch Stellung zur gefundenen Lösung.
Das #ix("Bonbon-Modell") ist nicht nur für einzelne Unterrichtsstunden gedacht, sondern soll sich ebenfalls über mehrere Unterrichtseinheiten erstrecken können.
], image("mod_bonbon.png", height: 3.25cm)+en[@Runtenberg2016_EPhiD[S. 139]])
][*#ix("PEST"):*#en[Vgl. @Klager2016_SpielAlsWeltzugang[S. 302-309]] #h(1fr) #ix("Klager", "<NAME>")][
#grid(columns: (1fr, 10%), column-gutter: 1em, [
Das #ix("PEST")-Modell ist ein didaktisches Standardmodell zur Unterrichtsplanung und besteht aus vier Phasen.
+ *Problematisierungsphase:* In der Problematisierungsphase wird das Thema der Stunde motiviert, durch die SuS erarbeitet und kontrovers dargestellt.
+ *Erarbeitungsphase:* Nachdem das Problem herausgestellt wurde, wird es durch die SuS inhaltlich bearbeitet und Kompetenzen werden generiert.
+ *Sicherungsphase:* Die Sicherungsphase ermöglicht es den SuS die Inhalte zu vergleichen und zu festigen.
+ *Transferphase:* In der Transferphase wird das erarbeitete Wissen auf ein neues Beispiel angewendet, um sicherzugehen, dass die gewonnen Fertigkeiten anwendbar sind.
], image("mod_pest.png", height: 1.75cm))
][*#ix("Backward Design") / #ix("PETF"):*#en[@Poerschke2021_BackwardDesign] #h(1fr) #ix("Sistermann", "<NAME>"), #ix("Pörschke", "<NAME>")][
#grid(columns: (1fr, 10%), column-gutter: 1em, [
#ix("<NAME>", "<NAME>") empfiehlt das #ix("Backward Design", "Backward Design", "PETF") in Verbindung mit seinem Bonbon-Modell als Planungsmethode für eine Unterrichtsstunde. Das Ziel der Unterrichtsstunde wird dabei in den Vordergrund stellt.
+ *Festigungsphase:* Welche Inhalte sollen gefestigt werden?
+ *Problemstellung:* Welche Problemstellung führt zu den Inhalten der Festigungsphase?
+ *Materialien:* Welche Materialien unterstützen dabei?
+ *intuitive Phase:* Wie werden die SuS motiviert, das Problem intuitiv zu lösen?
+ *Transferphase:* Wie kann mit dem Problem weitergearbeitet werden?
+ *Hinführung:* Was eignet sich als Hinführung?
#ix("<NAME>", "<NAME>") empfiehlt eine Erweiterung des Modells, erweitert den Vorschlag damit um eine curriculare Legitimation und Einbettungen anderer didaktischer Konzepte:#en[Vgl. @Poerschke2021_BackwardDesign[S. 112-120]]
+ *Formulierung des Lernziels:* Anhand des Rahmenplans und dem Thema der Unterrichtsreihe wird ein Lernziel formuliert.
+ *Ergebnissicherung/Material:* Variabel kann entweder zuerst geeignetes Material für das Lernziel gesucht oder die Planung der Ergebnissicherung stattfinden.
+ *Problemstellung:* Es wird eine Problemstellung entworfen, deren Antwort die Inhalte der Ergebnissicherung/Festigungsphase sind.
+ *Hinführung:* Für die gegebene Problemstellung wird eine geeignete Hinführung für den Stundeneinstieg entworfen.
+ *Unterrichtssetting:* Für die SuS wird eine Umgebung gestaltet, die die Notwendigkeit zum weiteren Arbeiten verdeutlicht.
+ *Methoden/Sozialformen:* Es werden geeignete Methoden und Sozialformen gewählt.
+ *Transfer:* Für die Weiterarbeit mit den Inhalten werden geeignete Aufgaben für den Wissenstransfer vorbereitet.
#ix("Backward Design") als Ansatz kann daher mit anderen Methoden für die Planung Unterrichtsstunden kombiniert werden. Es geht hier um eine Anpassung des Prozesses der Planung, nicht um die konkrete Unterrichtsstruktur, die dann von anderen Modellen wie der #ix("Methodenschlange") oder dem #ix("Bonbon-Modell") festgelegt werden. // entfernbar
], image("mod_petf.png", height: 1.75cm))
]
#task(key: "pest-vs-inquiry")[PEST vs. Inquiry][
Vergleichen Sie den klassischen Aufbau einer Unterrichtsstunde nach dem PEST-Modell mit der Methode der Inquiry!
][
Das klassiche PEST-Modell beginnt mit einer Problematisierung, in der das Thema der Stunde motiviert und als Problem durch die SuS erarbeitet wird. Danach folgt die Erarbeitungsphase, in der es gelöst und in der Sicherungsphase verglichen und festgehalten wird. In der abschließenden Transferphase wird das erlangte Wissen auf einen neuen Sachverhalt angewandt.
Die Inquiry hat im Gegensatz zum PEST-Modell sieben statt vier Phasen, jedoch lassen sich diese sieben Phasen teilweise in das PEST-Modell übersetzen: Die ersten vier Phasen -- das Geben des Stimulus, das Stellen philosophischen Fragen, das Sammeln dieser und die Auswahl der Frage -- lässt sich als Problematisierung im PEST-Modell sehen, da hier das Problem aufgeworfen und zur Bearbeitung ausgewählt wird. Die darauffolgende Denkzeit und Untersuchung als fünfte und sechste Phase, welche im PEST-Modell die Bearbeitungsphase darstellen. Das Metagespräch und die Evaluation sind wie eine Sicherung, besonders das schriftliche Festhalten dieser ist eine typische Form der Sicherung. Was fehlt, wäre die anschließende Transferphase, die in der Grundform der Inquiry nicht gegeben ist. Durch eine anschließende Aufgabe wäre diese jedoch auch gegeben und die Inquiry könnte eine vollwertige Unterrichtsstunde im PEST-Modell dartellen.
] |
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/layout/grid/stroke.typ | typst | --- grid-stroke-pattern ---
#let double-line = pattern(size: (1.5pt, 1.5pt), {
place(line(stroke: .6pt, start: (0%, 50%), end: (100%, 50%)))
})
#table(
stroke: (_, y) => if y != 1 { (bottom: black) },
columns: 3,
table.cell(colspan: 3, align: center)[*Epic Table*],
align(center)[*Name*], align(center)[*Age*], align(center)[*Data*],
table.hline(stroke: (paint: double-line, thickness: 2pt)),
[John], [30], [None],
[Martha], [20], [A],
[Joseph], [35], [D]
)
--- grid-stroke-folding ---
// Test folding
#set grid(stroke: red)
#set grid(stroke: 5pt)
#grid(
inset: 10pt,
columns: 2,
stroke: stroke(dash: "loosely-dotted"),
grid.vline(start: 2, end: 3, stroke: (paint: green, dash: none)),
[a], [b],
grid.hline(end: 1, stroke: blue),
[c], [d],
[e], grid.cell(stroke: aqua)[f]
)
--- grid-stroke-set-on-cell-and-line ---
// Test set rules on cells and folding
#set table.cell(stroke: 4pt)
#set table.cell(stroke: blue)
#set table.hline(stroke: red)
#set table.hline(stroke: 0.75pt)
#set table.vline(stroke: 0.75pt)
#set table.vline(stroke: aqua)
#table(
columns: 3,
gutter: 3pt,
inset: 5pt,
[a], [b], table.vline(position: end), [c],
[d], [e], [f],
table.hline(position: bottom),
[g], [h], [i],
)
--- grid-stroke-field-in-show ---
// Test stroke field on cell show rules
#set grid.cell(stroke: (x: 4pt))
#set grid.cell(stroke: (x: blue))
#show grid.cell: it => {
test(it.stroke, (left: stroke(paint: blue, thickness: 4pt, dash: "loosely-dotted"), right: blue + 4pt, top: stroke(thickness: 1pt), bottom: none))
it
}
#grid(
stroke: (left: (dash: "loosely-dotted")),
inset: 5pt,
grid.hline(stroke: red),
grid.cell(stroke: (top: 1pt))[a], grid.vline(stroke: yellow),
)
--- grid-stroke-complex ---
#table(
columns: 3,
[a], table.cell(colspan: 2)[b c],
table.cell(stroke: blue)[d], [e], [f],
[g], [h], table.cell(stroke: (left: yellow, top: green, right: aqua, bottom: red))[i],
[j], [k], [l],
table.cell(stroke: 3pt)[m], [n], table.cell(stroke: (dash: "loosely-dotted"))[o],
)
--- grid-stroke-array ---
// Test per-column stroke array
#let t = table(
columns: 3,
stroke: (red, blue, green),
[a], [b], [c],
[d], [e], [f],
[h], [i], [j],
)
#t
#set text(dir: rtl)
#t
--- grid-stroke-func ---
#grid(
columns: 3,
inset: 3pt,
stroke: (x, _) => (right: (5pt, (dash: "dotted")).at(calc.rem(x, 2)), bottom: (dash: "densely-dotted")),
grid.vline(x: 0, stroke: red),
grid.vline(x: 1, stroke: red),
grid.vline(x: 2, stroke: red),
grid.vline(x: 3, stroke: red),
grid.hline(y: 0, end: 1, stroke: blue),
grid.hline(y: 1, end: 1, stroke: blue),
grid.cell[a],
[b], [c]
)
--- grid-stroke-manually-positioned-lines ---
#set page(height: 5em)
#table(
columns: 3,
inset: 3pt,
table.hline(y: 0, end: none, stroke: 3pt + blue),
table.vline(x: 0, end: none, stroke: 3pt + green),
table.hline(y: 5, end: none, stroke: 3pt + red),
table.vline(x: 3, end: none, stroke: 3pt + yellow),
[a], [b], [c],
[a], [b], [c],
[a], [b], [c],
[a], [b], [c],
[a], [b], [c],
)
--- grid-stroke-automatically-positioned-lines ---
// Automatically positioned lines
// Plus stroke thickness ordering
#table(
columns: 3,
table.hline(stroke: red + 5pt),
table.vline(stroke: blue + 5pt),
table.vline(stroke: 2pt),
[a],
table.vline(x: 1, stroke: aqua + 5pt),
[b],
table.vline(stroke: aqua + 5pt),
[c],
table.vline(stroke: yellow + 5.2pt),
table.hline(stroke: green + 5pt),
[a], [b], [c],
[a], table.hline(stroke: green + 2pt), table.vline(stroke: 2pt), [b], [c],
)
--- grid-stroke-priority-line ---
// Line specification order priority
// The last line should be blue, not red.
// The middle aqua line should be gone due to the 'none' override.
#grid(
columns: 2,
inset: 2pt,
grid.hline(y: 2, stroke: red + 5pt),
grid.vline(),
[a], [b],
grid.hline(stroke: red),
grid.hline(stroke: none),
[c], grid.cell(stroke: (top: aqua))[d],
grid.hline(stroke: blue),
)
--- grid-stroke-hline-position-bottom-gutter ---
// Position: bottom and position: end with gutter should have a visible effect
// of moving the lines after the next track.
#table(
columns: 3,
gutter: 3pt,
stroke: blue,
table.hline(end: 2, stroke: red),
table.hline(end: 2, stroke: aqua, position: bottom),
table.vline(end: 2, stroke: green), [a], table.vline(end: 2, stroke: green), table.vline(end: 2, position: end, stroke: orange), [b], table.vline(end: 2, stroke: aqua, position: end), table.vline(end: 2, stroke: green), [c], table.vline(end: 2, stroke: green),
[d], [e], [f],
table.hline(end: 2, stroke: red),
[g], [h], [ie],
table.hline(end: 2, stroke: green),
)
--- grid-stroke-hline-position-bottom ---
// Using position: bottom and position: end without gutter should be the same
// as placing a line after the next track.
#table(
columns: 3,
stroke: blue,
table.hline(end: 2, stroke: red),
table.hline(end: 2, stroke: aqua, position: bottom),
table.vline(end: 2, stroke: green), [a], table.vline(end: 2, stroke: green), [b], table.vline(end: 2, stroke: aqua, position: end), table.vline(end: 2, stroke: green), [c], table.vline(end: 2, stroke: green),
table.hline(end: 2, stroke: 5pt),
[d], [e], [f],
table.hline(end: 2, stroke: red),
[g], [h], [i],
table.hline(end: 2, stroke: red),
)
--- grid-stroke-vline-position-left-and-right ---
// Test left and right for grid vlines.
#grid(
columns: 3,
inset: 5pt,
grid.vline(stroke: green, position: left), grid.vline(stroke: red, position: right), [a],
grid.vline(stroke: 2pt, position: left), grid.vline(stroke: red, position: right), [b],
grid.vline(stroke: 2pt, position: left), grid.vline(stroke: red, position: right), [c],
grid.vline(stroke: 2pt, position: left)
)
#grid(
columns: 3,
inset: 5pt,
gutter: 3pt,
grid.vline(stroke: green, position: left), grid.vline(stroke: red, position: right), [a],
grid.vline(stroke: blue, position: left), grid.vline(stroke: red, position: right), [b],
grid.vline(stroke: blue, position: left), grid.vline(stroke: red, position: right), [c],
grid.vline(stroke: 2pt, position: left)
)
--- table-stroke-vline-position-left-and-right ---
// Test left and right for table vlines.
#table(
columns: 3,
inset: 5pt,
table.vline(stroke: green, position: left), table.vline(stroke: red, position: right), [a],
table.vline(stroke: 2pt, position: left), table.vline(stroke: red, position: right), [b],
table.vline(stroke: 2pt, position: left), table.vline(stroke: red, position: right), [c],
table.vline(stroke: 2pt, position: left)
)
#table(
columns: 3,
inset: 5pt,
gutter: 3pt,
table.vline(stroke: green, position: left), table.vline(stroke: red, position: right), [a],
table.vline(stroke: blue, position: left), table.vline(stroke: red, position: right), [b],
table.vline(stroke: blue, position: left), table.vline(stroke: red, position: right), [c],
table.vline(stroke: 2pt, position: left)
)
--- grid-stroke-priority-line-cell ---
// Hlines and vlines should always appear on top of cell strokes.
#table(
columns: 3,
stroke: aqua,
table.vline(stroke: red, position: end), [a], table.vline(stroke: red), [b], [c],
table.cell(stroke: blue)[d], [e], [f],
table.hline(stroke: red),
[g], table.cell(stroke: blue)[h], [i],
)
#table(
columns: 3,
gutter: 3pt,
stroke: aqua,
table.vline(stroke: red, position: end), [a], table.vline(stroke: red), [b], [c],
table.cell(stroke: blue)[d], [e], [f],
table.hline(stroke: red),
[g], table.cell(stroke: blue)[h], [i],
)
--- grid-stroke-priority-cell ---
// Ensure cell stroke overrides always appear on top.
#table(
columns: 2,
stroke: black,
table.cell(stroke: red)[a], [b],
[c], [d],
)
#table(
columns: 2,
table.cell(stroke: red)[a], [b],
[c], [d],
)
--- grid-stroke-hline-position-bad ---
// Error: 7:3-7:32 cannot place horizontal line at the 'bottom' position of the bottom border (y = 2)
// Hint: 7:3-7:32 set the line's position to 'top' or place it at a smaller 'y' index
#table(
columns: 2,
[a], [b],
[c], [d],
table.hline(stroke: aqua),
table.hline(position: top),
table.hline(position: bottom)
)
--- grid-stroke-border-partial ---
// Test partial border line overrides
#set page(width: auto, height: 7em, margin: (bottom: 1em))
#table(
columns: 4,
stroke: (x, y) => if y == 0 or y == 4 { orange } else { aqua },
table.hline(stroke: blue, start: 1, end: 2), table.cell(stroke: red, v(3em)), table.cell(stroke: blue)[b], table.cell(stroke: green)[c], [M],
[a], [b], [c], [M],
[d], [e], [f], [M],
[g], [h], [i], [M],
table.cell(stroke: red)[a], table.cell(stroke: blue)[b], table.cell(stroke: green)[c], [M],
table.hline(stroke: blue, start: 1, end: 2),
)
--- grid-stroke-vline-colspan ---
// - Vline should be placed after the colspan.
// - Hline should be placed under the full-width rowspan.
#table(
columns: 3,
rows: 1.25em,
inset: 1pt,
stroke: none,
table.cell(colspan: 2)[a], table.vline(stroke: red), table.hline(stroke: blue), [b],
[c], [d], [e],
table.cell(colspan: 3, rowspan: 2)[a], table.vline(stroke: blue), table.hline(stroke: red)
)
--- grid-stroke-hline-rowspan ---
// Red line should be above [c] (hline skips the shortest rowspan).
#set text(6pt)
#table(
rows: 1em,
columns: 2,
inset: 1.5pt,
table.cell(rowspan: 3)[a], table.cell(rowspan: 2)[b],
table.hline(stroke: red),
[c]
)
--- grid-stroke-hline-position-bottom-out-of-bounds ---
// Error: 8:3-8:32 cannot place horizontal line at the 'bottom' position of the bottom border (y = 2)
// Hint: 8:3-8:32 set the line's position to 'top' or place it at a smaller 'y' index
#table(
columns: 2,
gutter: 3pt,
[a], [b],
[c], [d], table.vline(stroke: red),
table.hline(stroke: aqua),
table.hline(position: top),
table.hline(position: bottom)
)
--- grid-stroke-vline-position-bottom-out-of-bounds ---
// Error: 6:3-6:28 cannot place vertical line at the 'end' position of the end border (x = 2)
// Hint: 6:3-6:28 set the line's position to 'start' or place it at a smaller 'x' index
#grid(
columns: 2,
[a], [b],
grid.vline(stroke: aqua),
grid.vline(position: start),
grid.vline(position: end)
)
--- grid-stroke-vline-position-bottom-out-of-bounds-gutter ---
// Error: 7:3-7:28 cannot place vertical line at the 'end' position of the end border (x = 2)
// Hint: 7:3-7:28 set the line's position to 'start' or place it at a smaller 'x' index
#grid(
columns: 2,
gutter: 3pt,
[a], [b],
grid.vline(stroke: aqua),
grid.vline(position: start),
grid.vline(position: end)
)
--- grid-stroke-hline-out-of-bounds ---
// Error: 4:3-4:19 cannot place horizontal line at invalid row 3
#grid(
[a],
[b],
grid.hline(y: 3)
)
--- grid-stroke-hline-out-of-bounds-gutter ---
// Error: 5:3-5:19 cannot place horizontal line at invalid row 3
#grid(
gutter: 3pt,
[a],
[b],
grid.hline(y: 3)
)
--- grid-stroke-vline-out-of-bounds ---
// Error: 4:3-4:20 cannot place vertical line at invalid column 3
#table(
columns: 2,
[a], [b],
table.vline(x: 3)
)
--- grid-stroke-vline-out-of-bounds-gutter ---
// Error: 5:3-5:20 cannot place vertical line at invalid column 3
#table(
columns: 2,
gutter: 3pt,
[a], [b],
table.vline(x: 3)
)
--- table-hline-in-grid ---
// Error: 7-20 cannot use `table.hline` as a grid line
// Hint: 7-20 use `grid.hline` instead
#grid(table.hline())
--- table-vline-in-grid ---
// Error: 7-20 cannot use `table.vline` as a grid line
// Hint: 7-20 use `grid.vline` instead
#grid(table.vline())
--- grid-hline-in-table ---
// Error: 8-20 cannot use `grid.hline` as a table line
// Hint: 8-20 use `table.hline` instead
#table(grid.hline())
--- grid-vline-in-table ---
// Error: 8-20 cannot use `grid.vline` as a table line
// Hint: 8-20 use `table.vline` instead
#table(grid.vline())
--- grid-hline-end-before-start-1 ---
// Error: 3:3-3:31 line cannot end before it starts
#grid(
columns: 3,
grid.hline(start: 2, end: 1),
[a], [b], [c],
)
--- grid-hline-end-before-start-2 ---
// Error: 3:3-3:32 line cannot end before it starts
#table(
columns: 3,
table.vline(start: 2, end: 1),
[a], [b], [c],
[d], [e], [f],
[g], [h], [i],
)
--- grid-hline-position-horizon ---
// Error: 24-31 expected `top` or `bottom`, found horizon
#table.hline(position: horizon)
--- grid-vline-position-center ---
// Error: 24-30 expected `start`, `left`, `right`, or `end`, found center
#table.vline(position: center)
--- grid-hline-position-right ---
// Error: 24-29 expected `top` or `bottom`, found right
#table.hline(position: right)
--- grid-vline-position-top ---
// Error: 24-27 expected `start`, `left`, `right`, or `end`, found top
#table.vline(position: top)
|
|
https://github.com/El-Naizin/cv | https://raw.githubusercontent.com/El-Naizin/cv/main/modules_zh/skills.typ | typst | Apache License 2.0 | #import "../brilliant-CV/template.typ": *
#cvSection("技能与兴趣")
#cvSkill(
type: [语言],
info: [英语 #hBar() 法语 #hBar() 中文]
)
#cvSkill(
type: [技术栈],
info: [Tableau #hBar() Python (Pandas/Numpy) #hBar() PostgreSQL]
)
#cvSkill(
type: [个人兴趣],
info: [游泳 #hBar() 烹饪 #hBar() 阅读]
)
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/scripting/modules/cycle1.typ | typst | // SKIP
#import "cycle2.typ": *
#let inaccessible = "wow"
This is the first element of an import cycle.
|
|
https://github.com/typst-community/typst.js | https://raw.githubusercontent.com/typst-community/typst.js/main/README.md | markdown | Apache License 2.0 | # Typst
📦 [Typst] for JavaScript
<table align=center><td>
```sh
# ✨ Use Typst right away through the power of npx! 🚀
npx typst --help
npx typst compile example.typ example.pdf
npx typst query example.typ "<note>"
#=> [ { "func": "metadata", "value": "This is a note" } ]
```
<tr><td>
```js
// 👨💻 Or use the JavaScript API (with types!)
import * as typst from "typst";
await typst.compile("example.typ", "example.pdf");
console.log(await typst.query("example.typ", "<note>"));
//=> [ { func: 'metadata', value: 'This is a note' } ]
```
</table>
<p align=center>
<a href="https://typst.community/typst.js/">Docs</a>
| <a href="https://github.com/typst-community/typst.js">GitHub</a>
| <a href="https://typst.app/">Typst</a>
</p>
👨💻 Includes the Typst CLI so you can `npx typst` \
💻 Provides a typed JavaScript API so you can `typst.compile()` \
📑 Install it locally with `npm install --save` as a project-level dependency \
🌎 Or install it globally with `npm install --global`
[**📑 Make sure you check out the official Typst website!**](https://typst.app/)
## Installation





You can install Typst using your favorite npm package manager like npm, [Yarn],
[pnpm], or [Bun].
```sh
npm install typst
```
If you're using [Deno] you can import Typst straight from `npm:typst`.
```js
import * as typst from "npm:typst";
```
🛑 Typst does not yet work in the browser. WASM support is planned.
Supported native platforms: Windows x64, macOS x64, macOS ARM64, Linux x64,
Linux ARM64
## Usage







This package provides both the Typst CLI as well as a JavaScript API. To use the
CLI, just run `npx typst --help`.
```
The Typst compiler
Usage: typst [OPTIONS] <COMMAND>
Commands:
compile Compiles an input file into a supported output format [aliases: c]
watch Watches an input file and recompiles on changes [aliases: w]
query Processes an input file to extract provided metadata
fonts Lists all discovered fonts in system and custom font paths
update Self update the Typst CLI
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbosity... Sets the level of logging verbosity: -v = warning & error, -vv = info, -vvv = debug, -vvvv = trace
--cert <CERT> Path to a custom CA certificate to use when making network requests [env: TYPST_CERT=]
-h, --help Print help
-V, --version Print version
```
<sup>ℹ The `typst update` command will fail. Use `npm install typst@latest` to
update it through npm.</sup>
All of the major Typst CLI commands are also exposed for use in JavaScript:
```js
import * as typst from "typst";
await typst.query("example.typ", "<note>"); //=> object[]
await typst.compile("example.typ", "example.pdf");
await typst.watch("example.typ", "example.pdf");
await typst.fonts(); //=> string[]
await typst.help(); //=> string
await typst.version(); //=> string
```
[📚 Check out the Typst JavaScript API documentation for more details!](https://typst.community/typst.js/)
### Example
<img align=right width=400 src="https://i.imgur.com/24wiUGN.png">
```typst
#set page(width: 10cm, height: auto)
#set heading(numbering: "1.")
= Fibonacci sequence
The Fibonacci sequence is defined through
the recurrence relation $F_n = F_(n-1) + F_(n-2)$.
It can also be expressed in _closed form:_
$ F_n = round(1 / sqrt(5) phi.alt^n), quad
phi.alt = (l + sqrt(5)) / 2 $
#let count = 8
#let nums = range(1, count + 1)
#let fib(n) = (
if n <= 2 { 1 }
else { fib(n - 1) + fib(n - 2) }
)
The first #count numbers of the sequence are:
#align(center, table(
columns: count,
..nums.map(n => $F_#n$),
..nums.map(n => str(fib(n))),
))
```
```sh
typst compile example.typ
$BROWSER example.pdf
```
## Development


This package contains two primary parts: a binary redistribution setup using a
bunch of `optionalDependencies` and a bunch of pretty `typst ...` CLI wrapper
functions.
When you clone this repository and run `npm install`, it auto runs the
`tools/generate-dist-package` script with your current `$OS-$ARCH` tuple and
uses `npm link` to link that to the current workspace. This is for debugging.
To bump the version, use `npm version --no-git-tag-version $NEW_VERSION` so that
the `tools/postversion.js` script gets run to realign the `optionalDependencies`
with the new `version` field. You can do this manually if you prefer. 🤷♂️
Then, when you want to create a new release, remember to run `npm run build`
_after_ the `version` field has been updated (it gets used in the build step).
This will generate a bunch of `out/$OS-$ARCH/` folders, each of which is a
targeted distribution of a native binary that only works on that platform.
Then finally when you run `npm publish`, there's a hook to publish all the
`out/$OS-$ARCH/` packages (`@typst-community/typst-$OS-$ARCH`) _before_ finally
publishing the root `typst` package.
[typst]: https://typst.app/
[yarn]: https://yarnpkg.com/
[pnpm]: https://pnpm.io/
[deno]: https://deno.com/
[bun]: https://bun.sh/
|
https://github.com/SaifOwleN/resume | https://raw.githubusercontent.com/SaifOwleN/resume/master/README.md | markdown | # Saif's Resume
This repository contains my resume created using Typst.
## Compilation
To compile the resume, follow these steps:
1. **Install Typst**: Ensure you have [Typst](https://typst.app/) installed on your machine.
2. **Clone this Repository**:
```bash
git clone https://github.com/yourusername/resume.git
cd resume
```
3. Modify it: Either make a new file and import the template provided or edit my own.
4. **Compile the Resume**:
```bash
typst c name_here.typ
```
4. **Output**: The compiled resume will be generated as a PDF in the same directory.
|
|
https://github.com/denkspuren/typst_programming | https://raw.githubusercontent.com/denkspuren/typst_programming/main/Recipies.typ | typst | = Typst Recipies
#let renderLabel(label) = {
locate(loc => {
let res = query(label, loc)
return eval(res.first().text, mode: "markup")
}
)
}
== Hyphenation
To force hyphenation in certain places, use `-?` for that. Example: `b-?ad hyp-?hen-?ation`
Source: https://discord.com/channels/1054443721975922748/1171083569192501268
== Vertical Bar left to some text
For this effect:
#renderLabel(<letsolution2>)
Use the stroke parameter for `rect`/`box`/`block` (whatever you want to use here) and only apply it on the left:
```typst
+ #lorem(10)\
#rect(fill: luma(240), stroke: (left: 0.25em))[
*Solution:* #lorem(10)
$ a_(n+1)x^n = 2... $
]
```<letsolution2>
Source: https://discord.com/channels/1054443721975922748/1171244599268872274
== Sort Arrays by Key
```typst
#{
let a = (2, 4, 0)
let b = ("typst", "world", "hello")
let zipped = array.zip(a, b)
let sorted = zipped.sorted(key: ((a, b)) => a)
[
#zipped \
#sorted \
]
}
```<SortArrayByKey>
#renderLabel(<SortArrayByKey>)
Source: https://discord.com/channels/1054443721975922748/1088371919725793360/1171448834119962685
== Get Initials of a Sequence of Words
```typst
#{
let home-place = "Federal University of Ceará"
let words = home-place.split()
let letters = words.map(word => word.at(0))
let capletters = letters.filter(l => upper(l) == l)
[
#letters.join() \
#capletters.join() \
]
}
```<InitialsOfWords>
This results in:
#renderLabel(<InitialsOfWords>)
Source: https://discord.com/channels/1054443721975922748/1171580507138568192
== Styling a list of terms and descriptions
Terms are definied here: https://typst.app/docs/reference/layout/terms/
This is an example from the docs:
/ Ligature: A merged glyph.
/ Kerning: A spacing adjustment
between two adjacent letters.
To change the layout to a term in italics and a description in bold face:
#let termLayout = [ ]
```typst
#show terms: it => list(
marker: none,
body-indent: 0em,
..it.children.map(i => emph(i.term) + h(0.5em) + strong(i.description))
)
/ term: #lorem(10)
/ term: #lorem(5)
/ term: #lorem(7)
```<termLayout>
#renderLabel(<termLayout>)
== List with a bullet set differently
In a bullet list the bullet is formatted like this
- #lorem(10)
- #lorem(25)
- #lorem(9)
If you want to vertically center the bullet, do this:
```typst
#set list(marker: align(horizon)[•])
- #lorem(10)
- #lorem(25)
- #lorem(9)
```<listWithVerticallyCenteredBullet>
#renderLabel(<listWithVerticallyCenteredBullet>)
Source: https://discord.com/channels/1054443721975922748/1088371919725793360/1172273891092213871 |
|
https://github.com/Functional-Bus-Description-Language/Specification | https://raw.githubusercontent.com/Functional-Bus-Description-Language/Specification/master/src/parametrization.typ | typst | #pagebreak()
= Parametrization
The FBDL provides the following three ways for description parametrization:
- constants,
- type definitions,
- type extending.
== Constant
The constant represents a constant value.
The value might be used in expression evaluations.
The following code presents a bus description with three functionalities, all having the same array dimensions and width.
#block(breakable: false)[
#pad(left: 1em)[
```fbd
Main width
const ELEMENT_COUNT = 4
const WIDTH = 8
C [ELEMENT_COUNT]config; width = WIDTH
M [ELEMENT_COUNT]mask; width = WIDTH
S [ELEMENT_COUNT]status; width = WIDTH
```
]
]
Constants must be included in the generated code, both for the provider and for the requester.
This allows for having a single source of the constant value.
A constant can be defined in a single line in the single-line constant definition or as a part of the multi-constant definition.
#block(breakable: false)[
`single_constant_definition ::= `*`const`*` identifier = expression newline`
Examples of single constant definition:
#pad(left: 1em)[
```fbd
const WIDTH = 16
const FOO = 8 * BAR
const LIST = [1, 2, 3, 4, 5]
```
]
]
#block(breakable: false)[
`multi_constant_definition ::=` \
` `*`const`*` newline` \
` indent` \
` identifier = expression newline` \
` { identifier = expression newline }` \
` dedent`
Examples of multi-constant definition:
#pad(left: 1em)[
```fbd
const
WIDTH = 16
FOO = 8 * BAR
LIST = [1, 2, 3, 4, 5]
const
ONE = 1
TWO = ONE + 1
THREE = TWO + 1
```
]
]
== Type definition
The type definition allows for defining custom functionalities.
Any custom functionality resolves to one of the built-in functionalities.
However, by defining custom functionality types it is possible to preset property values or to create easily parametrizable functionalities.
The former leads to shorter descriptions and helps to avoid duplication.
`type_definition ::= single_line_type_definition | multi_line_type_definition`
#block(breakable: false)[
`single_line_type_definition ::=` \
*` type`* \
` identifier` \
` [ parameter_list ]` \
` [ array_marker ]` \
` declared_identifier | qualified identifier` \
` [ argument_list ]` \
` semicolon_and_property_assignments | newline`
]
#block(breakable: false)[
`multi_line_type_definition ::=` \
*` type`* \
` identifier` \
` [ parameter_list ]` \
` [ array_marker ]` \
` declared_identifier | qualified identifier` \
` [ argument_list ]` \
` functionality_body`
]
`parameter_list ::= `*`(`*` parameters `*`)`*
`parameters ::= parameter { `*`,`*` parameter }`
`parameter ::= identifier [ `*`=`*` expression ]`
Parameters in the parameter list might have default values, but parameters with the default values must prepend parameters without default values in the parameter list.
`argument_list ::= `*`(`*` arguments )`
`arguments ::= argument { `*`,`*` argument }`
`argument ::= [ declared_identifier = ] expression`
Arguments in the argument list may be prepended with the parameter name.
However, arguments with parameter names must prepend arguments without parameter names in the argument list.
#block(breakable: false)[
The below snippet presents examples of type definitions.
#pad(left: 1em)[
```fbd
# Single line type definition
type cfg_t(w = 10) config; width = w; reset-value = 1
# Multi line type definition
type blk_t(with_status = true, mask_count) block
S [with_status]status
M [mask_count]mask
Main bus
type irq_t irq; clear = "On Read"
I1 irq_t
I2 irq_t
C1 cfg_t
C2 cfg_t(6)
C3 cfg_t(width = 8)
Blk1 blk_t(7)
Blk2 blk_t(with_status = false, mask_count = 11)
```
]
]
== Type extending
The type extending allows extending any custom defined type, either by instantiation or by defining a new type.
This is mainly, but not only, useful when there are similar blocks with only slightly different set of functionalities.
#block(breakable: false)[
Example:
#pad(left: 1em)[
```fbd
type blk_common_t block
C1 config
M1 mask
S1 status
Main bus
Blk_C blk_common_t
C2 config
Blk_M blk_common_t
M2 mask
Blk_S blk_common_t
S2 status
```
]
]
This description is equivalent to the following description:
#block(breakable: false)[
#pad(left: 1em)[
```fbd
type blk_common_t block
C1 config
M1 mask
S1 status
type blk_C_t blk_common_t
C2 config
type blk_M_t blk_common_t
M2 mask
type blk_S_t blk_common_t
S2 status
Main bus
Blk_C blk_C_t
Blk_M blk_M_t
Blk_S blk_S_t
```
]
]
The type nesting has no depth limit.
However, no property already set in one of the ancestor types can be overwritten.
Also no symbol identifier defined in one of the ancestor types can be redefined.
|
|
https://github.com/Doublonmousse/pandoc-typst-reproducer | https://raw.githubusercontent.com/Doublonmousse/pandoc-typst-reproducer/main/color_issues/desaturate.typ | typst | #square(
fill: red.desaturate(10%)
)
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-2A700.typ | typst | Apache License 2.0 | #let data = (
"0": ("<CJK Ideograph Extension C, First>", "Lo", 0),
"1039": ("<CJK Ideograph Extension C, Last>", "Lo", 0),
)
|
https://github.com/ClazyChen/Table-Tennis-Rankings | https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2004/WS-03.typ | typst |
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (1 - 32)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[1], [WANG Nan], [CHN], [2594],
[2], [ZHANG Yining], [CHN], [2589],
[3], [GUO Yan], [CHN], [2440],
[4], [NIU Jianfeng], [CHN], [2435],
[5], [GUO Yue], [CHN], [2423],
[6], [LI Ju], [CHN], [2303],
[7], [KIM Kyungah], [KOR], [2241],
[8], [TIE Yana], [HKG], [2213],
[9], [SONG Ah Sim], [HKG], [2191],
[10], [LIN Ling], [HKG], [2157],
[11], [GAO Jun], [USA], [2147],
[12], [STEFF Mihaela], [ROU], [2138],
[13], [BOROS Tamara], [CRO], [2133],
[14], [LAU Sui Fei], [HKG], [2125],
[15], [ZHANG Rui], [HKG], [2097],
[16], [LI Nan], [CHN], [2092],
[17], [FAN Ying], [CHN], [2085],
[18], [PENG Luyang], [CHN], [2084],
[19], [LEE Eunsil], [KOR], [2084],
[20], [CAO Zhen], [CHN], [2076],
[21], [JIANG Huajun], [HKG], [2057],
[22], [FUKUHARA Ai], [JPN], [2055],
[23], [UMEMURA Aya], [JPN], [2053],
[24], [K<NAME>], [PRK], [2047],
[25], [TOTH Krisztina], [HUN], [2047],
[26], [LI Jiawei], [SGP], [2037],
[27], [LI Xiaoxia], [CHN], [2035],
[28], [ZAMFI<NAME>], [ROU], [2004],
[29], [<NAME>], [GER], [2000],
[30], [SCHOPP Jie], [GER], [1998],
[31], [LANG Kristin], [GER], [1997],
[32], [<NAME>], [JPN], [1993],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (33 - 64)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[33], [SUK Eunmi], [KOR], [1993],
[34], [FUJINUMA Ai], [JPN], [1991],
[35], [WANG Chen], [CHN], [1985],
[36], [KIM Mi Yong], [PRK], [1983],
[37], [PASKAUSKIENE Ruta], [LTU], [1974],
[38], [#text(gray, "LI Jia")], [CHN], [1970],
[39], [LIU Jia], [AUT], [1966],
[40], [KOSTROMINA Tatyana], [BLR], [1961],
[41], [BADESCU Otilia], [ROU], [1954],
[42], [<NAME>], [GER], [1949],
[43], [<NAME>], [NZL], [1941],
[44], [ODOROVA Eva], [SVK], [1933],
[45], [<NAME>], [KOR], [1931],
[46], [<NAME>], [JPN], [1924],
[47], [<NAME>], [ITA], [1922],
[48], [<NAME>], [RUS], [1908],
[49], [<NAME>], [BLR], [1904],
[50], [<NAME>], [CHN], [1904],
[51], [<NAME>], [KOR], [1903],
[52], [<NAME>], [HUN], [1900],
[53], [<NAME>], [SGP], [1880],
[54], [<NAME>], [LUX], [1871],
[55], [STRBIKOVA Renata], [CZE], [1859],
[56], [<NAME>], [ITA], [1858],
[57], [<NAME>], [HUN], [1854],
[58], [<NAME>], [CHN], [1851],
[59], [<NAME>], [HUN], [1851],
[60], [NEGRISOLI Laura], [ITA], [1850],
[61], [<NAME>], [TPE], [1849],
[62], [<NAME>], [CRO], [1846],
[63], [<NAME>], [JPN], [1839],
[64], [NEMES Olga], [ROU], [1838],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (65 - 96)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[65], [<NAME>], [BLR], [1834],
[66], [<NAME>], [CRO], [1823],
[67], [<NAME>], [HUN], [1823],
[68], [<NAME>], [ISR], [1821],
[69], [<NAME>], [GER], [1818],
[70], [<NAME>], [SVK], [1816],
[71], [<NAME>], [SGP], [1816],
[72], [<NAME>], [TPE], [1810],
[73], [KONISHI An], [JPN], [1808],
[74], [RATHER Jasna], [USA], [1803],
[75], [<NAME>], [JPN], [1803],
[76], [<NAME>], [KOR], [1803],
[77], [HIURA Reiko], [JPN], [1803],
[78], [KWAK Bangbang], [KOR], [1799],
[79], [HUANG Yi-Hua], [TPE], [1793],
[80], [DOBESOVA Jana], [CZE], [1786],
[81], [SHIOSAKI Yuka], [JPN], [1785],
[82], [LEE Hyangmi], [KOR], [1772],
[83], [<NAME>], [KOR], [1772],
[84], [WANG Yu], [ITA], [1769],
[85], [KIM Hyang Mi], [PRK], [1768],
[86], [KIM Mookyo], [KOR], [1765],
[87], [<NAME>], [AUT], [1759],
[88], [<NAME>], [GER], [1753],
[89], [STEFANSKA Kinga], [POL], [1753],
[90], [BOLLMEIER Nadine], [GER], [1752],
[91], [<NAME>], [SLO], [1748],
[92], [LOGATZKAYA Tatyana], [BLR], [1746],
[93], [<NAME>], [JPN], [1744],
[94], [XU Yan], [SGP], [1743],
[95], [<NAME>], [KOR], [1741],
[96], [TODOROVIC Biljana], [SLO], [1740],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Women's Singles (97 - 128)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[97], [<NAME>], [GER], [1737],
[98], [FADEEVA Oxana], [RUS], [1736],
[99], [<NAME>], [HUN], [1734],
[100], [VACHOVCOVA Alena], [CZE], [1728],
[101], [NISHII Yuka], [JPN], [1724],
[102], [FUJITA Yuki], [JPN], [1720],
[103], [ITO Midori], [JPN], [1720],
[104], [<NAME>], [AUS], [1712],
[105], [<NAME>], [SWE], [1710],
[106], [<NAME>], [UKR], [1710],
[107], [<NAME>], [FRA], [1708],
[108], [<NAME>], [IND], [1705],
[109], [<NAME>], [RUS], [1700],
[110], [<NAME>], [RUS], [1697],
[111], [<NAME>], [USA], [1696],
[112], [<NAME>], [SWE], [1694],
[113], [<NAME>], [FRA], [1689],
[114], [<NAME>], [HUN], [1686],
[115], [<NAME>], [KOR], [1683],
[116], [<NAME>], [CAN], [1683],
[117], [#text(gray, "<NAME>")], [FRA], [1681],
[118], [<NAME>], [SGP], [1680],
[119], [WIGOW Susanna], [SWE], [1680],
[120], [SKOV Mie], [DEN], [1680],
[121], [CADA Petra], [CAN], [1673],
[122], [GATINSKA Katalina], [BUL], [1671],
[123], [<NAME>], [CRO], [1671],
[124], [<NAME>], [SRB], [1668],
[125], [VOLAKAKI Archontoula], [GRE], [1665],
[126], [KO Somi], [KOR], [1660],
[127], [SU Hsien-Ching], [TPE], [1652],
[128], [#text(gray, "HAN Kwangsun")], [KOR], [1651],
)
) |
|
https://github.com/pluttan/typst-g7.32-2017 | https://raw.githubusercontent.com/pluttan/typst-g7.32-2017/main/gost7.32-2017/styles/list.typ | typst | MIT License | #import "../g7.32-2017.config.typ":config
#let style_list(content) = {
set list(indent: config.page.parIndent)
show list: it => {
it
par(text(size: config.list.indent, h(0.0em)))
}
set enum(indent: config.page.parIndent)
show enum: it => {
it
par(text(size: config.list.indent, h(0.0em)))
}
content
} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.