repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/circuiteria/0.1.0/src/elements/logic/or.typ | typst | Apache License 2.0 | #import "@preview/cetz:0.2.2": draw
#import "gate.typ"
#let draw-shape(id, tl, tr, br, bl, fill, stroke) = {
let (x, y) = bl
let (width, height) = (tr.at(0) - x, tr.at(1) - y)
let t = (x + width / 2, y + height)
let b = (x + width / 2, y)
let ctrl-bl = (x + width / 2, y)
let ctrl-br = (x + width * 0.8, y + height * 0.1)
let ctrl-tl = (x + width / 2, y + height)
let ctrl-tr = (x + width * 0.8, y + height * 0.9)
let l = (x + width * 0.2, y + height / 2)
let r = (x + width, y + height / 2)
let f = draw.group(name: id, {
draw.merge-path(
inset: 0.5em,
fill: fill,
stroke: stroke,
name: id + "-path", {
draw.bezier-through(bl, l, tl)
draw.bezier((), r, ctrl-tl, ctrl-tr)
draw.bezier((), bl, ctrl-br, ctrl-bl)
}
)
draw.intersections("i",
id + "-path",
draw.hide(draw.line(t, b))
)
draw.anchor("north", "i.0")
draw.anchor("south", "i.1")
})
return (f, tl, tr, br, bl)
}
/// Draws an OR gate. This function is also available as `element.gate-or()`
///
/// For parameters, see #doc-ref("gates.gate")
/// #examples.gate-or
#let gate-or(
x: none,
y: none,
w: none,
h: none,
inputs: 2,
fill: none,
stroke: black + 1pt,
id: "",
inverted: (),
debug: (
ports: false
)
) = {
gate.gate(
draw-shape: draw-shape,
x: x,
y: y,
w: w,
h: h,
inputs: inputs,
fill: fill,
stroke: stroke,
id: id,
inverted: inverted,
debug: debug
)
}
/// Draws a NOR gate. This function is also available as `element.gate-nor()`
///
/// For parameters, see #doc-ref("gates.gate")
/// #examples.gate-nor
#let gate-nor(
x: none,
y: none,
w: none,
h: none,
inputs: 2,
fill: none,
stroke: black + 1pt,
id: "",
inverted: (),
debug: (
ports: false
)
) = {
gate-or(
x: x,
y: y,
w: w,
h: h,
inputs: inputs,
fill: fill,
stroke: stroke,
id: id,
inverted: if inverted != "all" {inverted + ("out",)} else {inverted},
debug: debug
)
} |
https://github.com/raffiii/kit-thesis-typst-template | https://raw.githubusercontent.com/raffiii/kit-thesis-typst-template/main/kit-template.typ | typst | // Organized by functions for each section
// numbering
#let numbered(numbering-format,doc) = [
#pagebreak(to: "odd", weak: true)
#set page(numbering: numbering-format)
#counter(page).update(1)
#counter(heading).update(0)
#doc
]
// Title page: KIT and institute logos in the upper corners, title, author, institute, examiners and advisors, and creation time
#let make-title-page(opts) = [
#set text(size: 12pt)
#set rect(width: 100%,
height: 100%,
inset: 4pt,
radius: (top-right: 0.5cm, bottom-left: 0.5cm),
stroke: 0.5pt
)
#let tablealign(a,b) = {
let rows = a.zip(b).map(row=>row.map(c => [#c])).flatten()
table(align: left, stroke: none, columns: 2,..rows)
}
#let numbered = ("First", "Second", "Third", "Fourth", "Fifth")
#rect[
#table(columns: 2,align: (left,right),stroke: none,
pad(left:1cm,top:1.5cm,image(opts.kit-logo, width: 50%)),
pad(right:1cm,top:1.5cm,image(opts.sdq-logo, width: 50%))
)
#set align(center)
#v(2cm)
#text(20pt)[*#opts.title*]
#v(1cm)
#opts.degree's Thesis of
#v(1cm)
#text(17pt)[#opts.author.firstname #opts.author.lastname]
#v(2.5cm)
At the KIT Department of #opts.institute.department\
#opts.institute.institute
#tablealign(numbered.map(i => [#i Examiner:]),opts.examiners)
#tablealign(numbered.map(i => [#i Advisor:]),opts.advisors)
#v(1cm)
#opts.time.from - #opts.time.to
]
]
#let default-postal-address = (
"Karlsruher Institut für Technologie",
"Fakultät für Informatik",
"Postfach 6980",
"76128 Karlsruhe"
)
#let make-postal-address(address) = [
#pagebreak(weak: true)
#for line in address [
#line\
]
]
#let default-authorship-text = "I declare that I have developed and written the enclosed thesis completely by myself. I
have not used any other than the aids that I have mentioned. I have marked all parts of the
thesis that I have included from referenced literature, either in their original wording or
paraphrasing their contents. I have followed the by-laws to implement scientific integrity
at KIT."
#let make-declaration-of-authorship(opts, text: default-authorship-text) = [
#pagebreak(weak:true)
#align(bottom)[
#line(length: 100%)
_[#opts.title]_
#text
*#opts.sign.loc, #opts.sign.date*
#v(1.5cm)
#line(length: 50%,stroke: (dash:"dotted"))
(#opts.author.firstname #opts.author.lastname)
]
]
// Abstracts
#let make-abstract(opts) = [
#pagebreak(to: "odd", weak: true)
= Abstract
#opts.abstract.english
]
#let make-zusammenfassung(opts) = [
#pagebreak(to: "odd", weak: true)
= Zusammenfassung
#opts.abstract.german
]
// Outlines
#let make-outline() = [
#pagebreak(to: "odd", weak: true)
#outline()
]
#let make-list-of-kind(kind, name) = [
#context {
if query(figure.where(kind: kind)).len()>0 {
pagebreak(to: "odd")
outline(
title: [List of #name],
target: figure.where(kind: kind),
)
}
}
]
// Headers
#let make-header(primary, secondary) = [
#set text(size: 10pt)
#context {
if calc.rem(counter(page).at(here()).last(),2)==0 [
#let count = numbering(secondary.numbering, ..counter(heading).get().slice(0,1)) + " "
_ #pad(left:2mm, count + primary.body) _
] else [
#let count = numbering(secondary.numbering, ..counter(heading).get().slice(0,2)) + " "
_ #pad(right:2mm, align(right, count + secondary.body)) _
]
}
//_ #primary #h(1fr) #secondary _
#line(length: 100%, start: (0pt,-8pt), stroke: 0.5pt)
]
#let get-header() = {
context {
let main-heading = query(heading.where(level:1)).filter(head => head.location().page() == here().page())
if main-heading.len() > 0 {
return []
}
let prev-main-heading = query(heading.where(level:1)).filter(head =>
head.location().page() < here().page()
).sorted(key: head =>
head.location().page()
)
let primary = ((heading(""),)+prev-main-heading).last()
let prev-secondary-heading = query(
heading.where(level:2)
).filter(head =>
head.location().page() <= here().page()
and head.location().page() >= primary.location().page()
).sorted(key: head =>
head.location().page()
)
let secondary = ((heading(""),)+prev-secondary-heading).last()
return make-header(primary, secondary)
}
}
#let thesis-content(opts, doc) = [
#{
set figure(placement: auto, numbering: "1.1")
set heading(numbering: "1.1.")
set page(header: get-header())
show heading: it => [
#v(0.5cm) * #text(font: "DejaVu Sans", weight: "extrabold", it) * #v(0.5cm)
]
show heading.where(level: 1): it => [
#pagebreak(weak: true) #v(2cm) #text(size:20pt,it) #v(1cm)
]
set par(justify: true)
set math.equation(numbering: "(1.1)")
doc
}
]
#let thesis(
title: none,
degree: "Master",
abstract: (german: [], english: []),
institute: (department:none,institute:none),
author: (firstname: none, lastname: none),
examiners: (),
advisors: (),
lang: "en",
time: (from: none, to: none),
sign: (loc: none, date: none),
postal-address:default-postal-address,
kit-logo:"logos/kitlogo_de_cmyk.svg",
sdq-logo:"logos/sdqlogo.svg",
doc
) = {
let opts = (
title: title,
degree:degree,
abstract:abstract,
institute: institute,
author:author,
examiners: examiners,
advisors:advisors,
time: time,
sign: sign,
postal-address:postal-address,
kit-logo:kit-logo,
sdq-logo:kit-logo,
)
set page(margin: (inside: 3cm, outside: 2.51cm, y: 1.75cm, bottom: 2.5cm, top:3cm))
// Title page
make-title-page(opts)
// Postal Address of KIT
make-postal-address(postal-address)
// authorship
make-declaration-of-authorship(opts)
// Abstracts
show: doc => numbered("i", doc)
make-abstract(opts)
make-zusammenfassung(opts)
// Outline
make-outline()
make-list-of-kind(image, "Figures")
make-list-of-kind(table, "Tables")
// Thesis
show: doc => numbered("1", doc)
show: doc => thesis-content(opts,doc)
// doc
doc
}
#let appendix(doc) = {
set heading(numbering: "A.1")
show: doc => numbered("I", doc)
bibliography("references.bib")
doc
} |
|
https://github.com/Enter-tainer/wavy | https://raw.githubusercontent.com/Enter-tainer/wavy/master/wavy.typ | typst | MIT License | #import "./typst-package/lib.typ" as wavy
// Uncomment the following line to use the wavy from the official package registry
// #import "@preview/wavy:0.1.1"
#set page(height: auto, width: auto, fill: black, margin: 2em)
#set text(fill: white)
#show raw.where(lang: "wavy"): it => wavy.render(it.text, width: 20cm)
= Wavy
Typst, now with waves.
```wavy
{
signal:
[
{name:'clk',wave:'p......'},
{name:'bus',wave:'x.34.5x',data:'head body tail'},
{name:'wire',wave:'0.1..0.'}
]
}
```
```js
{
signal:
[
{name:'clk',wave:'p......'},
{name:'bus',wave:'x.34.5x',data:'head body tail'},
{name:'wire',wave:'0.1..0.'}
]
}
```
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/array-33.typ | typst | Other | // Test the `sorted` method.
#test(().sorted(), ())
#test(().sorted(key: x => x), ())
#test(((true, false) * 10).sorted(), (false,) * 10 + (true,) * 10)
#test(("it", "the", "hi", "text").sorted(), ("hi", "it", "text", "the"))
#test(("I", "the", "hi", "text").sorted(key: x => x), ("I", "hi", "text", "the"))
#test(("I", "the", "hi", "text").sorted(key: x => x.len()), ("I", "hi", "the", "text"))
#test((2, 1, 3, 10, 5, 8, 6, -7, 2).sorted(), (-7, 1, 2, 2, 3, 5, 6, 8, 10))
#test((2, 1, 3, -10, -5, 8, 6, -7, 2).sorted(key: x => x), (-10, -7, -5, 1, 2, 2, 3, 6, 8))
#test((2, 1, 3, -10, -5, 8, 6, -7, 2).sorted(key: x => x * x), (1, 2, 2, 3, -5, 6, -7, 8, -10))
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/content_02.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test non-equation math directly in content.
#math.attach($a$, t: [b])
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/034%20-%20Dominaria/005_Return%20to%20Dominaria%3A%20Episode%205.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Return to Dominaria: Episode 5",
set_name: "Dominaria",
story_date: datetime(day: 11, month: 04, year: 2018),
author: "<NAME>",
doc
)
"Thank you for meeting me here," Ajani said.
Jhoira inclined her head. "I assume you want me to help the Planeswalkers you told me about." They stood on the newly constructed bridge of the #emph[Weatherlight] . It was raised and suspended across the stern of the ship, with big windows that stretched from one wall to the other, providing a broad view of the bright morning sky of Bogardan, the workers' camp, and the beach and cove below. The others were out on the open deck below the bridge, where Tiana and Arvad were helping Shanna and Raff bring the rest of the supplies aboard and stow them below decks.
Ajani's sudden appearance had caused some confusion. Even to people accustomed to magic, it was startling to see a tall muscular humanoid with white fur and the head of a one-eyed predator cat materialize out of thin air. Fortunately, most of the work crew had already boarded the supply ship for their voyage home, and Hadi and Tien and the few others who had remained on the beach to say goodbye to Jhoira were used to strange occurrences.
Jhoira had only met Ajani once before, and briefly, when he had told her he was a Planeswalker and asked for her help. They had arranged to meet again here, but Jhoira had meant to arrive early enough to be able to reacquaint herself with the completed #emph[Weatherlight ] first. Now she had to make herself concentrate on the conversation when all she really wanted was to run her hands over the smooth new wood of the ship's navigation console, to take the stairs at the back of the bridge and go down to examine the rebuilt engines and explore the maze of cabins and common rooms and the galley. Molimo's seed had clothed the skyship's bones in a way that was both completely different and hauntingly familiar.
"Yes, we must meet them," Ajani said. He didn't seem to notice Jhoira's distraction, obviously occupied with his own concerns. Whatever he was about to say, he seemed reluctant to get on with it. "But first I must ask . . . Were you aware the Planeswalker called Karn was found and rescued from the Phyrexians? That he has returned to Dominaria?"
"No! I wasn't—are you certain?" The shock and the rush of relief made her heart pound. Ajani nodded gently. Jhoira turned away and covered her face, wanting the well of emotion to be private. Her mechanical owl landed on her shoulder, chirping anxiously, drawn by her sudden agitation. #emph[I'm all right] , she told it, and with another thought sent it down the stairwell hatch and out to the #emph[Weatherlight] 's deck. She took a deep breath and turned back to Ajani to ask where Karn was. Ajani's features were so different it was hard to read his expressions, but the dismay in his gaze was eloquent. Instead she asked, "Is something wrong? Is Karn hurt?"
"Not hurt." Ajani hesitated. "You also knew the Planeswalker Venser?"
"Yes." Jhoira noted the past tense and felt sick. "Please, just tell me what happened."
Ajani let out a breath. "Venser gave up his spark to Karn, to rescue him. Venser did not survive."#linebreak
#figure(image("005_Return to Dominaria: Episode 5/01.jpg", width: 100%), caption: [Distant Memories | Art by <NAME>inski], supplement: none, numbering: none)
Jhoira paced away toward the compass stand, running a hand through her hair. She didn't want to believe it, but it was exactly the kind of thing Venser would do. After her relief for Karn, this was a crushing sadness. Venser had been barely older than Raff when she had known him, and she had loved him as a friend, though he had felt more for her. Her back to Ajani, she asked, "Is this why Karn hasn't come to find me?"
Ajani shook his head. "I don't know. But . . . it seems a natural assumption."
#emph[I'll have to find him] , Jhoira thought. Karn was her friend too, and their grief for Venser was shared. She rubbed her eyes. There were other things to deal with first. She said, "And Phyrexia?"
"An entire plane has fallen to them, but they've been contained there. No other planes should be in any danger." Ajani sounded reassuringly certain.
Jhoira wanted to ask more, but she heard Tiana call to her from the deck. The #emph[Weatherlight] was ready to get under way, and she didn't want to waste another moment. The work to come would be a welcome distraction. She ran her hands over the navigation console, grounding herself, and said, "Thank you for bringing me this news. It can't have been an easy burden. Let's fetch your friends, shall we?"
Ajani nodded, his expression gentle, obviously recognizing the hollowness of her smile and her desire for privacy.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The gates to Benalia City were impressive, constructed of the magical Benalish stained glass, gleaming in the bright morning sun. They were well over four stories high, set in soaring gray stone walls topped with narrow towers and arches. Gideon would have appreciated the sight more if the passage inside hadn't been blocked at the moment. A dozen battle angels had planted themselves across the roadway, stopping not only their party but all the market wagons and other travelers trying to get in around them.#linebreak
#figure(image("005_Return to Dominaria: Episode 5/02.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Gideon was on horseback, and didn't bother to dismount. Behind him were Liliana and a small troop of Rael's men-at-arms. Not bothering to keep the ironic tone out of his voice, he asked the angels, "Is there a problem?"
The angel in the lead said, "I am <NAME>, commander of the angels of Serra. Your companion stinks of death magic and will not be allowed into this city."
"Oh, please," Liliana muttered in disgust.
Gideon drew in a calming breath. This was no time for a fight, particularly with people who should be their allies. "You see we travel with soldiers of Benalia," he began.
Lyra interrupted, "You and they are welcome. The necromancer is not."
Gideon was not in the mood. It had been a long ride here, and he knew Rael's aven messengers had already carried word of the battle ahead of them. "The 'necromancer' is a demon slayer. She has already killed three demons and was instrumental in defeating the Cabal in Caligo, and we've come here to kill Belzenlok."
Liliana gasped in exasperation. "Why are you telling everyone our plans? Can you shout a little louder? I'm sure there's at least one Cabal cultist in the countryside who didn't hear you."
Gideon set his jaw. "I'm not telling everyone, I'm talking to the commander of the Church of Serra." He pointed emphatically. "She's the one with the wings."
"Oh, don't try to be sarcastic, you're not very good at it," Liliana said. "And that doesn't mean you can trust her. How can you have survived this long and still be so naive?"
Gideon said over his shoulder, "The Church forces trusted us in Caligo and helped you with your particular problem. The least we can do is trust them in return—"
Liliana pointed out, "That isn't the least we can do!"
"—And we already know Belzenlok knows we're here!"
Lyra looked from Gideon to Liliana and back, one brow lifted. Thiago rode around them and offered her a folded packet. "<NAME>, this letter is from Rael, battle angel of Caligo, where she personally vouches for the necromancer Liliana."
Lyra took the packet and opened it. She asked Thiago, "Have they been like this the entire way from Caligo?"
Thiago sighed. "Yes, Commander, every step."
Lyra scanned the letter. After a long moment, she grudgingly admitted, "Very well. You may enter the city."
Her tone deeply sarcastic, Liliana began, "Why thank you very mu—" but with one hard flap of her wings, Lyra shot into the air. The other angels followed, the displaced air stirring Gideon's hair and making his horse stamp.
While Liliana muttered rude comments, Gideon was just relieved to have the obstacle removed. He turned to Thiago. "We need to find somewhere high up, the top of a tower. Do you have any suggestions?"
Thiago said, "That, I can help with."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
White banners flew everywhere, and they passed through a plaza with statues of Benalish heroes in gold-plated armor. After the Morass, it was good to ride through a living city, bustling and energetic, with so many humans and aven in civilian clothing going about their business. There were still soldiers and knights, and even some of the giant winged horses being led through the streets, but while Benalia City was obviously well guarded, it wasn't under siege. #emph[Not yet] , Gideon thought. He would hate to see this place, and the prosperous towns and countryside around it, in the same state as Caligo.#linebreak
#figure(image("005_Return to Dominaria: Episode 5/03.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Thiago arranged for them to be allowed to wait at the top of one of the Benalish garrison's signal towers, which also had a landing platform for the convenience of angels and aven. Gideon had told him only that they were waiting for a friend, but, accustomed to the comings and goings of winged warriors, Thiago didn't seem to find this unusual. Gideon thanked him and he said, "It's the least I can do, after what you did for Caligo. Both of you. Good luck."
Gideon glanced at Liliana to see what effect this had on her, but she had already turned away. She took a seat on a stone bench near the platform. On the journey here, he'd been worried about her. She still hadn't spoken about her brother, and Gideon wasn't sure she had been aware that he'd heard Josu's last words to her. The Chain Veil had taken its toll, draining her strength, but they had had to leave for Benalia City almost immediately.
As he took a seat beside her, she said, "So why did Ajani want to meet in midair?"
Gideon leaned back against the wall, easing his still-sore shoulder. "I don't know. I'm sure it's a good reason."
Liliana countered, "I'm sure it's a pretentious reason."
They waited long enough for Liliana to drift off to sleep. Then Gideon spotted something small and gold flitting through the air and stood, thinking it was a messenger. It landed on the parapet, and he saw it was a small mechanical owl. "That's some very complex magework," Liliana commented with a yawn, getting to her feet.
"And so is that," Gideon said, as the giant skyship dropped down toward them.#linebreak
#figure(image("005_Return to Dominaria: Episode 5/04.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The argument started as soon as they boarded the #emph[Weatherlight] and went up the steps and into the spacious bridge. The front section, where the wheel and compass pillar stood, was almost all window and looked out over a spectacular view of Benalia City. Ajani barely gave them time to meet <NAME>, <NAME>, and <NAME> before he asked Gideon, "Where are the others? Why aren't they with you?" forcing Gideon to launch into a long and awkward explanation.
Liliana stood there, teeth gritted, as long as she could take it. The long-buried part of her who had remembered she was a daughter of the House of Vess found it all very rude and disrespectful. Gideon was his usual annoying self, standing there explaining with apparent calm. At least he left out any mention of her brother, making it sound like they had laid the Caligo Lich to rest simply because it was the only way to defeat the Cabal force. It was a relief; she could imagine Ajani might even be sympathetic, at least regarding Josu, and she couldn't stand the thought. His pity would be more than her temper could take.
And Josu's reference to the Void still sent a chill through her bones. What could it mean?
Ajani said sorrowfully, "I was afraid of this. I don't know how we can defeat <NAME> now. You should not have gone to Amonkhet."
Liliana couldn't take any more. The Chain Veil was like a weight at her side, sapping her strength even this long after using it. She wanted a raging argument with someone and Ajani was a much better target than Gideon. With icy control, she said, "You might stop moaning at us long enough to listen to our plan. Or let us sit down. Gideon is still recovering from being wounded, you know, and not that you care, but I'm not feeling well either."
The young mage Raff tried to offer them a seat but Ajani turned his regretful gaze on her. "I know most of this is because of you, necromancer. You and your demons—"
"Liliana, stop," Gideon interrupted. "Ajani, this was my decision and I accept the consequences."
Ajani turned back to Gideon, exasperation in his gaze. But his tone was still irritatingly calm as he said, "Accepting the consequences is admirable, but the damage has been done on Amonkhet, and there is no way to repair it."
"I can't argue with that," Gideon said. Liliana seethed, but at least Gideon's weaponized calm was aimed at Ajani. Maybe they could calmly "more in sorrow than in anger" each other until they turned to stone where they stood. #emph[Not a bad idea] , Liliana thought, and started to seriously consider how to make that happen, at least as far as Ajani was concerned. Gideon continued, "But we failed on Amonkhet because Liliana was still hamstrung by her demon pact. Once we kill Belzenlok, she will be free to use her full power against <NAME>."
Ajani persisted. "You need to listen to me, and not waste your time here."
"Ridding Dominaria of Belzenlok is a waste of time?" Liliana burst out.
"That is not what I meant," Ajani said, so patiently that Liliana snapped like a twig.
"You didn't see what he did to Caligo!" she burst out. "Everything I knew, destroyed, turned to mud and rot. We have to stop—we have to—" She realized abruptly she had said more than she meant to, that she had exposed herself terribly. The new people were staring at her sympathetically; Shanna in particular was nodding as if she understood perfectly, and it was all horrible. Liliana folded her arms and lifted her chin, determined to brazen it out. "I need to be free of my pact before I can fight your battles for you, Ajani, it's just that simple."#linebreak
#figure(image("005_Return to Dominaria: Episode 5/05.jpg", width: 100%), caption: [Demonic Pact | Art by <NAME>], supplement: none, numbering: none)
Ajani didn't answer, merely studying her with his one good eye. Gideon said, "We intend to continue the fight, Ajani. But we must destroy Belzenlok first."
Ajani regarded Gideon steadily, then his gaze moved back to Liliana. She knew she looked stubborn and angry and distressed, and tried to compose her expression into her usual contemptuous sneer. She wasn't sure she managed it.
Ajani seemed to reach a decision. Finally, he spoke. "I see. I can't help you here. I must find more Planeswalkers to join the battle against Bolas."
Gideon didn't hesitate. "We'll join you as soon as we can."
Ajani gave him a grim, respectful nod. "Take care."
Golden shadows formed around him as he turned away, as if he stalked through a field of high grass. Then a heartbeat later he vanished as he walked from the plane.
Raff waved at the empty spot he had left. "Bye, it was nice meeting you. Come again whenever you want to have an inexplicable Planeswalker confrontation in front of total strangers."
Shanna nudged him. "Not now, Raff."
Gideon let his breath out and turned to Jhoira. "I'm sorry to argue on your bridge. Obviously Ajani intended us to leave with him. If you'd like us to go—"
"Not at all." There was steel underneath Jhoira's calm. "Ajani may have his plans, but I've had this ship reconstructed for the sole purpose of fighting the Cabal, and destroying Belzenlok is an excellent first step. We'd welcome your help."
"Why?" With effort, Liliana kept her tone inquiring instead of accusing. She didn't want to turn down help and she didn't want to leave this obviously comfortable skyship, but she didn't want to be fooled again. "What's your interest in killing Belzenlok?"
Jhoira smiled a little. "I'm not a Planeswalker; this place is my home, and my interest is in protecting it. I've been doing that since before the Phyrexian invasion." That was interesting. Liliana raised her brows, and Jhoira added, "I'm older than I look."
With a shrug, Shanna said, "I fight the Cabal in whatever form it takes. Getting rid of Belzenlok will make that much easier."
Raff waved. "I'm new. I just started today, really. And you haven't met the others yet, but Tiana's an angel of Serra and Arvad's . . . Arvad, but he wants to destroy Belzenlok too."
Liliana didn't sense any deception, and being an expert at deception herself, she should know. Part of her didn't want new allies; she wanted to be alone with her anger and the painful revelations about her family. But she knew she was even more incapable of killing Belzenlok on her own now than she had been when they first arrived on Dominaria. She glanced at Gideon, who said, "We all have the same goal, whatever our different reasons. Let's sit down and discuss how we can help each other."
Jhoira led them down the stairs to a compartment on the lower deck below the bridge. It was a wide room with a meeting table and more long windows looking out on the sky and the city below. They also met Tiana the angel, who seemed less arrogant than the other angels Liliana had encountered, and Arvad, who was an apparently reformed vampire.
As they took seats, Liliana admitted, "I know we'd be fools not to cooperate. But we need a new plan. My old one fell apart when our Planeswalker allies left."
Ever the deluded optimist, Gideon said, "I think we can get Chandra back . . . if we can find her."
Wearily, Liliana told him, "Even if she's still on Dominaria, her power isn't enough to get us into the Stronghold. Without Nissa, we don't have the brute force." She made a frustrated gesture. "And we still have to find some way to kill Belzenlok."
"We need information." Jhoira steepled her fingers. "I've been watching the Stronghold for years, and one thing I've learned is that its defenses are constantly changing, and the ways in and out are rebuilt on Belzenlok's whim."#linebreak
#figure(image("005_Return to Dominaria: Episode 5/06.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Liliana grimaced. The situation was even worse than she had expected.
But Shanna said, "We need to capture a high-level Cabal agent. They report to Belzenlok personally, they'll have information about the Stronghold's current structure, the traps that surround it, the best way to get inside." She looked at Tiana. "Would there be one here? Would the angels help us find one?"
Tiana considered it, her expression dubious. "The angels assigned to Benalia City search for agents and kill them. I don't think we'd find one alive here."
The vampire Arvad had been listening quietly. He said now, "Tiana's right. If there's anywhere in Dominaria where Cabal agents have no hold, it's Benalia City. We'll have to go somewhere else to find one."
Raff bounced enthusiastically. "Oh, I know. The last time I was in Tolaria West, there were rumors about Cabal agents in the academy. It's not far, especially as fast as the #emph[Weatherlight] travels. We could be there before sunset, see if they've captured any—"
All this constructive discussion was making Liliana's mood improve, in spite of herself. Also, traveling in fast comfort instead of traipsing all over by foot or horseback or boat sounded ideal. She said, "If they haven't, we may be able to flush one out of hiding."
"It's a good plan," Gideon agreed.
Jhoira glanced around the table. "Then we're decided. To Tolaria West it is."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Barely half the day later they were approaching Tolaria West, and Liliana went out on deck with the others. She had a chance to sleep on a bunk in one of the comfortable cabins, and she felt less like something that had been chewed up by undead crocodiles.
They had been traveling over an astonishingly blue sea, and now they were coming up on a series of low wooded islands surrounded by reefs and sand bars. On the shore of the largest stood the Tolarian mage academy, a complex of white stone buildings and towers with steeply pitched red tile roofs. One high tower had a giant instrument built into it that looked very like an astrolabe but probably wasn't. It was obviously the same sort of magic that had produced the mechanical wonders of the #emph[Weatherlight] , Jhoira's owl, and the artificer's devices Raff carried.#linebreak
#figure(image("005_Return to Dominaria: Episode 5/07.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
By the time the #emph[Weatherlight] arrived at the tallest tower, important-looking people were waiting for them on a broad balcony. The good thing about arriving in the #emph[Weatherlight] , Liliana supposed, was that you didn't have to kill anybody to get the attention of the authorities you needed to speak to.
As they drew close enough to see who was waiting there, Liliana sensed Jhoira tense up. "Problems?" she asked.
"No." Jhoira sounded somewhere between regretful and impatient. "Just an ex-lover I wasn't expecting to see today."
"Ex-lovers are more trouble than they're worth," Liliana agreed. "They disappear, and don't tell you where they're going, and ruin all your plans."
Gideon, who she hadn't realized was in earshot, said, "I'm sure that's not what happened. Jace would never—"
"It's none of your business," Liliana snapped, cutting him off. The last thing she wanted was Gideon's opinion on her love life. In fact, the last thing she wanted was Gideon's opinion, period.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
They left Tiana and Arvad on the deck to guard the #emph[Weatherlight] , Tiana leaning on an enormous spear and Arvad's fangs gleaming in the fading sunlight. It was a precaution Gideon approved. Any Cabal agent who tried to steal aboard would find they had come to the wrong skyship. As Gideon climbed down the ladder, the others stood on the broad stone balcony. A group of blue-robed Tolarian academicians waited for them, the strong sea wind pulling at their robes. In the lead were an older man with hard features and a deceptively young-looking mage with a mane of brown hair. Gideon didn't have any trouble guessing which one was Jhoira's former lover.
#figure(image("005_Return to Dominaria: Episode 5/08.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
The young mage stepped forward. Composed and cool, he said, "Jhoira."
Jhoira tilted her head, her expression just slightly ironic. "Jodah."
Raff interposed hastily and introduced the older man. "This is Naban, the Dean of Iteration."
Naban nodded a greeting. "To what occasion do we owe this honor?"
Something about the man's tone said he was very busy and they were interrupting important work. #emph[Well, that's too bad] , Gideon thought, in no mood to care. Their mission was too urgent.
Jhoira explained, "We've found ourselves in need of information from a Cabal agent. Raff said you were having a problem rooting them out of the Academy."
Naban lifted a reproachful brow at Raff, but Jodah's expression went thoughtful. He said, "Give us a moment, please."
As he stepped away with Naban to talk, Gideon said softly to Jhoira and Shanna, "And what do you make of that?"
Jhoira watched the dean speculatively. "I think Raff was right about a problem with Cabal agents."
Shanna's gaze was on the other academics. "There's been trouble here. They're nervous, upset."
As they watched, Naban appeared to be reluctantly convinced by Jodah's argument. Jodah stepped back over to them. He said, "I'm not sure how much we can help you, but there's something we'd like you to take a look at."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Gideon stood with his arms folded, watching as Liliana took a seat on the next pallet and performed her spell. This corpse was another young woman, dressed in the blue and white robes of a student. The spell took hold and violet sparks of light chased across the corpse's graying skin. Its eyes opened and it sat up, its gaze locked on Liliana. She said, "There you are. Now tell us what you saw."
They were in one of the academy's risk laboratories, a place where dangerous magical experiments were performed and strange magical objects examined. It took up the whole top of one of the larger towers, but so far they had only seen this main room, a wide, high, barrel-vaulted space, with narrow windows barred with metal and warded by magic. The light from the windows had dimmed as sunset approached, and glowing crystal globes, floating on little platforms constructed by artificers, hovered in the air. Lying on the floor were nine corpses, students and staff of the academy. It made a grim sight; most of them were young, and from the expressions on their rigid features, they had died in torment.#linebreak
#figure(image("005_Return to Dominaria: Episode 5/09.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Raff was over at a table, examining the magical devices the murdered people had carried. Jodah stood with Jhoira and Shanna a few steps away, quietly answering their questions. He was saying, "The stairwell they were found in leads to the archives and three different laboratory towers. We have no idea which one the intruder was trying to reach."
"And there was no sound at all?" Jhoira asked, frowning in consternation.
"Nothing," Jodah told her. He glanced at the bodies, regret obvious in the crease of his brow. "We're still attempting to assemble a timeline of events, but it happened very quickly."
The corpse whispered to Liliana, "The floor turned to water, I sunk into it. I couldn't breathe. There were serpents in the water, like the ones off the outer reef when I was young, they came at me—"
Liliana's mouth twisted in impatience. "Yes, yes, but did you see anyone? A face you remember?"
"No, the serpents—"
Liliana tapped it on the forehead. "Never mind, then. Back you go." As the corpse sank back into immobility, Liliana pushed to her feet. "It's dementia magic all around, I'm afraid," she said briskly. "It has to be a Cabal cleric, but none of the victims saw who cast the spell."
Shanna had her arms folded, her brow furrowed. "This isn't right."
Liliana shrugged. "You all said you wanted me to interrogate the corpses."
"No, not that." Shanna waved that away. "The whole situation. I've hunted Cabal agents in the cities of Jamuraa, and this is not how they operate. They're far more subtle than this, they have to be."
Puzzled, Raff looked away from the devices on the table. "I thought they were like berserkers."
"The grimnants and other fighters, yes," Shanna told him. "But the agents have to be able to blend in, to get into the places or get near the people they want to spy on." She gestured at the line of bodies. "Killing all these poor people in one go is something they certainly would do, but it's also drawn too much attention. They failed to get into the archives or the other laboratories and now the entire academy is alerted."
Gideon thought it was a valid point, but Liliana didn't look convinced. She said, "Maybe it's just a very stupid agent. Cabal cultists aren't the brightest bunch, you know."
"Then why hasn't this one been caught yet?" Jhoira countered.
Gideon looked at the corpses again. He was certain Shanna was on the right track. "So you think this was a distraction, but from what?"
Jhoira turned to Jodah. "There haven't been any other disturbances in the academy?" The two seemed much more reconciled to each other's presence with a problem to work on. Gideon found himself wishing Liliana and Jace could be that efficient.
"No, the entire academy has been on alert, and we've sent warnings to the other islands." Jodah's expression was grim. "It did occur to us that this might have been an attempt to draw attention from another area of the academy."
Shanna paced along the line of pallets. "Can you tell us what exactly happened when the dead were discovered? What steps were taken?"
Jodah considered it. "Healers were summoned to make sure there was no hope of revival. At the same time, the archives were searched thoroughly, and we made sure . . . certain seals remained intact. By that time the healers had determined the victims were killed by spellcraft, so the bodies were brought here to this laboratory for examination."
Shanna turned and lifted a brow. "Brought by who, exactly?"
"By the healers' assistants, some students . . . " Jodah stopped, eyes narrowing.
Jhoira smiled. "Oh, that's clever. Raff, guard that door."
Gideon drew his sword. "We need to search." It was a relief that their quarry might be nearby, trapped in this secure tower somewhere, but they had to be careful. This Cabal agent had nothing to lose now.#linebreak
#figure(image("005_Return to Dominaria: Episode 5/10.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Raff hurried to the main entrance to put his back against the heavy carved doors. "Uh, what exactly did we figure out?"
Liliana made an annoyed gesture. "This place was the target all along."
Gideon stepped into the open archway that led further into the laboratory's tower. The foyer was clear, no one lurking in the shadows. "The agent killed these people so they would be brought here to be examined. This many victims would need at least twice as many attendants to carry them—"
Jodah's expression had gone hard. He reached Gideon's side and said, "We didn't count the students who came to help. We don't know how many came in and how many left."
"Do you have any idea what the agent might want in here?" Jhoira moved to the stairwell to look upward and Gideon joined her. There were six levels of tower above them, with balconies and landings extending out over the well. The staircase wound up, with no obvious support except magic, touching the walls only at the landings. The tower was complex, and seemed larger on the inside than it had appeared from the outside. It would be a long, difficult search unless they could narrow it down.
Jodah made an impatient gesture. "There's a great number of devices and partial devices stored here. It could be anything—"
"What about ancient artifacts?" Liliana strolled up behind them. "This is Belzenlok we're talking about. He's not going to be interested in some artificer's newly created device, he's going to want something old he can use to aggrandize himself."
"That's right," Raff called to them from the outer door. "All those titles he's given himself! 'Eternal Patriarch of the Cabal,' 'King of Urborg,' 'Lord of the Wastes,' 'Master of the Ebon Hand'—'"
Peering up into the shadows of the stairwell, Jhoira gestured at Raff to stop. "Yes, he's been taking credit for every shift in Dominaria's history, every ancient cataclysm, and he's collected artifacts to supposedly prove his claims."
It sounded more than plausible to Gideon. He asked, "Is there anything here that's particularly ancient or famous? Or both?"
Jodah frowned in thought. "I think I have it. Come with me."
Jodah led them up the stairs past the third level to a balcony, then through an archway. It opened into a large round chamber with tall shelves leading back into shadowy depths. As the others stepped inside, Gideon asked Jodah, "Is this the only way out?"
Jodah signaled assent, and Gideon took up a guard position in the archway. As Shanna drew her sword and stepped to Gideon's side, Jodah strode to one of the shelves and lifted down a box. He cursed under his breath and showed the empty container to Jhoira. "It's gone."
"But now we know we're right." Jhoira sounded satisfied.
Liliana stepped forward to look into the empty box. "What was it?"
Before Jodah could answer, Shanna said, "Quiet." She tilted her head, listening. "Someone's in here."
Gideon heard the faint footstep. He raised his voice, "Whoever's hiding here, come out."
The silence stretched, and some almost imperceptible change in the air made it more and more obvious someone was in here with them. Then a rustle sounded from a library bay on the far side of the room. A young man in Tolarian student robes stepped out of the shadows. He said, "I'm sorry, Magister, I was just working here. I'm Thom, studying artificing with Dr. Arongi."
Gideon lifted his brows. As an excuse, it was somewhat lacking. But he thought it was also something a young student might well do. More skeptical, Jhoira commented, "Today, with a pile of murder victims in the main laboratory? That's dedication."
Jodah said coldly, "You're not one of the students assigned here."
Thom moved forward, his expression contrite. "I'm sorry. I helped carry the bodies in. One of the healers said more help might be needed, and so I stayed, and I started to look at these texts." He smiled earnestly. "I just forgot myself. I've never been in this tower before."
The young man seemed so innocent that he made Raff looked like a jaded rake. Gideon was tempted again to believe him, then thought, #emph[If I were a Cabal agent, this is exactly the way I'd want to appear] .
Jodah appeared unconvinced. Jhoira watched Thom like a hawk about to pounce. She said, "And what do you have in your hand, Thom? It's an artificer's device, isn't it?"#linebreak
#figure(image("005_Return to Dominaria: Episode 5/11.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Thom's expression turned serious. "Yes, I found this lying on the floor where the others were killed." He started forward, lifting the device up. "I meant to tell the healers but—" A dark globe of death magic appeared in the air and shot across the room toward Jodah.
Jhoira moved so fast it was like she had teleported. Suddenly in front of Jodah, she flicked her fingers at the approaching globe. The air in front of her seemed to harden somehow, and when the globe struck it, it broke like a glass bauble. The fragments bounced back toward Thom.
Gideon shouted and lunged forward, but Liliana was faster. Purple bolts shot from her hands as the lines on her skin flared. Thom took the hit in the chest and stumbled backward. But even as he flailed, he cast a spell of his own, enveloping Liliana in a black cloud. She gasped and staggered.
Another cloud flowed toward Gideon almost immediately, but his sword glowed golden with his shield spell and turned the cloud back toward Thom. Shanna flung herself forward right through it. Gold sparkled around her as she slammed into Thom's chest. She knocked him flat and Gideon stepped forward to kick the magical device away from his hand.
Abruptly Thom's struggles stopped and his body went rigid.
Gideon glanced back to see Jodah stood beside him, one hand raised. "He's harmless now," Jodah said.
Gideon gave Shanna a hand up and they both backed away. Jodah gestured again and Thom's body lifted off the floor. "I'll take him down to the main laboratory where you can speak to him."
He conducted the body out, and Jhoira and Shanna followed. Gideon stopped to ask Liliana, "Are you all right? I saw something hit you."
Her skin was pale and there were beads of sweat on her brow. But her mouth twisted in the familiar expression of contempt. "I'm fine. A little dementia magic hasn't much effect on me."
Gideon hesitated, then had to ask. "You saw Josu, didn't you?"
Liliana glared at him, then the glare faded and she looked away. "The cleric should have chosen something else. I see Josu all the time, now." Then the glare returned. "It's not a sign of weakness, so if you tell anyone—"
Gideon sighed. "Yes, I know, tear me limb from limb, unspeakable torments, and so on. Let's see what this Cabal agent has to say."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
In the laboratory's main room, Jodah sent for Naban and the other academy deans to hear the agent's confession. While they tried various magical means to get the information out of their captive, Jhoira found herself with a chance to talk to Jodah. His expression was opaque, but she knew him well enough to know he would hold himself responsible for this breach of the Academy's security. She said, "You can't personally check all the students."
"Nine people died. Next time it could be more." He looked down at her, seemed to really focus on her for the first time. "You could stay here and help us. With you, and your friend Sisay, we could find every Cabal cultist in the Spice Isles."
Jhoira felt her jaw go tense. "She's not Sisay, she's Shanna, and I have my own plans."
His expression wry, Jodah jerked his chin toward Liliana and Gideon. "To help these Planeswalkers. Are you sure that they aren't taking advantage of you?"
Jhoira's pulse thumped in her temple. She didn't like the way he could make her this angry, this quickly. She didn't like the way he didn't seem to have an inkling that he was making her angry. She said, "I'm known for so many things, but I didn't think any of them involved being naive."
As they stared each other down, Raff stepped up. "<NAME>, I have a spell that might help." He glanced across the room, where <NAME> was glaring daggers at him. "I'm not exactly supposed to have it, but I think it could be what we need. It involves drawing individual thoughts out of someone's brain. If I cast it while someone is asking him questions—"
Naban strode across the room. "That spell is forbidden for good reason. It's dangerous, something only master mages should even know exists."#linebreak
#figure(image("005_Return to Dominaria: Episode 5/12.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
Jodah's brows drew together. "Where did you learn it?"
Raff hesitated, looking from Jodah's consternation to Naban's anger. "Uh, I know as much as a master mage, I'm very advanced—"
"Raff," Jhoira said pointedly. Backed into a corner, Raff was falling back on old habits. "Do you like serving on the #emph[Weatherlight] ? Because I can just leave you here."
"Sorry, sorry," Raff said hurriedly. "I snuck a look at a book I wasn't supposed to have access to. Just the once." He looked worriedly at Naban. "Sorry."
Naban stormed off. Ignoring Jodah's attempt to interrupt, Jhoira said, "But you can actually make it work?"
"I can try," Raff said.
Jhoira eyed him. She could tell he was being honest now. "Then try."
"I can't stop you," Jodah said, coldly, and walked away.
Standing nearby, Liliana said with an eye-roll, "Oh, he disapproves." Then she added to Gideon, "I will not shut up. And stop elbowing me, it's like being bumped by a mammoth."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
It was late at night when they climbed the stairs to the top of the tower where the #emph[Weatherlight] was docked. Gideon found it a relief to see Tiana perched on a railing. "How did it go?" Tiana called.
"We got our agent," Shanna told her. "And the information we need."
"Good," Tiana replied. "Arvad's making dinner."
Liliana's mouth quirked. "The vampire's making dinner," she said to Gideon.
He snorted a laugh. It had been a long and trying day, but now at least they had what they needed to make a plan.
As Arvad prepared a meal for them, they sat down at the big table in the compartment below the bridge and went over the information Raff's spell had uncovered. As Gideon paged through Jhoira's notes, he saw it was going to take some time to figure it all out, as the spell had drawn out the answers to their questions in disconnected bits and pieces. He paused at an unfamiliar name. "The Blackblade?" he asked. "What's that?"
"It's a famous magical weapon," Jhoira explained. She was sitting across from him, nursing a cup of warmed wine. "It killed an elder dragon."
That was encouraging. "Which one?" Gideon asked.
"Piru, I think," Shanna said, taking a seat next to him.
"Never heard of him," he told her.
Shanna inclined her head. "Exactly."
Liliana tugged the page away from him to read over it. "So this Blackblade would kill Belzenlok."#linebreak
#figure(image("005_Return to Dominaria: Episode 5/13.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
"Easily," Jhoira said. "But it's a soul-drinker, created with death magic, and steals the life-energy of everyone it kills."
Liliana was clearly intrigued. "A soul-drinker would be just the thing. Perfect for killing a demon like Belzenlok." She added, "If it's already absorbed the life force of an elder dragon, it should be more than powerful enough to do the job."
Gideon wasn't surprised she wanted to use it; it sounded like just her sort of weapon. But he wanted nothing to do with it. He told her firmly, "A soul-drinker is not something we would want to use, under any circumstances." Liliana rolled her eyes at him and he ignored her.
"It's also locked up in the Stronghold," Shanna pointed out. "Before we decide if we want to use it or not, we need a way to get inside."
Still glaring at Gideon, Liliana sipped her wine. "If we could turn all the cultists and clerics to stone, it would be easy. I was thinking about turning people to stone earlier."
Raff grinned at her. "What, like by stopping time? If only we could."
Jhoira smiled, as if she had a secret she was ready to share. "We can't. But I know just the time mage who can."
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/github-pages/docs/data-flow-standalone.dark.typ | typst | Apache License 2.0 |
#import "graphs.typ": data-flow-graph
#set page(height: auto, width: auto, margin: 0.5em)
#set text(fill: white)
#show link: underline
#figure(
data-flow-graph(stroke: white, bg-color: rgb(13, 17, 23), light-theme: false),
caption: [Figure: Browser-side module needed: $dagger$: compiler; $dagger.double$: renderer. ],
numbering: none,
)
|
https://github.com/rdboyes/resume | https://raw.githubusercontent.com/rdboyes/resume/main/modules_zh/skills.typ | typst | // Import
#import "@preview/brilliant-cv:2.0.2": cvSection, cvSkill, hBar
#let metadata = toml("../metadata.toml")
#let cvSection = cvSection.with(metadata: metadata)
#cvSection("技能与兴趣")
#cvSkill(
type: [语言],
info: [英语 #hBar() 法语 #hBar() 中文],
)
#cvSkill(
type: [技术栈],
info: [Tableau #hBar() Python (Pandas/Numpy) #hBar() PostgreSQL],
)
#cvSkill(
type: [个人兴趣],
info: [游泳 #hBar() 烹饪 #hBar() 阅读],
)
|
|
https://github.com/Nerixyz/icu-typ | https://raw.githubusercontent.com/Nerixyz/icu-typ/main/docs/docs/fmt-zoned-datetime.md | markdown | MIT License | # `fmt-zoned-datetime` 🚧
<!-- prettier-ignore -->
!!!warning
This function is experimental and can change at any time.
```typst-code
let fmt-zoned-datetime(
dt,
zone,
locale: "en",
fallback: "localized-gmt",
date-length: "long",
time-length: "long"
)
```
Formats a date and a time in a timezone. Dates are assumed to be ISO dates.
## Arguments
### `dt`
The date and time to format. This can be a [`datetime`][datetime] or a dictionary with `year`, `month`, `day`, `hour`, `minute`, and `second`.
example{
```typst +preview
#let tz = (
offset: "-03",
iana: "America/Thule",
zone-variant: "dt",
)
- #fmt-zoned-datetime(datetime(
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
), tz)
- #fmt-zoned-datetime(( // (1)!
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
),
tz,
locale: "en-GB"
)
- #fmt-zoned-datetime((
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
),
tz,
locale: "en-GB",
time-length: "full"
)
```
1. Datetime passed as a dictionary
}example
### `zone`
The timezone. A dictionary with [`offset`](./fmt-timezone.md#offset), [`iana`](./fmt-timezone.md#iana), [`bcp47`](./fmt-timezone.md#bcp47), [`metazone-id`](./fmt-timezone.md#metazone-id), and [`zone-variant`](./fmt-timezone.md#zone-variant). The options correspond to the arguments for [`fmt-timezone`](./fmt-timezone.md). Only [`offset`](./fmt-timezone.md#offset) is mandatory - the other fields provide supplemental information for named time zones.
[`iana`](./fmt-timezone.md#iana) and [`bcp47`](./fmt-timezone.md#bcp47) are mutually exclusive. To get the zone name, [`iana`](./fmt-timezone.md#iana)/[`bcp47`](./fmt-timezone.md#bcp47) and [`zone-variant`](./fmt-timezone.md#zone-variant) must be specified in addition to [`offset`](./fmt-timezone.md#offset). Note that not every locale has names for the zones. If a zone doesn't have a name in some locale, [`fallback`](#fallback) is used.
example{
```typst +preview
#let dt = datetime(
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
)
- #fmt-zoned-datetime(dt, (
offset: "-07",
iana: "America/Phoenix",
zone-variant: "st",
))
- #fmt-zoned-datetime(dt, (
offset: "+02",
iana: "Atlantic/Jan_Mayen",
zone-variant: "dt",
), locale: "en-GB")
- #fmt-zoned-datetime(dt, (
offset: "+08",
iana: "Asia/Hong_Kong",
zone-variant: "st",
), locale: "en-HK")
- #fmt-zoned-datetime(dt, (
offset: "+09:30",
iana: "Australia/Adelaide",
zone-variant: "dt",
), locale: "en-AU")
- #fmt-zoned-datetime(dt, (
offset: "+01",
iana: "Europe/Belfast", // (1)!
), locale: "en-GB")
- #fmt-zoned-datetime(dt, (
offset: "Z",
))
```
1. No [`zone-variant`](./fmt-timezone.md#zone-variant) specified.
}example
### `locale`
The locale to use when formatting the zoned datetime. A [Unicode Locale Identifier]. As with [dates](./fmt-date.md#locale), `ca` can be set to a [bcp47 calendar name](https://github.com/unicode-org/cldr/blob/main/common/bcp47/calendar.xml).
example{
```typst +preview
#let dt = datetime(
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
)
#let tz = (
offset: "+03",
iana: "Asia/Nicosia",
zone-variant: "dt",
)
- #fmt-zoned-datetime(dt, tz)
- #fmt-zoned-datetime(
dt, tz,
locale: "en-GB"
)
- #fmt-zoned-datetime(
dt, tz,
locale: "el-CY"
)
- #fmt-zoned-datetime(
dt, tz,
locale: "en-GB-u-ca-persian"
)
- #fmt-zoned-datetime(
dt, tz,
locale: "en-GB-u-ca-islamic-hc-h12"
)
```
}example
### `fallback`
The timezone format fallback. Either `#!typst-code "localized-gmt"` or a dictionary for an [ISO 8601 fallback](./fmt-timezone.md#iso-8601). This has the same effect as [`fallback`](./fmt-timezone.md#fallback) does for [`fmt-timezone`](./fmt-timezone.md).
example{
```typst +preview
#let dt = datetime(
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
)
#let f(
offset,
iso: none,
minutes: true,
seconds: false,
locale: "en"
) = fmt-zoned-datetime(
dt,
(offset: offset), // timezone
fallback: if iso != none {(
iso8601: (
format: iso,
minutes: if minutes {
"required"
} else {
"optional"
},
seconds: if seconds {
"optional"
} else {
"never"
},
)
)} else {
"localized-gmt"
},
locale: locale,
)
- #f("-07")
- #f("-07", locale: "cs")
- #f("-07", locale: "da")
- #f("-07", iso: "basic")
- #f("-07", iso: "extended")
- #f("-07", iso: "utc-basic")
- #f("-07", iso: "utc-extended")
\
- #f("Z", iso: "basic")
- #f("Z", iso: "extended")
- #f("Z", iso: "utc-basic")
- #f("Z", iso: "utc-extended")
\
// 2h 15min 45s
#let sec = (2 * 60 * 60) + (15 * 60) + 45
- #f(sec, iso: "extended")
- #f(sec, iso: "extended", seconds: true)
- #f(sec, iso: "extended", minutes: false)
- #f(2 * 60 * 60, iso: "extended", minutes: false)
```
}example
### `date-length`
The length of the formatted date part (`#!typst-code "full"`, `#!typst-code "long"` (default), `#!typst-code "medium"`, `#!typst-code "short"`, or `#!typst-code none`).
example{
```typst +preview(vertical)
#let dt = datetime(
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
)
#let tz = (
offset: "+08",
iana: "Asia/Makassar",
zone-variant: "st",
)
#let f(
date-length,
locale: "en"
) = fmt-zoned-datetime(
dt, tz,
date-length: date-length,
locale: locale
)
*Full*
- #f("full", locale: "en-ID")
- #f("full", locale: "th")
- #f("full", locale: "id")
*Long*
- #f("long", locale: "en-ID")
- #f("long", locale: "ha")
- #f("long", locale: "lb")
*Medium*
- #f("medium", locale: "en-ID")
- #f("medium", locale: "ky")
- #f("medium", locale: "or")
*Short*
- #f("short", locale: "en-ID")
- #f("short", locale: "pa")
- #f("short", locale: "sr")
*None*
- #f(none, locale: "en-ID")
- #f(none, locale: "bg")
- #f(none, locale: "fr")
```
}example
### `time-length`
The length of the formatted time part (`#!typst-code "full"`, `#!typst-code "long"` (default), `#!typst-code "medium"`, `#!typst-code "short"`, or `#!typst-code none`).
example{
```typst +preview(vertical)
#let dt = datetime(
year: 2024, month: 8, day: 15,
hour: 13, minute: 24, second: 9
)
#let tz = (
offset: "+08",
iana: "Asia/Makassar",
zone-variant: "st",
)
#let f(
time-length,
locale: "en"
) = fmt-zoned-datetime(
dt, tz,
time-length: time-length,
locale: locale
)
*Full*
- #f("full", locale: "en-ID")
- #f("full", locale: "it")
- #f("full", locale: "lo")
*Long*
- #f("long", locale: "en-ID")
- #f("long", locale: "gu")
- #f("long", locale: "qu")
*Medium*
- #f("medium", locale: "en-ID")
- #f("medium", locale: "sk")
- #f("medium", locale: "tr")
*Short*
- #f("short", locale: "en-ID")
- #f("short", locale: "wo")
- #f("short", locale: "az")
*None*
- #f(none, locale: "en-ID")
- #f(none, locale: "eu")
- #f(none, locale: "lv")
```
}example
[datetime]: https://typst.app/docs/reference/foundations/datetime/
[Unicode Locale Identifier]: https://unicode.org/reports/tr35/tr35.html#Unicode_locale_identifier
|
https://github.com/kazuyanagimoto/quarto-clean-typst | https://raw.githubusercontent.com/kazuyanagimoto/quarto-clean-typst/main/README.md | markdown | MIT License | # Quarto-Clean-Typst Format
A minimalistic presentation theme for Quarto + Typst + [Touying](https://touying-typ.github.io).
Theme design is deeply inspired by <NAME>'s [Clean theme](https://github.com/grantmcdermott/quarto-revealjs-clean) for Quarto + Reveal.js.
Click the image below to see a long [demo](https://kazuyanagimoto.com/quarto-slides-typst/slides/quarto-clean-typst/clean.pdf).
Code is available [here](https://github.com/kazuyanagimoto/quarto-slides-typst/blob/main/slides/quarto-clean-typst/clean.qmd).
[](https://kazuyanagimoto.com/quarto-slides-typst/slides/quarto-clean-typst/clean.pdf)
## Install
If you would like to add the clean theme to an existing directory:
```bash
quarto install extension kazuyanagimoto/quarto-clean-typst
```
or you can use a Quarto template that bundles a .qmd starter file:
```bash
quarto use template kazuyanagimoto/quarto-clean-typst
```
|
https://github.com/dnx04/cv | https://raw.githubusercontent.com/dnx04/cv/main/cv.typ | typst | #import "template/lib.typ": *
#let metadata = toml("cv_dnx04.toml")
#show: cv.with(metadata)
#let cvSection = cvSection.with(metadata: metadata)
#let cvEntry = cvEntry.with(metadata: metadata)
#cvSection("Education")
#cvEntry(
title: [Bachelor in Computer Sciences, 3rd year],
society: [University of Engineering and Technology, VNU Hanoi (UET-VNU)],
date: [2022 -- 2026],
location: [Hanoi, Vietnam],
logo: image("images/uet.png"),
description: list(
[*Courses*: Data Structures & Algorithms, Database, Network Security, Operating System, Software Testing & Quality Assurance, Artificial Intelligence.],
[*GPA:* 3.56/4]
),
)
#cvEntry(
title: [Informatics],
society: [High School for the Gifted Students, University of Science, VNU Hanoi (HSGS-HUS)],
date: [2019 - 2022],
location: [Hanoi, Vietnam],
logo: image("images/hsgs.jpg"),
description: list(
[*GPA:* 9.6/10]
),
)
#cvSection("Merits")
#cvEntry(
title: [Champion],
society: [Viettel Programming Challenge 2024],
logo: image("images/viettel.png"),
date: [2024],
location: [Viettel Group],
description: none,
)
#cvEntry(
title: [1st place - Quarterfinal, Onsite finalist],
society: [Digital Dragon CTF 2024],
logo: image("images/ddc.png"),
date: [2024],
location: [VKU, Da Nang],
description: none,
)
#cvEntry(
title: [Silver Medal -- Master Division],
society: [Da Nang Code League 2024],
logo: image("images/fpt.jpg"),
date: [2024],
location: [FPT Complex, Da Nang],
description: none,
)
#cvEntry(
title: [Finalist -- Advanced Category],
society: [HackTheon Sejong 2024 International Student Cybersecurity Competition],
logo: image("images/sejong.jpg"),
date: [2024],
location: [Sejong City, Korea],
description: none,
)
#cvEntry(
title: [Second Prize (Northern), Participant (National)],
society: [The 2023 ICPC Vietnam National Programming Contest],
logo: image("images/icpc.png"),
date: [2023],
location: [Hanoi, Vietnam],
description: none,
)
#cvEntry(
title: [Top 7/211 (Hanoi), Finalist (Summit)],
society: [Code Tour 2023],
logo: image("images/vng.png"),
date: [2023],
location: [VNG, HCMC, Vietnam],
description: none,
)
#cvSection("Experiences")
#cvEntry(
title: [ Cybersecurity Researcher ],
society: [#link("https://jobs.viettel.vn/content/Viettel-Digital-Talent/?locale=vi_VN")[*Viettel Cyber Security*]],
date: [2024],
logo: image("images/viettel.png"),
location: [Hanoi, Vietnam],
description: list(
[ Currently researching on Red Team Reconnaissance phase. ]
),
)
#cvEntry(
title: [Student Ambassador -- Cybersecurity],
society: [#link("https://jobs.viettel.vn/content/Viettel-Digital-Talent/?locale=vi_VN")[*Viettel Digital Talent 2024*]],
date: [2024],
logo: image("images/viettel.png"),
location: [Viettel Group, Hanoi, Vietnam],
description: list(
[*Entrance exam result*: 23/30 -- 122.67 (IQ), 790/990 (TOEIC), 43/50 (Specialization), 570/570 (Programming)],
[*Phase 1 project:* _Techniques and Attack Chains in Linux System Pentesting_, produced a 37-page report on the progress to achieve root privileges on _Skyfall_ and _Corporate_ -- 2 active Insane Linux targets on HackTheBox.],
[*Achieved Top 1* and was _selected as an ambassador_ among 35 trainees in Phase 1. Currently onboarding at Viettel Cyber Security (VCS).]
),
)
#cvEntry(
title: [Admin, Developer],
society: [#link("https://uet.myctf.world/")[*UETCTF*]],
logo: image("images/uet.png"),
date: [2023 -- 2024],
location: [Information Security Laboratory, UET-VNU],
description: list(
[Maintainer of the CTF training platform of UET, based on the open-source project #link("https://github.com/GZTimeWalker/GZCTF")[GZ::CTF].],
[Maintaining dynamic challenge container generation and orchestration system using Docker Swarm, solved the problem with challenge integrity and readiness.],
[Being adopted as the main teaching material for several courses at UET (INT3507, INT3313E)]
),
)
#cvSection("Skills")
#cvSkill(
type: [Languages],
info: [English (IELTS 7.0) #hBar() Vietnamese],
)
#cvSkill(
type: [Tools],
info: [Docker #hBar() Burp Suite Professional #hBar() Wireshark #hBar() IDA Pro #hBar() Ghidra #hBar() GDB],
)
#cvSkill(
type: [Personal Interests],
info: [ Chess #hBar() Swimming #hBar() Traveling #hBar() Piano & Music ],
) |
|
https://github.com/lxl66566/my-college-files | https://raw.githubusercontent.com/lxl66566/my-college-files/main/信息科学与工程学院/算法导论/算法复杂度.typ | typst | The Unlicense | #import "../template.typ": *
#show: project.with(
title: "1",
authors: (
"absolutex",
)
)
= 1 算法复杂度作业
== 按照从增长量级低至高对下列函数进行排序
`f2<f1<f4<f3`
== 按照从增长量级低至高对下列函数进行排序
`f1<f4<f3<f2`
== 按照从增长量级低至高对下列函数进行排序
`f4<f1<f3<f2`
== 课本4.3-1:证明 $T(n) = T(n-1)+n$ 的解为 $O(n^2)$
即证明 $T(n) <= c n^2$。
假定 $m=n-1$,有 $T(n-1) <= c (n-1)^2$,即
$
T(n)&<=c(n-1)^2+n\
&=c n^2 -(2c-1) n+c\
&=c n^2
$
证毕。
== 课本4.3-2:证明 $T(n) = T(ceil(n/2))+1$ 的解为 $O(lg n)$
即证明 $T(n) <= c lg n$。
假定 $m=ceil(n/2)$,有 $T(ceil(n/2)) <= c lg ceil(n/2)$,即
$
T(n) &<= c lg ceil(n/2) + 1\
&= c lg ceil(n/2)\
&= c lg n
$
证毕。
== $T(n)=2T(n/3)+n lg n$ 是否可用主方法求解复杂度,如果可以请求解
$a=2,b=3,f(n)=n lg n,n^(log_b a)=O(n^0.63)$
当 n 足够大时,取 $c=2/3$,有 $a f(n/b) = 2n/3 lg n/3<=2/3n lg n=c f(n)$,由情况3,解为$T(n)=Theta(n lg n)$
== $T(n)=10T(n/3)+17n^1.2$ 是否可用主方法求解复杂度,如果可以请求解
$a=10,b=3,f(n)=17n^1.2=Theta(n^1.2),n^(log_b a)=O(n^2.09)$
应用第一种方法得 $T(n)=n^(log_3 10)=Theta(n^2.09)$
== $T(n)=sqrt(n)T(sqrt(n))+100n$ 是否可用主方法求解复杂度,如果可以请求解
T(n) 系数与参数不是常数,不能使用主方法。 |
https://github.com/duskmoon314/typst-fontawesome | https://raw.githubusercontent.com/duskmoon314/typst-fontawesome/main/README.md | markdown | MIT License | # typst-fontawesome
A Typst library for Font Awesome icons through the desktop fonts.
p.s. The library is based on the Font Awesome 6 desktop fonts (v6.6.0)
## Usage
### Install the fonts
You can download the fonts from the official website: https://fontawesome.com/download
After downloading the zip file, you can install the fonts depending on your OS.
#### Typst web app
You can simply upload the `otf` files to the web app and use them with this package.
#### Mac
You can double click the `otf` files to install them.
#### Windows
You can right-click the `otf` files and select `Install`.
#### Some notes
This library is tested with the otf files of the Font Awesome Free set. TrueType fonts may not work as expected. (Though I am not sure whether Font Awesome provides TrueType fonts, some issue is reported with TrueType fonts.)
### Import the library
#### Using the typst packages
You can install the library using the typst packages:
`#import "@preview/fontawesome:0.5.0": *`
#### Manually install
Copy all files start with `lib` to your project and import the library:
`#import "lib.typ": *`
There are three files:
- `lib.typ`: The main entrypoint of the library.
- `lib-impl.typ`: The implementation of `fa-icon`.
- `lib-gen.typ`: The generated icon map and functions.
I recommend renaming these files to avoid conflicts with other libraries.
### Use the icons
You can use the `fa-icon` function to create an icon with its name:
`#fa-icon("chess-queen")`
Or you can use the `fa-` prefix to create an icon with its name:
`#fa-chess-queen()` (This is equivalent to `#fa-icon().with("chess-queen")`)
You can also set `solid` to `true` to use the solid version of the icon:
`#fa-icon("chess-queen", solid: true)`
Some icons only have the solid version in the Free set, so you need to set `solid` to `true` to use them if you are using the Free set.
Otherwise, you may not get the expected glyph.
#### Full list of icons
You can find all icons on the [official website](https://fontawesome.com/search)
#### Different sets
By default, the library supports `Free`, `Brands`, `Pro`, `Duotone` and `Sharp` sets.
(See [Enable Pro sets](#enable-pro-sets) for enabling Pro sets.)
But only `Free` and `Brands` are tested by me.
That is, three font files are used to test:
- Font Awesome 6 Free (Also named as _Font Awesome 6 Free Regular_)
- Font Awesome 6 Free Solid
- Font Awesome 6 Brands
Due to some limitations of typst 0.12.0, the regular and solid versions are treated as different fonts.
In this library, `solid` is used to switch between the regular and solid versions.
To use other sets or specify one set, you can pass the `font` parameter to the inner `text` function: \
`fa-icon("github", font: "Font Awesome 6 Pro Solid")`
If you have Font Awesome Pro, please help me test the library with the Pro set.
Any feedback is appreciated.
##### Enable Pro sets
Typst 0.12.0 raise a warning when the font is not found.
To use the Pro set, `#fa-use-pro()` should be called before any `fa-*` functions.
```typst
#fa-use-pro() // Enable Pro sets
#fa-icon("chess-queen-piece") // Use icons from Pro sets
```
#### Customization
The `fa-icon` function passes args to `text`, so you can customize the icon by passing parameters to it:
`#fa-icon("chess-queen", fill: blue)`
#### Stacking icons
The `fa-stack` function can be used to create stacked icons:
`#fa-stack(fa-icon-args: (solid: true), "square", ("chess-queen", (fill: white, size: 5.5pt)))`
Declaration is `fa-stack(box-args: (:), grid-args: (:), fa-icon-args: (:), ..icons)`
- The order of the icons is from the bottom to the top.
- `fa-icon-args` is used to set the default args for all icons.
- You can also control the internal `box` and `grid` by passing the `box-args` and `grid-args` to the `fa-stack` function.
- Currently, four types of icons are supported. The first three types leverage the `fa-icon` function, and the last type is just a content you want to put in the stack.
- `str`, e.g., `"square"`
- `array`, e.g., `("chess-queen", (fill: white, size: 5.5pt))`
- `arguments`, e.g. `arguments("chess-queen", solid: true, fill: white)`
- `content`, e.g. `fa-chess-queen(solid: true, fill: white)`
#### Known Issues
- [typst#2578](https://github.com/typst/typst/issues/2578) [typst-fontawesome#2](https://github.com/duskmoon314/typst-fontawesome/issues/2)
This is a known issue that the ligatures may not work in headings, list items, grid items, and other elements. You can use the Unicode from the [official website](https://fontawesome.com) to avoid this issue when using Pro sets.
For most icons, Unicode is used implicitly. So I assume we usually don't need to worry about this.
Any help on this issue is appreciated.
## Example
See the [`example.typ`](https://typst.app/project/rQwGUWt5p33vrsb_uNPR9F) file for a complete example.
## Contribution
Feel free to open an issue or a pull request if you find any problems or have any suggestions.
### Python helper
The `helper.py` script is used to get metadata via the GraphQL API and generate typst code. I aim only to use standard python libraries, so running it on any platform with python installed should be easy.
### Repo structure
- `helper.py`: The helper script to get metadata and generate typst code.
- `lib.typ`: The main entrypoint of the library.
- `lib-impl.typ`: The implementation of `fa-icon`.
- `lib-gen.typ`: The generated functions of icons.
- `example.typ`: An example file to show how to use the library.
- `gallery.typ`: The generated gallery of icons. It is used in the example file.
## License
This library is licensed under the MIT license. Feel free to use it in your project.
|
https://github.com/darkMatter781x/OverUnderNotebook | https://raw.githubusercontent.com/darkMatter781x/OverUnderNotebook/main/entries/versioning/versioning.typ | typst | #import "/packages.typ": notebookinator, gentle-clues
#import notebookinator: *
#import themes.radial.components: *
#import gentle-clues: *
#import "/util.typ": qrlink
#show: create-body-entry.with(
title: "Decide: Version Control",
type: "decide",
date: datetime(year: 2024, month: 3, day: 5),
author: "<NAME>",
)
= Git
To maintain and organize code, our team uses a tool called Git. This tool keeps
a history of all changes made to the program, allowing the code to be reverted.
The image below is one of these Git commit histories. In Git, there are multiple
branches of code. There is a master version and smaller branches where testing
and prototyping can be done and merged into the master.
#figure(image("./history.png"), caption: [
Example git commit history
])
= Commit Styling
You'll notice that each commit has a weird commit message. This is a convention
that we use to keep our commits organized and visually grepable. We use a mix of
conventional commits and gitmoji to create this convention: ```
<type>: <gitmoji> <description>
```//typstfmt::off
= GitHub
//typstfmt::on
GitHub is a web-based platform that hosts Git repositories. It
allows for collaboration and sharing of code between team members. It also
enables us to easily open source our code so that other teams can use it as a
reference. You can see our git repository here:
#set align(center)
#qrlink("https://github.com/meiszwflz/OverUnder781X", width: 9em)
|
|
https://github.com/jiang131072/casual-szu-report | https://raw.githubusercontent.com/jiang131072/casual-szu-report/main/README.md | markdown | MIT License | # casual-szu-report
A Typst template for SZU course reports.
## Usage
Example is at `template/main.typ`. TLDR:
```typst
#import "lib.typ": template
#show: template.with(
course-title: [养鸡学习],
experiment-title: [养鸡],
faculty: [养鸡学院],
major: [智能养鸡],
instructor: [鸡老师],
reporter: [鸡],
student-id: [4144010590],
class: [养鸡99班],
experiment-date: datetime(year: 1983, month: 9, day: 27),
features: (
"Bibliography": "template/refs.bib",
),
)
// Start here
```
Features:
1. `Bibliography`: Bibliography file path.
2. `FontFamily`: Custom font family. Default: `("Noto Serif", "Noto Serif CJK SC")`
3. `CitationStyle`: Citation Style supported by Typst. Default: `gb-7714-2015-numeric`
- Only work if have `Bibliography` specified.
4. `CourseID`: Add a Course ID box on top-right of the cover. NOT YET IMPLEMENTED.
## Method
The template will traverse body content, and split it into groups according to Heading-1 layout. Each group content will be wrapped with `table.cell`. So all content will be wrapped in container, you can't use `pagebreak()` in your body content.
## Warning
This is not a serious work and may have some rough edges. And reports from different faculties isn't entirely uniform. Be careful when using it. |
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/document_symbols/headings-in-blocks.typ | typst | Apache License 2.0 | #let a = [
== Heading 1
#lorem(1)
#let b = [
// todo: there is a bug
== Heading 2
#lorem(1)
]
] |
https://github.com/YouXam/soviet-matrix | https://raw.githubusercontent.com/YouXam/soviet-matrix/main/README.md | markdown | MIT License | # soviet-matrix
This is a classic Tetris game implemented using Typst. The goal is to manipulate falling blocks to create and clear horizontal lines without letting the blocks stack up to the top of the playing field.

## How to Play
You can play the game in two ways:
1. **Online:**
- Visit [https://typst.app/app?template=soviet-matrix&version=0.1.0](https://typst.app/app?template=soviet-matrix&version=0.1.0).
- Enter any title of your choice and click **Create**.
2. **Locally:**
- Open your command line interface.
- Run the following command:
```bash
typst init @preview/soviet-matrix
```
- Typst will create a new directory.
- Open `main.typ` in the created directory.
- Use the [Typst Preview VS Code extension](https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview) for live preview and gameplay.
Enjoy the game!
## Controls
- Move Left: a
- Move Right: d
- Soft Drop: s
- Hard Drop: f
- Rotate Left: q
- Rotate Right: e
- 180-degree Rotate: w
## Changing the Game Seed
If you want to play different game scenarios, you can change the game seed using the following method:
```typst
#import "@preview/soviet-matrix:0.1.0": game
#show: game.with(seed: 123) // Change the game seed
```
Replace `123` with any number of your choice.
## Changing Key Bindings
Modify the `actions` parameter in the `game.with` method to change the key bindings. The default key bindings are as follows:
```typst
#show: game.with(seed: 0, actions: (
left: ("a", ),
right: ("d", ),
down: ("s", ),
left-rotate: ("q", ),
right-rotate: ("e", ),
half-turn: ("w", ),
fast-drop: ("f", ),
))
```
|
https://github.com/coljac/swinburne-phd-typst | https://raw.githubusercontent.com/coljac/swinburne-phd-typst/main/thesis.typ | typst | #import "template.typ": *
#show: thesis.with(title: "My Typst Thesis",
author: "<NAME>",
for_binding: false // Set this to true to have odd/even margins for printing
)[
// =======================================================
// Front matter: Abstract, acknowledgements, declaration
// =======================================================
= Abstract
#lorem(100)
= Acknowledgements
#lorem(200)
= Declaration
The work presented in this thesis has been carried out in the Centre for Astrophysics & Supercomputing at Swinburne University of Technology between 20?? and 20??. This thesis contains no material that has been accepted for the award of any other degree or diploma. To the best of my knowledge, this thesis contains no material previously published or written by another author, except where due reference is made in the text of the thesis. The content of the chapters listed below has appeared in refereed journals. Minor alterations have been made to the published papers in order to maintain argument continuity and consistency of spelling and style.
• Chapter 2 has been published as ...\
• Chapter 3 has been published as ...
My contribution to these papers was ..., accounting for X percent of the final manuscripts.
My co-authors contributed by ..., accounting for Y percent of the final manuscripts.
#align(right)[
Your Name
Melbourne, Victoria, Australia
year
]
] // End front matter
// =============================
// The rest of the thesis below
// =============================
= Introduction
== Galaxies
// #set cite(brackets: true)
// #set cite(brackets: false)
In @ferreiraPanicDisksFirst2022 found galaxies interesting. These astronomers, #cite(<whitneyGalaxyEvolutionAll2021>) also found this. Also, there are big and small galaxies with many balls of shiny gas #citep(pre: "stars", post: "see books on stars", <whitneyGalaxyEvolutionAll2021>, <hoekstraMassesGalaxyClusters2013>).
#lorem(22)
#lorem(400)
#figure(caption: [
This is a picture of some galaxies. They have many stars. *Top:* Some galaxies. *Bottom:* More galaxies.
// #lorem(20) \
],
placement: auto,
image("figures/sdss.png", width: 100%)
)
== Clusters
#lorem(244)
$ alpha = 2 beta^2 $
== Radio astronomy
#lorem(222)
= Methodology
== The data
#lorem(300)
#figure(caption: [
This is a plot of some data. *Left:* Data, in blue. *Right:* Data, in green.
],
placement: none,
image("figures/gini2.svg", width: 100%)
)
== The pipeline
#lorem(100)
#figure(caption: "The types of data we used.",
placement: none,
table(
columns: (auto, auto, auto),
inset: 10pt,
align: horizon,
[*Description*], [*Area*], [*Parameters*],
[Cylinder],
$ pi h (D^2 - d^2) / 4 $,
[
$h$: height \
$D$: outer radius \
$d$: inner radius
],
[Tetraheron],
$ sqrt(2) / 12 a^3 $,
[$a$: edge length]
)
)<atable>
See the table of date in @atable. #lorem(100)
#lorem(100)
$ sum_(k=0)^n k
&= 1 + ... + n \
&= (n(n+1)) / 2 $<eqsum>
In @eqsum, we show the math.
= Foo
#lorem(33)
== Another subheading
// #counter(heading.where(level: 1)).display()
$ alpha^2 = 4 $
// #state("stt").update("XX")
// #aa.update("XX")
#locate(loc => [
#loc.page()
// #if loc.page() == 17 [
// #aa.update(loc.page())
// AA!
// ]
])
$ G_f = sum_(i=1)^100 beta log_10 i $
$ vec(11, 22, 34, 99, delim: "(") $
= Doing stuff
#lorem(1000)
= Getting data
#lorem(1000)
= Conclusion
== Before I did things
#lorem(400)
== After I did things
#lorem(400)
|
|
https://github.com/PA055/5839B-Notebook | https://raw.githubusercontent.com/PA055/5839B-Notebook/main/Notebooks/Programming.typ | typst | #import "../notebookinator/lib.typ": *
#import themes.radial: radial-theme, components, colors
#import colors: *
#show: notebook.with(theme: radial-theme, title: "5839B's Programming Notebook", team-name: "5839B", season: "Water Game", year: "2024-2025")
#create-frontmatter-entry(
title: "Table of Contents",
)[
#components.toc()
]
#create-body-entry(
title: "First Steps",
type: "identify",
date: datetime(year: 2024, month: 3, day: 5),
author: "<NAME>",
witness: "<NAME>",
)[
= Post Season Notes
With the end of the Over Under season, sadly we didn't make it to worlds, we evaluated our progress and decided that we need a better programming library. My job as the coder is to record and create a programming library that serves all our needs for the improved robot.
In the Over Under season we didn't get all of the systems we wanted running working in time for the competition, for the autonomous we used PROS with both the OkapiLib library and the LemLib library, however each of those had its own shortcomings, so we decided to create our own library.
But first, we had to decide which library to build off of, the following decision matrix shows our considerations and our decision
#components.decision-matrix(
properties: (
(name: "Time to Develop", weight: 2),
(name: "Extendable", weight: 2),
(name: "Working Subsystems", weight: 1.5),
(name: "Experience With Library", weight: 1),
(name: "Future Proof", weight: 0.75),
(name: "Code Readability", weight: 0.5),
),
("PROS", 1, 5, 1, 4, 4, 1),
("OkapiLib", 4, 4, 3, 4, 4, 3),
("LemLib", 2, 3, 4, 2, 1, 1),
)
#components.admonition(type: "note")[
OkapiLib had the following Subsystems:
- Odometry (Centered Forward Pods)
- Solid Base Classes
- X-Drive Model
- PID
LemLib has the following Subsystems:
- Odometry (flexible placement)
- Pure Pursuit
- No other drivetrain functions worked
- PID not working
- Asset (_useful_ utility)
]
#components.admonition(type: "decision")[
We decided to build the library of of OkapiLib in the end, as it has more flexibility, and a solid codebase, while taking inspiration from LemLib
]
= Necessary Components
We have limited time to develop the library, as our schoolwork and jobs eat into the development time, so we have made a ongoing list, shown below, that shows all the features we need in the library along with a short explanation of the feature, a longer explanation will be given in a dedicated section of the notebook
- *Mecanum Drivetrain Model* - Although OkapiLib has an X-drive model, it doesn't have a Mechanum drive model, which has slightly different kinematics
- *Boosted Mecanum Wheel Model* - Since out robot not only has a 4 motor mechanum drivetrain, the drivetrain also includes 2 separately powered omni-wheels to help boost forward torque
- *Custom Odometry* - Although OkapiLib already has odometry, our design places all of the odometry pods in a straight line with the 2 forward facing wheels not being centered, OkapiLib doesn't support this so we need to create a custom odometry class for this, however this should be fairly straightforward
- *PID and other Control Loops* - this will allow us to have fast and accurate movements
- *Filtering Algorithms* - this will allow us to read more accurate readings by using previous values to validate and estimate a more accurate sensor reading
- *Pure Pursuit* - Pure Pursuit is an algorithm that allows the robot to follow paths smoothly, even with disturbances, which is necessary for a fast and accurate autonomous period
- *Asset* - this is a helpful utility from LemLib that would be very helpful in creating Pure Pursuit paths, as it allows the coder to not have to remove and reinsert the SD card every time a path is updated
- *GUI* - this is necessary as it allows us to live tune variables, for example, we can create a PID tuner so we don't have to recompile after changing a single variable, this will speed up tuning by a significant amount as half the time it takes to to tune PID is spent waiting for code to compile. This will also help out robot look cleaner as a build
#components.admonition(type: "goal")[
Our goal is to finish most ( > 95% ) of the library before _*September 10, 2024*_
This will allow us to have a reasonable amount of time to actually create the autonomous and any other functions that come up while doing so
]
#components.gantt-chart(
start: datetime(year: 2024, month: 3, day: 5),
end: datetime(year: 2024, month: 9, day: 10),
date-interval: 30,
date-format: "[month]/[day]",
tasks: (
("Plan", (1/30, 2/30)),
("Odometry", (2/30, 6/30)),
("Kalman Filtering", (6/30, 10/30)),
("Mecanum Drive", (10/30, 14/30)),
("PID", (14/30, 18/30)),
("Design GUI", (18/30, 20/30)),
("GUI", (20/30, 32/30)),
("Pure Pursuit", (32/30, 42/30)),
("Test/Fix Odometry", (42/30, 56/30)),
("Test/Fix Filtering", (56/30, 70/30)),
("Test/Fix Mecanum", (70/30, 75/30)),
("Test/Fix PID", (75/30, 84/30)),
("Test/Fix Pure Pursuit", (84/30, 98/30)),
("Integrate GUI", (98/30, 112/30)),
("Setup Field", (102/30, 105/30)),
("Fix Any Problems", (112/30, 206/30)),
("Create Match Route", (112/30, 120/30)),
("Test Match Route", (120/30, 140/30)),
("Create Skills Route", (140/30, 148/30)),
("Test Skills Route", (148/30, 168/30)),
("Create Drive Code", (168/30, 175/30)),
("Practice", (175/30, 206/30)),
("Move Field to School", (206/30, 210/30))
),
goals: (
("New Game Reveal", 83/30),
("Summer Vacation Starts", 102/30),
("Summer Vacation Ends", 205/30),
)
)
]
#create-body-entry(
title: "Library Structure",
type: "identify",
date: datetime(year: 2024, month: 3, day: 8),
author: "<NAME>",
witness: "<NAME>"
)[
Using proper C++ coding styles is a must in a project of this size, so we need a consistent and readable file structure which the following diagram will show
```
include/
├─ lib5839/
│ ├─ robot/
│ │ ├─ flywheel.hpp
│ │ ├─ catapult.hpp
│ │ ├─ lift.hpp
│ │ ├─ wings.hpp
│ │ ├─ PTO.hpp
│ ├─ chassis/
│ │ ├─ controller/
│ │ │ ├─ purePursuitController.hpp
│ │ │ ├─ purePursuitControllerPID.hpp
│ │ ├─ model/
│ │ │ ├─ mecanumDriveModel.hpp
│ │ │ ├─ boostedMecanumDriveModel.hpp
│ │ │ ├─ threeEncoderMecanumDriveModel.hpp
│ │ │ ├─ threeEncoderBoostedMecanumDriveModel.hpp
│ ├─ odometry/
│ │ ├─ trackingPod.hpp
│ │ ├─ threeWheelOdometry.hpp
│ ├─ GUI/
│ │ ├─ odomDebugGUI.hpp
│ │ ├─ PIDTunerGUI.hpp
│ ├─ utils/
│ │ ├─ filtering.hpp
│ │ ├─ odomMath.hpp
│ │ ├─ asset.hpp
│ ├─ api.hpp
├─ liblvgl/
│ ├─ ...
├─ okapi/
│ ├─ ...
├─ pros/
│ ├─ ...
├─ api.h
├─ main.hx
├─ globals.hpp
├─ gui.hpp
src/
├─ lib5839/
│ ├─ robot/
│ │ ├─ flywheel.cpp
│ │ ├─ catapult.cpp
│ │ ├─ lift.cpp
│ │ ├─ wings.cpp
│ │ ├─ PTO.cpp
│ ├─ chassis/
│ │ ├─ controller/
│ │ │ ├─ purePursuitController.cpp
│ │ │ ├─ purePursuitControllerPID.cpp
│ │ ├─ model/
│ │ │ ├─ mecanumDriveModel.cpp
│ │ │ ├─ boostedMecanumDriveModel.cpp
│ ├─ odometry/
│ │ ├─ trackingPod.cpp
│ │ ├─ threeWheelOdometry.cpp
│ ├─ GUI/
│ │ ├─ odomDebugGUI.cpp
│ │ ├─ PIDTunerGUI.cpp
│ ├─ utils/
│ │ ├─ odomMath.cpp
├─ main.cpp
├─ globals.cpp
├─ gui.cpp
static/
├─ path.txt
```
]
#create-body-entry(
title: "Asset and TrackingPod Classes",
type: "program",
date: datetime(year: 2024, month: 3, day: 8),
author: "<NAME>",
witness: "<NAME>"
)[
= Asset Class
The asset class is a useful utility that originated from the LemLib library. It is a compile time function and accesability class that compiles any files in the static folder and sends them to the brain while still allowing c++ functions to have access to the contents of the file, this allows us to not have to take out the SD card that would have stored the static files, find and use a SD card reader to upload files to the SD card, and then insert the SD back into the brain every time we change or add a static file. Static files being files that aren't evaluated during runtime, they are read by the program to get large blocks of information.
This is especially helpful when creating the GUI and Pure Pursuit Subsystems as both of those require static files. The Pure Pursuit requires a text file containing the path, which will be explained more in a future entry, and the GUI requiring images to display.
#components.admonition(type: "implementation")[
Stores:
- the whole file as a string
- the length of the file
Can Return:
- the file converted to many file types
- the file split by a delimitator
]
= TrackingPod Class
The TrackingPod class is part of the Odometry system, it stores information on where it is located relative to the tracking center of the robot, and have helpful functions that convert encoder ticks to distance traveled.
#components.admonition(type: "note")[
This class is not compatible with the chassisScales class used in the OkapiLib's odometry base class, so there will be some challanges with this.
]
#components.admonition(type: "implementation")[
Stores:
- diameter of tracking wheel
- distance to tracking center
- reference to encoder (to get the absolute position of the sensor)
- gear ratio (default: 1)
Can Return:
- distance traveled since last reset
]
]
#create-body-entry(
title: "Odometry Class",
type: "program",
date: datetime(year: 2024, month: 3, day: 9),
author: "<NAME>",
witness: "<NAME>"
)[
= Explanation
Odometry, also known as Dead Reckoning, is a way for a robot to know it's global position, by using, at minimum, 2 encoders parallel to each other, a third encoder perpendicular to the other two can allow the robot to also track horizonal movement.
Knowing the global position of the robot is useful as it allows the robot to self correct if it is disturbed by a game element or other robot. It also allows the robot to be able to use the pure pursuit algorithm, which will be explained in a later entry
This is done by taking the amount each encoder changed by each frame and using some math to convert that into how much the robot has moved and turned in the x and y direction.
#figure(
rect(fill: black.lighten(10%))[
#image("img\OdomDiagram.png", width: 80%)
],
caption: [
@odomDiagram: A simple case of the robot turning while moving forward
]
) <odomDiagram>
@odomDiagram shows how when the robot moves, the wheels make 2 arcs that can then be used to calculate the radius of the turn and the distance traveled in each direction with the equations below. See Appendix A for a derivation of the equations
#components.admonition(type: "equation")[
$Delta L$: the distance the left encoder wheel moved since the last tick (inches)
$Delta R$: the distance the right encoder wheel moved since the last tick (inches)
$Delta S$: the distance the back encoder wheel moved since the last tick (inches)
$s_L$: the distance from the tracking center to the left encoder wheel (inches)
$s_R$: the distance from the tracking center to the right encoder wheel (inches)
$s_S$: the distance from the tracking center to the back encoder wheel (inches)
$Delta theta$: the change in heading (radians)
$Delta attach(limits(d), t: ->, br: l)$: the translation vector in the local coordinate system (inches)
$ Delta theta = (Delta L - Delta R) / (s_L - s_R) $
$ Delta attach(limits(d), t: ->, br: l) = 2 sin(theta/2) * vec((Delta S)/(Delta theta) + s_S, (Delta R)/(Delta theta) + s_R) $
]
We can use those equations to create an algorithm that runs every 10 miliseconds, shown below
```cpp
void lib5839::threeWheelOdometry::step() {
// get the distances each encoder moved the last tick
QLength deltaV1 = sensors.vertical1->getDistanceTraveled() - prevV1;
QLength deltaV2 = sensors.vertical2->getDistanceTraveled() - prevV2;
QLength deltaH1 = sensors.horizontal1->getDistanceTraveled() - prevH1;
prevV1 = sensors.vertical1->getDistanceTraveled();
prevV2 = sensors.vertical2->getDistanceTraveled();
prevH1 = sensors.horizontal1->getDistanceTraveled();
// get change in heading
deltaTheta = (deltaV1 - deltaV2) / (sensors.vertical1.getOffset() - sensors.vertical2.getOffset());
avgHeading = currentPose.theta + deltaTheta / 2.0;
// prevent divide by zero when finding local translation
if (deltaTheta == 0) {
localX = deltaH1;
localY = deltaV1;
} else {
localX = 2 * sin(deltaTheta / 2) * (deltaH1 / deltaTheta + sensors.horizontal1.getOffset());
localY = 2 * sin(deltaTheta / 2) * (deltaV1 / deltaTheta + sensors.vertical1.getOffset());
}
// convert local translation to global position
currentPose.x += localY * sin(avgHeading);
currentPose.y += localY * cos(avgHeading);
currentPose.x += localX * -cos(avgHeading);
currentPose.y += localX * sin(avgHeading);
currentPose.theta += deltaTheta;
}
```
the odometry class also inherits from OkapiLib's base odometry class so it needs some other functions:
- getState() - gets the current pose of the robot as calculated by the odometry
- setState(Pose pose) - sets the current pose of the robot
- getModel() - gets the chassis model the odometry is using
- getScales() - get information about the position of the sensors, however since the positioning on our robot is incompatible with this function it will return an empty class
This odometry class will be updated to also include the imu on the robot after we work on kalman filtering, which will help improve the accuracy of the odometry
#components.admonition(type: "tldr")[
Odometry is a way for a robot to know its global position on the field by using 2-3 free spinning wheels, and using arcs to approximate the path the robot takes.
The global position can be used to allow the robot to self correct even though major disturbances to the path.
]
]
#create-body-entry(
title: "Mecanum Drivetrain Model",
type: "program",
date: datetime(year: 2024, month: 3, day: 12),
author: "<NAME>",
witness: "<NAME>"
)[
A Mecanum drivetrain is a type of holonomic drivetrain, which means it can move in all directions without having to face in the direction it needs to move, basically, it can move sideways.
This is useful in both driver control and autonomous, in driver control, this would help the driver maneuver around the field, avoiding conflicts with other teams, and better allowing the scoring of points around the field. And in autonomous this can allow the robot to not have to waste time turning before and after moving.
Using a tank drivetrain, to move to a point, the robot needs to first face that point, by turning to $arctan((Delta y) / (Delta x))$ radians where $Delta y$ is the difference between the robot's y position and the y position of the goal point, and similarly for $Delta x$ we can then use the distance formula $sqrt((Delta x)^2 + (Delta y)^2)$ to move forward until we reach the goal point, then finally we have to turn to the desired angle. This takes 3 steps, but using a holonomic drivetrain we can just do that in one step
To go from the robot's current position to a desired goal point, we first need to find the velocity and travel distance of each wheel separately, we found 2 different methods of calculating velocity, one just added up the turn, forward and strafe velocities with differing signs for each wheel, while the other algorithm uses the sine and cosine functions to compute the wheel velocity for the forward and strafe directions but then it adds the turn velocity separately. Both algorithms then need to normalize the values after adding the velocities together. However the first algorithm we mentioned is easier and gives a very similar result to the second algorithm, so we decided to use that algorithm.
To find the wheel velocities $V_(F L)$, $V_(F R)$, $V_(B L)$, $V_(B R)$ we add the turn ($V_T$), forward ($V_F$) and strafe ($V_S$) velocities in the following ways
#components.admonition(type: "equation")[
$ V_(F L) = V_F + V_S + V_T $
$ V_(F R) = V_F - V_S - V_T $
$ V_(B L) = V_F + V_S - V_T $
$ V_(B R) = V_F - V_S + V_T $
we then have to normalize the values:
if $max(V_(F L), V_(F R), V_(B L), V_(B R)) > V_"max"$ we need to multiply all wheel velocities by $V_"max" / V_"biggest"$ where $V_"biggest" = max(V_(F L), V_(F R), V_(B L), V_(B R))$
]
We first implemented this in python VexCode so we can test if the equations work, the results can be seen at #link("https://youtu.be/eSuvUhxxs34")
After the successful results of the VexCode prototype, we then started working on the implementation in the library, the OkapiLib code style guide mandates that we build off of the ChassisModel base class, we did this and used many of the same functions as the X-drive class as the drivetrains are almost the same, just some small differences in the kinematic equations.
<<<<<<< HEAD
The next step was to work on finding the travel distance for each wheel, this was not implemented in the X-drive class from OkapiLib so we decided to delay the development until after the Kalman Filtering.
=======
The next step was to work on finding the travel distance for each wheel, this could be done by normalizing the vector for linear movement and and then multiplying by the distance to travel, finally the turn angle needs to be added on top of that using the same equations as a tank drivetrain, and finally we need to cap the values and scale them so give the desired velocities.
>>>>>>> 3f3e45b890fb4a87ddf1c51e66f0eeb3ba664b0e
]
#create-body-entry(
title: "Pure Pursuit",
type: "program",
date: datetime(year: 2024, month: 3, day: 14),
author: "<NAME>",
witness: "<NAME>"
)[
Pure Pursuit is, in our opinion, the most useful algorithm that is used in the vex autonomous period. Pure Pursuit is, in essence, a algorithm to make the robot smoothly follow a predetermined path.
To learn the algorithm, i used Purdue Sigbots's #link("https://wiki.purduesigbots.com/software/control-algorithms/basic-pure-pursuit")[Resource] as a base and added on the features I wanted. Their website used a donkey chasing a carrot, which always stays in front of the donkey, as a helpful metaphor on how the algorithm actually worked
#figure(
rect(fill: black.lighten(10%))[
#image("img\purePursuitMetaphor.gif", width: 80%)
],
caption: [An image showing the metaphor used by the Purdue Sigbots Website on the Pure Pursuit Algorithm]
)
So speaking more technically, the algorithm is given a set of points on a path, these points are linearly interpolated between so the point density has to be high for the path to be accurate, the algorithm is also given the robot's position and a lookahead distance, the distance the robot should look ahead to find the point it's heading towards.
We first need to find the point the robot is heading towards, we'll call this the goal point. The goal point needs to meet certain criteria,
- it needs to be on the path
- it cannot be further away from the robot than the lookahead distance
- it needs to be ahead of the nearest point to the robot on the path
- it needs to be the furthest point on the path that satisfies the conditions above
The criteria above do simplify the algorithm, however it creates some limitations:
- the path cannot cross over itself, as the algorithm would skip part of the path
- the lookahead distance needs to be tuned properly, high lookahead distance leads to path smoothness, but low leads to accuracy
To find the goal point we draw a line between each point on the path, we then draw a circle, centered on the robot with a radius equal to the lookahead distance, and list any intersections, we then find the furthest point on the path and check if it is ahead of the robot, if the robot is ahead of the furthest point, we know the path is ending so we set the lookahead point to the final point in the path, otherwise it is the furthest point on the path. We can use the following code to find the goal point.
.
```cpp
struct Point {
float x;
float y;
};
path = [/* The path can be read from a file and formatted as an array of Points */]
int get_closest_point(Point points[], Point to) {
float smallestDist = 999999999999999999999999999999;
int smallestIndex = -1;
for (int i = 0; i < points.length; i++) {
if (dst_btw_pts(points[i], to) < smallest) {
smallestIndex = i;
smallestDist = dst_btw_pts(points[i], to)
}
}
return smallestIndex;
}
int get_discriminant(Point pt1, Point pt2, Point robotPos, float lookaheadDistance) {
float x1 = pt1.x - robotPos.x;
float y1 = pt1.y - robotPos.y;
float x2 = pt2.x - robotPos.x;
float y2 = pt2.y - robotPos.y;
float dx = x2 - x1;
float dy = y2 - y1;
dr = std::sqrt(std::pow(dx, 2) + std::pow(dy, 2));
D = x1 * y2 - x2 * y1;
discriminant = std::pow(lookaheadDistance, 2) * std::pow(dr, 2) - std::pow(D, 2);
return discriminant;
}
Point find_goal_point(Point[] path, Point robotPos, float lookaheadDistance, int lastFoundPoint) {
goalPt = Point(0, 0);
std::vector<int> points = new std::vector<int>();
for (int i = 0; i < path.length; i++) {
discriminant = get_discriminant(path[i], path[i+1], robotPos, lookaheadDistance);
if (discriminant >= 0) // we have an intersection
points.add(i);
}
if (points.count() <= 0) // no intersected point, we have wandered from the path
goalPt = path[lastFoundPoint];
else if (get_closest_point(path, robotPos) > std::max(points)) // robot is farther than all intersected points, use last point in path
goalPt = path[path.length];
else
goalPt = path[std::max(points)];
return goalPt
}
```
we can then use PID loops to go towards the goal point and update it as we do so, finishing the pure pursit algorithm
]
#create-body-entry(
title: "GUI",
type: "program",
date: datetime(year: 2024, month: 3, day: 14),
author: "<NAME>",
witness: "<NAME>"
)[
== 3/14 progress
Currently we have 3 screens for the GUI:
- Autonomous Selector
- PID Tuner
- Odometry Debug Screen
And using Squareline Studio, i have designed a screen for all of them, however this is likely to change as the designs aren't as aesthetically pleasing as i would like them to be.
_*Insert Images Here*_
== 3/18 progress
I have finished one of the three screens and got a working and interactive display on the brain, I started with the Auton Selector as I believed that that was the most important, as it will be used in every match, while the other 2 are just convinient for tuning
Some errors i encountered were:
- Memory Exceptions - this occurred when i tried to edit the properties of an lvgl object that was still uninitialized
- Memory Overflow - this occurred when i attempted to load too many objects on the screen at a single time, which occurred because of a bug that prevented the objects from getting deleted when the competition mode was switched
- Logic Errors - This was the worst type of error to debug, as i didn't know lvgl that well and so i had to create a blank screen to isolate the problem and try and fix it, often the error was when things aren't showing up, they are probably being hidden under another object
- Problems with Static/Class functions - this was when i was working with callbacks, i had to create a static callback functions which meant that variables that belonged to the class couldn't be accessed, which caused me to consider scrapping the GUI
#figure(
rect(fill: black.lighten(10%))[
#image("img\AutonSelector1.png", width: 80%)
],
caption: [The Autonomous Selector Screen]
)
== 3/26 progress
This time i worked on the Odom Debug Screen, which i felt was the easier of the 2, I managed to finish this class completely with the visuals and functionality cleanly incorporated into the class
I did run into some of the same problems as the Autonomous Selector, however they were much rarer and easier to resolve, so i at least learned something
The class included a function to display the debug screen and map along with a function to update the odometry values
#figure(
rect(fill: black.lighten(10%))[
#image("img\OdomDebug2.png", width: 80%)
],
caption: [The Odometry Debug Screen]
)
== 4/2 progress
The final screen so far was the PID tuner, this needed to have a complex class and i was unsure how i could accomplish this using object oriented programming when lvgl is effectively fighting me on this.
Some of the problems i faced were how to switch between different PID loops, as i couldn't just store them in a list as the function couldn't access the list which is stored in the class. Another problem was how to update the values, not just in the program, but in the actual PID class, again the main problem was accessing the class to get the different PID loops. Another problem was retrieving the PID error information, which again was a problem related to accessing the class.
I couldn't find any solution to this that both worked and was memory safe, I couldn't just put a pointer to the class in an arbitrary location and access it within the function, as that can cause more errors than it would solve. So i put off the functionality and just created the visuals with a temporary list of PID loops.
#figure(
rect(fill: black.lighten(10%))[
#image("img\PIDTuner1.png", width: 80%)
],
caption: [The PID Tuner Screen]
)
]
#create-body-entry(
title: "Behind Schedule",
type: "management",
date: datetime(year: 2024, month: 5, day: 3),
author: "<NAME>",
witness: "<NAME>"
)[
Development on the robot has been mostly paused for the past month because the programmers were predisposed with family matters and schoolwork, It is likely to be paused for another 2 weeks as AP testing is upcoming. This is a huge setback to the library as most of the features are untested or nonexistent.
The proposed solution is to scrap unnecessary features and use a preexisting library like LemLib or EZ Template, to make up for the lack of features.
We have decided to keep the following features:
- Autonomous Selector
- PID Tuner
- Odometry Debug Screen
- Any other GUI we deem necessary
- Interface Classes (this is to make EZ and Lemlib work well together)
- Path Injector
- SD card Logger
A combination of those features combined with EZ Template, Lemlib and OkapiLib, will lead to a efficient autonomous.
However changing to this new combination requires a different pros kernel (3.8.3) which is incompatible with the existing GUI and other code, So converting and improving the existing GUI classes are the first priority before getting the libraries to cooperate, as that also needs a functional robot
]
#create-appendix-entry(title: "Appendix A: Odometry Derivation")[
#rect(fill: black.lighten(10%))[
#image("img\OdomDiagram.png", width: 80%)
]
We first start with the arc length formula and solve for $r_A$:
#grid(
columns: (1fr, 1fr),
$ Delta L = r_L Delta theta $,
$ Delta R = r_R Delta theta $,
$ Delta L = (r_A + s_L) Delta theta $,
$ Delta R = (r_A + s_R) Delta theta $,
$ (Delta L) / (Delta theta) = r_A + s_L $,
$ (Delta R) / (Delta theta) = r_A + s_R $,
$ r_A = (Delta L)/(Delta theta) - s_L $,
$ r_A = (Delta R)/(Delta theta) - s_R $,
)
The two equations can then be combined to eliminate the radius (the only unknown) and solved for $Delta theta$:
$ (Delta L)/(Delta theta) - s_L = (Delta R)/(Delta theta) - s_R $
$ Delta L - s_L Delta theta = Delta R - s_R Delta theta $
$ Delta L - Delta R = Delta theta (s_L - s_R) $
$ Delta theta = (Delta L - Delta R)/(s_L - s_R) $
To find the local translation, we first need to set the local coordinate system, the easiest one being one where the y axis coincides with the endpoints of the arc. This will allow us to calculate the y translation using the equation for chord length:
$ 2 sin ((Delta theta) / 2) * ((Delta R)/(Delta theta) + s_R) $
And now we can use the back wheel to find out how much the robot strays from the arc, by approximating another arc, and this arc's chord is perpendicular to the chord of the main arc so we can use the same formula for chord length and just add it to the y translation to make a translation vector:
$ 2 sin ((Delta theta) / 2) * vec(((Delta S)/(Delta theta) + s_S), ((Delta R)/(Delta theta) + s_R)) $
And to rotate the local translation vector back to the global coordinate system we rotate it back by $theta_0 + (Delta theta) / 2$ which is the angle of the main chord, using the following equation:
$ vec(Y_l sin(theta_0 + (Delta theta) / 2) - X_l cos(theta_0 + (Delta theta) / 2), Y_l cos(theta_0 + (Delta theta) / 2) + X_l sin(theta_0 + (Delta theta) / 2)) $
]
#glossary.add-term("delimitator")[A character or set of characters that separate parts of a string]
#glossary.add-term("pose")[A structure containing the x, y, and heading of the robot]
#glossary.add-term("GUI")[Graphical User Interface - A way to display information on the robot brain in a clean and presentable manner]
#glossary.add-term("PID")[Proportional, Integral, Derivative - A type of control loop that takes in error and returns new motor value]
#glossary.add-term("PTO")[Power Take Off - A mechanism where a single motor can switch between powering 2 different mechanism using pneumatics]
#create-appendix-entry(title: "Glossary")[
#components.glossary()
]
#create-appendix-entry(title: "Credits")[
- <NAME>
- The creators and contributors to PROS
- The creators and contributors to OkapiLib
- The creators and contributors to LemLib
- Theo from Team 7842F/B
- Felix from 53E
-
] |
|
https://github.com/ClazyChen/Table-Tennis-Rankings | https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2008/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], [3188],
[2], [WANG Hao], [CHN], [3138],
[3], [WANG Liqin], [CHN], [2997],
[4], [MA Long], [CHN], [2947],
[5], [CHEN Qi], [CHN], [2855],
[6], [<NAME>], [BLR], [2790],
[7], [JOO Saehyuk], [KOR], [2777],
[8], [<NAME>], [GER], [2761],
[9], [<NAME>], [KOR], [2755],
[10], [HAO Shuai], [CHN], [2693],
[11], [ZHANG Jike], [CHN], [2683],
[12], [<NAME>], [ROU], [2673],
[13], [KO Lai Chak], [HKG], [2669],
[14], [KAN Yo], [JPN], [2628],
[15], [YOON Jaeyoung], [KOR], [2617],
[16], [HOU Yingchao], [CHN], [2610],
[17], [LI Ching], [HKG], [2605],
[18], [<NAME>], [DEN], [2601],
[19], [SCHLAGER Werner], [AUT], [2582],
[20], [<NAME>], [SWE], [2567],
[21], [<NAME>], [CRO], [2562],
[22], [JIANG Tianyi], [HKG], [2558],
[23], [CHEUNG Yuk], [HKG], [2547],
[24], [LEE Jungwoo], [KOR], [2544],
[25], [GAO Ning], [SGP], [2539],
[26], [TANG Peng], [HKG], [2535],
[27], [YOSHIDA Kaii], [JPN], [2531],
[28], [QIU Yike], [CHN], [2528],
[29], [GERELL Par], [SWE], [2527],
[30], [KREANGA Kalinikos], [GRE], [2524],
[31], [XU Xin], [CHN], [2518],
[32], [LI Ping], [QAT], [2510],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (33 - 64)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[33], [MIZUTANI Jun], [JPN], [2498],
[34], [LEE Jungsam], [KOR], [2489],
[35], [CHUANG Chih-Yuan], [TPE], [2488],
[36], [SUSS Christian], [GER], [2475],
[37], [CHIANG Peng-Lung], [TPE], [2473],
[38], [CHIANG Hung-Chieh], [TPE], [2466],
[39], [OH Sangeun], [KOR], [2451],
[40], [GARDOS Robert], [AUT], [2445],
[41], [TUGWELL Finn], [DEN], [2431],
[42], [KONG Linghui], [CHN], [2423],
[43], [#text(gray, "ROSSKOPF Jorg")], [GER], [2417],
[44], [KORBEL Petr], [CZE], [2412],
[45], [<NAME>], [IND], [2412],
[46], [HE Zhiwen], [ESP], [2407],
[47], [KIM Junghoon], [KOR], [2406],
[48], [KIM Hyok Bong], [PRK], [2405],
[49], [<NAME>], [SWE], [2403],
[50], [TAKAKIWA Taku], [JPN], [2401],
[51], [XU Hui], [CHN], [2398],
[52], [<NAME>], [HKG], [2384],
[53], [BLASZCZYK Lucjan], [POL], [2375],
[54], [<NAME>yi], [POL], [2373],
[55], [MONTEIRO Thiago], [BRA], [2367],
[56], [<NAME>], [SLO], [2366],
[57], [WU Chih-Chi], [TPE], [2364],
[58], [GIONIS Panagiotis], [GRE], [2360],
[59], [KISHIKAWA Seiya], [JPN], [2360],
[60], [ELOI Damien], [FRA], [2350],
[61], [KEEN Trinko], [NED], [2346],
[62], [CHEN Weixing], [AUT], [2345],
[63], [SHMYREV Maxim], [RUS], [2335],
[64], [KOSOWSKI Jakub], [POL], [2335],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (65 - 96)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[65], [<NAME>], [DOM], [2335],
[66], [<NAME>], [POL], [2335],
[67], [<NAME>], [BEL], [2331],
[68], [BOBOCICA Mihai], [ITA], [2328],
[69], [SMIRNOV Alexey], [RUS], [2320],
[70], [<NAME>], [PRK], [2318],
[71], [<NAME>], [POR], [2318],
[72], [<NAME>], [SVK], [2316],
[73], [<NAME>], [POR], [2315],
[74], [YANG Min], [ITA], [2307],
[75], [<NAME>], [ROU], [2307],
[76], [LIVENTSOV Alexey], [RUS], [2306],
[77], [<NAME>], [PRK], [2306],
[78], [#text(gray, "HAKANSSON Fredrik")], [SWE], [2303],
[79], [<NAME>], [KOR], [2298],
[80], [STEGER Bastian], [GER], [2296],
[81], [ZHANG Chao], [CHN], [2292],
[82], [OVTCHAROV Dimitrij], [GER], [2292],
[83], [HABESOHN Daniel], [AUT], [2290],
[84], [<NAME>], [SRB], [2285],
[85], [<NAME>], [KOR], [2285],
[86], [<NAME>], [SGP], [2279],
[87], [<NAME>], [CZE], [2278],
[88], [<NAME>], [CRO], [2274],
[89], [<NAME>-Shu], [TPE], [2272],
[90], [<NAME>], [JPN], [2271],
[91], [MATSUDAIRA Kenji], [JPN], [2270],
[92], [<NAME>], [FRA], [2266],
[93], [MONTEIRO Joao], [POR], [2263],
[94], [<NAME>], [CRO], [2260],
[95], [<NAME>], [ROU], [2250],
[96], [<NAME>], [CHN], [2248],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (97 - 128)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[97], [<NAME>], [KOR], [2247],
[98], [LUNDQVIST Jens], [SWE], [2245],
[99], [<NAME>], [KOR], [2243],
[100], [<NAME>], [DEN], [2237],
[101], [MATSUDAIRA Kenta], [JPN], [2233],
[102], [<NAME>], [CZE], [2229],
[103], [<NAME>], [UKR], [2227],
[104], [SKACHKOV Kirill], [RUS], [2227],
[105], [PERSSON Jon], [SWE], [2225],
[106], [CHT<NAME>], [BLR], [2222],
[107], [ERLANDSEN Geir], [NOR], [2221],
[108], [<NAME>], [KUW], [2218],
[109], [<NAME>], [FRA], [2215],
[110], [#text(gray, "<NAME>")], [JPN], [2213],
[111], [BURGIS Matiss], [LAT], [2212],
[112], [<NAME>], [ESP], [2199],
[113], [<NAME>], [SVK], [2198],
[114], [<NAME>], [EGY], [2198],
[115], [<NAME>], [SVK], [2197],
[116], [<NAME>], [RUS], [2196],
[117], [<NAME>], [HUN], [2196],
[118], [<NAME>], [UKR], [2194],
[119], [<NAME>], [SRB], [2191],
[120], [<NAME>], [NGR], [2187],
[121], [<NAME>], [HUN], [2186],
[122], [<NAME>], [ARG], [2181],
[123], [<NAME>], [SGP], [2179],
[124], [MAZUNOV Dmitry], [RUS], [2177],
[125], [<NAME>], [DEN], [2174],
[126], [<NAME>], [CZE], [2170],
[127], [NEKHVEDOVICH Vitaly], [BLR], [2170],
[128], [#text(gray, "SAIVE Philippe")], [BEL], [2166],
)
) |
|
https://github.com/halt23/math | https://raw.githubusercontent.com/halt23/math/main/test.typ | typst | #set heading(numbering: "1.")
= Wiskunde hoofdstuk 4 combinatoriek
== Regels voor telproblemen
\
*11*
Kieze uit de letters *A, B , C of D*
Codes van twee letters waarbij 1 is anders dan twee #sym.arrow.r $4 dot 3 = 12$ mogelijkheden.
Codes van twee letters 1 en 2 kunnen herzelfde zijn #sym.arrow.r $4 dot 4 = 16$ mogelijkheden.
*12*
getallen van *4* cijfers *alleen* de cijfers *3, 4, 5, 6, 7 en 8* geeft keuze uit 6 cijfers.
*a*
$6 dot 5 dot 4 dot 3 = 360$ mogelijkheden.
*b*
positie 1 \> 6 geeft 3 opties voor 1 #sym.arrow.r $3 dot 5 dot 4 dot 3 = 180$ mogelijheden.
*c*
cijfers meerdere keren gebruiken maar \> 6500 #sym.arrow.r $3 dot 3 dot 6 dot 6 = 324$
*13*
*8 NL, 10 FR* #sym.arrow.r *18 leerlingen*
*a*
$10 dot 17 dot 16 = 2720$ mogelijke verdelingen
*b*
$10 * 8 * 7 = 560$ mogelijke verdelingen als T1 = FR en 2,3 NL
*c*
$10 * 8 * 16 $
*14*
*a*
codes van drie letters uit 26 #sym.arrow.r $26 dot 26 dot 26 = 17576$ codes.
*b*
$26 dot 25 dot 25 = 1625$ codes.
*c*
$ 1 dot 26 dot 26 = 676$ codes.
*15*
codes die bestaan uit *o, p, q, r, s, t* geeft *zes* letters.
*a*
- 1 maal gebruiken #sym.arrow.r $6 dot 5 dot 4 = 120$
- meerdere malen gebruiken #sym.arrow.r $6^3 = 216$
*b*
- geen gelijke letters:
- 2 #sym.arrow.r $6 dot 5 = 30 $
- 3 #sym.arrow.r $6 dot 5 dot 4 = 120 $
- 4 #sym.arrow.r $6 dot 5 dot 4 dot 3 = 360 $
- 5 #sym.arrow.r $6 dot 5 dot 4 dot 3 dot 2 = 720 $
- 6 #sym.arrow.r $6 dot 5 dot 4 dot 3 dot 2 dot 1 = 720 + $
#sym.arrow.r $30 + 120 + 360 + 720 dot 2 = 1950$
- letters mogen gelijk zijn:
- 2 #sym.arrow.r $6^2 = 36$
- 3 #sym.arrow.r $6^3 = 216$
- 4 #sym.arrow.r $6^4 = 1296$
- 5 #sym.arrow.r $6^5 = 7776$
- 6 #sym.arrow.r $6^6 = 46659 +$
#sym.arrow.r 55980
*17*
*Twee leerlingen gekozen: 14J, 17M, 31 TOTAAL*
*a*
$14 dot 5 = 70 $
*c*
$14 dot 17 = 238$
|
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/086.%20ycombinator.html.typ | typst | ycombinator.html
A New Venture Animal
March 2008, rev May 2013(This essay grew out of something I wrote for myself to figure
out what we do. Even though Y Combinator is now 3 years old, we're still
trying to understand its implications.)
I was annoyed recently to read a description of Y Combinator that
said "Y Combinator does seed funding for startups." What was
especially annoying about it was that I wrote it. This doesn't
really convey what we do. And the reason it's inaccurate is that,
paradoxically, funding very early stage startups is not mainly about
funding.Saying YC does seed funding for startups is a description in terms
of earlier models. It's like calling a car a horseless carriage.When you scale animals you can't just keep everything in proportion.
For example, volume grows as the cube of linear dimension, but
surface area only as the square. So as animals get bigger they
have trouble radiating heat. That's why mice and rabbits are furry
and elephants and hippos aren't. You can't make a mouse by scaling
down an elephant.YC represents a new, smaller kind of animal—so much smaller
that all the rules are different.Before us, most companies in the startup funding business were
venture capital funds. VCs generally fund later stage companies
than we do. And they supply so much money that, even though the
other things they do may be very valuable, it's not that inaccurate
to regard VCs as sources of money. Good VCs are "smart money," but
they're still money.All good investors supply a combination of money and help. But
these scale differently, just as volume and surface area do. Late
stage investors supply huge amounts of money and
comparatively little help: when a company about to go public gets
a mezzanine round of $50 million, the deal tends to be almost
entirely about money. As you move earlier in the venture
funding process, the ratio of help to money increases, because
earlier stage companies have different needs. Early stage companies
need less money because they're smaller and cheaper to run, but
they need more help because life is so precarious for them. So
when VCs do a series A round for, say, $2 million, they generally
expect to offer a significant amount of help along with the money.Y Combinator occupies the earliest end of the spectrum. We're at
least one and generally two steps before VC funding. (Though some
startups go straight from YC to VC, the most common trajectory is
to do an angel round first.) And what happens at Y Combinator is
as different from what happens in a series A round as a series A
round is from a mezzanine financing.At our end, money is almost a negligible factor. The startup usually
consists of just the founders. Their living expenses are the
company's main expense, and since most founders are under 30, their
living expenses are low. But at this early stage companies need a
lot of help. Practically every question is still unanswered. Some
companies we've funded have been working on their software for a
year or more, but others haven't decided what to work on, or even
who the founders should be.When PR people and journalists recount the histories of startups
after they've become big, they always underestimate how uncertain
things were at first. They're not being deliberately misleading.
When you look at a company like Google, it's hard to imagine they
could once have been small and helpless. Sure, at one point they
were a just a couple guys in a garage—but even then their
greatness was assured, and all they had to do was roll forward along
the railroad tracks of destiny.Far from it. A lot of startups with just as promising beginnings
end up failing. Google has such momentum now that it would be hard
for anyone to stop them. But all it would have taken in the beginning
would have been for two Google employees to focus on the wrong
things for six months, and the company could have died.We know, because we've been there, just how vulnerable startups are
in the earliest phases. Curiously enough, that's why founders tend
to get so rich from them. Reward is always proportionate to risk,
and very early stage startups are insanely risky.What we really do at Y Combinator is get startups launched straight.
One of many metaphors you could use for YC is a steam catapult on
an aircraft carrier. We get startups airborne. Barely airborne,
but enough that they can accelerate fast.When you're launching planes they have to be set up properly or
you're just launching projectiles. They have to be pointed straight
down the deck; the wings have to be trimmed properly; the engines
have to be at full power; the pilot has to be ready. These are the
kind of problems we deal with. After we fund startups we work
closely with them for three months—so closely in fact that
we insist they move to where we are. And what we do in those three
months is make sure everything is set up for launch. If there are
tensions between cofounders we help sort them out. We get all the
paperwork set up properly so there are no nasty surprises later.
If the founders aren't sure what to focus on first, we try to figure
that out. If there is some obstacle right in front of them, we
either try to remove it, or shift the startup sideways. The goal
is to get every distraction out of the way so the founders can use
that time to build (or finish building) something impressive. And
then near the end of the three months we push the button on the
steam catapult in the form of Demo Day, where the current group of
startups present to pretty much every investor in Silicon Valley.Launching companies isn't identical with launching products. Though
we do spend a lot of time on launch strategies for products, there
are some things that take too long to build for a startup to launch
them before raising their next round of funding. Several of the
most promising startups we've funded haven't launched their products
yet, but are definitely launched as companies.In the earliest stage, startups not only have more questions to
answer, but they tend to be different kinds of questions. In later
stage startups the questions are about deals, or hiring, or
organization. In the earliest phase they tend to be about technology
and design. What do you make? That's the first problem to solve.
That's why our motto is "Make something people want." This is
always a good thing for companies to do, but it's even more important
early on, because it sets the bounds for every other question. Who
you hire, how much money you raise, how you market yourself—they
all depend on what you're making.Because the early problems are so much about technology and design,
you probably need to be hackers to do what we do. While some VCs
have technical backgrounds, I don't know any who still write code.
Their expertise is mostly in business—as it should be, because
that's the kind of expertise you need in the phase between series
A and (if you're lucky) IPO.We're so different from VCs that we're really a different kind of
animal. Can we claim founders are better off as a result of this
new type of venture firm? I'm pretty sure the answer is yes, because
YC is an improved version of what happened to our startup, and our
case was not atypical. We started Viaweb with $10,000 in seed money
from our friend Julian. He was a lawyer and arranged all our
paperwork, so we could just code. We spent three months building
a version 1, which we then presented to investors to raise more
money. Sounds familiar, doesn't it? But YC improves on that
significantly. Julian knew a lot about law and business, but his
advice ended there; he was not a startup guy. So we made some basic
mistakes early on. And when we presented to investors, we presented
to only 2, because that was all we knew. If we'd had our later
selves to encourage and advise us, and Demo Day to present at, we
would have been in much better shape. We probably could have raised
money at 3 to 5 times the valuation we did.If we take 7% of a company we fund, the founders only have to do
7.5% better in their next round of funding
to end up net ahead. We certainly manage that.So who is our 7% coming out of? If the founders end up net ahead
it's not coming out of them. So is it coming out of later stage
investors? Well, they do end up paying more. But I think they pay
more because the company is actually more valuable. And later stage
investors have no problem with that. The returns of a VC fund
depend on the quality of the companies they invest in, not how
cheaply they can buy stock in them.If what we do is useful, why wasn't anyone doing it before? There
are two answers to that. One is that people were doing it before,
just haphazardly on a smaller scale. Before us, seed funding came
primarily from individual angel investors. Larry and Sergey, for
example, got their seed funding from <NAME>, one of the
founders of Sun. And because he was a startup guy he probably gave
them useful advice. But raising money from angel investors is a
hit or miss thing. It's a sideline for most of them, so they only
do a handful of deals a year and they don't spend a lot of time on
the startups they invest in. And they're hard to reach, because
they don't want random startups pestering them with business plans.
The Google guys were lucky because they knew someone who knew
Bechtolsheim. It generally takes a personal introduction with
angels.The other reason no one was doing quite what we do is that till
recently it was a lot more expensive to start a startup. You'll
notice we haven't funded any biotech startups. That's still
expensive. But advancing technology has made web startups so cheap
that you really can get a company airborne for $15,000. If you
understand how to operate a steam catapult, at least.So in effect what's happened is that a new ecological niche has
opened up, and Y Combinator is the new kind of animal that has moved
into it. We're not a replacement for venture capital funds. We
occupy a new, adjacent niche. And conditions in our niche are
really quite different. It's not just that the problems we face
are different; the whole structure of the business is different.
VCs are playing a zero-sum game. They're all competing for a slice
of a fixed amount of "deal flow," and that explains a lot of their
behavior. Whereas our m.o. is to create new deal flow, by encouraging
hackers who would have gotten jobs to start their own startups
instead. We compete more with employers than VCs.It's not surprising something like this would happen. Most fields
become more specialized—more articulated—as they develop,
and startups are certainly an area in which there has been a lot
of development over the past couple decades. The venture business
in its present form is only about forty years old. It stands to
reason it would evolve.And it's natural that the new niche would at first be described,
even by its inhabitants, in terms of the old one. But really Y
Combinator is not in the startup funding business. Really we're
more of a small, furry steam catapult.Thanks to <NAME>, <NAME>, and <NAME>
for reading drafts of this.
Comment on this essay.
|
|
https://github.com/refparo/resume | https://raw.githubusercontent.com/refparo/resume/main/resume.typ | typst | MIT License | #import "chicv.typ": *
#show: chicv
= <NAME>
#fa[#envelope] <EMAIL> |
#fa[#github] #link("https://github.com/skyzh")[github.com/skyzh] |
#fa[#globe] #link("https://skyzh.dev")[skyzh.dev] |
#fa[#linkedin] #link("https://www.linkedin.com/in/alex-chi-skyzh/")[alex-chi-skyzh]
== Education
#cventry(
tl: "Carnegie Mellon University",
tr: "2022/08 - 2023/12 (Expected)",
bl: "Master of Science in Computer Science, GPA 4.09/4.33",
br: "Pittsburgh, PA, USA"
)[
- Teaching Assistant for 15-445/645 Database Systems (Fall 2022, Spring 2023)
]
#cventry(
tl: "Shangehai Jiao Tong University",
tr: "2018/09 - 2022/06",
bl: "B. Eng in Computer Science and Technology",
br: "Shangehai, China"
)[
- GPA 93.80/100, Rank 1/149, National Scholarship 2019 (Top 0.2% national-wide)
- A+ Courses: Operating Systems, Computer Architecture, Computer Networks, and 28 others
]
== Work Experience
#cventry(
tl: "RisingWave Labs",
tr: "2021/08 - 2022/07",
bl: "Database System R&D Intern",
br: "Shanghai, China"
)[
- *Top contributor of #iconlink(
"https://github.com/risingwavelabs/risingwave",
text: "RisingWave",
icon: github)* _as of 2023/03_. RisingWave is a database system with PostgreSQL-compatible interface that incrementally maintains materialized views. Worked on the development of almost all components related to stream computing and state store.
- *Streaming Index Joins*: Designed shared state and streaming index in RisingWave; implemented index lookup join executor; implemented delta join DAG optimizer transformations; implemented distributed delta join scheduler
- *Performance Improvement*: Conducted intensive benchmarks and analyzed performance issues. Fixed bugs, proposed strategies, and led cross-team collaboration which improved the system throughput by 10x in a 3-month period
- *Developer Experience*. Initiated the RiseDev development tool to start a RisingWave cluster with one command, which is deeply integrated into the development workflow across unit testing, integration testing, and benchmarking. Built RisingWave Streaming Dashboard that shows cluster metrics and visualizes streaming query plans in one place
- *Mentoring*. Mentored database kernel interns and helped their integration into the team. Maintained overview documents of the database kernel to facilitate knowledge transfer and help new hires learn about the system.
]
#cventry(
tl: "ByteDance, Ltd.",
tr: "2021/06 - 2021/08",
bl: "Storage System R&D Intern, TerarkDB Team",
br: "Beijing, China"
)[
- *Co-Optimized #iconlink(text: "TerarkDB", icon: github, "https://github.com/bytedance/terarkdb")* and *#iconlink(text: "ZenFS", icon: github, "https://github.com/westerndigitalcorporation/zenfs")*. Implemented Zone-aware Garbage Collection in TerarkDB and WAL-Aware Zone Allocator in ZenFS, which reduced 3-4x of space amplification and improved the p999 tail latency by 100x
/*
- Implemented *Zone-Aware Garbage Collection* in *TerrakDB* for Zoned Namespace SSDs, which reduced 3-4x of space amplification caused by interleaving write lifetime in a single ZNS zone. #iconlink("https://github.com/bytedance/terarkdb", icon: github)
- Added observability facilities to *ZenFS* (by Western Digital) to analyze bottlenecks and implemented a *WAL-Aware Zone Allocator*, which reduced the p999 tail latency by 100x. #iconlink("https://github.com/bzbd/zenfs", icon: github)
*/
]
#cventry(
tl: "PingCAP, Inc.",
tr: "2020/08 - 2021/01",
bl: "Storage System R&D Intern",
br: "Shanghai, China"
)[
- Built LSM-based storage engine *#iconlink("https://github.com/tikv/agatedb", icon: github, text: "AgateDB")* from ground-up. Inspired by WiscKey and BadgerDB, AgateDB separates large vallues from LSM tree into value log, so as to reduce write amplification.
]
== Open-Source Contributions
#cventry(
tl: "cmu-db/busttub" + " " + iconlink("https://github.com/cmu-db/bustub", icon: github),
tr: "2022/08 - Now"
)[
- Lead the development of the BusTub database system. Added SQL support/query processing layer to the system.
- Redesigned course projects to help students better understand the concepts and apply them to real-world scenarios. Developed leaderboard tests to challenge advanced students and enable further study.
]
#cventry(
tl: "RisingLight Community" + " " + iconlink("https://github.com/risinglightdb", icon: github),
tr: "2022/01 - Now",
)[
- Lead the development of *RisingLight*, an OLAP database system for educational purpose.
]
#cventry(
tl: "TiKV Community" + " " + iconlink("https://github.com/tikv", icon: github),
tr: "2020/05 - Now"
)[
- Maintains *TiKV Coprocessor*, the push-down execution framework of TiDB. Mentored community members to contribute features (e.g. new data types, plugin system) in the *LFX Mentorship*. #iconlink("https://github.com/tikv/tikv/issues/9066") #iconlink("https://github.com/tikv/tikv/issues/9747")
]
#cventry(
tl: "Personal Projects",
tr: "5.3k followers " + iconlink(text: "skyzh", icon: github, "https://github.com/skyzh")
)[
- *#iconlink(icon: github, text: "mini-lsm", "https://github.com/skyzh/mini-lsm")* (#fa[#star]1k) Build a simple LSM-Tree storage system in Rust in a week
- *#iconlink(icon: github, text: "type-exercise-in-rust", "https://github.com/skyzh/mini-lsm")* (#fa[#star]1k) Learn Rust generics by implementing a vectorized expression evaluation framework
]
#align(right, text(fill: gray)[Last Updated on #today()])
|
https://github.com/qjcg/awesome-typst | https://raw.githubusercontent.com/qjcg/awesome-typst/main/README_ZH.md | markdown | Creative Commons Zero v1.0 Universal | <p align=center>
<a href="README.md" hreflang="en" lang="en">English</a>
| <a href="README_ZH.md" hreflang="zh" lang="zh">简体中文</a>
</p>
# Awesome Typst 中文版
[](https://awesome.re)
> Awesome Typst 列表中文版(持续维护至最新),最初为已不再维护的 [typst-cn/awesome-typst-cn](https://github.com/typst-cn/awesome-typst-cn) ,后引申出的新仓库 [typst-doc-cn/awesome-typst-cn](https://github.com/typst-doc-cn/awesome-typst-cn),现在被合并到当前仓库。
>
> 该仓库部分内容由 ChatGPT 根据 [英文版](README.md) 翻译而来,并加入了中文专属部分〈如中国大学论文模板〉。
为 [Typst](https://github.com/typst/typst) 中文用户精心策划的有用链接集合。
欢迎提交 PR!也欢迎加入 Typst 非官方中文交流 QQ 群 793548390 一起讨论!
**Typst 非官方中文文档网站:** https://typst-doc-cn.github.io/docs/
除了文档,还可以考虑阅读 [typst-examples-book](https://sitandr.github.io/typst-examples-book/book/),里面包含了一些 Typst 的高级知识、简单示例,以及一些最佳实践。
## 关于 Typst
Typst 是可用于出版的可编程标记语言,拥有变量、函数与包管理等现代编程语言的特性,注重于科学写作 (science writing),定位与 LaTeX 相似。
- **语法简洁**:上手难度跟 Markdown 相当,文本源码阅读性高,不会像 LaTeX 一样充斥着反斜杠与花括号。
- **编译速度快**:Typst 使用 Rust 语言编写,即 typ(e+ru)st,目标运行平台是WASM,即浏览器本地离线运行;也可以编译成命令行工具,采用一种 **增量编译** 算法和一种有约束的版面缓存方案,**文档长度基本不会影响编译速度,且编译速度与常见 Markdown 渲染引擎渲染速度相当**。
- **环境搭建简单**:不需要像 LaTeX 一样折腾几个 G 的开发环境,原生支持中日韩等非拉丁语言,无论是官方 Web App 在线编辑,还是使用 VS Code 安装插件本地开发,都是 **即开即用**。
- **现代编程语言**:Typst 是可用于出版的可编程标记语言,拥有 **变量、函数、包管理与错误检查** 等现代编程语言的特性,同时也提供了 **闭包** 等特性,便于进行 **函数式编程**。以及包括了 `[标记模式]`、`{脚本模式}` 与 `$数学模式$` 等多种模式的作用域,并且它们可以不限深度地、交互地嵌套。并且通过 **[包管理](https://typst-doc-cn.github.io/docs/packages/)**,你不再需要像 TexLive 一样在本地安装一大堆并不必要的宏包,而是 **按需自动从云端下载**。
## 目录
- [Awesome Typst 中文版](#awesome-typst-中文版)
- [关于 Typst](#关于-typst)
- [目录](#目录)
- [官方项目链接](#官方项目链接)
- [集成和工具](#集成和工具)
- [浏览器扩展](#浏览器扩展)
- [聊天机器人](#聊天机器人)
- [CI/CD](#cicd)
- [命令行工具](#命令行工具)
- [编辑器](#编辑器)
- [编辑器集成](#编辑器集成)
- [编程](#编程)
- [Typst 作为服务](#typst-作为服务)
- [模板和库](#模板和库)
- [官方](#官方)
- [中国大学论文模板](#中国大学论文模板)
- [通用](#通用)
- [作业](#作业)
- [CV](#cv)
- [示例](#示例)
- [模板](#模板)
- [日历 / 课程表](#日历--课程表)
- [脚注和尾注](#脚注和尾注)
- [格式](#格式)
- [图形](#图形)
- [信件](#信件)
- [语言学](#语言学)
- [数学](#数学)
- [音乐](#音乐)
- [物理](#物理)
- [会议](#会议)
- [期刊](#期刊)
- [基金/提案](#基金提案)
- [工程](#工程)
- [绘图](#绘图)
- [海报](#海报)
- [脚本](#脚本)
- [幻灯片](#幻灯片)
<!-- markdown-toc end -->
## 官方项目链接
- [typst.app](https://typst.app) - Typst 网页应用程序
- [Typst 文档](https://typst.app/docs)
- [GitHub](https://github.com/typst/typst)
- [博客](https://typst.app/blog/)
- 社交 - [Discord] [Instagram] [LinkedIn] [Mastodon] [X]
[discord]: https://discord.gg/2uDybryKPe
[instagram]: https://instagram.com/typstapp/
[linkedin]: https://www.linkedin.com/company/typst/
[mastodon]: https://mastodon.social/@typst
[X]: https://twitter.com/typstapp/
## 集成和工具
### 浏览器扩展
- (FireFox) [bib-kit](https://github.com/MordragT/bib_kit) - 提取网站信息以创建 hayagriva 格式的引用
- (FireFox) [yank](https://addons.mozilla.org/en-US/firefox/addon/yank/) - 复制当前选项卡的 URL 和标题,格式化为选择的标记语言,然后复制到剪贴板(支持 Typst 链接格式)
### 聊天机器人
- [typst-bot](https://github.com/mattfbacon/typst-bot) - 用于呈现 Typst 代码的 Discord 机器人
### CI/CD
- [gitlab-ci-typst](https://gitlab.com/IvanSanchez/gitlab-ci-typst) - 使用 GitLab CI 管道构建 Typst 文档
- [setup-typst](https://github.com/typst-community/setup-typst) - 使用 GitHub 操作(Actions)安装 Typst
- [typst-action](https://github.com/lvignoli/typst-action) - 使用 GitHub 操作构建 Typst 文档
### 命令行工具
- [typstfmt](https://github.com/astrale-sharp/typstfmt/) - Typst 语言的基本格式化程序,未来还有更多功能!
- [typst-preview](https://github.com/Enter-tainer/typst-preview) - 在浏览器中实时预览 Typst
- [typst-live](https://github.com/ItsEthra/typst-live) - 在 Web 浏览器中实时重新加载 PDF
- [typst-pandoc](https://github.com/lvignoli/typst-pandoc) - Pandoc 的 Typst 自定义读写器
### 编辑器
- [typstudio](https://github.com/Cubxity/typstudio) - 正在开发中的使用 Tauri 构建的桌面编辑器
### 编辑器集成
- [SeniorMars/tree-sitter-typst](https://github.com/SeniorMars/tree-sitter-typst) - 用于 Typst 文件格式的 TreeSitter 解析器
- [Typst LSP VS Code 扩展](https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp)
- [Typst Preview VS Code 扩展](https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview) - 在 VSCode 中实现 typst 实时预览
- [frozolotl/tree-sitter-typst](https://github.com/frozolotl/tree-sitter-typst) - 重点放在正确性上的 tree-sitter 语法分析器
- [obsidian-typst](https://github.com/fenjalien/obsidian-typst) - 使用 Typst 将 Obsidian 中的 Typst 代码块呈现为图像的插件,通过 WASM 的力量!
- [typst-lsp](https://github.com/nvarner/typst-lsp) - Typst 的全新语言服务器,以及 VS Code 扩展
- [typst-mode.el](https://github.com/Ziqi-Yang/typst-mode.el) - 用于 `typst` 基于标记的排版系统的 Emacs 主要模式
- [typst-sympy-calculator](https://github.com/OrangeX4/vscode-typst-sympy-calculator) - 用于 Typst 数学计算的 VS Code 扩展,包括算术、微积分、矩阵、自定义变量和自定义函数
- [typst.nvim](https://github.com/SeniorMars/typst.nvim) - 正在开发中。目标:TreeSitter 高亮、代码片段和与 Neovim 的顺畅集成
- [typst.vim](https://github.com/kaarmu/typst.vim) - Typst 的 Vim 插件
- [typst-conceal.vim](https://github.com/MrPicklePinosaur/typst-conceal.vim) - Vim/Nvim 插件,用于替换 typst 长符号到 unicode 字符
- [Typst Sync](https://github.com/OrangeX4/vscode-typst-sync) - 用于 Typst 本地包管理和同步的 VS Code 扩展
- [Typst Math](https://github.com/supersurviveur/typst-math) - 在 VSCode 编辑器中预览 typst 数学公式
### 编程
- [leetcode.typ](https://github.com/lucifer1004/leetcode.typ) - 使用 Typst 解决 LeetCode 问题
- [typst-py](https://github.com/messense/typst-py) - Typst 的 Python 绑定
### Typst 作为服务
- [typst-http-api](https://github.com/slashformotion/typst-http-api) - 包含 API 的简单 Docker,用于编译 Typst 标记
## 模板和库
### 官方
- [typst/templates](https://github.com/typst/templates) - 随 Typst 网页应用程序一起提供的模板
### 中国大学论文模板
- [pkuthss-typst](https://github.com/lucifer1004/pkuthss-typst): 北京大学学位论文模板
- [BUAA-typst](https://github.com/cherichy/BUAA-typst): 北京航空航天大学学位论文模板
- [bupt-typst](https://github.com/QQKdeGit/bupt-typst): 北京邮电大学本科学士学位论文模板
- [HUST-typst-template](https://github.com/werifu/HUST-typst-template): 用于华科毕业设计(本科)的 typst 模板。
- [SHU-Bachelor-Thesis-Typst](https://github.com/shuosc/SHU-Bachelor-Thesis-Typst): 上海大学本科毕业论文 typst 模板 (开发ing)
- [sysu-thesis-typst](https://github.com/howardlau1999/sysu-thesis-typst): 中山大学学位论文 Typst 模板
- [ZJGSU-typst-template](https://github.com/jujimeizuo/ZJGSU-typst-template): 浙江工商大学毕业设计(本科)的 typst 模板。
- [CQUPTypst](https://github.com/jerrita/CQUPTypst): 一个 Typest 模板,但是大专
- [zjut-report-typst](https://github.com/zjutjh/zjut-report-typst): 浙江工业大学一些实验报告的 Typst 模板
- [HIT-Thesis-Typst](https://github.com/chosertech/HIT-Thesis-Typst): 适用于哈尔滨工业大学学位论文的 Typst 模板
- [nju-thesis-typst](https://github.com/nju-lug/nju-thesis-typst): 南京大学学位论文 Typst 模板,使用 Typst 包管理、闭包等现代编程语言特性开发,一个更方便编辑和拓展的模板
- [HEU-Report-Typst](https://github.com/a-kkiri/HEU-Report-Typst): 哈尔滨工程大学课程作业/结课汇报的通用简易 Typst 模板
- [sustech-ug-thesis-typst](https://github.com/dazhi0619/sustech-ug-thesis-typst): 南方科技大学本科毕业论文 Typst 模版
- [ustcthss-typst](https://github.com/smallscientist1/ustcthss-typst): 中国科学技术大学本科毕业论文 Typst 模版
### 通用
- [Data Thinking Report Template](https://github.com/onefact/datathinking.org-report-template) - 用 Zotero 协作文献目录编写人工智能白皮书的模板
- [Mantys](https://github.com/jneug/typst-mantys) - 用于编写 Typst 包的手册的模板
- [Project-Report-Typst](https://github.com/aurghya-0/Project-Report-Typst) - 用于大学或大学项目报告的简单模板
- [SimplePaper](https://github.com/1bitbool/SimplePaper) - 用于编写简单论文的中文模板
- [Typst-Paper-Template](https://github.com/jxpeng98/Typst-Paper-Template) - 用于工作论文的 Typst 模板
- [LaPreprint](https://github.com/rowanc1/LaPreprint) - 适用于 Typst 的漂亮论文模板
- [gloss-awe](https://github.com/RolfBremer/gloss-awe) - 自动生成的术语表页(从 typst-glossary 改名而来)
- [in-dexter](https://github.com/RolfBremer/in-dexter) - 自动生成的索引页(从 typst-index 改名而来)
- [simple-typst-thesis](https://github.com/zagoli/simple-typst-thesis) - 用于撰写简单论文的 Typst 模板
- [typst-invoice](https://github.com/erictapen/typst-invoice) - 从 TOML 文件生成发票
- [typst-orange-template](https://github.com/flavio20002/typst-orange-template) - 受 Legrand Orange Book 启发的 Typst 书籍模板
- [typst-palettes](https://github.com/kaarmu/typst-palettes) - Typst 的颜色调色板库
- [typst-templates](https://github.com/eigenein/typst-templates) - Typst 模板
- [typst-templates](https://github.com/haxibami/typst-template) - 我的 Typst 模板
- [typst-uwthesis](https://github.com/yangwenbo99/typst-uwthesis) - 用于撰写论文的 Typst 模板,具有工作缩写列表功能
- [typstry](https://github.com/qjcg/typstry) - Typst 模板和示例的编织
- [tyspt-mla9-template](https://github.com/wychwitch/tyspt-mla9-template) - MLA 第 9 版模板
- [writable-gm-screen-inserts](https://github.com/LLBlumire/writable-gm-screen-inserts) - 可涂写的 GM 帷幕的内页
- [french-association-status](https://github.com/coco33920/typst-association-status) - 用于法国协会编写状态的模板
- [aiaa-typst-template](https://gitlab.com/waterlubber/aiaa-typst-template) - 用于AIAA(美国航空航天学会)论文的模板。
- [SimpleNote](https://github.com/a-kkiri/SimpleNote) - 用于编写简易课程笔记的 Typst 模板
- [mcm-icm-typst-template](https://github.com/DawnEver/mcm-icm-typst-template) - 美国大学生数学建模比赛(美赛, MCM/ICM) Typst 模版.
- [CUMCM-typst-template](https://github.com/a-kkiri/CUMCM-typst-template) - 高教社杯全国大学生数学建模比赛(CUMCM)Typst 模版
- [caidan](https://github.com/cu1ch3n/caidan) - 用于编写菜单的简洁模板
### 作业
- [assignment-template](https://github.com/AntoniosBarotsis/typst-assignment-template) - 简单的作业模板
- [typst-assignment-template](https://github.com/astrale-sharp/typst-assignement-template.git) - 又一个简单的作业模板
- [typst-assignment-template](https://github.com/gRox167/typst-assignment-template.git) - 具有封面和多个有用数学符号的另一个简单作业模板
- [typst-homework-template](https://github.com/OriginCode/typst-homework-template) - 受到 Adam Blank LaTeX 作业模板启发的简单作业模板
- [typst-teacher-template](https://github.com/jomaway/typst-teacher-templates) - 用于创建我的课程工作表和考试的 Typst 模板的集合
### CV
#### 示例
- [bare-bones-cv](https://github.com/caffeinatedgaze/bare-bones-cv) – 一个包含必要要素的极简主义简历。它似乎与 ATS 非常兼容。
#### 模板
- [typst-academic-cv](https://github.com/DawnEver/typst-academic-cv) - Typst 学术 CV 模版
- [alta-typst](https://github.com/GeorgeHoneywood/alta-typst) - 简单的 Typst CV 模板,灵感来自 AltaCV by <NAME>
- [attractive-typst-resume](https://github.com/Harkunwar/attractive-typst-resume) - <NAME> 制作的现代、吸引人的 CV/简历模板
- [awesomeCV-Typst](https://github.com/mintyfrankie/awesomeCV-Typst) - 受 LaTeX `Awesome-CV` 项目启发的具有多语言支持等特点的 CV 模板
- [billryan-typst](https://github.com/gvariable/billryan-typst) - 受 Billryan 制作的简单和极简主义的简历模板启发
- [cv.typ](https://github.com/jskherman/cv.typ) - 使用 Typst 和 YAML 版本控制 CV 数据的无花样简历模板
- [moderncv.typst](https://github.com/giovanniberti/moderncv.typst) - 受 LaTeX 的 `moderncv` 启发的 CV 模板
- [resume.typ](https://github.com/wusyong/resume.typ) - 生成简历和 CV 的简单、人体工程学模板
- [simplecv](https://github.com/LaurenzV/simplecv) - 用 Typst 编写的简单而优雅的 CV 模板
- [typst-cv-miku](https://github.com/ice-kylin/typst-cv-miku) - 为 Typst 制作的简单、优雅、学术风格的 CV 模板。支持英语和中文等多语言
- [typst-cv-resume](https://github.com/jxpeng98/Typst-CV-Resume) - 使用 Sans 字体受到 LaTeX `Deedy-Resume` 启发的 CV 模板
- [typst-cv-template1](https://github.com/vaibhavjhawar/typst-cv-template1) - 受 <NAME> 的 Graduate CV LaTeX 模板启发的 CV 模板
- [typst-cv-template](https://github.com/skyzh/typst-cv-template) - 适用于 Typst 的中文 CV 模板
- [typst-mixed-resume](https://github.com/titaneric/typst-mixed-resume) - 受多个模板启发的随意而优雅的简历模板
- [typst-neat-cv](https://github.com/UntimelyCreation97/typst-neat-cv) - 一种现代、简约和优雅的Typst简历模板,灵感来自于 mintyfrankie 的`Brilliant CV`。
- [typst-resume-sans](https://github.com/mizlan/typst-resume-sans) - 时尚而朴素的无衬线字体简历模板
- [typst-resume-template](https://github.com/bamboovir/typst-resume-template) - 受 Awesome-CV 项目启发的美观样式
- [typst-resume-template](https://github.com/hexWars/resume) - 使用 Typst 设计的漂亮简历模板
- [typst-twentysecondcv](https://github.com/tomowang/typst-twentysecondcv) - 受 LaTeX 的 `Twenty Seconds Resume/CV` 启发的 CV 模板
- [typst-yaml-cv](https://github.com/daxartio/cv) - 使用 Typst 和 YAML 设计的简历模板
- [vercanard](https://github.com/elegaanz/vercanard) - 适用于 Typst 的多彩简历模板
- [Chinese-Resume-in-Typst](https://github.com/OrangeX4/Chinese-Resume-in-Typst) - 使用 Typst 编写的中文简历, 语法简洁, 样式美观, 开箱即用, 可选是否显示照片
- [neet-cv](https://github.com/kznr02/neet-cv) - 作者自用后开源的一份使用typst自制的中文简历模板,具有简单的使用方法,其中有部分参考`wondercv`,开箱即用,简洁美观。
- [serif-chinese-cv](https://github.com/MondayCha/chinese-cv) - 双色中文简历,使用衬线字体,基于 [chicv](https://github.com/skyzh/chicv) 改造。
- [Chinese-Resume-in-Typst-PhD](https://github.com/TimoLin/Chinese-Resume-in-Typst-PhD) - 基于`Chinese-Resume-in-Typst`简历开发,适用于硕/博士求职,更加灵活地管理和展示你的项目经历 。
### 日历 / 课程表
- [typst-timetable](https://github.com/ludwig-austermann/typst-timetable) - 课程表模板
### 脚注和尾注
- [notes.typ](https://github.com/tbug/notes.typ) - 具有去重和自定义功能的注释库
- [typst-notes](https://github.com/saadulkh/typst-notes) - Typst 中添加脚注和尾注的库
### 格式
- [metro](https://github.com/fenjalien/metro) - 用于添加排版单位的 Typst 包
- [ruby-typ](https://github.com/rinmyo/ruby-typ) - 用于添加 Ruby 文本的库
- [showybox](https://github.com/Pablo-Gonzalez-Calderon/showybox-package) - 创建多彩且可自定义的框的 Typst 包
- [simple-poem-typst](https://github.com/asibahi/simple-poem-typst) - 使用 `measure` 函数设置阿拉伯诗歌的应用程序
- [syntastica-typst](https://github.com/RubixDev/syntastica-typst/) - 用于代码块的 Tree-sitter 语法高亮
- [typst-ansi_render](https://github.com/8LWXpg/typst-ansi_render) - 使用 ANSI 转义序列呈现文本的库
- [typst-boxes](https://github.com/lkoehl/typst-boxes) - 用于绘制多彩框的库
- [typst-codelst](https://github.com/jneug/typst-codelst) - 用于呈现源代码的 Typst 包
- [typst-diagbox](https://github.com/PgBiel/typst-diagbox) - 用于 Typst 表格中的对角线分隔线的库
- [typst-tablex](https://github.com/PgBiel/typst-tablex) - 更强大和可定制的 Typst 表格
- [typst-tablem](https://github.com/OrangeX4/typst-tablem) - 在 Typst 中轻松编写类 markdown 表格
### 图形
- [CeTZ](https://github.com/johannes-wolf/typst-canvas) - 用于 [Typst](https://typst.app) 绘图的库,其 API 受到 TikZ 和 [Processing](https://processing.org/) 的启发。它附带用于绘制图表、图形和图表的模块。
- [typst-raytracer](https://github.com/SeniorMars/typst-raytracer) - Typst 中的光线追踪器
### 信件
- [typst-letter](https://github.com/dvdvgt/typst-letter) - 受 DIN 5008 标准启发的 Typst 信件模板
- [typst-letter-template](https://github.com/pascal-huber/typst-letter-template) - 具有不同预设(DIN 5008、Swiss C5)的可定制 Typst 信件模板
### 语言学
- [leipzig-gloss](https://gitea.everydayimshuflin.com/greg/typst-lepizig-glossing) - 提供根据 Leipzig 规则创建辞典规则的基本库
- [typst-ipa](https://github.com/imatpot/typst-ipa) - 用于 Typst 的 ASCII / IPA 转换
### 数学
- [commute](https://gitlab.com/giacomogallina/commute) - 用于创建交换图的库
- [typst-algorithms](https://github.com/platformer/typst-algorithms) - 用于编写算法的库
- [typst-himcm-template](https://github.com/EvanLuo42/typst-himcm-template) - 针对 Typst 的 HiMCM 模板
- [typst-math-template](https://github.com/matthiasGmayer/typst-math-template) - 一个简单的数学模板,允许编号、可引用的定理以及对使用引用的子文件进行编译。
- [typst-pf3](https://github.com/maxwell-thum/typst-pf3) - 用于创建“结构化证明”的小型包。本质上是 Leslie Lamport 的 `pf2.sty` 移植
- [typst-theorems](https://github.com/sahasatvik/typst-theorems) - 用于创建带编号的定理环境的库
- [typst-undergradmath](https://github.com/johanvx/typst-undergradmath) - Typst 对 [undergradmath](https://gitlab.com/jim.hefferon/undergradmath) 的移植
### 音乐
- [conchord](https://github.com/sitandr/conchord) - 用于轻松编写带和弦的歌词并生成多彩的指板图的 Typst 包
- [typst-chords](https://github.com/ljgago/typst-chords) - 用于在 Typst 中编写带弦图的歌词的库
### 物理
- [physics](https://github.com/Leedehai/typst-physics) - 用于常见物理符号表示的库,例如向量和矢量场、矩阵、微分、导数、Dirac 括号、张量、同位素和数字信号序列。
### 会议
- [aiaa-typst](https://github.com/isaacew/aiaa-typst) - 一种按照美国航空航天学会风格创建会议论文的模板。
- [ieee-conference-typst-template](https://github.com/DawnEver/ieee-conference-typst-template) - 用于撰写 Typst 的 IEEE 会议模板
- [ieee-typst-template](https://github.com/bsp0109/ieee-typst-template) - 用于撰写 Typst 的 IEEE 论文模板
- [ifacconf-typst](https://github.com/avonmoll/ifacconf-typst) - 一种按照国际自动控制联合会风格创建的模板
### 期刊
- [ieee-trans-typst](https://github.com/p4perf4ce/typst-ieee-trans-template) - 模仿 LaTeX IEEE 汇刊 (Transactions) 模板(`ieee-trans.cls`)的模板
### 基金/提案
- [typst-nsf-templates](https://github.com/ntjess/typst-nsf-templates) - 国家科学基金会(NSF)通用模板和常见提案类型的大纲。
### 工程
- [circuitypst](https://github.com/fenjalien/circuitypst) - 用于绘制电子电路原理图的库
- [typst-bytefield](https://github.com/jomaway/typst-bytefield) - 用于绘制(网络)协议头的库
- [tids](https://github.com/oldrev/tids) - TI 风格的电子元件规格书模板
### 绘图
- [typst-cd](https://gitlab.com/giacomogallina/typst-cd) - 用于创建类似 Tikz 的交换图的概念验证
- [typst-plot](https://github.com/johannes-wolf/typst-plot) - 用于绘制折线图的库(已不再推荐使用,推荐使用 CeTZ)
- [typst-plotting](https://github.com/Pegacraft/typst-plotting) - 用于绘制各种图表和图形的库,如折线图、直方图和饼图
### 海报
- [typst-poster](https://github.com/pncnmnp/typst-poster) - 一种学术海报模板
- [science-posters](https://github.com/jonaspleyer/science-posters) - 创建块风格的学术海报
### 脚本
- [typst-oxifmt](https://github.com/PgBiel/typst-oxifmt) - Typst 中方便的类似 Rust 的字符串格式化
- [typst-tools4typst](https://github.com/jneug/typst-tools4typst) - 用于包和模板作者的工具。
### 幻灯片
- [diapo](https://github.com/lvignoli/diapo) - 一种极简和简约的演示模板。
- [polylux](https://github.com/andreasKroepelin/polylux) - 在 Typst 中创建演示幻灯片
- [pinit](https://github.com/OrangeX4/typst-pinit) - 用于更好地在 Typst 中编写 Slides 的相对定位工具包
- [touying](https://github.com/touying-typ/touying) - 一个更强大的演示幻灯片包,包含许多内置模板和 [中文文档](https://touying-typ.github.io/zh/docs/intro/)
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz/0.2.0/src/matrix.typ | typst | Apache License 2.0 | #import "vector.typ"
#let cos(angle) = {
return calc.round(calc.cos(angle), digits: 10)
}
#let sin = calc.sin
#let pi = calc.pi
/// Create identity matrix with dimensions $m times n$
///
/// - m (int): Rows
/// - n (int): Columns
/// - one (float): Value to set as $1$
/// - zero (float): Value to set as $0$
/// -> matrix
#let ident(m: 4, n: 4, one: 1, zero: 0) = {
({for m in range(0, m) {
({for n in range(0, n) {
if m == n { (one,) } else { (zero,) }
}},)
}})
}
/// Return matrix dimensions (m, n)
/// -> tuple
#let dim(m) = {
return (m.len(), if m.len() > 0 {m.at(0).len()} else {0})
}
/// Return a $4 times 4$ translation matrix
#let transform-translate(x, y, z) = {
((1, 0, 0, x),
(0, 1, 0, y),
(0, 0, 1, z),
(0, 0, 0, 1))
}
// Return 4x4 x-shear matrix
#let transform-shear-x(factor) = {
((1, factor, 0, 0),
(0, 1, 0, 0),
(0, 0, 1, 0),
(0, 0, 0, 1))
}
/// Return a $4 times 4$ z-shear matrix
#let transform-shear-z(factor) = {
((1, 0, factor, 0),
(0, 1,-factor, 0),
(0, 0, 1, 0),
(0, 0, 0, 1))
}
// Return 4x4 scale matrix
#let transform-scale(f) = {
let (x, y, z) = if type(f) == array {
vector.as-vec(f, init: (1, 1, 1))
} else if type(f) == dictionary {
(f.at("x", default: 1),
f.at("y", default: 1),
f.at("z", default: 1))
} else {
(f, f, f)
}
return(
(x, 0, 0, 0),
(0, y, 0, 0),
(0, 0, z, 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate xyz matrix for direction and up vector
#let transform-rotate-dir(dir, up) = {
dir = vector.norm(dir)
up = vector.norm(up)
let (dx, dy, dz) = dir
let (ux, uy, uz) = up
let (rx, ry, rz) = vector.norm(vector.cross(dir, up))
((rx, dx, ux, 0),
(ry, dy, uy, 0),
(rz, dz, uz, 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate x matrix
#let transform-rotate-x(angle) = {
// let (cos, sin) = (calc.cos, calc.sin)
((1, 0, 0, 0),
(0, cos(angle), -sin(angle), 0),
(0, sin(angle), cos(angle), 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate y matrix
#let transform-rotate-y(angle) = {
// let (cos, sin) = (calc.cos, calc.sin)
((cos(angle), 0, -sin(angle), 0),
(0, 1, 0, 0),
(sin(angle), 0, cos(angle), 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate z matrix
#let transform-rotate-z(angle) = {
((cos(angle), -sin(angle), 0, 0),
(sin(angle), cos(angle), 0, 0),
(0, 0, 1, 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate xz matrix
#let transform-rotate-xz(x, z) = {
((cos(z), sin(z), 0, 0),
(-cos(x)*sin(z), cos(x)*cos(z), -sin(x), 0),
(sin(x)*sin(z), -sin(x)*cos(z), cos(x), 1),
(0, 0, 0, 1))
}
/// Return 4x4 rotation matrix - yaw-pitch-roll
///
/// Calculates the product of the three rotation matrices
/// R = Rz(a) Ry(b) Rx(c)
///
/// - a (angle): Yaw
/// - b (angle): Pitch
/// - c (angle): Roll
/// -> matrix
#let transform-rotate-ypr(a, b, c) = {
((cos(a)*cos(b), cos(a)*sin(b)*sin(c) - sin(a)*cos(c), cos(a)*sin(b)*cos(c) + sin(a)*sin(c), 0),
(sin(a)*cos(b), sin(a)*sin(b)*sin(c) + cos(a)*cos(c), sin(a)*sin(b)*cos(c) - cos(a)*sin(c), 0),
(-sin(b), cos(b)*sin(c), cos(b)*cos(c), 1),
(0,0,0,1))
}
/// Return 4x4 rotation matrix - euler angles
///
/// Calculates the product of the three rotation matrices
/// R = Rz(z) Ry(y) Rx(x)
///
/// - x (angle): Rotation about x
/// - y (angle): Rotation about y
/// - z (angle): Rotation about z
/// -> matrix
#let transform-rotate-xyz(x, y, z) = {
((cos(y)*cos(z), sin(x)*sin(y)*cos(z) - cos(x)*sin(z), cos(x)*sin(y)*cos(z) + sin(x)*sin(z), 0),
(cos(y)*sin(z), sin(x)*sin(y)*sin(z) + cos(x)*cos(z), cos(x)*sin(y)*sin(z) - sin(x)*cos(z), 0),
(-sin(y), sin(x)*cos(y), cos(x)*cos(y), 0),
(0,0,0,1))
}
// Multiply matrices on top of each other.
#let mul-mat(..matrices) = {
// assert(ms.named() == (:), message: "Unexpected named arguments: " + repr(ms.named()))
matrices = matrices.pos()
let out = matrices.remove(0)
for matrix in matrices {
let (m, n, p) = (
..dim(out),
dim(matrix).last()
)
out = (
for i in range(m) {
(
for j in range(p) {
(range(n).map(k => out.at(i).at(k) * matrix.at(k).at(j)).sum(),)
}
,)
}
)
}
return out
}
// Multiply 4x4 matrix with vector of size 3 or 4.
// The value of vec_4 defaults to w (1).
//
// The resulting vector is of dimension 3
#let mul4x4-vec3(mat, vec, w: 1) = {
assert(vec.len() <= 4)
let out = (0, 0, 0)
for m in range(0, 3) {
let v = (mat.at(m).at(0) * vec.at(0, default: 0)
+ mat.at(m).at(1) * vec.at(1, default: 0)
+ mat.at(m).at(2) * vec.at(2, default: 0)
+ mat.at(m).at(3) * vec.at(3, default: w))
out.at(m) = v
}
return out
}
// Multiply matrix with vector
#let mul-vec(mat, vec) = {
if mat.len() != vector.dim(vec) {
panic("matrix m must be equal to vector dim")
}
let new = (0, 0, 0, 1)
for m in range(0, mat.len()) {
let v = 0
for n in range(0, vector.dim(vec)) {
v += vec.at(n) * mat.at(m).at(n)
}
new.at(m) = v
}
return new
}
#let inverse(matrix) = {
let n = {
let size = dim(matrix)
assert.eq(size.first(), size.last(), message: "Matrix must be square to perform inversion.")
size.first()
}
let N = range(n)
let inverted = ident(m: n, n: n)
let p
for j in N {
for i in range(j, n) {
if matrix.at(i).at(j) != 0 {
(matrix.at(j), matrix.at(i)) = (matrix.at(i), matrix.at(j))
(inverted.at(j), inverted.at(i)) = (inverted.at(i), inverted.at(j))
p = 1 / matrix.at(j).at(j)
for k in N {
matrix.at(j).at(k) *= p
inverted.at(j).at(k) *= p
}
for L in N {
if L != j {
p = -matrix.at(L).at(j)
for k in N {
matrix.at(L).at(k) += p * matrix.at(j).at(k)
inverted.at(L).at(k) += p * inverted.at(j).at(k)
}
}
}
}
}
}
return inverted
}
/// Swap column a with column b
///
/// - mat (matrix): Matrix
/// - a (int): Column a
/// - b (int): Column b
/// -> matrix New matrix
#let swap-cols(mat, a, b) = {
let new = mat
for m in range(mat.len()) {
new.at(m).at(a) = mat.at(m).at(b)
new.at(m).at(b) = mat.at(m).at(a)
}
return new
}
// Translate the matrix by the vector
#let translate(mat, vec) = {
return mul-mat(
mat,
transform-translate(
vec.at(0),
-vec.at(1),
vec.at(2),
),
)
}
|
https://github.com/ice1000/website | https://raw.githubusercontent.com/ice1000/website/main/dtt-dev/config.typ | typst | #import "@preview/ctheorems:1.1.2": *
#let alpha = "33"
#let theorem = thmbox("theorem", "Theorem", breakable: true, fill: rgb("#eeffee" + alpha))
#let lemma = thmbox("lemma", "Lemma", breakable: true, fill: rgb("#eeffee" + alpha))
#let corollary = thmbox("corollary", "Corollary", breakable: true, fill: rgb("#eeffee" + alpha))
#let definition = thmbox("definition", "Definition", breakable: true, fill: rgb("#DFF9FF" + alpha))
#let notation = thmbox("notation", "Notation", breakable: true, fill: rgb("#DFF9FF" + alpha))
#let construction = thmbox("construction", "Construction", breakable: true, fill: rgb("#fff7f7" + alpha))
#let example = thmbox("example", "Example", breakable: true, fill: rgb("#f7f7fd" + alpha))
#let lesson = thmbox("lesson", "Lesson", breakable: true, fill: rgb("#FFCCCB" + alpha))
#let proof = thmproof("proof", "Proof")
#let inl(x) = $sans("inl")(#x)$
#let inr(x) = $sans("inr")(#x)$
#let wk(x) = $sans("wk")(#x)$
#let elim = $sans("elim")$
#let refl = $sans("refl")$
#let ex(A,B) = $sans("ex")_(#A, #B)$
#let Cone(D, X) = $sans("Cone")_(#D)(X)$
#import "/book.typ": cross-link as lib-cross-link
#let cross-link(path, reference: none, content) = lib-cross-link("/dtt-dev/" + path + ".typ", reference: reference, content)
#let common-config(body) = {
show: thmrules.with(qed-symbol: $square$)
show math.equation: it => {
show "★": math.class.with("unary")
show sym.bot: math.class.with("unary")
show "·": math.class.with("unary")
show "∈": math.scripts
show "⊢": math.scripts
show "=": math.scripts
it
}
body
}
#let dtt(title: "DTT", body) = {
import "/book.typ": book-page
show: book-page.with(title: title, show-title: true)
show: common-config
body
}
|
|
https://github.com/herbhuang/utdallas-thesis-template-typst | https://raw.githubusercontent.com/herbhuang/utdallas-thesis-template-typst/main/content/introduction.typ | typst | MIT License | #import "/utils/todo.typ": TODO
= Introduction
#TODO[
Introduce the topic of your thesis, e.g. with a little historical overview.
]
== Problem
#TODO[
Describe the problem that you like to address in your thesis to show the importance of your work. Focus on the negative symptoms of the currently available solution.
]
== Motivation
#TODO[
Motivate scientifically why solving this problem is necessary. What kind of benefits do we have by solving the problem?
]
== Objectives
#TODO[
Describe the research goals and/or research questions and how you address them by summarizing what you want to achieve in your thesis, e.g. developing a system and then evaluating it.
]
== Outline
#TODO[
Describe the outline of your thesis
] |
https://github.com/jasonelaw/typst-templates | https://raw.githubusercontent.com/jasonelaw/typst-templates/main/pdx-bes-memo/0.1.0/template/template.typ | typst | MIT License | #import "@local/pdx-bes-memo:0.1.0": bes-memo
#show: rest => bes-memo(
sender: "<NAME>",
recipient: "<NAME>",
date: datetime.today().display(),
re: "Typst Memo",
rest
)
This is a Typst template for a City of Portland Bureau of Environmental Services
memo. The template is based on the standard BES Microsoft Word memo template.
lorem(25) |
https://github.com/OverflowCat/sigfig | https://raw.githubusercontent.com/OverflowCat/sigfig/neko/README.md | markdown | MIT License | # `sigfig`
`sigfig` is a [Typst](https://typst.app/) library for rounding numbers with [significant figures](https://en.wikipedia.org/wiki/Significant_figures) and [measurement uncertainty](https://en.wikipedia.org/wiki/Measurement_uncertainty).
## Overview
```typ
#import "@preview/sigfig:0.1.0": round, urounds
#import "@preview/unify:0.5.0": num
$ #num(round(98654, 3)) $
$ #num(round(2.8977729e-3, 4)) $
$ #num(round(-.0999, 2)) $
$ #num(urounds(114514.19, 1.98)) $
$ #num(urounds(1234.5678, 0.096)) $
```
yields
<img src="https://github.com/typst/packages/assets/20166026/f3d69c3c-bc67-484f-81f9-80a10913fd11" width="240px">
## Documentation
### `round`
`round` is similar to JavaScript's `Number.prototype.toPrecision()` ([ES spec](https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-number.prototype.toprecision)).
```typ
#assert(round(114514, 3) == "1.15e5")
#assert(round(1, 5) == "1.0000")
#assert(round(12345, 10) == "12345.00000")
#assert(round(.00000002468, 3) == "2.47e-8")
```
Note that what is different from the ES spec is that there will be no sign ($+$) if the exponent after `e` is positive.
### `uround`
`uround` rounds a number with its uncertainty, and returns a string of both.
```typ
#assert(uround(114514, 1919) == "1.15e5+-2e3")
#assert(uround(114514.0, 1.9) == "114514+-2")
```
### `urounds`
`uround` rounds a number with its uncertainty, and returns a string of both with the same exponent, if any.
You can use `num` in `unify` to display the result.
## License
MIT © 2024 OverflowCat ([overflow.cat](https://about.overflow.cat)).
|
https://github.com/mrknorman/evolving_attention_thesis | https://raw.githubusercontent.com/mrknorman/evolving_attention_thesis/main/01_intro/01_introduction.typ | typst | #set page(numbering: "1", number-align: center)
#set heading(numbering: "1.1.1")
#counter(page).update(1)
#counter(heading).update(0)
#set math.equation(numbering: it => {[1.#it]})
#counter(math.equation).update(0)
#counter(figure).update(0)
= Introduction <intro-sec>
We live in an exciting time. Now dawns an age of remarkable confluence and innovation; machine learning and artificial intelligence stand poised to remake almost every aspect of science, technology, and everyday life. At the same time, our understanding of the world is increasing with ever more fervour. The era of gravitational-wave astronomy has well and truly begun, and bountiful volumes of new data will soon be at our fingertips. The machine learning community is unlocking novel new tools every month, and it would be a missed opportunity not to turn some of these powerful techniques onto the data hidden beneath interferometer noise.
This thesis is an exploration of the use of artificial neural networks to solve problems within gravitational-wave data analysis. Certainly, it is not the first work to attempt such a task, and indeed the intersection between the two fields has attracted much interest in recent years. Perhaps that is unsurprising --- both fields are new and exciting; it was only natural to try and merge the two. Despite this busy environment, we find that there is some room for innovation. Crucially, we try and work upward from first principles, and present our results in a manner that is easily comparable with other studies. The entirety of the codebase used in the creation of this thesis and all associated work is available here: #link("https://github.com/mrknorman/evolving_attention"), although, unfortunately, some of the data acquisition methods are gated behind LIGO-VIRGO-Kagra collaboration membership.
@gravitational-waves-sec and @machine-learning-sec, are introductory chapters that present background information in the areas of gravitational waves and machine learning respectively. They aim to both contextualize the data analysis methods presented throughout the rest of the thesis and, in the case of the machine learning chapter, introduce many of the analysis methods and nomenclature used throughout. @gravitational-waves-sec gives a brief introduction to gravitational wave science, but it is considered less necessary for the understanding of this thesis than the following chapter. @machine-learning-sec is a more rigorous examination of the basics of artificial neural networks, which form the backbone of this work.
@application-sec does not present any novel work but instead acts as a general methodology for the data analysis techniques used in later chapters. This chapter introduces the two pieces of custom software written to facilitate the faster iteration of machine learning model training: cuPhenom @cuphenom_ref a GPU implementation of IMRPhenomD @imrphenom_d, and GravyFlow, a custom data acquisition and model training pipeline designed for machine learning in gravitational wave science. In @application-sec we also review the relevant literature to explore the work others have contributed to the field. We perform a series of experiments to evaluate the performance of unspecialized artificial neural networks to show the necessity of experimentation. We conclude this chapter by recreating some prominent results from the literature, which act as a baseline for comparison in further chapters.
When designing artificial neural network models, there are a large number of free parameters that are not optimised during model training, these parameters are known as hyperparameters. They pose a significant barrier when attempting to find optimal deep-learning solutions for data analysis tasks. Often, hyperparameter optimization is performed by human-guided trial and error. This increases the already difficult task of comparisons between the performance of models presented in the literature. It is never clear how optimal the hyperparameter optimisation process has been. @dragonn-sec presents Dragonn. This original work consists of a hyperparameter optimisation method that utilises genetic algorithms to find optimal network solutions. In this chapter, we optimise the hyperparameters of a network designed to detect the gravitational wave emissions of a pair of binary black holes in the second before they merge. We show that genetic algorithms can be used to optimise network hyperparameters, however, due to time constraints, we do not arrive at any solutions that are better than the current standard. We do, however, observe that training efficiency can be improved by adding artificial glitches into the noise-only training examples. It is hypothesised that this "inoculation" method prevents the model from relying on excess power alone, and thus forces the model to examine signal shape. It is hoped that by exploring methods for automatic hyperparameter selection we might move a little toward a more robust and repeatable method for optimizing and comparing the performance of different model architectures. This work was used in the early development of the models that form the core of the MLy rapid burst detection pipeline @MLy.
@skywarp-sec is also original work. In this chapter, we explore the use of a more contemporary neural network architecture, the transformer @attention_is_all_you_need, which has found the most prominent use in natural language processing applications such as ChatGPT @chatgpt_ref. More precisely, we explore the use of the core innovations presented by the initial transformer paper @attention_is_all_you_need, the attention mechanism. We apply attention-based models to the binary black hole merger detection problem and find a marginal improvement over more widely used convolutional neural networks.
@crosswave-sec is the final piece of original work presented in this thesis. Here, we focus on a more specific problem that is currently not an issue but will become a major component of search pipelines when next-generation gravitational wave detectors come online. We explore the possibility that artificial neural networks can aid in the differentiation between single gravitational wave signals and pairs of overlapping gravitational wave signals. We also build a large network utilizing cross-attention layers in order to attempt to extract the parameters from both signals in an overlapping pair. We do this both to provide an established parameter estimation method with more information to improve its operation and as an exercise in its own right, potentially as a prelude to an entire machine-learning-based method to perform parameter estimation on overlapping signals. We find success in both tasks, with the smaller network able to match the classification performance of matched filtering when distinguishing between overlapping and single signals. The larger model was able to extract the merger times of each event in two overlapping binary signals with high accuracy, though the other parameter estimation tasks attempted were less successful.
Lastly, in @conclusion-sec, we summarise the key results of each chapter and discuss future steps that could yield further interesting results. |
|
https://github.com/ChristophVanDeest/FH-Kiel-Typst-Template | https://raw.githubusercontent.com/ChristophVanDeest/FH-Kiel-Typst-Template/main/templates/bachelor-thesis/lib.typ | typst | MIT License | // This file is redundant, but required by the Typst packaging system |
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/03-unicode/store/utf8.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/components.typ": note
#import "/lib/glossary.typ": tr
#show: web-page-template
// ### UTF-8
=== UTF-8
// But UTF-16 still uses *two whole bytes* for every ASCII and Western European Latin character, which sadly are the only characters that any programmers actually care about. So of course, that would never do.
但UTF-16依然会使用*整整两个字节*来表示所有的ASCII和西欧拉丁#tr[character]。没错,在这些几乎是程序处理中最常用和关心的#tr[character]上浪费空间是绝对不行的。
// UTF-8 takes the trade-off introduced by UTF-16 a little further: characters in the ASCII set are represented as single bytes, just as they were originally in ASCII, while code points above 127 are represented using a variable number of bytes: codepoints from `0x80` to `0x7FF` are two bytes, from `0x800` to `0xffff` are three bytes, and higher characters are four bytes.
UTF-8将UTF-16做出的妥协和权衡向前更进了一步:ASCII#tr[character]只使用一个字节表示,就像原本的ASCII码表一样。超过127的#tr[codepoint]使用可变数量的字节表示:`0x80`到`0x7FF`使用两个字节,`0x800`到`0xFFFF`用三个字节,更大的用四个字节。
// The conversion is best done by an existing computer program or library - you shouldn't have to do UTF-8 encoding by hand - but for reference, this is what you do. First, work out how many bytes the encoding is going to need, based on the Unicode code point. Then, convert the code point to binary, split it up and insert it into the pattern below, and pad with leading zeros:
你不需要手动进行UTF-8#tr[encoding],这个过程最好使用现成的程序或库来处理。不过为了提供参考,我们也简单介绍一下。首先,基于你想#tr[encoding]的#tr[character]的#tr[codepoint],根据上述的范围决定一共需要几个字节。然后将#tr[codepoint]转换为二进制并分为几段,插入下面的模板中(记得补0):
#align(
center,
table(
columns: 5,
align: (right,) + (center,) * 4,
[#tr[codepoint]],
[第一字节],
[第二字节],
[第三字节],
[第四字节],
[`0x00-0x7F`],
[`0xxxxxxx`],
[],
[],
[],
[`0x80-0x7FF`],
[`110xxxxx`],
[`10xxxxxx`],
[],
[],
[`0x800-0xFFFF`],
[`1110xxxx`],
[`10xxxxxx`],
[`10xxxxxx`],
[],
[`0x10000-0x10FFFF`],
[`11110xxx`],
[`10xxxxxx`],
[`10xxxxxx`],
[`10xxxxxx`],
),
)
// > Originally UTF-8 allowed sequences up to seven bytes long to encode characters all the way up to `0x7FFFFFFF`, but this was restricted when UTF-8 became an Internet standard to match the range of UTF-16. Once we need to encode more than a million characters in Unicode, UTF-8 will be insufficient. However, we are still some way away from that situation.
#note[
最初的UTF-8允许用最长7个字节的序列来#tr[encoding]直到`0x7FFFFFFF`的#tr[character],但这一点在UTF-8成为互联网标准时,为了和UTF-16的范围保持一致而被限制了。一旦我们在Unicode中容纳的#tr[character]超过百万个之后,UTF-8就不能胜任了。但还好,这一情况离我们还比较远。
]
// FATHER CHRISTMAS is going to take four bytes, because he is above `0x10000`. The binary representation of his codepoint U+1F385 is `11111001110000101`, so, inserting his bits into the pattern from the right, we get:
圣诞老人#tr[character]用UTF-8#tr[encoding]需要四个字节,因为它比`0x10000`大。其#tr[codepoint]`U+1F385`的二进制表示为`11111001110000101`。将这些比特(从右往左)插入上述模板,我们得到:
#align(
center,
table(
columns: 5,
align: (right,) + (center,) * 4,
[`0x10000-0x10FFFF`],
[`11110xxx`],
[`10x`*`11111`*],
[`10`*`001110`*],
[`10`*`000101`*],
),
)
最后,将未填充的`x`补上0,得到:
#align(
center,
table(
columns: 4,
align: center,
[`11110`*`000`*],
[`10`*`011111`*],
[`10`*`001110`*],
[`10`*`000101`*],
[`F0`],
[`9F`],
[`8E`],
[`85`],
),
)
// UTF-8 is not a bad trade-off. It's variable width, which means more work to process, but the benefit of that is efficiency - characters don't take up any more bytes than they need to. And the processing work is mitigated by the fact that the initial byte signals how long the byte sequence is. The leading bytes of the sequence also provide an unambiguous synchronisation point for processing software - if you don't recognise where you are inside a byte stream, just back up a maximum of four characters until you see a byte starting `0`, `110`, `1110` or `11110` and go from there.
UTF-8所做的权衡其实并不差。它是变宽的,这也就意味着处理它更麻烦。但好处是它的空间利用非常高效:#tr[character]实际使用的字节数永远不会比它实际需要的更多。设计中的一个小巧思也减轻了处理负担,那就是从首个字节中就能知道这个字节序列有多长。而且首字节的这种特性也提供了软件处理过程中所需的清晰的同步位置。比如当程序不知道目前所处的是序列中的第几个字节时,它只需要简单的往后看最多四个字节,只要发现某个字节由`0`、`110`、`1110`或`11110`开头,就能够从这里继续往下处理了。
// Because of this, UTF-8 has become the *de facto* encoding standard of the Internet, with around 90% of web pages using it. If you have data that you're going to be shaping with an OpenType shaping engine, it's most likely going to begin in UTF-8 before being transformed to UTF-32 internally.
由于上述原因,UTF-8成为了互联网上文本#tr[encoding]的*事实标准*,大约90%的网页都使用它。如果你的数据需要被OpenType#tr[shaping]引擎处理的话,很可能它需要是UTF-8#tr[encoding]的,引擎的内部流程会将它转化为UTF-32处理。
|
https://github.com/CHHC-L/JI-Lab-Report-Typst | https://raw.githubusercontent.com/CHHC-L/JI-Lab-Report-Typst/master/example.typ | typst | #import "template.typ": *
#show: project.with(
course: "Signals and Systems",
code:"VE216",
lab:3,
title: "Feedback Control",
authors: (
(name: "Waibi", affiliation: "12345678"),
(name: "Babu", affiliation: "87654321"),
(name: "<NAME>", affiliation: "42424242"),
),
date: "April 2024",
)
= Objectives
- Understand feedback control
= Theoretical Background
== A Closed-Loop Feedback Model
#lorem(20)
== Closed-Loop Transfer Function
#lorem(20)
To calculate $G_"cl" (s)$:
$
Y(s) &= E(s)C(s)P(s) \
E(s) &= X(s)-H(s)Y(s) \
G_"cl" (s) &= Y(s)/X(s) = (C(s)P(s))/(1+C(s)P(s)H(s)) \
E(s) / X(s) &= 1/(1+C(s)P(s)H(s))
$
= Experimental Procedures
== Open-Loop System
#lorem(20)
== Feedback Control
#lorem(20)
= Experimental Results
== Open-Loop System
#lorem(20)
== Feedback Control
#lorem(20)
= Error Analysis and Discussion
#lorem(20)
= Conclusion
#lorem(20)
= Reference
- Lab+3+Manual2024.pdf, UM-SJTU Joint Institute, 2024. |
|
https://github.com/cmoog/tex2typst | https://raw.githubusercontent.com/cmoog/tex2typst/master/README.md | markdown | MIT License | # tex2typst
> Work in progress. Does not yet support all builtin identifiers or layouts.
The goal is to generate high quality conversions with a complete focus on the math subset of each language.
Convert TeX Math to [Typst](https://github.com/typst/typst) Math.
## Build from source
```console
nix build
./result/bin/tex2typst < example.tex
frac(1, 123)
```
|
https://github.com/goshakowska/Typstdiff | https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_working_types/code/code_updated.typ | typst | `print("updated line")`
`print("second line")` |
|
https://github.com/Ttajika/typst_template_tajika | https://raw.githubusercontent.com/Ttajika/typst_template_tajika/main/libs/useful_functions.typ | typst | #import "translation.typ": *
#let cap_body(it) = {if it != none {return it.body}
else {return it}
}
#let inactive_versions(name_varsion) = {
let name_version(title: none, label:none, body) = {
}
}
//autonumbering equations
#let tjk_numb_style(tag,tlabel,name,numbering:"(1)") = {
if tag == true or name != none {
if name == none{
return it => "("+str(tlabel)+")"}
else {return it => "("+str(name)+")"}
}
else {
return numbering
}
}
#let tell_labels(it) ={
if type(it) == "label"{return it}
else {return label(str(it))}
}
#let auto-numbering-equation(tlabel, name:none, tag:false,numbering:"(1)", body) ={
locate(loc =>{
let eql = counter("tjk_auto-numbering-eq" + str(tlabel))
if eql.final(loc).at(0) == 1{
[#math.equation(numbering: tjk_numb_style(tag,tlabel,name,numbering:numbering),block: true)[#body]#tell_labels(tlabel)]
if tag == true{counter(math.equation).update(i => i - 1)}
}
else {
[#math.equation(numbering:none,block: true)[#body] ]
}
})
}
//shorthand
#let aeq = auto-numbering-equation
#let heading_supplement(it, supplement,thenumber,lang:"en") ={
if lang == "jp" and supplement in trans.at("jp").keys() {
return thenumber + trans.at("jp").at(supplement)
}
else {return it}
}
#let eq_refstyle(it,lang:"en") = {
return {
let lbl = it.target
let eq = math.equation
let el = it.element
let eql = counter("tjk_auto-numbering-eq"+str(lbl))
eql.update(1)
if el != none and el.func() == eq {
link(lbl)[
#numbering(
el.numbering,
..counter(eq).at(el.location())
) ]
} else if el != none and el.has("counter") {
let c_eq = el.counter
if el.supplement.text in trans.at(lang).keys(){
link(lbl)[
#trans.at(lang).at(el.supplement.text) #numbering(
el.numbering,
..c_eq.at(el.location())
)]
} else {it}
} else if el != none and el.func() == heading {
let thenumber = numbering(
el.numbering,
..counter(heading).at(el.location())
)
link(lbl)[#heading_supplement(it, it.element.supplement.text, thenumber,lang:lang)
]
}
else {it}
}
}
#let plurals(single,dict) ={
if single in dict.keys() {
return dict.at(single)
}else {return single}
}
#let refs(..sink,dict:plurals_dic,add:" and ",comma:", ") = {
let args = sink.pos()
let numargs = args.len()
let current_titles = ()
let titles_dic = (:)
if numargs == 1 {link(ref(args.at(0)).target)[#ref(args.at(0))]}
else {
show ref: it => plurals(it.element.supplement.text,dict)
ref(args.at(0)) + " "
show ref: it => {
let c_eq = it.element.counter
numbering(it.element.numbering,
..c_eq.at(it.element.location()))
}
if numargs == 2{link(ref(args.at(0)).target)[#ref(args.at(0))] + ""+ add +"" + link(ref(args.at(1)).target)[#ref(args.at(1))]}
else{
for i in range(numargs){
if i< numargs - 1 {link(ref(args.at(i)).target)[#ref(args.at(i))] + comma+"" }
else {add+"" + link(ref(args.at(i)).target)[#ref(args.at(i))]}
}}
}
}
#let counter_body(num) = {if num != none {return num.counter}
else {return num}}
//定理環境の基本設定:より高度な設定はLemmifyを用いる
#let my_thm_style(
thm-type, name, number, body
) = block(width: 100%, breakable: true)[#{
strong(thm-type) + " "
if number != none {
strong(number)
}
if name == none {"."}
if name != none {
" "+ [(#name).] + " "
}
" " + emph(body)
}]
#let my_defi_style(
thm-type, name, number, body
) = block(width: 100%, breakable: true)[#{
strong(thm-type) + " "
if number != none {
strong(number)
}
if name == none {"."}
if name != none {
" "+ [(#name).] + " "
}
" " + body
}]
#let my_proof_style(
thm-type, name, number, body, lang
) = block(width: 100%, breakable: true)[#{
if name == none {strong(trans.at(lang).at("Proof")) +"."}
if name != none {
[#strong[#proofname(name,lang)]] + " "
}
" " + body + [#h(1fr) #QERmark(lang)]}]
#let theorem_base(thm_style, kind, supplement) ={
return{ (name:none, numbering:numbering,content) => figure(
content,
caption: name,
kind: kind,
supplement: supplement
) }
}
#let trans_thm(str,lang) = {
if lang == "jp" {
return theorem_jp.at(str)
}
else {return str}
}
#let theorem_create(tlabel) = {
return{theorem_base(my_thm_style, tlabel, tlabel)
}
}
#let theorem = theorem_create("Theorem")
#let prop = theorem_create("Proposition")
#let lemma = theorem_create("Lemma")
#let rem = theorem_create("Remark")
#let cor = theorem_create("Corollary")
#let claim = theorem_create("Claim")
#let fact = theorem_create("Fact")
#let defi = theorem_create("Definition")
#let assump = theorem_create("Assumption")
#let ex = theorem_create("Example")
#let proof = theorem_create("Proof")
#let theo_list = ("Theorem","Proposition","Lemma","Remark","Corollary","Claim","Fact")
#let defi_list = ("Definition","Assumption","Example")
#let others_list = ("Table","Figure")
#let content_remove_br(cont) = {
if cont.has("body"){
let valuecon = cont.body.at("children")
let val_num = valuecon.len()
let value = ""
for i in range(1,val_num - 1 ) {
value = value + valuecon.at(i)
}
return value
}
else {
return cont
}
}
//conditional probability; different from phisyca Pr
#let Pro(..sink) = {
let args = sink.pos()
let event = content_remove_br(args.at(0))
if args.len() <= 1 {
$op("Pr")(event)$
}
else {
let condition = content_remove_br(args.at(1))
$op("Pr")(event mid(|) condition)$
}
}
#let argmax = $op("arg max", limits: #true)$
#let argmin = $op("arg min", limits: #true)$
#let cdot = $dot.c$
#let cdots = $dots.c$
//2player Normal form game
#let Ngame(players,strategies,payoffs,caption:none) = {
let glist = ()
let g_list = strategies.at(1)
g_list.insert(0,"")
glist.push(g_list)
for i in range(strategies.at(0).len()){
let g_list = payoffs.at(i)
g_list.insert(0,strategies.at(0).at(i))
glist.push(g_list)
}
return {
table(columns: strategies.at(1).len()+2,
align: center + horizon,
stroke: (x,y) => (
top: if y ==2 {1pt} else {0pt},
left: if x==2 {1pt} else {0pt}
),
[], table.cell(colspan: strategies.at(1).len()+1, players.at(1)),
table.cell(rowspan: (strategies.at(0).len()+1), players.at(0)),
..glist.flatten()
) }
}
//Date functions
#let Today(style:"mdy-en") = {
let y = datetime.today().year()
let m = datetime.today().month()
let d = datetime.today().day()
if style == "ymd-en" {
return str(y)+" "+tjk_month_name.en.at(str(m))+" "+str(d)}
if style == "mdy-en" {
return tjk_month_name.en.at(str(m))+" "+str(d)+", "+str(y)}
if style == "mdy-en-abr" {
return tjk_month_name.en-abr.at(str(m))+" "+str(d)+", "+str(y)}
if style == "ymd-jp" {
return str(y)+"年"+ str(m)+"月"+str(d)+"日"}
if style == "ymd-jp-nengou" {
return tjk_wareki(y)+"年"+str(m)+"月"+str(d)+"日"}
if style == "ymd-jp-wareki" {
return tjk_wareki(y)+"年 "+tjk_month_name.jp.at(str(m))+str(d)+"日"}
}
#let abstract_name = ("en": [#smallcaps[Abstract]], "jp":"概要") |
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/footnote-columns_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
#set page(height: 120pt)
#align(center, strong[Title])
#show: columns.with(2)
#lorem(3) #footnote(lorem(6))
Hello there #footnote(lorem(2))
|
https://github.com/Skimmeroni/Appunti | https://raw.githubusercontent.com/Skimmeroni/Appunti/main/Metodi%20Algebrici/Crittografia/Introduzione.typ | typst | Creative Commons Zero v1.0 Universal | #import "../Metodi_defs.typ": *
Si consideri una situazione in cui si vuole inviare un messaggio
opportunamente "occultato" di modo che solamente i destinatari
intesi a riceverlo siano in grado di rimuovere l'occultamento e
poter leggere il messaggio. Ovvero, non si ha interesse ad impedire
a terze parti di poter trovare il messaggio, ma di fare in modo che,
anche se terze parti possano intercettarlo, non siano in grado di
rimuovere l'occultamento.
Il messaggio originale che si vuole mandare prende il nome di *messaggio
in chiaro*, mentre il messaggio opportunamente occultato prende il nome
di *messaggio cifrato*. Le due versioni del messaggio sono scritte adoperando
i *caratteri* di un certo *alfabeto* (in genere, il medesimo) di dimensione
$N$. Il processo che consiste nel convertire un messaggio in chiaro in un
messaggio cifrato prende il nome di *cifratura* o *crittazione*; il processo
inverso, ovvero il convertire un messaggio cifrato in un messaggio in chiaro,
prende il nome di *decifratura* o *decrittazione*.
Affinché sia possibile manipolarli, il messaggio in chiaro ed il messaggio
cifrato devono essere scomposti in elementi atomici, trattabili uno per
uno, detti *unitá*. Una unitá puó corrispondere ad un singolo carattere
dell'alfabeto su cui i messaggi sono definiti cosí come ad una $k$-upla
di caratteri.
Dovendo poi operare matematicamente su tali unitá per ottenere la cifratura,
é necessario tradurre tali caratteri sotto forma di numero. In genere, questo
viene fatto determinando un intervallo di numeri interi ed associando ciascuna
unitá ad uno di questi numeri interi. Tale associazione deve essere biunivoca,
e non é nemmeno necessario nascondere a terze parti la regola che permette
tale traduzione.
#example[
Si voglia spedire il messaggio `A, M, O, G, U, S`. Tale messaggio é
scritto nell'alfabeto inglese, avente $N = 26$ caratteri (gli spazi
e le virgole non sono parte del messaggio, sono presenti solo per
chiarezza).
Si assuma che la conversione fra carattere e numero venga fatta
associando a ciascun $i$-esimo carattere l'$i$-esimo numero intero
nell'intervallo ${0, ..., 26}$, modulo $26$. Pertanto, la dimensione
delle unitá dei messaggi é pari ad $1$. Il messaggio scritto in forma
di numero é quindi
$ [1]_(26), [13]_(26), [15]_(26), [7]_(26), [21]_(26), [18]_(26) $
] <Amogus-as-numbers>
L'operazione di cifratura puó quindi essere vista come una funzione che
ha in input una unitá del messaggio in chiaro scritta sotto forma di numero
e restituisce una unitá di messaggio cifrato scritta sotto forma di numero.
L'operazione di decifratura é la funzione inversa della funzione di cifratura,
che ha in input una unitá del messaggio cifrato e restituisce una unitá del
messaggio in chiaro. La funzione di cifratura deve essere biunivoca, ovvero
ad una unitá di messaggio in chiaro (scritta come numero) deve venire associata
una ed una sola unitá di messaggio cifrato (scritta come numero), perché
altrimenti non sarebbe possibile costruire la funzione di decifratura (essendo
la sua inversa).
Un sistema cosí formulato prende il nome di *sistema crittografico*, e puó
essere schematicamente rappresentato come:
$ cal(P) attach(-->, t: f) cal(C) attach(-->, t: f^(-1)) cal(P) $
- $cal(P)$ é l'insieme di tutte le possibili unitá che costituiscono i
messaggi in chiaro, scritte come numero;
- $cal(C)$ é l'insieme di tutte le possibili unitá che costituiscono i
messaggi cifrati, scritte come numero;
- $f$ é la funzione di cifratura;
- $f^(-1)$ é la funzione di decifratura (inversa di $f$).
#example[
#set math.mat(column-gap: 3.5em, delim: none)
Si consideri un sistema crittografico cosí costruito (é facile
verificare che le funzioni di cifratura e decifratura sono
effettivamente l'una l'inversa dell'altra):
$ mat(
cal(P) = ZZ_(N),
cal(C) = ZZ_(N),
f(p) = [5]_(26) p + [3]_(26),
f^(-1) (c) = [21]_(26) c - [11]_(26);
) $
Si consideri il messaggio del @Amogus-as-numbers, scritto come
numeri interi modulo $26$. La cifratura fornisce:
$ mat(
f([1]_(26)) = [1]_(26) dot [5]_(26) + [3]_(26) = [8]_(26),
f([13]_(26)) = [13]_(26) dot [5]_(26) + [3]_(26) = [16]_(26);
f([15]_(26)) = [15]_(26) dot [5]_(26) + [3]_(26) = [0]_(26),
f([7]_(26)) = [7]_(26) dot [5]_(26) + [3]_(26) = [12]_(26);
f([21]_(26)) = [21]_(26) dot [5]_(26) + [3]_(26) = [4]_(26),
f([18]_(26)) = [18]_(26) dot [5]_(26) + [3]_(26) = [15]_(26);
) $
Mentre la decifratura fornisce:
$ mat(
f^(-1)([8]_(26)) = [21]_(26) dot [8]_(26) - [11]_(26) = [1]_(26),
f^(-1)([16]_(26)) = [21]_(26) dot [16]_(26) - [11]_(26) = [13]_(26);
f^(-1)([0]_(26)) = [21]_(26) dot [0]_(26) - [11]_(26) = [15]_(26),
f^(-1)([12]_(26)) = [21]_(26) dot [12]_(26) - [11]_(26) = [7]_(26);
f^(-1)([4]_(26)) = [21]_(26) dot [4]_(26) - [11]_(26) = [21]_(26),
f^(-1)([15]_(26)) = [21]_(26) dot [15]_(26) - [11]_(26) = [18]_(26);
) $
Effettivamente, i due messaggi coincidono.
] <Amogus-crypto>
In genere, quando ci si riferisce ad un sistema crittografico ci si riferisce
ad una _famiglia_ di sistemi, che hanno in comune la struttura delle funzioni
$f$ e $f^(-1)$ e degli insiemi $cal(P)$ e $cal(C)$ ma differiscono fra di loro
per la scelta di determinati parametri. I valori dei parametri della funzione
$f$ prendono il nome di *chiave di cifratura*, mentre i valori dei parametri
della funzione $f^(-1)$ prendono il nome di *chiave di decifratura*.
#example[
Il sistema crittografico dell'esempio @Amogus-crypto puó essere
visto come un membro di una famiglia piú ampia di sistemi crittografici,
che hanno questa forma:
#set math.mat(column-gap: 1.5em, delim: none)
$ mat(
cal(P) = ZZ_(N),
cal(C) = ZZ_(N),
f(p) = a p + b,
f^(-1) (c) = a^(-1) c - a^(-1) b,
"con" a\, b in ZZ_(n) " e " a "invertibile";
) $
Dove tutti i sistemi crittografici di tale famiglia hanno gli
stessi insiemi $cal(P)$ e $cal(C)$, ma la scelta delle funzioni
di cifratura e di decifratura dipendono dalla coppia di parametri
$(a, b)$. Nel caso particolare dell'@Amogus-crypto, la chiave di
cifratura é $([5]_(26), [3]_(26))$, mentre la chiave di decifratura
é $([21]_(26), [11]_(26))$.
] <Amogus-crypto-system>
Di fatto, non é necessario che a terze parti sia nascosto il sistema
crittografico che viene usato per cifrare un messaggio, ma é sufficiente
che siano le chiavi ad esserlo. Questo perché fintanto che le chiavi di
cifratura e di decifratura non sono note, le sole funzioni di cifratura
e di decifratura non sono sufficienti a cifrare/decifrare un messaggio.
Essendo la funzione di cifratura e di decifratura l'una l'inversa
dell'altra, se la chiave di cifratura viene scoperta, diventa possibile
ricostruire la chiave di decifratura, e viceversa. Questo richiede che
entrambe le chiavi siano note solo ed esclusivamente alle entitá che si
scambiano i messaggi, perché se terze parti riescono ad ottenere l'una
possono facilmente determinare l'altra. I sistemi di crittografia che
adottano questo approccio prendono il nome di *crittografia a chiave
privata*, anche detta *crittografia simmetrica*.
#example[
Si consideri l'@Amogus-crypto-system. Anche se fosse noto il sistema
di cifratura, senza almeno una delle due chiavi non é possibile conoscere
la vera forma delle due funzioni. Si supponga peró di venire a conoscenza
che la chiave di cifratura sia $([7]_(26), [11]_(26))$; diventa allora
possibile determinare la chiave di decifratura (e quindi la vera forma
della funzione di decifratura) con pochi passi:
$ f^(-1) (c) = a^(-1) c - a^(-1) b =>
f^(-1) (c) = ([7]_(26))^(-1) c - ([7]_(26))^(-1) [11]_(26) =>
f^(-1) (c) = [15]_(26) c - [9]_(26) $
]
Nella *crittografia a chiave pubblica*, anche detta *crittografia
asimmetrica*, é invece possibile rendere nota la chiave di cifratura
senza che questo comporti che si possa usarla per ricavare la chiave
di decifratura. Questo perché la funzione di cifratura viene appositamente
scelta di modo che, anche ammesso di conoscere la chiave di cifratura,
calcolare la chiave di decifratura a partire da questa richieda una
computazione troppo lunga per essere ragionevole.
Funzioni per le quali é semplice valutarle nel loro input ma che é proibitivo
calcolarne l'inversa sono dette *one-way function*. La nozione di one-way
function non é rigorosa dal punto di vista matematico, dato che il tempo
necessario per calcolare la funzione inversa di una funzione dipende anche
dalla tecnologia attualmente a disposizione. In parole povere, un incremento
nella potenza dei calcolatori puó rendere funzioni un tempo considerate
one-way function delle funzioni "comuni".
Sarebbe tecnicamente possibile provare matematicamente che il calcolo
dell'inversa di una certa funzione sia un problema non risolvibile in
tempo polinomiale. In questo modo, non importa la potenza dei calcolatori,
tale computazione sará sempre e comunque improponibile (se non per piccole
istanze). É peró interessante notare come non esista alcuna prova matematica
che il calcolo di funzioni inverse per funzioni di cifratura comunemente
utilizzabili sia un problema intrattabile.
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/aero-check/0.1.0/README.md | markdown | Apache License 2.0 | # aero-check
This template is meant to create checklists with a style inspired by aviation checklists.
It includes 2 different styles!
## Usage
Start your checklist with the following code:
```typst
#import "@preview/aero-check:0.1.0": *
#show: checklist.with(
title: "Title",
// disclaimer: "",
// 0 or 1
// style: 0,
)
```
You can then add items to your checklist with the following code:
```typst
#topic("Topic")[
#section("Section")[
#step("Step", "Check")
#step("Step", "Check")
#step("Step", "Check")
#step("Step", "Check")
]
#section("Section")[
#step("Step", "Check")
#step("Step", "Check")
#step("Step", "Check")
#step("Step", "Check")
]
]
```
And you can use `#colbreak()` to add a column break.
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-10140.typ | typst | Apache License 2.0 | #let data = (
("GREEK ACROPHONIC ATTIC ONE QUARTER", "Nl", 0),
("GREEK ACROPHONIC ATTIC ONE HALF", "Nl", 0),
("GREEK ACROPHONIC ATTIC ONE DRACHMA", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIFTY", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE THOUSAND", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIFTY THOUSAND", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE TALENTS", "Nl", 0),
("GREEK ACROPHONIC ATTIC TEN TALENTS", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIFTY TALENTS", "Nl", 0),
("GREEK ACROPHONIC ATTIC ONE HUNDRED TALENTS", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE HUNDRED TALENTS", "Nl", 0),
("GREEK ACROPHONIC ATTIC ONE THOUSAND TALENTS", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE THOUSAND TALENTS", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC TEN STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIFTY STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC ONE HUNDRED STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIVE HUNDRED STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC ONE THOUSAND STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC TEN THOUSAND STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC FIFTY THOUSAND STATERS", "Nl", 0),
("GREEK ACROPHONIC ATTIC TEN MNAS", "Nl", 0),
("GREEK ACROPHONIC HERAEUM ONE PLETHRON", "Nl", 0),
("GREEK ACROPHONIC THESPIAN ONE", "Nl", 0),
("GREEK ACROPHONIC HERMIONIAN ONE", "Nl", 0),
("GREEK ACROPHONIC EPIDAUREAN TWO", "Nl", 0),
("GREEK ACROPHONIC THESPIAN TWO", "Nl", 0),
("GREEK ACROPHONIC CYRENAIC TWO DRACHMAS", "Nl", 0),
("GREEK ACROPHONIC EPIDAUREAN TWO DRACHMAS", "Nl", 0),
("GREEK ACROPHONIC TROEZENIAN FIVE", "Nl", 0),
("GREEK ACROPHONIC TROEZENIAN TEN", "Nl", 0),
("GREEK ACROPHONIC TROEZENIAN TEN ALTERNATE FORM", "Nl", 0),
("GREEK ACROPHONIC HERMIONIAN TEN", "Nl", 0),
("GREEK ACROPHONIC MESSENIAN TEN", "Nl", 0),
("GREEK ACROPHONIC THESPIAN TEN", "Nl", 0),
("GREEK ACROPHONIC THESPIAN THIRTY", "Nl", 0),
("GREEK ACROPHONIC TROEZENIAN FIFTY", "Nl", 0),
("GREEK ACROPHONIC TROEZENIAN FIFTY ALTERNATE FORM", "Nl", 0),
("GREEK ACROPHONIC HERMIONIAN FIFTY", "Nl", 0),
("GREEK ACROPHONIC THESPIAN FIFTY", "Nl", 0),
("GREEK ACROPHONIC THESPIAN ONE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC THESPIAN THREE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC EPIDAUREAN FIVE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC TROEZENIAN FIVE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC THESPIAN FIVE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC CARYSTIAN FIVE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC NAXIAN FIVE HUNDRED", "Nl", 0),
("GREEK ACROPHONIC THESPIAN ONE THOUSAND", "Nl", 0),
("GREEK ACROPHONIC THESPIAN FIVE THOUSAND", "Nl", 0),
("GREEK ACROPHONIC DELPHIC FIVE MNAS", "Nl", 0),
("GREEK ACROPHONIC STRATIAN FIFTY MNAS", "Nl", 0),
("GREEK ONE HALF SIGN", "No", 0),
("GREEK ONE HALF SIGN ALTERNATE FORM", "No", 0),
("GREEK TWO THIRDS SIGN", "No", 0),
("GREEK THREE QUARTERS SIGN", "No", 0),
("GREEK YEAR SIGN", "So", 0),
("GREEK TALENT SIGN", "So", 0),
("GREEK DRACHMA SIGN", "So", 0),
("GREEK OBOL SIGN", "So", 0),
("GREEK TWO OBOLS SIGN", "So", 0),
("GREEK THREE OBOLS SIGN", "So", 0),
("GREEK FOUR OBOLS SIGN", "So", 0),
("GREEK FIVE OBOLS SIGN", "So", 0),
("GREEK METRETES SIGN", "So", 0),
("GREEK KYATHOS BASE SIGN", "So", 0),
("GREEK LITRA SIGN", "So", 0),
("GREEK OUNKIA SIGN", "So", 0),
("GREEK XESTES SIGN", "So", 0),
("GREEK ARTABE SIGN", "So", 0),
("GREEK AROURA SIGN", "So", 0),
("GREEK GRAMMA SIGN", "So", 0),
("GREEK TRYBLION BASE SIGN", "So", 0),
("GREEK ZERO SIGN", "No", 0),
("GREEK ONE QUARTER SIGN", "No", 0),
("GREEK SINUSOID SIGN", "So", 0),
("GREEK INDICTION SIGN", "So", 0),
("NOMISMA SIGN", "So", 0),
)
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CU/oktoich/1_generated/0_all/Hlas8.typ | typst | #import "../../../all.typ": *
#show: book
= #translation.at("HLAS") 8
#include "../Hlas8/0_Nedela.typ"
#pagebreak()
#include "../Hlas8/1_Pondelok.typ"
#pagebreak()
#include "../Hlas8/2_Utorok.typ"
#pagebreak()
#include "../Hlas8/3_Streda.typ"
#pagebreak()
#include "../Hlas8/4_Stvrtok.typ"
#pagebreak()
#include "../Hlas8/5_Piatok.typ"
#pagebreak()
#include "../Hlas8/6_Sobota.typ"
#pagebreak()
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/georges-yetyp/0.1.0/lib.typ | typst | Apache License 2.0 | #let rapport(
nom: none,
entreprise: (
nom: none,
adresse: none,
téléphone: none,
logo: none,
),
filière: "INFO",
année: 5,
titre: none,
référent: none,
responsable: none,
tuteur: none,
période: [25 Mars 2024 -- 25 Août 2024],
résumé: none,
fonte: "New Computer Modern",
glossaire: none,
lang: "fr",
body
) = {
set text(lang: lang, font: fonte, size: 12pt)
set par(justify: true, leading: 0.8em)
set heading(numbering: "I.1 -")
show heading: block.with(spacing: 1.5em)
if nom == none {
panic("`nom` doit être une chaîne de caractère (avec votre nom et prénom)")
}
if titre == none {
panic("`titre` doit être une chaîne de caractère (avec le titre du rapport)")
}
if type(entreprise) != dictionary {
panic("`entreprise` doit être un dictionnaire contenant `nom`, `adresse` et éventuellemenent `téléphone` et `logo`")
}
if entreprise.nom == none {
panic("`entreprise.nom` doit être une chaîne de caractères ou un bloc de contenu")
}
let entreprise-text-info = align(horizon + right, {
text(size: 14pt, entreprise.nom)
linebreak()
entreprise.adresse
})
let entreprise-info = if "logo" in entreprise and entreprise.logo != none {
(
align(
right + horizon,
entreprise.logo
),
[],
entreprise-text-info
)
} else {
(entreprise-text-info,)
}
grid(
columns: (1fr, 1fr),
column-gutter: 5em,
row-gutter: 1em,
align(horizon, image("logo-polytech.png")),
..entreprise-info
)
v(1fr)
align(center, [
#set text(size: 16pt)
#nom \
#filière \
Rapport de stage de #année#super[ème] année
#v(1fr)
#smallcaps(text(size: 20pt, titre))
#v(1fr)
Tome principal \ & \ Annexes
#v(1fr)
#let year = datetime.today().year()
Année universitaire #{year - 1}--#{year} \
#période
])
pagebreak()
{
set page(header: context {
let headings-after = query(
selector(heading.where(outlined: true)).after(here())
)
let heading = if headings-after.len() == 0 {
query(
selector(heading.where(outlined: true)).before(here())
).last()
} else {
headings-after.first()
}
grid(
columns: (1fr, auto),
emph(titre),
emph(heading.body)
)
}, numbering: "1")
show figure: it => align(center, block(spacing: 3em, it))
show raw.where(block: true): it => {
set text(font: "Fira Code")
block(
width: 110%,
stroke: 1pt + gray,
radius: 0.2em,
inset: (y: 1em, x: 5%),
align(left, it)
)
}
{
set page(header: none)
v(1fr)
align(center, heading(outlined: false, numbering: none, [Résumé]))
align(center, block(width: 80%, align(left, résumé)))
v(1fr)
pagebreak()
outline(indent: auto)
}
body
pagebreak()
set page(header: none)
heading(numbering: none, outlined: false, [Annexes])
if glossaire != none {
heading(numbering: none, outlined: false, level: 2, [Glossaire])
glossaire
}
heading(numbering: none, outlined: false, level: 2, [Table des figures])
outline(target: figure, title: none)
}
pagebreak()
show strong: it => text(size: 10pt, [#it \ ])
set table.cell(colspan: 2)
table(
columns: (1fr, 1fr),
gutter: 1em,
stroke: none,
table.cell(colspan: 1, [*Étudiant⋅e* #nom]),
table.cell(colspan: 1, align(right, [*Année d'étude dans la spécialité* #année#super[ème] année])),
[
*Entreprise* #entreprise.nom \
*Adresse* #entreprise.adresse \
#if "téléphone" in entreprise [
*Téléphone* #entreprise.téléphone
]
],
[
*Responsable administratif⋅ve* #responsable.nom, #responsable.fonction \
#responsable.téléphone \
#responsable.email
],
[
*Tuteur⋅ice de stage* #tuteur.nom \
#tuteur.téléphone \
#tuteur.email
],
[
*Enseignant⋅e référent⋅e* #référent.nom \
#référent.téléphone \
#référent.email
],
[*Titre* #titre],
[*Résumé* #résumé]
)
}
|
https://github.com/Caellian/UNIRI_voxels_doc | https://raw.githubusercontent.com/Caellian/UNIRI_voxels_doc/trunk/content/generiranje.typ | typst | = Proceduralno generiranje <pcg>
Proceduralno generiranje volumetrijskih podataka je idealno za aplikacije koje se ne koriste stvarnim podacima jer se oslanja na dobre karakteristike definicije putem pravila, a izbjegava nedostatak velikih prostornih zahtjeva na uređajima za trajnu pohranu.
#pagebreak()
|
|
https://github.com/hei-templates/hevs-typsttemplate-thesis | https://raw.githubusercontent.com/hei-templates/hevs-typsttemplate-thesis/main/02-main/02-introduction.typ | typst | MIT License | #import "../00-templates/helpers.typ": *
#pagebreak()
= Introduction <sec:intro>
== Context Problem
#acrfull(acr-ar)
#gls-scrum.name
#gls-scrum.description
#cite(<stateoftheArt>)
#cite(<stateoftheArt>, supplement:[p.7ff])
```rust
fn main() {}
```
#lorem(50)
== Objectives
#lorem(50)
== Structure of this report
#lorem(50) |
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/3_PB/VerbaliEsterni/VerbaleEsterno_240402/content.typ | typst | MIT License | #import "meta.typ": inizio_incontro, fine_incontro, luogo_incontro, company
#import "functions.typ": glossary, team
#let participants = csv("participants.csv")
#let participants_company = csv("participants_company.csv")
#show link: underline
= Partecipanti
/ Inizio incontro: #inizio_incontro
/ Fine incontro: #fine_incontro
/ Luogo incontro: #luogo_incontro
== Partecipanti di #team
#table(
columns: (3fr, 1fr),
[*Nome*], [*Durata presenza*],
..participants.flatten()
)
== Partecipanti di #emph[#company]
#for member in participants_company.flatten() [
- #member
]
= Sintesi Elaborazione Incontro
== Presentazione prodotto software
L'incontro si è aperto con la presentazione del prodotto software da parte del team. Il prodotto, nella sua Release 2.0, è stato presentato esponendo le dashboard sviluppate, ovvero "Ambientale", "Urbanistica", "Dati grezzi" e "Superamento Soglie"; la presentazione ha esposto le funzionalità di ciascuna dashboard e le modalità di utilizzo, concentrandosi in particolare sulle novità introdotte rispetto a quanto presentato alla Proponente nell'incontro precedente. Le novità includevano, in particolare, il miglioramento dell'aspetto visuale delle dashboard, il completamento dei pannelli, l'introduzione del sistema di notifica tramite Discord e l'intera dashboard "Superamento Soglie". I referenti della Proponente hanno espresso apprezzamento per i miglioramenti apportati e hanno valutato positivamente l'impegno del team nella realizzazione della simulazione dei dati in modo realistico e variegato in base al tipo.
#pagebreak()
== Validazione MVP
La Proponente ha espresso piena soddisfazione per il lavoro svolto e attesta che il prodotto soddisfa la definizione di MVP (Regolamento progetto didattico: #link("https://www.math.unipd.it/~tullio/IS-1/2023/Dispense/PD2.pdf")).
== Conclusione
L'incontro si è concluso con lo scambio di feedback tra il team e la Proponente. Quest'ultima ha espresso apprezzamento per il lavoro svolto dal team, sottolineando la qualità del prodotto sviluppato e la professionalità dimostrata. Il team ha ringraziato la Proponente per la collaborazione, sottolineando l'importanza del confronto e del supporto ricevuto. Infine, su richiesta della Proponente, il gruppo ha condiviso suggerimenti per il miglioramento dei progetti da proporre per il corso in futuro, indicando i punti di forza e gli aspetti migliorabili di "InnovaCity".
Tra i punti di forza sono stati menzionati l'interesse suscitato nel team da parte dell'ambito di applicazione del progetto (big data e data streaming), le tecnologie utilizzate che, essendo molto diffuse, risultano sicuramente utili da includere nel proprio bagaglio formativo e il supporto ricevuto dalla Proponente. Tra gli aspetti migliorabili, invece, è stato consigliato di proporre un progetto che comporti una parte di codifica più ampia e strutturata; questo anche per permettere che, nel contesto dell'insegnamento di Ingegneria del Software, si possano approfondire maggiormente architetture e design pattern nel corso della progettazione. La Proponente ha accolto con favore i suggerimenti, indicando che una possibile evoluzione per i progetti degli anni successivi potrebbe includere l'aggiunta di un layer di data processing in modo da sopperire a questa necessità. |
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/let-22.typ | typst | Other | // Trailing placeholders.
// Error: 10-11 not enough elements to destructure
#let (a, _, _, _, _) = (1,)
#test(a, 1)
|
https://github.com/PhilChodrow/cv | https://raw.githubusercontent.com/PhilChodrow/cv/main/src/content/grants.typ | typst |
#import "../template.typ": *
#cvSection("Grants, Fellowships and Funding")
#cvEntry(
title: [RUI: Network Evolution with Unobserved Mechanisms (\$287,522)],
organisation: [National Science Foundation (NSF)],
logo: "",
date: [2024-2027],
location: [Middlebury, VT],
)
// #divider()
#cvEntry(
title: [Graduate Research Fellowship (\$138,000)],
organisation: [National Science Foundation (NSF)],
logo: "",
date: [2017-2020],
location: [Cambridge, MA],
// description: list(
// [#lorem(20)],
// ),
)
#cvEntry(
title: [Fulbright Research Award (\~\$28,000)],
organisation: [US-Norway Fulbright Foundation],
logo: "",
date: [2012-2013],
location: [Oslo, Norway],
// description: list(
// [#lorem(20)],
// ),
)
|
|
https://github.com/matzemathics/typst-template | https://raw.githubusercontent.com/matzemathics/typst-template/main/src/main.typ | typst | #import "template.typ": *
#show: project.with(
title: "Typst template document",
authors: (
(name: "<NAME>", email: "<EMAIL>"),
),
)
= Introduction
#lorem(60)
== In this paper
#lorem(20)
=== Contributions
#lorem(40)
= Related Work
#lorem(500)
#bibliography("references.bib")
|
|
https://github.com/linsyking/messenger-manual | https://raw.githubusercontent.com/linsyking/messenger-manual/main/generalmodel.typ | typst | #pagebreak()
= General Model
In previous sections, we discussed the general model. Its definitions are as follows:
```elm
type AbstractGeneralModel env event tar msg ren bdata sommsg
= Roll
{ update : env -> event -> ( AbstractGeneralModel env event tar msg ren bdata sommsg, List (Msg tar msg sommsg), ( env, Bool ) )
, updaterec : env -> msg -> ( AbstractGeneralModel env event tar msg ren bdata sommsg, List (Msg tar msg sommsg), env )
, view : env -> ren
, matcher : tar -> Bool
, baseData : bdata
}
type alias ConcreteGeneralModel data env event tar msg ren bdata sommsg =
{ init : env -> msg -> ( data, bdata )
, update : env -> event -> data -> bdata -> ( ( data, bdata ), List (Msg tar msg sommsg), ( env, Bool ) )
, updaterec : env -> msg -> data -> bdata -> ( ( data, bdata ), List (Msg tar msg sommsg), env )
, view : env -> data -> bdata -> ren
, matcher : data -> bdata -> tar -> Bool
}
```
*Note.* Scenes are similar to layers and components, but have some differences as well. So the core does not define scene by `GeneralModel`.
In brief, `AbstractGeneralModel` is a model that can update itself and generate the view but hiding the data to the user.
When the model updates itself, it will be fed an event (a _user event_, used in `update`) or a message from other object (used in `updaterec`) and it will generate a list of new messages with targets. The target can be either the same type of object or the higher level object. For example, a component can send messages to another component in the same scene and to its parent layer; a layer can send messages to another layer and to its parent scene.
If the input is an event, the model can choose to _block_ it from sending to the next object. To prevent getting wrong messages, model use _matcher_ to identify itself.
The model also has a `baseData` field so that users can get some specific type of data outside the model. This is used in components.
A `ConcreteGeneralModel` can be considered as the _initialization data_ of its corresponding `AbstractGeneralModel`. Specific logic for every part of the `AbstractGeneralModel` should be implemented in `ConcreteGeneralModel` "concretely". That is, to generate a `AbstractGeneralModel`, users have to set a `ConcreteGeneralModel` first, then `abstract` it.
The `abstract` function mainly takes use of the _delayed evaluation_ to implement.
First, consider a simple example.
```elm
type Absturact
= Roll (() -> Abstract)
type alias Concrete a =
{ init : a, update : a -> a }
abstract : Concrete a -> Abstract
abstract con =
let
abstractRec : a -> Abstract
abstractRec a =
let
func : () -> Abstract
func () =
abstractRec <| con.update a
in
Roll func
in
abstractRec con.init
```
`Abstract` hides the data it is updating and only leaves the interface for users to use. Thus, `Abstarct` with different inner data types can have the same type. The `update` function is like a _virtual function_ in OOP.
Next, let's examine how a concrete `view` is transformed into an abstract `view` for a more advanced example.
```elm
abstract : ConcreteGeneralModel data env event tar msg ren bdata sommsg -> msg -> env -> AbstractGeneralModel env event tar msg ren bdata sommsg
abstract conmodel initMsg initEnv =
let
abstractRec : data -> bdata -> AbstractGeneralModel env event tar msg ren bdata sommsg
abstractRec data base =
let
...
views : env -> ren
views env =
conmodel.view env data base
in
Roll
{ update = updates
, updaterec = updaterecs
, view = views
, matcher = matchers
, baseData = baseDatas
}
( init_d, init_bd ) =
conmodel.init initEnv initMsg
in
abstractRec init_d init_bd
```
After understanding the relationship between the concrete model and the abstract model, `Messenger.Recursion.updateObjects` can be used to update all objects recursively.
```elm
updateObjects : env -> event -> List (AbstractGeneralModel env event tar msg ren bdata sommsg) -> ( List (AbstractGeneralModel env event tar msg ren bdata sommsg), List (MsgBase msg sommsg), ( env, Bool ) )
```
Note that the output messages of `updateObjects` don't include the targets because the target of those messages are the parent object. If the result has messages that needs to be sent to a same level object, the recursion won't stop.
If users want to only send a specific message(s) to a specific object(s), they may use `updateObjectsWithTarget`:
```elm
updateObjectsWithTarget : env -> List ( tar, msg ) -> List (AbstractGeneralModel env event tar msg ren bdata sommsg) -> ( List (AbstractGeneralModel env event tar msg ren bdata sommsg), List (MsgBase msg sommsg), env )
```
|
|
https://github.com/Matt-Tansley/quarto-typst-landscape | https://raw.githubusercontent.com/Matt-Tansley/quarto-typst-landscape/main/README.md | markdown | # quarto-typst-landscape

## Installing
``` bash
quarto use template Matt-Tansley/quarto-typst-landscape
```
This will install the format extension and create an example qmd file that you can use as a starting place for your document.
## Using
Basic landscape template for use with Quarto + Typst.
## References
Inspired by:
- Making Pretty PDFs with Typst (and Quarto). <NAME>. January 31, 2024. nrennie.rbind.io/blog/pdf-quarto/making-pdf-with-quarto-typst-latex
|
|
https://github.com/dead-summer/math-notes | https://raw.githubusercontent.com/dead-summer/math-notes/main/notes/ScientificComputing/ch2-scalar-nonlinear-eqns/the-bisection-method.typ | typst | #import "/book.typ": book-page
#import "../../../templates/conf.typ": *
#import "@preview/mitex:0.2.4": *
#show: book-page.with(title: "The Bisection Method")
#show: codly-init.with()
#show: thmrules.with(qed-symbol: $square$)
#codly_init()
= 1 The Bisection Method
Assume the values of function $f(x)$ at the end points of the interval $[a, b]$ take opposite signs, i.e.,
$
f(a) f(b) < 0.
$
let
$
c = (a+b) / 2,
$
if $f(a)f(c) > 0$ , replace $a$ with $c$ ; otherwise, replace $b$ with $c$ . Repeat the process. Each time the length/size of the interval $[a, b]$ is reduced by a half. When the interval $[a, b]$ is sufficiently small, any value on interval $[a, b]$ can be used as an approximate solution to the equation with error not greater than the size $(b - a)$ of the interval.
#exm[
Consider the nonlinear equation
$
f(x) = x - e^(-x), quad x in [-1, 1].
$
]
```cpp
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
double F(double x)
{
double f = x - exp(-x);
return f;
}
int main(int argc, char *argv[])
{
double a = -1;
double b = 1;
double fa = F(a);
double fb = F(b);
double c = 0.5 * (a + b);
double d = b - a;
double tol = 1.0E-8;
int count = 0;
int max itr num = 100;
do {
count++;
double fc = F(c);
std::cout << "count = " << count << ", d = " << d
<< ", c = " << c << ", fc = " << fc << std::endl;
if ((fa * fc) > 0.0) {
a = c;
fa = fc;
} else {
b = c;
fb = fc;
}
c = 0.5 * (a + b);
d *= 0.5;
} while ((d > tol) && (count < max itr num));
if (count == max itr num) {
std::cout << "The bisection method failed to converge." << std::endl;
exit(EXIT FAILURE);
}
std::cout << "An approximate solution found, x = " << c << std::endl;
return EXIT SUCCESS;
}
```
|
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/SK/textsTmp.typ | typst | #import "../style.typ": *
#let trojsvatePoOtcenas = [
#lettrine("Svätý Bože, Svätý Silný, Svätý Nesmrteľný, zmiluj sa nad nami. (3x)")
#lettrine("Sláva Otcu i Synu i Svätému Duchu.")
#lettrine("I teraz i vždycky i na veky vekov. Amen.")
#lettrine("Presvätá Trojica, zmiluj sa nad nami. Pane, očisť nás od našich hriechov. Vládca, odpusť nám naše neprávosti, Svätý, príď a uzdrav naše slabosti pre svoje meno.")
#lettrine("Pane, zmiluj sa. (3x)")
#lettrine("Sláva Otcu i Synu i Svätému Duchu.")
#lettrine("I teraz i vždycky i na veky vekov. Amen.")
#lettrine("Otče náš, ktorý si na nebesiach, posväť sa meno tvoje, príď kráľovstvo tvoje, buď vôľa tvoja ako v nebi, tak i na zemi. Chlieb náš každodenný daj nám dnes a odpusť nám naše viny, ako i my odpúšťame svojim vinníkom, a neuveď nás do pokušenia, ale zbav nás Zlého.")
#lettrine("Lebo tvoje je kráľovstvo a moc i sláva, Otca i Syna i Svätého Ducha, teraz i vždycky i na veky vekov.")
#lettrine("Amen.")
]
#let nacaloPoOtcenasBezKnaza = [
#lettrine("Pane Ježišu Kriste, Bože náš, pre modlitby našich svätých otcov zmiluj sa nad nami.")
#lettrine("Amen.")
#lettrine("Sláva tebe, Bože náš, sláva tebe.")
#lettrine("Kráľu nebeský, Utešiteľu, Duchu pravdy, ktorý si všade a všetko naplňuješ, poklad dobra a darca života, príď a prebývaj v nás, očisť nás od každej poškvrny a spas, Dobrotivý, naše duše.")
#trojsvatePoOtcenas
]
#let nacaloPoOtcenas = [
#note[Kňaz: ]#lettrine("Požehnaný Boh náš v každom čase, teraz i vždycky i na veky vekov.")
#note[ak nie je kňaz, prednášaj:]
#lettrine("Pane Ježišu Kriste, Bože náš, pre modlitby našich svätých otcov zmiluj sa nad nami.")
#lettrine("Amen.")
#lettrine("Sláva tebe, Bože náš, sláva tebe.")
#lettrine("Kráľu nebeský, Utešiteľu, Duchu pravdy, ktorý si všade a všetko naplňuješ, poklad dobra a darca života, príď a prebývaj v nás, očisť nás od každej poškvrny a spas, Dobrotivý, naše duše.")
#trojsvatePoOtcenas
]
#let nacaloBezKnaza = [
#nacaloPoOtcenasBezKnaza
#lettrine("Pane, zmiluj sa.") #primText[(12x)]
#lettrine("Sláva Otcu i Synu i Svätému Duchu.")
#lettrine("I teraz i vždycky i na veky vekov. Amen.")
#lettrine("Poďte, pokloňme sa Kráľovi, nášmu Bohu.")
#lettrine("Poďte, pokloňme sa Kristovi, Kráľovi, nášmu Bohu.")
#lettrine("Poďte, pokloňme sa a padnime pred samým Pánom, Ježišom Kristom, Kráľom a Bohom naším.")
]
#let nacalo = [
#nacaloPoOtcenas
#lettrine("Pane, zmiluj sa.") #primText[(12x)]
#lettrine("Sláva Otcu i Synu i Svätému Duchu.")
#lettrine("I teraz i vždycky i na veky vekov. Amen.")
#lettrine("Poďte, pokloňme sa Kráľovi, nášmu Bohu.")
#lettrine("Poďte, pokloňme sa Kristovi, Kráľovi, nášmu Bohu.")
#lettrine("Poďte, pokloňme sa a padnime pred samým Pánom, Ježišom Kristom, Kráľom a Bohom naším.")
]
#let prepustenieSDostojneBezKnaza = [\
== Prepustenie <X>
#lettrine("Dôstojné je velebiť teba, Bohorodička, * vždy blažená a nepoškvrnená, Matka nášho Boha.")
#lettrine("Čestnejšia si ako cherubíni a neporovnateľne slávnejšia ako serafíni, bez porušenia si porodila Boha Slovo, opravdivá Bohorodička, velebíme ťa.")
#lettrine("Sláva: I teraz: Pane, zmiluj sa (3x). Požehnaj.")
#lettrine("Pane Ježišu Kriste, Bože náš, pre modlitby našich svätých otcov zmiluj sa nad nami.")
#lettrine("Amen.")
]
#let prepustenieBezKnaza = [\
== Prepustenie <X>
#lettrine("Čestnejšia si ako cherubíni a neporovnateľne slávnejšia ako serafíni, bez porušenia si porodila Boha Slovo, opravdivá Bohorodička, velebíme ťa.")
#lettrine("Sláva: I teraz: Pane, zmiluj sa (3x). Požehnaj.")
#lettrine("Pane Ježišu Kriste, Bože náš, pre modlitby našich svätých otcov zmiluj sa nad nami.")
#lettrine("Amen.")
]
#let prepustenieMaleBezKnaza = [\
== Prepustenie <X>
#lettrine("Sláva: I teraz: Pane, zmiluj sa (3x). Požehnaj.")
#lettrine("Pane Ježišu Kriste, Bože náš, pre modlitby našich svätých otcov zmiluj sa nad nami.")
#lettrine("Amen.")
]
#let prepustenie = [\
== Prepustenie <X>
#note[Kňaz: ] #lettrine("Premúdrosť!")
#note[Ľud: ] #lettrine("Čestnejšia si ako cherubíni a neporovnateľne slávnejšia ako serafíni, bez porušenia si porodila Boha Slovo, opravdivá Bohorodička, velebíme ťa.")
#note[Kňaz: ] #lettrine("Sláva tebe, <NAME>, naša nádej, sláva tebe.")
#note[Ľud: ] #lettrine("Sláva: I teraz: Pane, zmiluj sa (3x). Požehnaj.")
#note[Kňaz: ] #lettrine("Kristus, náš pravý Boh, na prosby svojej prečistej Matky, našich prepodobných a bohonosných otcov a všetkých svätých, nech sa nad nami zmiluje a spasí nás, lebo je dobrý a miluje nás.")
#note[Ľud: ] #lettrine("Amen.")
]
#let tropar(hlas, podoben, txt) = [
#primText[Tropár (#hlas. hlas#if podoben != none [, #podoben])]: #txt
]
#let sit(hlas, podoben, txt) = [
#primText[Sláva: I teraz: #if hlas != none [(#hlas. hlas#if podoben != none [, #podoben]):] ]#txt
]
#let stich(hlas, podoben, txt) = [
#primText[#if hlas != none [(#hlas. hlas#if podoben != none [, #podoben]):]] #txt
]
#let vers(txt) = [
#pad(left: 20pt)[#primText[Verš:] #txt]
]
#let K(txt) = [
#note[Kňaz:] #txt
]
#let L(txt) = [
#note[Ľud:] #txt
]
#let prokimen(hlas, txt, v) = [
#primText[Prokimen (#hlas. hlas)]: #txt
#vers[#v]
]
#let zalm(num) = [
#import "/style.typ": *
#set par(first-line-indent: 1em)
#subheader[Žalm #num]
#include "zalmy/Z"+padNum(num)+".typ"
]
#let slavoslovieMale = [
#set par(first-line-indent: 1em)
Sláva Bohu na nebi a mier na zemi. V ľuďoch dobrá vôľa.
Chválime ťa, velebíme ťa. Klaniame sa ti, oslavujeme ťa.
Dobrorečíme ti pre nesmiernu tvoju slávu,
Pane a Kráľu nebeský, Bože, Otče, všemohúci Vládca,
Pane náš a jednorodený Synu, Ježišu Kriste i Svätý Duchu, Pane Bože.
<NAME>, Syn Otca, ty, čo snímaš hriechy sveta, zmiluj sa nad nami.
Ty, čo snímaš hriechy sveta, prijmi naše modlitby.
Ty, čo sedíš po pravici Otcovej, zmiluj sa nad nami.
Len ty sám si svätý, ty jediný si Pán, <NAME> v sláve Boha Otca. Amen.
Každý deň ťa budeme velebiť a tvoje meno chváliť navždy a naveky.
Pane, bol si naše útočisko z pokolenia na pokolenie.
Riekol som: Pane, zmiluj sa nado mnou a uzdrav moju dušu, lebo som sa prehrešil proti tebe.
Pane, k tebe sa utiekam. Nauč ma plniť tvoju vôľu, lebo ty si môj Boh.
Veď u teba je zdroj života a v tvojom svetle uzrieme svetlo.
Svoju milosť daj tým, čo ťa poznajú.
Ráč nás, Pane, v tento deň zachrániť od hriechu.
Velebíme ťa, Pane, Bože otcov našich. Chválime a oslavujeme tvoje meno na veky. Amen.
Preukáž nám, Pane, svoje milosrdenstvo, lebo dúfame v teba.
Blahoslavený si, Pane, nauč nás svoje pravdy.
Blahoslavený si, Vládca, daj nám porozumieť svojim pravdám.
Blahoslavený si, Svätý, osvieť nás svojimi pravdami.
Pane, tvoje milosrdenstvo je večné, nepohŕdaj dielom svojich rúk.
Tebe patrí chvála, tebe patrí pieseň.
Tebe, Otcu i Synu, i Svätému Duchu, patrí sláva teraz i vždycky, i na veky vekov. Amen.
]
#let slavoslovieVelke = [
#set par(first-line-indent: 1em)
Sláva Bohu na nebi a mier na zemi. V ľuďoch dobrá vôľa.
Chválime ťa, velebíme ťa. Klaniame sa ti, oslavujeme ťa.
Dobrorečíme ti pre nesmiernu tvoju slávu,
Pane a Kráľu nebeský, Bože, Otče, všemohúci Vládca,
Pane náš a jednorodený Synu, Ježišu Kriste i Svätý Duchu, <NAME>.
<NAME>, Syn Otca, ty, čo snímaš hriechy sveta, zmiluj sa nad nami.
Ty, čo snímaš hriechy sveta, prijmi naše modlitby.
Ty, čo sedíš po pravici Otcovej, zmiluj sa nad nami.
Len ty sám si svätý, ty jediný si Pán, Ježi<NAME> v sláve Boha Otca. Amen.
Každý deň ťa budeme velebiť a tvoje meno chváliť navždy a naveky.
Pane, bol si naše útočisko z pokolenia na pokolenie.
Riekol som: Pane, zmiluj sa nado mnou a uzdrav moju dušu, lebo som sa prehrešil proti tebe.
Pane, k tebe sa utiekam. Nauč ma plniť tvoju vôľu, lebo ty si môj Boh.
Veď u teba je zdroj života a v tvojom svetle uzrieme svetlo.
Svoju milosť daj tým, čo ťa poznajú.
Ráč nás, Pane, v tento deň zachrániť od hriechu.
Velebíme ťa, Pane, Bože otcov našich. Chválime a oslavujeme tvoje meno na veky. Amen.
Preukáž nám, Pane, svoje milosrdenstvo, lebo dúfame v teba.
Blahoslavený si, Pane, nauč nás svoje pravdy.
Blahoslavený si, Vládca, daj nám porozumieť svojim pravdám.
Blahoslavený si, Svätý, osvieť nás svojimi pravdami.
Pane, bol si naše útočisko z pokolenia na pokolenie.
Riekol som: Pane, zmiluj sa nado mnou a uzdrav moju dušu, lebo som sa prehrešil proti tebe.
Pane, k tebe sa utiekam. Nauč ma plniť tvoju vôľu, lebo ty si môj Boh.
Veď u teba je zdroj života a v tvojom svetle uzrieme svetlo.
Svoju milosť daj tým, čo ťa poznajú.
]
#let vKazdomCase = [
V každom čase a v každej chvíli v nebi aj na zemi sa ti klaňajú a teba oslavujú, Bože dobrý, trpezlivý a nesmierne milosrdný. Ty miluješ spravodlivých, zmilúvaš sa nad hriešnymi a všetko voláš k spáse pre prísľub budúceho dobra. Ty sám, Pane, prijmi v tejto hodine aj naše modlitby a nasmeruj náš život k tvojim prikázaniam. Naše duše posväť a telá očisť, myšlienky usmerni, rozum urob rozvážnym a triezvym, osloboď nás od každého zármutku, zla a utrpenia. Okolo nás postav svojich svätých anjelov ako hradbu, aby sme pod ochranou a vedením ich oddielov dosiahli jednotu vo viere a poznanie tvojej nedotknuteľnej slávy, veď ty si požehnaný na veky vekov. Amen.
] |
|
https://github.com/jeffa5/typst-cambridge | https://raw.githubusercontent.com/jeffa5/typst-cambridge/main/README.md | markdown | MIT License | # Typst Cambridge templates
A set of University of Cambridge styled templates.
## Slides
Using [typst-slides](https://github.com/andreasKroepelin/typst-slides) template.
See the [manual](slides/manual.pdf).
## PhD Thesis/Dissertation
See the [manual](thesis/manual.pdf).
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/copy-paste-00.typ | typst | Other | The after fira 🏳️🌈!
#set text(lang: "ar", font: "Noto Sans Arabic")
مرحبًا
|
https://github.com/trace1729/typst-template | https://raw.githubusercontent.com/trace1729/typst-template/main/main.typ | typst | #import "template.typ": *
#show: project.with(
title: "TITLE",
authors: (
(
name: "Wonderland",
email: "<EMAIL>"
),
),
)
= Section
段落以及基本的 markup 语法
== Sub-section
Now we *know* _how_ to #highlight[mark files] as intentionally #text(red)[untracked] (ignored).
- First, you should never check automatically generated files
- Second, there are temporary files and by-products specific to ones's toolchain
+ `.vim`
+ `.bashrc`
We could use `.gitignore` to ignore file change.
```bash
/.vim/ #highlight
.bashrc
```
Noticed, we use `/.vim.` to ignore `.vim` dir only in project root dir.
= admonition (alert box)
#info-box(blue, "NOTE")[
需要指定 「颜色」,「标题」和「内容」
]
= Figure
@a is a figrue in 40% ratio
#figure(
image("./pipeline1.png", width: 40%),
caption: "流水线"
) <a>
#align(center)[双栏图]
#vsp(
"./pipeline1.png", "流水线", 70%,
"./pipeline1.png", "流水线", 70%
)
= 栈、列表和网格
== stack
#stack(
dir: ltr,
rect(width: 25%, "PPN1"),
rect(width: 25%, "PPN2"),
rect(width: 25%, "PPN3"),
rect(width: 25%, "OFF"),
)
== table
#let n = 6
#let yield_cells(n) = {
for i in range(0, n + 1) {
for j in range(0, n + 1) {
// this is an array, for loops merge them together
// into one large array of cells
(
table.cell(
fill: if i == 0 { blue} // top right corner
else if j == 0 { blue }
else {white},
" "),
)
}
}
}
#align(center)[#table(
columns: (0.6cm,) * (n + 1),
rows: (0.6cm,) * (n + 1),
..yield_cells(n),
)]
== grid
#set rect(width: 100%)
#align(center)[
#grid(
columns: (1em,) * 32,
rows: (0.75em, 2em),
text(size: 8pt, "31"),
grid.cell(
colspan: 5,
""
),
text(size: 8pt, "25"),
text(size: 8pt, "24"),
grid.cell(
colspan: 3,
""
),
text(size: 8pt, "20"),
text(size: 8pt, "19"),
grid.cell(
colspan: 3,
""
),
text(size: 8pt, "15"),
text(size: 8pt, "14"),
grid.cell(
colspan: 1,
""
),
text(size: 8pt, "12"),
text(size: 8pt, "11"),
grid.cell(
colspan: 3,
""
),
text(size: 8pt, "7"),
text(size: 8pt, "6"),
grid.cell(
colspan: 5,
""
),
text(size: 8pt, "0"),
grid.cell(
colspan: 7,
rect("0000001")
),
grid.cell(
colspan: 5,
rect("rs2")
),
grid.cell(
colspan: 5,
rect("rs1")
),
grid.cell(
colspan: 3,
rect("111")
),
grid.cell(
colspan: 5,
rect("rd")
),
grid.cell(
colspan: 7,
rect("0110011")
),
)
*REM* instruction layout
]
= 数学
_Proof_:
Assume we have another fixed point x, i.e. $x=f(x)$
By the definition of $bot$, we have $bot subset.eq.sq x$
Induction begins:
As f is monotonic, we have
$ f(bot) subset.eq.sq f(x) $
Assume $f^i (bot) subset.eq.sq f^i (x)$, as f is monotonic,we have
$ f^(i+1) (bot) subset.eq.sq f^(i+1)(x) $
Thus by induction, we have
$ f^(i) (bot) subset.eq.sq f^(i)(x) #[#set text(blue); induction completed here] $
Thus $f^(i)(bot) subset.eq.sq f^i (x) = x$
$ f^(#[fix]) = f^k(bot) subset.eq.sq x $
Then we prove $bot$ is the least fixed-point.
|
|
https://github.com/Pablo-Gonzalez-Calderon/apuntes-botanica | https://raw.githubusercontent.com/Pablo-Gonzalez-Calderon/apuntes-botanica/main/src/figures/fig.typ | typst | Other | #let fig_epidermis = block(
)
#let fig_tricomas = block(
)
#let fig_celula_oclusiva = block(
)
#let fig_estoma_en_epidermis = block(
) |
https://github.com/typst-community/mantodea | https://raw.githubusercontent.com/typst-community/mantodea/main/src/link.typ | typst | MIT License | #import "/src/_valid.typ"
#import "/src/theme.typ" as _theme
#let _type = type
/// The type links supported by `type`.
///
/// Can be used to add new or alter exisiting type links.
///
/// The default contains the typst built in types, including the special types
/// which contain no page like `any`, linking to the types page instead.
#let typst = {
let _docs(path) = "https://typst.app/docs/" + path
let _reference(path) = _docs("reference/" + path)
// the complete docs site map
let site-map = (
_self: _docs(""),
tutorial: (
_self: _docs("tutorial"),
writing-in-typst: _docs("tutorial/writing-in-typst"),
formatting: _docs("tutorial/formatting"),
advanced-styling: _docs("tutorial/advanced-styling"),
making-a-template: _docs("tutorial/making-a-template"),
),
reference: (
_self: _reference(""),
foundations: (
_self: _reference("foundations"),
arguments: _reference("foundations/arguments"),
array: _reference("foundations/array"),
bool: _reference("foundations/bool"),
bytes: _reference("foundations/bytes"),
content: _reference("foundations/content"),
datetime: _reference("foundations/datetime"),
dictionary: _reference("foundations/dictionary"),
float: _reference("foundations/float"),
function: _reference("foundations/function"),
int: _reference("foundations/int"),
location: _reference("foundations/location"),
plugin: _reference("foundations/plugin"),
regex: _reference("foundations/regex"),
selector: _reference("foundations/selector"),
str: _reference("foundations/str"),
type: _reference("foundations/type"),
label: _reference("foundations/label"),
),
model: (
_self: _reference("model"),
bibliography: _reference("model/bibliography"),
cite: _reference("model/cite"),
document: _reference("model/document"),
emph: _reference("model/emph"),
enum: _reference("model/enum"),
figure: _reference("model/figure"),
footnote: _reference("model/footnote"),
heading: _reference("model/heading"),
link: _reference("model/link"),
list: _reference("model/list"),
numbering: _reference("model/numbering"),
outline: _reference("model/outline"),
par: _reference("model/par"),
parbreak: _reference("model/parbreak"),
quote: _reference("model/quote"),
ref: _reference("model/ref"),
strong: _reference("model/strong"),
table: _reference("model/table"),
terms: _reference("model/terms"),
),
text: (
_self: _reference("text"),
highlight: _reference("text/highlight"),
linebreak: _reference("text/linebreak"),
lorem: _reference("text/lorem"),
lower: _reference("text/lower"),
overline: _reference("text/overline"),
raw: _reference("text/raw"),
smallcaps: _reference("text/smallcaps"),
smartquote: _reference("text/smartquote"),
strike: _reference("text/strike"),
sub: _reference("text/sub"),
super: _reference("text/super"),
text: _reference("text/text"),
underline: _reference("text/underline"),
upper: _reference("text/upper"),
),
layout: (
_self: _reference("layout"),
align: _reference("layout/align"),
alignment: _reference("layout/alignment"),
angle: _reference("layout/angle"),
block: _reference("layout/block"),
box: _reference("layout/box"),
colbreak: _reference("layout/colbreak"),
columns: _reference("layout/columns"),
direction: _reference("layout/direction"),
fraction: _reference("layout/fraction"),
grid: _reference("layout/grid"),
h: _reference("layout/h"),
hide: _reference("layout/hide"),
layout: _reference("layout/layout"),
measure: _reference("layout/measure"),
move: _reference("layout/move"),
pad: _reference("layout/pad"),
page: _reference("layout/page"),
pagebreak: _reference("layout/pagebreak"),
place: _reference("layout/place"),
ratio: _reference("layout/ratio"),
relative: _reference("layout/relative"),
repeat: _reference("layout/repeat"),
rotate: _reference("layout/rotate"),
scale: _reference("layout/scale"),
stack: _reference("layout/stack"),
v: _reference("layout/v"),
),
visualize: (
_self: _reference("visualize"),
circle: _reference("visualize/circle"),
color: _reference("visualize/color"),
ellipse: _reference("visualize/ellipse"),
gradient: _reference("visualize/gradient"),
image: _reference("visualize/image"),
line: _reference("visualize/line"),
path: _reference("visualize/path"),
pattern: _reference("visualize/pattern"),
polygon: _reference("visualize/polygon"),
rect: _reference("visualize/rect"),
square: _reference("visualize/square"),
stroke: _reference("visualize/stroke"),
)
),
guides: (
_self: _docs("guides"),
guide-for-latex-users: _docs("guides/guide-for-latex-users"),
page-setup-guide: _docs("guides/page-setup-guide"),
table-guide: _docs("guides/table-guide"),
),
changelog: _docs("changelog"),
roamap: _docs("roamap"),
community: _docs("community"),
)
let types = (
// special
any: site-map.reference.foundations._self,
"auto": site-map.reference.foundations._self,
"none": site-map.reference.foundations._self,
// foundations
arguments: site-map.reference.foundations.arguments,
array: site-map.reference.foundations.array,
bool: site-map.reference.foundations.bool,
bytes: site-map.reference.foundations.bytes,
content: site-map.reference.foundations.content,
datetime: site-map.reference.foundations.datetime,
dictionary: site-map.reference.foundations.dictionary,
float: site-map.reference.foundations.float,
function: site-map.reference.foundations.function,
int: site-map.reference.foundations.int,
location: site-map.reference.foundations.location,
plugin: site-map.reference.foundations.plugin,
regex: site-map.reference.foundations.regex,
selector: site-map.reference.foundations.selector,
str: site-map.reference.foundations.str,
type: site-map.reference.foundations.type,
label: site-map.reference.foundations.label,
// layout
alignment: site-map.reference.layout.alignment,
angle: site-map.reference.layout.angle,
direction: site-map.reference.layout.direction,
fraction: site-map.reference.layout.fraction,
ratio: site-map.reference.layout.ratio,
relative: site-map.reference.layout.relative,
// visualize
color: site-map.reference.visualize.color,
gradient: site-map.reference.visualize.gradient,
pattern: site-map.reference.visualize.pattern,
stroke: site-map.reference.visualize.stroke,
)
(
docs: site-map,
types: types,
)
}
/// The forges supported by `forge`.
///
/// Can be used to add new, or alter existing matchers, matchers come in the
/// form of a function which takes a url and either returns a `str` or `none`
/// directly, or a boolean. `false` or `none` means the matcher did not match,
/// `true` means use the matcher key, a `str` means use this string directly.
///
/// The default matchers include GitHub, GitLab and Codeberg as well as a crude
/// git-subdomain matcher which returns the top and second level domain.
#let forges = state("__mantodea:link:forges", (
GitHub: s => s.contains("github.com"),
GitLab: s => s.contains("gitlab.com"),
Codeberg: s => s.contains("codeberg.org"),
GenericGitSubdomain: s => {
let re = regex("(https?://)?git\.")
if s.starts-with(re) {
s.trim(re, at: start, repeat: false)
}
},
))
/// Creates a link with a footnote.
///
/// - url (str): The url for the link and the footnote.
/// - label (str): The label for the link.
/// -> content
#let footlink(
url,
label,
_validate: true,
) = {
if _validate {
import _valid as z
_ = z.parse(url, z.string(), scope: ("url",))
_ = z.parse(label, z.content(), scope: ("label",))
}
link(url, label)
footnote(link(url))
}
/// Creates a link with footnote to a source forge and optional repo.
///
/// - base (str): The forge base url.
/// - label (str, auto): The label to use for the forge, uses `forges` if
/// `auto`.
/// - ..relative (str): An optional author or repository path.
/// -> content
#let forge(
base,
..relative,
label: auto,
_validate: true,
) = {
if _validate {
import _valid as z
_ = z.parse(base, z.string(), scope: ("base",))
_ = z.parse(
relative,
z.sink(positional: z.array(z.string(optional: true))),
scope: ("relative",),
)
}
relative = relative.pos().at(0, default: none)
if base.ends-with("/") {
base = base.silce(0, -1)
}
if label == auto {
label = context {
for (label, matcher) in forges.final().pairs() {
let m = matcher(base)
if m == true {
return label
} else if type(m) == str {
return m
}
}
base
}
}
if relative != none {
label = label + ":" + relative
}
let url = if relative != none {
(base, relative).join("/")
} else {
base
}
footlink(url, label, _validate: false)
}
/// Creates a link with a footnote to a GitHub repository.
///
/// - repo (str): The repository path.
/// -> content
#let github(repo, _validate: true) = forge("https://github.com", repo, _validate: _validate)
/// Creates a link with a footnote to a GitLab repository.
///
/// - repo (str): The repository path.
/// -> content
#let gitlab(repo, _validate: true) = forge("https://gitlab.com", repo, _validate: _validate)
/// Creates a link with a footnote to a Codeberg repository.
///
/// - repo (str): The repository path.
/// -> content
#let codeberg(repo, _validate: true) = forge("https://codeberg.org", repo, _validate: _validate)
/// Creates a link with a footnote to the Typst Universe page of a package.
///
/// - name (str): The name of the package.
/// - version (version, none): The version of the package, this has no effect
/// on the link itself.
/// -> content
#let package(
name,
version: none,
_validate: true,
) = {
if _validate {
import _valid as z
_ = z.parse(name, z.string(), scope: ("name",))
_ = z.parse(version, z.version(optional: true), scope: ("version",))
}
let base = "https://typst.app/universe/package"
// NOTE: lowering the name is always valid here
footlink((base, lower(name)).join("/"), smallcaps(name), _validate: false)
}
/// Creates a link with a footnote to the Typst package repository.
///
/// - name (str): Name of the package.
/// - version (version): The version of the package.
/// - namespace (str): The package namespace to use.
/// -> content
#let package-repo(
name,
version,
namespace: "preview",
_validate: true,
) = {
if _validate {
import _valid as z
_ = z.parse(name, z.string(), scope: ("name",))
_ = z.parse(version, z.version(), scope: ("version",))
_ = z.parse(namespace, z.string(), scope: ("namespace",))
}
let base = "https://github.com/typst/packages/tree/main/packages"
let version = str(version)
footlink(
// NOTE: I'm not sure if always lowering the package name is valid, but I the ecosystem seems to
// largely use kebab-case package names so this will be fine
(base, namespace, lower(name), version).join("/"),
smallcaps(name + ":" + version),
_validate: false,
)
}
/// Creates a link with a footnote to the documentation of a built-in Typst type.
///
/// - value (str, any): The type or value to which to link to:
/// - if this is a `str`, it is inferred to be the type representation
/// - if this is a type, it is inferred to be the expected type
/// - if this is a value, it is inferred to be a value of the expected type
/// - with-footnote (bool):
/// - theme (theme): The theme to use for this type.
/// -> content
#let type(
value,
with-footnote: false,
theme: _theme.default,
_validate: true,
) = {
if _validate {
import _valid as z
_ = z.parse(with-footnote, z.boolean(), scope: ("with-footnote",))
_ = z.parse(theme, _theme.schema(), scope: ("theme",))
}
let type = if _type(value) == str {
value
} else if _type(value) == _type {
repr(value)
} else {
repr(_type(value))
}
let color = theme.colors.types.at(type, default: theme.colors.types.at("any"))
let type = {
let aliases = (
string: "str",
boolean: "bool",
)
aliases.at(type, default: type)
}
footlink(
typst.types.at(type),
box(
inset: (x: 0.25em),
outset: (y: 0.25em),
radius: 0.25em,
fill: color,
raw(type),
),
_validate: false,
)
}
|
https://github.com/frectonz/the-pg-book | https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/207.%20smart.html.typ | typst | smart.html
Beyond Smart
October 2021If you asked people what was special about Einstein, most would say
that he was really smart. Even the ones who tried to give you a
more sophisticated-sounding answer would probably think this first.
Till a few years ago I would have given the same answer myself. But
that wasn't what was special about Einstein. What was special about
him was that he had important new ideas. Being very smart was a
necessary precondition for having those ideas, but the two are not
identical.It may seem a hair-splitting distinction to point out that intelligence
and its consequences are not identical, but it isn't. There's a big
gap between them. Anyone who's spent time around universities and
research labs knows how big. There are a lot of genuinely smart
people who don't achieve very much.I grew up thinking that being smart was the thing most to be desired.
Perhaps you did too. But I bet it's not what you really want. Imagine
you had a choice between being really smart but discovering nothing
new, and being less smart but discovering lots of new ideas. Surely
you'd take the latter. I would. The choice makes me uncomfortable,
but when you see the two options laid out explicitly like that,
it's obvious which is better.The reason the choice makes me uncomfortable is that being smart
still feels like the thing that matters, even though I know
intellectually that it isn't. I spent so many years thinking it
was. The circumstances of childhood are a perfect storm for fostering
this illusion. Intelligence is much easier to measure than the value
of new ideas, and you're constantly being judged by it. Whereas
even the kids who will ultimately discover new things aren't usually
discovering them yet. For kids that way inclined, intelligence is
the only game in town.There are more subtle reasons too, which persist long into adulthood.
Intelligence wins in conversation, and thus becomes the basis of
the dominance hierarchy.
[1]
Plus having new ideas is such a new
thing historically, and even now done by so few people, that society
hasn't yet assimilated the fact that this is the actual destination,
and intelligence merely a means to an end.
[2]Why do so many smart people fail to discover anything new? Viewed
from that direction, the question seems a rather depressing one.
But there's another way to look at it that's not just more optimistic,
but more interesting as well. Clearly intelligence is not the only
ingredient in having new ideas. What are the other ingredients?
Are they things we could cultivate?Because the trouble with intelligence, they say, is that it's mostly
inborn. The evidence for this seems fairly convincing, especially
considering that most of us don't want it to be true, and the
evidence thus has to face a stiff headwind. But I'm not going
to get into that question here, because it's the other ingredients
in new ideas that I care about, and it's clear that many of them
can be cultivated.That means the truth is excitingly different from the story I got
as a kid. If intelligence is what matters, and also mostly inborn,
the natural consequence is a sort of Brave New World fatalism. The
best you can do is figure out what sort of work you have an "aptitude"
for, so that whatever intelligence you were born with will at least
be put to the best use, and then work as hard as you can at it.
Whereas if intelligence isn't what matters, but only one of several
ingredients in what does, and many of those aren't inborn, things
get more interesting. You have a lot more control, but the problem
of how to arrange your life becomes that much more complicated.So what are the other ingredients in having new ideas? The fact
that I can even ask this question proves the point I raised earlier
— that society hasn't assimilated the fact that it's this and not
intelligence that matters. Otherwise we'd all know the answers
to such a fundamental question.
[3]I'm not going to try to provide a complete catalogue of the other
ingredients here. This is the first time I've posed
the question to myself this way, and I think it may take a while
to answer. But I wrote recently about one of the most important:
an obsessive interest in a particular topic.
And this can definitely be cultivated.Another quality you need in order to discover new ideas is
independent-mindedness. I wouldn't want to
claim that this is
distinct from intelligence — I'd be reluctant to call someone smart
who wasn't independent-minded — but though largely inborn, this
quality seems to be something that can be cultivated to some extent.There are general techniques for having new ideas — for example,
for working on your own projects
and
for overcoming the obstacles you face with early work
— and these
can all be learned. Some of them can be learned by societies. And
there are also collections of techniques for generating specific types
of new ideas, like startup ideas and
essay topics.And of course there are a lot of fairly mundane ingredients in
discovering new ideas, like working hard,
getting enough sleep, avoiding certain
kinds of stress, having the right colleagues, and finding tricks
for working on what you want even when it's not what you're supposed
to be working on. Anything that prevents people from doing great
work has an inverse that helps them to. And this class of ingredients
is not as boring as it might seem at first. For example, having new
ideas is generally associated with youth. But perhaps it's not youth
per se that yields new ideas, but specific things that come with
youth, like good health and lack of responsibilities. Investigating
this might lead to strategies that will help people of any age to
have better ideas.One of the most surprising ingredients in having new ideas is writing
ability. There's a class of new ideas that are best discovered by
writing essays and books. And that "by" is deliberate: you don't
think of the ideas first, and then merely write them down. There
is a kind of thinking that one does by writing, and if you're clumsy
at writing, or don't enjoy doing it, that will get in your way if
you try to do this kind of thinking.
[4]I predict the gap between intelligence and new ideas will turn out
to be an interesting place. If we think of this gap merely as a measure
of unrealized potential, it becomes a sort of wasteland that we try to
hurry through with our eyes averted. But if we flip the question,
and start inquiring into the other ingredients in new ideas that
it implies must exist, we can mine this gap for discoveries about
discovery.
Notes[1]
What wins in conversation depends on who with. It ranges from
mere aggressiveness at the bottom, through quick-wittedness in the
middle, to something closer to actual intelligence at the top,
though probably always with some component of quick-wittedness.[2]
Just as intelligence isn't the only ingredient in having new
ideas, having new ideas isn't the only thing intelligence is useful
for. It's also useful, for example, in diagnosing problems and figuring
out how to fix them. Both overlap with having new ideas, but both
have an end that doesn't.Those ways of using intelligence are much more common than having
new ideas. And in such cases intelligence is even harder to distinguish
from its consequences.[3]
Some would attribute the difference between intelligence and
having new ideas to "creativity," but this doesn't seem a very
useful term. As well as being pretty vague, it's shifted half a frame
sideways from what we care about: it's neither separable from
intelligence, nor responsible for all the difference between
intelligence and having new ideas.[4]
Curiously enough, this essay is an example. It started out
as an essay about writing ability. But when I came to the distinction
between intelligence and having new ideas, that seemed so much more
important that I turned the original essay inside out, making that
the topic and my original topic one of the points in it. As in many
other fields, that level of reworking is easier to contemplate once
you've had a lot of practice.
Thanks to <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, and <NAME> for reading drafts
of this.
|
|
https://github.com/dyc3/senior-design | https://raw.githubusercontent.com/dyc3/senior-design/main/visualization-design.typ | typst | = Visualization Design <Chapter::Visualization-Design>
The visualization serves a dual purpose: To communicate the functionality of the load balancer at a glance to a non-technical audience, and to serve as a useful debugging tool during development.
#figure(
image("figures/vis/DOM-class-visualization.svg"),
caption: "Class Diagram Explaining How a Component using React and D3.js is Rendered to the DOM"
) <Figure::DOM-class-visualization>
== Frameworks/Libraries
The visualization must be ready before the innovation exposition on April 26 and is not the main focus of the project. With this in mind D3.js, Grafana, and React have been selected for development.
#figure(
image("figures/vis/visualization-package.svg", width: 50%),
caption: "Package Diagram for Visualization"
) <Figure::visualization-package>
The figure above represents the three major libraries and frameworks utlized to create the visualization. Both Grafana and D3.js have dependencies on React in the context of creating a web-app (like the visualization) and one of the major technical challenges of creating the visualization will be integrating D3.js into a Grafana panel.
Below are some helpful links:
- D3.js Getting Started: https://d3js.org/getting-started
- Grafana Quick Start: https://grafana.com/developers/plugin-tools/
- Grafana Example Plugins: https://grafana.com/developers/plugin-tools/plugin-examples/
- Grafana and D3.js: https://community.grafana.com/t/build-a-panel-plugin-with-d3-js/35450
#figure(
table(
columns: 2,
[*View*],[*Graph Type*],
[Region], [D3.js Graph],
[Tree], [D3.js Graph],
[Topology], [D3.js Graph],
[Latency Graph], [Grafana Panel],
[Traffic Heat Map], [Grafana Panel],
[Traffic/Time], [Grafana Panel]
),
caption: "Visualization Views and Graph Type"
) <Table::visualization-types>
== Grafana
Grafana is an open source data motitoring platform allowing users to explore metrics from any storage location #cite(<grafana-basic-about>). In the context of the visualization, Grafana is a framework that does most of the heavy lifting associated with building a data visualization tool.
#figure(
image("figures/vis/visualization-class-high-level.svg", height: 30%),
caption: "High Level Class Diagram of Grafana Visualization Structure"
) <Figure::visualization-class-high-level>
Grafana contains dashboards, and dashboards contain panels, the "building blocks" of the platform. Panels have a data source that can be linked to a database and a query editor for performing operations on the source. Multiple queries can be configured to display multiple values (or graphs) within the same panel #cite(<grafana-panel-info>).
=== How Grafana Plugins Work
Grafana plugins are built using React, and are essentially a web application that is embedded into a Grafana dashboard. The plugin is a separate project from the dashboard, and is built using the Grafana Toolkit. The plugin is then added to a dashboard as a panel, and the dashboard is then added to a Grafana instance. The plugin is then able to query data from the Grafana instance, and display it in the panel. See @Figure::grafana-plugin-hierarchy.
#figure(
image("figures/vis/grafana-plugin-hierarchy.svg", height: 50%),
caption: "Class diagram showing the relationship between Grafana, the plugin, and dashboards."
) <Figure::grafana-plugin-hierarchy>
== D3.js
D3.js is an open source JavaScript library for visualizing data and has a low-level approach that gives the developer a lot of flexibility in how their data is displayed. D3.js is advertised as an alternative to doing it yourself, not as an alternative to a high-level charting library #cite(<d3-info>).
The reason for using this library is because of its embrace of web standards like SVG and to allow creation of visualizations that would be harder to implement into a Grafana panel without D3.js.
== Data Format
The visualization will need to receive an array of balancers:
```json
balancers = []
```
Each balancer must have a state, and from that state, the following is needed:
```json
balancer = {
monoliths: Monolith[],
region: string,
}
```
While not explicitly required, having a complete count of the number of clients would be helpful for the purposes of the traffic graph would be helpful. A way to measure and fetch server latency is also needed.
Each monolith contains rooms:
```json
monolith = {
rooms: Room[],
}
```
Each room has a name, and clients that are connected. The clients themselves are not necessary to be read by the visualization, but rather just the number and id of clients in each room:
```json
room = {
name: string,
clients: Client[],
}
```
```json
client = {
id: string
}
```
== Data Gathering
The load balancer is one part of a distributed system, and many instances of the Balancer can be active simultaneously. One instance of the visualization should have the capability of receiving information from multiple Balancers, and should do so in real time. Additionally, the visualization should have the capability of receiving data from both the official deployment of OTT on fly.io and self-hosted instances.
Grafana supports querying Prometheus, and supports custom data sources through its plugin system. Given the Balancer has already integrated Prometheus for metrics, this is the preferred method for gathering data. #cite(<grafana-prometheus-visualization>) Grafana is a tool primarily meant for time series data, and no current data source plugins support receiving the type of information needed. To add support, a custom data source must be created.
The Collector will be responsible for querying the Balancer for the data needed to display the visualization.
=== Balancer Discovery
While the visualization is running, multiple instances of the Balancer can be active simultaneously, new instances can become active, and instances can go offline. The network addresses of these Balancers are not known at runtime, so the Collector must perform service discovery (as described in @Chapter::ServiceDiscovery). It must run as a prerequisite in order to collect data from the Balancers.
=== Querying Balancers
After the Collector has discovered the Balancers, it must query them for the data needed to display the visualization. The data source will then query the Collector for the data.
#figure(
image("figures/vis/visualization-balancer-datasource-sequence.svg"),
caption: "Sequence Diagram Explaining How Grafana Receives Data From Load Balancers"
) <Figure::visualization-balancer-datasource-sequence>
== Development Schedule
#figure(
table(
columns: 2,
[*Milestone*],[*Date*],
[Design Finalized],[1/20/24],
[Prototype],[1/30/24],
[Views Finished],[2/20/24],
[Testing/Refactoring],[3/5/24],
[Visualization Complete],[3/12/24],
),
caption: "Development Schedule for Graph Visualizer"
) <Table::visualization-dev-schedule>
== Panel Structure
The custom panel will be structured as shown in @Figure::panel-internal-class. It will be able to render the region view (@Figure::region-view), the tree view (@Figure::tree-view), and the topology view (@Figure::topology-view). The panel will provide a selector in `PanelOptions` to switch between the views.
#figure(
image("figures/vis/panel-internal-class.svg", height: 80%),
caption: "Class diagram of the custom Grafana panel, showing it's internal structure."
) <Figure::panel-internal-class>
== Streamed Events
The visualization will be able to receive streamed events from the Balancers for realtime updates of the visualization. The collector is responsible for receiving these events and passing them to the datasource via WebSockets. The panel will then update the visualization accordingly. @Figure::vis-collector-component shows how the collector interacts with the visualization.
#figure(
image("figures/vis/vis-collector-component.svg"),
caption: [Component diagram showing the internal components of the collector and how they interact with the rest of the system.]
) <Figure::vis-collector-component>
In the Balancer, events are sourced directly from the Balancer's logs via a `Layer` from the `tracing` crate.
== Dev Environment
#import "balancer-design.typ": text-box
There are 4 components that need to be running in order to have the visualization working correctly:
+ Grafana instance
+ Collector
+ Balancer
+ Monolith
See @Section::dev-env for instructions on running the Monolith with the Balancer.
#block(breakable: false)[
The easiest way to do this is with the `with-balancer.docker-compose.yml` file. This file will run the balancer, monolith, and collector in a docker-compose environment.
#text-box([
```bash
docker-compose -f docker/with-balancer.docker-compose.yml up -d
```
])
]
#let vis-dev-env-figure(path, caption, balancer-config, collector-config, commands) = {
figure(
grid(
columns: 2,
gutter: 20pt,
image(path),
align(left)[
#grid(
gutter: 10pt,
[
`balancer.toml`
#text-box(
raw(balancer-config, lang: "toml"),
)
],
[
`collector.toml`
#text-box(
raw(collector-config, lang: "toml"),
)
],
[
`Commands to run:`
#text-box(
raw(commands, lang: "bash"),
)
]
)
]
),
caption: caption,
)
}
#vis-dev-env-figure(
"figures/dev-env/vis-dev-env-docker.svg",
"Visualization Development Environment Setup (with docker)",
read("data/dev-env/balancer.docker.toml"),
read("data/dev-env/collector.docker.toml"),
read("data/dev-env/commands-vis-docker.txt"),
) <Figure::vis-dev-env-docker>
Alternatively, @Figure::vis-dev-env-no-docker shows how to run the balancer, monolith, and collector without docker.
#vis-dev-env-figure(
"figures/dev-env/vis-dev-env-no-docker.svg",
"Visualization Development Environment Setup (without docker)",
read("data/dev-env/balancer.no-docker.toml"),
read("data/dev-env/collector.no-docker.toml"),
read("data/dev-env/commands-vis-no-docker.txt"),
) <Figure::vis-dev-env-no-docker>
#block(breakable: false)[
=== Checklist
- Ensure Grafana is accessible at #link("http://localhost:3500")
- Ensure both the datasource and panel have been built
- Ensure the balancer is running
- Make sure an api key is set in the config
- Ensure the monolith is running
- Make sure load balancing is enabled
- Ensure the collector is running and accessible at #link("http://localhost:8000")
- Make sure the collector is configured with the balancer's api key
]
|
|
https://github.com/ClazyChen/Table-Tennis-Rankings | https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2010/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], [MA Long], [CHN], [3264],
[2], [WANG Hao], [CHN], [3140],
[3], [ZHANG Jike], [CHN], [3090],
[4], [MA Lin], [CHN], [3074],
[5], [WANG Liqin], [CHN], [3064],
[6], [BOLL Timo], [GER], [3054],
[7], [XU Xin], [CHN], [3003],
[8], [JOO Saehyuk], [KOR], [2986],
[9], [<NAME>], [BLR], [2967],
[10], [HAO Shuai], [CHN], [2939],
[11], [CHEN Qi], [CHN], [2930],
[12], [MIZUTANI Jun], [JPN], [2916],
[13], [<NAME>], [DEN], [2791],
[14], [APOLONIA Tiago], [POR], [2751],
[15], [RYU Seungmin], [KOR], [2750],
[16], [KISHIKAWA Seiya], [JPN], [2728],
[17], [KO Lai Chak], [HKG], [2726],
[18], [OVTCHAROV Dimitrij], [GER], [2720],
[19], [TANG Peng], [HKG], [2719],
[20], [CHUANG Chih-Yuan], [TPE], [2696],
[21], [GAO Ning], [SGP], [2691],
[22], [<NAME>], [KOR], [2689],
[23], [CHT<NAME>], [BLR], [2684],
[24], [SMIRNOV Alexey], [RUS], [2681],
[25], [<NAME>], [JPN], [2670],
[26], [<NAME>], [GER], [2661],
[27], [<NAME>], [ROU], [2644],
[28], [<NAME>], [HKG], [2642],
[29], [<NAME>], [RUS], [2637],
[30], [SEO Hyundeok], [KOR], [2636],
[31], [<NAME>], [SLO], [2620],
[32], [<NAME>], [AUT], [2618],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (33 - 64)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[33], [YOON Jaeyoung], [KOR], [2617],
[34], [HOU Yingchao], [CHN], [2610],
[35], [GIONIS Panagiotis], [GRE], [2590],
[36], [OH Sangeun], [KOR], [2585],
[37], [KREANGA Kalinikos], [GRE], [2584],
[38], [UEDA Jin], [JPN], [2584],
[39], [CHEN Weixing], [AUT], [2570],
[40], [KIM Junghoon], [KOR], [2566],
[41], [<NAME>], [SWE], [2553],
[42], [<NAME>], [CRO], [2546],
[43], [<NAME>], [CZE], [2534],
[44], [<NAME>], [QAT], [2531],
[45], [#text(gray, "QIU Yike")], [CHN], [2514],
[46], [PROKOPCOV Dmitrij], [CZE], [2513],
[47], [<NAME>], [KOR], [2488],
[48], [<NAME>], [KOR], [2486],
[49], [<NAME>], [GER], [2478],
[50], [KIM Minseok], [KOR], [2473],
[51], [<NAME>], [ESP], [2468],
[52], [<NAME>], [HUN], [2468],
[53], [<NAME>], [CZE], [2461],
[54], [<NAME>], [JPN], [2460],
[55], [<NAME>], [POR], [2458],
[56], [<NAME>], [GER], [2457],
[57], [<NAME>], [KOR], [2455],
[58], [RUBTSOV Igor], [RUS], [2449],
[59], [CHEUNG Yuk], [HKG], [2448],
[60], [<NAME>], [JPN], [2444],
[61], [KIM <NAME>], [PRK], [2443],
[62], [FEJER-KONNERTH Zoltan], [GER], [2439],
[63], [VLASOV Grigory], [RUS], [2436],
[64], [<NAME>], [SRB], [2435],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (65 - 96)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[65], [<NAME>u], [DOM], [2434],
[66], [WANG Zengyi], [POL], [2432],
[67], [JEOUNG Youngsik], [KOR], [2424],
[68], [YAN An], [CHN], [2424],
[69], [<NAME>], [ARG], [2421],
[70], [<NAME>], [FRA], [2421],
[71], [<NAME>], [AUT], [2416],
[72], [<NAME>], [SWE], [2415],
[73], [<NAME>], [FRA], [2404],
[74], [<NAME>], [KOR], [2401],
[75], [<NAME>], [CRO], [2385],
[76], [<NAME>], [CZE], [2381],
[77], [<NAME>], [FRA], [2381],
[78], [<NAME>], [BEL], [2371],
[79], [<NAME>], [SVK], [2371],
[80], [<NAME>], [SWE], [2370],
[81], [<NAME>], [HKG], [2366],
[82], [<NAME>], [CRO], [2365],
[83], [<NAME>], [AUS], [2363],
[84], [<NAME>], [SGP], [2361],
[85], [LUNDQV<NAME>], [SWE], [2360],
[86], [<NAME>], [SRB], [2359],
[87], [BLASZCZYK Lucjan], [POL], [2359],
[88], [<NAME>], [JPN], [2357],
[89], [<NAME>], [PRK], [2355],
[90], [<NAME>], [ESP], [2351],
[91], [<NAME>], [RUS], [2351],
[92], [<NAME>], [KOR], [2349],
[93], [<NAME>], [HUN], [2345],
[94], [<NAME>], [SVK], [2334],
[95], [<NAME>], [SVK], [2325],
[96], [TAKAKIWA Taku], [JPN], [2323],
)
)#pagebreak()
#set text(font: ("Courier New", "NSimSun"))
#figure(
caption: "Men's Singles (97 - 128)",
table(
columns: 4,
[Ranking], [Player], [Country/Region], [Rating],
[97], [<NAME>], [CZE], [2321],
[98], [<NAME>], [BRA], [2321],
[99], [TSUBOI Gustavo], [BRA], [2319],
[100], [PLATONOV Pavel], [BLR], [2318],
[101], [<NAME>], [DEN], [2317],
[102], [<NAME>], [SRB], [2317],
[103], [LASHIN El-Sayed], [EGY], [2315],
[104], [<NAME>], [GER], [2314],
[105], [<NAME>], [HKG], [2313],
[106], [<NAME>], [FRA], [2312],
[107], [<NAME>], [SGP], [2312],
[108], [KASAHARA Hiromitsu], [JPN], [2309],
[109], [JANG Song Man], [PRK], [2302],
[110], [<NAME>], [JPN], [2301],
[111], [BURGIS Matiss], [LAT], [2300],
[112], [MATSUDAIRA Kenji], [JPN], [2296],
[113], [CHIANG Peng-Lung], [TPE], [2293],
[114], [<NAME>], [GER], [2291],
[115], [<NAME>], [MEX], [2288],
[116], [<NAME>], [SVK], [2288],
[117], [LIVENTSOV Alexey], [RUS], [2287],
[118], [KOSOWSKI Jakub], [POL], [2287],
[119], [<NAME>], [IND], [2286],
[120], [SHIBAEV Alexander], [RUS], [2285],
[121], [HUANG Sheng-Sheng], [TPE], [2276],
[122], [LIM Jaehyun], [KOR], [2275],
[123], [<NAME>], [SVK], [2274],
[124], [CHIANG Hung-Chieh], [TPE], [2272],
[125], [AGUIRRE Marcelo], [PAR], [2263],
[126], [TORIOLA Segun], [NGR], [2259],
[127], [<NAME>], [BEL], [2256],
[128], [#text(gray, "LEI Zhenhua")], [CHN], [2255],
)
) |
|
https://github.com/tinnamchoi/resumes | https://raw.githubusercontent.com/tinnamchoi/resumes/master/src/resume.typ | typst | #import "preamble.typ": *
#show: doc => template(doc)
#set page(margin: 0.75cm)
#header(name: name, links: links)
#v(1fr)
#state("center_style").update(40%)
= Education
#education(
institution: "Technical University of Munich",
degree: "Informatics (Exchange)",
location: "Munich, Germany",
from: "2024 Apr",
to: "2025 Mar",
)
#education(
institution: "The University of Adelaide",
degree: "Bachelor of Mathematical and Computer Sciences",
grade: "GPA: 6.33/7",
location: "Adelaide, Australia",
from: "2022 Feb",
to: "2025 Sep",
)
= Experience
#experience(
company: "Dassault Systèmes",
role: "Software Engineering Working Student",
location: "Munich, Germany",
technologies: "C++, mkmk, Jira, BitBucket, NG Jenkins, Python, Rust",
from: "2024 May",
)
- Improve the interface of debug tools in C++, reducing development time for the team
- Streamline the process of test case generation with Python, reducing over 90% of the manual work
- Develop CI/CD tools in Rust to reduce local build time by 80%
#experience(
company: "Altacomm Technologies",
role: "Software Engineering Intern",
location: "Adelaide, Australia",
technologies: "Rust, Actix, Astro, GitHub Actions",
from: "2024 Jan",
to: "2024 Mar",
)
- Empower student communities by streamlining the logistical processes
- Built a full-stack contact us and media release page
#experience(
company: "Global Technology Integrator",
role: "System Engineer",
location: "Hong Kong",
technologies: "Batch, Windows AD, Project Management",
from: "2021 Aug",
to: "2021 Nov",
)
- Leading a team of 4+ people, spearheaded the automation and parallelization of our tasks
- Helped resolve our staff shortage by reducing the manpower and time required by \~200%
- Mentored new staff, helping them understand the technology
= Projects
#project(
title: "Block Model Compression Algorithm",
technologies: "C++, Algorithm Design, Linux",
project_link: "tinnamchoi.github.io/projects/bmca",
)
- Implemented octrees to compress 3D data in $O(N log_8 N)$ time
- Employed agile methodologies for a group of 7 and enforced good Git practices such as using conventional commits
#project(
title: "Negative Base Converter",
technologies: "Math, Number Theory, JavaScript",
project_link: "tinnamchoi.github.io/projects/nbc",
)
- Exploring a numeral system that can represent negative numbers without a negative sign
- Motivated by the lack of existing tools, providing beginners with a better understanding of negative bases
#project(
title: "Binary Search on Color",
technologies: "Algorithm Design, JavaScript",
project_link: "tinnamchoi.github.io/projects/bsoc",
)
- Devised an algorithm that allows people to search the modern color space of over 16 million colors in just 24 clicks
- Inspired by the lack of precision in existing tools, providing a better imagination to reality interface
#project(
title: "Hare-Clark C++",
technologies: "C++, CMake, Data Structures",
project_link: "tinnamchoi.github.io/projects/hcc",
)
- Created for the CS Club committee to verify the results of the `hcvote` Python library
- After discovering multiple mistakes in the original library, I decided to release this as a better alternative
= Volunteering
#experience(
company: "Adelaide Rover Team",
role: "Software Developer",
location: "Adelaide, Australia",
technologies: "C++, ROS, Git, Linux",
from: "2023 Jul",
)
- We participate in the Australian Rover Challenge, an annual competition where university students compete in a simulated lunar mission using semi-autonomous rovers that we design and build. Sponsored by Boeing, Caterpillar Inc. (CAT), and more.
#experience(
company: "UNIHACK",
role: "Organizer",
location: "Australia (remote)",
technologies: "Slack",
from: "2023 Apr",
)
- We are the largest hackathon in Australia, where students from all over the country come together to build projects in a weekend, with sponsors from Atlassian, AWS, and more
#experience(
company: "The University of Adelaide Computer Science Club",
role: "Committee member",
location: "Adelaide, Australia",
technologies: "Python, Web Development",
from: "2022 Dec",
)
- As the only club in the university with a dedicated club room on campus, we frequently organize workshops and social events for over 500 members with sponsors from Jane Street, Citadel Securities, VivCourt, and more.
= Skills & Achievements
== Skills & Technologies
#technologies(
daily_drivers: "C++, Linux, Git, Just, Typst, GitHub",
others: "Python, JavaScript, Atlassian suite, Bash, Rust, LaTeX, HTML, CSS",
)
#skill(title: "Human languages")[English (native), Cantonese (native), Mandarin (C1), German (A2)]
== Prizes & Achievements
#achievement(
title: "Subject prize",
subtitle: "Information and Communication Technology 2021"
)[
Achiever of the best results amongst peers
]
#achievement(
title: "University of Adelaide Scholarship",
subtitle: "30% Global Citizens Scholarship"
)[
Best possible scholarship for international students
]
|
|
https://github.com/tingerrr/hydra | https://raw.githubusercontent.com/tingerrr/hydra/main/src/util/assert.typ | typst | MIT License | #import "/src/util/core.typ" as _core
#import _core: queryable-functions as _queryable-functions
/// Assert that `value` is any of the given `expected-values`.
///
/// - name (str): The name use for the value in the assertion message.
/// - value (any): The value to check for.
/// - message (str, auto): The assertion message to use.
/// - ..expected-values (type): The expected variants of `value`.
#let enum(name, value, ..expected-values, message: auto) = {
expected-values = expected-values.pos()
let message = _core.or-default(check: auto, message, () => if expected-values.len() == 1 {
_core.fmt("`{}` must be `{}`, was `{}`", name, expected-values.first(), value)
} else {
_core.fmt(
"`{}` must be one of {}, was `{}`",
name,
expected-values.map(_core.fmt.with("`{}`")).join(", ", last: " or "),
value,
)
})
assert(value in expected-values, message: message)
}
/// Assert that `value` is of any of the given `expected-types`.
///
/// - name (str): The name use for the value in the assertion message.
/// - value (any): The value to check for.
/// - message (str, auto): The assertion message to use.
/// - ..expected-types (type): The expected types of `value`.
#let types(name, value, ..expected-types, message: auto) = {
let given-type = type(value)
expected-types = expected-types.pos().map(t => if t == none {
type(none)
} else if t == auto {
type(auto)
} else {
t
})
let message = _core.or-default(check: auto, message, () => if expected-types.len() == 1 {
_core.fmt("`{}` must be a `{}`, was `{}`", name, expected-types.first(), given-type)
} else {
_core.fmt(
"`{}` must be one of a {}, was `{}`",
name,
expected-types.map(_core.fmt.with("`{}`")).join(", ", last: " or "),
given-type,
)
})
assert(given-type in expected-types, message: message)
}
/// Assert that `element` is an element creatd by one of the given `expected-funcs`.
///
/// - name (str): The name use for the value in the assertion message.
/// - element (any): The value to check for.
/// - message (str, auto): The assertion message to use.
/// - ..expected-funcs (type): The expected element functions of `element`.
#let element(name, element, ..expected-funcs, message: auto) = {
let given-func = element.func()
expected-funcs = expected-funcs.pos()
let message = _core.or-default(check: auto, message, () => if expected-funcs.len() == 1 {
_core.fmt("`{}` must be a `{}`, was `{}`", name, expected-funcs.first(), given-func)
} else {
_core.fmt(
"`{}` must be one of a {}, was `{}`",
name,
expected-funcs.map(_core.fmt.with("`{}`")).join(", ", last: " or a"),
given-func,
)
})
types(name, element, content, message: message)
assert(given-func in expected-funcs, message: message)
}
/// Assert that `value` can be used in `query`.
///
/// - name (str): The name use for the value in the assertion message.
/// - value (any): The value to check for.
/// - message (str, auto): The assertion message to use.
#let queryable(name, value, message: auto) = {
let given-type = type(value)
let message = _core.or-default(check: auto, message, () => _core.fmt(
"`{}` must be queryable, such as an element function, selector or label, `{}` is not queryable",
name,
given-type,
))
types(name, value, label, function, selector, message: message)
if type(value) == function {
let message = _core.or-default(check: auto, message, () => {
_core.fmt("`{}` is not an element function, was `{}`", name, value)
})
assert(value in _queryable-functions, message: message)
}
}
|
https://github.com/rabotaem-incorporated/algebra-conspect-1course | https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/03-polynomials/!sec.typ | typst | Other | #import "../../config.typ"
#if config.enable-chapters-from-sem1 [
= Многочлены
#include "01-polys-power-series.typ"
#include "02-deg-props.typ"
#include "03-div-with-remainder.typ"
#include "04-subs-homomorphism.typ"
#include "05-euclidian-rings.typ"
#include "06-principal-ideals.typ"
#include "07-multiroots-and-derivatives.typ"
#include "08-taylor-series.typ"
#include "09-alg-closed-field.typ"
#include "10-rational-fractions.typ"
#include "11-interpolation.typ"
] |
https://github.com/ayoubelmhamdi/typst-phd-AI-Medical | https://raw.githubusercontent.com/ayoubelmhamdi/typst-phd-AI-Medical/master/functions.typ | typst | MIT License | #let heading_center(title) = {
v(0.5em)
align(
center,
text(
fill: rgb("#1e045b"),
weight: "bold",
size:22pt,
title
)
)
v(3em)
}
#let linkb(the_link,text) = {
show link: underline
link(the_link)[#text]
}
#let counter_image = counter(figure.where(kind: image))
#let images(filename:"", caption:[], width:100%, height: none, ref:none) = {
height = if height != none { height } else{ auto }
figure(
image(filename, width: width, height:height),
caption: caption,
)
}
#let italic(it) = [
#set text(style: "italic")
#it
]
#let dots = [
#box(width: 1fr,repeat[.])
#linebreak()
]
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/footnote-invariant_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
#set page(height: 120pt)
#lorem(13)
There #footnote(lorem(20))
|
https://github.com/Mc-Zen/quill | https://raw.githubusercontent.com/Mc-Zen/quill/main/tests/decorations/midstick/test.typ | typst | MIT License | #set page(width: auto, height: auto, margin: 0pt)
#import "/src/quill.typ": *
#quantum-circuit(
1, $H$, midstick($ρ$), $X$
)
#pagebreak()
#quantum-circuit(
1, $H$, midstick($ρ$, fill: blue, label: ("label")), $X$
)
#pagebreak()
#quantum-circuit(
baseline: .6fr,
1, ctrl(1), targ(), ctrl(1), midstick("=", n: 2), swap(1), 1, [\ ],
1, targ(), ctrl(-1), targ(), 1, swap(0), 1,
) |
https://github.com/Bi0T1N/typst-iconic-salmon-svg | https://raw.githubusercontent.com/Bi0T1N/typst-iconic-salmon-svg/main/examples/examples.typ | typst | MIT License | #import "../iconic-salmon-svg.typ": *
= Usage Examples
== Facebook
#facebook-info("NEFFEX", url: "https://www.facebook.com/Neffexmusic/")
#h(1cm)
#facebook-info("NEFFEX", url: "https://www.facebook.com/Neffexmusic", blue)
== Instagram
#instagram-info("janlo.pulling_pictures")
#h(0.5cm)
#instagram-info("janlo.pulling_pictures", purple)
#h(0.5cm)
#instagram-info("Jan Lo - Tractor-Pulling Media „<NAME>“", url: "https://www.instagram.com/janlo.pulling_pictures/")
== TikTok
#tiktok-info("neffex", green, style: "italic")
#h(1cm)
#tiktok-info("NEFFEX", url: "https://www.tiktok.com/@neffex/", font: "DejaVu Sans")
== YouTube
#youtube-info("floatingfinish2211")
#h(1cm)
#youtube-info("floatingfinish2211", rgb("#0033cc"), weight: "bold")
#h(1cm)
#youtube-info("Floating Finish", url: "https://www.youtube.com/@floatingfinish2211", green)
== Vimeo
#vimeo-info("osrfoundation")
#h(1cm)
#vimeo-info("Open Robotics", url: "https://vimeo.com/osrfoundation/")
== LinkedIn
#linkedin-info("BMW Group", url: "https://www.linkedin.com/company/bmw-group/", rgb("0166B1"))
== XING
#xing-info("CLAAS", url: "https://www.xing.com/pages/claas")
#h(1cm)
#xing-info("ABB Deutschland", url: "https://www.xing.com/pages/abbde")
== GitHub
#github-info("Bi0T1N")
#h(1cm)
#github-info("Bi0T1N", rgb("#ffcc00"))
#h(1cm)
#github-info("Bi0T1N", green)
== GitLab
#gitlab-info("Bi0T1N")
#h(1cm)
#gitlab-info("Bi0T1N", rgb("#811052"))
#h(1cm)
#gitlab-info("Bi0T1N", green)
#h(1cm)
#gitlab-info("Bi0T1N", url: "https://gitlab.com/Bi0T1N/fpc-docker")
== Bitbucket
#bitbucket-info("karaiskc")
#h(1cm)
#bitbucket-info("karaiskc", url: "https://bitbucket.org/karaiskc/ros-sensor-info-viewer-and-logger/")
== Codeberg
#codeberg-info("biotite-dev")
== SourceForge
#sourceforge-info("Lazarus", url: "https://sourceforge.net/projects/lazarus/")
== Docker
#docker-info("rust", url: "https://hub.docker.com/_/rust", rgb("b7410e"))
#h(1cm)
#docker-info("Bi0T1N", url: "https://hub.docker.com/u/bi0t1n")
#h(1cm)
#docker-info("debian", url: "https://hub.docker.com/_/debian", red)
== Stack Overflow
#stackoverflow-info("Remy Lebeau", url: "https://stackoverflow.com/users/65863/remy-lebeau")
#h(1cm)
#stackoverflow-info("Bi0T1N", url: "https://stackoverflow.com/users/20742512/bi0t1n", orange)
== Stack Exchange
#stackexchange-info("<NAME>", url: "https://scifi.stackexchange.com/users/42754/remy-lebeau")
#h(1cm)
#stackexchange-info("Bi0T1N", url: "https://robotics.stackexchange.com/users/33077/bi0t1n")
== Skype
#skype-info("callme")
== Discord
#discord-info("messageme")
== Twitter
#twitter-info("elonmusk", rgb("#663300"))
#h(1cm)
#twitter-info("<NAME>", url: "https://twitter.com/elonmusk/", rgb("#663300"))
== X / Twitter
#x-twitter-info("elonmusk", rgb("#663300"))
#h(1cm)
#x-twitter-info("<NAME>", url: "https://twitter.com/elonmusk/", rgb("#663300"))
== ORCID
#orcid-info("0000-0002-1825-0097")
#h(1cm)
#orcid-info("<NAME>", url: "https://orcid.org/0000-0002-1825-0097", green)
== TryHackMe
#tryhackme-info("Bi0T1N", url: "https://tryhackme.com/p/Bi0T1N")
#h(1cm)
#tryhackme-info("Bi0T1N", url: "https://tryhackme.com/p/Bi0T1N", filename: "tryhackme_logo_icon_249349.svg")
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/glossarium/0.1.0/glossarium.typ | typst | Apache License 2.0 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
// glossarium figure kind
#let __glossarium_figure="glossarium_entry"
// prefix of label for retreiving of references
#let __glossary_label_prefix = "glossary:"
// global state constaining the glossary entry and their location
#let __glossary_entries = state("__glossary_entries", (:))
#let __query_labels_with_key(loc, key, before: false) = {
if before {
query(
selector(label(__glossary_label_prefix + key)).before(loc, inclusive: false),
loc,
)
} else {
query(
selector(label(__glossary_label_prefix + key)),
loc,
)
}
}
// Reference a term
#let gls(key, suffix: none, long: auto) = {
locate(
loc => {
let __glossary_entries = __glossary_entries.final(loc);
if key in __glossary_entries {
let entry = __glossary_entries.at(key)
let gloss = __query_labels_with_key(loc, key, before: true)
let is_first = gloss == ();
let entlong = entry.at("long", default: "")
let textLink = if (is_first or long == true) and entlong != [] and entlong != "" {
[ #entry.short#suffix (#emph(entlong))]
} else {
[#entry.short#suffix ]
}
[
#link(label(entry.key))[#textLink]
#label(__glossary_label_prefix + entry.key)
]
} else {
text(fill: red, "Glossary entry not found: " + key)
}
},
)
}
// reference to term with pluralisation
#let glspl(key) = gls(key, suffix: "s")
// show rule to make the references for glossarium
#let make-glossary(body) = {
show ref: r => {
if r.element != none and r.element.func() == figure and r.element.kind == __glossarium_figure {
// call to the general citing function
gls(str(r.target), suffix: r.citation.supplement)
} else {
r
}
}
body
}
#let print-glossary(entries) = {
__glossary_entries.update(
(x) => {
for entry in entries {
x.insert(
entry.key,
(
key: entry.key,
short: entry.short,
long: entry.long,
),
)
}
x
},
)
for entry in entries.sorted(key: (x) => x.key) {
[
#show figure.where(kind: __glossarium_figure): it => it.caption
#par(
hanging-indent: 1em,
)[
#figure(
supplement: "",
kind: __glossarium_figure,
caption: {
{
set text(weight: 600)
let long = entry.at("long", default: "")
if long != "" and long != [] [
#emph(entry.short) - #entry.long:
] else [
#emph(entry.short):
]
}
entry.at("desc", default: "")
locate(
loc => {
__query_labels_with_key(loc, entry.key)
.map((x) => x.location())
.sorted(key: (x) => x.page())
.fold(
(values: (), pages: ()),
((values, pages), x) => if pages.contains(x.page()) {
(values: values, pages: pages)
} else {
values.push(x)
pages.push(x.page())
(values: values, pages: pages)
},
)
.values
.map(
(x) => link(
x,
)[#numbering(x.page-numbering(), ..counter(page).at(x))],
)
.join(", ")
},
)
},
)[] #label(entry.key)
]
#parbreak()
]
}
};
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz/0.0.1/matrix.typ | typst | Apache License 2.0 | #import "vector.typ"
#let cos(angle) = {
return calc.round(calc.cos(angle), digits: 10)
}
#let sin = calc.sin
#let pi = calc.pi
// Create identity matrix with dim `m`, `n`
#let ident(m: 4, n: 4, one: 1, zero: 0) = {
({for m in range(0, m) {
({for n in range(0, n) {
if m == n { (one,) } else { (zero,) }
}},)
}})
}
// Return matrix dimension (m, n)
#let dim(m) = {
return (m.len(), if m.len() > 0 {m.at(0).len()} else {0})
}
// Return 4x4 translation matrix
#let transform-translate(x, y, z) = {
((1, 0, 0, x),
(0, 1, 0, y),
(0, 0, 1, z),
(0, 0, 0, 1))
}
// Return 4x4 z-shear matrix
#let transform-shear-z(factor) = {
((1, 0, factor, 0),
(0, 1,-factor, 0),
(0, 0, 1, 0),
(0, 0, 0, 1))
}
// Return 4x4 scale matrix
#let transform-scale(f) = {
let (x, y, z) = if type(f) != "dictionary" {
(f, f, f)
} else {
(f.at("x", default: 1),
f.at("y", default: 1),
f.at("z", default: 1))
}
return(
(x, 0, 0, 0),
(0, y, 0, 0),
(0, 0, z, 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate x matrix
#let transform-rotate-x(angle) = {
// let (cos, sin) = (calc.cos, calc.sin)
((1, 0, 0, 0),
(0, cos(angle), -sin(angle), 0),
(0, sin(angle), cos(angle), 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate y matrix
#let transform-rotate-y(angle) = {
// let (cos, sin) = (calc.cos, calc.sin)
((cos(angle), 0, -sin(angle), 0),
(0, 1, 0, 0),
(sin(angle), 0, cos(angle), 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate z matrix
#let transform-rotate-z(angle) = {
// let (cos, sin) = (calc.cos, calc.sin)
((cos(angle), -sin(angle), 0, 0),
(sin(angle), cos(angle), 0, 0),
(0, 0, 1, 0),
(0, 0, 0, 1))
}
// Return 4x4 rotate xz matrix
#let transform-rotate-xz(x, z) = {
// let (pi, cos, sin) = (calc.pi, calc.cos, calc.sin)
((cos(z), sin(z), 0, 0),
(-cos(x)*sin(z), cos(x)*cos(z), -sin(x), 0),
(sin(x)*sin(z), -sin(x)*cos(z), cos(x), 1),
(0, 0, 0, 1))
}
// Return 4x4 rotate xyz matrix
#let transform-rotate-xyz(x, y, z) = {
// let (pi, cos, sin) = (calc.pi, calc.cos, calc.sin)
((cos(x)*cos(y)*cos(z)-sin(x)*sin(z),
-cos(x)*cos(y)*sin(z)-sin(x)*cos(z),
cos(x)*sin(y), 0),
(sin(x)*cos(y)*cos(z)+cos(x)*sin(z),
-sin(x)*cos(y)*sin(z)+cos(x)*cos(z),
sin(x)*sin(y), 0),
(-sin(y)*cos(z),
sin(y)*sin(z),
cos(y), 0),
(0, 0, 0, 1))
}
// Multiply matrix with matrix
#let mul-mat(a, b) = {
let (dim-a, dim-b) = (a, b).map(dim)
let (m, n, p) = (
..dim-a,
dim-b.last()
)
(
for i in range(m) {
(
for j in range(p) {
(range(n).map(k => a.at(i).at(k) * b.at(k).at(j)).sum(),)
}
,)
}
)
}
// Multiply matrix with vector
#let mul-vec(mat, vec) = {
if mat.len() != vector.dim(vec) {
panic("matrix m must be equal to vector dim")
}
let new = (0, 0, 0, 1)
for m in range(0, mat.len()) {
let v = 0
for n in range(0, vector.dim(vec)) {
v += vec.at(n) * mat.at(m).at(n)
}
new.at(m) = v
}
return new
}
#let inverse(matrix) = {
let n = {
let size = dim(matrix)
assert.eq(size.first(), size.last(), message: "Matrix must be square to perform inversion.")
size.first()
}
let N = range(n)
let inverted = ident(m: n, n: n)
let p
for j in N {
for i in range(j, n) {
if matrix.at(i).at(j) != 0 {
(matrix.at(j), matrix.at(i)) = (matrix.at(i), matrix.at(j))
(inverted.at(j), inverted.at(i)) = (inverted.at(i), inverted.at(j))
p = 1 / matrix.at(j).at(j)
for k in N {
matrix.at(j).at(k) *= p
inverted.at(j).at(k) *= p
}
for L in N {
if L != j {
p = -matrix.at(L).at(j)
for k in N {
matrix.at(L).at(k) += p * matrix.at(j).at(k)
inverted.at(L).at(k) += p * inverted.at(j).at(k)
}
}
}
}
}
}
return inverted
}
|
https://github.com/Myriad-Dreamin/shiroa | https://raw.githubusercontent.com/Myriad-Dreamin/shiroa/main/github-pages/docs/format/supports/cross-ref.typ | typst | Apache License 2.0 | #import "/github-pages/docs/book.typ": book-page, cross-link, heading-reference
#show: book-page.with(title: "Typst Supports - Cross Reference")
// begin of sample
#let p = "/format/supports/cross-ref-sample.typ"
- #cross-link(p)[cross reference to the sample page]
#let sub = heading-reference[== Subsection]
- #cross-link(p, reference: sub)[cross reference to ```typ == Subsection``` in the sample page]
#let ref-head = "== Math equation $f = lambda x . x$ in heading"
#let sub = heading-reference(eval(ref-head, mode: "markup"))
- #cross-link(p, reference: sub)[cross reference to #raw(lang: "typ", ref-head) in the sample page]
// end of sample
== List of Code
#raw(lang: "typ", read("cross-ref.typ").find(regex("// begin of sample[\s\S]*?// end of sample")).replace("\r", "").slice(18, -16).trim(), block: true)
|
https://github.com/isaacholt100/isaacholt | https://raw.githubusercontent.com/isaacholt100/isaacholt/main/public/maths-notes/template.typ | typst | MIT License | #import "@preview/lemmify:0.1.5": *
#import "@preview/polylux:0.3.1": *
#let thm-style-proof(
thm-type,
name,
number,
body
) = block(width: 100%, breakable: true)[#{
emph(thm-type) + "."
if number != none {
strong(number) + " "
}
if name != none {
emph[(#name)] + " "
}
" " + body + h(1fr) + $square$
}]
#let thm-style-simple(
thm-type,
name,
number,
body
) = {
if thm-type == "Proof (Hints)" {
return thm-style-proof(thm-type, name, none, body)
}
return block(width: 100%, breakable: true)[#{
strong(thm-type)
if number != none {
// " " + strong(number)
}
if name != none {
" " + [(#name)]
}
". " + body
}]
}
#let (
theorem, lemma, corollary, definition, remark, proposition, example, proof, rules: thm-rules
) = default-theorems("thm-group", lang: "en", proof-styling: thm-style-proof, thm-styling: thm-style-simple)
#let (algorithm, note, notation, exercise, fact, axiom, proofhints, problem, rules) = new-theorems("thm-group", ("algorithm": [Algorithm], "note": [Note], "notation": [Notation], "exercise": [Exercise], "fact": [Fact], "axiom": [Axiom], "proofhints": "Proof (Hints)", "problem": [Problem]), thm-styling: thm-style-simple)
#let template(doc, hidden: ("proof", ), slides: false) = {
set text(
font: "New Computer Modern",
size: if slides { 24pt } else { 12pt },
)
set page(paper: if slides {
"presentation-16-9"
} else {
"a4"
}, numbering: if slides {
none
} else {
"1"
})
// set par(justify: true)
set math.mat(delim: "[")
set math.vec(delim: "[")
set heading(numbering: "1.")
show: rules
show: thm-rules
let hidden = hidden.map(s => [#s])
show thm-selector("thm-group"): it => {
if hidden.contains(it.supplement) {
none
} else {
if slides {
polylux-slide[
#it
]
} else {
it
}
}
}
show heading: it => {
if slides {
polylux-slide[
#set align(center + horizon)
#it
]
} else {
it
}
}
show math.equation.where(block: true): e => [
#box(width: 100%, inset: 0em, [
#set align(center)
#e
])
]
show link: underline
if not slides {
outline()
pagebreak()
}
doc
}
#let hdots = $op(dot.op dot.op dot.op)$
#let powset = math.bb("P")
#let dom = math.op("dom")
#let indicator(S) = $bb(1)_#S$ |
https://github.com/OverflowCat/typecharts | https://raw.githubusercontent.com/OverflowCat/typecharts/neko/themes.typ | typst | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#let vintageTheme = {
let colorPalette = (
"#d87c7c",
"#919e8b",
"#d7ab82",
"#6e7074",
"#61a0a8",
"#efa18d",
"#787464",
"#cc7e63",
"#724e58",
"#4b565b"
)
(
color: colorPalette,
backgroundColor: "#fef8ef",
graph: (
color: colorPalette
)
)
}
#let romaTheme = {
let colorPalette = (
"#E01F54",
"#001852",
"#f5e8c8",
"#b8d2c7",
"#c6b38e",
"#a4d8c2",
"#f3d999",
"#d3758f",
"#dcc392",
"#2e4783",
"#82b6e9",
"#ff6347",
"#a092f1",
"#0a915d",
"#eaf889",
"#6699FF",
"#ff6666",
"#3cb371",
"#d5b158",
"#38b6b6"
)
(
color: colorPalette,
visualMap: (
color: ("#e01f54", "#e7dbc3"),
textStyle: (
color: "#333"
)
),
candlestick: (
itemStyle: (
color: "#e01f54",
color0: "#001852"
),
lineStyle: (
width: 1,
color: "#f5e8c8",
color0: "#b8d2c7"
),
areaStyle: (
color: "#a4d8c2",
color0: "#f3d999"
)
),
graph: (
itemStyle: (
color: "#a4d8c2"
),
linkStyle: (
color: "#f3d999"
)
),
gauge: (
axisLine: (
lineStyle: (
color: (
(0.2, "#E01F54"),
(0.8, "#b8d2c7"),
(1, "#001852")
),
width: 8
)
)
)
)
}
|
|
https://github.com/chamik/gympl-skripta | https://raw.githubusercontent.com/chamik/gympl-skripta/main/cj-autori/nesbo.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "/helper.typ": autor
#autor("<NAME>", "1960", "", "spisovatel", "Norwegian School of Economics", "thrillery", "/cj-autori/media/nesbo.jpg")
Chtěl se stát profesionálním hráčem fotbalu, ale zranil se, proto začal studovat ekonomii. Stal se z něj burzovní makléř a později i finanční analytik v největší makléřské společnosti v Norsku. S mladším bratrem Knutem založili vlastní skupinu _Di Derre_ a se stali idoly norské rockové scény s rekordním počtem prodaných alb a až 180 odehranými koncerty ročně. Na několik měsíců odletěl do Austrálie, kde se naplno načal věnovat psaní. Věnuje se horolezectví, v 62 letech přelezl úsek obtížnosti 8a. Všehovšudy je to renesanční muž.
Jeho typickou postavou je #underline[_Harry Hole_], prototyp drsného chlapíka, který se snaží vymýtit zločin ve všech jeho podobách. Není schopen respektu vůči žádné autoritě a na vlastní pěst svádí boje s kriminálníky. Jeho Achillovou patou je alkohol -- i když mu občas poskytne momenty útěchy, většinou kvůli němu klesá ještě hlouběji do propasti zoufalství.
Sám ke své metodě psaní řekl: _„Dopřeji si tolik přípravy, kolik je možné -- tvorbou námětu a synopse strávím více času než psaním samotné knihy. Je velmi důležité probouzet se každé ráno a věřit svému příběhu. Mou jedinou úlohou při psaní knihy je nezničit ho.“_
Mezi jeho známá díla patří:
1. *<NAME>* -- série humorných knih pro děti věnované jeho dceři
2. *Zatmění* -- poslední ze série _Harryho Hola_
*Současníci*\
_<NAME>_ -- <NAME>, 2020\
_<NAME>_ -- Rozkazem, 2006\
_<NAME>_#footnote[pseudonym <NAME>é] -- Neklidná krev, 2020
#pagebreak() |
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/docs/param.typ | typst | Apache License 2.0 | // Docs for f.
#let f(/* ident after */ a) = {
show it: it => it;
}; |
https://github.com/MasterEvarior/typst-cv | https://raw.githubusercontent.com/MasterEvarior/typst-cv/main/README.md | markdown | MIT License | # typst-cv
This is my CV template. For an example see [here](./cv.pdf).
## Usage
Define most of your information at the beginning
```typst
#let personal_profile = "A very nice text"
#let personal_info = ((
(
"service": "email",
"display": "<EMAIL>"
),
(
"service": "phone",
"display": "+1 206 555 0100"
),
...
))
#show: doc => template(doc, black, "<NAME>", "photo.jpeg", personal_profile, personal_info)
```
After that you can use helper functions however you want.
## Icons
You can use whatever icons you want, as long as they are an SVG. Just place them in the `template/assets/svg` folder.
## Images
Place your headshot (or anime avatar, whatever) in the `template/assets/img` folder. |
https://github.com/cetz-package/cetz-venn | https://raw.githubusercontent.com/cetz-package/cetz-venn/master/tests/venn3/test.typ | typst | Apache License 2.0 | #set page(width: auto, height: auto)
#import "/src/lib.typ": venn3
#import "/tests/helper.typ": *
#import cetz.draw: content, set-style, scale
#test-case({
venn3(name: "v")
content("v.a", [A])
content("v.b", [B])
content("v.c", [C])
content("v.ab", [AB])
content("v.bc", [BC])
content("v.ac", [AC])
content("v.abc", [\*])
content("v.not-abc", [not ABC], anchor: "south-west")
})
#test-case({
venn3(a-fill: red)
})
#test-case({
venn3(b-fill: red)
})
#test-case({
venn3(c-fill: red)
})
#test-case({
venn3(ab-fill: red)
})
#test-case({
venn3(bc-fill: red)
})
#test-case({
venn3(ac-fill: red)
})
#test-case({
venn3(abc-fill: red)
})
#test-case({
venn3(not-abc-fill: red)
})
#test-case({
set-style(venn: (stroke: blue, fill: gray, padding: (top: 1, bottom: .5, rest: .25)))
venn3(name: "v", a-stroke: black, ab-fill: green)
})
|
https://github.com/liuguangxi/erdos | https://raw.githubusercontent.com/liuguangxi/erdos/master/Problems/typstdoc/figures/p93_1.typ | typst | #import "@preview/cetz:0.2.1"
#cetz.canvas(length: 10pt, {
import cetz.draw: *
let brown = orange.darken(40%)
let os = 0.12
let sqr-mark(cor) = line(cor, (rel: (0.24, 0.24)), stroke: black+3.6pt)
line((2.1, 0), (1.9, 2), stroke: yellow+3pt)
line((3.1, 0), (3, 2), stroke: yellow+3pt)
line((5, 0), (5, 2.1), stroke: yellow+3pt)
line((5.9, 0), (5.9, 2), stroke: yellow+3pt)
line((1.9, 2), (1, 7), stroke: yellow+3pt)
line((3, 2), (2.5, 5.2), stroke: yellow+3pt)
line((5, 2.1), (5.3, 5.1), stroke: yellow+3pt)
line((5.9, 2), (6.1, 4.1), stroke: yellow+3pt)
line((1, 7), (2.2, 4), stroke: yellow+3pt)
line((2.2, 4), (6.1, 4.1), stroke: yellow+3pt)
line((1, 7), (0, 5), stroke: orange+3pt)
line((1, 7), (2.5, 5.2), stroke: orange+3pt)
line((2.5, 5.2), (5.3, 5.1), stroke: yellow+3pt)
line((5.3, 5.1), (6.6, 5.5), stroke: yellow+3pt)
line((6.6, 5.5), (8, 6.2), stroke: yellow+3pt)
line((6.1, 4.1), (8, 6.2), stroke: yellow+3pt)
line((1, 7), (2.8, 8.5), stroke: orange+3pt)
line((2.8, 8.5), (6.8, 8.7), stroke: yellow+3pt)
line((6.8, 8.7), (8, 6.2), stroke: yellow+3pt)
line((6.8, 8.7), (8, 9.8), stroke: yellow+3pt)
line((8, 9.8), (8, 6.2), stroke: yellow+3pt)
line((8, 9.8), (9, 8.6), stroke: yellow+3pt)
line((8, 6.2), (9, 8.6), stroke: yellow+3pt)
line((8, 9.8), (9.5, 11), stroke: yellow+3pt)
line((9, 8.6), (9.5, 11), stroke: yellow+3pt)
line((9, 8.6), (10.2, 9.5), stroke: yellow+3pt)
line((9.5, 11), (10.2, 9.5), stroke: brown+3pt)
line((10.2, 9.5), (12, 9.5), stroke: brown+3pt)
line((9.5, 11), (12, 11), stroke: brown+3pt)
line((12, 9.5), (12, 11), stroke: brown+3pt)
line((9.5, 11), (10.2, 12.3), stroke: brown+3pt)
line((10.2, 12.3), (10.9, 11.4), stroke: brown+3pt)
line((11.2, 12.3), (10.9, 11.4), stroke: brown+3pt)
line((11.2, 12.3), (12, 11), stroke: brown+3pt)
sqr-mark((1.9-os, 2-os))
sqr-mark((3-os, 2-os))
sqr-mark((5-os, 2.1-os))
sqr-mark((5.9-os, 2-os))
sqr-mark((1-os, 7-os))
sqr-mark((2.5-os, 5.2-os))
sqr-mark((5.3-os, 5.1-os))
sqr-mark((6.1-os, 4.1-os))
sqr-mark((2.2-os, 4-os))
sqr-mark((6.6-os, 5.5-os))
sqr-mark((8-os, 6.2-os))
sqr-mark((2.8-os, 8.5-os))
sqr-mark((6.8-os, 8.7-os))
sqr-mark((8-os, 9.8-os))
sqr-mark((9-os, 8.6-os))
sqr-mark((9.5-os, 11-os))
sqr-mark((10.2-os, 9.5-os))
sqr-mark((12-os, 9.5-os))
sqr-mark((12-os, 11-os))
sqr-mark((10.2-os, 12.3-os))
sqr-mark((10.9-os, 11.4-os))
sqr-mark((11.2-os, 12.4-os))
line((0, 0), (14, 0), stroke: 3pt)
content((0.5, 13), anchor: "south-west", [*Golden Hind*])
})
|
|
https://github.com/Shedward/dnd-charbook | https://raw.githubusercontent.com/Shedward/dnd-charbook/main/dnd/core/graphics.typ | typst | #import "dimentions.typ": *
// Renders rectangle with corners rounded inside
// Parameters:
// - width: Outer width of frame
// - height: Outer height of frame
// - stroke: Stroke width, use values from dimenstions.stroke
// - radius: Inner radius of frame
#let frame(
width: 100%,
height: 100%,
stroke: strokes.thin,
fill: none,
radius: paddings(1) - 0.1 * paddings(1)
) = path(
closed: true,
stroke: stroke,
fill: fill,
// ---
(radius, 0pt),
((width - radius, 0pt), (0pt, 0pt), (0pt, 0.5 * radius)),
((width, radius), (-0.5 * radius, 0pt), (0pt, 0pt)),
((width, height - radius), (0pt, 0pt), (-0.5 * radius, 0pt)),
((width - radius, height), (0pt, -0.5 * radius), (0pt, 0pt)),
((radius, height), (0pt, 0pt), (0pt, -0.5 * radius)),
((0pt, height - radius), (0.5 * radius, 0pt), (0pt, 0pt)),
((0pt, radius), (0pt, 0pt), (0.5 * radius, 0pt)),
((radius, 0pt), (0pt, 0.5 * radius), (0pt, 0pt))
)
#let heart(width: 100%, height: 100%, stroke: strokes.thin, fill: none) = {
let xCenter = 0.5 * width
let yTopRuler = 0.1 * height
let topHanger = 0.125 * height
let bottomHanger = topHanger
let yBottomRuler = 0.75 * height
let xLeftRuler = 0.1 * width
let xRightRuler = width - xLeftRuler
path(
closed: true,
stroke: stroke,
fill: none,
// ---
((xCenter, width), (topHanger, -topHanger), (-topHanger, -topHanger)),
((xLeftRuler, yBottomRuler), (bottomHanger, bottomHanger)),
((xLeftRuler, yTopRuler), (-topHanger, topHanger)),
((xCenter, yTopRuler), (-topHanger, -topHanger), (topHanger, -topHanger)),
((xRightRuler, yTopRuler), (-topHanger, -topHanger)),
((xRightRuler, yBottomRuler), (bottomHanger, -bottomHanger))
)
}
#let shield(width: 100%, height: 100%, stroke: strokes.thin, fill: none) = {
let xCenter = 0.5 * width
let yTopRuler = 0pt
let topHanger = 0.125 * height
let bottomHanger = topHanger
let yBottomRuler = 0.75 * height
let xLeftRuler = 0.055 * width
let xRightRuler = width - xLeftRuler
path(
closed: true,
stroke: stroke,
fill: fill,
// ---
((xCenter, width), (topHanger, -topHanger), (-topHanger, -topHanger)),
((xLeftRuler, yBottomRuler), (bottomHanger, bottomHanger)),
(xLeftRuler, yTopRuler),
((xCenter, yTopRuler), (-topHanger, topHanger), (topHanger, topHanger)),
(xRightRuler, yTopRuler),
((xRightRuler, yBottomRuler), (bottomHanger, -bottomHanger))
)
}
#let rhombus(
width: 100%,
stroke: strokes.thin,
fill: none
) = {
let h = 0.5 * width
path(
closed: true,
stroke: stroke,
fill: fill,
// ---
(h, 0pt), (width, h), (h, width), (0pt, h)
)
}
#let checkboxes(count, size: 4mm, padding: 25%, shape: rhombus) = if (count == 1) {
shape(width: size, stroke: strokes.normal)
} else {
grid(
columns: (auto,) * count,
column-gutter: padding * size,
..((shape(width: size, stroke: strokes.normal),) * count)
)
}
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/docs/cookery/direction/claim.typ | typst | Apache License 2.0 | *Claim: the Typst compiling functions is provided by official #link("https://github.com/typst/typst")[typst]* |
https://github.com/fabriceHategekimana/master | https://raw.githubusercontent.com/fabriceHategekimana/master/main/4_Usecase/Couches.typ | typst | #import "../src/module.typ" : *
#pagebreak()
= Librairie de réseaux de neurones
Maintenant que nous avons été capable d'établire un formalisme pour la création et la manipulation de nos tableaux multidimensionnels. Nous pouvons nous lancer le défi de définir la base d'une librairie de réseaux de neuronnes et voir comment notre système de type peut nous aider à créer ce type de construction. Nous n'entrerons pas en détail sur les notions comme la backpropagation.
Dans son article, <NAME> @towardsdatascienceFunctionalProgramming a mentionné la possibilité de créer des réseaux de neuronnes par le biais de la programmation fonctionnelle. Nous allons faire la démonstration avec notre langage.
// lien de l'article: https://towardsdatascience.com/functional-programming-for-deep-learning-bc7b80e347e9
== Couches de réseaux de neurones
Un réseau de neurones en machine learning est un modèle computationnel inspiré du cerveau humain, conçu pour reconnaître des motifs et effectuer des tâches d'apprentissage automatique. Il est constitué de neurones artificiels, ou nœuds, organisés en couches. Chaque neurone reçoit des signaux d'entrée, les traite, et transmet une sortie aux neurones de la couche suivante. Les réseaux de neurones sont particulièrement efficaces pour des tâches complexes comme la reconnaissance d'images, la traduction de langues et la prédiction de séries temporelles.
Les couches d'un réseau de neurones peuvent être représentées à l'aide de matrices, facilitant ainsi les calculs mathématiques nécessaires pour l'apprentissage et l'inférence. Considérons un réseau de neurones simple avec une couche d'entrée, une couche cachée et une couche de sortie. La couche d'entrée reçoit les données initiales, souvent représentées par un vecteur x de dimension n, où n est le nombre de caractéristiques des données d'entrée.
Les neurones de la couche cachée effectuent des transformations linéaires sur les entrées, suivies de l'application de fonctions d'activation non linéaires. Les poids et biais de cette couche peuvent être représentés par une matrice W de dimension m \* n (où m est le nombre de neurones dans la couche cachée) et un vecteur de biais b de dimension m. Le calcul des activations pour la couche cachée est donné par z = Wx + b, où z est un vecteur de dimension m.
Enfin, la couche de sortie produit la sortie finale du réseau. Si cette couche a p neurones, elle a une matrice de poids W' de dimension p \* m et un vecteur de biais b de dimension p. Les sorties sont calculées de manière similaire : y = W' z + b', où y est le vecteur de sortie.
Chaque couche du réseau effectue donc une transformation linéaire suivie d'une application de fonction d'activation, ces transformations étant exprimées sous forme de multiplications matricielles et d'additions vectorielles. En empilant plusieurs couches de ce type, les réseaux de neurones peuvent modéliser des relations complexes dans les données. Les paramètres (poids et biais) de ces matrices sont ajustés durant l'entraînement du réseau via des algorithmes comme la rétropropagation, qui minimise l'erreur de prédiction en ajustant progressivement les poids et les biais.
On peut en premier lieu tenter de représenter une couche à l'aide de notre système de type. Une couche peut avoir N entrées et O sorties et peut être construite à l'aide d'une matrice $M_{"NxO"}$ et d'un vecteur v de taille O. On peut représenter ça comme une fonction qui prend en entrée une matrice et un vecteur puis retourn une fonction layer qui respecte ce protocole. Cette fonction prend un vecteur ligne et ne fera seulement que d'appliquer l'opération linéaire et retourner un vecteur colonne.
#Exemple()[Création d'une couche de réseau de neurones
```R
let NNLayer: ([N, [O, T]], [O, T]) -> [1, [O, T]] =
func <N, O, T>(m: [N, [O, T]], b: [O, T]) {
func <N, T>(v: [1, [N, T]]){
plus2(dot(v, m), b)
}
}
```
]
Pour éviter que les applications faites dans les réseaux de neuronnes restent linéaires (car ceci peut entraîner le fameux "vanishing gradient"), les fonction non linéaires ont étés inventée. Nous avons notamment la fonction sigmoïde, la fonction ReLU, etc. Dans notre cas, le langage prototype que nous avons à notre disposition ne peut pas émuler ce comportement. Nous allons donc faire une fonction d'activation faussement linéaire. Le but est juste de montrer que ce type d'opération peut être typé et donc protégé.
#Exemple()[Pseudo fonction sigmoïd
```R
let p_sigmoid: ([N, T]) -> ([1, [N, T]]) -> [N, [1, T]] =
func<N, T>(v: [N, T]){
transpose(V)
}
```
]
La pseudo fonction d'activation "p_sigmoid" prendra un vecteur colonne et retourner a un vecteur ligne de même longeure qui sera passé à la prochaine couche. Ici on ne fera que de transposer le vecteur par soucis de simplicité.
|
|
https://github.com/ustctug/ustc-thesis-typst | https://raw.githubusercontent.com/ustctug/ustc-thesis-typst/main/chapters/math.typ | typst | MIT License | = 数学
<数学>
== 数学符号
<数学符号>
《撰写手册》要求数学符号遵循 GB/T
3102.11—1993《物理科学和技术中使用的数学符号》 #footnote[原 GB
3102.11—1993,自 2017 年 3 月 23 日起,该标准转为推荐性标准。]。
该标准参照采纳 ISO 31-11:1992 #footnote[目前已更新为 ISO
80000-2:2019。], 但是与 TeX
默认的美国数学学会(AMS)的符号习惯有所区别。 具体地来说主要有以下差异:
+ 大写希腊字母默认为斜体,如
$ Gamma Delta Theta Lambda Xi Pi Sigma Upsilon Phi Psi Omega dot.basic $
注意有限增量符号 $laplace$ 固定使用正体,模板提供了 命令。
+ 小于等于号和大于等于号使用倾斜的字形 $lt.eq$、$gt.eq$。
+ 积分号使用正体,比如 $integral$、$integral.cont$。
+ 偏微分符号 $diff$ 使用正体。
+ 省略号 按照中文的习惯固定居中,比如
$ 1 comma 2 comma dots.h comma n quad 1 plus 2 plus dots.h plus n dot.basic $
+ 实部 $Re$ 和虚部 $Im$ 的字体使用罗马体。
以上数学符号样式的差异可以在模板中统一设置。
但是还有一些需要用户在写作时进行处理:
+ 数学常数和特殊函数名用正体,如 \$\$\\uppi \= 3.14\\dots; \\quad
\\symup{i}^2 \= -1; \\quad
\\symup{e} \= \\lim\_{n \\to \\infty} \\left\( 1 + \\frac{1}{n} \\right)^n.\$\$
+ 微分号使用正体,比如 \$\\dif y / \\dif x\$。
+ 向量、矩阵和张量用粗斜体(),如
$bold(x)$、$bold(Sigma)$、\$\\symbfsf{T}\$。
+ 自然对数用 $ln x$ 不用 $log x$。
模板中使用 宏包配置数学字体。 该宏包与传统的 、、、 、
等宏包#emph[不]兼容。 本模板作了处理,用户可以直接使用 , , 等命令。
关于数学符号更多的用法,参见 宏包的使用说明和符号列表 。
== 数学公式
<数学公式>
数学公式可以使用 和 环境。 注意数学公式的引用应前后带括号,建议使用
命令,比如式~#link(<eq:example>)[\[eq:example\]]。
// \$\$\\hat{f}\(\\xi) \= \\int\_{-\\infty}^\\infty f\(x) \\eu^{-2 \\uppi \\iu x \\xi} \\dif x.
// \\label{eq:example}\$\$
$ hat(xi) = d x $
<eq:example>
多行公式尽可能在"\="处对齐,推荐使用
// 环境,比如式~#link(<eq:align_2>)[\[eq:align\_2\]]。
$ a & eq b plus c plus d plus e\
& eq f plus g dot.basic $
== 量和单位
<量和单位>
量和单位要求严格执行 GB 3100~3102—1993 有关量和单位的规定。 宏包
提供了更好的数字和单位支持:
- 为了阅读方便,四位以上的整数或小数推荐采用千分空的分节方式:55235367.34623。
四位以内的整数可以不加千分空:1256。
- 数值与单位符号间留适当空隙:25.4~mm,5.97~×~10#super[24]~kg,
−273.15~°C。 例外:12.3~°,1°2′3″。
- 组合单位默认使用 APS 的格式,即相乘的单位之间留一定空隙:
kg~m~s#super[−2], 也可以使用居中的圆点: kg~m~s#super[−2]。 GB
3100—1993 对两者都允许,建议全文统一设置。
- 量值范围使用"~":10~mol/L–15~mol/L。
- 注意:词头 不能写为 u,如:umol 应为 μmol、μmol。
== 定理和证明
<定理和证明>
示例文件中使用 宏包配置了定理、引理和证明等环境。 用户也可以使用 宏包。
#block[
If the integral of function $f$ is measurable and non-negative, we
define its \(extended) #strong[Lebesgue integral] by
$ integral f eq sup_g integral g comma $ where the supremum is taken
over all measurable functions $g$ such that $0 lt.eq g lt.eq f$, and
where $g$ is bounded and supported on a set of finite measure.
]
#block[
The communication graph is strongly connected.
]
#block[
Simple examples of functions on $bb(R)^d$ that are integrable \(or
non-integrable) are given by
$ f_a lr((x)) eq cases(delim: "{", lr(|x|)^(minus a) & upright("if ") lr(|x|) lt.eq 1 comma, 0 & upright("if ") x gt 1 dot.basic) $
$ F_a lr((x)) eq frac(1, 1 plus lr(|x|)^a) comma #h(2em) upright("all ") x in bb(R)^d dot.basic $
Then $f_a$ is integrable exactly when $a lt d$, while $F_a$ is
integrable exactly when $a gt d$.
]
#block[
Suppose $brace.l f_n brace.r$ is a sequence of measurable functions with
$f_n gt.eq 0$. If $lim_(n arrow.r oo) f_n lr((x)) eq f lr((x))$ for a.e.
$x$, then
$ integral f lt.eq liminf_(n arrow.r oo) integral f_n dot.basic $
]
#block[
We do not exclude the cases $integral f eq oo$, or
$liminf_(n arrow.r oo) f_n eq oo$.
]
#block[
Suppose $f$ is a non-negative measurable function, and
$brace.l f_n brace.r$ a sequence of non-negative measurable functions
with $f_n lr((x)) lt.eq f lr((x))$ and $f_n lr((x)) arrow.r f lr((x))$
for almost every $x$. Then
$ lim_(n arrow.r oo) integral f_n eq integral f dot.basic $
]
#block[
Suppose $f$ is integrable on $bb(R)^d$. Then for every
$epsilon.alt gt 0$:
+ There exists a set of finite measure $B$ \(a ball, for example) such
that $ integral_(B^c) lr(|f|) lt epsilon.alt dot.basic $
+ There is a $delta gt 0$ such that
$ integral_E lr(|f|) lt epsilon.alt #h(2em) upright("whenever ") m lr((E)) lt delta dot.basic $
]
#block[
Suppose $brace.l f_n brace.r$ is a sequence of measurable functions such
that $f_n lr((x)) arrow.r f lr((x))$ a.e. $x$, as $n$ tends to infinity.
If $lr(|f_n lr((x))|) lt.eq g lr((x))$, where $g$ is integrable, then
$ integral lr(|f_n minus f|) arrow.r 0 #h(2em) upright("as ") n arrow.r oo comma $
and consequently
$ integral f_n arrow.r integral f #h(2em) upright("as ") n arrow.r oo dot.basic $
]
#block[
#emph[Proof.] Trivial.~◻
]
#block[
#strong[Axiom of choice 1.1]. #emph[Suppose $E$ is a set and $E_alpha$
is a collection of non-empty subsets of $E$. Then there is a function
$alpha arrow.r.bar x_alpha$ \(a "choice function") such that
$ x_alpha in E_alpha comma #h(2em) upright("for all ") alpha dot.basic $]
]
#block[
#strong[Observation 1.1]. #emph[Suppose a partially ordered set $P$ has
the property that every chain has an upper bound in $P$. Then the set
$P$ contains at least one maximal element.]
]
#block[
#emph[A concise proof.] Obvious.~◻
]
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/007%20-%20Theros/003_Prince%20Anax%2C%20Part%202.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Prince Anax, Part 2",
set_name: "Theros",
story_date: datetime(day: 25, month: 09, year: 2013),
author: "<NAME>",
doc
)
Anax approached an estate near the edge of the Kolophon. There was a small gate and a small fence, and on either side of the gate were two great stones with the name "Sinon" carved into them.
#figure(image("003_Prince Anax, Part 2/01.jpg", width: 100%), caption: [], supplement: none, numbering: none)
The estate itself was of medium size; Sinon was not exactly noble, but he had been the defending champion of the pankration for three Games running, and outright victory there could bring a man no small measure of wealth.
As Anax entered the gates, a servant approached him and bowed. "Your Highness, how might someone as lowly as Sinon assist you?"
Anax looked calmly at the servant. "I only wish to speak with him."
"Of course, Your Highness." The servant scurried off.
He returned a couple of minutes later. "Follow me, please."
Anax followed him into a room where a man sat, a man who was tall sitting down. There was not a single strand of visible hair on his head or body, and tight cords of muscle rippled up and down his arms.
Anax sat down across from the man.
The man stared at Anax, his eyes giving nothing away. "Yes?"
"I would request the honor of training for the Games with you."
"Stand up." Anax glared at him but obeyed. Sinon looked him up and down, then stood and walked all the way around him. "You're fourteen?"
Anax turned his head to face the older man. "Fifteen, as of last month."
Sinon rolled his eyes. "Fifteen, sure. I only have time for one pupil. And you look quite a bit less promising than the one I'm already training."
"Excuse me?"
He turned his head toward the estate's courtyard. "Timoteus, I'll be right there!" Sinon looked back at Anax and shrugged. "Sorry."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
"Sounds like that went poorly," said Zotikos. As usual, the gymnasium was nearly empty this evening, and only Anax was in earshot of the other boy.
Anax spread his legs, bent down on his right leg, and stretched his left hamstring. "Yes."
Zotikos made circles in the air with his arms. "You could always pick another sport."
Anax touched his toes for several seconds. "I already told Father I was going to do pankration."
"Oh." Zotikos's arms dropped to his sides. "Maybe I could help. Let's get everything out of the middle." They moved the weights to the side of the sand pit. "So how does this work?"
"We fight until someone goes unconscious or submits, but you can't bite or gouge out eyes."
Zotikos raised an eyebrow.
"Yes."
"And you're a little short," Zotikos said, "so striking doesn't seem like a great idea for you."
"I think I just threaten injury with joint locks until they submit. I can't imagine getting a knockout."
Zotikos scratched his head. "That sounds right."
Anax shrugged. "Want to try?"
Zotikos dropped into a back stance and his eyes went cold. Anax did the same. He crouched and tried to come in lower than Zotikos's center of gravity, but the other boy spun out of his grasp at the last possible moment, placing his hand on the back of Anax's neck. Zotikos shoved hard, and Anax tripped over Zotikos's planted foot and landed face first in the sand. The older boy dropped on top of Anax, grabbed his right arm, and pulled.
Anax's arm felt like it was about to pop out of its socket. "You win!"
Zotikos stopped the pressure. Anax rotated his shoulder, which still hurt. "How did you do that?"
Zotikos stood up. "I don't know. I just... did." He stood, furrowing his brow. "I guess that doesn't help."
Anax returned to his feet as well. "Not really."
Zotikos frowned. "I don't think I can help here."
Anax nodded. "I suppose not."
In the distance, the gymnasium door opened, and closed.
Zotikos looked over to where they had put the weights at the side of the sand pit. "So... more weight throwing?"
Anax shook his head. "I think I'm done for tonight. I'll see you again tomorrow."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Georgios was already in the classroom waiting for Anax when the prince arrived for his lesson the next day. "How did your errand go?"
Anax sighed as he sat down. "Sinon is already teaching my brother, and he won't take another pupil."
Georgios frowned. "That is unfortunate."
"Yes." Anax thought. "He might not have been the right teacher anyway, though. He was really big, and I'm not. Even if he won the last three games, someone smaller than him must have beaten him at some point."
"Do you know Kaletor? He is one of your Father's advisors."
"The older man with the twisted knee who walks with a crutch?"
Georgios nodded. "He competed in the pankration for several years. He was not a tall man even before his injury and might be willing to help. You will need to be careful with your approach, as he does not consider that a pleasant memory. He would not refuse a request to speak with you, although your father will not force him to help past that. I will speak with him on your behalf tonight."
#figure(image("003_Prince Anax, Part 2/02.jpg", width: 100%), caption: [], supplement: none, numbering: none)
"Thank you, Teacher."
The old man nodded. "Thesis: You are depending on me too much."
Anax sneered at him. "Going to the gym every night was my idea. I chose the pankration, not you. I can't know the history of every single man in the palace, but I told you exactly what I was looking for in a teacher. And," he said, "'too much' is hardly specific enough to defend."
The teacher nodded and smiled. "Very good!"
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kaletor's study was austere, little more than a cell with a table and two chairs. The man himself was just as severe, with a chiseled jaw and square head both covered in curly silver hair. Frown lines were worn deep into his face, and his swollen knee was just as gnarled as the twisted branch he used for a cane.
Kaletor regarded the prince from his seat with unguarded confusion. "Your teacher tells me that you wish to compete in the pankration four months from now."
Anax stood as tall as he was able. "I promised Father that I would, but honestly I don't know the first thing about how to do it well. I was wondering if you would be willing to help me."
"Four months is nowhere near enough for you to be a threat to win your division."
#figure(image("003_Prince Anax, Part 2/03.jpg", width: 100%), caption: [], supplement: none, numbering: none)
Anax shook his head. "I don't need to win the whole event. I just need to impress people." He thought. "And if I draw my brother, I definitely need to beat him."
Kaletor scratched his silver beard. "I can give you a chance at that, if you are willing to work."
"You should also know that Sinon is training my brother."
Fire flickered in the old man's eyes. "In that case, I will be honored to help you."
Anax smiled a hungry smile. "I train with one of my friends every evening at the gymnasium. Most people don't see us there, since we stay late. Would you be willing to come then?"
Kaletor reached for his cane. "I will be there."
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Kaletor was true to his word, and began to teach Anax and Zotikos that very night. With his gnarled knee, he could not demonstrate techniques himself, but despite the injury he proved to be a capable teacher.
Kaletor's first lesson was that Anax should close immediately. An opponent shorter than Anax would also be weaker once Anax got him on the ground. An opponent taller than Anax would have a longer range before grappling began, and there was no reason to risk an early knockout from an unlucky strike to the head. It also saved training time, as they could focus exclusively on grappling.
Kaletor's second lesson was how to get the opponent on the ground. Anax was not as strong as the other boys his age—although he was beginning to catch up—and his best chance was to get them on the ground first, where technique could overcome raw strength.
After all that, Kaletor began to teach Anax all the ways to actually win a fight. There were holds that dislocated arms and legs, and ones that outright broke them. These, he said, were the easiest ways to win for the weaker combatant. There were many of these holds, and it took several nights to go through them all.
One night, Anax and Zotikos were practicing various locks. Anax went for an ankle lock, but Zotikos wriggled out of it, and Anax ended up with his friend's foot above his right shoulder instead. He felt Zotikos's knee reach the end of its extension, and started to push it even further.
"Stop!" They did, as Kaletor's voice had an unfamiliar note of fear to it. "That was highly dangerous!" He hobbled toward the two boys. "Anax, I'm impressed you found that, but you could have crippled him. If you push hard enough to force a submission from there, the other man won't walk normally again. Ever. You have to at least give them the chance to submit before that. Don't use that lock."
Anax stood and brushed sand off of his arms. "Is that what happened to you?"
Kaletor narrowed his eyes.
A few beads of sweat ran down Anax's face. "It was Sinon, wasn't it?"
Kaletor nodded.
"Would he teach my brother to do that?"
Kaletor's expression darkened. "It wouldn't surprise me."
"What would I do about it?"
Kaletor was lost in thought for a moment. "It has been a long time. Show me how you got there."
The boys showed him again, and he frowned. "Zotikos, there's a heel hook you can catch him in right there. Grab his heel, put your foot against his stomach, and twist just a tiny bit."
Zotikos did, and Anax yelped. "That hurts!"
"Don't push any harder. If you put anything on that—and I do mean anything—you'll break the ankle, and maybe do worse. It's nasty, but it'll work."
Anax smiled a little. "I'd like to try that."
"Anax," Kaletor said. The prince looked up at his teacher. "I showed you that because I trust you. Promise me you won't hurt anyone with it."
Anax nodded. "I need to win, not break people. I don't want to hurt anyone."
"Good. Now switch positions, and I'll show you, too."
Kaletor showed them both the heel hook that night, and many other things in the coming days. Slowly, painfully, Anax improved, and both teacher and student began to believe that Anax would be ready.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
The stadium was packed to the brim for the junior division of the pankration, which was not the usual state of affairs. Normally, only the parents of competitors attended, but word must have spread throughout the Kolophon that the king's sons were competing. As it was, even the aisles were full of standing spectators.
#figure(image("003_Prince Anax, Part 2/04.jpg", width: 100%), caption: [], supplement: none, numbering: none)
Anax's first two bouts were easy. Both of his opponents were a few years younger than he was, and neither had much of a handle on how his body worked. After Kaletor's training, neither posed much of a challenge.
In the third round, however, Anax drew his brother. Timoteus had range, and therefore tried to start with strikes. His first jab was only a feint, too far out of range to be a serious threat. He stepped forward, and then threw a real punch. Anax could have blocked it and closed, but he flinched, and drew back instead.
Timoteus shifted his weight forward and threw a kick toward Anax's groin. This time, Anax was quick enough to dart inside the kick's range. He grabbed his brother's kicking thigh and opposite shoulder and shoved, and like that the two were on the ground.
Anax landed on top of him, but Timoteus recovered more quickly, and began to twist into position for an ankle lock—a safe move, one that would force Anax to submit but posed little threat of injury. Anax was a few inches away from position for a heel hook, but unless Timoteus overextended himself, there was no way for Anax to reach it.
Anax shifted his weight slightly, offering Timoteus the chance for a different lock—the kneebar that had crippled Kaletor. Timoteus went for it without a second thought. Anax was ready for him, though, and caught his brother's heel at the last possible moment. He twisted—just barely enough to make his point—and Timoteus froze and raised his index finger.
The crowd applauded as the two boys stood. Timoteus's face was a mask of rage as he turned away.
When the applause finally died down, Anax regarded his brother with contempt. "I'm disappointed," he said, loudly enough to carry but softly enough that it wouldn't seem like anything more than a private conversation.
Timoteus brushed sand off his shoulders as he turned back to face his brother. "What?"
Silence spread through the crowd. Many of the spectators craned their heads forward to hear. "You could have won safely, but I gave you the chance to cripple me the same way Sinon crippled Kaletor. And you took it. That let me reverse the hold." Shock appeared on many faces in the crowd. Anax put a mask of haughty disappointment onto his own. "And at the end, I could have ripped apart your ankle. You would never have walked again. But who would want to serve a king who crippled his own brother?" He took three steps away, and looked back over his shoulder. "I wouldn't."
Chatter exploded throughout the stadium. Anax left the ring without another word and prepared for the next bout, doing his best to ignore the crowd. He wanted very much to shout with triumph, or at least to smile. But that is not what a prince does, so he did not.
He lost his next bout to a tall young man who was about to come of age, and was stronger and more skilled. After the respectful looks that everyone gave Anax, though, he did not need a visit from Iroas to know that he had won.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Anax stood in the palace's private courtyard with his father, mother, and sister. Timoteus knelt alone in the center of the courtyard. Fifteen feet from him was a burly man holding a whip. The man drew the whip behind his head.
#emph[Crack.]
#figure(image("003_Prince Anax, Part 2/05.jpg", width: 100%), caption: [], supplement: none, numbering: none)
A thin line of red appeared on Timoteus's back. The wound would heal, but he would bear its mark forever. Such was the cost of political crime in Akros.
#emph[Crack.]
A second red line appeared. Blood from the first one began to drip. This punishment was a liberal interpretation of Akroan treason laws, but King Athanas was furious with his second son, and had insisted.
#emph[Crack.]
A third line appeared. No one would ever forget that Timoteus had tried to cripple his future king.
Father turned to Anax, and the grim look on his face became a bit less stern. "We have begun the process of finding you a wife. We are considering a young woman named Cymede. She comes from a powerful family that we would do well to placate, but she is also beautiful. She will make you a fine queen."
Anax wanted very much to shout with triumph, or at least to smile. But that is not what a king does, so he did not.
|
|
https://github.com/RaphGL/ElectronicsFromBasics | https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/DC/chap1/chap1.typ | typst | Other | == Basic concepts of electricity
#include "1_static_electricity.typ"
#include "2_insulators_and_electron_flow.typ"
#include "3_electric_circuits.typ"
#include "4_voltage_and_current.typ"
#include "5_resistance.typ"
#include "6_voltage_and_current_practical.typ"
#include "7_conventional_electron_flow.typ"
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/bytefield/0.0.4/lib/types.typ | typst | Apache License 2.0 | // bf-field
#let bf-field(type, index, data: none) = (
bf-type: "bf-field",
field-type: type,
field-index: index,
data: data,
)
// data-field holds information about an field inside the main grid.
#let data-field(index, size, start, end, label, format: none) = {
bf-field("data-field", index,
data: (
size: size,
range: (start: start, end: end),
label: label,
format: format,
)
)
}
// note-field holds information about an field outside (left or right) the main grid.
#let note-field(index, anchor, side, level:0, label, format: none, rowspan: 1) = {
bf-field("note-field", index,
data: (
anchor: anchor,
side: side,
level: level,
label: label,
format: format, // TODO
rowspan: rowspan,
)
)
}
// header-field hold information about a complete header row. Usually this is the top level header.
#let header-field(start: auto, end: auto, msb: left, autofill: auto, numbers: (), labels: (:), ..args) = {
// header-field must have index 0.
bf-field("header-field", none,
data: (
// This is at the moment always 0 - (bpr), but in the future there might be header fields between data rows.
range: (start: start, end: end),
// Defines the order of the bits. false: start - end, true: end - start
msb: msb,
// Defines which numbers should be shown. Possible none or array if numbers.
numbers: numbers,
// Defines which labels should be shown. Dict of number and content.
labels: labels,
// Defines which numbers should be calculated automatically
autofill: autofill,
// Defines the format of the bitheader.
format: (
// Defines the angle of the labels
angle: args.named().at("angle", default: -60deg),
// Defines the text-size for both numbers and labels.
text-size: args.named().at("text-size",default: auto),
// Defines if a marker should be shown
marker: args.named().at("marker", default: true),
)
)
)
}
// bf-cell holds all information which are necessary for cell positioning inside the table.
#let bf-cell(type, grid: center, x: auto, y: auto, colspan:1, rowspan:1, label: none, cell-idx: (auto, auto) ,format: auto) = (
bf-type: "bf-cell",
cell-type: type,
cell-index: cell-idx, // cell index is a tuple (field-index, slice-index)
// has-next-slice: false, // indicates if a cell follows which belongs to the same field.
position: (
grid: grid,
x: x,
y: y,
),
span: (
rows: rowspan,
cols: colspan,
),
label: label,
format: format, // fill, stroke, align, inset, ...
data: none,
)
#let header-cell(num, label: none, pos: auto, show-number: true, meta, ..args) = {
bf-cell(
"header-cell",
cell-idx: none,
x: (if (pos == auto) {calc.rem(num, meta.cols.main)} else { calc.rem(pos, meta.cols.main) }) + meta.cols.pre, //NOTE: we could probably get rid of meta if we change to a subgrid solution.
y: 0,
label: (
num: str(num),
text: label,
),
format: (
// Defines if the number should be shown or ommited
number: show-number,
// Defines the angle of the labels
angle: args.named().at("angle", default: -60deg),
// Defines the text-size for both numbers and labels.
text-size: args.named().at("text-size",default: auto), //TODO: connect to global setting
// Defines if a marker should be shown
marker: args.named().at("marker", default: true), // false
// Defines the alignment
align: args.named().at("align", default: center + horizon),
// Defines the inset
inset: args.named().at("inset", default: (x: 0pt, y: 4pt)),
)
)
} |
https://github.com/goshakowska/Typstdiff | https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_working_types/link/link.typ | typst | https://typst.app/
https://pl.wikipedia.org/ |
|
https://github.com/MrToWy/Bachelorarbeit | https://raw.githubusercontent.com/MrToWy/Bachelorarbeit/master/Code/onDestroy.typ | typst | ```ts
ngOnDestroy(): void {
if (this.intervalId) {
clearInterval(this.intervalId);
}
if (this.languageSubscription) {
this.languageSubscription.unsubscribe();
}
}
``` |
|
https://github.com/sbihel/cv | https://raw.githubusercontent.com/sbihel/cv/master/resume.typ | typst | #let cv(author: "", website: "", email: "", github: "", body) = {
set document(author: author, title: author + " - Resume")
set text(font: "Linux Libertine", lang: "en", size: 10pt)
set page(
footer: [
#set align(right)
#set text(6pt)
Last updated on #datetime.today().display("[month repr:long] [day], [year].")
]
)
show heading: it => [
#pad(bottom: -10pt, [#smallcaps(it.body)])
#line(length: 100%, stroke: 0.5pt)
]
grid(
columns: (50%, 50%),
rows: auto,
row-gutter: 1.5%,
align(left + bottom)[
#block(text(weight: 700, 1.75em, author))
],
align(right + bottom)[
#email
],
align(left + bottom)[
#website
],
align(right + bottom)[
#github
],
)
// Main body.
set par(justify: true)
body
}
#let exp(place, location, ..details) = {
grid(
columns: (50%, 50%),
align(left)[
*#place*
],
align(right)[
#location
]
)
v(1%, weak: true)
for position in details.pos() {
grid(
columns: (50%, 50%),
align(left)[
#emph[#position.title]
],
align(right)[
#position.time
]
)
set list(indent: 1em)
position.details
v(1%, weak: true)
}
v(2%, weak: true)
}
// ------------
#show: cv.with(
author: "<NAME>",
website: [#link("https://simonbihel.me/")[simonbihel.me]],
email: [#link("mailto:<EMAIL>")],
github: [#link("https://github.com/sbihel")[github.com/sbihel]],
)
= Skills
/ Rust: Four years of professional experience, including developing libraries, web services, and language bindings.
/ Infrastructure: Experience working on internal infrastructure as well as working in customers' environments.
/ Digital Identity: Four years of experience, including implementing standards and designing solutions.
= Experience
#exp(
"SpruceID",
"(Remote) London, United-Kingdom",
(
title: "Principal Software Engineer, Head of Infrastructure",
time: "March 2023 – Present",
details: []
),
(
title: "Senior Software Engineer, Infrastructure Lead",
time: "April 2022 – March 2023",
details: []
),
(
title: "Software Engineer",
time: "September 2020 – April 2022",
details: [
- Joined as the second employee and worked on most projects over the years (e.g. California DMV mobile driver's licenses, Utah digital credentials).
- Development: worked on most libraries and services; mostly in Rust but also generated bindings for other languages, and worked on web and mobile apps.
- Standards: participated in the implementation of new standards (e.g. W3C Verifiable Credentials, OID4VC, ISO mDL, Sign-In with Ethereum).
- Infrastructure: single person responsible for it, provided direction and did most of the implementation.
- DevOps: managed services deployments, CI/CD pipelines, and monitoring.
- Architecture: contributed to infrastructure and software architecture discussions.
- Compliance: worked on the infrastructure side of SOC2.
- Management: up to 7 direct reports at a time, was also part of the leadership team.
]
)
)
#exp(
"Nexmo (Vonage)",
"London, United-Kingdom",
(
title: "Software Development Engineer in Test",
time: "November 2018 – October 2020",
details: [
- Testing: maintenance of the test suite (e.g. abstraction and generation of tests, parallelisation).
- Monitoring: facilitate incident impact measurement, track API usage, alerting (pushed for on-call).
- Investigations: understanding test failures or abnormal behaviours across the services.
- Development: built a rating engine, refactored cluster management, various internal changes in services.
- DevOps: AWS migration, maintenance of on-demand test environments (e.g. dockerise services, debugging).
]
)
)
#exp(
"KTH",
"Stockholm, Sweden",
(
title: "Research Intern",
time: "February 2018 – June 2018",
details: []
)
)
#exp(
"KAIST",
"Daejeon, South-Korea",
(
title: "Research Intern",
time: "March 2017 – August 2017",
details: []
)
)
#exp(
"IRISA & INRIA",
"Rennes, France",
(
title: "Research Intern",
time: "May 2016 - July 2016",
details: []
)
)
= Education
#exp(
"University of Rennes 1 & ÉNS Rennes",
"Rennes, France",
(
title: "BSc & MSc in Computer Science, research track",
time: "2013 - 2018",
details: []
)
)
|
|
https://github.com/Shedward/dnd-charbook | https://raw.githubusercontent.com/Shedward/dnd-charbook/main/books/edna-zeenhoffer.typ | typst | #import "../dnd/dnd.typ"
#import "../dnd/game/game.typ": *
#show: dnd.core.charbook
#let edna = dnd.game.character(
name: "<NAME>",
class: "Чародей",
subclass: "Аберантный разум",
race: "Чейнджлинг",
type: "Гуманоид",
alignment: "Lawful Neutral",
story: "Преследуемый",
spellcasting: spellcasting(
focus: "Брошь",
resources: ("Ед. чар.",)
)
)
#dnd.page.cover(
edna.name,
title: "Медицинская карта пациента",
author: [
Лечащий врач: <NAME>
],
caption: [
Поликлинника \#62
г. <NAME>, пр-т Консомолов, 16к2
],
subtitle: "Психиатрическое отделение"
)
#dnd.page.attacks
#dnd.page.charlist(edna)
#dnd.page.inventory
#page(
header: section[Spellcasting]
)[
#dnd.page.spellcasting(edna)
#dnd.page.spellsSection(
level: cantrip,
spell(
"Расщепление разума",
duration: round(1),
range: target(60),
components: "VSM",
source: "Абберантный разум"
)[
*INT или 1к6 псих.* + штраф 1к4 к спас. броскам
],
spell(
"Фокусы",
duration: hour(1),
range: [#point(10), <#volume(1)],
source: "Чародей"
)[
- мгновенный сенсорный эффект (световой, порыв ветра, звук или запах)
- зажечь/потушить свечу, факел или костер
- мгновенно отчистить/замарать предмет
- нагреть/остудить или придат вкус
- создать цвет, метку или символ на поверхности
- создать немагическую безделушку помещающуюся в ладонь (#round(1))
],
spell(
"Волшебная рука",
duration: minute(1),
range: point(30),
source: "Чародей"
)[
В точку появляется магическая рука.
Исчезает если окажется дальше 30фт.
Действием можно контролировать руку - открывать незапертые двери и контейнеры.
При каждом использовании можно переместить на 30фт.
Нельзя совершать атаки, активировать маг. предметы и переносить более 10 фунтов (4.5 кг).
],
spell(
"Огненный снаряд",
duration: instant,
range: target(120),
source: "Чародей"
)[
Дальнобойная, *1к10 огнем*
],
spell(
"Малая илюзия",
duration: minute(1),
range: point(1),
source: "Чародей"
)[
Вы создаете звук или образ.
Громкость как шепот или крик.
Образ объемом не больше #volume(5).
Можно исследовать проверкой ИНТ
],
spell(
"Формирование воды",
duration: hour(1),
range: target(30),
source: "Чародей"
)[
Выберите область воды не больше #volume(5) и примените не больше 2ух эффектов
- Переместить воду в любом направлении
- Принимать простые формы и двигаться
- Изменить цвет и прозрачность
- Заморозить/разморозить без существ
]
)
]
#page(
header: section[Spellcasting]
)[
#dnd.page.spellsSection(
level: spellLevel(1, slots: 4),
spell(
"Диссонир. шепот",
range: target(60),
duration: instant,
source: "Абберантный разум"
)[
*МУД или 3к6 псих.* + убегает проч
],
spell(
"Руки Хадара",
range: circle(10),
duration: instant,
source: "Абберантный разум"
)[
*СИЛ или 2к6 некр.* + нельзя использовать реакции
],
spell(
"Щит",
range: self,
castTime: reaction,
duration: round(1),
source: "Чародей"
)[
Под атакой или волшебной стрелой, +5 КД до начала сл. хода
],
spell(
"Искусная острота",
range: target(60),
castTime: reaction,
duration: insight,
source: "Чародей"
)[
На успешный бросок, помеха. Приемущество другому сущ.
]
)
#dnd.page.spellsSection(
level: spellLevel(2, slots: 3),
spell(
"Обнаружение мыслей",
range: self,
castType: concentration,
duration: minute(1),
source: "Абберантный разум"
)[
Позволяет поверхностно *читать мысли*
],
spell(
"Умиротворение",
range: target(60),
castType: concentration,
duration: minute(1),
source: "Абберантный разум"
)[
ХАР или *снять очарование, испуг или вражду*
],
spell(
"Внушение",
range: target(30),
castType: concentration,
duration: hour(1),
source: "Чародей"
)[
МУД или *следовать простому приказу*
],
spell(
"Вихрь искревления",
range: target(90),
duration: instant,
source: "Чародей"
)[
ТЕЛ или переместиться
],
spell(
"Палящий луч",
range: target(120),
duration: instant,
source: "Чародей"
)[
3 #sym.times дальнобойная, *2к6 огнем*
],
)
#inputGrid(5)
]
#page(
header: section[Spellcasting]
)[
#dnd.page.spellsSection(
level: spellLevel(3, slots: 3),
spell(
"Огненный шар",
range: circle(20, range: 150),
duration: instant,
source: "Чародей"
)[
*ЛОВ или 8к6 псих.* + возгорается горючее
],
spell(
"Контрзакл.",
range: target(60),
duration: instant,
castTime: reaction,
source: "Чародей"
)[
При касте закл. Отменяет 3 ур. и ниже. Выше - проверка ИНТ на Сл 10 + уровень заклинания
],
spell(
"<NAME>",
range: sphere(20, range: 150),
castType: concentration,
duration: instant,
source: "Аберрантный разум"
)[
Существа в области *ослеплены*. Область *труднопроходимая*.
Существам в начале хода *2к6 холода*, в конце хода *ЛОВ или 2к6 кисл.*
],
spell(
"Послание",
range: [#(sym.infinity) ft, знакомому],
duration: instant,
source: "Чародей"
)[
Можно отправить послание не более 25 слов.
Получатель может ответить тоже не более 25 слов
],
spell(
"Рассеивание магии",
range: point(120),
duration: instant,
source: "Чародей"
)[
Все заклинания 3 уровня и ниже рассеиваются.
4 и выше - СЛ 10 + уровень заклинания
],
)
#inputGrid(14)
]
#page(
header: section[Spellcasting]
)[
#inputGrid(30)
]
#dnd.page.abilities(
ability("Сердце Тьмы", source: "Преследуемый")[
Обыватели будут вежливы и сделают всё, чтобы помочь вам.
Если вы не выказывали признаков угрозы для них, они даже могут взяться за оружие,
чтобы драться вместе с вами, если вы окажетесь лицом к лицу с врагом в одиночестве.
],
ability("Телепатическая речь", source: "Аберрантный разум")[
Обыватели будут вежливы и сделают всё, чтобы помочь вам.
Бонусным действием выберите одно существо, которое вы можете видеть в пределах 30 футов.
Вы и выбранное существо можете говорить телепатически друг с другом
],
ability("Перевертыш", source: "Чейндлинг")[
Действием вы можете изменить облик
],
ability("Волшебное указание", source: "Чародей 5ур")[
При провале проверки характеристики, можно потратить 1ед. чародейства, чтобы перебросить.
Но обязательно нужно использовать новый бросок.
],
colbreak(),
ability("Метамагия", source: "Чародей 3ур")[
К заклинанию можно добавить эффект метамагии:
- *Удвоенное [по ячейке]*.
Если заклинание целится в существо, можно нацелиться во второе существо
- *Неуловимое [1 ед.]*.
Можно наложить заклинание без вербальных и соматических компонентов
],
ability("Адепт метамагии", source: "Черта 4ур")[
+2 ед. чародейства и +2 метамагии:
- *Далекое [1 ед.]*.
Можно удвоить дальность или заменить касание на 30фт
- *Аккуратное [1 ед.]*.
Можно выбрать [мод. ХАР] существ, они автоматически проходят спас бросок
],
ability("Источник магии", source: "Чародей 2ур")[
Можно обменивать ед. чародейства и ячейки заклинаний.
#simpleTable(
("Уровень закл.", "Ед. чародейства"),
"Заговор", "1",
"1", "2",
"2", "3",
"3", "5",
"4", "6",
"5", "7",
)
],
ability("Старые рецепты", source: "Эдна 3ур")[
У Эдны есть 3 пирога. Действием можно съесть или отдать другому один пирог.
Для этого кинь 1к6
1. *С говядиной*:\ +1к4 временного хм на 1 ход
2. *C курицей*:\ +5фт к скорости передвижения на 1 ход
3. *С рыбой*:\ съевший излучает тусклый свет на 5фт на 1 ход
4. *С грибами*:\ съевший громко пердит - слышат все на 60фт
5. *Слипшиеся пироги*:\ бросить 2к6 и применить эффект, 5-ка игнорируется
6. *С говном*:\ вы выплевываете пирог, ваш рот в говне. Помеха на ХАР, действием можно помыть
#abilityCharges(3)
],
ability("Новые рецепты", source: "Эдна и Доброгон 5ур")[
Проведя много времени с Доброгоном Эдна научилась новым рецептам.
Теперь вместо старых рецептов нужно кинуть 1к10
1. *С говядиной*:\ +1к4 + 2 временных хп на 1 минуту, помеха ЛОВ.
2. *C курицей*:\ +10фт скорости на 1 минуту, помеха ТЕЛ.
#colbreak()
3. *С рыбой*:\ Богат фосфором: испускает тусклый свет на 10фт на 1 минуту. Воняет: Помеха на скрытность.
4. *С грибами*:\ Вы оглушительно пердите на 120 футов. Все существа (включая вас) в радиусе 10 фт
ТЕЛ Сл 13 или оглушены на 1 раунд. Вы делаете этот бросок с преимуществом.
5. *С ялодами*:\ Заряжает энергией: В течении 1 минуты вы можете выполнять отход и рывок за бонусное действие.
Болят зубы: помеха на любую следующую проверку навыков.
6. *С острым перцем*:\ Получите 1к6 урона огнем.
В течении 1 минуты можете бонусным действием выдохнуть 15 футовый конус огня.
Существа ЛОВ Сл 13 или 2к6 урона огнем.
7. *С мёдом*:\ Полезный: на 1 минуту сопр. 1 типу урона на выбор.
Попа слиплась: Скорость передвижения снижена на 5 футов.
8. *По-доброгоновски*:\ Ослеплены на 1 минуту (в конце хода ТЕЛ). Пьяные рефлексы: +1 к AC.
9. *Слипшиеся*:\ Бросить 2к10 и применить эффект.
10. *С говном*:\ Отравленны на 1 минуту, помеха ХАР. Действием можно прополоскать рот
],
ability("Инсульт", source: "Эдна")[
При любой критической неудаче брось к100 и выбери эффект из таблицы.
Так же, в любой волнительный или страшный момент можно бросить к20, если выпадет 1 брось к100.
#set par(first-line-indent: 0.5em, justify: true)
*1-2. Момент Ясности*:\ Получи преимущество при следующей проверке.
*3-4. Забывчивость*:\ Забудь, как пользоваться оружием или заклинаниями на 1 раунд.
*5-6. Вдохновение*:\ Мгновенно найди решение проблемы, с которой сталкивается группа.
*7-8. Потеря вещей*:\ Все мелкие предметы теряются и появляются разбросанными вокруг.
*9-10. Внезапный сон*:\ Засыпаешь на 1 раунд.
*11-12. Телепатический взрыв*:\ Случайно транслируешь свои мысли всем в радиусе 30 футов на 1 минуту.
*13-14. Искажение времени*:\ Cкорость передвижения уменьшается вдвое на 2 раунда.
*15-16. Задумчивость*:\ Окаменеваешь на 1 раунд, раздумывая о смысле жизни.
*17-18. Дежавю*:\ Получи преимущество на следующую атаку.
#colbreak()
*19-20. Случайное знание*:\ Высказываешь случайный факт, который может быть полезным.
*21-22. Языковой сбой*:\ Говоришь на случайном языке в течение 1 минуты.
*23-24. Невидимый друг*:\ Взаимодействуешь с кем-то, кого не существует.
*25-26. Перепад настроения*:\ Твоя личность кардинально меняется на несколько минут.
*27-28. Психическая перегрузка*:\ Получи 1d6 психического урона.
*29-30. Внезапный гений*:\ Получи случайный заговор на 24 часа.
*31-32. Память золотой рыбки*:\ Забудь последнего человека, с которым ты говорил.
*33-34. Галлюцинации*:\ Видишь яркие, но безвредные видения в течение 1 минуты.
*35-36. Телекинетический выброс*:\ Случайно двигаешь небольшой предмет в радиусе 10 футов.
*37-38. Непроизвольная смена облика*:\ Цвет волос или кожи меняется на 1 час.
*39-40. Экстремальная эмоция*:\ Смейся, плачь или кричи громко в течение 1 раунда.
*41-42. Неудержимое бормотание*:\ Говоришь бессвязно несколько минут.
#colbreak()
*43-44. Пророческое видение*:\ Получаешь видение о событии, которое произойдет в течение следующего дня.
*45-46. Внезапный страх*:\ Боишься случайного объекта рядом с тобой на 1 раунд.
*47-48. Интенсивная концентрация*:\ Удваиваешь бонус за владение при следующей проверке навыков.
*49-50. Потеря памяти*:\ Забудь события последнего часа.
*51-52. Мгновенная экспертиза*:\ Мгновенно понимаешь, как выполнить задачу, которую видишь.
*53-54. Музыкальный синдром*:\ Внезапно выкрикиваешь строчки из песен в неподходящие моменты.
*55-56. Компульсивная честность*:\ Не можешь солгать в течение 10 минут.
*57-58. Случайное телепортирование*:\ Телепортируешься на 10 футов в случайном направлении
*59-60. Заклинание по ошибке*:\ Следующее заклинание нацелено на случайное существо рядом.
*61-62. Непреодолимая тяга*:\ Срочно нужно съесть что-то странное.
#colbreak()
*63-64. Обратная гравитация*:\ Ощущаешь, что вверх — это вниз на несколько секунд, но не двигаешься.
*65-66. Эхо мыслей*:\ Твои мысли эхом отзываются в голове, вызывая помеху на следующее действие.
*67-68. Потеря навыка*:\ Потеряешь владение случайным навыком или инструментом на 1 час.
*69-70. Воспоминание прошлого*:\ Вспоминаешь момент из детства так, будто переживаешь его заново.
*71-72. Без фильтра*:\ Говоришь всё, что думаешь, в течение нескольких минут.
*73-74. Третий глаз*:\ Видишь невидимые объекты на мгновение.
*75-76. Магический храп*:\ Во сне произносишь случайный заговор.
*77-78. Зуд в мозгу*:\ Ощущаешь зуд в черепе, но без реального вреда.
*79-80. Фантомные запахи*:\ Чувствуешь запах, которого нет, возможно отвлекающий или приятный.
*81-82. Внезапное очарование*:\ Неосознанно очаровываешь того, с кем разговариваешь.
*83-84. Когнитивное эхо*:\ Повторяешь последнюю услышанную фразу в течение минуты.
*85-86. Обмен разумом*:\ Меняешь местами значения мудрости и интеллекта на 10 минут.
*87-88. Отвлеченность*:\ Получаешь штраф -2 к следующему спасброску из-за отсутствия концентрации.
*89-90. Непреднамеренная мудрость*:\ Дашь удивительно хороший совет по текущей проблеме.
*91-92. Электростатический шок*:\ Создаешь небольшой разряд, наносящий 1 урон электричеством ближайшему союзнику.
*93-94. Внезапное озарение*:\ Получи бонус +5 к следующей проверке по Аркане или Истории.
*95-96. Дрожь*:\ Руки трясутся, получаешь помеху на следующую атаку или проверку с их использованием.
*97-98. Потеря голоса*:\ Потеряй голос на 1 минуту, нельзя кастовать заклинания с вербальным компонентом.
*99-100. Космическое откровение:*\ Получи внезамное откровение, можешь спросить одина вопрос да/нет о текущем приключении.\
],
ability("Бабкины настойки", source: "Эдна 3ур")[
#abilityRequirement[1 день работы и материалов на 25зм]
Эдна может приготовить *зелье лечения 2к4 + МУД*
],
inputGrid(30)
)
#dnd.page.proficiencies(
toolsProficiency(
"Набор путешественника",
source: "Чародей",
items: (
"рюкзак",
"спальник",
"столовый набор",
"10 факелов",
"10 рационов",
"бурдюк",
"50 футовая пеньковая верёвка"
)
),
toolsProficiency(
"Набор охотника на монстров",
source: "Преследуемый",
items: (
"сундук",
"фомка",
"молоток",
"три деревянных кола",
"святой символ",
"святая вода",
"кандалы",
"стальное зеркало",
"масло",
"трутница",
"3 факела"
)
),
inputGrid(30)
)
#dnd.page.backstory[
Эдна, чейнджлинг, начала замечать странные изменения в своей жизни уже в старости.
В её доме появился сосед-гном, которого она всегда недолюбливала.
Постепенно гномов в доме стало становиться всё больше.
Они заменяли её соседей, торговцев в лавках, а однажды она даже увидела,
как маленькая девочка-чейнджлинг превратилась в гнома.
Полиция и соседи не верили её жалобам,
и вскоре Эдна начала слышать их шепоты и мысли, в которых они обсуждали,
как использовать её жир для блеска своих бород.
Не выдержав, Эдна покинула свой родной дом и начала скитаться в поисках места,
где не было бы гномов. Но куда бы она ни шла, гномы появлялись вновь.
В своих странствиях она встретила других жертв и объединилась с ними
в попытках разоблачить гномий заговор, но все их усилия оказались тщетными.
Эдна мечтает о спокойной жизни без гномов,
но боится их и теряет терпение при долгом общении с ними.
После очередного бегства она поселилась в Шарне, где начала борьбу с гномами.
Нескольких соседей она уже изгнала, а одного довела до нервного срыва.
Вместе с частным детективом Максом Мерлоком они раскрыли преступные сети гномов,
занимавшихся грибным бизнесом и проституцией. Несмотря на её паранойю,
Эдна обладает удивительным чутьём на тёмные дела,
что делает её опасным врагом для любых преступников, даже если они не гномы.
]
#dnd.page.personality[
#biographySection("Личные качества")[
#biographySubsection("Упрямость")[
Ничто и никто не может ее переубедить.
Дело не в старости. В молодости она была еще хуже.
]
#biographySubsection("Скурпулезность")[
Дотошность к деталям и инструкциям остались после
долгих лет работы чиновником.
]
]
#biographySection("Идеалы")[
#biographySubsection("Без гномов")[
Спокойная жизнь без ЕБУЧИХ ГНОМОВ
]
]
#biographySection("Привязаности")[
#biographySubsection("Родной дом")[
Она скучает по своей маленькой квартирке в родном городе.
]
]
#colbreak()
#biographySection("Цели")[
#biographySubsection("Раскрыть заговор")[
Всю свою жизнь Эдна посвятила раскрытию заговора гномов
]
#biographySubsection("Вернуться домой")[
После всех приключений хотелось бы наконец вернуться домой
]
]
#biographySection("Слабости")[
#biographySubsection("Маленькая неприязнь")[
Эдна боится гномов. Она может их терпеть их какое-то время и даже вежливо общатся.
Но когда видит гнома слишком близко и слишком долго у нее начинает нарастать нервное напряжение.
Этот срах даже немного перетекает и на другие маленькие расы.
*Если Эдна находится дольше 15 мин на расстоянии 5ft от гнома
или дольше часа рядом с любым маленьким существом
у нее может случится истерика*
]
]
]
#dnd.page.quests
#dnd.page.quests
|
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/if-06.typ | typst | Other | // Error: 4 expected expression
#if
// Error: 5 expected expression
#{if}
// Error: 6 expected block
#if x
// Error: 2-6 unexpected keyword `else`
#else {}
// Should output `x`.
// Error: 4 expected expression
#if
x {}
// Should output `something`.
// Error: 6 expected block
#if x something
// Should output `A thing.`
// Error: 19 expected block
A#if false {} else thing
#if a []else [b]
#if a [] else [b]
#if a {} else [b]
|
https://github.com/typst-community/glossarium | https://raw.githubusercontent.com/typst-community/glossarium/master/examples/full-example/main.typ | typst | MIT License | #import "../../glossarium.typ": make-glossary, register-glossary, print-glossary, gls, glspl, agls, gls-key, gls-short, gls-artshort, gls-plural, gls-long, gls-artlong, gls-longplural, gls-description, gls-group
// Replace the local import with a import to the preview namespace.
// If you don't know what that mean, please go read typst documentation on how to import packages at https://typst.app/docs/packages/.
#show: make-glossary
#let entry-list = (
(
key: "kuleuven",
short: "KU Leuven",
long: "Katholieke Universiteit Leuven",
description: [Fugiat do fugiat est minim ullamco est eu duis minim nisi tempor adipisicing do _sunt_. #gls("vub")],
plural: "KU Leuvens",
),
(
key: "uclouvain",
short: "UCLouvain",
long: "Université catholique de Louvain",
description: "Sunt pariatur deserunt irure dolore veniam voluptate cillum in. Officia nulla laborum nostrud mollit officia aliqua. Laborum tempor aute proident fugiat adipisicing qui laborum tempor ad officia. Nulla ipsum voluptate in proident laborum labore nulla culpa sunt deserunt sit ad aliqua culpa.",
),
(
key: "ughent",
short: "UGent",
long: "Universiteit Gent",
description: "Labore officia commodo dolor sunt eu sunt excepteur enim nisi ex ad officia magna. Nostrud elit ullamco quis amet id eu. Cupidatat elit cupidatat ad nulla laboris irure elit.",
),
(
key: "vub",
short: "VUB",
long: "Vrije Universiteit Brussel",
description: [Proident veniam non aliquip commodo sunt cupidatat. Enim est cupidatat occaecat
elit et. Adipisicing irure id consequat ullamco non. Labore sunt tempor et
mollit. #gls("kuleuven", long: true)],
),
(
key: "ulb",
short: "ULB",
long: "",
description: "Magna do officia sit reprehenderit anim esse. Eu Lorem ullamco incididunt minim quis sit sunt id mollit sit amet cupidatat. Labore incididunt enim culpa ex magna veniam proident non sint dolor. Incididunt proident esse culpa nostrud tempor cupidatat culpa consectetur excepteur ipsum deserunt duis exercitation. Non consectetur dolore culpa laboris in quis. Cupidatat aliquip exercitation id elit ipsum amet enim nostrud elit reprehenderit velit. Irure labore pariatur non dolore non officia laborum quis deserunt adipisicing cillum incididunt.",
),
(
key: "umons",
short: "UMons",
long: "Université de Mons",
description: "Aliquip incididunt elit aliquip eu fugiat sit consectetur officia veniam sunt labore consequat sint eu. Minim occaecat irure consequat sint non enim. Ea consectetur do occaecat aliqua exercitation exercitation consectetur Lorem pariatur officia nostrud. Consequat duis minim veniam laboris nulla anim esse fugiat. Ullamco aliquip irure adipisicing quis est laboris.",
),
(
key: "uliege",
short: "ULiège",
long: "Université de Liège",
description: "Tempor deserunt commodo reprehenderit eiusmod enim. Ut ullamco deserunt in elit commodo ipsum nisi voluptate proident culpa. Sunt do mollit velit et et amet consectetur tempor proident Lorem. Eu officia amet do ea occaecat velit fugiat qui tempor sunt aute. Magna Lorem veniam duis ea eiusmod labore non anim labore irure culpa Lorem dolor officia. Laboris reprehenderit eiusmod nostrud duis excepteur nisi officia.",
),
(
key: "unamur",
short: "UNamur",
long: "Université de Namur",
),
(
key: "lod",
short: "LOD",
artshort: "an",
long: "level of details",
description: lorem(10),
),
(
key: "notused",
short: "Not used",
description: [This key is not cited anywhere, it won't be in the glossary unless the
`show-all` argument is set to true],
),
)
#register-glossary(entry-list)
#set page(paper: "a5")
//I recommend setting a show rule for the links to that your reader understand that they can click on the references to go to the term in the glossary.
#show link: set text(fill: blue.darken(60%))
There are many Belgian universities, like @kuleuven and @ulb. When repeating
their names, they won't show as a long version: @kuleuven, @ulb. But we can
still force them to be long using the `gls` function: #gls("kuleuven", long: true).
We can also force them to be short: #gls("kuleuven", long: false). Finally, we
can make them plural:
+ using the `suffix` parameter: #gls("kuleuven", suffix: "s"), or
+ using the additional `supplement` onto the `ref`: @kuleuven[s], or
+ the plural function `#glspl(key: "kuleuven")` #glspl("kuleuven"), or
+ call `@kuleuven:pl` @kuleuven:pl
It is also possible to use the proper article with `#agls("lod")`: "#agls("lod") system", "#agls("lod") system".
You can also override the text shown by setting the `display` argument: #gls("kuleuven", display: "whatever you want")
Attributes of an entry can be retrieved using the available functions:
- `gls-key("kuleuven")`: #gls-key("kuleuven")
- `gls-short("kuleuven")`: #gls-short("kuleuven")
- `gls-artshort("kuleuven")`: #gls-artshort("kuleuven")
- `gls-plural("kuleuven")`: #gls-plural("kuleuven")
- `gls-long("kuleuven")`: #gls-long("kuleuven")
- `gls-artlong("kuleuven")`: #gls-artlong("kuleuven")
- `gls-longplural("kuleuven")`: #gls-longplural("kuleuven")
- `gls-description("kuleuven")`: #gls-description("kuleuven")
- `gls-group("kuleuven")`: #gls-group("kuleuven")
#pagebreak()
Numbering is, of course, correct when referencing the glossary: @kuleuven, @ulb,
@ughent, @vub, @ulb, @umons, @uliege, @unamur. They are also sorted based on
where the page is in the document and not the textual representation.
#pagebreak()
Additionally, you can load data externally and pass it as a parameter to the
`glossary.with` function to load data from an external format.
#pagebreak()
= Glossary
#print-glossary(
entry-list,
// show all term even if they are not referenced, default to true
show-all: true,
// disable the back ref at the end of the descriptions
disable-back-references: true,
)
|
https://github.com/raygo0312/Typst_template | https://raw.githubusercontent.com/raygo0312/Typst_template/main/main.typ | typst | #import "@local/japanese-template:0.1.0": *
#show: it => jarticle(
// titlepage: true,
title: "Typst",
office: "電気通信大学 情報理工学研究科 情報数理工学",
author: "2400000 raygo",
date: true,
// column: true,
it,
)
ここに文章を入力すれば,そのまま出力されます.Latin-もいい感じにABCabcと(出力)されます.改行したい場合は\
バックスラッシュで改行できます.
空行を入れると改段落できます.
アクセントは\*で*太字*,\_で_italic_ができます.
= セクション
セクションは番号が振られます.
= セクション
== サブセクション
=== サブサブセクション
- \-を打つと
- 箇条書きができます
- インデントすると
- 階層ができます
同様に
+ \+で
+ 順序付きリスト
+ が階層付きで
+ できます
インラインは\$で囲むとできます.ブロックは\$で囲み内側にスペースか改行を挟むとできます.
集合$A$の部分集合族$A in scr(A)$.ただし,$scr(A)subset 2^A$である.
文字の積はスペースを入れなければなりません.
$
a b c
$
関数などは$sin(theta)$のようにくっつけると出力されます.詳しくは#link("https://typst.app/docs/")[公式ドキュメント]
フォント紹介
#let full = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
$
cal(full)\
scr(full)\
frak(full)
$ |
|
https://github.com/JosephDavis/typst-starter | https://raw.githubusercontent.com/JosephDavis/typst-starter/main/docs/papers/my_paper.typ | typst | = My Paper
This is a simple example of a paper written in the `typ` format. |
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/07-localisation/resources.typ | typst | Other | #import "/template/template.typ": web-page-template
#import "/template/components.typ": note
#import "/lib/glossary.typ": tr
#show: web-page-template
// ## Resources
== 参考资料
// To finish, here is a list of resources which may help you when designing and implementing for global scripts:
我们以一个参考资料列表作为本章结尾。
这些资料也许可以在你设计和实现各种#tr[script]的字体时提供帮助:
#let bibentry(key, body, verb: [编写的]) = cite(key, form: "author") + [ ] + verb + body + cite(key, form: "normal")
- 拉丁文#tr[diacritic]设计:
// - [The Insects Project](http://theinsectsproject.eu) - a downloadable book on issues of Central European diacritic design
- #bibentry(<Balik.InsectsProject.2016>)[《The Insects Project》,一本关于中欧#tr[diacritic]设计的可下载电子书]
// - [Problems of Diacritic Design for Latin script text faces](https://gaultney.org/jvgtype/typedesign/diacritics/ProbsOfDiacDesignLowRes.pdf)
- #bibentry(<Gaultney.ProblemsDiacritic.2008>)[《Problems of Diacritic Design for Latin script text faces》]
// - [Polish diacritics how-to](http://www.twardoch.com/download/polishhowto/index.html) (<NAME>)
- #bibentry(<Twardoch.PolishDiacritics.1999>)[《Polish diacritics how-to》文档]
// - <NAME>'s [Diacritics project](http://diacritics.typo.cz)
- #bibentry(<Blazek.DiacriticsProject.2006>, verb: [制作的])[Diacritics project 网站]
// - [Context of Diacritics](https://www.setuptype.com/x/cod/) analyses diacritics by frequency, combination and language
- #bibentry(<Job.ContextDiacritics.2013>, verb: [制作的])[《Context of Diacritics》在线项目],分析了#tr[diacritic]的出现频率、互相作用以及在语言中的使用
// * <NAME>'s [Vietnamese Typography](https://vietnamesetypography.com)
- #bibentry(<Truong.VietnameseTypography>)[关于越南文#tr[typography]的在线电子书《Vietnamese Typography》]
// * Guidance on specific characters:
- 关于特定#tr[character]的设计指导:
// - [thorn and eth](https://sites.google.com/view/briem/type-design/thorn-and-eth) (Gunnlaugur Briem)
- #bibentry(<Briem.ThornEth>, verb: [])[关于冰岛字母 thorn 和 eth 的博客文章]
// - [Tcomma and Tcedilla](https://typedrawers.com/discussion/318/tcomma-and-tcedilla)
- #bibentry(<PabloImpallari.TcommaTcedilla.2013>, verb: [])[在TypeDrawers论坛上关于 Tcomma 和 Tcedilla 的提问帖]
// - [German capital sharp s](https://typography.guru/journal/capital-sharp-s-designs/), and [OpenType feature code to support it](https://medium.com/@typefacts/the-german-capital-letter-eszett-e0936c1388f8)
- #bibentry(<Herrmann.CapitalSharp.2013>, verb: [在TypographyGuru上发表的])[关于德文中大写Sharp S的文章],在#bibentry(<Koeberlin.GermanCapital.2017>, verb: [的Medium文章])[《The German Capital Letter Eszett》] 中有如何支持此字母的OpenType特性代码
// * Microsoft's script development specifications: [Latin, Cyrillic, Greek](https://docs.microsoft.com/en-gb/typography/script-development/standard); [Arabic](https://docs.microsoft.com/en-gb/typography/script-development/arabic); [Buginese](https://docs.microsoft.com/en-gb/typography/script-development/buginese); [Hangul](https://docs.microsoft.com/en-gb/typography/script-development/hangul); [Hebrew](https://docs.microsoft.com/en-gb/typography/script-development/hebrew); [Bengali](https://docs.microsoft.com/en-gb/typography/script-development/bengali); [Devanagari](https://docs.microsoft.com/en-gb/typography/script-development/devanagari); [Gujarati](https://docs.microsoft.com/en-gb/typography/script-development/gujarati); [Gurmukhi](https://docs.microsoft.com/en-gb/typography/script-development/gurmukhi); [Kannada](https://docs.microsoft.com/en-gb/typography/script-development/kannada); [Malayalam](https://docs.microsoft.com/en-gb/typography/script-development/malayalam); [Oriya](https://docs.microsoft.com/en-gb/typography/script-development/oriya); [Tamil](https://docs.microsoft.com/en-gb/typography/script-development/tamil); [Telugu](https://docs.microsoft.com/en-gb/typography/script-development/telugu); [Javanese](https://docs.microsoft.com/en-gb/typography/script-development/javanese); [Khmer](https://docs.microsoft.com/en-gb/typography/script-development/khmer); [Lao](https://docs.microsoft.com/en-gb/typography/script-development/lao); [Myanmar](https://docs.microsoft.com/en-gb/typography/script-development/myanmar); [Sinhala](https://docs.microsoft.com/en-gb/typography/script-development/sinhala); [Syriac](https://docs.microsoft.com/en-gb/typography/script-development/syriac); [Thaana](https://docs.microsoft.com/en-gb/typography/script-development/thaana); [Thai](https://docs.microsoft.com/en-gb/typography/script-development/thai); [Tibetan](https://docs.microsoft.com/en-gb/typography/script-development/tibetan)
- 微软为各种#tr[script]编写了字体开发规范文档,比如拉丁、西里尔、希腊字母@Microsoft.DevelopingStandard。其他文种的文档包括:阿拉伯文<EMAIL>、布吉文、韩文、希伯来文、孟加拉文、天城文@<EMAIL>ari、古吉拉特文、古尔穆基文、卡纳达文、马拉雅拉姆文、奥里亚文、泰米尔文、泰卢固文、爪哇文、高棉文、老挝文、缅甸文、僧伽罗文、叙利亚文、塔纳文、泰文、藏文,均可在侧边栏目录中找到。
// * Arabic resources:
- 阿拉伯文资源:
// - <NAME>'s [Notes on some Unicode Arabic characters: recommendations for usage](https://scripts.sil.org/cms/sites/nrsi/download/arabicletterusagenotes/ArabicLetterUsageNotes.pdf)
- #bibentry(<Kew.NotesUnicode.2005>, verb: [])[向Unicode提交的提案《Notes on some Unicode Arabic characters: recommendations for usage》]
// - [Character Requirements for a Nastaliq font](https://scriptsource.org/cms/scripts/page.php?item_id=entry_detail&uid=q5mbdr6h3b)
- 《Character Requirements for a Nastaliq font》@Priestla.CharacterRequirements.2013
// * Indic script resources:
- 印度系#tr[scripts]资源:
// - The Indian Type Foundry has an [annotated feature file](https://github.com/itfoundry/devanagari-shaping/blob/master/features/core/features.fea) for Devanagari.
- #bibentry(<IndianTypeFoundry.AnnotatedFeature.2015>)[具有完善注释的天城文字体特性文件]
// * Script databases:
- #tr[scripts]数据库:
// [Omniglot](https://www.omniglot.com) is an online encyclopedia of scripts and languages.
- Omniglot @Ager.OmniglotEncyclopedia 是关于语言和#tr[script]的在线百科全书
// - [ScriptSource](https://scriptsource.org/cms/scripts/page.php) is similar, but includes an annotated version of the Unicode Character Database for each codepoint. See, for example, the page about [LATIN SMALL LETTER EZH](https://scriptsource.org/cms/scripts/page.php?item_id=character_detail_use&key=U000292).
- ScriptSource @SILInternational.ScriptSourceWriting 也是类似的网站,但它包含一个带有注解的Unicode#tr[character]数据库。例如 `LATIN SMALL LETTER EZH`的页面@SILInternational.ScriptSource.LATINEZH
// - Eesti Keele Institute [letter database](http://www.eki.ee/letter/) tells you what glyphs you need to support particular languages.
- #bibentry(<EestiKeeleInstituut.LetterDatabase>, verb: [])[的 letter database 网站]可以查找到每种语言需要支持哪些#tr[glyph]
|
https://github.com/MatheSchool/typst-g-exam | https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/docs-shiroa/g-exam-doc/examples/exam-big-image.typ | typst | MIT License | #import "mod.typ": *
#show: book-page.with(title: "Exam big images")
// #include "./exam-big-image.doc.typ"
#pagebreak()
Code:
#raw(block:true, read("./exam-big-image.doc.typ"), lang:"typ")
// #v(5cm)
// #raw(block:true, read("./exam-big-image.doc.typ"), lang:"txt")
// Codigo fuente:
// ```typ
// #raw(block:true, read("./exam-big-image.doc.typ"), lang:"txt")
// ``` |
https://github.com/Functional-Bus-Description-Language/Specification | https://raw.githubusercontent.com/Functional-Bus-Description-Language/Specification/master/src/scope-and-visibility.typ | typst | #pagebreak()
= Scope and visibility
== Import and package system
The FBDL has a concept of packages and allows importing packages into the file scope using the import statements.
A package consists of files with `.fbd` extension placed in the same directory.
A package must have at least one file and shall not be placed in more than a single directory.
A package is uniquely identified by its path.
The name of a package is equivalent to the last part of its path.
That is, it is the same as the name of the directory containing package files.
However, if the package directory name starts with the _`"fbd-"`_ prefix, then the prefix is not included in the package name.
For example, two packages with following paths `foo/bar/uart` and `baz/zaz/fbd-uart` have exactly the same name `uart`.
A package can be imported in a single line using the single-line import statement or as a part of the multi-import statement.
`single_import_statement ::= `*`import`*` [ identifier ] string_literal`
#block(breakable: false)[
Examples of single import statement:
#pad(left: 1em)[
```fbd
import "uart"
import spi "custom_spi"
```
]
]
#block(breakable: false)[
`multi_import_statement ::=` \
` `*`import`*` newline` \
` indent` \
` [ identifier ] string_literal` \
` { [ identifier ] string_literal }`
]
#block(breakable: false)[
Examples of multi import statement:
#pad(left: 1em)[
```fbd
import
"uart"
spi "custom_spi"
```
]
]
The string literal is the path of the package.
The path might not be complete, but shall be unambiguous.
For example, if two paths are visible by the import statement (_`"foo/bar/uart"`_ and _`"baz/zaz/uart"`_), and both ends with _`"uart"`_, then _`"uart"`_ path is ambiguous, but _`"bar/uart"`_ and _`"zaz/uart"`_ are not.
The optional identifier is an identifier that shall denote the imported package within the importing file.
If the identifier is omitted, then the implicit identifier for the package is the last part of its path.
=== Package discovery
Each FBDL compiler is required to carry out the package auto-discovery procedure.
The procedure must obey following rules.
#set enum(numbering: "1)")
+ If the compiler working directory contains a directory named `"fbd"`, then each of the `"fbd"` subdirectories is considered a package directory if it contains at least one file with the `".fbd"` extension.
The name of the package is the same as the name of the subdirectory, unless it has `"fbd-"` prefix.
In such a case, the prefix shall be removed from the package name.
If the name of the subdirectory matches exactly the `"fbd-"` pattern, then a compiler must report an error on an invalid package name.
+ The compiler must recursively check all subdirectories of its working path (except the `"fbd"` directory in the working directory that is described in rule number 1).
Each subdirectory with a name starting with the `"fbd-"` prefix is considered a package directory if it contains at least one file with the `".fbd"` extension.
If the name of the subdirectory matches exactly the `"fbd-"` pattern, then a compiler must report an error on an invalid package name
+ The compiler must recursively check all subdirectories of the paths defined in the `FBDPATH` environment variable.
The variable may contain multiple paths separated by the ’:’ (colon) character.
Each subdirectory with a name starting with the `"fbd-"` prefix is considered a package directory if it contains at least one file with the `".fbd"` extension.
If the name of the subdirectory matches exactly the `"fbd-"` pattern, then a compiler must report an error on an invalid package name.
Compilers are also free to have their own parameters allowing to provide extra paths to look for packages.
The below snippet presents a tree of example working directory.
#block(breakable: false)[
#pad(left: 1em)[
```
|-- externals
| `-- bar
| |-- fbd-bar
| | `-- bar.fbd
| `-- gw
| `-- bar.vhd
|-- fbd
| |-- fbd-pkg1
| | `-- a.fbd
| |-- not-a-pkg
| | `-- c.txt
| `-- pkg2
| `-- b.fbd
|-- gw
| |-- modules
| | |-- a.vhd
| | `-- b.vhd
| `-- top.vhd
`-- sw
`-- foo.py
```
]
]
In this case each FBDL compilant compiler must automatically discover following three packages:
- `bar` - path `"./externals/bar/fbd-bar"`,
- `pkg1` - path `"./fbd/fbd-pkg1"`,
- `pkg2` - path `"./fbd/pkg2"`.
== Scope rules
The following elements define a new scope in the FBDL:
- package,
- type definition,
- functionality instantiation.
The following example presents all scopes.
#block(breakable: false)[
#pad(left: 1em)[
```fbd
const WIDTH = 16
Main bus
width = WIDTH
const C20 = 20
Blk block
const C30 = 30
type cfg_t(WIDTH = WIDTH) config
atomic = false
width = WIDTH
Cfg16 cfg_t
Cfg20 cfg_t(C20)
Cfg30 cfg_t(C30)
```
]
]
The `WIDTH` constant has package scope, and it is visible at the package level, in the `Main` bus instantiation and in the `Blk` block instantiation.
It would also be visible in the `cfg_t` type definition.
However, the `cfg_t` type has the parameter with the same name `WIDTH`.
As a result, only the `WIDTH` parameter is visible within the type definition.
The `WIDTH` parameter has a default value that equals `16`.
This is because at this point the name `WIDTH` denotes the package level `WIDTH` constant.
Type parameters are visible inside the type definition, but not in the type parameter list.
The `Cfg16` is thus a non-atomic config of width `16`, the `Cfg20` is a non-atomic config of width `20` and the `Cfg30` is a non-atomic config of width `30`.
|
|
https://github.com/rabotaem-incorporated/algebra-conspect-1course | https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/05-group-theory/!sec.typ | typst | Other | #import "../../config.typ"
#if config.enable-chapters-from-sem2 [
= Теория групп
#include "01-group-theory.typ"
#include "02-related-classes.typ"
#include "03-factor-groups.typ"
#include "04-homomorphism.typ"
#include "05-direct-prod.typ"
#include "06-finitely-generated-groups.typ"
#include "07-free-groups.typ"
#include "08-group-on-set.typ"
]
|
https://github.com/simon-isler/zhaw-summaries | https://raw.githubusercontent.com/simon-isler/zhaw-summaries/main/Template/main.typ | typst | #import "template.typ": *
#show: project.with(
title: "Main Template",
authors: (
"<NAME>",
),
)
#include "./sections/1-template.typ" |
|
https://github.com/SWATEngineering/Docs | https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/PianoDiProgetto/sections/PreventivoSprint/DecimoSprint.typ | typst | MIT License | #import "../../const.typ": Re_cost, Am_cost, An_cost, Ve_cost, Pr_cost, Pt_cost
#import "../../functions.typ": prospettoOrario, prospettoEconomico, glossary
== Decimo #glossary[sprint]
*Inizio*: Venerdì 16/02/2024
*Fine*: Giovedì 22/02/2024
#prospettoOrario(sprintNumber: "10")
#prospettoEconomico(sprintNumber: "10") |
https://github.com/lkndl/typst-bioinfo-thesis | https://raw.githubusercontent.com/lkndl/typst-bioinfo-thesis/main/modules/bioinfo-covers.typ | typst | #import "styles.typ": *
#let bioinfo-front-style(body) = {
set align(center)
set text(15pt, hyphenate: false)
set block(spacing: .3em)
set par(leading: 1.4em, justify: false)
// set heading(numbering: none, outlined: false, bookmarked: false, level: 1)
table(
columns: (30%, 1fr, 40%),
align: (x, y) => (left, center, right + bottom).at(x),
inset: 0pt,
stroke: none,
image("logos/lmu_logo.svg"), //, width: 48mm),
[],
image("logos/tum_logo_wide.svg"), //, width: 64mm),
)
body
}
#let cover-page(args) = {
show: bioinfo-front-style
v(4.9cm)
if args.lang == "en" [
Bioinformatics Program \ Technical University of Munich \ Ludwig-Maximilians-Universität München \ #v(1.3cm) #args.Degree's Thesis in Bioinformatics #v(1.1cm)
] else if args.lang == "de" [
Studiengang Bioinformatik \ Technische Universität München \ Ludwig-Maximilians-Universität München \ #v(1.3cm) #{args.Degree}arbeit in Bioinformatik #v(1.1cm)
]
[
#line(length: 100%, stroke: 0.5mm)
#v(3mm)
#par(leading: .5em, text(26pt)[*#args.title*])
#v(5mm)
#line(length: 100%, stroke: 0.5mm)
#v(1.4cm)
#args.author
]
}
#let title-page(args, submission-info-content) = {
show: bioinfo-front-style
v(2.9cm)
if args.lang == "en" [
Bioinformatics Program \ Technical University of Munich \ Ludwig-Maximilians-Universität München \ #v(1.3cm) #args.Degree's Thesis in Bioinformatics #v(1.1cm)
] else if args.lang == "de" [
Studiengang Bioinformatik \ Technische Universität München \ Ludwig-Maximilians-Universität München \ #v(1.3cm) #{args.Degree}arbeit in Bioinformatik #v(1.2cm)
] else {
assert(false)
}
[
*#par(leading: .5em, text(22pt)[#args.title#v(1.1cm)#args.translated-title])*
#v(1.5cm)
]
submission-info-content
} |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz-plot/0.1.0/src/plot/mark.typ | typst | Apache License 2.0 | #import "/src/cetz.typ": draw
#import "/src/axes.typ"
// Draw mark at point with size
#let draw-mark-shape(pt, size, mark, style) = {
let sx = size
let sy = size
let bl(pt) = (rel: (-sx/2, -sy/2), to: pt)
let br(pt) = (rel: (sx/2, -sy/2), to: pt)
let tl(pt) = (rel: (-sx/2, sy/2), to: pt)
let tr(pt) = (rel: (sx/2, sy/2), to: pt)
let ll(pt) = (rel: (-sx/2, 0), to: pt)
let rr(pt) = (rel: (sx/2, 0), to: pt)
let tt(pt) = (rel: (0, sy/2), to: pt)
let bb(pt) = (rel: (0, -sy/2), to: pt)
if mark == "o" {
draw.circle(pt, radius: (sx/2, sy/2), ..style)
} else if mark == "square" {
draw.rect(bl(pt), tr(pt), ..style)
} else if mark == "triangle" {
draw.line(bl(pt), br(pt), tt(pt), close: true, ..style)
} else if mark == "*" or mark == "x" {
draw.line(bl(pt), tr(pt), ..style)
draw.line(tl(pt), br(pt), ..style)
} else if mark == "+" {
draw.line(ll(pt), rr(pt), ..style);
draw.line(tt(pt), bb(pt), ..style)
} else if mark == "-" {
draw.line(ll(pt), rr(pt), ..style)
} else if mark == "|" {
draw.line(tt(pt), bb(pt), ..style)
}
}
#let draw-mark(pts, x, y, mark, mark-size, plot-size) = {
let pts = pts.map(pt => {
axes.transform-vec(plot-size, x, y, none, pt)
}).filter(pt => pt != none)
for pt in pts {
draw-mark-shape(pt, mark-size, mark, (:))
}
}
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.