repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/GartmannPit/Praxisprojekt-II | https://raw.githubusercontent.com/GartmannPit/Praxisprojekt-II/main/Praxisprojekt%20II/PVA-Templates-typst-pva-2.0/template/contents.typ | typst | #let createTableofContent() = {
set heading(numbering: none)
set heading(outlined: false)
par[= Inhaltsverzeichnis] // change heading here for other languages
show outline.entry.where(level:1): it => {
v(12pt, weak: true)
strong(it)
}
outline(title: none, indent: auto)
} |
|
https://github.com/pedrofp4444/BD | https://raw.githubusercontent.com/pedrofp4444/BD/main/report/content/[4] Modelação Lógica/main.typ | typst | #import "validação.typ": validação
#import "explicação.typ": explicação
#import "normalização.typ": normalização
#import "interrogações.typ": interrogações
#let lógico = {
[
= Modelação Lógica
#validação
#explicação
#normalização
#interrogações
]
} |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-A700.typ | typst | Apache License 2.0 | #let data = (
("MODIFIER LETTER CHINESE TONE YIN PING", "Sk", 0),
("MODIFIER LETTER CHINESE TONE YANG PING", "Sk", 0),
("MODIFIER LETTER CHINESE TONE YIN SHANG", "Sk", 0),
("MODIFIER LETTER CHINESE TONE YANG SHANG", "Sk", 0),
("MODIFIER LETTER CHINESE TONE YIN QU", "Sk", 0),
("MODIFIER LETTER CHINESE TONE YANG QU", "Sk", 0),
("MODIFIER LETTER CHINESE TONE YIN RU", "Sk", 0),
("MODIFIER LETTER CHINESE TONE YANG RU", "Sk", 0),
("MODIFIER LETTER EXTRA-HIGH DOTTED TONE BAR", "Sk", 0),
("MODIFIER LETTER HIGH DOTTED TONE BAR", "Sk", 0),
("MODIFIER LETTER MID DOTTED TONE BAR", "Sk", 0),
("MODIFIER LETTER LOW DOTTED TONE BAR", "Sk", 0),
("MODIFIER LETTER EXTRA-LOW DOTTED TONE BAR", "Sk", 0),
("MODIFIER LETTER EXTRA-HIGH DOTTED LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER HIGH DOTTED LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER MID DOTTED LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER LOW DOTTED LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER EXTRA-LOW DOTTED LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER EXTRA-HIGH LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER HIGH LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER MID LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER LOW LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR", "Sk", 0),
("MODIFIER LETTER DOT VERTICAL BAR", "Lm", 0),
("MODIFIER LETTER DOT SLASH", "Lm", 0),
("MODIFIER LETTER DOT HORIZONTAL BAR", "Lm", 0),
("MODIFIER LETTER LOWER RIGHT CORNER ANGLE", "Lm", 0),
("MODIFIER LETTER RAISED UP ARROW", "Lm", 0),
("MODIFIER LETTER RAISED DOWN ARROW", "Lm", 0),
("MODIFIER LETTER RAISED EXCLAMATION MARK", "Lm", 0),
("MODIFIER LETTER RAISED INVERTED EXCLAMATION MARK", "Lm", 0),
("MODIFIER LETTER LOW INVERTED EXCLAMATION MARK", "Lm", 0),
)
|
https://github.com/GZTimeWalker/GZ-Typst-Templates | https://raw.githubusercontent.com/GZTimeWalker/GZ-Typst-Templates/main/templates/shared.typ | typst | MIT License | #import "../functions/fonts.typ": *
#import "../functions/booktab.typ": *
#import "@preview/physica:0.8.0": *
// Set the default style for the document
#let shared(doc) = {
set page(paper: "a4", numbering: "1", number-align: center)
set text(font: fonts.serif, lang: "zh", size: 11pt)
show raw.where(block: true): block.with(fill: luma(240), inset: (x: 1.25em, y: 1em), width: 100%, radius: 4pt)
show raw.where(block: true): par.with(first-line-indent: 0em, justify: true, leading: 8pt)
show raw.where(block: false): box.with(
fill: luma(240),
inset: (x: 5pt, y: 0pt),
outset: (y: 4pt),
radius: 3pt,
)
show raw: text.with(font: fonts.monospace + fonts.sans, size: 1em)
set heading(numbering: (..numbers) => {
let level = numbers.pos().len();
if (level == 1) {
return numbering("一. ", numbers.pos().at(level - 1))
} else {
return numbering("1.1. ", ..numbers.pos().slice(1, level))
}
})
show heading: it => [
// Cancel indentation for headings of level 2 or above
#set par(first-line-indent: 0em, hanging-indent: 2em)
#let sized_heading(it, size, weight, mt, mb) = {
set text(size, weight: weight)
v(mt)
counter(heading).display()
text[#it.body]
v(mb)
}
#if it.level == 1 {
sized_heading(it, 20pt, "semibold", 1em, 0.6em)
} else if it.level == 2 {
sized_heading(it, 16pt, "semibold", 0.7em, 0.7em)
} else if it.level == 3 {
sized_heading(it, 14pt, "medium", 0.5em, 0.5em)
} else {
sized_heading(it, 12pt, "medium", 0.3em, 0.3em)
}
]
show link: underline
set math.vec(delim: "[")
set math.mat(delim: "[")
show par: set block(spacing: line_height)
doc
}
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/04-opentype/implied.typ | typst | Other | #import "/lib/draw.typ": *
#let start = (250, 650)
#let end = (950, 1400)
#let text-size = 32
#let point-radius = 5
#let hightlight-thickness = 5
#let curve-thickness = 10
#let ctrl-curve-color = gray
#let ctrl-point-color = choose(gray.darken(50%), gray.lighten(50%))
#let main-curve-color = theme.main
#let arrow-thickness = 5
#let arrow-color = theme.main
#let highlight = (p, stroke, radius-in, radius-out, times: 12) => {
let (x, y) = p
for t in range(0, times) {
let theta = t * 360 / times;
let start = (
x + radius-in * calc.sin(theta * 1deg),
y + radius-in * calc.cos(theta * 1deg),
)
let end = (
x + radius-out * calc.sin(theta * 1deg),
y + radius-out * calc.cos(theta * 1deg),
)
segment(start, end, stroke: stroke)
}
}
#let graph = with-unit((ux, uy) => {
let s = (307, 731)
let c1 = (307, 1010)
let c2 = (586, 1331)
let e = (827, 1331)
let ps = (s, c1, c2, e)
let ctrl-stroke = curve-thickness * ux + ctrl-curve-color;
let main-stroke = curve-thickness * ux + main-curve-color;
for (a, b) in ps.zip(ps.slice(1)) {
segment(a, b, stroke: ctrl-stroke)
}
let ctrl-point = point.with(
radius: point-radius, color: ctrl-point-color, fill: true,
need-txt: true, size: text-size * ux,
)
ctrl-point(s, anchor: "ct", dy: -20)
ctrl-point(c1, anchor: "cb", dy: 100)
ctrl-point(c2, anchor: "cb", dy: 20)
ctrl-point(e, anchor: "cb", dy: 20)
let m = c1.zip(c2).map(((a, b)) => (a + b) / 2)
bezier(s, c1, none, m, stroke: main-stroke)
bezier(m, c2, none, e, stroke: main-stroke)
let highlight-stroke = stroke(
paint: theme.main,
thickness: hightlight-thickness * ux ,
cap: "round"
)
highlight(m, highlight-stroke, 15, 25, times: 12)
let arrows = (m.at(0) + 30, m.at(1) - 30)
let arrowe = (m.at(0) + 120, m.at(1) - 70)
let arrowc = (arrows.at(0) + 50, arrowe.at(1))
bezier(arrows, arrowc, none, arrowe, stroke: arrow-thickness * ux + arrow-color)
arrow-head(arrows, 10, theta: 140deg, point-at-center: true)
txt([隐含的点], arrowe, size: text-size * ux, anchor: "lc", dx: 10)
txt([
#box(baseline: 30%)[$ (#c1.at(0) + #c2.at(0)) / 2 , (#c1.at(1) + #c2.at(1)) / 2 $] = (#m.at(0), #m.at(1))
], arrowe, size: text-size * ux, anchor: "lt", dy: -text-size)
})
#align(center, canvas(
start: start,
width: 60%,
end,
graph,
))
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/010_Duel%20Decks%3A%20Jace%20vs.%20Vraska.typ | typst | #import "@local/mtgset:0.1.0": conf
#show: doc => conf("Duel Decks: Jace vs. Vraska", doc)
#include "./010 - Duel Decks: Jace vs. Vraska/001_The Gorgon and the Guildpact.typ"
|
|
https://github.com/Nyovelt/Resume2024 | https://raw.githubusercontent.com/Nyovelt/Resume2024/main/README.md | markdown | MIT License | # Alex's Resume
This is my resume, based on [Matchy's template](https://github.com/matchy233/typst-chi-cv-template).
|
https://github.com/Treeniks/bachelor-thesis-isabelle-vscode | https://raw.githubusercontent.com/Treeniks/bachelor-thesis-isabelle-vscode/master/chapters/05-main-enhancements.typ | typst | #import "/utils/todo.typ": TODO
#import "/utils/isabelle.typ": *
= Enhancements and New Features
This chapter focuses on significant redesigns or additions to #vscode. Users of #vscode frequently reported syntax highlighting breaking, particularly when switching files. To address this, we implemented a feature that allows manual requests for decorations.
Additionally, we added the ability to disable HTML output for state and output panels, a feature primarily motivated by the requirements of the Neovim language client prototype mentioned in @intro:motivation. We also provided more granular control for the language client regarding the handling of Isabelle symbols, which enhances the server's flexibility.
Lastly, we identified two features of #jedit where #vscode had no equivalent: Active markup and the ability to set Isabelle preferences through a UI settings menu. While these features required certain compromises, the implementations in #vscode prioritize simplicity and compatibility, even if they deviate from the exact functionality found in #jedit.
#include "/chapters/05-main-enhancements/decorations-file-switch.typ"
#include "/chapters/05-main-enhancements/non-html-content.typ"
#include "/chapters/05-main-enhancements/symbol-handling.typ"
#include "/chapters/05-main-enhancements/code-actions-active-markup.typ"
#include "/chapters/05-main-enhancements/isabelle-system-options.typ"
// == New Default Settings and Word Pattern
// #TODO[
// - completions don't work properly if word pattern is not set the way it is now
// ]
// #TODO[
// - renderWhitespace to none because the space render is not monospaced in the font
// - quickSuggestions strings to on, because everything in quotes is set to be a string by the static syntax
// - wordBasedSuggestions to off
// ]
|
|
https://github.com/ludwig-austermann/typst-timetable | https://raw.githubusercontent.com/ludwig-austermann/typst-timetable/main/README.md | markdown | MIT License | # typst-timetable
[GitHub Repository including Examples and Changelog](https://github.com/ludwig-austermann/typst-timetable)
A typst template for timetables
## Features
A resulting timetable looks like this:

- Collision detection
- Automatic extension over multiple fields / cells / time slots
- ...
## Usage
The main difficulty lies in defining the dictionary with the necessary data. Take a look into the example to see how a `json` or `toml` file can be used to specify the data, which can then be included into `.typ` files.
### Functions
The exposed `timetable` function takes the following arguments:
- `all-data`: is the necessary data input
- `language: "en"`: the language to use for weekdays and other terms
- `date: datetime.today().display("[day].[month].[year]")`: the date to be displayed in the header
- `show-header: true`: if to show the header
- `show-alternatives: true`: if to show collisions and their corresponding alternatives
- `show-description: true`: if to show the description table
- `tablex-args: (:)`: arguments to be passed to the underlying tablex table, to overwrite the style
- `event-cell: default-blocks.event-cell`: how to display the events
- `time-cell: default-blocks.time-cell`: how to display the time cells
- `color-theme: tab`: for automatical coloring of courses
### Data Dictionary
```
general
period
person
times: array
start [end - defaults.duration]
end [start + defaults.duration]
display: string [start "--" end]
show-time [false]
defaults
duration [2]
description?: array
id
title
type: text|link|content [text]
courses: {abbrv}?: string ->
{description.id}?
color?
priority [0]
hide [false]
hide-description [false]
events: {eventtype}?: string ->
day
start [end - default.duration]
end [start + default.duration]
room
priority [thiscourse.priority]
hide [false]
```
Here `?` denotes optional values, `[]` the corresponding default value, `{}` parametrices keys and `->` denotes another dictionary.
Necessary are only a few options, for a quick start look at this simplified version:
```
general
period
person
times: array
start or end
courses: {abbrv}?: string ->
events: {eventtype}?: string ->
day
start or end
room
```
Take a look at the example files, currently only the `toml` ones show all options.
## Typst Usage Tipp
I plan to eventually release this as a package to typst packages. Until then, or additionally, you can place this in your local packages repo. If you use the web app, |
https://github.com/matthiasGmayer/structural-independence-typst | https://raw.githubusercontent.com/matthiasGmayer/structural-independence-typst/Typst/main.typ | typst | #import "template.typ": *
#show: showrules
#align(center)[Writing notes]
In the intro we explain
d-separation and what it does.
We explain that there is D-separation and that it views functions as general position, but there was no theory for a fixed function until Garrabrant, Mayer et al. Having fixed functions makes the theory applicable to structural equations models.
This develops into a nice mathematical theory.
(Counterexample where?)
Overview over definitions
Define the basic notions
Theorem
Open: Cyclic models
Open: continuous time
Open: How to make SEM directions identifiable
#pagebreak()
#align(center)[
#text(size:2em)[A Theory of Structural Independence] \
\
<NAME>
]
\
#emph[
#lorem(100)
]
= Introduction
Independence is arguable the most important concepts in probability theory.
(Why?)
Often we assume that the independence of variables informs about the structure of the process that generated these variables.
We will formalize what it means for an independence to come from the structure of a process, this is called _structural independence_.
Under the assumption that the observed independences are coming from the process, it is possible to gain information about the process, this is called _discovery_. We will see causal discovery.
We will explain more about structural indpendence
We observe a set of variables $V$ and we want to express their independence relationships.
We can do this through bayesian networks.
We assume common notation for graphs and leave the details to an appendix.
#definition[bayesian network][
A bayesian network is a directed acyclic graph (DAG) $G$ with nodes $V$.
A distribution $P in distributions(Val(V))$ is compatible with $G$
if it fulfills the markov condition, i.e. for any $X in V$ and $Y in V$ with
$X cancel(arrow) Y$ we have $X indep_PP Y | PA(X)$.
Let $distributions(G)$ denote all probability distributions over $V$ that are compatible with $G$.
]
From the definition of compatibility it is clear that for any $X cancel(arrow) Y$ we have $forall PP in distributions(G): X indep_P Y | PA(X)$, but we can also go further and characterize all independences between sets of variables
that arise in all compatible distributions.
#definition[d-separation][
Let $X,Y,Z$ be sets of variables.
Then $X$ and $Y$ are d-connected given $Z$
if there is a trail from a node in X
to a node in $Y$ on which every node is a collider if and only if it is in $Z$.
$X$ and $Y$ are d-separated given $Z$ if they are not d-connected.
]
#theorem[
Let $X,Y,Z$ be sets of variables.
Then $X$ and $Y$ are d-seperated from $Z$ if and only if
they are independent in all distributions compatible with $G$.
]
From this we can motivate the following definition.
#definition[structural independence][
Let $X,Y,Z$ be random variables a sample space $Omega$.
Let $distributions$ be a class of probability distributions on $Omega$.
Then $X$ and $Y$ are structurally independent given $Z$ w.r.t. $distributions$ if they are independent in all probability distributions in $distributions.$ We write $orth_distributions$ for the structural independence relation w.r.t. $distributions$. Therefore,
$
X orth_distributions Y | Z :<=> forall PP in distributions : X indep_PP Y | Z.
$
]
We can now further motivate why this is good definition informally:
We argue that '$=>$' has to hold for any reasonable definition for structural independence. This is because once you endow your structure with a probability distribution, i.e. a specific realization of your model, the independences that you argued structurally, should be realized as well.
'$arrow.l.double$' means that structural independence is the largest relation that fulfills these requirements.
Now the key part is that we want to characterize the structural independence for nice classes of distributions. We already saw the example of bayesian networks.
Bayesian networks have the problem that their independence criterion only works for sets of nodes and not for arbitrary random variables.
We will see that we can use our theory to fully characterize structural independence for all random variables defined on the graph.
In general we can't characterize independence in terms of simple properties, since we can choose any singleton set as our reference class.
We are interested in nice classes.
One first definition we can do is look at all distributions with a certain independence structure.
But even this sometimes singles out one distributions. (e.g. uniform distribution on 4 elements).
We are interested in independencies where changing numerical values around does not change the independencies.
i.e.
Let $distributions$ be induced by some partial independence relation $indep$.
Then we can look at a particular instance
$
X indep_PP Y | Z
$
Then clearly for a $X ms$ $Z$ density $f$ and
$Y ms$ $Z$ denstity $G$ we have
and we have for $Q := f dot g dot PP(dot | Z)$ that
$X indep_Q Y | Z$.
But other relations can be destroyed.
We require that all relations are retained under such transformations.
(This is too strong for continuous time)
We now want to see that this makes structural independence compositional.
#theorem[
Let $PP$ be a probability distribution over $Omega$. Further let $X : Omega -> RR$ and $f$ be a density w.r.t. $PP$.
Let $PP' := f dot PP$.
We have
$EE'(X|Z) dot EE(f | Z) = EE(f dot X | Z) $.
]
#proof[
Note that $EE'(X|Z) EE(f|Z)$ is $Z ms$. Let $C in sigma(Z)$. Then
$
integral_C EE'(X|Z) EE(f|Z) dif PP
&= integral_C EE'(X |Z) dif EE(f|Z) PP \
&= integral_C EE'(X |Z) dif f PP \
&= integral_C X dif f PP \
&= integral_C f dot X dif PP
$
The second equality follows from
$(EE(f|Z) PP)|_sigma(Z) = (f PP)_sigma(Z)$ by definition of conditional expectation.
]
#corollary[
Let $f$ be a probability density w.r.t. $PP$ and $PP' := f PP$, then
$A indep_P' B | Z <=> EE(f 1_A | Z) EE(f 1_B | Z) = EE(f | Z) EE(1_(A sect B) | Z)$.
]
#lemma[
Let $X indep Y | Z$ and
$X' indep Y | Z$
then
$(X,X') indep Y | Z$.
and therefore $(X,X',Y)$ is independent given $Z$.
]
#proof[
Let $A in sigma(X)$ and $A' in sigma(X')$.
Let $B in sigma(Y)$.
It suffices to show that $A sect A' indep B | Z$.
By applying our assumption to $1_A'$, we get
with independence of $A$ and $B$ given $Z$ w.r.t. $PP':= PP(dot | A')$ that
$
PP(A,A'|Z) PP(B, A'| Z) = PP(A'|Z) PP(A,A',B|Z) \
$
using independence of $A'$ and $B$ given $Z$ we get
$
PP(A,A'|Z) PP(B|Z) = PP(A,A',B|Z).
$
// Set $Q_lambda (S) = (lambda 1_A + comp(lambda) 1_(A^c) ) dot PP (S) = lambda PP(S sect A) + comp(lambda) PP(S sect A^c) $.
// Note that
// $QQ_lambda (S | Z) =(lambda PP(S A|Z) + comp(lambda)PP ( S A^c|Z))/(lambda PP(A|Z) + comp(lambda) PP (A^c|Z))$
// By our assumptions we have
// $A' indep_Q_lambda B | Z$.
// Therefore
// $
// (lambda PP(A' A|Z) + comp(lambda)PP (A' A^c|Z))
// (lambda PP(B A|Z) + comp(lambda)PP (B A^c|Z))
// = (lambda PP(A|Z) + comp(lambda) PP (A^c|Z))
// (lambda PP(A' B A|Z) + comp(lambda) PP (A' B A^c|Z))
// $
// collecting terms by lambda, we have
// $
// A' A dot B A - A' A^c dot B A^c = A dot A' B A - A^c dot A' B A^c \
// (A' A - A' A^c) dot B A^c + (B A - B A^c) dot A' A^c
// = (A'B A - A'B A^c) dot A^c + (A - A^c) dot A' B A^c \
// A' A^c dot B A^c = A^c dot A' B A^c \
// 1+3: A' A dot B A = A dot A' B A \
// $
// $
// PP(A,A' | Z) PP(B | Z) = PP(A,A',B | Z) \
// <=> PP(A,A' | Z) = PP(A,A',B | Z)/PP(B | Z) \
// $
// $
// PP(A,A' | Z) PP(B | Z) = PP(A,A',B | Z) \
// <=> PP(B | Z) = PP(A,A',B | Z)/PP(A,A' | Z) \
// $
// $
// PP_A' (A | Z) PP_A' (B | Z) = PP_A' (A,B | Z) \
// PP (A lambda A' comp(lambda) A'^c | Z) PP (A' B | Z) = PP(A'|Z) PP (A' A B | Z) \
// $
]
= Definitions
conditional history
= Main Theorem
= Arbitrary independencies?
$#history (X)$
|
|
https://github.com/UBOdin/data_structures_book | https://raw.githubusercontent.com/UBOdin/data_structures_book/main/chapters/5-recursion.typ | typst | = Recursion, Divide and Conquer, Sorting
This section will cover:
- Recursion basics
- Factorial
- Tail recursion
- Bounding recursive functions
- Coming up with recursive algorithms: Divide and conquer
- Sorted Array as an ADT
- Sort algorithms: Merge Sort
- Expected Runtime Complexity
- Sort algorithms: Quick Sort |
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/foundations/bytes.typ | typst | // Test the bytes type.
--- bytes-basic ---
#let data = read("/assets/images/rhino.png", encoding: none)
#test(data.len(), 232243)
#test(data.slice(0, count: 5), bytes((137, 80, 78, 71, 13)))
#test(str(data.slice(1, 4)), "PNG")
#test(repr(data), "bytes(232243)")
--- bytes-string-conversion ---
#test(str(bytes(range(0x41, 0x50))), "ABCDEFGHIJKLMNO")
--- bytes-array-conversion ---
#test(array(bytes("Hello")), (0x48, 0x65, 0x6C, 0x6C, 0x6F))
--- bytes-addition ---
// Test addition and joining.
#test(bytes((1, 2)) + bytes(()), bytes((1, 2)))
#test(bytes((1, 2)) + bytes((3, 4)), bytes((1, 2, 3, 4)))
#test(bytes(()) + bytes((3, 4)), bytes((3, 4)))
--- bytes-joining ---
#test(str({
bytes("Hello")
bytes((0x20,))
bytes("World")
}), "Hello World")
--- bytes-bad-conversion-from-dict ---
// Error: 8-14 expected string, array, or bytes, found dictionary
#bytes((a: 1))
|
|
https://github.com/chendaohan/bevy_tutorials_typ | https://raw.githubusercontent.com/chendaohan/bevy_tutorials_typ/main/20_events/events.typ | typst | #set page(fill: rgb(35, 35, 38, 255), height: auto, paper: "a3")
#set text(fill: color.hsv(0deg, 0%, 90%, 100%), size: 22pt, font: "Microsoft YaHei")
#set raw(theme: "themes/Material-Theme.tmTheme")
= 1. 事件
将数据在系统之间传递!让你的系统彼此通信!
像资源或组件一样,事件是简单的 Rust 结构体或枚举。当创建一个新的事件类型时,派生 Event Trait。
然后,任何系统都可以发送(广播)该类型的值,任何系统都可以接收这些事件。
要发送事件,请使用 EventWriter\<T>。 要接收事件,请使用 EventReader\<T>。 每个读取器独立跟踪它已读取的事件,因此你可以从多个系统处理相同的事件。
```rs
fn add_experiences(
mut commands: Commands,
mut player: Query<&mut Player>,
mut experience_reader: EventReader<AddExperience>,
mut upgrade_writer: EventWriter<PlayerUpgrade>,
) {
let Ok(mut player) = player.get_single_mut() else {
return;
};
let previous_level = player.level;
for &AddExperience { entity, experience } in experience_reader.read() {
player.current_experience += experience;
while player.current_experience >= player.upgrade_experience[player.level as usize] {
player.current_experience -= player.upgrade_experience[player.level as usize];
player.level += 1;
}
commands.entity(entity).despawn();
}
let upgrade_level = player.level - previous_level;
if upgrade_level > 0 {
upgrade_writer.send(PlayerUpgrade(upgrade_level));
}
}
```
你需要通过应用程序构建器注册自定义事件类型:
```rs
app.add_event::<PlayerUpgrade>()
```
= 2. 使用建议
事件应该是你的首选数据流工具。由于事件可以从任何系统发送并被多个系统接收,它们非常通用。
事件可以是一个非常有用的抽象层。它们允许你解耦功能,从而更容易推理哪个系统负责什么。
你可以想象,即使在上面展示的简单“玩家升级”示例中,使用事件也可以让我们轻松扩展假设的游戏功能。如果我们想显示一个华丽的升级效果或动画,更新 UI 或其他任何东西,我们只需添加更多读取事件并执行各自任务的系统。
= 3. 工作原理
当你注册一个事件类型时,Bevy 会创建一个 Events\<T> 资源,作为事件队列的后备存储。Bevy 还添加了一个“事件维护”系统,定期清除事件,防止它们积累并占用内存。
Bevy 确保事件至少保留两个帧更新周期或两个固定时间步长周期,以较长者为准。之后,它们会被静默丢弃。这给你的系统足够的机会来处理它们,假设你的系统一直在运行。注意,当为你的系统添加运行条件时,你可能会错过一些事件,因为你的系统没有运行!
如果你不喜欢这样,你可以手动控制何时清除事件(如果忘记清除,可能会导致内存泄漏/浪费)。
EventWriter\<T> 系统参数只是语法糖,用于可变地访问 Events\<T> 资源以将事件添加到队列中。EventReader\<T> 稍微复杂一些:它不可变地访问事件存储,但也存储一个整数计数器来跟踪你已读取的事件数量。这就是为什么它也需要 mut 关键字。
Events\<T> 本身是使用简单的 Vec 实现的。发送事件相当于向 Vec 推送。这非常快,开销低。事件通常是 Bevy 中实现功能的最有效方式,比使用变更检测更好。
= 4. 可能的陷阱
注意帧延迟/1帧滞后。如果 Bevy 在发送系统之前运行接收系统,则接收系统只有在下次运行时才有机会接收事件。如果你需要确保事件在同一帧上处理,可以使用显式系统排序。
如果你的系统有运行条件,注意它们在不运行时可能会错过一些事件!如果你的系统没有至少每隔一帧或固定时间步检查一次事件,这些事件将会丢失。
如果你希望事件保留更长时间,可以实现自定义的清理/管理策略。然而,你只能对自己的事件类型这样做。对于 Bevy 的内置类型,没有解决方案。 |
|
https://github.com/Quaternijkon/notebook | https://raw.githubusercontent.com/Quaternijkon/notebook/main/content/数据结构与算法/.chapter-算法/动态规划/丑数.typ | typst | #import "../../../../lib.typ":*
=== #Title(
title: [丑数],
reflink: "https://leetcode.cn/problems/ugly-number-ii/description/",
level: 2,
)<丑数>
#note(
title: [
丑数
],
description: [
给你一个整数 n ,请你找出并返回第 n 个 丑数 。
说明:丑数是只包含质因数 2、3 和/或 5 的正整数;1 是丑数。
],
examples: ([
输入: n = 10
输出: 12
解释: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 是前 10 个丑数。
],
),
tips: [
1 <= n <= 1690
],
solutions: (
( name:[动态规划],
text:[
根据题意,每个丑数都可以由其他较小的丑数通过乘以 2 或 3 或 5 得到。
所以,可以考虑使用一个优先队列保存所有的丑数,每次取出最小的那个,然后乘以 2 , 3 , 5 后放回队列。然而,这样做会出现重复的丑数。例如:
> 初始化丑数列表 $[1]$
> 第一轮: 1 -> 2, 3, 5 ,丑数列表变为 $[1, 2, 3, 5]$
> 第二轮: 2 -> 4, 6, 10 ,丑数列表变为 $[1, 2, 3, 4, 6, 10]$
> 第三轮: 3 -> 6, 9, 15 ,出现重复的丑数 $6$
为了避免重复,我们可以用三个指针 a , b, c ,分别表示下一个丑数是当前指针指向的丑数乘以 2 , 3 , 5 。
利用三个指针生成丑数的算法流程:
1. 初始化丑数列表 res ,首个丑数为 1 ,三个指针 a , b, c 都指向首个丑数。
2. 开启循环生成丑数:
1. 计算下一个丑数的候选集 $"res"[a] dot 2 , "res"[b] dot 3,"res"[c] dot 5$ 。
2. 选择丑数候选集中最小的那个作为下一个丑数,填入 res 。
3. 将被选中的丑数对应的指针向右移动一格。
3. 返回 res 的最后一个元素即可。
],code:[
```cpp
class Solution {
public:
int nthUglyNumber(int n) {
int a = 0, b = 0, c = 0;
int res[n];
res[0] = 1;
for(int i = 1; i < n; i++) {
int n2 = res[a] * 2, n3 = res[b] * 3, n5 = res[c] * 5;
res[i] = min(min(n2, n3), n5);
if (res[i] == n2) a++;
if (res[i] == n3) b++;
if (res[i] == n5) c++;
}
return res[n - 1];
}
};
```
]),
),
gain:none,
) |
|
https://github.com/f14-bertolotti/bedlam | https://raw.githubusercontent.com/f14-bertolotti/bedlam/main/src/main.typ | typst | #import "theme.typ": template
#show: template
#include "notation/main.typ"
#include "set-theory/main.typ"
#include "abstract-algebra/main.typ"
#include "topology/main.typ"
#include "measure-theory/main.typ"
#include "probability-theory/main.typ"
#include "optimal-transport/main.typ"
|
|
https://github.com/0x6e66/hbrs-typst | https://raw.githubusercontent.com/0x6e66/hbrs-typst/main/modules_de/00_introduction.typ | typst | #import "../template/template.typ": *
= Einleitung
#lorem(600)
== Sub-Einleitung
#lorem(20)
#figure(
table(
columns: 4,
[t], [1], [2], [3],
[y], [0.3s], [0.4s], [0.8s],
),
kind: "tab",
supplement: "Tabelle",
caption: [Timing results],
) <tab1>
in @tab1 kann man sehen, dass
#lorem(20)
=== Sub-Sub-Einleitung
#lorem(20)
@Wellens2010 @Yoshida1999 @Walke2001 #lorem(2) @Walke2000 @Burns2003
#lorem(20)
#acro("API")
#lorem(20)
#acro("API")
#lorem(20)
#acro("IOCCC")
#lorem(20)
#acro("IOCCC")
==== asdf
#lorem(20)
#figure(
image("../img/hbrs_logo.png"),
caption: [HBRS logo],
kind: "fig",
supplement: "Abbildung"
) <abb1>
===== asdf
#lorem(20)
#figure(
```rust
fn handle_connection(mut stream: TcpStream) {
// --snip--
let (status_line, filename) = if request_line == "GET / HTTP/1.1" {
("HTTP/1.1 200 OK", "hello.html")
} else {
("HTTP/1.1 404 NOT FOUND", "404.html")
};
let contents = fs::read_to_string(filename).unwrap();
let length = contents.len();
let response =
format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}");
stream.write_all(response.as_bytes()).unwrap();
}
```,
caption: [Code Ausschnitt],
kind: "lst",
supplement: "Listing",
outlined: true,
) <lst1>
#lorem(20)
in @lst1 kann man sehen, dass
|
|
https://github.com/maucejo/presentation_polylux | https://raw.githubusercontent.com/maucejo/presentation_polylux/main/src/_config.typ | typst | MIT License | #let config = (
weight: "regular", // Font weight
text-size: 20pt, // Text size
box-text-size: 0.8em, // Box text size
logo-height: 22%, // Logo height
)
// Colors
#let colors = (
red: rgb("#c1002a"),
gray: rgb("#405a68"),
green: rgb(31, 136, 61),
blue: rgb(9, 105, 218),
purple: rgb(130, 80, 223),
)
// State variables
#let states = (
title: state("title", []), // Title
stitle: state("stitle", []), // Short title
author: state("author", []), // Author
labo: state("academic-program", []),
mlogo: state("mlogo", []), // Main logo
flogo: state("flogo", []), // Footer logo
sec-count: counter("sec-count"), // Section counter
app-count: counter("app-count"), // Appendix counter
localization: state("localization", []),
) |
https://github.com/maxgraw/bachelor | https://raw.githubusercontent.com/maxgraw/bachelor/main/apps/document/src/2-theory/0-index.typ | typst | Dieses Kapitel bietet eine Übersicht über die theoretischen Grundlagen, die für das Verständnis der Arbeit benötigt werden. Dabei werden Begriffe und Technologien vorgestellt, die für die Entwicklung einer Augmented Reality-Anwendung auf Basis von WebXR relevant sind.
== Augmented Reality <augmented-reality-chapter>
#include "ar.typ"
== Progressive Enhancement <progressive-enhancement-chapter>
#include "progressive.typ"
== WebXR Device API <webxr-chapter>
#include "webxr.typ"
== WebXR Hit Test Module
#include "webxr-hit-test.typ"
== WebXR Lighting Estimation <webxr-lighting-chapter>
#include "webxr-lighting-estimation.typ"
== WebGL <webgl-chapter>
#include "webgl.typ"
== Web Components <web-components-chapter>
#include "web-component.typ" |
|
https://github.com/jxpeng98/Typst-CV-Resume | https://raw.githubusercontent.com/jxpeng98/Typst-CV-Resume/main/example_double.typ | typst | MIT License | #import "@local/modernpro-cv:1.0.0": *
#import "@preview/fontawesome:0.5.0": *
#show: cv-double(
font-type: "PT Sans",
continue-header: "true",
name: [#lorem(2)],
address: [#lorem(4)],
lastupdated: "true",
pagecount: "true",
date: "2024-07-03",
contacts: (
(text: [#fa-icon("location-dot") UK]),
(text: [#fa-icon("mobile") 123-456-789], link: "tel:123-456-789"),
(text: [#fa-icon("link") example.com], link: "https://www.example.com"),
),
left: [
#section[about]
#descript[#lorem(50)]
#sectionsep
#section("Skills")
#oneline-title-item(
title: "Programming Languages",
content: [Python, C++, Java, JavaScript, HTML, CSS, SQL, LaTeX],
)
#oneline-title-item(
title: "Frameworks",
content: [React, Node.js, Express, Flask, Django, Bootstrap, jQuery],
)
#oneline-title-item(
title: "Tools",
content: [Git, GitHub, Docker, AWS, Heroku, MongoDB, MySQL, PostgreSQL, Redis, Linux],
)
// Award
#section("Awards")
#award(award: "Scholarship", date: "2018", institution: "University")
#award(award: "Prize", date: "2018", institution: "University")
#sectionsep
],
right: [
#section("Education")
#education(
institution: [#lorem(4)],
major: [#lorem(2)],
date: "xxxx-xxxx",
location: "UK",
description: [
- #lorem(10),
- #lorem(10),
- #lorem(10),
],
)
#education(
institution: [#lorem(4)],
major: [#lorem(2)],
date: "xxxx-xxxx",
location: "UK",
)
//Experience
#section("Experience")
#job(
position: "Software Engineer",
institution: [#lorem(4)],
location: "UK",
date: "xxxx-xxxx",
description: [
- #lorem(10),
- #lorem(10),
- #lorem(10),
],
)
#subsectionsep
#job(
position: "Software Engineer",
institution: [#lorem(4)],
location: "UK",
date: "xxxx-xxxx",
)
#sectionsep
// Projects
#section("Projects")
#twoline-item(
entry1: "Project 1",
entry2: "Jan 2023",
entry3: "https://www.example.com",
entry4: "UK",
description: [
- #lorem(20)
- #lorem(10)
],
)
#subsectionsep
#twoline-item(
entry1: "Project 2",
entry2: "Jan 2023",
description: [#lorem(40) \ ],
)
#sectionsep
// Publication
#section("Publications")
+ @singh1981asymptotic
+ @singh1981asymptotic
#sectionsep
// Reference
#section("References")
#references(references: (
(
name: "Dr. <NAME>",
position: "Professor",
department: "Computer Science",
institution: "University",
address: "123 Street, City, Country",
email: "<EMAIL>",
),
(
name: "Dr. <NAME>",
department: "Computer Science",
institution: "University",
address: "123 Street, City, Country",
email: "<EMAIL>",
),
(
name: "Dr. <NAME>",
position: "Professor",
department: "Computer Science",
institution: "University",
address: "123 Street, City, Country",
email: "<EMAIL>",
),
))
// Keep this at the end
#show bibliography: none
#bibliography("bib.bib", style: "chicago-author-date")
],
)
|
https://github.com/gvariable/billryan-typst | https://raw.githubusercontent.com/gvariable/billryan-typst/master/demo.typ | typst | #import "template.typ": *
#show: doc => conf(
// Your personal photo.
photo: "SpongeBob SquarePants.png",
// Your name.
name: "gvariable",
// Information regarding your social media accounts.
// The "display" parameter is required, whereas the "link" parameter is optional.
medias: (
(name: "github.svg", link: "https://github.com/gvariable", display: "github/gvariable"),
(name: "envelope.svg", link: "<EMAIL>", display: "<EMAIL>"),
(name: "square-phone.svg", display: "(+86)130-1111-4514"),
(name: "linkedin.svg", link: "http://linkedin.cn/", display: "linkedin/gvariable"),
),
// The skills you possess.
talents: (
("Python", 0.66),
("Rust", 0.73),
("C++", 0.85),
("Linux", 0.43),
),
// Job interests tags.
tagline: [
_Software engineering, Operating system, Compiler, Software testing and debugging._
],
// main body
body: doc
)
// --------------------------- MAIN DOC BODY HERE --------------------------- //
== #icon("graduation-cap.svg") EDUCATION
/ Huazhong University of Science and Technology\: : Undergraduate student. #term("2019 - 2023", "Wuhan,China")
/ Nan Jing University\: : Ph.D. student. #term("2024- who knows", "Nanjing,China")
#lorem(10)
#lorem(15)
== #icon("users.svg") EXPERIENCE
/ Intel Inc.: Software engineer #box(width: 1fr)[#align(right)[#date("2022 - 2023")]]
_Intern_ | Manager: <NAME> \
Brief Introduction: #lorem(30)
- Implemented #lorem(10)
- Optimized #lorem(15)
- #lorem(10)
- #lorem(40)
/ xxx Project.: Software testing and debuging #box(width: 1fr)[#align(right)[#date("2022 - 2023")]]
_C, Python, Rust_ | Individual Projects. \
Brief Introduction: #lorem(30)
- Implemented #lorem(10)
- Optimized #lorem(15)
- #lorem(20)
== #icon("award.svg") HONORS AND AWARDS
- _1#super[st] Prize_, Award on xxx #box(height: 1em, width: 1fr)[#align(right)[#location("London,UK")]]
- _National Scholarship_ in 2019
- More awards
== #icon("info.svg") MISCELLANEOUS
#lorem(50)
#lorem(30)
|
|
https://github.com/UntimelyCreation/typst-neat-cv | https://raw.githubusercontent.com/UntimelyCreation/typst-neat-cv/main/src/letter.typ | typst | MIT License | #import "template.typ": *
#show: layout
#set text(size: 12pt)
#set page(
paper: "a4",
margin: (
left: 1.2cm,
right: 1.2cm,
top: 1.2cm,
bottom: 1.2cm,
),
)
#letterHeader(
myAddress: [12 Cours Maréchal-Joffre \ 75003 Paris, France],
recipientName: [ABC Company],
recipientAddress: [32 Rue Michel Ange \ 75011 Paris, France],
date: [November 1, 2023],
subject: "Subject: Job Application for Senior Software Engineer"
)
Dear Hiring Manager,
#lorem(200)
Thank you for considering my application. I look forward to the opportunity to discuss my qualifications further.
Sincerely,
#letterSignature("/images/signature.png")
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/physica/0.7.5/README.md | markdown | Apache License 2.0 | # The physica module (for physics)
Current semantic version: `0.7`. [Manual](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf).
Available at [https://typst.app/docs/packages/](https://typst.app/docs/packages/).
This [Typst](https://typst.app) package provides handy typesetting utilities for
physics, including:
* Braces,
* Vectors and vector fields,
* Matrices,
* Dirac braket notations,
* Common math functions,
* Differentials and derivatives, including partial derivatives of mixed orders with automatic order summation,
* Familiar "h-bar", tensor abstract index notations, isotopes,
* Signal sequences i.e. digital timing diagrams.
:warning: [Typst](https://typst.app) is in beta and evolving, and this package
evolves with it. As a result, no backward compatibility is guaranteed yet.
:information_source: In response to the official Typst package [guideline](https://github.com/typst/packages/tree/main#submission-guidelines)
"Package names should not be merely descriptive to create level grounds for
everybody", this package was renamed from `physics` to `physica`.
## A quick look
See the [manual](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf) for more details.

## Using phyiscs in your Typst document
### With `typst` package management (recommended)
See https://github.com/typst/packages.
```
#import "@preview/physica:0.7.5": *
$op("curl")(op("grad") f) = curl (grad f)$
```
### Without `typst` package management
* To use the `physics` package, simply insert `#import "physics.typ": *` at the
beginning of your document.
* To reduce the possibility of name collisions, you may want to import the
package under name scope `physics`:
```
#import "physics.typ"
$op("curl")(op("grad") f) = physics.curl (physics.grad f)$
```
* You may also import names specifically:
```
#import "physics.typ": curl, grad
$op("curl")(op("grad") f) = curl (grad f)$
```
## Manual
See the manual [physics-manual.pdf](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf) for a more comprehensive coverage, a PDF file
generated directly with the [Typst](https://typst.app) binary.
CLI Version:
```sh
$ typst --version
typst 0.6.0 (2dfd44fe)
```
To regenerate the manual, use command
```sh
typst watch physics-manual.typ
```
## Contribution
* Bug fixes are welcome!
* New features: welcome as well. If it is small, feel free to create a pull
request. If it is large, the best first step is creating an issue and let us
explore the design together. Some features might warrant a package on its own.
* Testing: currently testing is done by closely inspecting the generated
[physics-manual.pdf](physics-manual.pdf). This does not scale well. I plan to add programmatic
testing by comparing rendered pictures with golden images.
## License
* Code: the [MIT License](LICENSE.txt).
* Docs: the [Creative Commons BY-ND 4.0 license](https://creativecommons.org/licenses/by-nd/4.0/).
|
https://github.com/DaAlbrecht/lecture-notes | https://raw.githubusercontent.com/DaAlbrecht/lecture-notes/main/computer_networks/computer_networks.typ | typst | MIT License | #import "../template.typ": *
#show: project.with(title: "Computer Networks", header:"Computer Networks")
#include "./network_topology.typ"
#pagebreak()
#include "./protocols_protocol_layers.typ"
#pagebreak()
#include "./network_layer.typ"
#pagebreak()
#include "./ipv4.typ"
#pagebreak()
#include "./ip_protocols.typ"
#pagebreak()
#include "./ipv6.typ"
#pagebreak()
#include "./routing.typ"
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/def_use/import_ident_alias.typ | typst | Apache License 2.0 | #import "base.typ"
#base
#import "base.typ": x as foo
#base, #foo |
https://github.com/tony-rsa/thonifho.muhali.cv | https://raw.githubusercontent.com/tony-rsa/thonifho.muhali.cv/main/README.md | markdown | MIT License | ## :shamrock: **cv**
[![CD][cd-shield]][cd-url]
[![EN][en-shield]][en-url]
[![RU][ru-shield]][ru-url]
[![License][license-shield]][license-url]
### My Typst CV template available in multiple languages.
<!-- MARKDOWN LINKS -->
[cd-shield]: https://img.shields.io/github/actions/workflow/status/tensorush/cv/cd.yaml?branch=main&style=for-the-badge&logo=github&label=CD&labelColor=black
[cd-url]: https://github.com/tensorush/cv/blob/main/.github/workflows/cd.yaml
[en-shield]: https://img.shields.io/badge/click-009E60?style=for-the-badge&logo=read.cv&label=en&labelColor=black
[en-url]: https://tensorush.github.io/cv/en.pdf
[ru-shield]: https://img.shields.io/badge/click-009E60?style=for-the-badge&logo=read.cv&label=ru&labelColor=black
[ru-url]: https://tensorush.github.io/cv/ru.pdf
[license-shield]: https://img.shields.io/github/license/tensorush/cv.svg?style=for-the-badge&labelColor=black
[license-url]: https://github.com/tensorush/cv/blob/main/LICENSE.md
|
https://github.com/wznmickey/JI_Lab_Report_typst_template | https://raw.githubusercontent.com/wznmickey/JI_Lab_Report_typst_template/main/report.typ | typst | #import "conf.typ": conf
#show : doc => conf(
lab-number: 0,
title: [Measurement of the Acceleration Due to Gravity],
name: [<NAME>],
studentID: 12345678,
doc,
)
= Introduction
<introduction>
#set text(fill: blue);
This part should include a brief description of the experiment: its objectives, underlying physical model and phenomena, and equations that you will use in your calculations. It may be a bit longer than that below, but you should not simply copy the lab manual or quote long passages from textbooks.
#set text(fill: black);
The objective of the experiment was to find the value of the acceleration due to gravity, based on measurements of the period of a simple physical pendulum and the dependence of the period on the length of the pendulum.
A simple pendulum consists of a point mass m suspended on a mass less in extensible thread with length l, placed in a uniform gravitational field characterized by acceleration g. If a simple pendulum is displaced from the equilibrium position by a small angle $alpha$, it may be approximately treated as a harmonic oscillator, and the solution of its equation motion is a periodic function of time (cosine) with the period.
#math.equation[
$ T eq 2 pi sqrt(l / g) $] Hence, by measuring the period T and the
length of l a pendulum it is possible to find the value of the
acceleration due to gravity as
#math.equation[$ g eq frac(4 pi^2 l, T^2) $]
= Experimental setup
<experimental-setup>
#text(
fill: blue,
"A sketch and a description of the measurement setup should be simple, understandable and — first of all — conform to the setup used in the experiment. The information about measurement instruments used (type, class, measurement range, precision, etc.) should be given here.",
)
The pendulum used in the experiment is a metal ball attached to a fine
light thread of adjustable length. The thread is suspended on a solid
bar attached to the wall. The measurement system consists of an
optoelectronic sensor OS connected to a digital timer MCR–21. The
diagram of the experimental setup is presented in @img_setup.
#figure(
placement: auto,
image("setup.png"),
caption: [
Experimental setup.
],
)
<img_setup>
The optoelectronic sensor generates an impulse each time the thread
passes through the gate of the sensor. The timer is a digital device
allowing measurements with maximum uncertainty of $0.01 s$. It starts
the measurement after the first impulse from the sensor, skips the next
impulse, and ends the measurement when the third impulse arrives, thus
measuring the time of one period of oscillations.
The length of the pendulum was determined by using a measurement tape
with maximum uncertainty $1 m m$. However, the precision of this
measurement was smaller. This is because the distance from the point the
thread was attached to the ball and the ball’s center could only be
determined approximately. Therefore the maximum uncertainty of the
thread length measurement has been estimated at $5 m m$.
The length of the thread can be adjusted
= Measurements
<measurements>
#text(
fill: blue,
"This part should describe the measurement procedure (it can be also merged with the previous section into a single section). This is also the section, where any comments/observations regarding the measurements should be made. These include, but are not limited to: abnormal functioning of measurement devices, instability of readings, etc.
",
)
== Measurements of the period of oscillations
<sec_measurement>
The position of the sensor was adjusted so that the pendulum placed out
of the equilibrium was able to trigger a signal. After the digital timer
was reset, the pendulum was displaced from the equilibrium position and
released. The reading on the timer was recorded. The above measurement
of the period of 3 oscillations was repeated ten times and the obtained
data is presented in @tb_measurement.
Then, the length of the thread was measured by measuring the distance
between the suspension point and the center of the ball. Because of the
fact that the position of the ball’s center was determined only
approximately, the uncertainty of this measurement is much larger than
the maximum uncertainty of the measurement tape.
The period of oscillations was measured for different lengths of the
pendulum \(cf. @tb_measurement\).
#figure(
caption: [ Data for the dependence of the oscillation period on the length of the pendulum.],
table(
stroke: none,
[$M e a s u r e m e n t$],
table.vline(start: 0),
[$l lr([m]) plus.minus 0.005 lr([m])$],
table.vline(start: 0),
[$T lr([s]) plus.minus 0.01 lr([s])$],
table.vline(start: 0),
[$T^2 lr([s^2])$],
table.vline(start: 0),
[$mu_T^2 lr([s^2])$],
table.hline(start: 0),
[1], [0.500], [1.38], [1.90], [0.03],
[2], [0.700], [1.68], [2.82], [0.03],
)
)<tb_measurement>
== Relation between the period of oscillations and the pendulum length
<relation-between-the-period-of-oscillations-and-the-pendulum-length>
The measurements of the period of oscillations were analogous to those
in the previous section. For each length of the thread one measurement
of the period was performed. The length of the thread was increased from
0.5 to 2.1 m in steps of 0.2 m. The results of the measurements are
presented in Table 2 \(columns 1 through 3).
= Results
<results>
#text(
fill: blue,
"In this section the results of your measurements should be presented. Usually tables and graphs are the best ways to present the results. The values of all physical quantities (both: measured and calculated based on the measurements) must be expressed using the appropriate SI units. This section should also include calculations with all intermediate steps (in case of repeated calculations, one sample calculation is enough). If any values are calculated by data analysis software (e.g. Origin, QtiPlot, R), it should be clearly indicated.",
)
== Measurements of the period of oscillations
<measurements-of-the-period-of-oscillations>
The period of oscillations was measured in the procedure described in
@sec_measurement and the average value was
calculated based on the results presented in @tb_measurement
as
$ T^(‾) eq 1 / 10 sum_(i eq 1)^10 T_i eq 2.21 plus.minus 0.02 s $
Using the value of the slope from the linear in the relation \(3), the
acceleration due to gravity can be found as
$ g eq frac(4 pi^2, alpha) eq frac(4 dot.op 3.14159^2, 4.00) eq 9.88 plus.minus 0.11 m slash s^2 $
#figure(
[#box(width: 355.46853146853147pt, image("image.png"))],
caption: [
Measurement data \(dots) with error bars \(red for $l$, blue for
$T^2$) and a linear fit to the data \(solid line) for the relation
between the period of oscillations squared and the pendulum’s
length. The value of $R^2$ for the obtained fit is 0.999.
],
)
== Relation between the period of oscillations and the pendulum length
<relation-between-the-period-of-oscillations-and-the-pendulum-length-1>
= Conclusions and discussion
<conclusions-and-discussion>
In the experiment the acceleration due to gravity was found first by
measuring the period of oscillations for a fixed length of the pendulum,
and then by measuring the period for different lengths and finding the
acceleration due to gravity from the slope of the $T^2$ vs. $l$ line.
The two methods yielded the values
$ g eq 9.82 plus.minus 0.08 m slash s #text("and") g eq 9.88 plus.minus 0.11 m slash s #text(",") $
respectively, with the former method yielding the result with slightly
smaller uncertainty. Both values conform \(within the uncertainty range)
to the value $9.81 plus.minus 0.07 m slash s 2$ quoted for Happy Town in
the paper <NAME>, Journal of Experimental Physics, 18 1234 \(2001).
The fundamental source of inaccuracy of both methods is the fact that
the formula for the period of oscillations \(1) is valid only under the
assumption that the motion is harmonic, what in the case of a simple
pendulum is only approximately valid for small angles. In general, for a
simple pendulum, the period depends on the amplitude, and for different
angular displacements from the equilibrium position, the measured values
of the period differ.
The other factors that have been neglected in the model yielding the
formula \(1) include: the fact that the thread is not perfectly in
extensible; viscous air and other dissipative forces dampen the
pendulum’s motion; non-inertiality of the earth \(the latter, however,
being a small effect that can usually be safely neglected).
The precision of the measurements, can be further increased by
redesigning the measurement of the pendulum’s length. The uncertainty of
this measurement, which is greater than the resolution of the
measurement tape, is mainly due to the fact that the distance to the
center of the ball cannot be measured accurately. Instead of measuring
the total distance between the suspension point and the center of the
ball by a measurement tape, the radius of the ball may be measured
separately \(e.g. in a calliper measurement).
#pagebreak()
#counter(heading).update(0)
#heading(numbering: "A ", "Datasheet")
<datasheet>
#text(fill: blue, "
Please remember to attach the original data sheet signed by your instructor.")
|
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/scripting/closure.typ | typst | // Test closures.
--- closure-without-params-non-atomic ---
// Don't parse closure directly in content.
#let x = "x"
// Should output `x => y`.
#x => y
--- closure-without-captures ---
// Basic closure without captures.
#{
let adder = (x, y) => x + y
test(adder(2, 3), 5)
}
--- closure-as-arg ---
// Pass closure as argument and return closure.
// Also uses shorthand syntax for a single argument.
#{
let chain = (f, g) => (x) => f(g(x))
let f = x => x + 1
let g = x => 2 * x
let h = chain(f, g)
test(h(2), 5)
}
--- closure-capture-from-popped-stack-frame ---
// Capture environment.
#{
let mark = "!"
let greet = {
let hi = "Hi"
name => {
hi + ", " + name + mark
}
}
test(greet("Typst"), "Hi, Typst!")
// Changing the captured variable after the closure definition has no effect.
mark = "?"
test(greet("Typst"), "Hi, Typst!")
}
--- closure-shadows-outer-var ---
// Redefined variable.
#{
let x = 1
let f() = {
let x = x + 2
x
}
test(f(), 3)
}
--- closure-shadows-outer-var-import ---
// Import bindings.
#{
let b = "module.typ"
let f() = {
import b: b
b
}
test(f(), 1)
}
--- closure-shadows-outer-var-for-loop ---
// For loop bindings.
#{
let v = (1, 2, 3)
let f() = {
let s = 0
for v in v { s += v }
s
}
test(f(), 6)
}
--- closure-let-basic ---
// Let + closure bindings.
#{
let g = "hi"
let f() = {
let g() = "bye"
g()
}
test(f(), "bye")
}
--- closure-let-args ---
// Parameter bindings.
#{
let x = 5
let g() = {
let f(x, y: x) = x + y
f
}
test(g()(8), 13)
}
--- closure-bad-capture ---
// Don't leak environment.
#{
// Error: 16-17 unknown variable: x
let func() = x
let x = "hi"
func()
}
--- closure-missing-arg-positional ---
// Too few arguments.
#{
let types(x, y) = "[" + str(type(x)) + ", " + str(type(y)) + "]"
test(types(14%, 12pt), "[ratio, length]")
// Error: 8-21 missing argument: y
test(types("nope"), "[string, none]")
}
--- closure-too-many-args-positional ---
// Too many arguments.
#{
let f(x) = x + 1
// Error: 8-13 unexpected argument
f(1, "two", () => x)
}
--- closure-capture-in-lvalue ---
// Mutable method with capture in argument.
#let x = "b"
#let f() = {
let a = (b: 5)
a.at(x) = 10
a
}
#f()
--- closure-capture-mutate ---
#let x = ()
#let f() = {
// Error: 3-4 variables from outside the function are read-only and cannot be modified
x.at(1) = 2
}
#f()
--- closure-named-args-basic ---
// Named arguments.
#{
let greet(name, birthday: false) = {
if birthday { "Happy Birthday, " } else { "Hey, " } + name + "!"
}
test(greet("Typst"), "Hey, Typst!")
test(greet("Typst", birthday: true), "Happy Birthday, Typst!")
// Error: 23-35 unexpected argument: whatever
test(greet("Typst", whatever: 10))
}
--- closure-args-sink ---
// Parameter unpacking.
#let f((a, b), ..c) = (a, b, c)
#test(f((1, 2), 3, 4), (1, 2, (3, 4)))
#let f((k: a, b), c: 3, (d,)) = (a, b, c, d)
#test(f((k: 1, b: 2), (4,)), (1, 2, 3, 4))
// Error: 8-14 expected identifier, found destructuring pattern
#let f((a, b): 0) = none
// Error: 10-19 expected pattern, found array
#let f(..(a, b: c)) = none
// Error: 10-16 expected pattern, found array
#let f(..(a, b)) = none
--- closure-param-duplicate-positional ---
// Error: 11-12 duplicate parameter: x
#let f(x, x) = none
--- closure-body-multiple-expressions ---
// Error: 21 expected comma
// Error: 22-23 expected pattern, found integer
// Error: 24-25 unexpected plus
// Error: 26-27 expected pattern, found integer
#let f = (x: () => 1 2 + 3) => 4
--- closure-param-duplicate-mixed ---
// Error: 14-15 duplicate parameter: a
// Error: 23-24 duplicate parameter: b
// Error: 35-36 duplicate parameter: b
#let f(a, b, a: none, b: none, c, b) = none
--- closure-param-duplicate-spread ---
// Error: 13-14 duplicate parameter: a
#let f(a, ..a) = none
--- closure-pattern-bad-string ---
// Error: 7-14 expected pattern, found string
#((a, "named": b) => none)
--- closure-let-pattern-bad-string ---
// Error: 10-15 expected pattern, found string
#let foo("key": b) = key
--- closure-param-keyword ---
// Error: 10-14 expected pattern, found `none`
// Hint: 10-14 keyword `none` is not allowed as an identifier; try `none_` instead
#let foo(none: b) = key
--- closure-param-named-underscore ---
// Error: 10-11 expected identifier, found underscore
#let foo(_: 3) = none
--- issue-non-atomic-closure ---
// Ensure that we can't have non-atomic closures.
#let x = 1
#let c = [#(x) => (1, 2)]
#test(c.children.last(), [(1, 2)]))
|
|
https://github.com/MilanR312/ugent_typst_template | https://raw.githubusercontent.com/MilanR312/ugent_typst_template/main/template/prelude.typ | typst | MIT License | //helpfull file to include all needed methods
#import "methods/glos.typ": gls, glspl
#import "methods/introduction.typ": introduction
#import "methods/todo.typ": todo
#import "methods/table_notes.typ": note
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/foundations-04.typ | typst | Other | // Test panic.
// Error: 7-24 panicked with: "this is wrong"
#panic("this is wrong")
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/minerva-report-fcfm/0.1.0/README.md | markdown | Apache License 2.0 | # Minerva Report FCFM
Template para hacer tareas, informes y trabajos. Pensado para ser familiar para estudiantes y académicos de la Facultad de Ciencias Físicas y Matemáticas de la Universidad de Chile que han usado templates similares para LaTeX.
## Guía Rápida
### [Webapp](https://typst.app)
Si utilizas la webapp de Typst puedes presionar "Start from template" y buscar "minerva-report-fcfm" para crear un nuevo proyecto con este template.
### Typst CLI
Teniendo el CLI con la versión 0.11.0 o mayor, puedes realizar:
```sh
typst init @preview/minerva-report-fcfm:0.1.0
```
Esto va a descargar el template en la cache de typst y luego va a iniciar el proyecto en la carpeta actual.
## Configuración
La mayoría de la configuración se realiza a través del archivo `meta.typ`,
allí podrás elegir un título, indicar los autores, el equipo docente, entre otras configuraciones.
Todos los campos menos `autores` pueden recibir tanto strings `"string"` o directamente un bloque de contenido `[Contenido #emoji.smile]`.
La configuración `departamento` puede ser personalizada a cualquier organización pasandole un diccionario de esta forma:
```typ
#let departamento = (
nombre: (
"Pontificia Universidad Católica de Chile",
"Facultad de Derecho",
)
)
```
### Configuración Avanzada
Algunos aspectos más avanzados pueden ser configurados a través de la show rule que inicializa el documento `#show: minerva.report.with( ... )`, los parámetros opcionales que recibe la función `report` son los siguientes:
| nombre | tipo | descrición |
|-----------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| portada | (meta) => content | Una función que recibe el diccionario `meta.typ` y retorna una página. |
| header | (meta) => content | Header a aplicarse a cada página. |
| footer | (meta) => content | Footer a aplciarse a cada página. |
| showrules | bool | El template aplica ciertas show-rules para que sea más fácil de utilizar. Si quires más personalización, es probable que necesites desactivarlas y luego solo utilizar las que necesites. |
# Changelog
# v0.1.0
- Primera versión
|
https://github.com/0warning0error/typst-yats | https://raw.githubusercontent.com/0warning0error/typst-yats/main/yats.typ | typst | Apache License 2.0 | // the format of the data transfer
// the structure
// |--type(1 byte)--|--payload--|--EOF--|
// EOF : 0x00
// type :
// 0x01 - none
// 0x02 - bool
// 0x03 - type
// 0x04 - int64
// 0x05 - float64
// 0x06 - duration
// 0x07 - datetime
// 0x08 - bytes
// 0x09 - string
// 0x0A - regex
// 0x0B - array
// 0x0C - dict
// (extended type, not necessarily implemented):
// 0x0D - label
// 0x0E - selector
// 0x0F - color
// 0x10 - reserved for future type 1
// 0x11 - reserved for future type 2
// ...
// -----------------------------------
// in payload
// none : |--data(0 bytes)--|
// type : |--type_id(1 byte,same as previous type code)--|
// bool : |--data(1 byte)--|
// 0x00 for false, 0x01 for true
// int64 : |--data(8 bytes)--|
// datetime :|--year(4 bytes)--|--month(1 byte)--|--day(1 byte)--|
// |--hour(1 byte)--|--minute(1 byte)--|--second(1 byte)--|
// duration :|--seconds(8 bytes)--|--minutes(8 bytes)--|
// |--hours(8 bytes)--|--days(8 bytes)--|--weeks(8 bytes)--|
// bytes : |--len(8 bytes, int64)--|--data(len bytes)--|
// float64/string/label/regex : |--len(8 bytes, int64)--|--data(len bytes)--|
// array : |--len(8 bytes, int64)--|--elt1_type(1 byte)--|--elt1_payload--|...
// ...repeat for len elements...
// dict : |--len(8 bytes, int64)--|--key1_len(4 bytes, int64)--|--key1_data--|
// |--value1_type(1 byte)--|--value1_payload--|...
// ...repeat for len pairs...
// selector :|--selector_type(1 byte)--|--selector_payload--|
#let arr2int(arr, byte_order : "big",signed : true) = {
let sum = 0
arr = if byte_order != "big" {arr.rev()} else {arr}
let highest_byte = arr.at(0)
let is_negative = highest_byte >= 128
if is_negative and signed {
arr = arr.map((v)=>255-v)
arr.at(-1) += 1
sum = -sum
for elt in arr {
sum = sum * 256 - elt
}
sum
}
else{
for elt in arr {
sum = sum * 256 + elt
}
sum
}
}
#let div_remainder(dividend, divisor) = {
let quotient = int(dividend / divisor)
let remainder = dividend - (quotient * divisor)
return remainder
}
#let pow2f(i) = {
let result = 1
if i < 0{
for j in range(0,-i) {
result = result * 2.0
}
result = 1 / result
}else{
for j in range(0,i) {
result = result * 2.0
}
}
result
}
#let arr2float(arr, byte_order : "big") = {
let is_negative = false
arr = if byte_order != "big" {arr.rev()} else {arr}
let highest_byte = arr.at(0)
is_negative = highest_byte >= 128
let exponent = calc.rem-euclid(highest_byte,128) * 16 + calc.div-euclid(arr.at(1) , 16)
let new_slice = arr.slice(1)
new_slice.at(0) = calc.rem-euclid(highest_byte,16)
let mantissa = arr2int(new_slice,signed : false)
if is_negative {-mantissa * calc.pow(2.0, exponent - 1024 - 51) - calc.pow(2.0, exponent - 1024) } else {mantissa * calc.pow(2.0, exponent - 1024 - 51) + calc.pow(2.0, exponent - 1024)}
}
#let type_res = (none,
true,
int,
1,
1.0,
datetime(year:2000,month:3,day:3),
duration(),
bytes("t"),
"",
regex(""),
(),
(:)
).map(type)
#let deserialize(data) = {
let _deserialize(data) = {
let deserialize_none(data) = {
assert(data.at(0) == 0x01, message: "error when parsing none")
(none,1)
}
let deserialize_bool(data) = {
assert(data.at(0) == 0x02, message: "error when parsing bool")
(data.at(1) != 0,2)
}
let deserialize_int(data) = {
assert(data.at(0) == 0x04, message: "error when parsing int")
(arr2int(array(data.slice(1, count:8))), 9)
}
let deserialize_type(data) = {
assert(data.at(0) == 0x03, message: "error when parsing type")
let typecode = data.at(1)
(type_res.at(typecode - 1),2)
}
let _deserialize_bytes_without_typecode(data) = {
let data_len = arr2int(array(data.slice(0,count:8)))
(data.slice(8,count:data_len),8 + data_len)
}
let _deserialize_bytes(data) = {
let data_len = arr2int(array(data.slice(1,count:8)))
(bytes(data.slice(9,count:data_len)),9 + data_len)
}
let deserialize_bytes(data) = {
assert(data.at(0) == 0x8,message: "error when parsing bytes")
_deserialize_bytes(data)
}
let bytes2str(data) = {
assert(data.at(0) in (0x05,0x09,0x0A), message: "type is not string")
let bytes_r = _deserialize_bytes(data)
bytes_r.at(0) = str(bytes(bytes_r.at(0)))
bytes_r
}
let deserialize_float(data) = {
assert(data.at(0) == 0x05, message: "error when parsing float")
let bytes_r = _deserialize_bytes(data)
bytes_r.at(0) = float(str(bytes(bytes_r.at(0))))
bytes_r
}
let deserialize_duration(data) = {
assert(data.at(0) == 0x6,message: "error when parsing duration")
let seconds = arr2int(array(data.slice(1,count:8)))
let minutes = arr2int(array(data.slice(9,count:8)))
let hours = arr2int(array(data.slice(17,count:8)))
let days = arr2int(array(data.slice(25,count:8)))
let weeks = arr2int(array(data.slice(33,count:8)))
(duration(seconds: seconds,
minutes:minutes,
hours:hours,
days:days,
weeks:weeks),41)
}
let deserialize_datetime(data) = {
assert(data.at(0) == 0x7,message: "error when parsing datetime")
let datetime_type = data.at(1)
if datetime_type == 0x1{
let year = arr2int(array(data.slice(2,count:8)))
let month = arr2int(array(data.slice(10,count:8)))
let day = arr2int(array(data.slice(18,count:8)))
(datetime(year: year,month : month,day :day),26)
}
else if datetime_type == 0x2{
let hour = arr2int(array(data.slice(2,count:8)))
let minute = arr2int(array(data.slice(10,count:8)))
let second = arr2int(array(data.slice(18,count:8)))
(datetime(hour: hour,minute : minute,second :second),26)
}
else if datetime_type == 0x3{
let year = arr2int(array(data.slice(2,count:8)))
let month = arr2int(array(data.slice(10,count:8)))
let day = arr2int(array(data.slice(18,count:8)))
let hour = arr2int(array(data.slice(26,count:8)))
let minute = arr2int(array(data.slice(34,count:8)))
let second = arr2int(array(data.slice(42,count:8)))
(datetime(year: year,month : month,day :day,hour: hour,minute : minute,second :second),50)
}
else{
assert(false,message: "invalid datetime type")
}
}
let deserialize_regex(data) = {
assert(data.at(0) == 0x0A, message: "error when parsing regex")
let bytes_r = _deserialize_bytes(data)
bytes_r.at(0) = regex(str(bytes_r.at(0)))
bytes_r
}
let deserialize_array(data) = {
assert(data.at(0) == 0x0B, message: "error when parsing array")
let result_array = ()
let size = 9
let length = arr2int(array(data.slice(1,count:8)))
for i in range(length){
let new_slice = data.slice(size)
let r = _deserialize(new_slice)
result_array.push(r.at(0))
size += r.at(1)
}
(result_array,size)
}
let deserialize_dict(data) = {
assert(data.at(0) == 0x0C, message: "error when parsing dict")
let result_dict = (:)
let length = arr2int(array(data.slice(1,count:8)))
let size = 9
for i in range(length){
let new_slice = data.slice(size)
let key_r = _deserialize_bytes_without_typecode(new_slice)
let key = str(bytes(key_r.at(0)))
size += key_r.at(1)
let r = _deserialize(new_slice.slice(key_r.at(1)))
result_dict.insert(key, r.at(0))
size += r.at(1)
}
(result_dict,size)
}
let type_code = data.at(0)
let type_arr = (
(v) => {assert(false,message: "EOF parsed")},
deserialize_none,
deserialize_bool,
deserialize_type,
deserialize_int,
deserialize_float,
deserialize_duration,
deserialize_datetime,
deserialize_bytes,
bytes2str,
(data) => {
let r = bytes2str(data)
r.at(0) = regex(str(bytes(r.at(0))))
r
},
deserialize_array,
deserialize_dict,
)
type_arr.at(type_code,
default : (data)=>assert(false,message: "not a valid data")
)(data)
}
let data_ = array(data)
_deserialize(data_).at(0)
}
#let int2arr(value) = {
let arr = ()
for i in range(8) {
let byte = calc.abs(calc.rem-euclid(value, 256))
arr.push(byte)
value = calc.div-euclid(value, 256)
}
arr.rev()
}
#let _string2bytes(value) = {
int2arr(value.len()) + array(bytes(value))
}
#let string2bytes(value) = {
(0x09,) + _string2bytes(value) + (0x00,)
}
// Main serialization functions
#let serialize_none() = {
(0x01, 0x00)
}
#let serialize_type(data) = {
let result_pos = type_res.position((val)=> data == val)
result_pos = result_pos
if result_pos != none{
(0x03,calc.rem(result_pos,256) + 1,0x00)
}else{
assert(false,message: "unsupport type")
}
}
#let serialize_bool(value) = {
(0x02, int(value), 0x00)
}
#let serialize_int(value) = {
(0x04,) + int2arr(value) + (0x00,)
}
#let serialize_float(value) = {
value = str(value)
(0x05,) + _string2bytes(value) + (0x00,)
}
#let serialize_datetime(dt) = {
let d = eval(repr(dt).slice(8))
let datetime_type = 0
let result = ()
if d.at("day",default:none) != none{
datetime_type += 1
result += int2arr(d.at("year"))
result += int2arr(d.at("month"))
result += int2arr(d.at("day"))
}
if d.at("second",default:none) != none{
datetime_type += 2
result += int2arr(d.at("hour"))
result += int2arr(d.at("minute"))
result += int2arr(d.at("second"))
}
assert(datetime_type != 0,message: "datetime not valid")
(0x07, calc.rem(datetime_type,256)) +result+(0x00,)
}
#let serialize_duration(dur) = {
// this code is too tricky
let seconds = dur.seconds()
let d = eval(repr(dur).slice(8))
if seconds == 0{
d = (:)
}
let middle = (d.at("seconds",default:0),
d.at("minutes",default:0),
d.at("hours",default:0),
d.at("days",default:0),
d.at("weeks",default:0)).map(int2arr).join()
(0x06,) + middle + (0x00,)
}
#let serialize_bytes(bytes) = {
(0x08,) + _string2bytes(bytes) + (0x00,)
}
#let serialize_string(value) = {
(0x09,) + _string2bytes(value) + (0x00,)
}
#let serialize_regex(reg) = {
let s = (repr(reg).match(regex("\"(.*)\"")).captures.at(0))
(0x0A,) + _string2bytes(s) + (0x00,)
}
#let serialize_array(arr) = {
let _serialize(value) = {
if type(value) == type(none) {
serialize_none()
} else if type(value) == type(true) {
serialize_bool(value)
} else if type(value) == int {
serialize_int(value)
} else if type(value) == float {
serialize_float(value)
} else if type(value) == datetime {
serialize_datetime(value)
} else if type(value) == duration {
serialize_duration(value)
} else if type(value) == bytes {
serialize_bytes(value)
} else if type(value) == type("") {
serialize_string(value)
} else if type(value) == regex {
serialize_regex(value)
} else if type(value) == array {
serialize_array(value)
} else if type(value) == dictionary {
serialize_dict(value)
} else if type(value) == type{
serialize_type(value)
}
else {
assert(false, message: "Unsupported type for serialization")
}
}
let len = arr.len()
let serialized_array = int2arr(len)
let r = (0x0B,) + serialized_array
for elt in arr {
let serialized_elt = _serialize(elt)
let _ = serialized_elt.pop()
r += serialized_elt
}
r += (0x00,)
r
}
#let serialize_dict(dict) = {
let _serialize(value) = {
if type(value) == type(none) {
serialize_none()
} else if type(value) == type(true) {
serialize_bool(value)
} else if type(value) == int {
serialize_int(value)
} else if type(value) == float {
serialize_float(value)
} else if type(value) == datetime {
serialize_datetime(value)
} else if type(value) == duration {
serialize_duration(value)
} else if type(value) == bytes {
serialize_bytes(value)
} else if type(value) == type("") {
serialize_string(value)
} else if type(value) == regex {
serialize_regex(value)
} else if type(value) == array {
serialize_array(value)
} else if type(value) == dictionary {
serialize_dict(value)
} else if type(value) == type{
serialize_type(value)
}
else {
assert(false, message: "Unsupported type for serialization")
}
}
let len = dict.len()
let serialized_dict = int2arr(len)
let r = (0x0C,) + serialized_dict
for pair in dict {
let key = pair.at(0)
let value = pair.at(1)
let serialized_key = _string2bytes(key)
let serialized_value = _serialize(value)
let _ = serialized_value.pop()
r += serialized_key + serialized_value
}
r += (0x00,)
r
}
// Main serialize function that dispatches to specific type serialization
#let serialize(value) = {
let result = if type(value) == type(none) {
serialize_none()
} else if type(value) == type(true) {
serialize_bool(value)
} else if type(value) == int {
serialize_int(value)
} else if type(value) == float {
serialize_float(value)
} else if type(value) == datetime {
serialize_datetime(value)
} else if type(value) == duration {
serialize_duration(value)
} else if type(value) == bytes {
serialize_bytes(value)
} else if type(value) == type("") {
serialize_string(value)
} else if type(value) == regex {
serialize_regex(value)
} else if type(value) == array {
serialize_array(value)
} else if type(value) == dictionary {
serialize_dict(value)
} else if type(value) == type{
serialize_type(value)
}
else {
assert(false, message: "Unsupported type for serialization")
}
bytes(result)
}
|
https://github.com/Champitoad/typst-slides | https://raw.githubusercontent.com/Champitoad/typst-slides/main/pba-demo.typ | typst | Creative Commons Zero v1.0 Universal | #import "@preview/polylux:0.3.1": *
#import "theme/metropolis.typ": *
#import "@local/svg-emoji:0.1.0": setup-emoji
#import "notations.typ": *
#import "utils.typ": *
/********** PREAMBLE **********/
#show: metropolis-theme.with()
// Font config
#set text(font: "Fira Sans", weight: "light", size: 20pt)
#show math.equation: set text(font: "Fira Math", weight: "light")
#set strong(delta: 100)
#show link: underline.with(offset: 3pt)
#show: setup-emoji
// Layout config
#set par(justify: true)
#set list(spacing: 1.5em)
// Useful shortcuts
#let mt = spar($|->$)
#let to = spar($->$)
#let xrule(content) = spar(spacing: 1em, xarrow(sym: sym.arrow.r, irule(content)))
// Theorem and definition environements
#import "@preview/ctheorems:1.1.2": *
#show: thmrules
#let definition = thmbox(
"definition", "Definition",
fill: blue.lighten(90%),
).with(numbering: none)
#let theorem = thmbox(
"theorem", "Theorem",
fill: red.lighten(90%),
).with(numbering: none)
#let corollary = thmbox(
"corollary", "Corollary",
fill: green.lighten(90%),
).with(numbering: none)
#let proof = thmproof("proof", "Proof")
/********** CONTENT **********/
#title-slide(
author: [<NAME>],
title: "Proof-by-Action",
subtitle: "Building proofs by hand 👆 (literally)",
date: datetime.today().display(),
extra: [
#set text(size: 16pt)
Proof and Computation autumn school --- Fischbachau
]
)
#slide(title: [Textual vs. Graphical])[
#set align(center)
#let user = text(size: 35pt)[🙇]
#let computer = text(size: 35pt)[💻]
*State-of-the art:* build proofs by writing *textual* commands (_tactics_)
#centerFocus[
#uncover("2-")[
#user : #quote[Please apply _this_ rule]
]
#alternatives-match(position: center + horizon, (
"3": [
#computer : "#text(fill: olive)[*✅ OK*] here is the result!"
],
"4-": [
#computer : "#text(fill: red)[*❌ ERROR:*] dkfsljfjdklsfjdkfjsldjfkdlsfj"
]
))
]
#uncover("5-")[
#squareFocus[
#grid(
columns: (auto),
align: left,
inset: 8pt,
[*1st contribution:* build proofs by #alert[direct manipulation] of _formulas_],
[
#thus No need to _memorize_ the rules \
#thus More _straightforward_ interaction
]
)
]
]
]
#focus-slide[_A #link("https://www.actema.xyz")[*demo*] is worth a thousand words!_]
#slide(title: [Symbolic vs. Iconic])[
- *Symbols* are hard to:
- _learn_ $=>$ purely conventional meaning
- _manipulate_ $=>$ need for very precise gestures
#pause
- Formulas can *interact* by being _moved_ in the same #alert[space]
#pause
#v(1cm)
#set align(center)
#squareFocus[
*2nd contribution:* replace logical symbols by #alert[geometrical diagrams]
]
]
#focus-slide[_A #link("https://www.lix.polytechnique.fr/Labo/Pablo.DONATO/flowerprover/")[*demo*] is worth a thousand words!_]
#slide(title: "For more details...")[
- Foundations in #alert[deep inference] = recent branch of *structural proof theory*
- DnD actions (1#super[st] demo): *Subformula Linking* @Chaudhuri2013 @donato:DnD
- #sys[Flower#h(2mm)Prover] (2#super[nd] demo): *Flower Calculus* @donato:LIPIcs.FSCD.2024.5
- Sound and *complete* for (intuitionistic) first-order logic
#centerFocus[
"_It's all written in my #strike[book] PhD thesis_"
@donato:tel-04698985
]
]
#slide(title: [Bibliography])[
#set cite(form: none)
@donato:DnD
@donato:LIPIcs.FSCD.2024.5
@donato:tel-04698985
#bibliography(
"main.bib",
style: "chicago-author-date",
)
]
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/minea/0_vseob/01_Bohorodicka.typ | typst | #let V = (
"HV": (
("",4,"Dal jesi známenije","Božestvennymi ďitelmi sobľudajušči i pokryvájušči, ot vražiich nachoždeníj, ľubóviju prazdnujuščyja preslavnoje tvoje (N.): zovúšče ti: ty jesi kriposť naša i utverždenije, i radovanije Bohoľipno, jedin Syn tvoj i Boh nas, jemuže poklaňajuščesja hlaholom: Isuse vsesilne, spasí dúšy naša, jako miloserd."),
("",none,"","Dnes svjaščenno sobravšesja pochválim Bohorodicu: Presvjataja Ďivo, mnohaja tvoja veličija í čudes pučina: ty bo jesi nam svjatoje ohraždenije, i pochvala i slava, i istóčnik iscilénija, prazdnujusčich svjatoje tvoje (N.); molimsja hlahóľušče: Isuse vsesilne spasi dušy naša, jako miloserd."),
("",none,"","Blahočestivno Prečístaja, čestnými tvoimi molítvami ohradi i sochrani; i strašny vrahom tvoim i nerabotny javi, tvorjaščíja prazdenstvo Tvoje, (N.): da Synu tvojemú zovem; Isuse vsesilne, spasi nas jako miloserd."),
),
"HV_SN": (
("", 6, "", "Jako vincem presvitlym Prečístaja Bohorodice, (N.): cerkov Bóžija obložisja, i svititsja radujuščisja, dnes tajno líkujet vopijušči tebi Vladýčice; radujsjaj diadimo čestnaja, i vinče božéstvennyja slavy. Radujsja jediná slávy ispolnenije, i vičnoje veselije. Radujsja iže k tebi pribihajuščim pristanišče, Predstatelnice i spasenije duš našich."),
),
"T": (
("", 4, "", "K Bohorodici priľižno nyňi prítecem hrišnii, i smirenníi, i pripadém v pokajanii zovúšče iz hlubiný dušévnyja. Vladýčice pomozi miloserdovavší na ny, potščisja, jako izhibajem ot množestva hrichov, ne otvrati rab tvoich tsčich, tebe bo i jedinú zastupnicu imamy"),
),
)
#let U = (
"K": (
"P1": (("", none, "", "Vodu prošéd jáko súšu, i Jegípetskaho zla izbižáv Israilfánin vopijáše: Izbávitelu Bohu nášemu poím."),),
"P3": (("", none, "", "Nebésnaho krúha verchotvórče Hóspodi, i cerkvé Ziždítelu, Ty mené utverdí v lubví Tvojéj, želánij kráju, i vírnych utverždénije, jedine čelovikolúbče."),),
"P4": (("", none, "", "Uslýšach Hóspodi smotrénija Tvojehó táinstvo, razumích dilá Tvojá, i proslávich Tvojé božestvó."),),
"P5": (("", none, "", "Prosvití nas povelínii Tvoími Hóspodi, i mýščeju Tvojéju vysókoju, Tvoj mir podážď nam, jedine čelovikolúbče."),),
"P6": (("", none, "", "Molítvu prolijú k Hóspodu, i Tomú vozviščú pečáli mojá, i jáko zol dušá mojá ispólnisja, i život moj ádu priblížisja i moľúsja jáko Jóna: ot tli Bóže vozvedí mja."),),
"P7": (("", none, "", "Ot Judéi došédše ótrocy v Vavilóňi inohdá víroju trójčeskoju plámeň péščnyj popráša pojúšče: Otcév Bóže blahoslovén jesí."),),
"P8": (("", none, "", "<NAME>, Jehóže pojút vói Anhelstii, chválite, i prevoznosíte vo vsjá víki."),),
"P9": (("", none, "", "Voístinnu Bohoródicu ťa ispovídujem, spasénii tobóju Ďívo čístaja, s bezplónymi líki ťa veličájušče."),)
)
) |
|
https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/wedges-rebuild/build.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/packages.typ": notebookinator
#import notebookinator: *
#import themes.radial.components: *
#show: create-body-entry.with(
title: "Build: Wedges Rebuild",
type: "build",
date: datetime(year: 2023, month: 12, day: 1),
author: "<NAME>",
witness: "<NAME>",
)
#grid(
columns: (1fr, 1fr),
gutter: 20pt,
[
We followed these steps in order to assemble the wedges:
+ We gathered all the materials
+ We cut the half-cut down to size
+ We screwed the half cut to the hinges
+ We placed a piece of polycarbonate on top of the assembly, and marked holes
+ we drilled out the holes, and put screws in them
+ We screwed the polycarbonate to the bottom assembly
+ Wedges
#admonition(
type: "note",
)[
Our design currently lacks the bottom standoff. We plan to add it in, but we ran
out of time at our last meeting.
]
],
image("./build-1.jpg"),
)
#admonition(
type: "build",
)[
The wedges are complete. In the future we'll want to swap out the polycarbonate
for a piece of acetal.
]
|
https://github.com/GartmannPit/Praxisprojekt-II | https://raw.githubusercontent.com/GartmannPit/Praxisprojekt-II/main/Praxisprojekt%20II/PVA-Templates-typst-pva-2.0/acronyms.typ | typst | #set terms.item()
// add your acronyms here and delete the examples
\ Ex.: #h(1fr)Example // delete me but follow my style
\ 2nd: #h(1fr)second // here too
Sorry, not sorry: you need to add acronyms manually // delete me |
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/attach-p3_02.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
//
// // Error: 30-34 unknown variable: oops
// $ attach(A, t: #locate(it => oops)) $ |
https://github.com/TomVer99/FHICT-typst-template | https://raw.githubusercontent.com/TomVer99/FHICT-typst-template/main/examples/showcase/terms.typ | typst | MIT License | #import "./../../template/fhict-template.typ": *
#let term-list = (
(
key: "fhict",
short: [FHICT],
long: [Fontys Hogeschool ICT],
desc: [Fontys University of Applied Sciences],
),
(
key: "wip",
short: [W.I.P.],
long: [Work In Progress],
),
(
key: "unused",
short: [UNUSED],
long: [Unused],
group: "unused",
),
)
|
https://github.com/jneug/schule-typst | https://raw.githubusercontent.com/jneug/schule-typst/main/src/themes/_theme.typ | typst | MIT License |
#import "../util/types.typ" as t
#let _theme-schema = t.dictionary((
primary: t.color(),
secondary: t.color(),
muted: t.color(),
//
bg: t.dictionary((
primary: t.color(),
secondary: t.color(),
muted: t.color(),
code: t.color(optional: true),
)),
//
text: t.dictionary((
default: t.color(),
header: t.color(),
footer: t.color(optional: true),
title: t.color(optional: true),
subject: t.color(optional: true),
)),
//
fonts: t.dictionary((
default: t.array(t.string()),
headings: t.array(t.string()),
code: t.array(t.string()),
serif: t.array(t.string()),
sans: t.array(t.string()),
)),
//
table: t.dictionary((
header: t.color(optional: true),
even: t.color(optional: true),
odd: t.color(optional: true),
)),
))
#let themes = (
default: (
// Primary and secondary colors
primary: rgb(56, 86, 153),
secondary: rgb(114, 5, 23),
muted: luma(74%),
bg: (
primary: rgb(56, 86, 153).lighten(90%),
secondary: rgb(114, 5, 23).lighten(90%),
muted: luma(92%)
),
text: (
default: black,
header: luma(20%),
footer: luma(70%),
title: rgb(56, 86, 153),
subject: luma(33%)
),
fonts: (
default: (), //("Fira Sans", "Liberation Sans", "Avenir Next", "Avenir", "Helvetica Neue", "Helvetica"),
headings: ("Charter", "Georgia"),
code: ("Fira Code", "Liberation Mono", "Courier New"),
serif: ("Charter", "Georgia"),
sans: ("Fira Sans", "Liberation Sans", "Avenir Next", "Avenir", "Helvetica Neue", "Helvetica"),
),
table: (
header: rgb(56, 86, 153).lighten(90%),
even: luma(96%),
odd: white,
),
),
)
#let create(
primary,
..colors,
) = {
let _if-color(name, default) = colors.named().at(name, default: default)
let theme = (
primary: primary,
secondary: _if-color("secondary", primary.rotate(180deg)),
muted: _if-color("muted", luma(74%)),
//
bg: (
primary: primary.lighten(90%),
secondary: none,
muted: none,
code: none,
),
//
text: (
default: _if-color("text-default", themes.default.text.default),
header: _if-color("text-header", themes.default.text.header),
footer: _if-color("text-footer", themes.default.text.footer),
title: _if-color("text-title", primary),
subject: _if-color("text-subject", themes.default.text.subject),
),
//
fonts: themes.default.fonts,
//
table: (
header: _if-color("text.default", primary.lighten(90%)),
even: none,
odd: white,
),
)
theme.bg.secondary = theme.secondary.lighten(90%)
theme.bg.muted = theme.muted.lighten(80%)
theme.bg.code = theme.bg.muted
theme.table.odd = theme.bg.muted
return theme
}
|
https://github.com/andrewzn69/templates | https://raw.githubusercontent.com/andrewzn69/templates/main/templates/Typst/general.typ | typst | MIT License | // general document
#import "main.typ": gen_preamble, doc_template, lref
#let template(
title: none,
authors: none,
suffix: none,
prefix: none,
body
) = {
doc_template({
gen_preamble(title: title, authors: authors, suffix: suffix, prefix: prefix)
body
})
}
|
https://github.com/d-mironov/typst-slides-uni-freiburg | https://raw.githubusercontent.com/d-mironov/typst-slides-uni-freiburg/main/template.typ | typst | MIT License | #let scriptsize = 8pt
#let transition(
// The slide accent color. Default is a vibrant yellow.
accent-color: rgb("f3bc54"),
// The slide content.
body,
) = {
page(
width: 15cm,
height: 10cm,
background: rect(width: 100%, height: 100%, fill: accent-color),
header: none,
footer: none,
)[
#set align(center+horizon)
#set text(28pt, fill: white, weight: "bold")
#body
]
}
#let slides(
// The presentation's title, which is displayed on the title slide.
paper: [Title],
// The presentation's author, which is displayed on the title slide.
author: none,
title: [Title],
// The date, displayed on the title slide.
date: none,
// If true, display the total number of slide of the presentation.
display-lastpage: true,
// If set, this will be displayed on top of each slide.
short-title: none,
// The presentation's content.
body
) = {
// Ensure that the type of `author` is an array
author = if type(author) == "string" { ((name: author),) }
else if type(author) == "array" { author }
else { panic("expected string or array, found " + type(author)) }
// Set the metadata.
set document(title: paper, author: author.map(author => author.name))
// Configure page and text properties.
set text(font: "PT Sans", weight: "regular")
set page(
width: 15cm,
height: 10cm,
header: if short-title != none {
set align(right)
set text(size: scriptsize)
short-title
},
footer: [
#let lastpage-number = locate(pos => counter(page).final(pos).at(0))
#set align(right)
#grid(
columns: (50%, 50%),
[
#set align(left)
#image("./images/logo-blue.png", width: 40%)
],
[
#set align(right)
#text(size: 5pt)[
*#counter(page).display("1")*
#if (display-lastpage) [\/ #lastpage-number]
]
]
)
],
)
// Display the title page.
page(background: none, header: none, footer: none, fill: rgb("344A9A"))[
#set align(left)
#image("./images/logo.png", width: 40%)
#set align(left+horizon)
#set text(15pt, weight: "light", fill: white)
#paper
#set text(12pt)
#title
#set text(10pt)
#set align(left+bottom)
#let count = author.len()
#let ncols = calc.min(count, 3)
#v(8pt, weak: true)
#grid(
columns: (auto,) * ncols,
column-gutter: 16pt,
row-gutter: 24pt,
..author.map(author => {
author.name
if (author.keys().contains("affiliation")) {
linebreak()
author.affiliation
}
if (author.keys().contains("email")) {
linebreak()
link("mailto:" + author.email)
}
}),
)
#v(8pt, weak: true)
#text(features: ("case",))[#date]
]
// Customize headings to show new slides.
show heading: set text(font: ("Avenir", "Inter Display", "Inter", "Arial"))
show heading.where(level: 1): it => {
pagebreak()
align(top, it)
v(1em)
}
// Add the body.
body
}
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/par-justify-02.typ | typst | Other | // Test forced justification with justified break.
A B C #linebreak(justify: true)
D E F #linebreak(justify: true)
|
https://github.com/ut-khanlab/master_thesis_template_for_typst | https://raw.githubusercontent.com/ut-khanlab/master_thesis_template_for_typst/main/template.typ | typst | // Store theorem environment numbering
#let thmcounters = state("thm",
(
"counters": ("heading": ()),
"latest": ()
)
)
// Setting theorem environment
#let thmenv(identifier, base, base_level, fmt) = {
let global_numbering = numbering
return (
..args,
body,
number: auto,
numbering: "1.1",
refnumbering: auto,
supplement: identifier,
base: base,
base_level: base_level
) => {
let name = none
if args != none and args.pos().len() > 0 {
name = args.pos().first()
}
if refnumbering == auto {
refnumbering = numbering
}
let result = none
if number == auto and numbering == none {
number = none
}
if number == auto and numbering != none {
result = locate(loc => {
return thmcounters.update(thmpair => {
let counters = thmpair.at("counters")
// Manually update heading counter
counters.at("heading") = counter(heading).at(loc)
if not identifier in counters.keys() {
counters.insert(identifier, (0, ))
}
let tc = counters.at(identifier)
if base != none {
let bc = counters.at(base)
// Pad or chop the base count
if base_level != none {
if bc.len() < base_level {
bc = bc + (0,) * (base_level - bc.len())
} else if bc.len() > base_level{
bc = bc.slice(0, base_level)
}
}
// Reset counter if the base counter has updated
if tc.slice(0, -1) == bc {
counters.at(identifier) = (..bc, tc.last() + 1)
} else {
counters.at(identifier) = (..bc, 1)
}
} else {
// If we have no base counter, just count one level
counters.at(identifier) = (tc.last() + 1,)
let latest = counters.at(identifier)
}
let latest = counters.at(identifier)
return (
"counters": counters,
"latest": latest
)
})
})
number = thmcounters.display(x => {
return global_numbering(numbering, ..x.at("latest"))
})
}
return figure(
result + // hacky!
fmt(name, number, body, ..args.named()) +
[#metadata(identifier) <meta:thmenvcounter>],
kind: "thmenv",
outlined: false,
caption: none,
supplement: supplement,
numbering: refnumbering,
)
}
}
// Definition of theorem box
#let thmbox(
identifier,
head,
..blockargs,
supplement: auto,
padding: (top: 0.5em, bottom: 0.5em),
namefmt: x => [(#x)],
titlefmt: strong,
bodyfmt: x => x,
separator: [#h(0.1em):#h(0.2em)],
base: "heading",
base_level: none,
) = {
if supplement == auto {
supplement = head
}
let boxfmt(name, number, body, title: auto) = {
if not name == none {
name = [ #namefmt(name)]
} else {
name = []
}
if title == auto {
title = head
}
if not number == none {
title += " " + number
}
title = titlefmt(title)
body = bodyfmt(body)
pad(
..padding,
block(
width: 100%,
inset: 1.2em,
radius: 0.3em,
breakable: false,
..blockargs.named(),
[#title#name#separator#body]
)
)
}
return thmenv(
identifier,
base,
base_level,
boxfmt
).with(
supplement: supplement,
)
}
// Setting plain version
#let thmplain = thmbox.with(
padding: (top: 0em, bottom: 0em),
breakable: true,
inset: (top: 0em, left: 1.2em, right: 1.2em),
namefmt: name => emph([(#name)]),
titlefmt: emph,
)
// Counting equation number
#let equation_num(_) = {
locate(loc => {
let chapt = counter(heading).at(loc).at(0)
let c = counter(math.equation)
let n = c.at(loc).at(0)
"(" + str(chapt) + "." + str(n) + ")"
})
}
// Counting table number
#let table_num(_) = {
locate(loc => {
let chapt = counter(heading).at(loc).at(0)
let c = counter("table-chapter" + str(chapt))
let n = c.at(loc).at(0)
str(chapt) + "." + str(n + 1)
})
}
// Counting image number
#let image_num(_) = {
locate(loc => {
let chapt = counter(heading).at(loc).at(0)
let c = counter("image-chapter" + str(chapt))
let n = c.at(loc).at(0)
str(chapt) + "." + str(n + 1)
})
}
// Definition of table format
#let tbl(tbl, caption: "") = {
figure(
tbl,
caption: caption,
supplement: [表],
numbering: table_num,
kind: "table",
)
}
// Definition of image format
#let img(img, caption: "") = {
figure(
img,
caption: caption,
supplement: [図],
numbering: image_num,
kind: "image",
)
}
// Definition of abstruct page
#let abstract_page(abstract_ja, abstract_en, keywords_ja: (), keywords_en: ()) = {
if abstract_ja != [] {
show <_ja_abstract_>: {
align(center)[
#text(size: 20pt, "概要")
]
}
[= 概要 <_ja_abstract_>]
v(30pt)
set text(size: 12pt)
h(1em)
abstract_ja
par(first-line-indent: 0em)[
#text(weight: "bold", size: 12pt)[
キーワード:
#keywords_ja.join(", ")
]
]
} else {
show <_en_abstract_>: {
align(center)[
#text(size: 18pt, "Abstruct")
]
}
[= Abstract <_en_abstract_>]
set text(size: 12pt)
h(1em)
abstract_en
par(first-line-indent: 0em)[
#text(weight: "bold", size: 12pt)[
Key Words:
#keywords_en.join("; ")
]
]
}
}
// Definition of content to string
#let to-string(content) = {
if content.has("text") {
content.text
} else if content.has("children") {
content.children.map(to-string).join("")
} else if content.has("body") {
to-string(content.body)
} else if content == [ ] {
" "
}
}
// Definition of chapter outline
#let toc() = {
align(left)[
#text(size: 20pt, weight: "bold")[
#v(30pt)
目次
#v(30pt)
]
]
set text(size: 12pt)
set par(leading: 1.24em, first-line-indent: 0pt)
locate(loc => {
let elements = query(heading.where(outlined: true), loc)
for el in elements {
let before_toc = query(heading.where(outlined: true).before(loc), loc).find((one) => {one.body == el.body}) != none
let page_num = if before_toc {
numbering("i", counter(page).at(el.location()).first())
} else {
counter(page).at(el.location()).first()
}
link(el.location())[#{
// acknoledgement has no numbering
let chapt_num = if el.numbering != none {
numbering(el.numbering, ..counter(heading).at(el.location()))
} else {none}
if el.level == 1 {
set text(weight: "black")
if chapt_num == none {} else {
chapt_num
" "
}
let rebody = to-string(el.body)
rebody
} else if el.level == 2 {
h(2em)
chapt_num
" "
let rebody = to-string(el.body)
rebody
} else {
h(5em)
chapt_num
" "
let rebody = to-string(el.body)
rebody
}
}]
box(width: 1fr, h(0.5em) + box(width: 1fr, repeat[.]) + h(0.5em))
[#page_num]
linebreak()
}
})
}
// Definition of image outline
#let toc_img() = {
align(left)[
#text(size: 20pt, weight: "bold")[
#v(30pt)
図目次
#v(30pt)
]
]
set text(size: 12pt)
set par(leading: 1.24em, first-line-indent: 0pt)
locate(loc => {
let elements = query(figure.where(outlined: true, kind: "image"), loc)
for el in elements {
let chapt = counter(heading).at(el.location()).at(0)
let num = counter(el.kind + "-chapter" + str(chapt)).at(el.location()).at(0) + 1
let page_num = counter(page).at(el.location()).first()
let caption_body = to-string(el.caption.body)
str(chapt)
"."
str(num)
h(1em)
caption_body
box(width: 1fr, h(0.5em) + box(width: 1fr, repeat[.]) + h(0.5em))
[#page_num]
linebreak()
}
})
}
// Definition of table outline
#let toc_tbl() = {
align(left)[
#text(size: 20pt, weight: "bold")[
#v(30pt)
表目次
#v(30pt)
]
]
set text(size: 12pt)
set par(leading: 1.24em, first-line-indent: 0pt)
locate(loc => {
let elements = query(figure.where(outlined: true, kind: "table"), loc)
for el in elements {
let chapt = counter(heading).at(el.location()).at(0)
let num = counter(el.kind + "-chapter" + str(chapt)).at(el.location()).at(0) + 1
let page_num = counter(page).at(el.location()).first()
let caption_body = to-string(el.caption.body)
str(chapt)
"."
str(num)
h(1em)
caption_body
box(width: 1fr, h(0.5em) + box(width: 1fr, repeat[.]) + h(0.5em))
[#page_num]
linebreak()
}
})
}
// Setting empty par
#let empty_par() = {
v(-1em)
box()
}
// Construction of paper
#let master_thesis(
// The master thesis title.
title: "ここにtitleが入る",
// The paper`s author.
author: "ここに著者が入る",
// The author's information
university: "",
school: "",
department: "",
id: "",
mentor: "",
mentor-post: "",
class: "修士",
date: (datetime.today().year(), datetime.today().month(), datetime.today().day()),
paper-type: "論文",
// Abstruct
abstract_ja: [],
abstract_en: [],
keywords_ja: (),
keywords_en: (),
// The paper size to use.
paper-size: "a4",
// The path to a bibliography file if you want to cite some external
// works.
bibliography-file: none,
// The paper's content.
body,
) = {
// citation number
show ref: it => {
if it.element != none and it.element.func() == figure {
let el = it.element
let loc = el.location()
let chapt = counter(heading).at(loc).at(0)
link(loc)[#if el.kind == "image" or el.kind == "table" {
// counting
let num = counter(el.kind + "-chapter" + str(chapt)).at(loc).at(0) + 1
it.element.supplement
" "
str(chapt)
"."
str(num)
} else if el.kind == "thmenv" {
let thms = query(selector(<meta:thmenvcounter>).after(loc), loc)
let number = thmcounters.at(thms.first().location()).at("latest")
it.element.supplement
" "
numbering(it.element.numbering, ..number)
} else {
it
}
]
} else if it.element != none and it.element.func() == math.equation {
let el = it.element
let loc = el.location()
let chapt = counter(heading).at(loc).at(0)
let num = counter(math.equation).at(loc).at(0)
it.element.supplement
" ("
str(chapt)
"."
str(num)
")"
} else if it.element != none and it.element.func() == heading {
let el = it.element
let loc = el.location()
let num = numbering(el.numbering, ..counter(heading).at(loc))
if el.level == 1 {
str(num)
"章"
} else if el.level == 2 {
str(num)
"節"
} else if el.level == 3 {
str(num)
"項"
}
} else {
it
}
}
// counting caption number
show figure: it => {
set align(center)
if it.kind == "image" {
set text(size: 12pt)
it.body
it.supplement
" " + it.counter.display(it.numbering)
" " + it.caption.body
locate(loc => {
let chapt = counter(heading).at(loc).at(0)
let c = counter("image-chapter" + str(chapt))
c.step()
})
} else if it.kind == "table" {
set text(size: 12pt)
it.supplement
" " + it.counter.display(it.numbering)
" " + it.caption.body
set text(size: 10.5pt)
it.body
locate(loc => {
let chapt = counter(heading).at(loc).at(0)
let c = counter("table-chapter" + str(chapt))
c.step()
})
} else {
it
}
}
// Set the document's metadata.
set document(title: title, author: author)
// Set the body font. TeX Gyre Pagella is a free alternative
// to Palatino.
set text(font: (
"Nimbus Roman",
// "Hiragino Mincho ProN",
// "MS Mincho",
"Noto Serif CJK JP",
), size: 12pt)
// Configure the page properties.
set page(
paper: paper-size,
margin: (bottom: 1.75cm, top: 2.25cm),
)
// The first page.
align(center)[
#v(80pt)
#text(
size: 16pt,
)[
#university #school #department
]
#text(
size: 16pt,
)[
#class#paper-type
]
#v(40pt)
#text(
size: 22pt,
)[
#title
]
#v(50pt)
#text(
size: 16pt,
)[
#id #author
]
#text(
size: 16pt,
)[
指導教員: #mentor #mentor-post
]
#v(40pt)
#text(
size: 16pt,
)[
#date.at(0) 年 #date.at(1) 月 #date.at(2) 日 提出
]
#pagebreak()
]
set page(
footer: [
#align(center)[#counter(page).display("i")]
]
)
counter(page).update(1)
// Show abstruct
abstract_page(abstract_ja, abstract_en, keywords_ja: keywords_ja, keywords_en: keywords_en)
pagebreak()
// Configure paragraph properties.
set par(leading: 0.78em, first-line-indent: 12pt, justify: true)
show par: set block(spacing: 0.78em)
// Configure chapter headings.
set heading(numbering: (..nums) => {
nums.pos().map(str).join(".") + " "
})
show heading.where(level: 1): it => {
pagebreak()
counter(math.equation).update(0)
set text(weight: "bold", size: 20pt)
set block(spacing: 1.5em)
let pre_chapt = if it.numbering != none {
text()[
#v(50pt)
第
#numbering(it.numbering, ..counter(heading).at(it.location()))
章
]
} else {none}
text()[
#pre_chapt \
#it.body \
#v(50pt)
]
}
show heading.where(level: 2): it => {
set text(weight: "bold", size: 16pt)
set block(above: 1.5em, below: 1.5em)
it
}
show heading: it => {
set text(weight: "bold", size: 14pt)
set block(above: 1.5em, below: 1.5em)
it
} + empty_par()
// Start with a chapter outline.
toc()
pagebreak()
toc_img()
pagebreak()
toc_tbl()
set page(
footer: [
#align(center)[#counter(page).display("1")]
]
)
counter(page).update(1)
set math.equation(supplement: [式], numbering: equation_num)
body
// Display bibliography.
if bibliography-file != none {
show bibliography: set text(12pt)
bibliography(bibliography-file, title: "参考文献", style: "ieee")
}
}
// LATEX character
#let LATEX = {
[L];box(move(
dx: -4.2pt, dy: -1.2pt,
box(scale(65%)[A])
));box(move(
dx: -5.7pt, dy: 0pt,
[T]
));box(move(
dx: -7.0pt, dy: 2.7pt,
box(scale(100%)[E])
));box(move(
dx: -8.0pt, dy: 0pt,
[X]
));h(-8.0pt)
} |
|
https://github.com/ClazyChen/Table-Tennis-Rankings | https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2005/MS-06.typ | typst |
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (1 - 32)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[1], [<NAME>], [CHN], [2938],
[2], [<NAME>], [CHN], [2755],
[3], [<NAME>], [KOR], [2587],
[4], [<NAME>], [CHN], [2576],
[5], [SAMSONOV Vladimir], [BLR], [2539],
[6], [<NAME>], [CHN], [2524],
[7], [<NAME>], [GER], [2506],
[8], [<NAME>], [KOR], [2495],
[9], [<NAME>], [DEN], [2471],
[10], [<NAME>], [CHN], [2470],
[11], [KREANGA Kalinikos], [GRE], [2418],
[12], [<NAME>], [CHN], [2414],
[13], [<NAME>], [ROU], [2392],
[14], [<NAME>], [CHN], [2385],
[15], [KORBEL Petr], [CZE], [2365],
[16], [BLASZCZYK Lucjan], [POL], [2360],
[17], [<NAME>], [AUT], [2352],
[18], [CHUANG Chih-Yuan], [TPE], [2346],
[19], [HEISTER Danny], [NED], [2314],
[20], [WALDNER Jan-Ove], [SWE], [2310],
[21], [<NAME>], [SWE], [2307],
[22], [JOO Saehyuk], [KOR], [2302],
[23], [LI Ching], [HKG], [2294],
[24], [HE Zhiwen], [ESP], [2272],
[25], [CHEUNG Yuk], [HKG], [2272],
[26], [QIU Yike], [CHN], [2264],
[27], [KEEN Trinko], [NED], [2260],
[28], [BENTSEN Allan], [DEN], [2242],
[29], [CHEN Weixing], [AUT], [2237],
[30], [<NAME>], [SRB], [2217],
[31], [FEJER-<NAME>], [GER], [2198],
[32], [LEUNG Chu Yan], [HKG], [2196],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (33 - 64)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[33], [CHIANG Peng-Lung], [TPE], [2191],
[34], [<NAME>], [RUS], [2191],
[35], [<NAME>], [SWE], [2182],
[36], [<NAME>he], [BUL], [2180],
[37], [KO Lai Chak], [HKG], [2167],
[38], [ROSSKOPF Jorg], [GER], [2164],
[39], [<NAME>], [BEL], [2163],
[40], [LEGOUT Christophe], [FRA], [2153],
[41], [MA Long], [CHN], [2146],
[42], [<NAME>], [DOM], [2141],
[43], [<NAME>], [GER], [2134],
[44], [<NAME>], [KOR], [2132],
[45], [<NAME>], [GER], [2128],
[46], [<NAME>], [POL], [2127],
[47], [<NAME>], [CZE], [2126],
[48], [<NAME>], [CHN], [2121],
[49], [<NAME>], [SWE], [2107],
[50], [<NAME>], [FRA], [2106],
[51], [<NAME>], [GER], [2104],
[52], [<NAME>], [SGP], [2098],
[53], [<NAME>], [CRO], [2098],
[54], [SMIRNOV Alexey], [RUS], [2096],
[55], [<NAME>], [BEL], [2089],
[56], [<NAME>], [SVK], [2086],
[57], [ERLANDSEN Geir], [NOR], [2085],
[58], [TUGWELL Finn], [DEN], [2074],
[59], [<NAME>], [GER], [2068],
[60], [<NAME>], [GER], [2067],
[61], [<NAME>], [DEN], [2053],
[62], [<NAME>], [SRB], [2049],
[63], [YANG Min], [ITA], [2033],
[64], [<NAME>], [SGP], [2028],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (65 - 96)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[65], [<NAME>], [SLO], [2028],
[66], [<NAME>], [RUS], [2026],
[67], [<NAME>], [FRA], [2018],
[68], [<NAME>], [AUT], [2018],
[69], [<NAME>], [SWE], [2017],
[70], [<NAME>], [JPN], [2016],
[71], [<NAME>], [NGR], [2016],
[72], [<NAME>], [GER], [2004],
[73], [<NAME>], [JPN], [2002],
[74], [<NAME>], [JPN], [1994],
[75], [<NAME>], [GRE], [1993],
[76], [<NAME>], [CHN], [1986],
[77], [<NAME>], [CZE], [1983],
[78], [<NAME>], [KOR], [1977],
[79], [KUSINSKI Marcin], [POL], [1977],
[80], [<NAME>], [SWE], [1975],
[81], [<NAME>], [HUN], [1971],
[82], [DIDUKH Oleksandr], [UKR], [1971],
[83], [#text(gray, "<NAME>")], [ITA], [1963],
[84], [<NAME>], [KOR], [1961],
[85], [<NAME>], [BLR], [1961],
[86], [#text(gray, "<NAME>")], [POL], [1961],
[87], [<NAME>], [FRA], [1957],
[88], [<NAME>], [SWE], [1957],
[89], [AXELQVIST Johan], [SWE], [1952],
[90], [<NAME>], [RUS], [1950],
[91], [<NAME>], [ARG], [1943],
[92], [<NAME>], [HUN], [1942],
[93], [<NAME>], [CAN], [1940],
[94], [<NAME>], [ROU], [1936],
[95], [<NAME>], [CHN], [1934],
[96], [<NAME>], [NOR], [1934],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (97 - 128)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[97], [<NAME>], [FRA], [1931],
[98], [<NAME>], [POL], [1930],
[99], [<NAME>], [NOR], [1929],
[100], [<NAME>], [CZE], [1919],
[101], [<NAME>], [AUT], [1918],
[102], [<NAME>], [HUN], [1912],
[103], [<NAME>], [HUN], [1912],
[104], [OLEJNI<NAME>], [CZE], [1912],
[105], [<NAME>], [ISL], [1911],
[106], [<NAME>], [SWE], [1906],
[107], [<NAME>], [FRA], [1904],
[108], [<NAME>], [CZE], [1902],
[109], [<NAME>], [FRA], [1902],
[110], [<NAME>], [BRA], [1902],
[111], [<NAME>], [POR], [1901],
[112], [<NAME>], [AUT], [1897],
[113], [<NAME>], [SVK], [1897],
[114], [LIVENTSOV Alexey], [RUS], [1894],
[115], [ZHMUDENKO Yaroslav], [UKR], [1891],
[116], [<NAME>], [EGY], [1890],
[117], [ZHUANG David], [USA], [1890],
[118], [<NAME>], [SVK], [1890],
[119], [<NAME>], [IND], [1887],
[120], [<NAME>], [BRA], [1882],
[121], [CAI Xiaoli], [SGP], [1880],
[122], [MONTEIRO Joao], [POR], [1880],
[123], [#text(gray, "<NAME>")], [JPN], [1877],
[124], [GRIGOREV Artur], [RUS], [1873],
[125], [TANG Peng], [HKG], [1870],
[126], [<NAME>], [ESP], [1868],
[127], [#text(gray, "T<NAME>")], [JPN], [1864],
[128], [<NAME> Jr], [CRO], [1861],
)
) |
|
https://github.com/daskol/typst-templates | https://raw.githubusercontent.com/daskol/typst-templates/main/neurips/neurips2024.typ | typst | MIT License | /**
* neurips2024.typ
*
* Template for The 38-th Annual Conference on Neural Information Processing
* Systems (NeurIPS) 2024.
*
* [1]: https://neurips.cc/Conferences/2024
*/
#import "/neurips2023.typ": font, neurips2023, paragraph, url
// Workaround for the lack of an `std` scope.
#let std-bibliography = bibliography
// Tickness values are taken from booktabs.
#let botrule = table.hline(stroke: (thickness: 0.08em))
#let midrule = table.hline(stroke: (thickness: 0.05em))
#let toprule = botrule
#let anonymous-notice = [
Submitted to 38th Conference on Neural Information Processing Systems
(NeurIPS 2024). Do not distribute.
]
#let arxiv-notice = [Preprint. Under review.]
#let public-notice = [
38th Conference on Neural Information Processing Systems (NeurIPS 2024).
]
#let get-notice(accepted) = if accepted == none {
return arxiv-notice
} else if accepted {
return public-notice
} else {
return anonymous-notice
}
/**
* neurips2024
*
* Args:
* accepted: Valid values are `none`, `false`, and `true`. Missing value
* (`none`) is designed to prepare arxiv publication. Default is `false`.
*/
#let neurips2024(
title: [],
authors: (),
keywords: (),
date: auto,
abstract: none,
bibliography: none,
bibliography-opts: (:),
appendix: none,
accepted: false,
body,
) = {
show: neurips2023.with(
title: title,
authors: authors,
keywords: keywords,
date: date,
abstract: abstract,
accepted: accepted,
aux: (get-notice: get-notice),
)
body
// Display the bibliography, if any is given.
if bibliography != none {
if "title" not in bibliography-opts {
bibliography-opts.title = "References"
}
if "style" not in bibliography-opts {
bibliography-opts.style = "ieee"
}
// NOTE It is allowed to reduce font to 9pt (small) but there is not
// small font of size 9pt in original sty.
show std-bibliography: set text(size: font.small)
set std-bibliography(..bibliography-opts)
bibliography
}
if appendix != none {
set heading(numbering: "A.1")
counter(heading).update(0)
appendix
}
}
|
https://github.com/Jollywatt/typst-wordometer | https://raw.githubusercontent.com/Jollywatt/typst-wordometer/master/tests/word-edge-cases/test.typ | typst | MIT License | #import "/src/lib.typ": *
#set page(width: 15cm, height: auto)
#let f(el) = {
let s = word-count-of(el)
highlight(el) + [ [Words: #s.words]]
}
#f[One two three]
#f[Acronyms count as O.N.E. word!]
#f[Hyphen-words] are one, but #f[En–Dash] are two.
#f[Punctuation doesn't count !?] #f[Qu'est-ce que c'est ?]
#f[The amount is \$4,599.99!]
#f[One (or so).]
|
https://github.com/alexanderjophus/typstcv | https://raw.githubusercontent.com/alexanderjophus/typstcv/main/README.md | markdown | # typstcv
CV template for typst
## Usage
- Clone/fork the repository.
- Modify `cv.typ` to your liking.
- Compile the `cv.typ` file using `typst`
```bash
typst compile cv.typ
```
## Motivation
I ported my CV from LaTeX to typst. I wanted to have a simple and clean CV that I can easily modify and compile.
## Magic Functions
- dot_separator
- This function converts a list/array/slice/whatever to a string with dots separating the elements.
- On the case where a new entry goes onto a new line, the dot is ommitted for a cleaner look.
## Future Work
Add a config file such that the user can easily modify the CV without having to modify the `cv.typ` file.
This would be a yaml file (possibly, or toml) that would be read by the `cv.typ` file.
Furthermore, we could add 'targets' where a user can compile the CV to different specs, i.e. more Rust focused, more Python focused, etc. |
|
https://github.com/Clamarche/typst-language-support | https://raw.githubusercontent.com/Clamarche/typst-language-support/main/vsc-extension-quickstart.md | markdown | # Welcome to your VS Code Extension
## What's in the folder
* This folder contains all of the files necessary for your extension.
* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension.
* `syntaxes/typst.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization.
* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets.
## Get up and running straight away
* Make sure the language configuration settings in `language-configuration.json` are accurate.
* Press `F5` to open a new window with your extension loaded.
* Create a new file with a file name suffix matching your language.
* Verify that syntax highlighting works and that the language configuration settings are working.
## Make changes
* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
## Add more language features
* To add features such as IntelliSense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs
## Install your extension
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/035%20-%20Core%202019/002_Chronicle%20of%20Bolas%3A%20The%20First%20Lesson.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Chronicle of Bolas: The First Lesson",
set_name: "Core 2019",
story_date: datetime(day: 20, month: 06, year: 2018),
author: "<NAME>",
doc
)
Naiva crouched on a knob of rock, looking back toward the mountains. Their hunting party had finally reached a high plateau yesterday after days of traveling through the rough and treacherous landscape. When Naiva was a little girl, Grandmother had brought her and Baishya to the high plateau. Back then—all those years ago—the mountains had been blanketed with thick snow and massive glaciers. Now the snow cover was patchy, rock showing through; the avalanche that had almost killed her and Baishya on Eternal Peak was one of many tearing the snow and ice off the once frosty peaks. The world was changing. If you didn't change with it, you'd be swept away.
She scanned the sky for any sign of the Atarka broodling who had been following them for days, but it had vanished. When she turned to look out over the plateau, she caught her breath. Far away, a long dragon swooped and dove, then rose skyward again with a sinuous, rippling grace no bird could copy.
She glanced down into a rock-ringed hollow where the other hunters were rolling up the hides under which they'd sheltered for the night.
"Bai, come see."
Her twin sister climbed up beside her, squinting against the rising sun. "It isn't one of Atarka's broodlings. Too long and lean."
"If it isn't, then it shouldn't be hunting in Atarka territory. What's taking so long for everyone to get going?" She again glanced down to where the hunters were readying their weapons and packs for the day's march. All wore heavy leather coats except for the tallest among them, the Kolaghan-born orc named Fec, with his graying crest of stiff black hair. Unlike the others, he wore nothing on his torso, only a heavy skirt of braided leather strips. A pair of swords were slung cross-wise on his mottled back, and he held a stout walking staff in his left hand. "It's probably that old orc slowing us down. I don't see why we have to have him with us."
"Grandmother has her reasons for everything she does. Now be quiet. Here she comes."
Yasova clambered up beside them, dropping to one knee beside the girls. The high plateau spread before them, so wide and bare it seemed the skin of the earth had no clothing to protect it. A straggly line of stunted trees marked the course of a stream that wound across the plateau. Otherwise, the stark landscape was nothing but stretches of grass, marshy hollows, puddles of icy water melting out of patches of snow, and knobs of bare rock like this one poking above the grass amid a tumble of boulders. The wind never let up, rippling through grass, tugging at loose strands of Naiva's hair.
#figure(image("002_Chronicle of Bolas: The First Lesson/01.jpg", width: 100%), caption: [Rugged Highlands | Art by: Eytan Zana], supplement: none, numbering: none)
"Do you see the dragon?" Naiva pointed east.
"Of course I see it." Grandmother shaded her eyes to cut out the glare. "That's an Ojutai dragon. It's curious to find one here in Atarka's territory, and it's never good when curious things happen."
"It might have wandered here accidentally."
"An Ojutai broodling? No. They're too intelligent to do anything by mistake."
"Dragons can be smart and not just hungry?"
"Haven't you been paying attention to Grandmother's history lessons?" Baishya elbowed her twin in the ribs, although the thick leather tunic Naiva wore absorbed most of the force, so the impact did not even rock her. "Ojutai is a great scholar. All his broodlings are lesser scholars."
"Scholars of dragon lore, not of human lore," said Grandmother with a disapproving purse of her lips. "He began the purges. The other dragonlords followed his lead."
"The purges?" Naiva regretted asking the question as Baishya rolled her eyes.
"Do you listen at all, Nai?"
"No one in our age group casts a hunting spear or shoots an arrow more accurately than me. What do I care about old stories?"
"Enough." Grandmother rose stiffly in a way that troubled Naiva, who was used to seeing her grandmother as eternally strong and capable. But when her eye caught Naiva's, not a sliver of weakness showed in her hard gaze. "We'll have to swing wide and go along the watercourse, using the trees as cover. I want to reach Ugin's grave without tangling with that dragon."
She turned to look back toward the western range of the Qal Sisma.
"Is that Atarka broodling still following us, do you think?" Naiva asked. "I haven't seen it since yesterday."
"Neither have I," said Grandmother. "I don't like that it's vanished. Maybe it got bored. Maybe it's stalking us for reasons that pass as thought in its small mind. Some of Atarka's broodlings have a low cunning that makes them particularly dangerous. Girls, you'll walk with me in the center of our line."
Baishya nodded with a smile, for she loved no place better than being close to Grandmother, but Naiva's anger flared.
"You said I'd be allowed to scout once we reached the plateau!"
"That was before the Ojutai broodling. Come along."
No sense in arguing with Grandmother.
But Naiva fumed as they set out, and she fumed as they walked, forming words with her lips without giving them breath to make sound. Now and again her twin would roll a sideways gaze at her and waggle her eyebrows, mocking her, until at last her mood began to soften at the familiar teasing. The morning's trudge in the shade of the tangled growth along the lazy curves of the watercourse was unpleasant, not that she would ever admit the constant buzz of insects and the pull of thorny vines and brush of stinging nettle bothered her. Any hunter worth her salt was above commenting on such mundane discomforts. The others walked with grim purpose as they slapped away the incessantly biting bugs.
Just before midday, they reached an oxbow bend in the river where a deep pool had formed away from the main current. Grandmother raised a hand. "We'll break here and catch fish for our supper. Rakhan and Sorya, take watch."
Naiva walked to the edge of the tree line and, using the leaves as cover, peered up at the heavens. A large raptor was gliding in the distance, perhaps a hawk or eagle. A flock of long-tailed finches patrolled for insects along the edge of the thick vegetation along the watercourse. After a bit, Grandmother came up to stand beside her, Baishya at her heels.
"There's no sign of the Ojutai dragon," said Naiva. "Maybe it's flown back to its own territory."
"Maybe." Grandmother studied her until Naiva began to shift from one foot to the other, fearing she was about to be scolded when she'd been the first to spot the dragon. "Naiva, you've done well. Protecting your twin. Killing the goblins, and thinking ahead to bring them to camp. Of course, you keep up without complaint. I expect that from you."
She'd done well!
Grandmother gestured toward the open ground. "Do you see that ring of stones out there?"
Some ways away from the watercourse, amid high grass, a knob of rock rose about a man's height above the ground. The rock was ringed by a tumble of boulders as if it had once been a giant firepit. A pair of vultures perched on one of the boulders. They were looking inside the ring in the way of scavengers, curious about something that might die soon but hadn't died yet.
"I want you to climb the outcropping and get a clear view, since our vantage is limited here. If the vultures are not afraid, then we need not be. Approach cautiously regardless."
"Of course!"
"Baishya can go with you."
"I thought I was going to fish with you, Grandmother," Baishya protested.
"You need the practice. If Atarka ever suspects you are a whisperer, she'll eat you. Go on."
Naiva was eager to get going. She left her pack with the others and, carrying only her spear and knife, hurried into the tall grass. Although the grass was tall enough to hide her from view, it rustled as she moved through it, a nuisance she'd never had to deal with in the mountains where grass never grew this high.
#figure(image("002_Chronicle of Bolas: The First Lesson/02.jpg", width: 100%), caption: [Forest | Art by: <NAME>], supplement: none, numbering: none)
Behind, Baishya panted, "Wait up."
Disturbed by the noise and movement, the vultures lofted themselves into the air.
"Hssh. Quiet." Naiva slowed as they reached the outer boulders of the ring. She halted with her back against the rough curve of the nearest boulder and eased around to peek in toward the sheltered center.
A staff's blunt end whipped past her face, barely missing her as she jerked back. She flipped her spear forward and, with a quick circling motion, caught the tip of the attacker's staff and slapped it hard backward. The person holding it stumbled, parrying as she hit his staff again. She ducked her spear under the point and lunged, and the stranger caught the blow as he spun his staff downward. But the effort unbalanced him. He staggered backward to get out of her way. She leaped in, meaning to drive him to the ground, but instead she stopped, staring.
A young man faced her, gasping heavily as he leaned on his staff. The left shoulder of his garment was sticky with fresh blood. Its red leavings had smeared up his neck to mottle his chin.
He trembled with pain, an easy kill, and he deserved to be killed for trespassing into Atarka territory. Yet she hesitated as he gripped the staff more tightly to stay upright, as any proud warrior should.
In a raspy voice he said, "You are of the Temur clan. I seek <NAME>."
As if this speech drained the last of his strength, he toppled unconscious to the ground.
Baishya stepped up beside her, staring. "Who is he?"
"Get Grandmother."
Baishya took in a sharp breath as if disliking the curtness of her sister's command, shook herself, and hurried away.
Naiva pressed the point of her spear against the side of his neck. She waited as a hunter waits. In the silence, she had time to examine him more closely. He had a shaved head and wore loose trousers and a light gray tunic wrapped with a sash around his waist and belt with a beautiful gold circular clasp decorated with strands made of tiny silver chains. Movement flashed in her peripheral vision as the two vultures settled at the height of the outcropping she'd meant to climb.
"You can only have him if Grandmother decides he's not worth saving," she said to the birds, but her gaze strayed back to his closed eyes, slightly parted lips, and lean face. He didn't look anything like the young people she had grown up with; he looked mysterious and intriguing.
He stirred, groaning, and she braced herself in case he came up fighting, but his chin sank back down and he fell still. She took a step back as Baishya reappeared with the big orc a step behind. Fec surveyed the sheltered clearing within the stones before whistling an "all clear!"
Only then did Grandmother come inside the ring of rocks. She paced around the unconscious man, examining him from every angle, then bent to remove the staff from his loose hand.
"He said he is looking for Yasova Dragonclaw," said Naiva.
"Just like in my vision," said Baishya eagerly.
"You saw #emph[him] ?" Naiva didn't want Baishya to have seen him first.
"No, not him. I don't care about him. I heard those #emph[words] . Remember?"
Maybe their voices woke him, or maybe he was all along fighting his way back to consciousness. His eyelids fluttered. Even that slight movement troubled his wound. With a hiss of pain, he woke up, opening his eyes. Blinking, his gaze shifted from one girl to the other and back again with a squint of confusion.
"How badly did I hit my head?" he whispered. "My vision shows me two. It is said the Temur whisperers have the power to create a double of themselves out of ice. Is one the magical revenant of the other?"
#figure(image("002_Chronicle of Bolas: The First Lesson/03.jpg", width: 100%), caption: [Mirror Mockery | Art by: <NAME>], supplement: none, numbering: none)
Grandmother's hand tightened on the spear she carried: an ordinary spear with an obsidian point, not the fabled dragon claw spear that had once heralded her position as ruler of all the Temur people. "You're being hunted by one of Ojutai's broodlings, aren't you?"
"I am."
"I should kill you and hand you over to your dragonlord. Your presence puts my people at risk."
"You can't kill him," exclaimed Naiva. "He came to find you! If you don't heal him, he'll die."
"We all die, now or later," replied her Grandmother in her most maddeningly calm tone. "This could be a trap on the part of Ojutai to find me."
"So you #emph[are] Yasova, keeper of the past and guardian of the unwritten now."
"Why does it matter to you?"
"Three months ago, my master had a dream. When he woke, he told me I was destined to make a long journey. He said it was time to share our secrets."
"Many people claim to have secrets, but few of them are worth sharing," Grandmother said.
He took in several ragged breaths to build strength for more words. "Ojutai destroyed the records <NAME> preserved for so many generations. He wants to destroy our memory of the past, and of our ancestors, so our people know only what the dragonlords wish them to know. But the story the Spirit Dragon told to the first shamans has survived because it wasn't only written down. It has also been passed down from master to student, memorized and handed on to the next generation."
Grandmother's brow wrinkled. A glimmer woke in her eyes, a flash of excitement, a thrill of fear and hope. "The Spirit Dragon spoke to your shamans?"
#figure(image("002_Chronicle of Bolas: The First Lesson/04.jpg", width: 100%), caption: [Haven of the Spirit Dragon | Art by: Raymond Swanland], supplement: none, numbering: none)
"Yes, and I know—" He broke off, coughing. Red droplets speckled his chin, and his breathing grew more ragged as he fought to stay awake.
"We'll never know if you don't heal him," cried Naiva.
"Nai's right," agreed Baishya. "Let him prove the truth of his words."
Grandmother frowned. "Fec? Any sign of the Ojutai broodling?"
The orc crouched atop one of the lesser rocks, though Naiva couldn't imagine how he had managed to scramble up there with his bad leg. "The sky is empty. That seems to me a bad sign."
Grandmother knelt beside the young man. "What is your name?"
"I am <NAME>, Yasova Dragonclaw."
"Do not use that title again."
She took hold of the hand he was pressing to his wound and shifted it to his other side. Blood welled up against the cloth the instant the pressure was removed. She pulled off her glove and placed a bare hand, fingers spread, atop the wound. The glow of magic lit her hand, its vital force like a lantern burning off the agony in his body. He gritted his teeth, making no sound, but sweat broke on his forehead despite the cold wind blowing over them.
The magic faded. Grandmother's eyes looked drawn and weary, but she gave no other sign of the toll healing magic had taken on her as she sat back on her haunches.
"Tell me something I don't know, and I may let you live."
He took in and released a breath free of the racking cough. "These are the words of Ugin Spirit Dragon, who spoke them in ancient days to one of my Jeskai ancestors."
Then he began to speak in a barely audible and almost rote tone as if he were merely a funnel through which a far more ancient voice spoke across generations.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
If you wish to master the way, then you must learn and repeat and remember. Knowledge is also memory. To forget the past is to lose a piece of ourselves. How much more so for an entire people who lose their past.
My own story is a simple one. The one I loved best in all the worlds is the one who killed me.
How did it happen? That is less simple, and will take longer to tell. Listen carefully, for he may come here someday, and if that happens, then you must beware, for whatever words he speaks to flatter and persuade you will be lies.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Grandmother hissed sharply.
Baishya took her hand. "Are you all right? Is something paining you?"
"No, it was just a bad memory. Go on, <NAME>. Now I am interested."
He nodded, as if he had expected this response, and continued speaking.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
We dragons fell out of the sky into a land that did not know us, nor did we know it. Of course, there were many of us fledglings. Each one met this new world in their own way.
I was born twinned to Nicol, where in every other egg there was only one. We woke together, we named ourselves together, we touched the soil of our new home at the same instant. We witnessed the death of a sister, and in this way, we learned that no creature is safe. Not even us.
When Nicol and I left the mountaintop, we flew in search of our siblings. The death of our sister haunted me because of how briefly she had lived and how savagely she had died. As for Nicol, it angered him because it scared him, although he would deny it. If you should ever have the misfortune of meeting him, I would never recommend anyone suggest to him that he at any point in his long life has felt fear.
What about our surviving siblings? I suppose you have never heard of them. The names of the elder dragons were once celebrated with awe and respect. It is so easy to forget. No memory is safe.
But what a flight we took on that first day, seeing it all with newborn eyes! The sky, so wide! Clouds like mist, and rivers streaming across a vast land covered with vegetation and beasts. I was passionate to know what everything was and to discover its name and a purpose.
Nicol stared at everything too, the sky so wide and the clouds like mist, and then he said, "How could we have stopped those hunters from killing her?"
"Once we understand the world better, we will find the answer. Aren't you excited to explore?"
"We should have interfered."
"You were trapped."
"I wasn't trapped! We could have managed something, if you hadn't hesitated."
"We did what we knew to do at the time."
"It wasn't enough! We must learn what we could have done to prevent it."
"Aren't you curious about the world?"
"I want to know who those hunters are, and where they come from, and how we can destroy them. They've learned they can kill one of us now, so they will not fear us."
"Look over there," I replied, hoping to distract him. "One of our siblings!"
In a valley high in the mountains spread a deep, dark lake. A long lean dragon with metallic sheen on his scales was stretched out on a flat outcropping of bare rock, forelegs hanging over the edge, his sleek head dangling over the water as if he'd fallen asleep. As we flew excitedly around him, seeking a place to land, something monstrously large turned in the waters of the lake, vanishing into murkier depths. From his perch on the outcropping, <NAME> looked up sharply and with the greatest displeasure.
#figure(image("002_Chronicle of Bolas: The First Lesson/05.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
"Why do you disturb me, young ones?"
"We are no younger than you! We fell from the same wingbeat!" Without asking permission, Nicol landed beside our brother. I hastily dropped down beside him.
"You hatched later, thus you are younger. And I must say, you're quite small. It takes both of you to make one of me." He looked us over as if measuring our worth according to our size. "You've ruined my observation of the various creatures that live in the lake."
Nicol craned his neck to look down into the murky waters. "Are you hunting?"
"Hunting? Is that all you think about? What are your names? No, wait. No need to tell me."
"Are you going to try to guess our names?" Nicol asked sarcastically.
"I do not guess. Dragons are born with the gift of names. It is in our nature to know names without being told them. Just as we knew our own names at the moment we woke into consciousness." He closed his eyes, not at all afraid of us, then opened them to examine us with a keen and unrelenting gaze that irritated me because he was so sure of himself. But his curiosity and confidence also intrigued me. "Why do you each only have one name?"
Nicol said nothing as he scratched a gouge in the rock. Steam puffed out of the sides of his closed mouth.
"We were born twinned together," I said, feeling a bit defensive on my twin's behalf and maybe a little on my own, too.
"Ah, so you have two names, but you share them between you, one for each. That would explain your size too, and maybe why you look so much younger. Hmm. Interesting."
"How is it interesting?" Nicol demanded, tail whipping side to side.
"There is an order underlying the world. It is difficult to discern because much of it is hidden from our eyes. Of course, most creatures lack the patience or the desire to delve into this book of knowledge."
"I don't lack anything," said Nicol.
<NAME>huell huffed smokily and unfolded his wings enough to express displeasure. "I am sure you do not. But for now, go away, little ones. I want to return to my observations. I can't with you two here talking so loudly and bothering the wildlife."
"What about hunting?" Nicol asked.
"If hunting is all that interests you, then you may as well go find Palladia-Mors. She certainly has no greater ambition."
He stared us down until we took the hint and departed.
On a vast stretch of grasslands, a huge reddish-green dragon with curling horns roared as she chased a herd of four-legged beasts. She blasted flames over the hindmost, and it collapsed, quivered, and expired. She circled back around and settled down beside the corpse to eat.
I flew over, Nicol beside me. When we landed next to her, she turned raw red eyes upon us and spat a warning gust of fire in our direction.
"This is mine. #emph[Mine] ."
"You are Palladia-Mors," I said politely. "Our elder sister. <NAME> suggested we come to you to learn about hunting."
"Go hunt your own." She tore off a great slab of flesh, and with blood staining her muzzle and teeth, she gnashed and swallowed, then turned her head again to glare at us. "You're so small, the two of you. Little runts. Probably too small to hunt."
#figure(image("002_Chronicle of Bolas: The First Lesson/06.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
"We can hunt!" Nicol clawed angrily at the dirt, then added, "Better than you can, once we learn how."
She snatched up the beast's charred corpse and flung it at us with a violent laugh. Nicol leapt sideways, startled, but I remained crouched where I was since I could see the throw would miss me, as indeed it did. Its weight smacked into the earth, spattering us with fluids.
"There, you can have my leavings. This one's flesh is tough and dry. I mean to kill a tastier one for my own supper."
She opened her magnificent wings and leapt into the sky. The force of her wingbeats flattened us like storm winds, and then she was gone, casting after the fleeing herd. I sniffed at the dead animal, seeking from what lingered of its spirit some indication of its name and substance: it was an ibex, old for its kind; it had had a peaceful life, and that gave its blood and meat a certain pleasing odor.
I tore off a hunk of flesh. It was pleasurable to eat, even if a little tough. "Come try this."
"I won't take anyone else's leavings." Nicol sat back on his tail, stretching to see how high he could reach. "We're not that small. We're bigger than any of the beasts that roam this land. Are you coming with me?"
It seemed wasteful to leave the dead beast, but as I considered the cooling flesh, insects settled upon its skin to burrow and small carnivores crept closer, halting at a safe distance, waiting for us to leave. Other creatures had also begun the work of devouring the dead flesh, although they were so small as to be invisible to the naked eye. That which decays is also being consumed.
The revelation swept over me like a storm's hot rush: within the invisible web that is life and death, nothing goes to waste.
"Death is merely part of a greater cycle," I said, quite struck by my amazing wisdom.
"I want to kill something," said Nicol. "Are you coming?"
It was the second time he'd asked if I was coming with him. To be fair, we'd never been apart, had never walked or flown the slightest span without the other within earshot. I couldn't imagine being in the world without him beside me.
"Yes. Let's learn how to hunt together."
Dragons are natural hunters. It's what we are born for: hunting and naming and hoarding knowledge. But even so, the ibexes and gazelles of the plain were fleet of foot and cunning in the ways of avoiding being pounced upon. They had more practice at escaping than we did at catching.
Once Palladia-Mors glided past just as we had at last successfully cornered a small gazelle. With mocking ease, she snatched up the animal before our claws closed on it. With a taunting roar, she flew away with it in her clutches. Nicol wanted to chase her, but I closed my mouth on his tail and held him thrashing back until he calmed enough to listen.
"She wins if she angers us. Do you want her to win?"
He coughed out a trickle of sooty smoke from the depths of his frustration, but after that, we took care to fly far from our older sister's hunting grounds so she wouldn't be bothered to plague us.
"It's in her nature to hunt and think of nothing else," I said. "But we aren't like her. We can think of more things than just hunting. Hunting is what we do to feed ourselves, not how we live in the world."
Yet by the time we finally dragged down a lagging animal too weak to outrun our pitiable attempts at catching it, I was exhausted and Nicol was so frustrated that he tore the limbs right off the creature, gulped them down too fast, and coughed them up again.
"Those hunters shouldn't have been able to kill our sister," he said when he could speak.
"May I eat in peace without your obsession ruining my meal?" I asked, wearily chewing on a strip of flank meat.
"The hunters worked together. If we learn to work together, then we can hunt better than Palladia-Mors."
I ate thoughtfully, considering his words. It was true we had hunted in the manner of our older sister, each hunting alone, relying on our individual speed and strength. What if there was a better way?
We cleaned ourselves off in a hot sandbank and napped in the afternoon sun. After this pleasant sojourn, Nicol forgot his frustration and was eager to set to work. We spent years, as you Jeskai would measure the span of days, perfecting various techniques for hunting in tandem. Eventually we were easily able to catch the juiciest and healthiest specimen out of any herd, no matter how fleet and canny the animals were.
By this time, we had explored into new territory. Several times we were chased by a big ugly dragon named <NAME> who, with his siblings, furiously guarded a territory they claimed for their own hunting grounds even though it had plenty of space and game enough for many hunters to cull. So, we explored farther afield, for to us, it seemed the land was vast and the ocean that girdled it an insurmountable barrier. We were so young and ignorant in those days.
#figure(image("002_Chronicle of Bolas: The First Lesson/07.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
One day, we settled on a hill amid a richly forested plain. From this vantage, we found ourselves looking over a riverside settlement inhabited by the bipeds called humans. In general, we avoided humans. They didn't taste good, and I didn't like eating things that could talk.
The settlement was ringed by a wall constructed of wood beams sewn together with stone cladding, the spaces between the interlocking beams packed with earth. We had observed other such settlements where these small, frail creatures protected themselves by flocking in numbers. This was by far the largest, with the greatest variety of structures and the most humans crammed inside its insalubrious confines. In short, one could smell it from a great distance.
To our surprise our sibling <NAME> had taken up residence inside the great ring wall. A spacious courtyard fronted a very large building constructed of wood with a high-peaked thatched roof. In a courtyard laden with flat river-stones, he rested at his ease. Bronze shields decorated with spirals flanked him on either side, so polished that any person who approached would be reflected in their shine. Before him, planted in a bronze vase filled with agates, rose a slender tree with a thin trunk carved from ivory and leaves fashioned from gold.
People wearing silver and gold bracelets and brooches attended him. Some were scribes seated cross-legged on mats, brushing letters onto barkcloth. Humbly dressed supplicants knelt by the tree with heads bowed, awaiting a judgment.
I wanted to observe the scene for a while, for it quite astonished me to see a dragon interacting with humans in such an intimate way. But Nicol was impatient, eager to meet this gleaming sibling whose scales were a blinding white under the sun and who presided over the humans with such assurance.
"I didn't realize humans would trust dragons," he said.
Since the humans moved around our brother without fear, we approached openly. Yet when we came within sight of the cultivated fields surrounding the town, people ran for the walls. Horns blared as warning. Archers took up positions along the wall walk. No sooner had we come within range than volleys of arrows sped upward, aiming for our bellies. A few arrows met their target. Their touch on my thick scales was little more than a prickling sensation, more annoying than dangerous, yet a vivid memory of my sister's death flared in my thoughts and choked anger into my chest.
Nicol soared up to hang in the sky for a moment, stretched out as he liked to do to make himself seem larger. His curving horns caught the sunlight and flashed. Then he twisted in a graceful spin and swooped into a dive. His blast of fire breath scorched along the highest tower and its adjoining wall walk. Hapless soldiers screamed and fell as the fire burned them.
A huge body slammed into Nicol, sending him tumbling through the air. He barely flapped his wings enough to keep aloft as our older brother, Arcades, circled back around for another attack. I sped between them, calling out.
"Brother! We mean no harm. We want only to talk to you."
I guided a furious, bruised, and battered Nicol back to the hill from which we'd first seen the town. We landed on its grassy knoll. Death was no longer a stranger to me, for we had killed our share of prey, but the screams of the dying soldiers troubled me in a way that the last moments of the animals we'd hunted had not. Nicol was bleeding from the scratch of Arcade's claws along his flank. He was snorting, stamping, huffing.
I said, "Here he comes!"
Arcades landed, wings spread wide. His glare was as bright as the sun and his claws were out.
Before Nicol could speak I said, "Forgive us, Brother. We thought the creatures were accustomed to dragons."
It is in the nature of dragons to know their own.
"You are the twins, Nicol and Ugin."
"I am <NAME>," said Nicol.
"You are?" I asked. "When did that happen?"
"I have two names. All proper dragons have two names."
"Ugin is fine for me," I said, dismissing this as another of Nicol's quicksilver mood changes. I turned politely back to our older brother. "Brother Arcades, why did the humans attack us when we approached?"
Unlike our roaring sister, Arcades spoke in a measured, resonant voice, deep and soothing. "My subjects thought you were attacking them."
"Why would they think that?" I asked.
"We are not the only dragons in the world."
"We know that," said Nicol. "There is Palladia-Mors, and Chromium Rhuell. We've met them both."
"And Vaevictis's mob. They're quite the gang of marauders. And more besides them, some flying alone and some flocking together. I protect the humans from the other dragons who roam this land. But I am also teaching the humans to a better path of life, one ruled not just by their own primitive, violent tendencies."
"Why do you care about the humans?" Nicol asked. "They killed one of our sisters, when we first fell."
Arcades shifted his wings in a sign of acceptance. "This struggle is the way of life and death, is it not? Humans have a right to live, just as we do."
Nicol flexed his claws but said nothing, and I could see that the effort cost him. But maybe he was learning to calm down and think more.
Arcades did not know Nicol as I did and so he kept talking, having missed Nicol's flash of anger. "Humans are interesting creatures. Unlike our kind, they work together. Do you want to come see? You may visit for a little while as my honored guests, as long as you follow the rules of law and order I have established in this colony."
Nicol looked at me. "I'd like that," he said in a cool, flat tone.
I was pleased to hear him be so reasonable. I thought I knew him down to his bones, but I did not yet know what he was capable of.
So, it was then that we accompanied Arcades back to the town. He made us known to the people there, and they greeted us with awe and respect, although, perhaps not quite as much awe and respect as they showed to Arcades, whom they called "Dragonlord."
#figure(image("002_Chronicle of Bolas: The First Lesson/08.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none)
There we sojourned for years. We watched as the humans enclosed more territory with more walls, as people were born in increasing numbers and built more houses and cleared more fields, as trade envoys came from distant towns to the growing city. I poked my snout into everything, and made particular friends with an old holy elder named <NAME>, whose sole purpose in life, it seemed, was to think about things that could not be seen. She lived alone in a round chamber whose walls were made of stone slabs. Like the stone, she was tough and dry. Though she was withered of limb and frail of body, her mind was as sharp as obsidian.
Nicol had no patience for her possessionless way of being in the world; he wanted to be where Arcades was, guiding and advising the people. Nicol made himself useful in a hundred ways, digging into every crevice of human life and emotion. But the greed and excitement and anxiety and competitiveness of humans tired me when I was around it too much, so the solitude of <NAME> Ki's way attracted me. I soaked up the calm wisdom she exuded.
Entire days would pass in silence as she and I sat in her circular chamber. Its roof had long since fallen in, and she informed me once that the half-collapsed tower was an artifact of builders who had bided here before the people who now lived in this place.
"We are not the first, and we will not be the last," she said. "We see only our hand before our face, but there have been other hands here before ours, and there will come others after us. Even this world is but one layer amid many others."
She knew many schemes as an aid to meditation, but I best liked it when she spun globes of light in the air. Translucent threads of magic tethered each of the globes to the others so that, as they whirled in the air, they remained both separate and yet linked by connections too mysterious for me to comprehend. She called each one a "plane," although I did not know what she meant by the word at that time. When I asked if the globes were a thought experiment or if they really existed, she said it did not matter because no physical being could cross between planes. But I didn't care about that. The way the radiant globes interlocked and moved in and around each other fascinated me as much as the wisdom she uttered in her whispery rasp of a voice.
"Everything that lives is interwoven. Everything that dies is consumed by something else, by another animal or by decay. In this rot lies the kernel of new life, for it passes back into the world as seeds take root and grow. There is no end, just endless cycles of transformation."
"You will die someday."
"Yes."
"Doesn't that scare you?"
"My essence will continue to exist in other forms. Shards of my being will transform into new and remarkable entities with their own journeys to make. How is this frightening?"
"It seems frightening to me. Do dragons die?"
"All things end. Sometimes that is not the same as dying. Do you wish me to teach you how to create the globes and spin them? It is an exercise to calm the mind."
I did wish it. Oh, I did. But it was a hard task, and I was not a quick study.
One day as I was sitting in the sun manifesting a single globe of light above my left foreleg, quite overweeningly proud of my tiny accomplishment, there came a terrible tumult of screams and shouts from the direction of the palace storerooms. Under the reign of Arcades Sabboth, the realm dwelt in peace and order, so the cries of fear and ragged agony cut with brutal intensity into the quiet afternoon.
My scales prickled as if assaulted by a hundred arrows—nothing that could pierce me but only alarm me. Something was up. Something bad.
The globe dissolved with a pop that turned into a cloud of lights dispersed by a gust of wind. In haste, I made my way to the courtyard fronting the storerooms, a place where carts and wagons and pack horses could unload and take on cargo. Blood spattered the cobblestoned courtyard. A man was on his knees on the stones. A bloody knife stuck into the chest of another man told the gruesome tale of a violent murder. Palace guards surrounded the killer who stared at his bloody hands in bewilderment.
"But he's my brother. How did this happen? Who stabbed him?"
Witnesses crowded forward. "You turned on him. You shouted at him that he was stealing your birthright and meant to cheat you. Then you pulled the knife and stabbed him."
His voice was breathless and lost. "But that dispute between us was all settled years ago when our parents gave the carting business to us to run together . . . " He shook his head repeatedly as if trying to shake loose a noxious worm that had burrowed inside him. "We never fought after that, not one day."
The words fell hollowly, given the evidence.
#figure(image("002_Chronicle of Bolas: The First Lesson/09.jpg", width: 100%), caption: [Murder | Art by: <NAME>], supplement: none, numbering: none)
The guards took him away. As a steward directed the body be removed and the blood washed off the stones, I raised my eyes to the roof of one of the nearby buildings. Nicol lounged there, stretched along the ridgeline, watching the scene with an avid gaze.
"What did you do?" I demanded in dragon speech.
"What did I do? I have not moved from here."
"You stood by and let it happen? You could have intervened."
A smirk of satisfaction creased his visage. "What if I did?"
The prickling sensation intensified. "What do you mean? What did you do, Nicol?"
"I have discovered a better way to get revenge. Are you coming or are you going to stay with your mealy-mouthed sage and her bland tidbits of wisdom?"
"Coming where?"
"I am going to avenge our sister, as we should have done long ago."
He opened his wings and, without even making proper farewells to our brother, flew off so quickly that he was out of my sight before I truly realized he meant to leave all this behind. I hastened to find our brother.
"A magistrate will hear the case and render a ruling. It won't even be brought to my attention. No need to concern yourself with it, Ugin. You can go back to your studies." He said when I found him.
"But don't you find it strange that the two brothers worked together in peace for years and then this suddenly happened?"
"Humans have these troubles," he explained tendentiously to me. "They keep their emotions weighted down for years, and then a spark ignites, and they explode. It has happened before, and it will happen again."
But my heart remained troubled.
"What do you fear?" Te Ju Ki asked me at dusk, when I returned to her open-roofed chamber.
"I don't know. But my heart will not rest."
"You cannot continue your studies in this state, Ugin. I'm sorry. Perhaps you need some time away."
I kept thinking of Nicol, flying off. #emph[I am going to avenge our sister.]
"I know where he's going. I must follow him."
"Your journey is your path to walk, Ugin. May you find what you seek."
I didn't want to leave, but I had to follow. Something momentous had happened. It made me think of standing in a dry stream bed in a desert when a cloudburst darkens the distant hills. The floodwaters are coming even if you can't see them yet.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"Down! Take cover!" cried Fec. "It stalked him through the grass!"
A loud rustling like the sound of rainfall swept over them, though the sky remained clear. The vultures launched into the sky in a frantic rush of wings.
A shadow fell across them as a dragon's head and sinuous neck rose from behind the outcropping. It was a stunningly beautiful creature, scales a pale gray-white with a hint of blue. A dark blue crest rose from the center of its head between two long, elegant horns. Its gaze marked them, each one, and dismissed them, each one, with a gleam of intelligence nothing like the brute hunger of Atarka's antlered broodlings. Then it saw the young man still seated on the ground. The creature hissed, threads of a cold, misty haze leaking from its nostrils.
#figure(image("002_Chronicle of Bolas: The First Lesson/10.jpg", width: 100%), caption: [Cunning Breezedancer | Art by: <NAME>], supplement: none, numbering: none)
<NAME> jumped to his feet, pressing his forearms together in a gesture of supplication. Was it after all a trap? Had he delivered up Grandmother to one of Ojutai's broodlings?
A large bird flew up from behind the dragon and landed on the outcropping. It was no bird but an aven, wearing an elaborate vest that hung almost to its taloned feet. Its head was capped by a crest and long horns similar to those of the dragon it served.
When the broodling spoke in a crackling rumble of draconic, the aven translated.
"T<NAME>, by the command of the Great Teacher, you are accused of the crime of sacrilege and sentenced to die by ice. It will be my pleasure and honor to kill you."
|
|
https://github.com/SidneyLYZhang/learnTypst | https://raw.githubusercontent.com/SidneyLYZhang/learnTypst/main/MyFavorites/001_tutorial-reference.typ | typst | #set text(font:("Consolas", "Source Han Sans SC"))
#set text(lang: "zh")
#show emph: text.with(font: ("Linux Libertine","STKaiti"))
#show link: text.with(fill: color.blue)
= 额外的学习参考
== 中文相关
更快捷的中文相关指引,我还是更推荐#link("https://typst.cn/#/")[Typst 中文社区]编写的#link("https://github.com/typst-doc-cn/typst-doc-cn.github.io/blob/main/docs/chinese.md")[中文用户指南]。但这个指南其实写的有点杂乱,但胜在所有关键信息都有涉及,能减少很多再查找的苦难。
=== 中文字体与排版格式
Typst目前在中文字体的一些支持上还是有一点遗憾的,例如斜体的支持等等。这一部分我觉得 #link("https://github.com/PeiPei233")[PeiPei233] 在他的#link("https://stormckey.github.io/PeiPei/typst/")[Typst is All You Need]中做了很不错的总结并提供了解决思路。虽然是目前没办法的办法,但也聊胜于无。而且他也提供了一些不错的模板和配置方案。是不错的中文教程补充。
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/root_05.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test shorthand.
$ √2^3 = sqrt(2^3) $
$ √(x+y) quad ∛x quad ∜x $
$ (√2+3) = (sqrt(2)+3) $
|
https://github.com/Robotechnic/diagraph | https://raw.githubusercontent.com/Robotechnic/diagraph/main/examples/font.typ | typst | MIT License | #import "@preview/diagraph:0.3.0" : *
#raw-render(```
digraph G {
redFiraSans [
label = "Red\nFiraSans\n20pt",
color = red,
fontcolor=red,
fontsize=20
fontname="Fira Sans",
]
blueDejaVuSans [
label = "Blue\nDejaVuSans\n10pt",
color = blue,
fontcolor=blue,
fontsize=10
fontname="DejaVu Sans",
]
redFiraSans -> blueDejaVuSans[color = red]
purpleTimesNewRoman [
label = "Purple\nTimesNewRoman\n8pt",
color = purple,
fontsize=8
fontcolor=purple,
fontname="Times New Roman",
]
blueDejaVuSans -> purpleTimesNewRoman[color = blue]
orangeredCourier [
label = "Orangered\nCourier\n32pt",
color = orangered,
fontsize=32
fontcolor=orangered,
fontname="Courier",
]
purpleTimesNewRoman -> orangeredCourier[color = purple]
limeComicSans [
label = "Lime\nComicSans\n15pt",
color = lime,
fontsize=15
fontcolor=lime,
fontname="Comic Sans",
]
orangeredCourier -> limeComicSans[color = orangered]
efefefArial [
label = "efefef\nArial\n20pt",
color = efefef,
fontsize=20
fontcolor=efefef,
fontname="Arial",
]
limeComicSans -> efefefArial[color = lime]
yellowVerdana [
label = "Yellow\nVerdana\n10pt",
color = yellow,
fontsize=10
fontcolor=yellow,
fontname="Verdana",
]
efefefArial -> yellowVerdana[color = efefef]
cyanGeorgia [
label = "Cyan\nGeorgia\n15pt",
color = cyan,
fontsize=15
fontcolor=cyan,
fontname="Georgia",
]
yellowVerdana -> cyanGeorgia[color = yellow]
blueImpact [
label = "Blue\nImpact\n20pt",
color = blue,
fontsize=20
fontcolor=blue,
fontname="Impact",
]
cyanGeorgia -> blueImpact[color = cyan]
redFiraSans -> blueImpact[color = red]
}
```, engine: "neato")
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/features-01.typ | typst | Other | // Test smallcaps.
#smallcaps[Smallcaps]
|
https://github.com/antonWetzel/Masterarbeit | https://raw.githubusercontent.com/antonWetzel/Masterarbeit/main/arbeit/abstrakt_englisch.typ | typst | This thesis focuses on the processing, analysis and visualization of forest areas using point clouds. The complete process from the data set to the visualization of the individual trees with relevant information is conducted.
A data set is a lidar scan of a forest area, which is given as a list of points. The points can be stored in any order and only the three-dimensional position is required for each point.
First, the points are automatically divided into individual trees. The analysis then calculates relevant information for the trees and individual points and the data is prepared for the visualization in real time.
The methods, data structures and algorithms presented are implemented in the associated software project. The analysis and visualization of the forest areas are tested and evaluated with the implementation.
|
|
https://github.com/MatheSchool/typst-g-exam | https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/docs-shiroa/g-exam-doc/mod.typ | typst | MIT License |
#import "book.typ": book-page, cross-link
#import "../template/page.typ": *
/// This function is to render a text string in monospace style and function
/// color in your defining themes.
///
/// ## Examples
///
/// ```typc
/// typst-func("list.item")
/// ```
///
/// Note: it doesn't check whether input is a valid function identifier or path.
#let typst-func(it) = [
#raw(it + "()", lang: "typc") <typst-raw-func>
]
#let kbd = raw
#let md-alter(left, right) = left
#let colors = (blue.lighten(10%), olive, eastern)
#let fg-blue = main-color.mix(rgb("#0074d9"))
#let pro-tip(content) = block(
width: 100%,
breakable: false,
inset: (x: 0.65em, y: 0.65em, left: 0.65em * 0.6),
radius: 4pt,
fill: rgb("#0074d920"),
{
set text(fill: fg-blue)
content
},
)
#let note-box = pro-tip
|
https://github.com/NMD03/CV | https://raw.githubusercontent.com/NMD03/CV/main/templates/resume.typ | typst |
#let default_font = "Source Sans Pro"
#let accent_color = orange
#let light_grey = rgb("#7f7f7f")
#let dark_grey = rgb("#3f3f3f")
#let text_color = rgb("#131A28")
#let textsize = 8pt
#let resume(author: (), body) = {
let date = datetime.today().display("[month repr:long] [day], [year]")
let align_footer(left_body, center_body, right_body) = {
block[
#box(width: 1fr)[
#align(left)[
#left_body
]
]
#box(width: 1fr)[
#align(center)[
#center_body
]
]
#box(width: 1fr)[
#align(right)[
#right_body
]
]
]
}
show par: set block(above: 0.75em, below: 0.75em)
set document(
title: "Resume",
author: author.first_name + " " + author.last_name,
)
set text(
font: default_font,
size: 12pt,
lang: "en",
fill: text_color,
fallback: false,
)
set page(
paper: "a4",
margin: (top: 1cm, bottom: 1cm, left: 1.5cm, right: 1.5cm),
flipped: false,
footer: [
#set text(fill: light_grey, size: 8pt)
#align_footer[
#smallcaps[#date]
][
#smallcaps[
#author.first_name
#author.last_name
]
][
#counter(page).display()
]
],
footer-descent: 0pt,
)
set par(justify: true)
set heading(
numbering: none,
outlined: false,
)
let name = {
align(center)[
#pad(bottom: 5pt)[
#block[
#set text(size: 32pt, style: "normal", fill: light_grey)
#text(weight: "regular")[#author.first_name]
#set text(fill: dark_grey)
#text(weight: "bold")[#author.last_name]
]
]
]
}
let positions = {
set text(
size: 9pt,
weight: "regular",
fill: accent_color
)
align(center)[
#smallcaps[
#author.positions.join(
text[#" "#sym.dot.c#" "]
)
]
]
}
let contacts = {
set box(height: 8pt)
let linkedin_icon = box(image("../assets/icons/linkedin.svg"))
let github_icon = box(image("../assets/icons/github.svg"))
let email_icon = box(image("../assets/icons/email.svg"))
let phone_icon = box(image("../assets/icons/phone.svg"))
let homepage_icon = box(image("../assets/icons/homepage.svg"))
let separator = box(width: 10pt)[#line(angle: 90deg, length: 8pt)]
align(center)[
#block[
#set text(size: 8pt)
#align(horizon)[
#if author.phone != ""{
phone_icon
box[#link("tel:" + author.phone)[#text(" " + author.phone)]]
}
#if author.email != ""{
separator
email_icon
box[#link("mailto:" + author.email)[#text(" " + author.email)]]
}
#if author.github != ""{
separator
github_icon
box[#link("https://github.com/" + author.github)[#text(" " + author.github)]]
}
#if author.linkedin != ""{
separator
linkedin_icon
box[
#link(author.linkedin_link)[#text(" " + author.linkedin)]
]
}
#if author.website != ""{
separator
homepage_icon
box[
#link(author.website)[#text(" " + author.website)]
]
}
]
]
]
}
name
positions
contacts
box(height: 20pt)
body
}
// Content formatting
#let align_content(left_body, right_body) = {
block[
#box(width: 1fr)[
#align(left)[
#left_body
]
]
#box(width: 1fr)[
#align(right)[
#right_body
]
]
]
}
#let section_title(title) = {
set text(
size: 14pt,
weight: "bold",
fill: dark_grey,
font: default_font,
)
align(left)[
#text(fill: accent_color)[#title.slice(0, 1)]#text[#title.slice(1)]
#box(width: 1fr)[#line(angle: 0deg, length: 100%)]
]
}
#let subsection_title(title) = {
set text(
size: 10pt,
weight: "regular",
fill: dark_grey,
font: default_font,
)
align(left)[
#text[#smallcaps[#title]]
]
}
#let detailed_entry(title: str, subtitle: str, date: str, location: str, body: list()) = {
set text(
size: textsize,
weight: "regular",
fill: dark_grey,
font: default_font,
)
align_content[
#text(fill: dark_grey, weight: "bold", size: 10pt)[#title]
#linebreak()
#box(height: 4pt)
#text(weight: "regular")[#smallcaps[#subtitle]]
#linebreak()
][
#text(fill: accent_color, size: textsize, style: "italic")[#location]
#linebreak()
#box(height: 4pt)
#text(fill: light_grey, size: textsize, style: "italic")[#date]
]
set text(size: textsize, weight: "light")
text[#body]
box(height: 3pt)
}
#let short_entry(title: str, subtitle: str, date: str, location: str) = {
set text(
size: textsize,
weight: "regular",
fill: text_color,
font: default_font,
)
align_content[
#grid(columns: (40pt, 410pt), column-gutter: 8pt, align: (center, left),
grid.cell[#text(fill: text_color, size: textsize)[#date]],
grid.cell[#text(fill: dark_grey, weight: "bold", size: textsize)[#title] + #text(fill: text_color, size: textsize)[#subtitle]]
)
][
#text(fill: accent_color, size: textsize, style: "italic")[#location]
]
box(height: 3pt)
}
#let minimal_entry(title: str, body: str) = {
set text(
size: textsize,
weight: "regular",
fill: text_color,
font: default_font,
)
text(fill: dark_grey, weight: "bold")[#title]
text(fill: text_color, size: textsize)[#body]
box(height: 3pt)
} |
|
https://github.com/schmidma/typst-workshop | https://raw.githubusercontent.com/schmidma/typst-workshop/main/examples/07-maths-2.typ | typst | Creative Commons Zero v1.0 Universal | $
7.32 beta +
sum_(i=0)^nabla
(Q_i (a_i - epsilon)) / 2
$ |
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1A20.typ | typst | Apache License 2.0 | #let data = (
("TAI THAM LETTER HIGH KA", "Lo", 0),
("TAI THAM LETTER HIGH KHA", "Lo", 0),
("TAI THAM LETTER HIGH KXA", "Lo", 0),
("TAI THAM LETTER LOW KA", "Lo", 0),
("TAI THAM LETTER LOW KXA", "Lo", 0),
("TAI THAM LETTER LOW KHA", "Lo", 0),
("TAI THAM LETTER NGA", "Lo", 0),
("TAI THAM LETTER HIGH CA", "Lo", 0),
("TAI THAM LETTER HIGH CHA", "Lo", 0),
("TAI THAM LETTER LOW CA", "Lo", 0),
("TAI THAM LETTER LOW SA", "Lo", 0),
("TAI THAM LETTER LOW CHA", "Lo", 0),
("TAI THAM LETTER NYA", "Lo", 0),
("TAI THAM LETTER RATA", "Lo", 0),
("TAI THAM LETTER HIGH RATHA", "Lo", 0),
("TAI THAM LETTER DA", "Lo", 0),
("TAI THAM LETTER LOW RATHA", "Lo", 0),
("TAI THAM LETTER RANA", "Lo", 0),
("TAI THAM LETTER HIGH TA", "Lo", 0),
("TAI THAM LETTER HIGH THA", "Lo", 0),
("TAI THAM LETTER LOW TA", "Lo", 0),
("TAI THAM LETTER LOW THA", "Lo", 0),
("TAI THAM LETTER NA", "Lo", 0),
("TAI THAM LETTER BA", "Lo", 0),
("TAI THAM LETTER HIGH PA", "Lo", 0),
("TAI THAM LETTER HIGH PHA", "Lo", 0),
("TAI THAM LETTER HIGH FA", "Lo", 0),
("TAI THAM LETTER LOW PA", "Lo", 0),
("TAI THAM LETTER LOW FA", "Lo", 0),
("TAI THAM LETTER LOW PHA", "Lo", 0),
("TAI THAM LETTER MA", "Lo", 0),
("TAI THAM LETTER LOW YA", "Lo", 0),
("TAI THAM LETTER HIGH YA", "Lo", 0),
("TAI THAM LETTER RA", "Lo", 0),
("TAI THAM LETTER RUE", "Lo", 0),
("TAI THAM LETTER LA", "Lo", 0),
("TAI THAM LETTER LUE", "Lo", 0),
("TAI THAM LETTER WA", "Lo", 0),
("TAI THAM LETTER HIGH SHA", "Lo", 0),
("TAI THAM LETTER HIGH SSA", "Lo", 0),
("TAI THAM LETTER HIGH SA", "Lo", 0),
("TAI THAM LETTER HIGH HA", "Lo", 0),
("TAI THAM LETTER LLA", "Lo", 0),
("TAI THAM LETTER A", "Lo", 0),
("TAI THAM LETTER LOW HA", "Lo", 0),
("TAI THAM LETTER I", "Lo", 0),
("TAI THAM LETTER II", "Lo", 0),
("TAI THAM LETTER U", "Lo", 0),
("TAI THAM LETTER UU", "Lo", 0),
("TAI THAM LETTER EE", "Lo", 0),
("TAI THAM LETTER OO", "Lo", 0),
("TAI THAM LETTER LAE", "Lo", 0),
("TAI THAM LETTER GREAT SA", "Lo", 0),
("TAI THAM CONSONANT SIGN MEDIAL RA", "Mc", 0),
("TAI THAM CONSONANT SIGN MEDIAL LA", "Mn", 0),
("TAI THAM CONSONANT SIGN LA TANG LAI", "Mc", 0),
("TAI THAM SIGN MAI KANG LAI", "Mn", 0),
("TAI THAM CONSONANT SIGN FINAL NGA", "Mn", 0),
("TAI THAM CONSONANT SIGN LOW PA", "Mn", 0),
("TAI THAM CONSONANT SIGN HIGH RATHA OR LOW PA", "Mn", 0),
("TAI THAM CONSONANT SIGN MA", "Mn", 0),
("TAI THAM CONSONANT SIGN BA", "Mn", 0),
("TAI THAM CONSONANT SIGN SA", "Mn", 0),
(),
("TAI THAM SIGN SAKOT", "Mn", 9),
("TAI THAM VOWEL SIGN A", "Mc", 0),
("TAI THAM VOWEL SIGN MAI SAT", "Mn", 0),
("TAI THAM VOWEL SIGN AA", "Mc", 0),
("TAI THAM VOWEL SIGN TALL AA", "Mc", 0),
("TAI THAM VOWEL SIGN I", "Mn", 0),
("TAI THAM VOWEL SIGN II", "Mn", 0),
("TAI THAM VOWEL SIGN UE", "Mn", 0),
("TAI THAM VOWEL SIGN UUE", "Mn", 0),
("TAI THAM VOWEL SIGN U", "Mn", 0),
("TAI THAM VOWEL SIGN UU", "Mn", 0),
("TAI THAM VOWEL SIGN O", "Mn", 0),
("TAI THAM VOWEL SIGN OA BELOW", "Mn", 0),
("TAI THAM VOWEL SIGN OY", "Mc", 0),
("TAI THAM VOWEL SIGN E", "Mc", 0),
("TAI THAM VOWEL SIGN AE", "Mc", 0),
("TAI THAM VOWEL SIGN OO", "Mc", 0),
("TAI THAM VOWEL SIGN AI", "Mc", 0),
("TAI THAM VOWEL SIGN THAM AI", "Mc", 0),
("TAI THAM VOWEL SIGN OA ABOVE", "Mn", 0),
("TAI THAM SIGN MAI KANG", "Mn", 0),
("TAI THAM SIGN TONE-1", "Mn", 230),
("TAI THAM SIGN TONE-2", "Mn", 230),
("TAI THAM SIGN KHUEN TONE-3", "Mn", 230),
("TAI THAM SIGN KHUEN TONE-4", "Mn", 230),
("TAI THAM SIGN KHUEN TONE-5", "Mn", 230),
("TAI THAM SIGN RA HAAM", "Mn", 230),
("TAI THAM SIGN <NAME>", "Mn", 230),
("TAI THAM SIGN KHUEN-<NAME>", "Mn", 230),
(),
(),
("TAI THAM COMBINING CRYPTOGRAMMIC DOT", "Mn", 220),
("TAI THAM HORA DIGIT ZERO", "Nd", 0),
("TAI THAM HORA DIGIT ONE", "Nd", 0),
("TAI THAM HORA DIGIT TWO", "Nd", 0),
("TAI THAM HORA DIGIT THREE", "Nd", 0),
("TAI THAM HORA DIGIT FOUR", "Nd", 0),
("TAI THAM HORA DIGIT FIVE", "Nd", 0),
("TAI THAM HORA DIGIT SIX", "Nd", 0),
("TAI THAM HORA DIGIT SEVEN", "Nd", 0),
("TAI THAM HORA DIGIT EIGHT", "Nd", 0),
("TAI THAM HORA DIGIT NINE", "Nd", 0),
(),
(),
(),
(),
(),
(),
("TAI THAM THAM DIGIT ZERO", "Nd", 0),
("TAI THAM THAM DIGIT ONE", "Nd", 0),
("TAI THAM THAM DIGIT TWO", "Nd", 0),
("TAI THAM THAM DIGIT THREE", "Nd", 0),
("TAI THAM THAM DIGIT FOUR", "Nd", 0),
("TAI THAM THAM DIGIT FIVE", "Nd", 0),
("TAI THAM THAM DIGIT SIX", "Nd", 0),
("TAI THAM THAM DIGIT SEVEN", "Nd", 0),
("TAI THAM THAM DIGIT EIGHT", "Nd", 0),
("TAI THAM THAM DIGIT NINE", "Nd", 0),
(),
(),
(),
(),
(),
(),
("TAI THAM SIGN WIANG", "Po", 0),
("TAI THAM SIGN WIANGWAAK", "Po", 0),
("TAI THAM SIGN SAWAN", "Po", 0),
("TAI THAM SIGN KEOW", "Po", 0),
("TAI THAM SIGN HOY", "Po", 0),
("TAI THAM SIGN DOKMAI", "Po", 0),
("TAI THAM SIGN REVERSED ROTATED RANA", "Po", 0),
("TAI THAM SIGN MAI YAMOK", "Lm", 0),
("TAI THAM SIGN KAAN", "Po", 0),
("TAI THAM SIGN KAANKUU", "Po", 0),
("TAI THAM SIGN SATKAAN", "Po", 0),
("TAI THAM SIGN SATKAANKUU", "Po", 0),
("TAI THAM SIGN HANG", "Po", 0),
("TAI THAM SIGN CAANG", "Po", 0),
)
|
https://github.com/Pablo-Gonzalez-Calderon/chic-header-package | https://raw.githubusercontent.com/Pablo-Gonzalez-Calderon/chic-header-package/main/manual/manual.typ | typst | MIT License | #import "@preview/codelst:1.0.0": sourcecode
#import "template.typ": *
#import "../chic-hdr.typ": *
#show link: it => text(blue, it)
#show:document-props
#title-page()
#pagebreak()
= Introduction
Chic-header (chic-hdr) is a Typst package for creating elegant headers and footers, similar as `fancyhdr` for LaTeX users.
Currently, chic-hdr is still on development, and all the code can be found at its GitHub repository #link("https://github.com/Pablo-Gonzalez-Calderon/chic-header-package", "here"). New features are welcome. So, if you have an idea that would improve this package, go on and send us the code as a Pull Request.
= Usage
To use this package through the Typst package manager (for Typst 0.6.0 or greater), write #line-raw(code: false, "#import \"@preview/chic-hdr:" + chic-version + "\": *") at the beginning of your Typst file.
Once imported, you can start using the package by writing the instruction #line-raw(code: false, "#show: chic.with(...)"), giving the chic-functions inside the parenthesis `()`.
#observation()[
From now on, the #line-raw("#show: chic.with(...)") function is going to (also) be called _main function,_ while other functions that start with `chic-` will be referred _auxiliary functions,_ or _style functions._
]
= Main function parameters
In version #chic-version, all the parameters that the #line-raw("chic()") function can receive are:
#chic-parameters()
The usage and possible values of all the parameters are detailed in the next subsections.
== Width #type-block("relative-length")
Indicates the width of both headers and footers in all the document.
Default is #line-raw("100%").
== Skip #type-block("array")
Which pages must be skipped for setting its header and footer. Other properties changed with #link(<chic-height-section>, line-raw("chic-height()")) or #link(<chic-offset-section>, line-raw("chic-offset()")) are preserved.
If you want to skip some of the last pages of your document, you can use negative indexes. For instance, #line-raw("skip: (-1, 1)") will skip both first and last pages header and footer.
Default is #line-raw("()") (empty array).
== Even #type-block("array-of-functions") #type-block("none") <even-section>
Array of auxiliary functions that will set the header and footer for even pages. Here only #link(<chic-header-section>, line-raw("chic-header()")), #link(<chic-footer-section>, line-raw("chic-footer()")) and #link(<chic-separator-section>, line-raw("chic-separator()")) auxiliary functions will take effect. Other auxiliary functions _must_ be given as an argument of the main function to take the desired effect.
If it's #type-block("none"), even pages will have their headers and footers with the style and content given at the main function (obviously, if they have been given).
Default is #line-raw("none").
== Odd #type-block("array-of-functions") #type-block("none") <odd-section>
Similarly with #link(<even-section>, `even`) parameter, it can be an array of auxiliary functions that sets the header and footer for odd pages. Here only #link(<chic-header-section>, line-raw("chic-header()")), #link(<chic-footer-section>, line-raw("chic-footer()")) and #link(<chic-separator-section>, line-raw("chic-separator()")) auxiliary functions will take effect. Other auxiliary functions _must_ be given as an argument of the main function to take the desired effect.
If it's #type-block("none"), odd pages will have their headers and footers with the style and content given at the main function (obviously, if they have been given).
Default is #line-raw("none").
== Auxiliary functions #type-block("chic-function")
These are a variable number of positional arguments that corresponds to any chic-hdr's auxiliary function. All those functions are listed in @auxiliary-functions
#heading(numbering: none, level: 2, "Example")
This example illustrates how to create a document without any header or footer on the first page, and with custom header and footer for even and odd pages.
#sourcecode(
```typst
#set page("a7")
#show: chic.with(
skip: (1,),
even: (
chic-header(center-side: [*Even page header*]),
chic-separator(1pt)
),
odd: (
chic-footer(left-side: [_Odd page's footer_]),
chic-separator(stroke(dash: "dashed"))
),
chic-height(1.5cm)
)
= Introduction
#lorem(70)
== Details
#lorem(50)
```
)
#example-box(("example-1/ex-1.png", "example-1/ex-2.png", "example-1/ex-3.png"))
= Auxiliary functions parameters <auxiliary-functions>
== #line-raw("chic-header()") <chic-header-section>
Sets the header content.
#chic-header-footer-parameters("header")
=== v-center #type-block("boolean")
Whether to vertically center `left-side`, `center-side`, and `right-side`. This is useful when any of them is higher than the others.
Default is #line-raw("false").
=== side-width #type-block("length") #type-block("relative-length") 3-item-#type-block("array")
Custom width for the different sides (left, center and right). If it's a #type-block("length") or #type-block("relative-length"), indicates the width of all three sides. Otherwise, if it's a 3-item-#type-block("array") of #type-block("length")s or #type-block("relative-length")s, the values at indexes #line-raw("0"), #line-raw("1"), and #line-raw("2") correspond to the width of `left-side`, `center-side`, and `right-side` respectively.
=== left-side, center-side, and right-side #type-block("string") #type-block("content")
Content displayed in the left, center, and/or right side of the header.
Default is #line-raw("none") (not present).
== #line-raw("chic-footer()") <chic-footer-section>
#chic-header-footer-parameters("footer")
=== v-center #type-block("boolean")
Whether to vertically center `left-side`, `center-side`, and `right-side`. This is useful when any of them is higher than the others.
Default is #line-raw("false").
=== side-width #type-block("length") #type-block("relative-length") 3-item-#type-block("array")
Custom width for the different sides (left, center and right). If it's a #type-block("length") or #type-block("relative-length"), indicates the width of all three sides. Otherwise, if it's a 3-item-#type-block("array") of #type-block("length")s or #type-block("relative-length")s, the values at indexes #line-raw("0"), #line-raw("1"), and #line-raw("2") correspond to the width of `left-side`, `center-side`, and `right-side` respectively.
=== left-side, center-side, and right-side #type-block("string") #type-block("content")
Content displayed in the left, center, and/or right side of the footer.
Default is #line-raw("none") (not present).
== #line-raw("chic-separator()") <chic-separator-section>
Sets the separator for either the header, footer or both.
#chic-separator-parameters()
Depending of the given value's type, it'll be a different behavior:
#list(marker: sym.bullet, indent: 1.25cm)[
If a #type-block("length") is given, it will correspond to the thickness of a #line-raw("line()") used as the separator.
][
If a #type-block("stroke") is given it corresponds to the stroke of a #line-raw("line()") used as the separator.
][
If a #type-block("content") is given (e.g. an image), that element is used _directly_ as the separator.
]
Also, there're custom separators that have unique styles and can be used calling the #link(<chic-styled-separator-section>, line-raw("chic-styled-separator()")) auxiliary function.
#observation()[
This function will _only_ take effect if the header or the footer are present. And also, if #link(<even-section>, `even`) or #link(<odd-section>, `odd`) options are set, their separators _must_ be set apart from the global one to appear in the document.
]
=== on #type-block("string")
Where to apply the separator. It can be #line-raw("\"header\""), #line-raw("\"footer\"") or #line-raw("\"both\"").
Default is #line-raw("\"both\"").
=== outset #type-block("relative-length")
Space around the separator beyond the page margins. It's applied in both directions (left and right).
Default is #line-raw("0pt").
=== gutter #type-block("relative-length")
How much spacing insert around the separator (above and below).
Default is #line-raw("0.65em").
== #line-raw("chic-styled-separator()") <chic-styled-separator-section>
Returns a pre-made custom separator for using in #link(<chic-separator-section>, line-raw("chic-separator()")) auxiliary function.
#chic-styled-separator-parameters()
#box(
columns(2)[
=== color #type-block("color")
Color for the separator.
Default is #line-raw("black").
=== style #type-block("string")
A string describing which separator to get. It can be #line-raw("\"double-line\""), #line-raw("\"bold-center\""), #line-raw("\"center-dot\""), or #line-raw("\"flower-end\"").
Examples of these styles are shown at right.
#colbreak()
#align(center)[
`double-line`
#chic-styled-separator("double-line")
`bold-center`
#chic-styled-separator("bold-center")
`center-dot`
#chic-styled-separator("center-dot")
`flower-end`
#chic-styled-separator("flower-end")
]
]
)
#heading(numbering: none, level: 2, "Example")
#sourcecode(
```typst
#set page("a7")
#show: chic.with(
chic-header(center-side: "Economy report"),
chic-footer(center-side: text(gray, "Online version")),
chic-separator(on: "header", chic-styled-separator("bold-center")),
chic-separator(on: "footer", stroke(dash: "loosely-dashed", paint: gray)),
chic-height(2cm)
)
= Introduction
#lorem(70)
== Details
#lorem(50)
= Conclusion
#lorem(30)
```)
#example-box(("example-2/ex-1.png", "example-2/ex-2.png", "example-2/ex-3.png"))
== #line-raw("chic-height()") <chic-height-section>
Sets the height of either the header, the footer or both.
#chic-height-parameters()
=== on #type-block("string")
Where to change the height. It can be #line-raw("\"header\""), #line-raw("\"footer\"") or #line-raw("\"both\"").
Default is #line-raw("\"both\"").
== #line-raw("chic-offset()") <chic-offset-section>
Sets the offset of either the header, the footer or both (relative to the page content).
#chic-offset-parameters()
=== on #type-block("string")
Where to change the offset. It can be #line-raw("\"header\""), #line-raw("\"footer\"") or #line-raw("\"both\"").
== #line-raw("chic-page-number()")
Returns the current page number. Useful for header and footer sides. It doesn't take any parameters.
== #line-raw("chic-heading-name()")
Returns the next heading name in the `dir` direction. The heading must have a lower or equal level than the `level` value. If there're no more headings in that direction, and `fill` is #line-raw("true"), then headings are sought in the other direction.
#chic-heading-name-parameters()
=== dir #type-block("string")
Direction for searching the next heading: #line-raw("\"next\"") (from the current page's start, get the next heading) or #line-raw("\"prev\"") (from the current page's start, get the previous heading).
Default is #line-raw("\"next\"").
=== fill #type-block("boolean")
If there's no more headings in the `dir` direction, indicates whether to try to get a heading in the opposite direction (#line-raw("true")) or not (#line-raw("false")).
Default is #line-raw("false").
=== level #type-block("integer")
Up to what level of headings should this function search.
Default is #line-raw("2").
#observation()[
Chic-hdr package also supports working with #link("https://github.com/tingerrr/hydra", "Hydra package"), so instead of using #line-raw("chic-heading-name()") auxiliary function you can give it a try to Hydra for fetching heading names ;).
]
#heading(level: 2, numbering: none, "Example")
#sourcecode(
```typst
#set page("a7")
#show: chic.with(
chic-header(
left-side: smallcaps("Thesis"),
right-side: emph(chic-heading-name())
),
chic-footer(
center-side: "Page " + chic-page-number()
),
chic-separator(1pt),
chic-offset(40%),
chic-height(2cm)
)
= Introduction
#lorem(70)
== Details
#lorem(50)
= Conclusion
#lorem(30)```
)
#example-box(("example-3/ex-1.png", "example-3/ex-2.png", "example-3/ex-3.png")) |
https://github.com/alberto-lazari/computer-science | https://raw.githubusercontent.com/alberto-lazari/computer-science/main/advanced-topics-cs/quantum-algorithms/chapters/qft.typ | typst | #import "/common.typ": *
= Quantum Fourier transform
The quantum Fourier transform algorithm (QFT) aims to compute the DFT of a vector $x in CC^(2^n)$.
The classic DFT is defined as
$ y_j = display(sum_(k = 0)^(2^n - 1)) x_k dot e^((2 pi i j k) / 2^n) quad
forall j = 0, 1, ..., 2^n - 1
$
The matrix $Q_n$ that implements the $n$-qubit QFT is
$ (Q_n)_(j k) = 1 / sqrt(2^n) omega_n^(j k) quad
forall jstr, arrow(k) in {0, 1}^n quad
omega_n = e^((2 pi i) / 2^n)
$
=== Complexity
It is not easy to declare a precise complexity for the algorithm that implements $Q_n$, but it uses a polynomial amount of resources.
By using the _elementary gate complexity_ measure the complexity can be declared as polynomial, which-in any case at all-is a huge improvement over the classical DFT algorithm (fast Fourier transform), that has a complexity of $O(n dot e^n)$.
This leads to an exponential speedup of the QFT over the classic algorithm.
|
|
https://github.com/mcanouil/quarto-invoice | https://raw.githubusercontent.com/mcanouil/quarto-invoice/main/README.md | markdown | MIT License | # Invoice Format Template (Typst)
This is a Quarto template that assists you in creating PDF invoices via Typst.
## Creating a New Invoice
You can use this as a template to create an invoice.
To do this, use the following command:
```bash
quarto use template mcanouil/quarto-invoice
```
This will install the extension and create an example qmd file that you can use as a starting place for your invoice.
## Installation For Existing Document
You may also use this format with an existing Quarto project or document.
From the Quarto project or document directory, run the following command to install this format:
```bash
quarto add mcanouil/quarto-invoice
```
## Usage
To use the format, you can use the format name `invoice-typst`.
For example:
```bash
quarto render template.qmd --to invoice-typst
```
or in your document yaml
```yaml
format:
invoice-typst:
lang: en_UK
papersize: a4
margin:
x: 2.5cm
y: 2.5cm
mainfont: "Alegreya Sans"
fontsize: 12pt
```
You can view a preview of the rendered template below: [Invoice Template](https://m.canouil.dev/quarto-invoice/index.pdf)
|
https://github.com/MooersLab/writingLogInTypst | https://raw.githubusercontent.com/MooersLab/writingLogInTypst/main/README.md | markdown | 
[](https://opensource.org/licenses/MIT)
# Writing log template in typst for journal article
## Purpose
Support the preparation of a scientific journal article for submission by providing space for thinking and planning the manuscript rather than doing this in the margins of the manuscript document.
## What is typst?
A type-setting program built on top of the programming language Rust.
It compiles small documents almost instantly, so it can be used interactively.
The [typst.app](https://typst.app) is analogous to Overleaf in the LaTeX world.
## Features
- table of contents
- Project initiation metadata
- Project management metadata
- Daily log
- To dos
- Future off-shoots
- Protocols
- List of typst links
- index
- bibliography
- single- and double-spacing
- running title in header
- 1/N page numbering
- BibLaTeX
## Sample of first page
<img width="1586" alt="Screenshot 2024-10-11 at 10 41 04 PM" src="https://github.com/user-attachments/assets/beb81060-0ae0-40ad-b51a-e35137902767">
## Contents
- typst source file template
- biblatex file
- sample PDF
- wordcount.csv
## Requirements
- typst version 0.11.0 or more recent
- in-dexter v0.6.0 to generate an index (optional).
- cheq v0.2.0 to generate checklists (optional)
## How to install packages locally
Git clone the package in {data-dir}/typst/packages/{namespace}/{name}/{version} to make it available on your system.
Here, {data-dir} is one of the following:
*Linux:* $XDG_DATA_HOME or ~/.local/share on Linux
*MacOS:* ~/Library/Application Support on macOS
*Windows:* %APPDATA% on Windows
Packages in the data directory have precedence over ones in the cache directory.
A good namespace for system-local packages is local:
Import the package in your typst file with `#import "@local/mypkg:1.0.0": *`.
## Bash or zsh function to compile to PDF and open in Preview.app on Mac (optional)
Typst compiles the *.typfile so quickly that you might as well pop open the PDF: `typc <filename prefix>`.
```bash
function typc {
echo "Compile typst file to PDF and display PDF file."
if [ $# -lt 1 ]; then
echo 1>&2 "$0: not enough arguments"
echo "Usage1: typc <filename prefix>"
return 2
elif [ $# -gt 1 ]; then
echo 1>&2 "$0: too many arguments"
echo "Usage1: typc <typst filename prefix>"
return 2
fi
typst compile $1.typ && pre $1.pdf
}
```
## Bash or zsh function to preview typst file with tinymist (optional)
Yes, I hate typing: `tmp <typst filename prefix>"
```bash
function tmp {
echo "Preview typst file in browser via tinymist."
if [ $# -lt 1 ]; then
echo 1>&2 "$0: not enough arguments"
echo "Usage1: tmp <filename prefix>"
return 2
elif [ $# -gt 1 ]; then
echo 1>&2 "$0: too many arguments"
echo "Usage1: typc <filename prefix>"
return 2
fi
tinymist preview $1.typ
}
```
## Optional bash functions to ease copying the template to a new project
Store in `.bashrc` or `.zshrc`.
Edit file paths to suit.
Two functions are provided, so you do not have to remember the order of the component names in the function name.
```bash
function typlog {
echo "Copy template writing log in typst with project number in title."
if [ $# -lt 1 ]; then
echo 1>&2 "$0: not enough arguments"
echo "Usage1: typlog projectID"
return 2
elif [ $# -gt 1 ]; then
echo 1>&2 "$0: too many arguments"
echo "Usage1: typlog projectID"
return 2
fi
projectID="$1"
echo "Write writing log to log$1.typ file."
cp ~/6112MooersLabGitHubLabRepos/writingLogInTypst/logTemplate.org log$1.typ
cp ~/6112MooersLabGitHubLabRepos/writingLogTemplateInTypst/wordcount.csv .
cp ~/6112MooersLabGitHubLabRepos/writingLogTemplateInTypst/template.bib $1.bib
}
function logtyp {
echo "Copy template writing log in typst with project number in title."
if [ $# -lt 1 ]; then
echo 1>&2 "$0: not enough arguments"
echo "Usage1: logtyp projectID"
return 2
elif [ $# -gt 1 ]; then
echo 1>&2 "$0: too many arguments"
echo "Usage1: logtyp projectID"
return 2
fi
projectID="$1"
echo "Write writing log to log$1.typ file."
cp ~/6112MooersLabGitHubLabRepos/writingLogInTypst/logTemplate.org log$1.typ
cp ~/6112MooersLabGitHubLabRepos/writingLogTemplateInTypst/wordcount.csv .
cp ~/6112MooersLabGitHubLabRepos/writingLogTemplateInTypst/template.bib $1.bib
}
```
## Update history
|Version |Changes |Date |
|:-------------|:-----------------------------------------------------------------------------------------------------|:--------------------|
| Version 0.1 | Initiate project. Added badges, funding, and update table. | 2024 October 11 |
| Version 0.2 | Added two bash convience functions to README.md. | 2024 October 19 |
## Sources of funding
- NIH: R01 CA242845
- NIH: R01 AI088011
- NIH: P30 CA225520 (PI: R. Mannel)
- NIH: P20 GM103640 and P30 GM145423 (PI: A. West)
|
|
https://github.com/LDemetrios/Typst4k | https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/foundations/context.typ | typst | // Test context expressions.
--- context-body-atomic-in-markup ---
// Test that context body is parsed as atomic expression.
#let c = [#context "hello".]
#test(c.children.first().func(), (context none).func())
#test(c.children.last(), [.])
--- context-element-constructor-forbidden ---
// Test that manual construction is forbidden.
// Error: 2-25 cannot be constructed manually
#(context none).func()()
--- context-in-show-rule ---
// Test that show rule establishes context.
#set heading(numbering: "1.")
#show heading: it => test(
counter(heading).get(),
(intro: (1,), back: (2,)).at(str(it.label)),
)
= Introduction <intro>
= Background <back>
--- context-in-show-rule-query ---
// Test that show rule on non-locatable element allows `query`.
// Error: 18-47 Assertion failed: 2 != 3
#show emph: _ => test(query(heading).len(), 3)
#show strong: _ => test(query(heading).len(), 2)
= Introduction
= Background
*Hi* _there_
--- context-assign-to-captured-variable ---
// Test error when captured variable is assigned to.
#let i = 0
// Error: 11-12 variables from outside the context expression are read-only and cannot be modified
#context (i = 1)
--- context-compatibility-locate ---
#let s = state("x", 0)
#let compute(expr) = [
#s.update(x =>
eval(expr.replace("x", str(x)))
)
// Warning: 17-28 `state.display` is deprecated
// Hint: 17-28 use `state.get` in a `context` expression instead
New value is #s.display().
]
// Warning: 1:2-6:3 `locate` with callback function is deprecated
// Hint: 1:2-6:3 use a `context` expression instead
#locate(loc => {
// Warning: 14-32 calling `query` with a location is deprecated
// Hint: 14-32 try removing the location argument
let elem = query(<here>, loc).first()
test(s.at(elem.location()), 13)
})
#compute("10") \
#compute("x + 3") \
*Here.* <here> \
#compute("x * 2") \
#compute("x - 5")
--- context-compatibility-styling ---
// Warning: 2-53 `style` is deprecated
// Hint: 2-53 use a `context` expression instead
// Warning: 18-39 calling `measure` with a styles argument is deprecated
// Hint: 18-39 try removing the styles argument
#style(styles => measure([it], styles).width < 20pt)
--- context-compatibility-counter-display ---
#counter(heading).update(10)
// Warning: 2-44 `counter.display` without context is deprecated
// Hint: 2-44 use it in a `context` expression instead
#counter(heading).display(n => test(n, 10))
--- context-delayed-warning ---
// Ensure that the warning that triggers in the first layout iteration is not
// surfaced since it goes away in the second one. Just like errors in show
// rules.
#show heading: none
= A <a>
#context {
let n = query(<a>).len()
let fonts = ("nope", "Roboto")
set text(font: fonts.at(n))
}
|
|
https://github.com/thornoar/typst-libraries | https://raw.githubusercontent.com/thornoar/typst-libraries/master/templates.typ | typst | #import "@preview/wrap-it:0.1.0": *
#import "@preview/wordometer:0.1.2": total-words, word-count
#import "@preview/equate:0.2.1": equate
#import "@preview/quick-maths:0.1.0": shorthands
// Layout
#let font = "<NAME>"
#let pagecount(format) = doc => {
set page(numbering: format)
counter(page).update(1)
doc
}
#let mtxt(str) = [ #set text(font: font); #text(str) ]
#let article(wordometerargs: ()) = doc => {
set page("a4", margin: (x: 0.7in, y: 1in))
set text(12pt, font: font)
set par(justify: true, leading: 0.5em)
set heading(numbering: "1.1.")
show heading.where(level:1): it => {
counter(math.equation).update(0)
it
}
show heading: it => {
it
v(0.1cm)
}
set math.equation(numbering: n => {
let h1 = counter(heading).get().first()
numbering("(1.1.1)", h1, n)
}, supplement: "Equation")
show: equate.with(sub-numbering: false, number-mode: "label")
show: shorthands.with(
($>=$, math.gt.eq.slant),
($<=$, math.lt.eq.slant)
)
show outline.entry.where(level: 1): it => {
v(1em, weak: true)
strong(it)
}
show ref: underline
show link: it => {
if (type(it.dest) == str) {
set text(blue)
it
} else { it }
}
set outline(indent: auto, fill: repeat([.#h(3pt)]))
set figure(gap: 1.5em)
show: word-count.with(..wordometerargs)
doc
}
// Templates
#let physics-preamble(part, due) = doc => {
import "@preview/equate:0.2.1": equate
set page(
"a4",
margin: (x:.5in, top: 0.8in, bottom: 0.5in),
header: box(
stroke: (left: none, right: none, top: none, bottom: .7pt),
inset: (bottom: 5pt),
[ PHYS1312 Homework, #part #h(1fr) <NAME> ]
),
numbering: "1"
)
set text(size: 12pt)
show: equate.with(breakable: true, sub-numbering: true, number-mode: "label")
set math.equation(numbering: "(1.1)")
table(
columns: 1,
align: (left),
inset: (left: 8pt, bottom: 3pt),
stroke: (left: 1pt, top: none, right: none, bottom: none),
table.cell(
inset: (left: 8pt, bottom: 8pt),
{ text(20pt, "PHYS1312 Homework, " + part); h(1fr) }
),
table.hline(),
text(14pt, "<NAME>, ID: 21098878"),
text(14pt, "Due date: " + due)
)
v(10pt)
doc
}
#let physics-problem(number) = underline(strong({
text("Problem " + number + ".");
h(3pt)
}))
#let math-preamble(part, due) = doc => {
set page(
"a4",
margin: (x:.5in, top: 0.8in, bottom: 0.5in),
header: box(
stroke: (left: none, right: none, top: none, bottom: .7pt),
inset: (bottom: 5pt),
[ MATH1023 Homework, #part #h(1fr) <NAME> ]
),
numbering: "1"
)
set text(size: 12pt)
set math.equation(supplement: "Formula", numbering: "(1)")
show: equate.with(sub-numbering: false, number-mode: "label")
table(
columns: 1,
align: (left),
inset: (left: 8pt, bottom: 3pt),
stroke: (left: 1pt, top: none, right: none, bottom: none),
table.cell(
inset: (left: 8pt, bottom: 8pt),
{ text(20pt, "MATH1023 Homework, " + part); h(1fr) }
),
table.hline(),
text(14pt, "<NAME>, ID: 21098878"),
text(14pt, "Due date: " + due)
)
doc
}
#let math-problem(number) = underline(strong({
text("Exercise " + number + ".");
h(3pt)
}))
#let math-solution = { underline(emph("Solution:")); h(2pt) }
#let title(
downstep: 0pt,
title,
author: "<NAME>",
titlefunction : none,
keywords: (),
keywordsfunction: none,
keywordlength: auto,
abstract: none,
abstractfunction: none,
logo: none,
date: datetime.today(),
format: "[month repr:long] [day], [year]",
index: true,
indextitle: "Contents",
index-of-figures: false,
figurestitle: "Index of Figures",
index-of-tables: false,
tablestitle: "Index of Tables",
index-of-listings: false,
listingstitle: "Index of Listings",
pagenumbering: "1"
) = doc => {
context {
let fontsize = text.size
v(downstep)
set par(first-line-indent: 0pt)
if (titlefunction != none) {
titlefunction(title, author)
} else {
set par(justify: false)
text(size: 2*fontsize+1pt, strong(title))
linebreak(); linebreak()
text(size: fontsize+5pt, author)
}
v(1fr)
if (keywords.len() > 0) {
if (keywordsfunction != none) {
keywordsfunction(keywords)
}
else {
let rownum = calc.ceil(calc.sqrt(keywords.len()))
let colnum = calc.ceil(keywords.len() / rownum)
let len = keywordlength
if (len == auto) { len = calc.min(100%, colnum*25%) }
text(size: fontsize+2pt, strong([ Keywords ])); linebreak()
line(start: (-2.5%, 0pt), length: len + 5%)
block(width: len, columns(colnum, gutter: 1em, {
let count = 0
for keyword in keywords {
if (count >= rownum) { colbreak(); count = 0 }
text(keyword); linebreak(); //linebreak()// text(", ")
count += 1
}
}))
}
}
v(1fr)
if (abstract != none) {
if (abstractfunction != none) {
abstractfunction(abstract)
}
else {
set par(first-line-indent: 0pt)
text(size: fontsize+2pt, strong([ Abstract ])); linebreak()
align(center, line(length: 105%))
abstract
align(center, line(length: 105%))
v(1em)
}
}
if (logo != none) {
align(center)[
#logo
#date.display(format)
]
}
}
pagebreak()
set page(numbering: pagenumbering)
context {
let hascontents = false
if index and (query(heading).len() > 0) {
outline(title: indextitle, target: heading)
hascontents = true
}
v(1fr)
if index-of-figures and (query(figure.where(kind: image)).len() > 0) {
outline(title: figurestitle, target: figure.where(kind: image))
hascontents = true
}
v(1fr)
if index-of-tables and (query(selector(figure.where(kind: table))).len() > 0) {
outline(title: tablestitle, target: figure.where(kind: table))
hascontents = true
}
v(1fr)
if index-of-listings and (query(selector(figure.where(kind: raw))).len() > 0) {
outline(title: listingstitle, target: figure.where(kind: raw))
hascontents = true
}
if hascontents { pagebreak() }
}
doc
}
#let diploma(
barwidth: 38mm,
barfill: white,
logo: none,
logovstep: auto,
labelfont: "FreeSans",
palesize: 100pt,
palefill: auto,
palevstep: auto,
palehstep: 0mm,
palelabel: "DIPLOMA",
labelsize: 43pt,
labelfill: auto,
labelvstep: auto,
label: none,
orgsize: auto,
org: [],
titlesize: 30pt,
title: [],
body: [],
footsize: auto,
foot: []
) = {
if (logo != none and logovstep == auto) { logovstep = (barwidth - logo.width)/2 }
if (palefill == auto) { palefill = if (barfill != none) { barfill.lighten(20%) } else { none } }
if (palevstep == auto) { palevstep = logovstep }
if (labelvstep == auto) { labelvstep = palevstep }
context {
assert(page.margin != auto, message: "please specify explicit margins")
place(
left,
dx: -page.margin.left,
dy: -page.margin.top,
rect(
fill: barfill,
width: barwidth,
height: 100% + page.margin.top + page.margin.bottom
)
)
if (logo != none) {
place(
left+top,
dx: -page.margin.left + (barwidth - logo.width)/2,
dy: -page.margin.top + logovstep,
logo
)
}
let vlabel(center, fontsize, vstep, fill, str) = {
let content = rotate(
-90deg,
text(str, size: fontsize, stroke: fill, fill: fill, font: labelfont)
)
let size = measure(content)
let dx = if center {
(barwidth - size.width)/2 - page.margin.left
} else {
-size.width/2 - page.margin.left - size.height/2 + barwidth + palehstep
}
let dy = (size.height - size.width)/2 + page.margin.bottom - vstep
place(left+bottom, dx: dx, dy: dy, content)
}
vlabel(false, palesize, palevstep, palefill, palelabel)
vlabel(true, labelsize, labelvstep, if (labelfill == auto) { page.fill } else { labelfill }, label)
if (palehstep > -1mm) {
place(
left,
dx: -page.margin.left + barwidth,
dy: -page.margin.top,
rect(
stroke: none,
fill: if (page.fill == none) { white } else { page.fill },
width: 1cm,
height: 100% + page.margin.top + page.margin.bottom
)
)
}
{
set text(stroke: barfill, fill: barfill, size: if (orgsize == auto) { text.size } else { orgsize })
org
}
linebreak()
linebreak()
{
set text(size: titlesize)
title
}
linebreak()
linebreak()
body
if (foot != none) {
v(1fr)
set text(size: if (footsize == auto) { text.size } else { footsize })
foot
}
}
}
#let clean-numbering(..schemes) = {
(..nums) => {
let (section, ..subsections) = nums.pos()
let (section_scheme, ..subschemes) = schemes.pos()
if subsections.len() == 0 {
numbering(section_scheme, section)
} else if subschemes.len() == 0 {
numbering(section_scheme, ..nums.pos())
}
else {
clean-numbering(..subschemes)(..subsections)
}
}
}
#let attention(
body,
title: [*ATTENTION*],
font: auto,
color: red,
stroke: 0.5pt,
centering: false
) = context {
let blockinset = text.size + 2pt
let blockfont = font
if (font == auto) {
blockfont = "Noto Sans"
} else if (font == none) {
blockfont = text.font
}
let titleshift = text.size / 2
let titlemargin = text.size / 6
let res = block(
above: 2em,
stroke: stroke + color,
inset: blockinset,
{
set text(font: blockfont, fill: color)
place(
top + left,
dy: -titleshift - blockinset,
dx: titleshift - blockinset,
block(fill: white, inset: titlemargin, strong(title))
)
body
}
)
if centering {
stack(dir: ltr, spacing: 1fr, [], res, [])
} else {
res
}
}
#let skew(angle, vscale: 1) = content => {
let (a,b,c,d)= (1,vscale*calc.tan(angle),0,vscale)
let E = (a + d)/2
let F = (a - d)/2
let G = (b + c)/2
let H = (c - b)/2
let Q = calc.sqrt(E*E + H*H)
let R = calc.sqrt(F*F + G*G)
let sx = Q + R
let sy = Q - R
let a1 = calc.atan2(F,G)
let a2 = calc.atan2(E,H)
let theta = (a2 - a1) /2
let phi = (a2 + a1)/2
set rotate(origin: bottom+center)
set scale(origin: bottom+center)
rotate(phi,scale(x: sx*100%, y: sy*100%,rotate(theta,content)))
}
#let namedgaps(
names,
length: 10em,
stroke: 0.5pt,
row-gutter: 1em,
column-gutter: .5em,
shift: auto
) = {
if shift == auto { shift = row-gutter / 5 }
let gap = align(bottom, move(dy: shift, line(length: length, stroke: stroke)))
grid(
columns: 2,
rows: names.len(),
row-gutter: row-gutter,
column-gutter: column-gutter,
align: (right, left),
..names.map(name => (name+[:], gap)).flatten()
)
}
|
|
https://github.com/qianxi0410/cv.typ | https://raw.githubusercontent.com/qianxi0410/cv.typ/master/README.md | markdown | MIT License | <h2 align="center"> cv.typ </h2>
> 天下苦 latex 久矣 - 鲁迅
这是一个基于 [typst](https://github.com/typst/typst) 搭建的简历模板,你可以轻松的对其进行编辑,来定制一份属于自己的简历:只需要替换 [main.toml](./main.toml) 文件中的内容,对其进行简单的字符串修改即可。
可以点击[这里](./main.pdf),来查看编译生成的pdf预览,编译时使用的字体是 [LXGW WenKai](https://github.com/lxgw/LxgwWenKai)。 |
https://github.com/Area-53-Robotics/53A-Notebook-Over-Under-2023-2024 | https://raw.githubusercontent.com/Area-53-Robotics/53A-Notebook-Over-Under-2023-2024/master/Vex%20Robotics%2053A%20Notebook%202023%20-%202024/Entries/Build%20Entry/Intake-4-Testing-Drivetrain-Bracing-LED-Code.typ | typst | #set page(header: [VR
#h(1fr)
November 24, 2023
])
= Intake No. 4 Testing + Drivetrain Bracing + LED Code
#figure(image("/Images/Code Images/BlueLEDTop.png"), caption: [Counter, used to switch between 60 different colors])
=== LED Counter
- *Lines 157 & 158* Defined two int variables, _count_ and _timeCount_
> Count is used to keep track of the current LED color and switch between them
> timeCount is used to keep track of time, which decides when the count variable changes
- *Line 161* Changes timeCount by +1 (while loop has delay of 20 milliseconds, so it goes up every 20 milliseconds)
- *Lines 163 - 165* Everytime timeCount goes up by 30 (every 600 miliseconds), count changes
- *Lines 167 - 169* Sets count back to 1 when it goes over 60
#figure(image("/Images/Code Images/BlueLEDGradient.png"), caption: [If statement contains all colors (not all are depicted here)])
=== LED Color Changes
- *Lines 171 - 184* Depending on what number count currently is, all LEDs will be set to a certain color
#figure(image("/Images/Code Images/LEDButtons.png"), caption: [Button is used to toggle the LEDs])
=== LED Button Controls
- Created boolean named _ledsOn_
- When the Y button is pressed, _ledsOn_ becomes the opposite of what it currently is
> Ex. If it is true, after pressing Y, it will become false
- When _ledsOn_ is true, the blueLEDs function will run, but when false, LEDs will clear, becoming blank
> LEDs were made toggleable so that the driver can turn them off if they become too distracting |
|
https://github.com/fenjalien/metro | https://raw.githubusercontent.com/fenjalien/metro/main/tests/template.typ | typst | Apache License 2.0 | #import "/src/lib.typ": *
#set page(width: auto, height: auto, margin: 1cm)
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/case_01.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
//
// // Error: 8-9 expected string or content, found integer
// #upper(1) |
https://github.com/Niksi-tunk/niksi-slides | https://raw.githubusercontent.com/Niksi-tunk/niksi-slides/main/main.typ | typst | #import "@preview/polylux:0.3.1": *
#import themes.metropolis: *
#set page(paper: "presentation-16-9")
#set text(size: 22pt)
#show: metropolis-theme.with(footer: [Niksi – Using Nix in education])
#title-slide(
title: "Niksi",
subtitle: "Using Nix for declarative programming environments in education",
author: [<NAME> and <NAME>rtfors],
extra: image("niksi.png"),
)
#slide(title: "Who are we?")[
#align(top)[
#side-by-side[
=== <NAME> <#link("mailto:<EMAIL>")>
- Third year CS student at Aalto
- Currently working in HPC
- I also teach programming #emoji.school (with Niklas)
- Dreaming of a declarative world #emoji.snowflake
][
=== <NAME> <#link("mailto:<EMAIL>")>
- CS and Math student at Aalto University and the University of Helsinki
- Open-Source developer
- Rust enjoyer #emoji.rocket#emoji.crab
- Haskell lover #emoji.face.hearts
]
]
]
#slide(title: "What's the problem?")[
// Early stages of programming education often suffer from time
// being wasted installing the course specific development environment on
// the students machine. *That time could be used on learning programming*.
// Each student has their own machine with problems specific to that machine
// so no single documentation can help everyone.
// This is a tremendous waste of time and resources and often leaves the
// student feeling discouraged about programming.
- Early stages of programming education often involve wasted time installing course-specific development environments.
- *Time could be better utilized for learning programming.*
- Each student's machine has unique issues.
- Difficult to provide universal documentation.
- A tremendous waste of time and resources.
- Students may feel discouraged about programming.
]
#slide(title: "How does Niksi solve it?")[
// Niksi utilizes the promises given by the Nix package manager.
// It allows the teacher of a course to define the development environment
// needed for that specific course.
// For the end-user (the students), Niksi acts as a simple and intuitive interface
// that allows the student to start coding immediately without having to
// pay any attention to the boring stuff
// #footnote[Although it might be useful to learn the boring stuff at some point #v(1em)].
- Niksi utilizes the promises given by the Nix package manager:
- *Declarative* and *deterministic* environments.
- Allows the teacher to define a development environment.
- The students:
- Get a simple and intuitive interface.
- Can start coding immediately.
- No need to learn any of the boring stuff. #footnote[Although it might be useful to learn the boring stuff at some point #v(1em)]]
#slide(title: "Workflow")[
- Niksi's user interface consists of a menu in VS Code which lists all the users courses.
- Clicking on a course opens it in a new VS Code window, where the user has all the necessary tools available to start working on the course.
]
#new-section-slide([Technical details])
#slide(title: "Behind the scenes")[
- Niksi has two components:
- The VS Code -plugin
- The NixOS WSL distro
- The plugin spawns a new VS Code process and instructs it to open the relevant directory in the NixOS WSL distro.
- Each course contains:
- An `extensions.json` file which specifies the VS Code plugins to install.
- A `flake.nix` file with a Devenv #footnote[#link("https://devenv.sh") #v(1em)] config specified by course staff.
]
#slide(title: "Devenv")[
// This config is a declarative description of the working environment for the course.
// The new VS Code window loads the config specified by the teacher of the course using the Direnv
// #footnote[#link("https://marketplace.visualstudio.com/items?itemName=mkhl.direnv") #v(1em)]
// plugin.
// The first time a course is opened it might take some time to download all the binaries from the cache,
// but after that enabling the environment will be almost instant.
- This config is a declarative description of the working environment for the course.
- The new VS Code window loads the config specified by the teacher of the course using the Direnv #footnote[#link("https://marketplace.visualstudio.com/items?itemName=mkhl.direnv") #v(1em)] plugin.
- The first time a course is opened it might take some time to download all the binaries from the cache.
- After that enabling the environment will be almost instant.
]
#slide(title: "Cross-platform??")[
- Niksi is cross platform and supports Windows, MacOS and Linux.
- Windows support is achieved through running NixOS in the WSL.
- MacOS and Linux can run the Nix package manager natively.
- The installer has to be developed somewhat separately for each platform.
- It will be based on nix-installer by Determinate Systems #footnote[#link("https://github.com/DeterminateSystems/nix-installer") #v(1em)].
]
#focus-slide[
= Actual demo
]
#slide(title: "What's next?")[
Niksi is currently implemented as a VSCode plugin, however
due to some limitations of the VSCode plugin API (and VSCode in general)
and our preference to *not write TypeScript*, Niksi will be rewritten as
VSCode-launcher (in Rust #emoji.rocket).
]
#slide(title: "What's next, continued")[
- We'll start working part-time on Niksi in September for Aalto University
- The project will be licensed under a free (as in freedom) license.
- Pilot testing at the Programming 2 course (\~750 students) in spring 2025.
- An optional way to install the environment.
- Our main focus points for Niksi:
+ Stability of core features
+ Good documentation
- We won't be able to maintain it forever.
]
#slide(title: "Other potential uses for Niksi")[
- Uses for Niksi are definitely not limited to education.
- We think Niksi (or a similar solution) could be of high usefulness in any environment where rapid context switching is required.
- e.g. Software Consulting
- Niksi and Nix is also not limited to only serving software development.
]
#focus-slide[
= Thank you for your attention!
= Questions?
]
|
|
https://github.com/XcantloadX/TypstMomoTalk | https://raw.githubusercontent.com/XcantloadX/TypstMomoTalk/main/examples/quickstart.typ | typst | #import "/momotalk/momotalk.typ": *
#import "/momotalk/characters.typ" : *
#show: doc => chat(
title: "TypstMomoTalk 快速上手", // 标题。可选参数。
author: "@XcantloadX", // 作者。可选参数。
height: 1000pt, // 高度。可选参数。
doc
)
// 以“//”开头的行是注释,不会显示到结果中。
// 提示:上面的文档开头部分暂时不用管,视为固定格式即可。
#yuuka[让我们从最简单的例子开始。]
#yuuka[请对照代码和成品来看。]
#yuuka[(提示:在右边预览里点击文字可以在左边跳转到对应的位置。)]
#hr
#yuuka[输入 `#hr` 可以产生一条分割线。]
#hr
#yuuka[发送单条消息很简单,只需输入 `#学生名称[消息内容]` 即可。]
#yuuka((
[
连续发送多条消息,格式为
```
#学生名称(([消息1], [消息2], ..., [消息n]))
```
],
[
为了美观,sensei 可以在中间换行
```
#学生名称((
[消息1],
[消息2],
...,
[消息n]
))
```
],
[需要注意小括号有两对,不要漏了!]
))
#yuuka(([学生名称一共有三种:罗马音、拼音、汉字,三种方式是等价的。], [现在使用的是罗马音。]))
#yegong[这是拼音。]
#梓[这是汉字。]
#yuuka[Sensei 可以按照自己的喜好选择。]
#yuuka[Sensei 的消息也是用类似的方法。\ `#sensei[内容]`]
#sensei[就像这样]
#yuuka[
如果想要让学生在右边发送消息,稍微复杂一些:\
`#学生名称(direction: "right")[内容]`
]
#yuuka(direction: "right")[我现在在右边。]
#hr
#yuuka[
自定义学生步骤如下:
+ 准备一张头像,上传/复制到项目里的某个位置。
我这里用的是 `examples/azusa.jpg`
+ 按照如下格式输入:
```
#let 学生名称 = messages.with("学生名称", "图片路径")
```
+ 然后按照之前的方法使用即可。
]
#let azusa_s = messages.with("꒰ঌ( ᗜ`v´ᗜ )໒꒱", "/examples/azusa.jpg")
#azusa_s[就像这样]
#hr
#yuuka[下面我们来看一下文本格式。]
#yuuka((
[
如果需要换行,在行末输入一个 `\`, \
就像这样。
如果要分段,只需要单独空一行。
],
[
这是*粗体 Bold*和_斜体Italic_。由于字体不支持,所以没有效果。\
这是#underline[下划线]。
],
[
这是#text(fill: red)[彩色文本]。 \
`fill` 后面可以是常见的颜色单词,或 RGB 颜色。 \
例如#text(fill: rgb("#000000"))[黑色文本],#text(fill: rgb(0, 0, 0))[同样是黑色文本]。
]
))
#yuuka[
下面是列表:
- 无序列表
- A
- B
+ 有序列表
+ A
+ B
]
#yuuka[其他的语法请参考 Typst 文档。]
#hr
#yuuka((
[接下来是图片,],
[插入的图片需要提前放到项目的目录下。],
[语法为 `#image("图片相对路径")`]
))
#yuuka[#image("/examples/azusa.jpg")]
#yuuka((
[如你所见,默认情况下图片可能会很大。所以我们需要指定宽度。],
[语法为 `#image("图片相对路径", width: 宽度)`。],
[宽度的单位可以为 `pt`(绝对) 或 `%`(相对)。]
))
#yuuka((
[例如 #image("/examples/azusa.jpg", width: 50pt)],
[或者 #image("/examples/azusa.jpg", width: 30%)]
))
#yuuka[如果需要让图片居中或居右,使用 `#align(image("路径"), xxx)`。]
#yuuka((
[我是填充我是填充我是填充我是填充 #align(image("/examples/azusa.jpg", width: 50pt), center)],
[我是填充我是填充我是填充我是填充 #align(image("/examples/azusa.jpg", width: 50pt), right)]
))
#hr
#yuuka[下面介绍特殊消息。]
#story_card("【这里填角色名称】")
#reply_card(
[回复卡描述文本。如果不需要,填 none],
([选项 1], [选项 2], [选项 3], [选项 N])
)
#reply_card(
none,
([选项 1], [选项 2])
)
#reply_card(
[描述文本],
none
)
#system[系统消息。]
#system[在系统消息内插入图片的格式与上面一样。]
#yuuka[语音消息:]
#yuuka((voice(5), voice(10), voice(60)))
#sensei(voice(20))
#yuuka[语音电话:]
#yuuka((
voice_call[],
voice_call[通话结束 01:45],
))
#sensei(voice_call[对方已拒绝])
#yuuka[行动消息:]
#action[这是一条行动消息。] |
|
https://github.com/pluttan/electron | https://raw.githubusercontent.com/pluttan/electron/main/dz1/dz1.typ | typst | #import "@docs/bmstu:1.0.0":*
#import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx, cellx
#show: student_work.with(
caf_name: "Компьютерные системы и сети",
faculty_name: "Информатика и системы управления",
work_type: "домашней работе",
work_num: "1",
discipline_name: "Электроника",
theme: "Исследование вольт-амперных и вольт-фарадных характеристик",
themecol2: "полупроводникового диода (Вариант №19)",
author: (group: "ИУ6-42Б", nwa: "<NAME>"),
adviser: (nwa: "<NAME>"),
city: "Москва",
table_of_contents: true,
)
= Цель работы
Исследование вольт-амперных и вольт-фарадных характеристик модели полупроводникового диода в программе аналогового и цифрового моделирования электрических и электронных цепей Micro-Cap 12.
= Задание и требования к отчету
== Задание
1. Построить прямую и обратную ветви вольт-амперной характеристики диода (модель выбирается согласно варианту, см. приложенный к заданию файл). Оценить влияние допустимого рабочего диапазона температур на характеристики полупроводникового диода.
2. Проанализировать зависимость собственной барьерной емкости диода от напряжения смещения (рекомендуется использовать параллельный резонансный контур, при этом добротность контура и частоту резонанса при нулевом смещении выбрать согласно варианту).
== Требования к отчету
Отчет должен полностью удовлетворять заданию, должен быть выполнен в соотстветствии с индивидуальным вариантом и должен быть предоставлен для проверки в обозначенные сроки. Для удобства оценки работы рекомендуется отображать в отчете все важные промежуточные этапы как с помощью вспомогательных иллюстраций, так и с помощью поясняющего текста. Отчет рекомендуется оформить в соответствии с требованиями ГОСТ 7.32-2017.
== Задание по варианту
#align(center)[
#tablex(
columns: 7,
inset: 10pt,
align: center+horizon,
rowspanx(2)[Модель\ элемента],
colspanx(4)[$U_"ст", В$],
rowspanx(2)[$a U_"ст", %\/^circle.small C$],
rowspanx(2)[$d U_"ст", %$],
[мин.],[ном.],[макс.],[$I_"ст"$, мА],
[Д816Б],[$24,2$],[],[$29,5$],[$150$],[$0,12$],[$5$]
)
#tablex(
columns: 7,
inset: 10pt,
align: center+horizon,
[$U_"пр", В$],
[$r_"ст"$, Ом],
colspanx(2)[$I_"ст", "мА"$],
rowspanx(2)[$P_"пр", "Вт"$],
rowspanx(2)[$T, ^circle.small C$],
rowspanx(2)[Модель\ в MC12 ],
colspanx(2)[При $I_"ст"$, мА],
[мин.],[макс.],
[$1,5 (500)$],[$8 (150)$],[$10$],[$180$],[$5$],[$-60...130$],[D816B]
)
#tablex(
columns: 2,
inset: 10pt,
align: center+horizon,
[Добротность\ контура],[Частота\ резонанса, кГц],
[33],[330]
)
]
= Выполнение работы
== Задание 1
Для получения прямой ветви вольт-амперной характеристики (ВАХ) диода на рабочем поле Micro-Cap 12 (МC12) составляется принципиальная схема, представленная на рис.1.
#img(image("1.png", width:60%), [Принципиальная схема])
Построим прямую и обратную ветвь ВАХ для выбранной модели диода (рис. 2-3).
#grid(
columns:2,
gutter:10pt,
img(image("2.png", width:100%), [Прямая ветвь ВАХ]),
img(image("3.png", width:100%), [Обратная ветвь ВАХ])
)
Исследуем принципиальную схему, для этого проведем анализ `Dynamic DC...`. Этот анализ называется анализом динамических процессов по постоянному току.
#img(image("4.png", width: 70%), [Анализ динамических процессов по постоянному току], f:(i)=>{i.display()})
Тут видно, что при составлении схемы ошибок допущено не было.
Проведем теперь анализ `DC...`. Этот анализ называется анализом передаточных характеристик по постоянному току. В данном случае будем анализировать зависимость ВАХ от изменения температуры.
#img(image("5.png", width: 70%), [Настройки анализа `DC`], f:(i)=>{i.display()})
#img(image("6.png", width: 70%), [Анализ `DC`], f:(i)=>{i.display()})
Получили 3 графика, наложенные друг на друга. Добавим на эти графики немного информации.
#img(image("7.png", width: 70%), [Анализ `DC`], f:(i)=>{i.display()})
Добавим несколько температур: от -60 до 60 с шагом 20.
#img(image("8.png", width: 70%), [Анализ `DC` для 7 температур], f:(i)=>{i.display()})
Графики получились похожие: чем больше температура тем сила тока возрастает быстрее с увеличением напряжения.
Теперь перестроим принципиальную схему для анализа обратной ветви.
#img(image("9.png", width: 50%), [Принципиальная схема №2], f:(i)=>{i.display()})
Снова запустим `Dynamic DC...` и увидим, что диод находится в закрытом состоянии.
#img(image("10.png", width: 50%), [`Dynamic DC` для второй схемы], f:(i)=>{i.display()})
Построим ВАХ относительно 3 температур.
#img(image("11.png", width: 50%), [Обратные ветви ВАХ при трех температурах], f:(i)=>{i.display()})
Теперь видно, что с увеличением температуры при уменьшении напряжения сила тока падает больше, причем эта зависимость нелинейна. Возьмем большее количество температур и снова запустим анализ.
#img(image("12.png", width: 70%), [`Dynamic DC` для второй схемы], f:(i)=>{i.display()})
Видно, что сила тока на температуре 120 упала настолько низко, что остальные графики практически слились в один.
== Задание 2
Для начала определим собственную емкость диода (обозначим далее как `CJO`).
#img(image("13.png", width: 70%), [Параметры диода], f:(i)=>{i.display()})
Как видим в поле `CJO` собственная емкость диода равна $133.2$ пикафарад.
Добавим в схему парраллельный колебательный контур. В параллельном колебательном контуре присутствуют три элемента: катушка индуктивности, конденсатор и резистор. Определим номиналы этих элементов.
У конденсатора возьмем $C_1 = 1..5 "CJO" tilde.eq 133.2 "пФ"$. Для разделительного конденсатора возьмем значение на порядок большее $C_1$ и $"CJO"$, $C_2 = 100..1000 "CJO" tilde.eq 65000 "пФ"$. Таким образом рассчет сложной емкости можно приблеженно произвести без учета влияния разделительного конденсатора.
$ C_к = C_1 + (C_2 times "CJO")/(C_2 + "CJO") tilde.eq C_1 + "CJO" = 433.2 "пФ" $
Номинал катушки индуктивности определим по формуле Томпсона:
$ L_1 = 1/((2 times pi times f_0)^2 times (C_1 + "CJO")) =\ = 1/((2 times 3.1415 times 300 dot 10^3)^2 times 433.2 dot 10^(-12)) tilde.eq\ tilde.eq 0,00065 "Гн" = 650 "мГн" $
Номинал резистора определяется параметрами контура и соотношением реактивных потерь в контуре к активным – то есть параметром добротности $Q$ по следующей формуле:
$ R_1 = 1/Q sqrt(L_1/C_1) = 1/33 sqrt((650 dot 10^(-6))/(300 dot 10^(-12))) = 1/33 dot 1471,96 = 44,6 "Ом" $
Помимо элементов контура в схеме присутствуют два резистора $R_2$ и $R_b$, отвечающие за сопротивление источников переменного и постоянного напряжения. Номиналы этих резисторов выбираются в диапазоне от 1 до 5 значений сопротивления контура на резонансной частоте, а это сопротивление может быть определено из значений элементов контура как
$ R_"рез" = 1/R_1 dot L_1/C_1 = (650 dot 10^(-6))/(33 times 300 dot 10^(-12)) = 65,65 "кОм" $
$ R_"2" = R_"b" = 1..5 R_"рез" tilde.eq 164,14 "кОм" $
Итак, мы рассчитали все номиналы для построения параллельного резонансного контура. Составим новую принципиальную схему, опираясь на эти значения.
#img(image("14.png", width: 70%), [Принципиальная схема для части 2], f:(i)=>{i.display()})
Заметим, что напряжение на `Vb` сейчас равно 0. В последствии мы будем изменять это напряжение и следить, как меняется резонансная частота.
Проведем анализ `AC...` -- анализ частотных характеристик. Посмотрим на зависимость `V(C1)` от изменения частоты на генераторе. Минимальное и максимальное значения возьмем как в два раза меньшее и в два раза большее отклонение от частоты резонанса.
#img(image("15.png", width: 70%), [Настройки анализа частотных характеристик], f:(i)=>{i.display()})
После этого проведем сам анализ и выделим максимум напряжения -- он будет на частоте резонанса.
#img(image("16.png", width: 70%), [Анализ частотных характеристик при `Vb = 0В`], f:(i)=>{i.display()})
При увеличении `Vb` частота резонанса и максимальное значение напряжения будут увеличиваться. Покажем это на 10 наложенных друг на друга графиках -- при `Vb = 0..10 В`.
#grid(
columns:2,
gutter:10pt,
img(image("17.png", width: 90%), [Настройки Stepping #h(1pt)]),
img(image("18.png", width: 110%), [`AC` анализ при разных значениях`Vb`])
)
Теперь по этим 10 значениям построим зависимость `CJO` от `Vb`. Для этого используем механизм `Performance Windows`. По оси X выбираем `Vb`, а по оси Y может быть любая формула, поэтому введем формулу для вычисления `CJO` через частоту резонанса:
$ "CJO" = 1/((2 times pi times f_0)^2 times L_1) - C_1 $
В MC12 эту формулу можно записать так: `1/((2*3.14*Peak_X(v(C1),1,1))^2*L(L1))-C(C1)`. Где `Peak_X` -- функция взятия значения по X (частоты) из графиков анализа.
#img(image("20.png", width: 70%), [Настройки `Performance Windows`], f:(i)=>{i.display()})
Получаем такой график:
#img(image("21.png", width: 100%), [График $"CJO"(f_0)$ (ВФХ диода)], f:(i)=>{i.display()})
Как мы видим, при увеличении напряжения собственная емкость диода падает, но при $"Vb" = 0$ емкость диода соответствует емкости в документации (рис. 13).
= Вывод
В процессе работы были исследованы вольт-амперные и вольт-фарадные характеристики модели полупроводникового диода в программе аналогового и цифрового моделирования электрических и электронных цепей Micro-Cap 12. Построны прямая и обратная ветви вольт-амперной характеристики диода. Оценено влияние допустимого рабочего диапазона температур на характеристики полупроводникового диода. Проанализирована зависимость собственной барьерной емкости диода от напряжения смещения.
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/023%20-%20Oath%20of%20the%20Gatewatch/001_The%20Rise%20of%20Kozilek.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"The Rise of Kozilek",
set_name: "Oath of the Gatewatch",
story_date: datetime(day: 09, month: 12, year: 2015),
author: "<NAME>",
doc
)
#emph[The merfolk Planeswalker Kiora has gone to great lengths to defend her world against the Eldrazi. She stole the divine weapon of a god on the plane of Theros and brought it back to Zendikar. She remembered the old stories of the merfolk gods, and how the trickster god Cosi—a garbled memory of the reality-bending Eldrazi titan Kozilek—made a fool out of Ula, the sea-god, who was really the titan Ulamog. With Ulamog rampaging across Zendikar, Kiora was inspired by the old stories of Cosi's tricks to face off against what she thinks of as Ula, god of the sea.]
#emph[The other Planeswalkers who are fighting the Eldrazi think they are trapping Ulamog, but Kiora has no intention of stopping there. She has her god-weapon. She has mighty allies of the deep. Her course now is clear.]
#emph[Her battle with a god is finally at hand.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kiora descended smoothly from the dizzying heights of Sea Gate, standing at the tip of a massive suckered tentacle, gripping the bident that was going to kill a god.
Planeswalkers were supposed to have #emph[vision] .
She wasn't angry. Not really. She hadn't gotten this far by relying on others to see things her way, and she wasn't entirely sure why she'd bothered trying to convince them. But the thought of facing Ula was so grand, so intoxicating. And she had a weapon that could do the job. Surely #emph[someone] would want to share in that triumph!
Kiora's gills opened as the giant octopus's tentacle plunged beneath the surface. There, waiting for her in the shallow waters that lapped against Sea Gate, was her own army, the one the dry-walkers had dismissed: five of Cosi's own tricksters and a legion of sea monsters.
"What's the plan?" asked one of the tricksters, in the peculiar language used by merfolk underwater. Shen, his name was.
"We split up," said Kiora. "We don't have as much time as we thought."
"Something wrong?" asked another of the tricksters, Yesha.
"Not at all," said Kiora. "Ula is—Ulamog is coming here."
"Says who?" asked Shen.
Tricksters were notoriously skeptical, keenly aware of how easy it is to make a claim—and how difficult to prove one false.
"A ruin diver named <NAME>," said Kiora.
"I've heard of her," said Shen. "She's trustworthy."
A careful choice of words. Jori might be reliable, but she was no devotee of Cosi.
"It gets better," said Kiora. "You remember those other worlds I told you about? The ones I can travel to?"
The tricksters murmured affirmatives. She wasn't sure how much of it they believed, but it was plain enough that the bident came from nowhere on Zendikar.
"Well, according to the scholars up in the tower, we may not even need to kill Ulamog. If we hurt him enough, he might leave Zendikar behind and trouble some other world."
The tricksters didn't rejoice—she hadn't expected them to—though probably not for the same reasons as the softhearted elf up in the tower.
"If he can leave, he can return," said Yesha.
"If he leaves," said Kiora, gripping her stolen god-weapon, "I can follow."
"So what's the plan?" asked Shen again. He was the least patient of the five, the most likely to question her—a truly devoted worshiper of Cosi. Kiora liked Shen.
"#emph[Their] plan is to lure the titan into some kind of hedron trap," said Kiora, "and bind him to this world, as he was before. No doubt it's an appealing notion for people who can pack up and leave when it's finished."
The tricksters made sounds of disgust.
"Our plan is to kill him if we can, and drive him off if we can't," said Kiora. "Fortunately for us, their plan and ours are compatible...to a point. We're going to hit Ulamog hard with everything we've got, and if that means we take advantage of their diversion, all the better. Tola, Inash, Runari—you stay here. Help the other world-walkers with their hedron trap, and pitch in on killing Ulamog if they come to their senses. If not...do what you have to do."
#figure(image("001_The Rise of Kozilek/01.jpg", width: 100%), caption: [Kiora, Master of the Depths | Art by Jason Chan], supplement: none, numbering: none)
The three tricksters nodded and swam away. Kiora sent a command out to half of her sea monsters, a gentle reminder that these merfolk issued commands in her name. She put the odds of that working at about even—tidal chances, merfolk called that, sometimes in and sometimes out. But the tricksters should be safe, at least.
Kiora turned and swam away from Sea Gate, out into the open ocean. Shen and Yesha fell in with her, along with the other half of her armada. They fought their way through the cloud of swimming Eldrazi spawn that surrounded Ula, and then they were free, with nothing but water ahead of them.
"What about us?" asked Shen. "Where are we going?"
"Out and down," said Kiora. #emph[Out] was a merfolk compass-point, always away from the nearest coast—though Kiora sometimes used it to describe that direction only she and those like her could move, out from the world and away from the shores of reality.
"You going to tell us why?" asked Shen.
"It's important enough to turn Kiora away from Ulamog," said Yesha. "That's good enough for me."
That shut Shen up, at least, but Kiora could see him out of the corner of her eye, jaw set, eyes dark. The tricksters didn't follow Kiora because she was a Planeswalker, or even because she was powerful. They followed her because they wanted to be a part of the story she was telling, a story about stealing a weapon from one god and using it to fell another.
They swam through that sullen silence for a long time, past the continental shelf and out over open waters. Behind and beneath them were Kiora's sea monsters, restlessly snapping at one another as they swam. They were bored, ready for action. Kiora didn't blame them.
"This is far enough," said Kiora, and the trio came to a stop.
Shen and Yesha waited.
"For thousands of years, we and our ancestors unknowingly worshiped the Eldrazi titans," said Kiora. "I'm sure there are some who still do."
Shen grumbled at that. Many merfolk assumed that if any of their people still held the Eldrazi in reverence, the tricksters must surely be among them—when in fact nothing could be further from the truth.
"We who have kept the faith of Cosi know that there's nothing special about gods. There's no such thing as divinity. There's only power. And anything with enough power, especially something ancient, can lay claim to the mantle of godhood. I stole this weapon from a being who called herself a god, and it is a weapon worthy of one. But let's remember that the Eldrazi aren't the only things our people have worshiped as divine."
She looked down, into the abyss that stretched out beneath them. Shen's eyes grew wide.
"After all," said Kiora, "what else do you call a being who may have been alive to see the Eldrazi imprisoned to begin with? What else do you call the one whose every move commands the tides themselves?"
Now Yesha understood, too. Kiora saw it in her eyes.
Kiora held the bident out in front of her and channeled every bit of power she had in her. The bident began to glow—blue, then white, until the glare of the thing was blinding. Kiora spread out through the currents, the tendrils of her awareness reaching out like squirming tentacles. She lost herself, a speck floating in a vast and hungry sea, and Zendikar's oceans opened themselves to her. Nearby—close to the speck, much too close—was Ula, a great dark blot spreading an ink-stain of dead, senseless corruption.
She reached farther, then. Across the sea. The shapes of the continents revealed themselves in negative space, the ridges and valleys of the seafloor reaching up between them. Somewhere out there, swimming across the wide, dark sea, were her sister and a few dozen other merfolk, but Kiora couldn't pick them out from the whales and the krill and the flotsam. Past them, then, or past where she hoped they were by now, to the far-off shores of Murasa.
There. She found him, coiled tightly in the depths, dormant. Slumbering. Kiora had never dared to call upon him—had not been sure, if she was being honest, whether she even could. But she was not calling him now, not really, or at least not alone. The bident was calling. He would answer.
In the distant darkness, an eye opened.
Kiora came back to herself, opened her own eyes. She had no idea how long it had been, but she felt the way she would after hours of swimming. The bident's glow faded, but didn't fully dissipate, pulsing gently in a slow, steady rhythm.
"What is this?" asked Shen. "Why call to him, if Ulamog is so close? What good does power do us if it's an ocean away?"
"None at all," said Kiora. "That's why I didn't call him."
The water grew very cold, and very still.
"I #emph[summoned] him."
Yesha balked.
"What makes you think you can even—"
Then he was there with them, a vast and churning darkness that blotted out what little sun filtered down to them.
#figure(image("001_The Rise of Kozilek/02.jpg", width: 100%), caption: [Lorthos, the Tidemaker | Art by Kekai Kotaki], supplement: none, numbering: none)
#emph[Lorthos!]
She summoned, and he came! Kiora would have laughed, if it had been a little less terrifying.
The great bulk moved, rotated, a whole landscape of barnacles and scars and heaving, rubbery flesh flashing by beside them. It was dizzying, like flying. At length, an enormous beak rolled into view, a maw that could swallow a whale without chewing.
#emph[Wait!] sent Kiora, holding out the bident once more. She channeled the thought through the bident, but it wasn't a command, not like when she demanded that her lesser sea beasts obey her. It was a plea. #emph[There are interlopers in your sea, great one] . #emph[Will you fight them with me?]
The beak opened and closed and opened again, but the great octopus did not swallow her whole.
#emph[I am not weak,] thought Kiora. #emph[I summoned you here, and I bear a weapon that can hurt them. Together, you and I can teach these creatures a lesson in humility.]
These were constructs of civilization, #emph[weapon] and #emph[lesson] and #emph[humility] , but surely something within Lorthos knew that he was power, and power must defend itself.
The beak closed, and the vast intricacy of Lorthos's enormous body flew past them once more. At last, his eye rolled into view, shining blue, the eye and the bident pulsing together in time. How small three little merfolk must seem to him! Insignificant motes, dancing in darkness, daring to speak his name.
Then he turned and sank beneath them, exposing the top of his mantle. Suction drew Kiora and her tricksters in, and they swam with it. Her lesser sea creatures backed away to the edges of her awareness, trying to stay out of grasp of those enormous tentacles.
"Grab hold of something!" said Kiora. "This isn't going to be gentle."
Shen and Yesha found resting places among the ridges of Lorthos's skin. Scars deep enough to hide in, barnacles bigger than the biggest clams she'd ever seen—the scale of him was almost incomprehensible. #emph[And Ula is bigger still.]
Kiora took her place at the top of Lorthos's mantle, her bident still pulsing in rhythm with his eye. Shen took a place near her, no doubt ready to take up the bident should she fall. She caught his eye and winked.
#emph[Not yet.]
Then Lorthos rose, and Kiora rose with him.
She didn't need to tell him where to go. He knew, could sense the intrusion of the Eldrazi titan in his seas. He couldn't know of other worlds, likely had no idea what the Eldrazi were. But he knew power—and he knew a challenge.
Lorthos lunged forward in bursts, expanding and contracting like a massive heart. Kiora gritted her teeth. Traveling by octopus was always like this, but this was worse—he was so damned #emph[big] . Still, she couldn't argue with the results, as each surge pushed them hundreds of yards forward.
Slowly but inexorably, Lorthos and Ula converged on Sea Gate.
Kiora's sea monsters spread out around them, acting as a screen against the waves of spawn. Her mind was pulled in dozens of directions at once, trying to maintain control of this vast armada as its members were injured, their dull instincts shifting from fight to flight.
The water grew shallower as they approached, and soon each of Lorthos's pushes lifted his passengers out of the water, blinking in the sun and air, only to send the ocean crashing back down around them. Then it was too shallow even for that, and Lorthos pulled himself along with his tentacles. His mantle broke the surface and stayed there, raising great waves in the little harbor and giving Kiora her first clear view of the enemy.
The other Planeswalkers' plan was working. Ula stood within a ring of hedrons, which glowed brightly with binding, blinding light. His arms and tentacles thrashed, batting at his assailants and his prison, but he seemed to be trapped.
#figure(image("001_The Rise of Kozilek/03.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Look at him! #emph[This] was the face of a god? This dull, bone-white blankness? He looked so stupid, flailing around like a cuttlefish caught in a trap. Why had anyone ever thought this pathetic creature was worthy of reverence? Just because he was big? Ha!
He really was big, though.
Here, so close and drawing closer, the enormity of her foe began to sink in. He towered above the water, nearly as tall as the lighthouse even though he was partially submerged. Set against an Eldrazi titan, even Lorthos looked small. In a head-to-head fight, the great octopus of Murasa probably wouldn't stand a chance. Good thing he had her to help him.
Then something went—wrong. The power coursing through the network of hedrons went red, then black. It flared on one of the hedrons, a dark flash. Then, one by one, the hedrons began to fall from the sky.
Kiora didn't know what had happened, or how. Maybe the hedrons had been rotten, or defective, or whatever it was hedrons got when you left them lying around for a few too many centuries. Or maybe he had simply broken free. Whatever the cause, the effect was clear: Ula was free of his prison.
#emph[Forward!] she urged Lorthos, though he hardly needed her to tell him. She grinned and risked standing, steadying herself with the bident. At last, she would punish Ula for what he had done to her people and her world—for the destruction since his release, for the millennia of deception before it, for being the festering rot at the heart of this plane for so very long.
"Ula!" she cried. "Turn and face me, you wretch!"
Shen looked at her like she'd gone mad. It was gratifying.
Ula did not turn toward her, but away, to lumber along the sea wall, toward the shore. #emph[Coward!]
The water began to churn, turning choppy and violent. At first she thought it might be her own fury, channeled unconsciously through the bident. But no—no, this was something else. Something else was happening and she didn't know what it was and then she saw it and #emph[oh gods and monsters—]
#figure(image("001_The Rise of Kozilek/04.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
The alien shape that rose above the landscape was horribly familiar. A crown of jet-black blades rested upon the nothing that ought to be the thing's head—impossibly flat, impossibly black, like holes in space. A mantle of shining carapace spread out beneath them. His enormous hands reached out, grasping, two swords of obsidian reaching back from his forearms.
#emph[Cosi.]
With one lurch he was in the water, sending a wave surging across the bay. Another and he stood before Sea Gate. He raised one enormous arm and swung, and the gleaming white stone of the sea wall seemed to stretch beneath it, to melt, to flow out and around in spiraling squares the color of oil on water. Kiora watched helplessly as the Halimar Sea, its water level held high above the ocean by Sea Gate itself, began to pour through the gap, cascading around Cosi's arm in impossible geometries.
The two titans moved toward one another, and for a mad moment Kiora thought they might battle for the privilege of devouring Zendikar. They brushed past each other, slow and smooth as icebergs. The moment passed.
Cosi turned toward her.
The world seemed to bend around him, as though he were its center. Those perfect black shards above his head seemed to draw in light itself. She couldn't understand the shape of them, or whether they were even solid. Where they overlapped, they seemed to merge together. They weren't objects, or even shapes—they were holes in space, and they captivated her.
Who had taught her that gods could be defied? Whose example had led her on this collision course with a god—with two? Cosi stories had shown her that Ula could be tricked, beaten, brought low. But there was one thing she'd forgotten in her rush to confront Ula, one thing that every Cosi story had in common.
Cosi always won. Not the mortals who followed his example. Not the dolphins who chattered his praises. #emph[Cosi] always won. Kiora had tricked Thassa, had thought to humble Ula. But Cosi had tricked her.
A movement out of the corner of her eye brought her back to her senses. Shen stood next to her, expression slack, eyes black. Around his head floated a crown of obsidian shards, like Cosi's.
He lunged for her.
Kiora stumbled backward across Lorthos's craggy skin. Shen kept coming, reaching for her—mindless, lost. The bident lodged against one of the great octopus's scars, and she was stuck. She only had a moment to decide.
The bident was a god's weapon, yes. It had vast power, some of which, no doubt, she had yet to even glimpse. But it was, in the end, a weapon, and could serve as any other weapon would.
She raised the bident, and its twin points buried themselves in Shen's chest.
Shen's eyes cleared, and the shards above his head vanished. He looked at her, hands clutching numbly at the bident. He tried to say something, or ask something, but all that came out was a kind of low, whistling moan. Blood seeped out around the points of the bident.
She kicked him away. The bident slipped out of him easily, bright-red blood splashing against Lorthos's skin. Shen fell away from her, slid, tumbled into the water, and was gone.
Cosi towered over her now, his writhing tendrils and Lorthos's tentacles entangling furiously. Kiora pumped power into the bloodstained bident, bolstering Lorthos for the fight, but the octopus was hopelessly outmatched. Cosi's arms rotated impossibly, bent strangely at that hideous double elbow. The obsidian blades that extended from his forearms scooped low into the sea and rose above her, seawater cascading from them. These, truly, were the weapons of a god. Compared to them the bident was a trinket.
One massive blade, then the other, slammed down into Lorthos's body. The second one missed Kiora by less than its width. Blue blood, almost black, welled up around them.
Kiora stared up at Cosi, but Cosi didn't stare back. He couldn't—no head, no face, just a vast and alien presence towering above her. He'd attacked Lorthos because the octopus was the only foe anywhere close to his size. Kiora and her precious bident were insignificant, beneath his notice.
She understood, finally, where she had gone wrong. Cosi hadn't tricked her. Cosi had no understanding of the little story she'd been telling—the one that cast the tricksters as loyal dolphins and the other Planeswalkers as fools and herself, laughably, as Cosi.
Thassa had hated her. Cosi couldn't even see her.
With a wet and horrible sound, Cosi pulled his arms apart. Lorthos's body shuddered and split, fountains of dark blue blood splattering into the water. The bident's light went out. Kiora lost her footing and fell, as Cosi let the two uneven halves of the ocean's mightiest champion slide from his blades.
As she fell, the bident slipped from her numb fingers. She watched, helpless, as her greatest trophy tumbled away.
She'd killed Shen. Probably the other tricksters, too, and dozens of her noble ocean behemoths. Lorthos, bringer of the tides, perhaps the oldest and greatest creature of Zendikar's seas. She'd killed all of them. They'd believed in her, believed in her little toy, believed in her stories. And they'd died for it. At least her sister had left her, thank the gods. Thank whomever.
Cosi blotted out the sun. No—not Cosi. #emph[Kozilek] , massive and impossible, a twisted mockery of the idea of gods.
She hit the water, and blackness claimed her.
#figure(image("001_The Rise of Kozilek/05.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
|
|
https://github.com/hewliyang/fyp-typst | https://raw.githubusercontent.com/hewliyang/fyp-typst/main/front-page.typ | typst | #align(center + horizon)[
#align(center, text(17pt)[*Evaluating Synthetic Speech*])
#align(center, [
<NAME> \
<EMAIL> \
])
#v(14pt)
#align(center, [
*Supervisor*: Assistant Professor <NAME> \
*Examiner*: \<insert examiner name here>
])
#v(14pt)
#align(center, [
Honours Year Project For Semester 1, AY2024/2025 \
Department of Statistics and Data Science\
National University of Singapore
])
] |
|
https://github.com/rabotaem-incorporated/algebra-conspect-1course | https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/06-field-theory/01-factorrings.typ | typst | Other | #import "../../utils/core.typ": *
== Факторкольца и гомоморфизмы колец
#ticket[Теорема о гомоморфизме для колец]
#notice[
$R$ --- кольцо (ассоциативное, коммутативное, с единицей)\
$I$ --- идеал, то есть $I$ подгруппа в $R$ и $R I subset I$
$R fg I$ --- факторгруппа, причем $(a + I) (b + I) = a b + I$. Покажем корректность умножения.
$
a' in a + I, b' in b + I, <==> \
a' = a + lambda, lambda in I, b' = b + mu, mu in I. \
a' b' = a b + lambda b + a mu + lambda mu in a b + I.
$
Заметим, что $R fg I$ --- кольцo.
]
#def[
Такие кольца называют _факторкольцами_ по идеалу $I$. Обозначается $R fg I$.
]
#pr[
$R$ --- область главных идеалов, $p in R$, $p != 0$. Тогда $R fg (p)$ --- поле тогда и только тогда, когда $p$ неприводимый.
]
#proof[
- "$==>$":
+ $p in R^* ==> p^(-1) in (p) ==> e in (p) ==> (p) = R ==> R fg (p) = {0}$ --- не поле.
+ $p = a b ==>$ в $R fg (p)$
$
overline(a b) = overline(0)\
overline(a) dot overline(b) ==> cases(delim: "[", overline(a) = 0, overline(b) = 0) ==> cases(delim: "[", p divides a\, space a = p c, p divides b)\
p = p c b, space c b = 1, space b in R^*
$
- "$<==$": Пусть $p$ --- неприводим. Требуется доказать следующие утверждения:
+ В $R fg (p)$ выполнено $0 != 1$.
$ 0 = 1 ==> 1 in 0 + (p) = (p) ==> p in R^* $
+ $overline(a) != 0 ==> overline(a) in (R fg (p))^*$
$
p divides.not a &==> (p, a) = 1 ==> \
&==> p b + a c = 1 "для некоторых" b, c in R ==> \
&==> 0 overline(b) + overline(a) overline(c) = 1 ==> \
&==> overline(a) in (R fg (p))^*
$
]
#notice[
$R fg I$ --- поле $<==>$ $I$ --- максимальный идеал в $R$ (максимальный идеал --- всякий идеал, не содержащийся ни в каком другом идеале)
]
#example[
+ $RR[x] fg (x^2 + 1) = CC$
+ $QQ[x] fg (x^3 - 2)$
+ $FF_2[x] fg (x^2 + x + 1)$
]
#def[
Пусть $R$, $S$ --- кольца. $f: R --> S$ --- гомоморфизм колец, если
+ $f(a + b) = f(a) + f(b)$.
+ $f(a b) = f(a) f(b)$.
+ $f(1_R) = 1_S$.
]
#th(name: "О гомоморфизме для колец")[
Пусть $phi: R --> S$ --- гомоморфизм колец. Тогда:
+ $Ker phi$ --- идеал в $R$,
+ $Im phi$ --- подкольцо в $S$,
+ Существует изоморфизм
$
R fg Ker phi &--> Im phi\
r + Ker phi &maps phi(r)
$
]
#let ol = math.overline
#proof[
Знаем, что существует изоморфизм групп, действующий как в пункте 3.
Надо проверить, что такой изоморфизм сохраняет умножение:
$
ol(phi)(ol(a) ol(b)) = ol(phi)(ol(a b)) = phi(a b) = phi(a) phi(b) = ol(phi)(ol(a)) ol(phi)(ol(b)), \
ol(phi)(ol(1_R)) = phi(1_R) = 1_S = 1_(Im phi).
$
]
#follow[
Пусть $F$ --- поле, $R$ --- ненулевое кольцо. $phi: F --> R$ --- гомоморфизм. Тогда $phi$ инъективен.
]
#proof[
$R != 0 ==> 1_R != 0_R$\
Рассмотрим $Ker phi$ --- идеал в $F$, но в поле есть всего 2 идеала. Поэтому либо $Ker phi = 0$, либо $Ker phi = F$.
Если $Ker phi = F$, то $phi(1_F) = 0_R$, но она должна переходить в $1_R$, поэтому этот случай не реализуется. Из $Ker phi = 0$ следует инъективность.
]
#notice[
Так $phi$ --- всегда инъекция, о _"гомоморфизме полей"_ не говорят. Имеет место понятие _"вложения поля"_.
]
|
https://github.com/sthenic/technogram | https://raw.githubusercontent.com/sthenic/technogram/main/src/descriptions.typ | typst | MIT License | #import "keep-with-next.typ": *
#let describe(label, note: none, indent: 30pt, body) = {
grid(
columns: (indent, 1fr, auto),
align: (left, left, right),
row-gutter: 0pt,
inset: (x: 0pt, y: 5pt),
/* Label row */
grid.cell(colspan: 2)[
/* Somewhat hacky solution to keep the label row together with the first
line of text, see function comment. */
#keep-with-next[
#if type(label) == str { strong(label) } else { label }
]
],
if type(note) == str { emph(note) } else { note },
/* Content row */
[], grid.cell(colspan: 2, body),
)
}
|
https://github.com/MaxAtoms/T-705-ASDS | https://raw.githubusercontent.com/MaxAtoms/T-705-ASDS/main/content/week1.typ | typst | #import "../template.typ": example
#import "../tags.typ": week, barron
== Applications in reliability
#week("1")
#barron("2.2.3")
Calculation of the probability of events is often used in reliability.
Probability for a system composed of several components to be functional:
- *Parallel connection:* It is enough for at least one component to be functional
$ P("OK") = P("at least one component OK") = 1 - P("all components fail") $
- *Sequence connection:* Failure of one component causes the whole system to fail
$ P("OK") = P("all components OK") $
#example[
All systems have a reliability of 0.92 and are independent.
#import "fletcher-reliability.typ": reliabilityExample
#figure(reliabilityExample)
$ P(F) &= P("A and B ok") = P(A) * P(B) = 0.8464 \
P(G) &= P("Either D or E work") = 1 - P("E and D fail") = 1 - (1-0.92)^2 = 0.9936 \
P(H) &= P(C sect G) = P(C) * P(G) = 0.92 * 0.9936 = 0.9141 \
P(F union G) &= 1 - P(accent(F, macron) sect accent(H, macron)) = 1 - P(accent(F, macron)) * P(accent(H, macron)) = 1 - (1-0.8464)(1-0.914) = 0.9868 $
]
|
|
https://github.com/eliapasquali/typst-thesis-template | https://raw.githubusercontent.com/eliapasquali/typst-thesis-template/main/config/variables.typ | typst | Other | // All reusable variables here
#let myLang = "it"
#let myName = "<NAME>"
#let myMatricola = "42"
#let myTitle = "Titolo della tesi"
#let myDegree = "Tesi di laurea"
#let myUni = "Università degli studi di Padova"
#let myDepartment = "Dipartimento di Matematica ''Tullio Levi-Civita''"
#let myFaculty = "Corso di Laurea in Informatica"
#let profTitle = "Prof. "
#let myProf = "<NAME>"
#let myCompany = "Nome azienda"
#let myTutor = "<NAME>"
#let myLocation = "Padova"
#let myAA = "AAAA-AAAA"
#let myTime = "Mese AAAA" |
https://github.com/ad-si/invoice-maker | https://raw.githubusercontent.com/ad-si/invoice-maker/master/template/main.typ | typst | ISC License | #import "@preview/invoice-maker:1.1.0": *
#show: invoice.with(
language: "en", // or "de"
banner-image: image("banner.png"),
invoice-id: "2024-03-10t172205",
// // Uncomment this to create a cancellation invoice
// cancellation-id: "2024-03-24t210835",
issuing-date: "2024-03-10",
delivery-date: "2024-02-29",
due-date: "2024-03-20",
biller: (
name: "<NAME>",
title: "Inventor",
company: "Crazy Inventions Ltd.",
vat-id: "DL1234567",
iban: "DE89370400440532013000",
address: (
country: "Disneyland",
city: "Duckburg",
postal-code: "123456",
street: "Inventor Drive 23",
),
),
hourly-rate: 100, // For any items with `dur-min` but no `price`
recipient: (
name: "<NAME>",
title: "Treasure Hunter",
vat-id: "DL7654321",
address: (
country: "Disneyland",
city: "Duckburg",
postal-code: "123456",
street: "Killmotor Hill 1",
)
),
items: (
(
// number: 3, // You can also specify a custom item number
date: "2016-04-03",
description: "Arc reactor",
// dur-min: 0, Either specify `dur-min` or `quantity` & `price`
quantity: 1,
price: 13000,
),
(
date: "2016-04-05",
description: "Flux capacitor",
dur-min: 0,
quantity: 1,
price: 27000,
),
(
date: "2016-04-07",
description: "Lightsaber",
dur-min: 0,
quantity: 2,
price: 3600,
),
(
date: "2016-04-08",
description: "Sonic screwdriver",
dur-min: 0,
quantity: 10,
price: 800,
),
(
date: "2016-04-12",
description: "Assembly",
dur-min: 160,
quantity: 1,
price: 53.33,
)
),
)
|
https://github.com/OCamlPro/ppaqse-lang | https://raw.githubusercontent.com/OCamlPro/ppaqse-lang/master/src/étude/introduction.typ | typst | #import "links.typ": *
#import "defs.typ": *
= Introduction
== Terminologie
#align(
center,
table(
columns: (auto, auto),
align: (center, left),
[*Terme*], [*Définition*],
[COTS <cots>], [_Commercial Off-The-Shelf_ ou produit sur étagère],
[WCET <wcet>], [
_Worst Case Execution Time_ ou temps d'exécution du pire cas
(_i.e._ maximal)
],
)
)
== Organisation du document
Le document présente les langages C, C++, #Ada, #Scade, #OCaml et #Rust
d'un point de vue de la sûreté logicielle embarquée selon un plan organisé en
trois axes:
1. une description du langage décrivant
+ son paradigme;
+ ses mécanismes de protection;
+ ses compilateurs;
+ son adhérence au système;
+ ses gestionnaires de paquets;
+ sa communauté.
2. l'outillage présent dans l'écosystème du langage :
+ les débugueurs;
+ les outils de tests;
+ les outils de _parsing_;
+ les capacités de méta-programmation;
+ les possibilités de dérivation.
3. les aspects de sûreté logicielle :
+ les outils d'analyse statique disponibles;
+ les moyens de formalisation;
+ le calcul statique du WCET;
+ le calcul statique de la taille de pile maximale;
+ les outils de qualité numérique;
+ l'assurance générale de la qualité du code;
+ l'utilisation dans le domaine critique.
== Note méthodologique
La méthodologie utilisée pour l'étude des langages reprend les points abordés
dans les clauses techniques #cite(<ctcots>).
De manière générale, l'étude est basée sur le contenu publique disponible sur
internet, les brochures techniques ou commerciales et les connaissances propres
des auteurs. Le volume d'information obtenu étant inégal suivant les outils,
la complétude des informations fournies dans ce rapport n'est pas assurée.
Toutefois, et sous réserve que les informations publiques soient à jour, elles
sont _a priori_ correctes.
Ce rapport étant lui même destiné à être _open source_, nous invitons
le lecteur à participer à son amélioration continue en signalant toute
erreur ou en contribuant via le dépôt https://github.com/OCamlPro/ppaqse-lang.
Pour des questions de lisibilité du document, certains points méthodologiques ou
explications sont renvoyés en annexe.
|
|
https://github.com/timon-schelling/uni-phi111-essay-2024-01-29 | https://raw.githubusercontent.com/timon-schelling/uni-phi111-essay-2024-01-29/main/src/main.typ | typst | #import "template/template.typ": *
#let bib-urls = {
sys.inputs.at("urls", default: none) != none
}
#let theme = {
sys.inputs.at("theme", default: none)
}
#set page(fill: rgb("1a1a1a")) if theme == "dark"
#set text(fill: rgb("c7c7c7")) if theme == "dark"
#show: project.with(
title: "Rekonstruktion des Kapitels zu Hermeneutik aus Hans Posers Einführung in die Wissenschaftstheorie - Ergebnisprotokoll zur Sitzung am 08-01-2024",
authors: (
"<NAME>",
),
date: "2024-01-29",
title-page-infos: [
#set text(size: 0.97em)
#table(
columns: (8em, auto),
inset: (x: 0em, y: 0.6em),
stroke: none,
[Universität:], [<NAME>ky Universität Oldenburg],
[Fakultät:], [Fakultät IV - Human- und Gesellschaftswissenschaften],
[Studiengang:], [Philosophie/Werte und Normen Zwei-Fächer-Bachelor],
[Semester:], [Wintersemester 2023/2024],
[Veranstaltung:], [Seminar: 4.03.1107 Wissenschaftstheorie - Eine philosophische Einführung],
[Dozent:], [<NAME>],
[Mail:], [#link("mailto:<EMAIL>"), #link("mailto:<EMAIL>")]
)
],
font: "Times New Roman",
bib-urls: bib-urls,
)
#let argument(premises, conclusion) = align(left, [
#set text(style: "italic")
#table(inset: (x: 0.8em, y: 0em), stroke: none)[
#table(
stroke: none,
inset: (x: 0.1em, y: 0.4em),
columns: 3,
..premises.enumerate(start: 1).map(e => {
let (i, premise) = e
([$P_#i$], [$:$], premise)
}).flatten(),
..([$K$], [$:$], conclusion)
)
]
])
= Einleitung
In dieser Arbeit wird das Kapitel zur Hermeneutik aus Hans Posers Einführung in die Wissenschaftstheorie rekonstruiert. @poser2001[vgl.&217-242]
<NAME> ist ein deutscher Philosoph und Wissenschaftstheoretiker, der sich in seinen Werken mit der Wissenschaftstheorie und der Philosophie der Geisteswissenschaften auseinandersetzt.
Sein Buch Einführung in die Wissenschaftstheorie bietet eine umfassende Darstellung der wichtigsten Themen und Debatten in der Wissenschaftstheorie. @poser2001[vgl.&5-9]
Das Hermeneutik-Kapitel beginnt Poser mit einer historischen Einordnung und Definition des Begriffs der Hermeneutik als Methode der Erkenntnisgewinnung, die das Verstehen und Interpretieren von Zeichen beschreibt. @poser2001[vgl.&217-222]
Anschließend behandelt er die Arbeit von verschiedenen Philosophen, zur hermeneutischen Methode und ihrer Weiterentwicklung. @poser2001[vgl.&223-228]
Besonders Tiefgehen wird dann die Weiterentwicklung durch Hans-Georg Gadamer behandelt die nach Poser den Hermeneutik-Diskurs in der Philosophie bis heute beherrscht. @poser2001[vgl.&228-233]
Zum Ende seiner Ausführungen adressiert Poser die herausfordernde Kritik an Gadamers Hermeneutik, erkundet die darauf folgenden Weiterentwicklungen, erläutert die Verteidigung Gadamers und schließt mit aus dem Kapitel folgenden Schlussfolgerungen. @poser2001[vgl.&233-242]
= Rekonstruktion
Die Debatte um das HO-Schema verdeutlicht eine zentrale philosophische Spannung: die zwischen dem ganzheitlichen Verstehen der Hermeneutik und der detailorientierten Analyse der analytischen Philosophie. @poser2001[vgl.&217-218]
Während die Hermeneutik das Verstehen innerhalb eines Kontextes als essenziell betrachtet und auf die wechselseitige Abhängigkeit des Ganzen und seiner Teile hinweist, fokussiert die analytische Philosophie sich auf die Zerlegung und Überprüfung einzelner Elemente, weil das ganze gar nicht zu verstehen sei. @poser2001[vgl.&217-218]
Verstehen bedeutet für Hermeneutiker, aus äußeren Zeichen ein dahinterliegendes (Geistiges) Konzept zu erfassen/erkennen. @poser2001[vgl.&220-221]
Beispielweise das gelesene Wort "Staat", ist beim lesen nicht das Papier, die Tinte oder die Form der Buchstaben, sondern steht als eben solch ein Zeichen für das Konzept des Staates, welches der Leser versteht, aufgrund des in seinem Verstand vorhandenen Kontextes. @poser2001[vgl.&221]
Poser betont, dass die Hermeneutik nicht auf Texte beschränkt ist, sondern auf alle Zeichen, die interpretiert werden können angewandt werden kann (Er erweitert damit das traditionelle Verständnis der Hermeneutik, welches häufig auf die Interpretation von Texten begrenzt wird, auf ein breiteres Spektrum von Zeichensystemen). @poser2001[vgl.&221]
Die Hermeneutik besagt jedes Verstehen fängt mit kleinen Einheiten an, diese werden nach und nach zu einem Gesamtbild ergänzt, bis das Ganze erkennbar wird. Aus der Perspektive dieses Ganzen kann sich die Bedeutung der einzelnen Teile neu ordnen oder sogar verändern. Diese Dynamik zwischen dem Verstehen von Teilen und dem Verstehen des Ganzen in Wiederholung wird als Hermeneutischer Zirkel bezeichnet. @poser2001[vgl.&221-222]
Nach Poser ergeben sich aus der Hermeneutik zwei voneinander abhängige Fragen, @poser2001[vgl.&221-222] deren Diskussion im weiteren Verlauf Thema sein soll. "1. Wie kann ich verstehen?" @poser2001[&222] "2. Warum kann ich verstehen?" @poser2001[&222]
Um diese Fragen zu beantworten, beschreibt Poser zunächst die Entwicklung der Hermeneutik, aus der Antike bis zur Christlichen Reformation, in der die Hermeneutik von Protestanten als Methode der Bibelauslegung heran gezogen wurde. @poser2001[vgl.&223]
Es zeigt sich dabei ein generelles Problem, das jede Form von Kommunikation betrifft, wie kann der Empfänger einer Nachricht sicher sein, dass er den Inhalt richtig verstanden hat, dass das innere was er dem äußeren Zeichen zuordnet, mit dem des Senders übereinstimmt. @poser2001[vgl.&223-224]
Im Grunde sind die beiden oben genannten Fragen, eine andere Formulierung dieses Problems. @poser2001[vgl.&224]
== Verstehen als Einfühlen nach Schleiermacher
Poser führt an dieser Stelle die Überlegungen von <NAME> ein, der Verstehen als das Einfühlen/Hineinversetzen in ein anderes Individuum definierte. @poser2001[vgl.&225]
Er betonte zwei wesentliche Methoden: Komparation und divinatorischer Akt. @poser2001[vgl.&225]
Komparation vergleicht Texte aufgrund von Ähnlichkeiten, was jedoch nur bei bekannten Inhalten greift. @poser2001[vgl.&225]
Für das Erfassen von Neuem sei der divinatorische Akt nötig, eine kreative Leistung des Verstehenden, die folglich in jedem Menschen vorhandenen sein müsste. @poser2001[vgl.&225-226]
"Verstehen wird so zu einem Rekonstruktionsprozess der fremden Individualität." @poser2001[&226]
Poser kritisiert Schleiermachers Ansatz, da er die Frage nach dem Warum des Verstehens nicht beantwortet, sondern sie nur auf eine als selbstverständlich angenommene Voraussetzung verlagert. @poser2001[vgl.&226]
"[N]ämlich, dass [...] die zeitliche Differenz zwischen [Leser] und einem (antiken) Autor einfach [übersprungen werden] kann." @poser2001[&226]
== Spiralbewegung des Verstehens nach Gadamer
Für Poser unternahm <NAME>, "unter Aufnahme einiger Konzeptionen <NAME>", @poser2001[&228] den entscheidenden Schritt, der die Diskussion in der Hermeneutik bis Heute prägt. @poser2001[vgl.&228]
Die Hermeneutik, wurde von einer Methodenlehre "zur fundamentalen ontologischen Theorie ausgeweitet". @poser2001[&229]
Kern Gadamers Theorie ist dabei das Gespräch, das Verstehen als ein Dialog der Sache wegen. @poser2001[vgl.&229-230]
Der Hermeneutische Zirkel wird zu einer art Spirale des Verstehens. @poser2001[vgl.&230]
Beide Gesprächspartner bringen ihre Vorverständnisse ein, die sich im Gespräch gegenseitig erweitern und verändern. @poser2001[vgl.&230-232]
Das Mehrverstehen wird als ein sich in der Spirale nach oben Bewegen gedacht, das in der sogenannten Horizontverschmelzung vorläufig endet, wenn sich die Gesprächspartner einig sind. @poser2001[vgl.&231]
Nach Gadamer ist dann jedoch kein Objektives Verständnis erreicht, denn es ist immer noch vom Vorverständnis der Gesprächspartner abhängig. @poser2001[vgl.&232-233]
Er zeigt damit auf, dass die Idee einer absoluten Vermittlung von Geschichte und Wahrheit, wie von Hegel gedacht, nur als Rückprojektion möglich ist. @poser2001[vgl.&233]
In jeder Wissenschaftsdisziplin wird nach Gadamer das Vorverständnis der Forschenden so vereinheitlicht, dass daraus entstehende Übereinstimmungen fälschlicherweise als objektive Wahrheiten gesehen werden; der Anspruch auf Objektivität beruht auf der Vernachlässigung des Kontextes, in dem Beobachtungen und Theorien entstehen. @poser2001[vgl.&233]
"[...][N]aturgemäß hat auch eine jede Wissenschaftsgeschichte ihre Voraussetzungen, ihr Vorverständnis und ihre paradigmatischen Begrenzungen." @poser2001[&233]
== Kritik an <NAME> nach Apel
Kritisiert wird Gadamer von <NAME>, der zu diesem Zweck den Begriffe der Transzendentalpragmatik erarbeite. @poser2001[vgl.&234]
Mit ihm versucht er, die Transzendentalphilosophie, Theorie des Subjekts, und der pragmatischen Dimension, dem tatsächlich Umgesetzten und Handeln, zu verbinden. @poser2001[vgl.&235-237]
Apel argumentiert, dass Erkennen grundsätzlich durch Interessen bestimmt ist. @poser2001[vgl.&234]
Er unterscheidet dabei zwischen Erkenntnisinteresse durch: Erstens technische Praxis, das auf konkrete Problemlösungen ausgerichtet ist, die Kenntnis der Naturgesetze erfordert; Zweitens sozial-moralischer Praxis, die das Zusammenleben in der Gesellschaft und die Interaktion zwischen Individuen und Institutionen betrifft. @poser2001[vgl.&234]
Dies führt zur Vorstellung einer Kommunikations-, Interpretations- und Interaktionsgemeinschaft, die nicht nur sprachliche Zeichen deuten kann, sondern auch pragmatische Handlungsanweisungen versteht und umsetzt. @poser2001[vgl.&236-237]
Apel stellt die Frage, wie trotz Tradition und sozialer Praxis intersubjektive Verständigung möglich ist. @poser2001[vgl.&235]
Er wirft Gadamer vor, diese transzendentalphilosophische Frage nach den Bedingungen der Möglichkeit der Verständigung zu vernachlässigen, indem er eine objektive Methode ablehnt und die Bindung an ein individuelles Vorverständnis betont. @poser2001[vgl.&235]
Dies führe laut Apel zu Relativismus statt Konsens und zu einer ideologischen Festlegung, die keiner Kritik zugänglich sei. @poser2001[vgl.&235]
== Kritik an <NAME> nach Albert
<NAME> kritisiert die Hermeneutik nach Gadamer und ihre Erweiterungen, als ein Festhalten an einem "Offenbarungsmodell der Erkenntnis", das nicht objektivitätsgesteuert sondern Holistisch sei, also den Vorgriff auf eine nie erreichbare Totalität. @poser2001[vgl.&238]
Er argumentiert auch gegen das Konzept des Erkenntnisinteresses, wie es von Apel vertreten wird, für ihn untersucht die Wissenschaft auch Dinge bei denen weder technisches noch soziales Interesse besteht. @poser2001[vgl.&239]
Nach Albert ist die Interpretation von Zeichen nur ein spezieller Fall des Erkenntnisprozesses, da Wahrnehmung schon Interpretation enthält. @poser2001[vgl.&239]
= Fazit
Hermeneutik zeigt, dass Wissenschaft nicht nur aus harten Fakten bestehen kann, sondern auch Interpretation enthält, die mitunter tief in der Geschichte und Tradition verwurzelt ist. @poser2001[vgl.&241]
Von Apel und Habermas wird betont, wie wichtig es dennoch ist, über ideale Ziele der Wissenschaft nachzudenken, auch wenn diese Ziele eher als Leitsterne denn als feste Regeln dienen, denn sie können nicht in sinnvolle regulative Regeln ausformuliert werden. @poser2001[vgl.&242]
Letzendlich muss Wissenschaft sowohl die analytische als auch die hermeneutische Methode nutzen, nicht als gegesatz, sondern als Ergänzung. @poser2001[vgl.&242]
|
|
https://github.com/pank-su/report_3 | https://raw.githubusercontent.com/pank-su/report_3/master/templates/titlepage.typ | typst | /* Титульный лист
[title] - Название работы
[authors] - Авторы работы
[teachers] - Преподаватели или другие([position])
[date] - Дата создания документа
[education] - Название организации
[department] - Факультет или институт
[position] - Должность преподавателя
[documentName] - Название документа (например "ОТЧЁТ")
[group] - Название группы
[city] - Город
*/
#let titlepage(
title: "",
authors: (),
teachers: (),
date: datetime.today(),
education: "Название организации",
department: "Факультет",
position: "преподаватель",
documentName: "ОТЧЁТ ПО ЛАБОРАТОРНЫМ РАБОТАМ",
group: "ГРУППА",
city: "ГОРОД",
discipline: "",
isPractice: false // TODO если практика, то добавить дополнительное поле для оценки
) = {
set text(font: "Times New Roman", size: 12pt, lang: "ru", hyphenate: false)
set page(margin: (right: 15mm, left: 25mm, top: 20mm, bottom: 20mm), paper: "a4")
align(center, education)
align(center, department)
align(left, stack(dir: ltr, "ОТЧЁТ
ЗАЩИЩЁН С ОЦЕНКОЙ", align(bottom, line(length: 80pt, start: (5pt, 0pt)))) ) // тут start = отступ
v(5pt)
align(left, "РУКОВОДИТЕЛИ")
grid(columns: (1.5fr, 1fr, 1.5fr), gutter: 10pt,
align(center, position), "", align(center, teachers.join(", ")),
line(length: 100%), line(length: 100%), line(length: 100%),
align(center, text(0.9em, "должность, уч.степень, звание")), align(center, text(0.9em, "подпись, дата")), align(center, text(0.9em, "инициалы, фамилия")),)
v(3fr)
align(center, upper(documentName))
align(center, stack(dir: ttb, title, v(5pt), align(bottom, line(length: 0%))))
v(1.5fr)
align(center, discipline)
v(1.5fr)
grid(columns: (1fr, 1fr, 1fr, 1fr), gutter: 10pt,
"ОТЧЁТ", "", "", "",
"ВЫПОЛНИЛ", "", "", "",
"СТУДЕНТ ГР №", align(center, group), "", align(center, authors.join(", ")),
"", line(length: 100%), line(length: 100%), line(length: 100%),
"", align(center, text(0.9em, "должность, уч.степень, звание")), align(center, text(0.9em, "подпись, дата")), align(center, text(0.9em, "инициалы, фамилия")),)
v(3fr)
align(center, stack(dir: ltr, city, h(10pt), str(date.year())))
} |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/touying-unistra-pristine/1.0.0/CHANGELOG.md | markdown | Apache License 2.0 | # v1.0.0 (2024-08-31)
Initial release for publication as a Typst template package.
# v0.2.0 (2024-08-30)
## General
### Slides
- **Focus Slides**:
- Added counter support.
- Added the following parameters: `text_alignment`, `show_counter`.
- Added the following parameters to `grandientize(): `lighten-pct`, `angle`.
- **Title Slides**:
- Added the following parameters: `title`, `subtitle`.
- **Hero Slides**:
- Added support for the following directions: left-to-right (default), right-to-left, up-to-down, down-to-up.
- Added caption support.
- - Captions can be bolded using `bold_caption: true`.
- Added enhanced text option.
- Enhanced text appears bigger than normal text, in bold, and close to the image for better visibility.
- Enhanced text can have a background using the `text_fill` parameter and specifying a fill color.
- Added option to hide footer on individual slides.
- Added the following parameters: `bold_caption`, `caption`, `direction`, `enhanced_text`, `gap`, `heading_level`, `hide_footer`, `img_height`, `img_width`, `numbering`, `rows`, `text_alignment`, `text_fill`, `txt`.
- **Gallery Slides**:
- Added caption support for individual images.
- Captions can be bolded using `bold_caption: true`.
- Added the following parameters: `captions`, `height`, `gutter`, `subtitle`, `bold_caption`, `heading_level`, `width`, `gap`.
### Admonitions
- Added "Brainstorming" admonition type.
- Added "Question" admonition type.
- Added option to enable or disable admonition numbering (default: false).
- Added localization support.
### Settings
- Added the following settings:
- ADMONITION_NUMBERING (default: false),
- DEBUG (default: false),
- FOOTER_LOWER_SEP (footer lower separator) (default: " | "),
- FOOTER_SHOW_SUBTITLE
- FOOTER_UPPER_SEP (footer upper separator) (default: " | "),
- LANGUAGE (used for [Typst's `text()` lang parameter](https://typst.app/docs/reference/text/text/#parameters-lang)) (default: "fr"),
- QUOTES (used to specify left and right quotation mark characters for the "Quote" element) (default: "« , »).
- Added [wiki page listing settings](https://github.com/spidersouris/typst-unistra-slides/wiki/Settings).
### Other
- Updated example with newest changes.
- Added a customized version of [`quote`](https://typst.app/docs/reference/model/quote/).
- Added the following exportable methods: `smaller`, `smallest`.
- `smaller` sets text to 25pt.
- `smallest` sets text to 20pt.
- Added `link-color` to `colors.typ`.
## Fixes
- Fixed aligment issue with `cell()`.
- Fixed alignment issue with `focus-slide()`.
- Improved `focus-slide()` theme-related error messages.
## Miscellaneous
- Added licence.
# v0.1.0 (2024-08-05)
Initial pre-release.
|
https://github.com/floriandejonckheere/utu-thesis | https://raw.githubusercontent.com/floriandejonckheere/utu-thesis/master/thesis/chapters/08-case-study.typ | typst | #import "@preview/acrostiche:0.3.1": *
#import "/helpers.typ": *
#let stats = (
sloc: 9288, // cloc . --exclude-dir spec
files: 204, // find . -iname '*.rb' -not -path './spec/*' | wc -l
classes: 207, // grep -hro 'class [A-Z][A-Za-z0-9]*' lib | wc -l
methods: 840, // grep -hro 'def [a-z][A-Za-z0-9]*' lib | wc -l
commits: 277, // git rev-list v5.0.0...45b0f99 --count --grep dependabot --invert-grep
contributors: ( // git shortlog -sn v5.0.0...45b0f99 --grep dependabot --invert-grep
A: 139,
B: 83,
C: 15,
D: 14,
E: 8,
F: 7,
G: 6,
H: 5,
I: 1,
J: 1,
)
)
= Case study <casestudy>
In this chapter, we present a case study to evaluate the effectiveness of the proposed solution using a real-world use case.
We start by describing the background information about the use case, followed by a description of the experimental setup.
Next, we decompose the use case application using MOSAIK, evaluate the quality of the decomposition, and present the results.
Finally, we discuss the findings and analyze the implications of the proposed solution in a broader context.
== Background
The case study is based on an application called NephroFlow™ Link.
The application is developed and distributed by Nipro Digital Technologies Europe#footnote[#link("https://www.niprodigital.com")[https://www.niprodigital.com]], a subsidiary of Nipro Group#footnote[#link("https://www.nipro-group.com")[https://www.nipro-group.com]].
Nipro Group is a leading global manufacturer of medical devices, specialized in renal care products.
NephroFlow™ Link, part of the NephroFlow™ Product Suite#footnote[#link("https://www.nipro-group.com/en/our-offer/products-services/NephroFlowtm-product-suite")[https://www.nipro-group.com/en/our-offer/products-services/NephroFlowtm-product-suite]], is an application that allows the NephroFlow™ Healthcare Platform to bidirectionally communicate with dialysis machines installed at hospitals and dialysis centers.
NephroFlow™ Link is responsible for collecting data from the dialysis machines, processing and transforming it, and sending it to the NephroFlow™ Healthcare Platform for storage and visualization.
Dialysis machines measure and publish data essential for the dialysis treatment, such as vital signs, blood flow rate, and dialyzer efficiency.
Nurses and practitioners use this information to evaluate the condition of the patient, and the effectiveness of the treatment.
Nipro Group has rolled out NephroFlow™ Link in a number hospitals and dialysis centers across Europe, the Middle East, Central America, India, and Japan, collectively ensuring connection to hundreds of dialysis machines.
To safeguard the privacy and information security of the patient, NephroFlow™ Link is deployed on a virtual server or hardware appliance within the physical and virtual premises of the hospital or dialysis center, and the data is sent to a secure cloud environment.
An overview of the topology of the deployment is presented in @link_topology.
#figure(
include("/figures/08-case-study/link.typ"),
caption: [NephroFlow™ Link topological overview]
) <link_topology>
The application is written in the Ruby programming language#footnote[#link("https://www.ruby-lang.org")[https://www.ruby-lang.org]] as a single-threaded process, deployed as a single unit.
The choice of Ruby as programming language was influenced by the Ruby on Rails framework#footnote[#link("https://rubyonrails.org")[https://rubyonrails.org]], which is used for the NephroFlow™ Platform.
The application itself is designed not to retain any stateful data, and stores only transitional data using the Redis#footnote[#link("https://www.redis.com")[https://www.redis.com]] key-value datastore (e.g. for rate-limiting purposes).
The source code of the application is hosted in a private Github repository#footnote[#link("https://github.com")[https://github.com]] and is not publicly available.
NephroFlow™ Link currently supports integration with 13 dialysis machine models, and the number of supported devices grows year by year.
The codebase of the application is becoming increasingly complex, which decreases the development velocity of new features and makes the application harder to maintain.
When it is deployed at bigger sites with up to 400 dialysis machines, the throughput and latency suffer and performance issues arise.
Additionally, patient safety and information security would benefit from a more modular architecture, as it would allow for a more fine-grained access control to the data.
For these reasons, the application would benefit from an architectural overhaul.
While a microservices architecture would allow the application to scale efficiently, it also introduces a significant amount of complexity, and requires an upfront investment in development time.
Since the number of developers working on NephroFlow™ Link is limited, directly migrating to a microservices architecture would be challenging.
Hence, we believe that migrating NephroFlow™ Link towards a modular monolith architecture would prove beneficial.
== Experimental setup
#cite_full(<lourenco_silva_2023>) analyzed multiple source code repositories and concluded that repositories with a large number of committers perform better when considering the contributor coupling in various scenarios.
They state thate approaches using contributor coupling achieve comparable results as approaches using a structural coupling on source code repositories with a large number of committers.
Since the number of committers to NephroFlow™ Link is limited, we used multiple coupling strategies to improve the quality of the decomposition.
Four test scenarios were designed by combining configurations obtained through varying the weights of the coupling strategy @santos_paula_2021.
We applied the weights $omega_s$, $omega_c$, and $omega_d$ to the structural, logical, and contributor coupling respectively.
Refer to @test_configurations for a list of the test configurations.
Strategies using a single coupling were not considered, as they extract limited information by themselves, and were not expected to perform well in the context of NephroFlow™ Link.
#let scenarios = (
"scn_structural_logical": (1, 1, 0, [_structural-logical_]),
"scn_structural_contributor": (1, 0, 1, [_structural-contributor_]),
"scn_logical_contributor": (0, 1, 1, [_logical-contributor_]),
"scn_structural_logical_contributor": (1, 1, 1, [_structural-logical-contributor_]),
)
#figure(
table(
columns: (auto, auto, auto, auto, auto),
inset: 10pt,
stroke: (x: none),
align: (right, center, center, center, left),
[*ID*], [$omega_s$], [$omega_c$], [$omega_d$], [*Scenario*],
..for (key, scenario) in scenarios.pairs() {
(
[*#ref(label(key), supplement: none)*],
[#scenario.at(0)],
[#scenario.at(1)],
[#scenario.at(2)],
scn_reference([*#scenario.at(3)*], key),
)
},
),
caption: [Test configurations]
) <test_configurations>
The repository contains a `main` branch with the latest code, and several branches for released versions.
For the purpose of this study, we only considered the `main` branch, from the release of NephroFlow™ Link version~5.0 on October 27, 2023 up until the pre-release of NephroFlow™ Link version 5.2 on April 25, 2024, which was the most recent commit in the repository at the time of writing.
The static analysis was performed on the source code as it appears in the most recent commit.
The source code of the application contained #stats.at("files") Ruby source code files, with a total of #stats.at("sloc") #acr("SLOC"), as measured by the `cloc` tool#footnote[#link("https://github.com/AlDanial/cloc")[https://github.com/AlDanial/cloc]].
Only the application code was considered, excluding tests and configuration files.
The commits from the `dependabot` contributor were omitted, as they were automatically generated by Github to update the external dependencies of the application#footnote[#link("https://github.com/features/security")[https://github.com/features/security]].
An overview of the source code repository is presented in @source_code_statistics.
#figure(
table(
columns: 5,
inset: 10pt,
stroke: (x: none),
[*#acr("SLOC")*], [*Classes*], [*Methods*], [*Commits*], [*Contributors*],
[#stats.at("sloc")],
[#stats.at("classes")],
[#stats.at("methods")],
[#stats.at("commits")],
[#stats.at("contributors").len()],
),
caption: [Source code statistics]
) <source_code_statistics>
#grid(
columns: (60%, 40%),
gutter: 1em,
[
We identified #stats.at("contributors").len() software developers that have contributed to the software in the analyzed timespan, although only five developers have more than ten commits attributed to them.
The top two contributors were responsible for #(calc.round(100 * (stats.at("contributors").at("A") + stats.at("contributors").at("B")) / stats.at("commits"), digits: 0))% of the commits, while the other eight contributors accounted for the remaining #(calc.round(100 - (100 * (stats.at("contributors").at("A") + stats.at("contributors").at("B")) / stats.at("commits")), digits: 0))% of the commits.
@contributor_statistics shows the distribution of commits by contributor.
],
[
#figure(
include("/figures/08-case-study/contributors.typ"),
caption: [Commits by contributor],
) <contributor_statistics>
],
)
The decomposition of the application was performed on a machine with an Intel Core i5-8350U CPU and 32 GB of RAM and a 2 TB NVMe SSD.
The operating system used was Arch Linux with kernel version 6.8.7, with Ruby version 3.3.0.
== Evaluation and results
The decomposition of the application was performed using MOSAIK, according to the test scenarios described in the previous section.
Figures #ref(<coupling_statistics>, supplement: none) to #ref(<complexity_statistics>, supplement: none) show the coupling, cohesion, ABC size, and complexity metrics, respectively, for each scenario using a box plot.
The plots indicate the distribution of the metrics for each scenario, calculated from the individual metrics of each microservice in the decomposition.
#import "/figures/08-case-study/statistics.typ": *
#grid(
columns: (50%, 50%),
[
#figure(
statistics_chart("coupling", 50),
caption: [Coupling statistics]
) <coupling_statistics>
],
[
The coupling metric measures how loosely coupled the microservices are in relation to each other, with a lower value indicating a better modularization.
@scn_logical_contributor and @scn_structural_logical_contributor have a similar mean coupling value at 227.0 and 222.5 respectively, with few outliers.
]
)
@scn_structural_logical has a much lower mean coupling value at 83.2, indicating that the microservices are more loosely coupled, and the decomposition is more modular.
On the other hand, @scn_structural_contributor has a mean coupling value of 0.0, which means that the microservices are not coupled at all.
This can happen when the decomposition is too fine-grained, and the microservices are too small to be useful.
Looking at the size of the microservices in @structural_contributor_microservice_size, we see that the microservices are very small, with the exception of one microservice that is significantly larger than the others, which explains the low coupling value.
#grid(
columns: (50%, 50%),
[
The cohesion metric measures how well the microservices are internally cohesive and group related functionality together.
A higher value indicates a better modularization.
],
[
#figure(
statistics_chart("cohesion", 0.05),
caption: [Cohesion statistics]
) <cohesion_statistics>
]
)
All scenarios have a similar mean cohesion value, ranging from 0.04 to 0.07 for @scn_structural_contributor.
The latter is likely caused by the significantly larger microservice, which raises the mean cohesion value.
#grid(
columns: (50%, 50%),
[
#figure(
statistics_chart("abc_size", 50),
caption: [ABC size statistics]
) <abc_size_statistics>
],
[
ABC size measures the size of a microservice given the assignments, branches, and conditions in the code.
A lower value indicates a smaller microservice, which is generally preferred.
]
)
In @abc_size_statistics, we see that the extrema of the ABC size metric are quite high for all scenarios, with values ranging from 262.4 to 329.6.
This indicates that some microservices are significantly larger than others.
As the number of microservices in the decomposition of @scn_logical_contributor is quite small, it has the least variation in the ABC size metric, with a mean value of 152.8 and a median value of 161.8.
The other scenarios have mean ABC size values ranging from 23.9 to 66.9, indicating that the microservices in these decompositions are on average smaller in size, but with more variation.
#grid(
columns: (50%, 50%),
[
@complexity_statistics shows the cyclomatic complexity of the microservices in the decomposition.
A lower value indicates a simpler microservice, which is generally preferred.
],
[
#figure(
statistics_chart("complexity", 50),
caption: [Complexity statistics]
) <complexity_statistics>
]
)
The statistical values for the complexity metric are similar to the ABC size metric, with the mean complexity values ranging from 21.1 to 59.2, with @scn_logical_contributor being an outlier with a mean complexity value of 135.2, and a median value of 142.8.
ABC size and complexity are closely related, as they both measure the perceived complexity of the code, but they do so in different ways.
#grid(
columns: (50%, 50%),
gutter: 1em,
[
#figure(
table(
columns: (auto, auto, auto, auto, auto),
inset: 10pt,
stroke: (x: none),
align: (right, left),
[*ID*], [*Coup*], [*Coh*], [*Size*], [*Cplx*],
[#ref(<scn_structural_logical>, supplement: none)],
[#calc.round(yaml("/data/structural_logical.yml").at("coupling").at("mean"), digits: 2)],
[#calc.round(yaml("/data/structural_logical.yml").at("cohesion").at("mean"), digits: 2)],
[#calc.round(yaml("/data/structural_logical.yml").at("abc_size").at("mean"), digits: 0)],
[#calc.round(yaml("/data/structural_logical.yml").at("complexity").at("mean"), digits: 0)],
[#ref(<scn_structural_contributor>, supplement: none)],
[#calc.round(yaml("/data/structural_contributor.yml").at("coupling").at("mean"), digits: 2)],
[#calc.round(yaml("/data/structural_contributor.yml").at("cohesion").at("mean"), digits: 2)],
[#calc.round(yaml("/data/structural_contributor.yml").at("abc_size").at("mean"), digits: 0)],
[#calc.round(yaml("/data/structural_contributor.yml").at("complexity").at("mean"), digits: 0)],
[#ref(<scn_logical_contributor>, supplement: none)],
[#calc.round(yaml("/data/logical_contributor.yml").at("coupling").at("mean"), digits: 2)],
[#calc.round(yaml("/data/logical_contributor.yml").at("cohesion").at("mean"), digits: 2)],
[#calc.round(yaml("/data/logical_contributor.yml").at("abc_size").at("mean"), digits: 0)],
[#calc.round(yaml("/data/logical_contributor.yml").at("complexity").at("mean"), digits: 0)],
[#ref(<scn_structural_logical_contributor>, supplement: none)],
[#calc.round(yaml("/data/structural_logical_contributor.yml").at("coupling").at("mean"), digits: 2)],
[#calc.round(yaml("/data/structural_logical_contributor.yml").at("cohesion").at("mean"), digits: 2)],
[#calc.round(yaml("/data/structural_logical_contributor.yml").at("abc_size").at("mean"), digits: 0)],
[#calc.round(yaml("/data/structural_logical_contributor.yml").at("complexity").at("mean"), digits: 0)],
),
caption: [Mean of metric per scenario]
) <mean_metrics>
],
[
@mean_metrics lists the mean values of the metrics for each scenario.
The mean value of each metric indicates the average value of the metric for all microservices in the decomposition, and can be used as a reference to compare the scenarios.
]
)
#pagebreak()
@structural_logical_microservice_size and @structural_contributor_microservice_size show the distribution of the microservices in @scn_structural_logical and @scn_structural_contributor.
@logical_contributor_microservice_size and @structural_logical_contributor_microservice_size show the distribution of the microservices in @scn_logical_contributor and @scn_structural_logical_contributor.
#import "/figures/08-case-study/microservice-size.typ": *
#grid(
columns: (50%, 50%),
gutter: 1em,
[
#figure(
microservice_size_chart("structural_logical"),
caption: [Microservice size distribution (@scn_structural_logical)]
) <structural_logical_microservice_size>
],
[
#figure(
microservice_size_chart("structural_contributor"),
caption: [Microservice size distribution (@scn_structural_contributor)]
) <structural_contributor_microservice_size>
]
)
@scn_structural_logical and @scn_structural_contributor each have 18 microservices, with a mean size of 6.1 and 4.4 classes per microservice respectively.
@scn_structural_logical_contributor has slightly fewer at 14 microservices, with a larger mean size of 9.2 classes per microservice.
These decompositions consists of several larger microservices, and a number of smaller microservices that contain only a few classes.
#grid(
columns: (50%, 50%),
gutter: 1em,
[
#figure(
microservice_size_chart("logical_contributor"),
caption: [Microservice size distribution (@scn_logical_contributor)]
) <logical_contributor_microservice_size>
],
[
#figure(
microservice_size_chart("structural_logical_contributor"),
caption: [Microservice size distribution (@scn_structural_logical_contributor)]
) <structural_logical_contributor_microservice_size>
],
)
#v(2em)
#grid(
columns: (30%, 70%),
gutter: 1em,
[
#figure(
table(
columns: (auto, auto, auto),
inset: 10pt,
stroke: (x: none),
align: (right, left, left),
[*ID*], [$bold(\#M_c)$], [$overline(bold(|M_c|))$],
[#ref(<scn_structural_logical>, supplement: none)], [#yaml("/data/structural_logical.yml").at("clusters").at("count")], [#calc.round(yaml("/data/structural_logical.yml").at("clusters").at("mean"), digits: 1)],
[#ref(<scn_structural_contributor>, supplement: none)], [#yaml("/data/structural_contributor.yml").at("clusters").at("count")], [#calc.round(yaml("/data/structural_contributor.yml").at("clusters").at("mean"), digits: 1)],
[#ref(<scn_logical_contributor>, supplement: none)], [#yaml("/data/logical_contributor.yml").at("clusters").at("count")], [#calc.round(yaml("/data/logical_contributor.yml").at("clusters").at("mean"), digits: 1)],
[#ref(<scn_structural_logical_contributor>, supplement: none)], [#yaml("/data/structural_logical_contributor.yml").at("clusters").at("count")], [#calc.round(yaml("/data/structural_logical_contributor.yml").at("clusters").at("mean"), digits: 1)],
),
caption: [Number of microservices per scenario]
) <microservices_per_scenario>
],
[
@microservices_per_scenario lists the number of microservices identified by MOSAIK for each scenario, as well as the average number of classes in a microservice.
Aside from @scn_logical_contributor, the number of microservices identified by MOSAIK is fairly similar between the scenarios.
@scn_logical_contributor, which consists of a test setup using only evolutionary coupling, identified a significantly lower number, five microservices.
The lack of structural coupling information has a significant impact on the size of the microservices.
],
)
#v(1em)
Investigating further into the microservices identified in @scn_logical_contributor, we observe that the granularity of the microservices is significantly lower than in other scenarios, with some microservices containing seemingly unrelated functionality.
Some of the microservices include a mix of data processing code, utility functions, and networking code.
The other scenarios, which include structural coupling information, identified microservices that have more related functionality grouped together.
Due to the restricted nature of the source code, precise information about the functionality for each microservice cannot be included in this report.
#grid(
columns: (60%, 40%),
gutter: 1em,
[
@runtime_statistics depicts the runtime of the analysis for each scenario.
The runtime statistics were gathered by running the analysis ten times for each scenario, and calculating the mean runtime.
Each scenario is executed multiple times to account for variations in the execution time due to external factors (e.g. system load, disk I/O, etc.).
Each execution is divided into three phases: extraction, decomposition, and evaluation.
The extraction step is equal for all scenarios, as it is based on the same input data.
],
[
#figure(
include("/figures/08-case-study/runtime.typ"),
caption: [Total analysis runtime]
) <runtime_statistics>
]
)
This step takes around 8 seconds to complete.
The second step, decomposition, is the most time-consuming step, as it involves the iterative process of identifying the microservices.
Finally, the evaluation step executes in a similar time for all scenarios, ranging from 3.4 to 4.9 seconds.
The decomposition in scenarios #ref(<scn_structural_logical>, supplement: none), #ref(<scn_logical_contributor>, supplement: none), and #ref(<scn_structural_logical_contributor>, supplement: none) had a similar runtime (157, 148, and 128 seconds respectively), while the scenario #ref(<scn_structural_contributor>, supplement: none) executed in less than half the time: 72 seconds.
@scn_structural_contributor is the fastest scenario, as it does not consider the logical coupling, which contains a lot of information that needs to be processed.
#pagebreak()
== Discussion
The results of the case study show that the decomposition of NephroFlow™ Link into a modular monolith architecture using MOSAIK is feasible.
The various test scenarios provide insights into how modularization behaves, with varying levels of success in terms of coupling, cohesion, and complexity.
@scn_logical_contributor indicates that structural coupling is an integral part of the extracted information, and decomposition performs poorly when not considering it.
@scn_structural_contributor shows that the granularity of the decomposition can be too fine-grained, resulting in microservices that are too small to be useful.
@scn_structural_logical_contributor, the scenario that considers all three types of coupling, performs well in terms of coupling, cohesion, and complexity, though the microservices end up with a tighter coupling than the scenario that only considers structural and logical coupling.
Given the results, we can conclude that the quality requirement is met, as the proposed solution is able to identify module boundaries with sufficient quality.
MOSAIK is able to automatically generate decompositions of the source code without intervention of the software architect, fulfilling the automation requirement.
The tool is able to generate visualizations of the decompositions, which can be used to gain insight into the structure of the application, fulfilling the visual requirement.
Finally, the runtime of the analysis is acceptable for the source code of NephroFlow™ Link, with the decomposition of the application taking less than three minutes to complete.
However, the runtime of the analysis may increase significantly for larger applications, as the time complexity of the algorithm is $O(n "log"(n))$ @lancichinetti_fortunato_2009.
Hence, we conclude that the performance requirement is only partially met, as the tool may not be performant enough for very large applications.
The results indicate that the transformation of NephroFlow™ Link into a modular monolith architecture is feasible and can provide numerous benefits, such as improved development velocity, as well as increasing the overall performance of the application.
We expect that MOSAIK can be used to decompose other Ruby applications, as the tool is not dependent on the specific characteristics of the use case application.
MOSAIK can decompose both applications written in plain Ruby, or developed using a framework such as Ruby on Rails or Sinatra, as the structural coupling does not rely on the specific implementation of any framework.
The evolutionary coupling does however require the application to be versioned using a version control system to be able to extract the necessary information.
In order to validate and improve the tool further, more case studies need to be conducted on other applications.
Furthermore, only the structural coupling (which parses the #acr("AST") of the source code) is language-specific.
The tool allows extending the extraction step to support other languages (e.g. Python or Java) by implementing a parser for the specific language.
Parsers can be implemented using existing libraries, or by using a language-agnostic parser generator (e.g. ANTLR#footnote[#link("https://www.antlr.org")[https://www.antlr.org]]).
Implementing support for an additional language should not be a significant effort, as the extraction step is decoupled from the other steps in the process.
|
|
https://github.com/fenjalien/obsidian-typst | https://raw.githubusercontent.com/fenjalien/obsidian-typst/master/README.md | markdown | Apache License 2.0 | # Typst Renderer
Renders `typst` code blocks, and optionally math blocks, into images using [Typst](https://github.com/typst/typst) through the power of WASM! This is still very much in development, so suggestions and bugs are welcome!
## Small Things to NOTE
- Typst does not currently support exporting to HTML only PDFs, PNGs and SVGs. So due to image scaling, the rendered views may look a bit terrible. If you know how to fix this PLEASE HELP.
- File paths should be relative to the vault folder.
- To help with loading times the web assembly file must be downloaded separately. This will automatically happen the first time the plugin is enabled and after an update!
## Versions
| Plugin | Typst |
|-|-|
| 0.10 | 0.11.0 |
| 0.9 | 0.10.0 |
| 0.8 | 0.9.0 |
| 0.7 | 0.8.0 |
| 0.6 | [522708b](https://github.com/typst/typst/commit/522708b9df0b9b2f8265938aa1f0aeda8e6e6c1f) (Some commits after 0.7.0 to include SVG export) |
| 0.5 | 0.6.0 |
| 0.4 | 0.3.0 |
| 0.3 | 0.2.0 |
## Using Packages
On desktop the plugin supports reading packages from the [`@preview`](https://github.com/typst/packages#downloads) and [`@local`](https://github.com/typst/packages#local-packages) namespaces. If a package cannot be found in either folder and the "Download Missing Packages" setting is on, the package will be downloaded and saved within the current vault in the pulgin's folder.
On mobile only the `@preview` namespace is supported and will always download missing packages to the vault.
You can view the downloaded packages in the settings and choose which ones to delete.
## Math Block Usage
The plugin can render `typst` inside math blocks! By default this is off, to enable it set the "Override Math Blocks" setting or use the "Toggle math block override" command. Math block types are conserved between Obsidian and Typst, `$...$` -> `$...$` and `$$...$$` -> `$ ... $`.
From what I've experimented with, normal math blocks are okay with Typst but Typst is not happy with any Latex code.
For styling and using imports with math blocks see the next section.
## Preambles
Need to style your `typst` code the same way everytime and don't to write it out each time? Or using math blocks and need a way to import things? Use PREAMBLES!
Preambles are prepended to your `typst` code before compiling. There are three different types on the "Typst Renderer" plugin settings page:
- `shared`: Prepended to all `typst` code.
- `math`: Prepended to `typst` code only in math blocks.
- `code`: Prepended to `typst` code only in code blocks.
The following variables are defined for you in all preambles to help style the output correctly:
- `WIDTH`: The horizontal size of the space the output will be placed in. Can be a `length` or `auto` if the space is not limited in that direction.
- `HEIGHT`: The vertical size of the space the output will be placed in. Can be a `length` or `auto` if the space is not limited in that direction.
- `SIZE`: The font size as defined by the CSS property `"--font-text-size"`
- `THEME`: A string defining the current theme of Obsidian. Either "light" or "dark".
The following are the default preambles, I highly recommend you check this on each update to make sure you don't miss any changes that could break things. That being said you don't need them they are merely recommended.
<details>
<summary>Shared</summary>
```
#set text(fill: white, size: SIZE)
#set page(width: WIDTH, height: HEIGHT)
```
</details>
<details>
<summary>Math</summary>
```
#set page(margin: 0pt)
#set align(horizon)
```
</details>
<details>
<summary>Code</summary>
```
#set page(margin: (y: 1em, x: 0pt))
```
</details>
## Known Issues
### Runtime Error Unreachable or Recursive Use Of Object
These occur when the Typst compiler panics for any reason and means the compiler cannot be used again until it is restarted. There should be more information in the console log so please create an issue with this error!
## Example
```
```typst
= 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 = floor(1 / sqrt(5) phi.alt^n), quad
phi.alt = (1 + sqrt(5)) / 2 $
#let count = 10
#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))),
))
```
```
<img src="assets/example.png">
## Installation
Install "Typst Renderer" from the community plugins tab in settings
or
Install it by copying `main.js`, `styles.css`, `obsidian_typst_bg.wasm` and `manifest.json` from the releases tab to the folder `.obsidian/plugins/typst` in your vault.
## TODO / Goals (In no particular order)
- [x] Better font loading
- [x] Fix importing
- [x] Fix Github Actions
- [x] Better error handling
- [x] ? Fix output image scaling
- [ ] Use HTML output
- [x] Override default equation rendering
- [ ] Custom editor for `.typ` files
- [x] Mobile file reading
- [x] Automate package downloading
- [ ] Use `sys.stdin` for preambles instead of modifying the source cod
- [ ] Overhall plugin structure (mostly communication with the webworker)
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/inlay_hints/named_or_pos.typ | typst | Apache License 2.0 | #text("")
#text(red, "")
#text(18pt, red, "")
|
https://github.com/daskol/typst-templates | https://raw.githubusercontent.com/daskol/typst-templates/main/iclr/iclr.typ | typst | MIT License | /**
* iclr.typ
*/
#import "/iclr2025.typ": iclr2025
/**
* iclr - Template for International Conference on Learning Representations
* (ICLR).
*
* Args:
* title: Paper title.
* authors: Tuple of author objects and affilation dictionary.
* keywords: Publication keywords (used in PDF metadata).
* date: Creation date (used in PDF metadata).
* abstract: Paper abstract.
* bibliography: Bibliography content. If it is not specified then there is
* not reference section.
* appendix: Content to append after bibliography section.
* accepted: Valid values are `none`, `false`, and `true`. Missing value
* (`none`) is designed to prepare arxiv publication. Default is `false`.
* id: Submission identifier.
*/
#let iclr(
title: [],
authors: (),
keywords: (),
date: auto,
abstract: [],
bibliography: none,
appendix: none,
accepted: false,
body,
) = {
show: iclr2025.with(
title: title,
authors: authors,
keywords: keywords,
date: date,
abstract: abstract,
bibliography: bibliography,
appendix: appendix,
accepted: accepted,
)
body
}
|
https://github.com/astro-group-bristol/py-package | https://raw.githubusercontent.com/astro-group-bristol/py-package/main/presentation/tamburlaine.typ | typst | MIT License | #import "@preview/polylux:0.3.1": *
#let SECONDARY_COLOR = rgb("#f6f0e0").lighten(30%)
#let PRIMARY_COLOR = rgb("#bf2f38")
#let TEXT_COLOR = black.lighten(13%)
#let tamburlaine-theme(aspect-ratio: "4-3", body) = {
set page(
paper: "presentation-" + aspect-ratio,
fill: SECONDARY_COLOR,
margin: 1em
)
set text(fill: TEXT_COLOR, size: 25pt, font: "Montserrat")
body
}
#let title-slide(
title: none,
authors: (),
where: none,
date: none
) = {
set page(
fill: SECONDARY_COLOR,
margin: 1em,
)
set text(fill: TEXT_COLOR, weight: "bold")
let pretty-title = par(leading: 23pt)[
#text(weight: "black", size:113pt, fill: SECONDARY_COLOR)[#title]
]
let author = authors.join(h(1em))
logic.polylux-slide[
#rect(inset:(top: 1em), width:100%, height: 74%, stroke:none, fill: PRIMARY_COLOR)[
#align(right)[
#pretty-title
]
]
#v(-0.6em)
#line(length: 100%, stroke: 5mm + TEXT_COLOR)
#v(-0.5em)
#grid(
columns: (70%, 30%),
row-gutter: 15pt,
author,
where,
align(left, text(size: 20pt, weight: "regular")[University of Bristol]),
align(right, text(size: 20pt, weight: "regular",
date.display("[day] [month repr:long] [year]")
)),
)
#v(-0.1em)
#line(length: 100%, stroke: 8mm + TEXT_COLOR)
]
}
#let slide(title: none, body) = {
set page(
fill: SECONDARY_COLOR,
margin: (top: 1em, bottom: 1.5em, left: 1em, right: 1em)
)
let header = align(top, locate( loc => {
set text(size: 20pt)
grid(
columns: (1fr, 1fr),
align(horizon + right, grid(
columns: 1, rows: 1em,
title,
utils.current-section,
))
)
}))
let footer = locate( loc => {
block(
stroke: ( top: 1mm + TEXT_COLOR ), width: 100%, inset: ( y: .3em ),
text(.5em, {
"<NAME>"
h(2em)
"/"
h(2em)
"Astro Dev Group"
h(1fr)
logic.logical-slide.display()
})
)
})
set page(
footer: footer,
footer-descent: 0em,
header-ascent: 1.5em,
)
let content = {
block(spacing: 0.0em, text(fill: PRIMARY_COLOR, size: 50pt, weight: "black", title))
v(-0.5em)
body
}
logic.polylux-slide(content)
}
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/frac_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test that denominator baseline matches in the common case.
$ x = 1/2 = a/(a h) = a/a = a/(1/2) $
|
https://github.com/michidk/cv | https://raw.githubusercontent.com/michidk/cv/main/src/lib/utils.typ | typst | // enables the debug mode, which has some useful visualizations
#let debugMode(
enabled: false,
margins: (top: 0, bottom: 0, left: 0, right: 0),
it
) = {
if enabled {
set block(stroke: red)
let text = text(fill: red, size: 20pt, "DEBUG")
style(styles => {
for i in range(6) {
place(top, dx: (measure(text, styles).width + 1cm) * i, {
v(-margins.top)
text
})
}
})
it
} else {
it
}
}
// prettify url by removing the protocol, www and trailing slash
#let prettifyUrl(url) = {
let url = url.replace("https://", "").replace("http://", "").replace("www.", "")
if url.ends-with("/") {
url.slice(0, url.len() - 1)
} else {
url
}
}
// safely get a value from a list, or return a default value
// needed until this is implemented: https://github.com/typst/typst/issues/946
#let get(list, key, default) = {
if key in list {
list.at(key)
} else {
default
}
}
// sort a list of entries by start date, most recent first
#let sortDateRange(entry) = {
// sort by end date, if not present, put it at the beginning and sort by start date
// rationale: we want all "present" position on top, with the most recent ones on top
if "endDate" in entry {
entry.endDate
} else {
("AAA" + entry.startDate)
}
}
|
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/038.%20venturecapital.html.typ | typst | venturecapital.html
A Unified Theory of VC Suckage
March 2005A couple months ago I got an email from a recruiter asking if I was
interested in being a "technologist in residence" at a new venture
capital fund. I think the idea was to play Karl Rove to the VCs'
George Bush.I considered it for about four seconds. Work for a VC fund? Ick.One of my most vivid memories from our startup is going to visit
Greylock, the famous Boston VCs. They were the most arrogant
people I've met in my life. And I've met a lot of arrogant people.
[1]I'm not alone in feeling this way, of course. Even a VC friend of
mine dislikes VCs. "Assholes," he says.But lately I've been learning more about how the VC world works,
and a few days ago it hit me that there's a reason VCs are the way
they are. It's not so much that the business attracts jerks, or
even that the power they wield corrupts them. The real problem is
the way they're paid.The problem with VC funds is that they're funds. Like the
managers of mutual funds or hedge funds, VCs get paid a percentage
of the money they manage: about 2% a year in management fees,
plus a percentage of the gains. So they want
the fund to be huge-- hundreds of millions of dollars, if possible.
But that means each partner ends up being responsible for investing
a lot of money. And since one person can only manage so many deals,
each deal has to be for multiple millions of dollars.This turns out to explain nearly all the characteristics of VCs
that founders hate.It explains why VCs take so agonizingly long to make up their minds,
and why their due diligence feels like a body cavity search. [2]
With so much at stake, they have to be paranoid.It explains why they steal your ideas. Every founder knows that
VCs will tell your secrets to your competitors if they end up
investing in them. It's not unheard of for VCs to meet you when
they have no intention of funding you, just to pick your brain for
a competitor. This prospect makes naive founders clumsily secretive.
Experienced founders treat it as a cost of doing business. Either
way it sucks. But again, the only reason VCs are so sneaky is the
giant deals they do. With so much at stake, they have to be devious.It explains why VCs tend to interfere in the companies they invest
in. They want to be on your board not just so that they can advise
you, but so that they can watch you. Often they even install a new
CEO. Yes, he may have extensive business experience. But he's
also their man: these newly installed CEOs always play something
of the role of a political commissar in a Red Army unit. With
so much at stake, VCs can't resist micromanaging you.The huge investments themselves are something founders would dislike,
if they realized how damaging they can be. VCs don't invest $x
million because that's the amount you need, but because that's the
amount the structure of their business requires them to invest.
Like steroids, these sudden huge investments can do more harm than
good. Google survived enormous VC funding because it could
legitimately absorb large amounts of money. They had to buy a lot
of servers and a lot of bandwidth to crawl the whole Web. Less
fortunate startups just end up hiring armies of people to sit around
having meetings.In principle you could take a huge VC investment, put it in treasury
bills, and continue to operate frugally. You just try it.And of course giant investments mean giant valuations. They have
to, or there's not enough stock left to keep the founders interested.
You might think a high valuation is a great thing. Many founders
do. But you can't eat paper. You can't benefit from a high valuation
unless you can somehow achieve what those in the business
call a "liquidity event," and the higher
your valuation, the narrower your options for doing that. Many a
founder would be happy to sell his company for $15 million, but VCs
who've just invested at a pre-money valuation of $8 million won't
hear of that. You're rolling the dice again, whether you like it
or not.Back in 1997, one of our competitors raised $20 million in a single
round of VC funding. This was at the time more than the valuation
of our entire company. Was I worried? Not at all: I was delighted.
It was like watching a car you're chasing turn down a street that
you know has no outlet.Their smartest move at that point would have been to take every
penny of the $20 million and use it to buy us. We would have sold.
Their investors would have been furious of course. But I think the
main reason they never considered this was that they never imagined
we could be had so cheap. They probably assumed we were on the
same VC gravy train they were.In fact we only spent about $2 million in our entire existence.
And that gave us flexibility. We could sell ourselves to Yahoo for
$50 million, and everyone was delighted. If our competitor had
done that, the last round of investors would presumably have lost
money. I assume they could have vetoed such a deal. But no one
those days was paying a lot more than Yahoo. So unless their
founders could pull off an IPO (which would be difficult with Yahoo
as a competitor), they had no choice but to ride the thing down.The puffed-up companies that went public during the Bubble didn't
do it just because they were pulled into it by unscrupulous investment
bankers. Most were pushed just as hard from the other side by VCs
who'd invested at high valuations, leaving an IPO as the only way
out. The only people dumber were retail investors. So it was
literally IPO or bust. Or rather, IPO then bust, or just bust.Add up all the evidence of VCs' behavior, and the resulting personality
is not attractive. In fact, it's the classic villain: alternately
cowardly, greedy, sneaky, and overbearing.I used to take it for granted that VCs were like this. Complaining
that VCs were jerks used to seem as naive to me as complaining that
users didn't read the reference manual. Of course VCs were jerks.
How could it be otherwise?But I realize now that they're not intrinsically jerks. VCs are
like car salesmen or bureaucrats: the nature of their work
turns them into jerks.I've met a few VCs I like. <NAME> seems a good guy. He even
has a sense of humor, which is almost unheard of among VCs. From
what I've read about <NAME>, he sounds like a good guy too,
almost a hacker. But they work for the very best VC funds. And
my theory explains why they'd tend to be different: just as the
very most popular kids don't have to persecute
nerds, the very best
VCs don't have to act like VCs. They get the pick of all the best
deals. So they don't have to be so paranoid and sneaky, and they
can choose those rare companies, like Google, that will actually
benefit from the giant sums they're compelled to invest.VCs often complain that in their business there's too much money
chasing too few deals. Few realize that this also describes a flaw
in the way funding works at the level of individual firms.Perhaps this was the sort of strategic insight I was supposed to
come up with as a "technologist in residence." If so, the good
news is that they're getting it for free. The bad news is it
means that if you're not one of the very top funds, you're
condemned to be the bad guys.Notes[1] After Greylock booted founder <NAME> out of ArsDigita,
he wrote a hilarious but also very informative
essay about it.
[2] Since most VCs aren't tech guys, the technology side of their
due diligence tends to be like a body cavity search by someone with
a faulty knowledge of human anatomy. After a while we were quite
sore from VCs attempting to probe our nonexistent database orifice.No, we don't use Oracle. We just store the data in files. Our
secret is to use an OS that doesn't lose our data. Which OS?
FreeBSD. Why do you use that instead of Windows NT? Because it's
better and it doesn't cost anything. What, you're using a
freeware OS?How many times that conversation was repeated.
Then when we got to Yahoo, we found they used FreeBSD and stored
their data in files too.Chinese TranslationJapanese Translation
|
|
https://github.com/OctarineSourcerer/NeonInTheDark | https://raw.githubusercontent.com/OctarineSourcerer/NeonInTheDark/main/crews/chromers.typ | typst | #import "../templates/crewTemplate.typ": crew, specialAbility
#crew(
[Chromers],
[Escapism Purveyors],
[At Neo-Duskvol's roots, Chromer gangs were groups of crazed individuals centralising their activities around song lyrics, treating them as gospel or orders from their musical heroes. Due to most of Chromer music being counter-culture and anti-establishment, Chromer gangs were often found in the centers of protests and riots, inciting civil disobedience and damaging public or corporate (one would say there is no difference between the two) property. But that was then. Eventually, the sentiment evolved, and now Chromers are typically associated with illicit escapism from the bonds of society, whether that's rocking out in an underground concert, venting your frustrations in a riot, or the good old-fashioned getting your brain blasted by the nastiest modern chemistry has to offer.],
[When you play Chromers, you earn xp when you successfully push your product, acquire new goods, or secure a new demographic.],
[What's your product? Who's your supplier? How do you move it?],
[
/ Training: Resolve
/ Lair: Secure
],
[
/ Supply: A transaction to acquire new product or establish a new supplier
/ Sale: A significant transaction with a special buyer
/ Show of Force: Make an example of an enemy
/ Socialise: Improve customer and/or supplier relations with an event
],
[
/ Toxx: an anarchist
/ Yosef: an artist
/ Louie: a community pillar
/ Ulysses: a socialite
/ Andria: a bar owner
/ Djimon: a beatcop
],
[
/ Chromer Rigging: One carried item is concealed and has no load. For example, you could carry a load of drugs or a weapon, perfectly concealed, for zero load.
/ Prison Contacts: Your Tier is effectively +1 higher in prison. This counts for any Tier-related element in prison, including the incarceration roll (see page 148).
/ Elite Feelers: All of your cohorts with the Feelers type get +1d to quality rolls for Feeler-related actions.
/ Elite Thugs: All of your cohorts with the Thugs type get +1d to quality rolls for Thug-related actions.
/ Composed: Each PC gets +1 stress box. This costs three upgrades to unlock, not just one.
],
[
/ Cover Identities: You get +1d to the engagement roll for deception and social plans. False identities help confuse the opposition.
/ Cover Operation: You get -2 heat per Run. The cover of a legitimate operation helps deflect some of the heat from law enforcement.
/ Foreign Market: Any time during downtime, roll dice equal to your Tier. You earn credit equal to the highest result, minus your heat. Some of your product makes its way out of the city.
/ Informants: You get +1d to gather information for a Run. Your eyes and ears on the streets are always on the lookout for new clients.
/ Local Graft: You get +2 credit in payoff for Runs that involve a show of force or socializing. A few city officials share bribe money with those who show that they’re players on the scene.
/ Lookouts: You get +1d to Trace or Survey on your turf.
/ Luxury Venue: +1d to Consort and Sway rolls on-site. Silks, paintings, and crystal impress the clientele.
/ Personal Clothier: You get +1d to the engagement roll for social plans. You always arrive on the scene in the most current and alluring fashion.
/ Surplus Cache: You get +2 credit in payoff for Runs that involve product sale or supply. You have an abundance of product, which pads your pockets every now and then. Vice Den: Any time during downtime, roll dice equal to your Tier. You earn credit equal to the highest result, minus your heat. Is this claim a den you’ve overtaken from another purveyor, or a new establishment replacing something else?
],
[
#specialAbility("The Right Words", [
Each PC may add +1 action rating to Control, Consort, or Sway (up to a max rating of 3). Each player may choose the action they prefer (you don't all have to choose the same one). If you take this ability during initial character and crew creation, it supersedes the normal starting limit for action ratings.
])
#specialAbility("Accord", [
Sometimes friends are as good as territory. You may treat up to three +3 faction statuses you hold as if they are turf. If your status changes, you lose the turf until it becomes +3 again. Regardless of how much turf you hold (from this ability or otherwise) the minimum rep cost to advance your Tier is always 6.
])
#specialAbility("High Society",[
It's all about who you know. Take -1 heat during downtime and +1d to gather information about the Neo-Duskvol's elite.
])
#specialAbility("Hooked", [
Your gang members are especially enthusiastic about your product, for better or worse. They’re committed, but might push too hard or struggle to keep their cool when dealing with the unsympathetic. Add the savage, unreliable, or wild flaw to your gangs to give them +1 quality (max rating of 4).
])
#specialAbility("One of a Kind", [
Your product, be it a drug, an idea, music, etc., is unique. The product quality is equal to your Tier +2. When you deal with a crew or faction, the GM will tell you who among them is hooked on your product (none, a few, or many). The quality of your product might be used for a fortune roll to find out how impressed a potential client is, how enthralled or incapacitated a user is in their indulgence of it, etc.
])
#specialAbility("Online Enterprise", [
Through serious tech knowhow or hard-earned experience, you have discovered how to prepare your product for use by digital entities. They do not pay in credit. What do they pay with? The GM will certainly have an idea about how your strange new clients pay, but jump in with your own ideas, too! This ability is usually a big shift in the game, so talk it out and come up with something that everyone is excited about. If it's a bit mysterious and uncertain, that's good. You have more to explore that way.
])
#specialAbility("Patron", [
When you advance your Tier, it costs half the credit it normally would. Who is your patron? Why do they help you?
])
]
) |
|
https://github.com/JWangL5/CAU-ThesisTemplate-Typst | https://raw.githubusercontent.com/JWangL5/CAU-ThesisTemplate-Typst/master/README.md | markdown | MIT License | ### 为什么使用Typst
因为语法足够简单(简单易学)、编译器体积小(随取随用)、且速度足够快(实时预览)!

### 关于本论文模板
本模板参考[中国农业大学毕业论文模板要求](https://jwc.cau.edu.cn/art/2020/2/25/art_14181_663910.html)编写,符合学校要求。对于其中一些可以灵活修改的格式,本模板也提供了配置项,具体详见模板使用方法。模板的效果见`sample.pdf`文件:[点击直达](https://github.com/JWangL5/CAU-ThesisTemplate-Typst/blob/master/template/sample.pdf)
⚠️ 但是,本模板为个人编写使用,没有完全适配自动化逻辑和模块化代码,可能仍旧存在部分情况排版不合理。如果您在使用过程中遇到问题,可以提交issue说明,也欢迎pull request贡献。
如果该模板对您有帮助并愿意支持我的工作,可以在这里[buy me a coffee](https://www.buymeacoffee.com/jwangl5),十分感谢😊!
### 使用方法
1. Typst可以使用[线上WebApp](https://typst.app/)或本地下载编译器后进行编写。可以通过[Typst的模板站点Typst Universe](https://typst.app/universe/package/universal-cau-thesis)直接创建该项目。本地编写需要[下载安装编译器](https://github.com/typst/typst/releases)到本地,并将`exe`格式的编译器添加到环境变量,以方便调用
2. 下载该仓库到本地目录或WebApp的工作目录中,可以使用git命令或该页面上方的Code按钮直接下载
```git
git clone https://github.com/JWangL5/CAU-ThesisTemplate-Typst.git
```
3. 安装本模板所使用的相关字体(`/fonts`文件夹内字体)
PS:受限于中文字体的衬线问题,目前版本的Typst暂不支持多数中文字体的加粗,这里使用了其他加粗字体作为替代,可以直接双击字体文件打开后安装
4. 本地编写时,建议使用[vscode](https://code.visualstudio.com/)及Typst配套插件(Tinymist Typst、Typst Preview)
5. 通过修改`template`目录下的文件完成论文的编写。其中`sample.typ`文件是论文的案例模板,在该文件中,首先使用`import`命令引入本地模板后,修改配置项
- kind:填写`"本科"`,`"硕士"`,`"博士"`,其会对应修改封面和页眉处的信息
- title:论文标题,填写在括号`[text]`内,使用`\`换行
- abstract:论文摘要,需要手动写关键词
- authors:论文作者姓名,可以`[text]`,也可以`"text"`
- teacher:指导教师的姓名
- degree:申请学位门类级别,比如`[理学硕士]`
- college, major, field:封面上的内容,学院、专业和研究方向
- signature:你的电子签名文件路径,是论文独创性声明处的签字
- classification & security:论文在图书馆收录时的[中图法分类](https://www.clcindex.com/)和保密级别
- student_ID:学号
- year, month, day:论文封面和诚信声明页上的日期
- draft:填写`true`时添加草稿水印,用以区分是否为最终版本,填写`false`时去除水印并添加论文章
- blindReview:填写为`true`时隐藏封面上的相关信息,以及致谢和作者介绍
6. 使用如下`typst`命令生成pdf格式文件,或直接使用vscode的实时预览插件(默认快捷键`ctrl+k v`)
```cmd
typst compile .\template\sample.typ -root '..\'
```
### Typst编写简易指南
> 如果在使用Typst时遇到任何问题,都可以参考[官方帮助文档](https://typst.app/docs/),下面是简要的使用方法及与本模板相关的配套设置,可以参考的示例文档`template\sample.typ`
- 关于标题:Typst使用`=`作为标题的指示符。本模板中,一级标题需要手动编号,二、三级标题则不需要
```typst
= 第一章 一级标题
== 二级标题
=== 三级标题
```
- 段落的编写:直接输入文本即可编写内容,使用两个回车另起一段
```typst
这是内容的第一段,
这仍旧是第一段的内容
多一个换行符号后另起为第二段
```
- 文字内容的基础格式:使用`*text*`包括住的文字可以加粗,使用`_text_`包括住的文字可以斜体文字,使用`#u[text]`包括住的文字可以实现下划线,使用`#sub[text]`包括住的文字修改为下标,使用`#super[text]`包括住的文字修改为上标
```typst
这里是*加粗文字*内容,
这里是_斜体文字_内容,
这里是#u[下划线文字]内容,
这里是#sub[下标文字]内容,
这里是#super[上标文字]内容
```
- 使用`#highlight(fill: red)[text]`高亮文字标记,使用`fill`参数修改高亮颜色
```typst
这一段文字#highlight[还需要修改]
```
- 使用`#link("your link here")[text]`标记超链接
```typst
这里是#link("https://typst.app/home")[Typst官方网站]
```
- 使用`-`或`+`使用无序列表或有序列表,使用`Tab`缩进为二级列表
```typst
- 无序列表1
+ 有序列表1
+ 有序列表2
- 无序列表2
```
- 使用`#h(2em)`或`#v(1em)`来添加水平或垂直的空白缩进,括号中的参数为需要空出的距离,其单位可以使用`%`(页面百分比),`pt`(点,印刷行业的绝对长度单位,相当于1/72英寸),`em`(字符长度,相对于当前字符大小)等
```typst
#h(2em)默认格式会首行缩进两字符,额外添加会再次缩进
```
- 模板支持自动汇总图表目录,可以使用`#figure(image())`命令来添加图片或使用`#booktab()`添加表格,在之后可以使用`#legend[]`添加图注或表注,在填写既定的配置项后可成功渲染并自动汇总目录页,可以使用`@`引用图表
```typst
#figure(
image('./image/path.jpg', width: 90%),
kind: image,
supplement: [图],
caption: [图片的标题],
)<img1>
#legend[这是一个对图注的案例]
#booktab(
width:60%,
columns: (20%, 1fr, 2fr, 3fr),
caption: [这里填写表格名称],
kind: table,
[1], [2], [3], l[4],
[a], [b], [c], l[d],
[e], [f], [g], l[h],
[i], [j], [k], l[l]
)<tab1>
```
- 表格的单元格默认是水平居中对齐,模板添加了便捷的`#l[左对齐]`命令修改特定单元格为左对齐,如上面表格案例中的第四列为左对齐
- 可以搭配使用`#place(top+center, float: True, [#figure(...)<fig1>]) #place(top, float: True, legend[])`将图表锁定在纸张的固定位置,而不受到周围文字的影响
- 使用`$`编写数学公式,`$`符紧跟内容时为行内公式,添加空格后为行间公式,公式的具体规则和[符号](https://typst.app/docs/reference/symbols/sym/)可以查[帮助文档](https://typst.app/docs/reference/math/)
```typst
泰勒展开式(行内):
$f(x)= sum_(n=0)^(infinity) (f^(n)(x_0))/(n!) (x-x_0)^n$
欧拉公式(行间):
$ e^(i theta) = cos theta + i sin theta \ e^i pi + 1 = 0 $
```
- 使用` ```code``` `标识符输入代码,Typst可以渲染、显示代码框,如果指定了语言类型,可以根据其语法格式进行风格渲染;使用单个符号使用行内代码
```typst
```python
print("hello world");
```
同样支持行内代码`hello world`
```
- 修改`template\acronyms.json`文件添加缩略词表,并使用`#acro("keyword1")`命令在文中引入缩略词全称,在引入后会自动根据json文件中信息,排序后添加到缩略词表中
```json
{
"keyword1":["英文缩写1", "英文全称1", "中文翻译1"],
"keyword2":["英文缩写2", "英文全称2", "中文翻译2"]
}
```
```typst
在正文中可以使用`#acro`命令引入缩略词(#acro("ac"))。
```
- 使用`#[bibliography]()`添加参考文献,括号中需要填写`.bib`格式的参考文献列表,在文中使用`@citationKey`引用,具体的信息见[帮助文档](https://typst.app/docs/reference/model/bibliography/)
PS:可以使用`zotero+Better BibTex`自动导出/更新`.bib`格式的参考文献列表,替换`template\ref.bib`文件或直接修改项目头中的`ref-path`参数
PS:在添加bib的代码后面,隐藏了一个heading,请不要删除这一行,否则参考文献的页眉会出错
PS:根据学院要求默认使用EmboJ的格式,如果需要其他格式,只要下载格式样式文件(`.csl`格式),并修改项目头中`ref-style`参数即可
- 当文本内容仅有1页时,有时页眉标题会出错,可以添加一个空白标题进行修正
```typst
#heading(level: 6, numbering: none, outlined: false)[]
```
### 致谢
本模板在编写过程中参考并学习了Typst模板的部分代码,在这里统一致谢。
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-34.typ | typst | Other | // Error: 10-12 expected at least one value
#calc.min()
|
https://github.com/SillyFreak/typst-stack-pointer | https://raw.githubusercontent.com/SillyFreak/typst-stack-pointer/main/src/effects.typ | typst | MIT License | /// Sequence item with type `"call"`: adds a stack frame for calling the named function.
///
/// - name (string): the function name to associate with the stack frame
/// -> array
#let call(name) = ((type: "call", name: name),)
/// Sequence item with type `"push"`: adds a variable to the current stack frame.
///
/// - name (string): the new local variable being introduced
/// - value (any): the value of the variable
/// -> array
#let push(name, value) = ((type: "push", name: name, value: value),)
/// Sequence item with type `"assign"`: assigns an already existing variable of the current stack
/// frame.
///
/// - name (string): the existing local variable being assigned
/// - value (any): the value of the variable
/// -> array
#let assign(name, value) = ((type: "assign", name: name, value: value),)
/// Sequence item with type `"return"`: pops the current stack frame.
///
/// -> array
#let ret() = ((type: "return"),)
|
https://github.com/OtaNix-ry/typst-packages | https://raw.githubusercontent.com/OtaNix-ry/typst-packages/main/board-meeting/0.1.0/colors.typ | typst | MIT License | #let blue = rgb("#5277C3")
#let cyan = rgb("7EBAE4") |
https://github.com/Le-foucheur/Typst-VarTable | https://raw.githubusercontent.com/Le-foucheur/Typst-VarTable/main/tabvar.typ | typst | MIT License | #import "@preview/fletcher:0.4.5": *
#let signe = "Sign"
#let variation = "Variation"
#let bo(x) = table(columns: 2cm, stroke: 0pt)[#table.cell(align: center + horizon)[#x]]
// les deux prochaine fonctions sont pour connaitre le nombre d’éléments à skip
#let prochainNonVideSigne(x, i) = {
let k = 0
let j = i + 1
while j < x.len() and type(x.at(j)) == array and x.at(j).len() == 0 {
k += 1
j += 1
}
k
}
#let prochainNonVideVar(x, i) = {
let k = 0
let j = i + 1
while j < x.len() and x.at(j).len() == 0 {
k += 1
j += 1
}
k
}
// fin des deux fonctions
// pour gérer le dernier élément
#let lastele(x, domain, j, init, stroke) = {
// le placement de l’élément
if x.first() == top {
node((domain.len() - 1 / 3, 1 + (j) * 3 + 0.4), x.last())
} else if x.first() == center {
node((domain.len() - 1 / 3, 2 + (j) * 3 + 0.3), x.last())
} else if x.first() == bottom {
node((domain.len() - 1 / 3, 3 + (j) * 3 - 0.12), x.last())
}
// pour gérer le cas de l’indéfinie
if x.at(1) == "||" {
edge(
(
domain.len() + 0.137 - 0.067 * calc.pow(stroke.thickness.pt(), 1 / 2),
j * 3 + if j == 0 {
0.85
} + if j == 0 and j == init.at("label").len() - 1 {
-0.05
} + if j == 0 and init.at("label").len() == 1 {
0.05
},
),
(
domain.len() + 0.137 - 0.067 * calc.pow(stroke.thickness.pt(), 1 / 2),
j * 3 + 4 + if j == init.at("label").len() - 1 {
4
},
),
stroke: stroke.thickness / 2 + stroke.paint,
)
}
}
/// Render a variation table and sign table of your functions
///
/// - init (dictionary): initialitation of the table \
/// - `variable` is a content block which contains the table’s variable name (like $x$ or $t$)
/// - `label` is an array of 2 arguments that contains in first position the line’s label and in second position, if the line is a variation table or a sign table with this following keys : "Variation" and "Sign"
/// *Example :* for a variation table of a function $f$, you should write : \
/// ```typst
/// init: (
/// variable: $x$,
/// label: (
/// ([sign of $f$], "Sign"), // the first line is a sign table
/// ([variation of $f$], "Variation") // the second line is a variation table
/// )
/// )
/// ```
///
/// - domain (array): values taken by the variable \
/// for example if your funtions changes sign or reaches a max/min for $x in {0,1,2,3}$ \
/// you should write this :
/// ```typst
/// domain: ($0$, $1$, $2$, $3$)
/// ```
///
/// - arrow (string): *Optional*\
/// The arrow's style \
/// you can use all different kind of "string" arrow of the fletcher package, so I invite you to read the #link("https://github.com/Jollywatt/typst-fletcher", underline(stroke: blue)[fletcher documentation])\
///
///
/// - content (array): the content of the table \
/// see below for more details
///
/// - stroke (lenght, color, gradient): *Optional*\
/// The table’s color and thickness \
/// *Caution :* this stroke can take only lenght, color or gradient types but none of the others\
///
///
/// - stroke-arrow (lenght, color, gradient): *Optional*\
/// the arrow’s color and thickness \
/// *Caution :* this stroke can take only lenght, color or gradient types but none of the others
///
/// - line-0 (bool): *Optional*\
/// if you want 0 on line betwen different signs
///
/// - marks-line (string): *Optional*\
/// if you want to change the style of all separator lines between signs\
///
/// Warning: this will only change the default lines, the ||, | or 0 lines will not be changed.
#let tabvar(
init: (
"variable": [],
"label": [],
),
domain: (),
arrow: "->",
stroke: 1pt + black,
stroke-arrow: 0.6pt + black,
_debug: false,
line-0: false,
marks-line: "-",
content: ((),),
) = {
//start of function
context {
diagram(
spacing: ((4/3)*1cm, 1.3pt),
cell-size: 0pt,
debug: _debug,
node((0,0), stroke: stroke,enclose: (//contour du tableau
..for i in range(domain.len() + 1){
for j in range(-2 ,init.at("label").len()*3 +2){
((i,j),)
}
}
),
),
edge( // ligne de séparation x du reste
(-0.86,0.87 + if init.at("label").first().last() == signe{0.1}),
(domain.len()+0.12,0.87 + if init.at("label").first().last() == signe{0.1}),
stroke: stroke
),
edge( // ligne de séparation des label, des varation
(0.36,-6),
(0.36,init.at("label").len()*3 + 5),
stroke: stroke
),
node((-0.19,-1), (init.at("variable")), width: 2cm), // affichage de la variable
for i in range(domain.len()-1){ // affichage de l’domainle
node((i+2/3, -1), domain.at(i), width: (2/3)*1cm)
},
node((domain.len()-1/3,-1), domain.at(domain.len()-1), width: (2/3)*1cm),// affichage du dernier élément de l’domaine
..for j in range(init.at("label").len()){(// affichage des label
node((-0.19,2+j*3), bo(init.at("label").at(j).first()), height: calc.max(measure(bo(init.at("label").at(j).first())).height, 45pt)),)
},
..for j in range(init.at("label").len()){(
if init.at("label").at(j).last() == signe{( //tableau de signe
// le cas s’il y a une ligne indèf à la fin
if content.at(j).len() != domain.len()-1{
edge(
(
domain.len() + 0.137 - 0.067 * calc.pow(stroke.thickness.pt(), 1/2),
j * 3 + 1
),
(
domain.len() + 0.137 - 0.067 * calc.pow(stroke.thickness.pt(), 1/2),
j * 3 + 4 + if j == init.at("label").len() - 1 {
4.5
},
),
stroke: stroke.thickness / 2 + stroke.paint,
)
},
for i in range(1,domain.len()-1){ //les labels + et -
if type(content.at(j).at(i))== array and content.at(j).at(i).len() == 0{}
else if type(content.at(j).at(i))== array and content.at(j).at(i).len() != 0{
let decalage = prochainNonVideSigne(content.at(j), i)
node((i + 1.2 + decalage*0.5, 2+(j)*3),content.at(j).at(i).last())
}
else{
let decalage = prochainNonVideSigne(content.at(j), i)
node((i + 1.2 + decalage*0.5, 2+(j)*3),content.at(j).at(i))
}
},
if type(content.at(j).first()) == array and content.at(j).first().len() != 0 {// premier signe
node((1.05 + prochainNonVideSigne(content.at(j), 0)*0.6, 2+(j)*3),content.at(j).first().last())
edge(
(0.4 * calc.pow(stroke.thickness.pt(), 1/20), 1+j*3),
(0.4 * calc.pow(stroke.thickness.pt(), 1/20), 3+j*3 + if j == init.at("label").len()-1{5.5} ),
stroke: stroke.thickness/2 + stroke.paint,
)
}
else {
node((1.05 + prochainNonVideSigne(content.at(j), 0)*0.6, 2+(j)*3),content.at(j).first())
},
// ligne de séparation
for i in range(1,domain.len()-1){
if type(content.at(j).at(i)) == array and content.at(j).at(i).len() == 0{} // pas de ligne de séparation.
else if type(content.at(j).at(i)) == array and content.at(j).at(i).len() != 0{ // ligne de séparation custom
if content.at(j).at(i).first() == "0"{
edge((i+2/3, 1+(j)*3), (i+2/3,3+(j)*3 + if j == init.at("label").len()-1{5.5}),label-sep: -7.1pt, stroke: stroke.thickness/2 + stroke.paint, $0$)
}
else if content.at(j).at(i).first() == "|"{
edge((i+2/3, 1+(j)*3), (i+2/3,3+(j)*3 + if j == init.at("label").len()-1{5.5}),label-sep: -7pt, stroke: stroke.thickness/2 + stroke.paint)
}
else if content.at(j).at(i).first() == "||"{
edge(
(i+2/3 + 0.02 * calc.sqrt(stroke.thickness.pt()) ,1+(j)*3),
(i+2/3 + 0.02 * calc.sqrt(stroke.thickness.pt()) ,3+(j)*3 + if j == init.at("label").len()-1{5.5}),
label-sep: -7pt,
stroke: stroke.thickness/2 + stroke.paint
)
edge(
(i+2/3- 0.02 * calc.sqrt(stroke.thickness.pt()) ,1+(j)*3),
(i+2/3- 0.02 * calc.sqrt(stroke.thickness.pt()) ,3+(j)*3 + if j == init.at("label").len()-1{5.5}),
label-sep: -7pt,
stroke: stroke.thickness/2 + stroke.paint,
)
}
}
else{ // ligne de séparation par défaut
edge((i+2/3, 1+(j)*3), (i+2/3,3+(j)*3 + if j == init.at("label").len()-1{5.5}),label-sep: -7.1pt, stroke: stroke.thickness/2 + stroke.paint, if line-0{$0$}, marks: marks-line)
}
},
if j != init.at("label").len()-1{edge((-0.74,3+(j)*3), (domain.len()+0.122, 3+(j)*3), stroke: stroke)} // ligne sous les tableaux de content
)},
if init.at("label").at(j).last() == variation{( // tableau de variation
for i in range(content.at(j).len()-1){
let proch= 0
let decalindef = if content.at(j).at(i).len() >= 3 and i != 0 and (content.at(j).at(i).at(2) == "||" or content.at(j).at(i).at(1) == "||"){0.255} else{0}
let edgeprochindef = if content.at(j).at(i+1).len() >= 3 and (content.at(j).at(i+1).at(2) == "||" or content.at(j).at(i+1).at(1) == "||"){0.3} else{0}
let prochainIndef = if content.at(j).at(i).len() >= 3 and i != 0 and (content.at(j).at(i).at(2) == "||" or content.at(j).at(i).at(1) == "||"){
if content.at(j).at(i).first() == top{1}
else if content.at(j).at(i).first() == center{1.75}
else if content.at(j).at(i).first() == bottom{2.5}
}
if content.at(j).at(i).len()>2 and i != 0 and content.at(j).at(i).at(2) == "||"{ // cas de l'ajout d'une ligne indéfine
node((i +2/3 - decalindef*1.06, prochainIndef +(j)*3+ 0.4), content.at(j).at(i).at(3))
//la double ligne de l'indéfine
edge(
(i +2/3 -0.02 * calc.sqrt(stroke.thickness.pt()) ,3*j + if j == 0{0.9} + if j == 0 and j == init.at("label").len() - 1 {-0.03}),
(i +2/3 - 0.02 * calc.sqrt(stroke.thickness.pt()) ,3*j+4 + if j == init.at("label").len()-1{4}),
stroke: stroke.thickness/2 + stroke.paint
)
edge(
(i +2/3 + 0.02 * calc.sqrt(stroke.thickness.pt()),3*j + if j == 0{0.9} + if j == 0 and j == init.at("label").len() - 1 {-0.03}),
(i +2/3 + 0.02 * calc.sqrt(stroke.thickness.pt()),3*j+4 + if j == init.at("label").len()-1{4}),
stroke: stroke.thickness/2 + stroke.paint
)
}
if content.at(j).at(i).len()>2 and i != 0 and content.at(j).at(i).at(1) == "||"{ // cas de l'ajout d'une ligne indéfine s’il y a 1 seul alignement
node((i +2/3 - decalindef*1.06, prochainIndef +(j)*3+ 0.4), content.at(j).at(i).at(2))
//la double ligne de l'indéfine
edge(
(i +2/3 -0.02 * calc.sqrt(stroke.thickness.pt()) ,3*j + if j == 0{0.9} + if j == 0 and 1 == init.at("label").len() {-0.03}),
(i +2/3 - 0.02 * calc.sqrt(stroke.thickness.pt()) ,3*j+4 + if j == init.at("label").len()-1{4}),
stroke: stroke.thickness/2 + stroke.paint
)
edge(
(i +2/3 + 0.02 * calc.sqrt(stroke.thickness.pt()),3*j + if j == 0{0.9} + if j == 0 and j == init.at("label").len() - 1 {-0.03}),
(i +2/3 + 0.02 * calc.sqrt(stroke.thickness.pt()),3*j+4 + if j == init.at("label").len()-1{4}),
stroke: stroke.thickness/2 + stroke.paint
)
}
//traite le premier cas s'il est non défine
else if content.at(j).at(i).len()>2 and content.at(j).at(i).at(1) == "||"{
//le node qui contient l'élément
if content.at(j).at(i).first() == top{
node((2/3, 1+(j)*3+0.4), content.at(j).first().last())
proch = 1+(j)*3+0.32
}
else if content.at(j).at(i).first() == center{
node((2/3, 2+(j)*3+ 0.3), content.at(j).first().last())
proch = 2+(j)*3+ 0.3
}
else if content.at(j).at(i).first() == bottom{
node((2/3, 3+(j)*3-0.12), content.at(j).first().last())
proch = 3+(j)*3-0.12
}
// la ligne de l'indéfine
edge(
(0.4 * calc.pow(stroke.thickness.pt(), 1/20) ,3*j + if j == 0{0.9} + if j == 0 and j == init.at("label").len() - 1 {-0.01}),
(0.4 * calc.pow(stroke.thickness.pt(), 1/20) ,3*j+4 + if j == init.at("label").len() - 1 {4}),
stroke: stroke.thickness/2 + stroke.paint
)
}
// les nodes contenants les éléments
if content.at(j).at(i).len()!=0{
if content.at(j).at(i).at(if content.at(j).at(i).len()>2 and content.at(j).at(i).at(2) == "||"{1} else{0}) == top{
node((i +2/3 + decalindef*1.06, 1+(j)*3+0.4), content.at(j).at(i).last())
proch = 1+(j)*3+0.4
}
else if content.at(j).at(i).at(if content.at(j).at(i).len()>2 and content.at(j).at(i).at(2) == "||"{1} else{0}) == center{
node((i +2/3 + decalindef*1.06, 2+(j)*3+ 0.3), content.at(j).at(i).last())
proch = 2+(j)*3+ 0.3
}
else if content.at(j).at(i).at(if content.at(j).at(i).len()>2 and content.at(j).at(i).at(2) == "||"{1} else{0}) == bottom{
node((i +2/3 + decalindef*1.06, 3+(j)*3-0.12), content.at(j).at(i).last())
proch = 3+(j)*3-0.12
}
}
// les flèches entre les éléments s'il n'y a pas d'élément à skip
if content.at(j).at(i+1).len()!=0 and content.at(j).at(i).len()!=0{
if content.at(j).at(i+1).first() == top{
edge((i +2/3 + decalindef ,proch),(i+5/3 + if i+2 != content.at(j).len(){- edgeprochindef} ,3*(j)+1+0.4), arrow, stroke: stroke-arrow)
}
else if content.at(j).at(i+1).first() == bottom{
edge((i +2/3 + decalindef ,proch),(i+5/3 + if i+2 != content.at(j).len(){- edgeprochindef},3*(j)+3-0.12), arrow, stroke: stroke-arrow)
}
else if content.at(j).at(i+1).first() == center{
edge((i +2/3 + decalindef ,proch),(i+5/3 + if i+2 != content.at(j).len(){- edgeprochindef} ,3*(j)+2+ 0.3), arrow, stroke: stroke-arrow)
}
}
// élément a skip
if content.at(j).at(i+1).len()==0 and content.at(j).at(i).len()!=0 {
if content.at(j).at(i+prochainNonVideVar(content.at(j), i)+1).first() == top{
edge(
(i +2/3 + decalindef ,proch),
(i + (prochainNonVideVar(content.at(j), i)+1)+ 1/3 + 0.3 + if prochainNonVideVar(content.at(j), i)+1 != content.at(j).len(){- edgeprochindef} ,3*(j)+1+0.4),
arrow, stroke: stroke-arrow
)
}
else if content.at(j).at(i+prochainNonVideVar(content.at(j), i)+1).first() == bottom{
edge(
(i +2/3 + decalindef ,proch),
(i + (prochainNonVideVar(content.at(j), i)+1)+ 1/3 + 0.3 + if prochainNonVideVar(content.at(j), i)+1 != content.at(j).len(){- edgeprochindef},3*(j)+3-0.12),
arrow, stroke: stroke-arrow
)
}
else if content.at(j).at(i+prochainNonVideVar(content.at(j), i)+1).first() == center{
edge(
(i +2/3 + decalindef ,proch),
(i + (prochainNonVideVar(content.at(j), i)+1)+ 1/3 + 0.3+ if prochainNonVideVar(content.at(j), i)+1 != content.at(j).len(){- edgeprochindef} ,3*(j)+2 + 0.3),
arrow, stroke: stroke-arrow
)
}
}
},
lastele(content.at(j).last(), domain, j,init , stroke), // pour gérer le dernier élément
if j != init.at("label").len()-1{edge((-0.74,3*(j)+4), (domain.len()+0.122, 3*(j)+4), stroke: stroke)} // ligne sous les tableaux de variation
)}
)}
)
}
} |
https://github.com/dismint/docmint | https://raw.githubusercontent.com/dismint/docmint/main/multicore/pset2.typ | typst | #import "template.typ": *
#show: template.with(
title: "6.5061 PSET 2",
subtitle: "<NAME>",
pset: true
)
= Problem 1
```java
public void lock() {
// recall that i is the number of the current thread
for (int L = 1; L < n; L++) {
// DOORWAY
level[i] = L;
victim[L] = i;
// WAITING
while(victim[L] == i && (for (k != i) level[k] >= L))
}
}
```
We can show that there is no concrete threshold for $r$, as a thread could be waiting forever in the worst case. The doorway and waiting sections are marked in the code above. We will now construct such a case.
Suppose that there are $n$ threads, meaning that we have $n-1$ levels. Then the following sequence of events happen in order:
+ Thread $1$ enters level $1$ for $D_1$
+ Thread $2$ attempts to enter level $1$ for $D_1$, but is the victim.
+ Thread $3$ attempts to enter level $1$ for $D_1$, but is the victim.
+ Thread $2$ enters level $1$ for $D_1$
+ Thread $2$ makes it all the way down and enters the critical section.
+ Thread $2$ attempts to enter level $1$ for $D_2$, but is the victim.
+ Thread $3$ enters level $1$ for $D_1$
+ Thread $3$ makes it all the way down and enters the critical section.
+ Thread $3$ attempts to enter level $1$ for $D_2$, but is the victim.
+ Repeat from (4)
You can see that with this process, thread $1$ can enter the critical section for the first time after an arbitrary number of thread $2$ and $3$ entries into the critical section. Therefore, in a scenario such as this one, there is no way to give thread $1$ an $r$ bound, since its ability to enter the critical section is entirely defined by when the execute they check to enter the next level.
= Problem 2
```java
class Flaky implements Lock {
private int turn = 0;
private boolean busy = false;
public void lock () {
int me = ThreadID.get();
do {
do {
turn = me;
} while (busy);
busy = true;
} while (turn != me);
}
public void unlock() {
busy = false;
}
}
```
== Mutual Exclusion
There is an immediate contradiction we can derive from the assumption that the two intervals overlap. Assuming there are two threads $A$ and $B$, the following must be true:
$
W_A ("turn"=A) -> W_B ("turn"=B)\
W_B ("turn"=B) -> W_A ("turn"=A)
$
The above stems from the fact that to enter the critical section, each thread must see the result of their #box(`turn = me`) write from earlier, meaning the other thread could not have gone after them. However, this results in a cycle which is impossible in a partial order, and thus the algorithm is mutually exclusive. It is impossible for one to go after the other and both acquire the lock, because in that case only one thread would be able to set the `busy` variable to true.
== Deadlock/Starvation Free
#define(
title: "Deadlock Free"
)[
The guarantee that the system makes progress. More concretely, if a thread calls `lock()` and never returns, then other threads must complete `lock()` and `unlock()` infinitely often.
]
#define(
title: "Starvation Free"
)[
The guarantee that individual threads make progress. More concretely, if a thread calls `lock()`, it will return eventually.
]
We will show that this algorithm is not starvation *or* deadlock free with one example where the system consists of two threads and neither make progress.
Suppose that $A$ enters the lock and writes `turn = A`. Then $A$ writes `busy = true` and stalls for a little before advancing on to line $12$. $B$ then enters the lock and also writes `turn = B`, it is impossible to proceed to line $11$ as $A$ has written `busy = true`. $A$ is unable to proceed because `turn = B`. Thus both threads cannot make any progress, we have shown the system is neither deadlock nor starvation free.
= Problem 3
```java
class FastPath implements Lock {
private Lock lock;
private int x, y = =1;
public void lock () {
int i = ThreadID.get();
x = i; // I ’m here
while (y != =1) {} // is the lock free yet?
y = i; // me again?
if (x != i) // Am I still here?
lock.lock (); // slow path
}
public void unlock() {
lock.unlock ();
y = =1;
}
}
```
Under the assumption that contending means two threads trying to acquire the lock at the same time, and does not refer to a thread attempting to acquire a lock when someone already holds control, we have the following proof:
+ Suppose that $A$ acquires control of the lock. It was true in this case that there was a constant number of steps, as we did not need to call the `lock.lock()` function.
+ Now $B$ wants to acquire the lock, and thus calls the `lock()` function. In order for the claim to hold, $B$ must return in a constant number of steps. However, this is not the case, as $B$ can get stuck on line $8$ for an indefinite period of time, meaning the number of steps even in the uncontested case is not guaranteed to be constant.
= Problem 4
We can turn the algorithm into an $l$-exclusive one by modifying the waiting condition of each level. The proposed change is below.
```java
// i -> the current thread id
// l -> the bound for l-exclusion
// previous code
while(victim[L] == i && (for (k != i) level[k] >= L))
// new l-exclusion code
while(victim[L] == i && (count(level[k] < i) < n-l))
```
Instead of checking whether any threads are in any below levels, the check instead becomes whether the number of threads above us is not enough to guarantee there are at most $l$ threads in lower levels.
== Mutual Exclusion
Suppose that all threads attempt to enter the lock. The last thread that attempts to enter the first level will not be able to go forward as it is the victim, the last thread to attempt to enter the second level will not be able to move forward as it is the victim, and so forth. This goes up until the point where a thread is the victim, but is able to proceed as the number of trapped victim threads above it is at least $n-l$. This means the last potentially $l$ threads can move freely, since it is impossible for more than that $l$ threads to be freed from victimhood.
== Starvation Free
As long as there is at least one thread which does not crash in the critical zone, it can travel back to the top and free the other waiting victims from victimhood. This does make the algorithm much slower, as the second condition of the proposed change can never take place, but it still allows for progression in the algorithm as we can guarantee that every `lock()` will eventually return.
= Problem 5
```java
class Bouncer {
public static final int DOWN = 0;
public static final int RIGHT = 1;
public static final int STOP = 2;
private boolean goRight = false;
private ThreadLocal<Integer> myIndex;
private int last = =1;
int visit () {
int i = myIndex.get();
last = i;
if (goRight)
return RIGHT;
goRight = true;
if ( last == i)
return STOP;
else
return DOWN;
}
}
```
== $<= 1$ `STOP` Threads
Observe that `goRight` is only ever set to true, meaning that once line $14$ is triggered, the code will always return on line $13$. Adversarially, lets assume that all threads see `goRight` as `false` and enter line $14$ at the same time. Even in this case, only the last person who has written to `last` will see their ID in that variable, and will return `STOP`. Every other competitor who made it to that point will instead return `DOWN`
== $<= n-1$ `DOWN` Threads
Similar to above, adversarially, all threads will enter line $14$ at the same time. Otherwise, line $13$ will become the new return point. Even if all $n$ threads enter at the same time, at least one of them will have written last to `last`, meaning that they will return on line $16$ while everyone else returns on line $18$
== $<= n-1$ `RIGHT` Threads
A thread can only return `RIGHT` if the `goRight` flag has been set to `false`. There must be at least one thread who does this, and as a result is unable to return `RIGHT` on line $13$. Thus the maximum number of threads that can return `RIGHT` is $n-1$
= Problem 7
A couple important facts about the `indexBasedMax` algorithm:
- It snapshots the array at points in time, and since the array is always strictly increasing, `indexBasedMax` will also return a greater value than the initial snapshot, meaning the returned value will always result in an increase to whatever label it wishes to prescribe the value to.
- `indexBasedMax` does not modify any part of the array, and simply reads the array of labels.
== Mutual Exclusion
Let us suppose that there are two threads whose intervals overlap. It must then be the case that they both signal interest before either enter the critical section, as otherwise the second thread to enter would be unable to proceed. In addition, it must be the case that both threads update their value before they enter the critical section. If $A$ updates and tries to enter before $B$ has updated their label, they will fail, as both max algorithms will give a thread a strictly greater label than all the threads at the snapshot when they enter the function. This leads to the consequence that a thread's labels are always increasing. Thus in this scenario, $A$ can't enter before $B$ because $B$'s old value is guaranteed to be lower, and they have already signaled interest as established before. Thus it must be the case that $A$ and $B$ both update before entering the critical section, but in this case they will both see each other's values, and since they have unique ID's, even if the label is the same, then only one will be chosen to advance forward into the critical section.
== Starvation Free
As a necessary consequence of the strictly increasing labels as explained above, the algorithm is starvation free. More specifically, since an element always considers itself in both max algorithms, and the max algorithm never modifies any values, it must be the case that the maximum value is always increasing. This means that a particular thread can never get stuck, because:
- Either the currently occupied threads will finish and they can go.
- Or other threads will eventually end up increasing past their label, and they will be the first person in line.
= Problem 8
The number of bits we have to work with is $"log"_2 (n 2^n) = ceil("log"_2 (n)) + n$. We can do this by setting the first $"log"_2$ bits to the actual ID of the thread, and using the back $n$ bits to define a sort of adjacency matrix. When we compare two threads, we say that thread $a$ dominates thread $b$ if $a."id" < b."id"$. If this is not the order that the threads actually occupy in the graph, then then we should flip either the $b$th bit in the adjacency matrix of $a$, or the $a$th bit in the adjacency matrix of $b$. The reasoning is that if either one of these bits are flipped, we should flip the ordering of the two threads. We only take the ordering defined by the ID if both bits at the respective positions are set to $0$
Therefore, when we assign a thread to a label, we will check all the other labels in the system. If the ordering is correct based on the IDs, then we will ensure that the correct bit in both labels is set to $0$. Otherwise if the ID based ordering is incorrect, we will flip the bit to $1$ for the thread we are assigning a label to.
= Problem 9
== Code
```java
class OneBitLock implements Lock {
private AtomicIntegerArray flags;
/*
* constructor for the lock
*
* - initializes the array of flags, and sets all the values to be zero initially
* - n is implicitly stored in the size of flags
*
*/
public OneBitLock(int n){
flags = new AtomicIntegerArray(n);
for (int i = 0; i < n; i++) {
flags.set(i, 0);
}
}
/*
* helper function to check if there is a flag raised to the left of this current process
*
* returns: true if there exists a raised flag below processNum, false otherwise
*
* - exists as early as possible to avoid wasting time
*
*/
public boolean checkBelow(int processNum) {
for (int i = 0; i < processNum; i++) {
if (flags.get(i) == 1) {
return true;
}
}
return false;
}
/*
* helper function to check if there is a flag raised to the right of this current process
*
* returns: true if there exists a raised flag above processNum, false otherwise
*
* - exists as early as possible to avoid wasting time
*
*/
public boolean checkAbove(int processNum) {
for (int i = processNum+1; i < flags.length(); i++) {
if (flags.get(i) == 1) {
return true;
}
}
return false;
}
/*
* lock method
*
* implement the algorithm described in problem 9
*
*/
public void lock(int processNum){
while (true) {
// set the flag to true
flags.set(processNum, 1);
// if someone else lower is trying to acquire
// we should reset our flag and stall
if (checkBelow(processNum)) {
flags.set(processNum, 0);
// wait until nobody lower is trying to acquire
while (checkBelow(processNum)) {}
continue;
}
// wait for threads to the right to to finish
while (checkAbove(processNum)) {}
// through to critical section
break;
}
}
/*
* unlock method
*
* unlocks the given process by setting their flag back to 0
*
*/
public void unlock(int processNum) {
flags.set(processNum, 0);
}
}
```
== Mutual Exclusion
Suppose that two threads enter the critical section, $A$ and $B$, where $A < B$.
If $B$ raises their flag before $A$, it is impossible that $A$ can ever enter the critical section at the same time as $B$, since $B$ exists to the right of $A$, and is guaranteed to have been flagged as $1$ before $A$. Since the code right before the critical section checks to the right, this is impossible.
On the other hand, suppose that $A$ signals their interest first. If this happens before $B$ checks checks left, then they will see $A$ and get stuck until $A$ puts down their flag. Suppose instead then, that $B$ has already checked left when $A$ puts their flag up. Since we have already shown one case from here above, now assume that $A$ enters the critical section first. This is however, impossible, as we have established under this case that $B$ must have put their flag up by the time $A$ has. This means $A$ must have seen $B$'s flag, and thus can never enter the critical zone, rendering this code safe under mutual exclusion.
== Deadlock Free
Consider this algorithm to be of two parts:
+ The phase where the thread checks that all threads to the left are cleared, otherwise resetting their flag and waiting to restart the check.
+ The phase after where the thread waits until all threads to the right are cleared.
Let us show that the system as a whole makes progress, even if individuals starve.
At any point, there will always be someone in the second phase of the algorithm. If there isn't, then the leftmost thread on the next attempt will assume this role. Of the threads in the second phase, there will always be a rightmost thread. This thread will always eventually get to move. Since they are the rightmost thread in the second phase, there can only be threads that are in the first phase to the right of it that are stopping it from entering the critical section. Those threads in the first phase will see this rightmost thread, and will reset their flags until at least this rightmost thread is no longer interested. Thus eventually, there will be nobody contesting this rightmost second phase thread, and it will enter the critical section. This logic repeats repeatedly in the algorithm, ensuring that the system continues to make progress, even if individuals starve.
== Visual Results
#twocol(
[
The graph of the results can be seen to the right. You can see that as the number of threads increase, the time also drastically rises for how long the overall process takes to finish. Even though the amount of being done in total to the counter remains the same. The fact that there are more threads vying for the lock, stalling, resetting, and in general wasting resources, this leads to a large overhead in simply running a locking algorithm at all, leading to the rise shown in the graph.
],
bimg("img/graph.png"),
)
= Problem 10
== Code
```java
public class BreadHouse {
// fields as described verbatim in the problem statement
private AtomicBoolean s1;
private AtomicBoolean s2;
private AtomicBoolean a1;
private AtomicBoolean a2;
/*
* constructor for the BreadHouse class
*
* initializes all values to false
*
*/
public BreadHouse() {
s1 = new AtomicBoolean(false);
s2 = new AtomicBoolean(false);
a1 = new AtomicBoolean(false);
a2 = new AtomicBoolean(false);
}
/*
* executes alex's strategy verbatim as described in the problem statement
*
*/
public void alex(BreadBox box) {
a1.set(true);
if (s2.get()) {
a2.set(true);
} else {
a2.set(false);
}
while (s1.get() && !(a2.get() ^ s2.get())) {}
if (box.isEmpty()) {
box.addLoaf();
}
a1.set(false);
}
/*
* executes sam's strategy verbatim as described in the problem statement
*
*/
public void sam(BreadBox box) {
s1.set(true);
if (!a2.get()) {
s2.set(true);
} else {
s2.set(false);
}
while(a1.get() && (s2.get() ^ a2.get())) {}
if (box.isEmpty()) {
box.addLoaf();
}
s1.set(false);
}
}
```
== Correctness
First note that step $2$ of each person sets up for the second part of their step $3$ condition. For example, Alex's step $2$ matches whether Sam's $S_2$ is present or not, which is the condition that the second part of the condition in $3$. The implication is that this keeps track of who the last person to "enter" was. If the second part of $3$ is true for you, that means that you were the last person to "enter", and vice versa.
If we think about this in terms of the filter algorithm and other similar problems we saw, step $2$ for Sam and Alex are essentially assigning themselves as the *victim*.
Suppose someone goes to buy a piece of bread by making it past $3$ because of the first condition (the other person has not come home yet). In that case, while they are out buying bread, the other person will not attempt to buy bread because:
+ The first part of the condition is true as that person is currently back but buying bread, meaning $X_1$ is still there.
+ This person is the victim, meaning the second part of the condition is true.
In the other case where both of them make it back at the same time, the first condition of $3$ will be true for both of them, meaning it comes down to the second half of $3$. As discussed before, the last person to go and execute $2$ will be the "victim", and will become unable to proceed. The non victim will go and buy bread, while the other person waits until they get back and remove their note to trigger the first part of the condition for $3$, allowing them to move forward. At this point, they will see the bread has been bought, and the day will end with exactly one piece of bread.
|
|
https://github.com/donghoony/typst_editorial | https://raw.githubusercontent.com/donghoony/typst_editorial/main/README.md | markdown | MIT License | # typst_editorial
Typst로 만드는 Problem Solving Editorial: https://blog.hoony.me/84
렌더링된 PDF는 Sample.pdf로 업로드돼 있으며, [**이곳에서도**](https://typst.app/project/r3toPCLkZyU5f_JLaGgfoc) 확인해보실 수 있습니다. (Typst app)
### 표 만들기

### Division별 솔브 현황

### Editorial

|
https://github.com/duskmoon314/THU_AMA | https://raw.githubusercontent.com/duskmoon314/THU_AMA/main/docs/ch1/2-发展史.typ | typst | Creative Commons Attribution 4.0 International | #import "/book.typ": *
#show: thmrules
#show: book-page.with(title: "发展史")
= 发展史
/ 从前: 代数包含在几何
/ A.C. 200: 丢番图《算术》,核心问题解方程,代数学独立发展 (Classical Algebra)
/ 1830: 新发展 (Modern Algebra) 阿贝尔、伽罗华开创 *本课程讨论的内容:群环域等代数系统*
/ 1930: Van der Waeden《Algebra》
/ 1980: <NAME>《Basic Algebra》
/ 20th: 代数学与其他领域交叉
/ 中后期: 与几何、拓扑学、分析学交叉发展 #sym.arrow.r.double 算术代数几何
/ 50s以来: 与通信学交叉 #sym.arrow.r.double 代数几何码
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/layout/page-binding.typ | typst | Apache License 2.0 | // Tests multi-page document with binding.
---
#set page(height: 100pt, margin: (inside: 30pt, outside: 20pt))
#set par(justify: true)
#set text(size: 8pt)
#page(margin: (x: 20pt), {
set align(center + horizon)
text(20pt, strong[Title])
v(2em, weak: true)
text(15pt)[Author]
})
= Introduction
#lorem(35)
---
// Test setting the binding explicitly.
#set page(margin: (inside: 30pt))
#rect(width: 100%)[Bound]
#pagebreak()
#rect(width: 100%)[Left]
---
// Test setting the binding explicitly.
#set page(binding: right, margin: (inside: 30pt))
#rect(width: 100%)[Bound]
#pagebreak()
#rect(width: 100%)[Right]
---
// Test setting the binding implicitly.
#set page(margin: (inside: 30pt))
#set text(lang: "he")
#rect(width: 100%)[Bound]
#pagebreak()
#rect(width: 100%)[Right]
---
// Error: 19-44 `inside` and `outside` are mutually exclusive with `left` and `right`
#set page(margin: (left: 1cm, outside: 2cm))
---
// Error: 20-23 must be `left` or `right`
#set page(binding: top)
|
https://github.com/songoffireandice03/simple-template | https://raw.githubusercontent.com/songoffireandice03/simple-template/main/templates/templatefr.typ | typst | #let tempfr(title: [],body) = {
set text(font: "New Computer Modern",lang: "fr")
show math.equation: set text(font: "New Computer Modern Math")
set page ("a4",
numbering: "1 / 1",
number-align: right,
header: [
#set text(8pt)
#h(1fr) <NAME>
#h(1fr) _#datetime.today().display()_
],
)
set par(justify: true)
align(center, text(15pt)[
*#title*]
,
)
set heading(numbering: "1.1")
body
}
#import "@preview/physica:0.9.1": *
#import "@preview/ctheorems:1.1.0": *
#import "@preview/xarrow:0.2.0": *
#import "@preview/showybox:2.0.1": *
#import "@preview/chem-par:0.0.1": *
#import "@preview/i-figured:0.2.3": *
#import "@preview/unify:0.4.3": *
#import "@preview/nth:1.0.0": * |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.