repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/wade-cheng/typst-mla
https://raw.githubusercontent.com/wade-cheng/typst-mla/main/main.typ
typst
MIT License
#import "mla.typ": * #show: mla.with( title: [Final Paper: Underwater Basket Weaving], author: [<NAME>], header: [Cheng], instructor: [<NAME>], class: [Intro Basketweaving], date: [1 January 1900], ) = INTRODUCTION #lorem(40) = METHODS #lorem(30) == Step 1 #lorem(40) == Step 2 #lorem(50) === Substep #lorem(20) === Substep #lorem(20) === Substep #lorem(20) == Step 3 #lorem(65) = RESULTS #lorem(20) Also, we found that $x$ was highly positively correlated with $y$ ($r=1.0, alpha =0.01$), which to be quite frank, was quite bizarre. Have a quote: "yipee!" (Roe 15). #lorem(20) $ sum_(i=0)^k ("more math")^2k $ #lorem(40) = DISCUSSION Yep. That's the paper.
https://github.com/howardlau1999/sysu-thesis-typst
https://raw.githubusercontent.com/howardlau1999/sysu-thesis-typst/master/info.typ
typst
MIT License
#let 学校 = "中山大学" #let 论文名称 = 学校 + "博士学位论文" #let 论文中文题目 = "基于 typst 的\n学位论文模板" #let 论文英文题目 = "A thesis template\nbased on typst" #let 日期 = "二零二三年六月" #let 中文页眉 = "基于 typst 的学位论文模板" #let 中文作者名 = "张三" #let 英文作者名 = "<NAME>" #let 学号 = "1234567890" #let 学院 = "某学院" #let 专业 = "某专业" #let 英文专业 = "Some Major" #let 方向 = "某研究方向" #let 中文导师名 = "李四" #let 英文导师名 = "<NAME>"
https://github.com/protohaven/printed_materials
https://raw.githubusercontent.com/protohaven/printed_materials/main/common-tools/drum_sander.typ
typst
#import "/meta-environments/env-features.typ": * = Drum Sander The drum sander can be used to: - Flatten a board face. - Smooth a board face. - Reduce the thickness of thin stock. == Notes Always feed stock against the rotation of the drum. A planer may be a better choice if a lot of material needs to be removed from a thick workpiece. == Parts of the Drum Sander // TODO image with parts === Full View #figure( image("images/drum_sander-full_view-annotated.png", width: 100%), caption: [ An annotated full view of the drum sander. ], ) === Sanding Drum Power Switch The sanding drum power switch turns the sanding drum motor on and off. === Sanding Drum Rotates as the workpiece advanced through the machine. Wrapped with a strip of abrasive (usually 80 grit sand paper) which is held in place on both sides with clips embedded in the drum. The abrasive should be inspected before each use to ensure that it is not scorched, overloaded, or loose on the drum. === Feed Table Speed Knob The feed table speed knob acts as the power switch and speed control for the feed table. Rotate the speed knob clockwise past the click to turn on the feed table. Once the feed table is moving, rotate the speed knob to adjust the speed of the feed table. Turn off the feed table by rotating the knob counter clockwise past the click. #warning("Make sure the drum motor is turned on before feeding a workpiece into the machine.") === Height Adjustment Crank The height adjustment crank raises and lowers the sanding drum, adjusting the clearance between the sanding drum and the feed table. === Feed Table The feed table moves the workpiece past the bottom of the sanding drum. If the feed table is pulling your workpiece to the left or right, tell the tech on duty. // For techs only: The edge should be visually inspected before each use to make sure it is centered in the guide tracks. == Replacing the Abrasive Strip on the Drum You may wish to replace the abrasive strip on the drum: - The abrasive strip on the drum is worn. - You want to use an abrasive strip with a specific grit. === Sourcing Abrasive Strips Abrasive strips are a consumable; you are welcome to use whatever is installed on the drum or left on the shelf beneath the drum sander. Protohaven sells pre-cut abrasive strips for the drum sander in the Protohaven Shop by the front desk. Check with the tech on duty for pricing and availability. You are welcome to bring your own abrasive strips, but you will need to cut the appropriate bevel in the strip for the strip to fit the drum. === Removing an Abrasive Strip From the Drum #let grid_setup = (columns: (1fr, 2in), gutter: 1em) + #grid(..grid_setup, [Start with the drum lid closed.], [#image("./images/drum_sander/removing/01-closed_lid.jpeg")] ) + #grid(..grid_setup, [Open the drum lid.], [#image("./images/drum_sander/removing/02-open_lid.jpeg")] ) + #grid(..grid_setup, [Reach into the drum and find the lever for the right clamp.], [#image("./images/drum_sander/removing/03-pull_right_clamp.jpeg")] ) + #grid(..grid_setup, [Pull up on the lever for the right clamp.], [#image("./images/drum_sander/removing/04-right_clamp_pulled.jpeg")] ) + #grid(..grid_setup, [Loosen the tapered end of the paper.], [#image("./images/drum_sander/removing/05-release_strip.jpeg")] ) + #grid(..grid_setup, [Pull the tapered end out of the drum.], [#image("./images/drum_sander/removing/06-remove_strip.jpeg")] ) + #grid(..grid_setup, [Unwind the abrasive strip from the drum.], [#image("./images/drum_sander/removing/07-unwind_strip.jpeg")] ) + #grid(..grid_setup, [The left clamp.], [#image("./images/drum_sander/removing/08-left_clamp.jpeg")] ) + #grid(..grid_setup, [Lift the left clamp to release the abrasive strip.], [#image("./images/drum_sander/removing/09-pull_left_clamp.jpeg")] ) + #grid(..grid_setup, [Pull the tapered end of the abrasive strip completely out of the drum.], [#image("./images/drum_sander/removing/10-remove_strip.jpeg")] ) + #grid(..grid_setup, [The empty drum.], [#image("./images/drum_sander/removing/11-empty_roller.jpeg")] ) === Attaching an Abrasive Strip to the Drum + #grid(..grid_setup, [Start with an empty drum.], [#image("./images/drum_sander/adding/01-empty_roller.jpeg")] ) + #grid(..grid_setup, [Lift the lever for the left clamp and insert a tapered end of the abrasive paper strip.], [#image("./images/drum_sander/adding/02-pull_left_clamp.jpeg")] ) + #grid(..grid_setup, [Wind the abrasive paper onto the drum.\ _Leave a small gap between the edges of the paper as it winds on to the drum._ ], [#image("./images/drum_sander/adding/03-wind_paper.jpeg")] ) // + #grid(..grid_setup, // [STEP], // [#image("./images/drum_sander/adding/04-rough_align_is_fine.jpeg")] // ) + #grid(..grid_setup, [The last wind of the paper around the roll should have an 1/8 inch gap.], [#image("./images/drum_sander/adding/05-leave_gap.jpeg")] ) + #grid(..grid_setup, [Insert the hook tool into the right clamp lever.], [#image("./images/drum_sander/adding/06-insert_hook_tool.jpeg")] ) + #grid(..grid_setup, [Pull the hook up, and then turn the hook so that the shoulder rests on the drum.\ _The shoulder should hold the paper in place._ ], [#image("./images/drum_sander/adding/07-pull_hook_up_and_over.jpeg")] ) + #grid(..grid_setup, [Feed the end of the taper into the right clamp.], [#image("./images/drum_sander/adding/08-strip_clamped_in_place.jpeg")] ) + #grid(..grid_setup, [Release the clamp and remove the tool.], [#image("./images/drum_sander/adding/09-remove_hook_tool.jpeg")] ) + #grid(..grid_setup, [Check the winding of the abrasive paper.\ _Retighten the strip as needed, making sure there is a gap between each winding of the abrasive strip._ ], [#image("./images/drum_sander/adding/10-tighten_paper_leaving_gap.jpeg")] ) + #grid(..grid_setup, [Pull the left clamp lever.\ _Hold the paper to the drum to keep it from unspooling._ ], [#image("./images/drum_sander/adding/11-pull_up_on_left_clamp.jpeg")] ) + #grid(..grid_setup, [Pull the taper into the drum to take up any slack in the abrasive paper.], [#image("./images/drum_sander/adding/12-tighten_paper.jpeg")] ) + #grid(..grid_setup, [The new abrasive strip is in place.\ _Recheck the gaps between the windings to make sure the paper does not overlap._ ], [#image("./images/drum_sander/adding/13-open_lid.jpeg")] ) + #grid(..grid_setup, [Close the lid.], [#image("./images/drum_sander/adding/14-closed_lid.jpeg")] ) == Basic Operation === Setting Up + Open the cover. + Raise the drum using the Height Adjustment Crank. + Place the workpiece below the drum. + Lower the drum until the drum barely touches the top of the workpiece. Check this by rotating the drum by hand. #warning("DO NOT TURN ON THE DRUM MOTOR.")\ _Turn the crank slowly as pushing the drum into the workpiece can bend the machine casting._ + Use the table feed to move the workpiece out from under the drum. + Close the cover. === Sanding + Turn on dust collection. + Open the blast gate. + Turn on the drum motor. + Turn on the feed table and adjust the table speed. + Feed the workpiece once all the way through. + Adjust the drum height for the next pass and repeat as needed. === Cleaning Up + Turn off the feed table. + Turn off the sanding drum. + Dust off and sweep up dust as needed. + Close the blast gate. + Turn off the dust collection.\ _If other members are still using the dust collector, leave it on._
https://github.com/AugustinWinther/structured-uib
https://raw.githubusercontent.com/AugustinWinther/structured-uib/main/README.md
markdown
MIT License
# Structured-UiB - A lab report template for the course PHYS114 at UiB Report template to be used for laboratory reports in the course PHYS114 - Basic Measurement Science and Experimental Physics, at the University of Bergen (https://www.uib.no/en/courses/PHYS114). The template is in Norwegian only as of now. English support may be added in the future. The first part of the packages name is arbitrary, such that it follows the naming guidelines of Typst. **Note:** The template uses the fonts **STIX Two Text** and **STIX Two Math** (https://github.com/stipub/stixfonts/tree/master/fonts). If running Typst locally on your computer, make sure you have these fonts installed. There should be no font problems if you are using Typst via https://typst.app however. Usage: ```typ // IMPORTS #import "@preview/structured-uib:0.1.0": * // TEMPLATE SETTINGS #show: report.with( task-no: "1", task-name: "Måling og behandling av måledata", authors: ( "<NAME>", "<NAME>", "<NAME>" ), mails: ( "<EMAIL>", "<EMAIL>", "<EMAIL>" ), group: "1-1", date: "29. Apr. 2024", supervisor: "Professor Professorsen", ) // CONTENT HERE... ``` Empty front page: ![thumbnail](https://github.com/AugustinWinther/structured-uib/assets/30674646/a93718d8-362d-453b-8047-3c3c4388d442) ## Licenses `lib.typ` is licensed under MIT. The contents of the `template/` directory are licensed under MIT-0. The logo/emblem of the University of Bergen (located at `media/uib-emblem.svg`) is owned by their respective owners.
https://github.com/DashieTM/ost-5semester
https://raw.githubusercontent.com/DashieTM/ost-5semester/main/compiler/weeks/week2.typ
typst
#import "../../utils.typ": * #section("lexical analysis") What does a lexer do? - turns program code into tokens - eliminates whitespaces, comments and other useless characters for compiler - marks positions in programcode for error propagation to user -> LSP, debugging Uses of a lexer - abstraction - parser has guarantee that tokens are already generated - simplicity - parser uses lookahead per token, not per character - efficiency - lexer doesn't use stack, unlike parser -> next tokens etc. #subsection("Lexem") a specific series of characters that represent a token.\ For example "MyStruct" is the lexem for a specific struct token. #subsubsection("Lexer language support") Lexers only support regular languages, this means that *only non-recursive languages are supported.*\ Note, this is specific to tokens, *multiple tokens can later be parsed into a non-regular language*.\ #align(center, [#image("../../Screenshots/2023_09_25_08_17_57.png", width: 70%)]) #align(center, [#image("../../Screenshots/2023_09_25_08_20_00.png", width: 50%)]) Note, sometimes languages can be restructured, which can lead to a language not being regular, or being regular: #align(center, [#image("../../Screenshots/2023_09_25_08_22_16.png", width: 50%)]) #text( teal, )[Note the note below, pumping lemma for proving a language not to be regular.] #subsubsection("Lexer Tokens") #subsubsubsection("Identifier") - identifier for classes, methods, variables etc - starts with a character, after that numbers are allowed - no whitespace allowed though! ```rs //Identifier = Letter { Letter | Digit }. //Letter = "A" | ... | "Z" | "a" | ... | "z". //Digit = "0" | ... | "9". ``` #subsubsection("lexer as finite automaton") A lexer absorbes as much as possible from the input to a token.\ This means that something like "my1234Name" will all convert into an identifier, not into identifier, number, identifier. #align(center, [#image("../../Screenshots/2023_09_25_08_27_30.png", width: 50%)]) #subsubsection("Comments in lexer") - are skipped by lexer - can be blocks - however, can't be boxed -> not recursive, again, lexer only supports regular languages - or can be a line -> \/\/ end of line defines end of comment #subsubsection("Tokens in lexer") #align(center, [#image("../../Screenshots/2023_09_25_08_33_31.png", width: 70%)]) - FixToken These are tokens that represent reserved *keywords or operators*. ```rs pub Enum Tag { CLASS, ELSE, IF, RETURN, WHILE, // keywords AND, OR, PLUS, MINUS, SEMICOLON // operators } ``` #text( teal, )[Note, reserved typenames should be considered to be identifiers instead!] - IdentifierToken variables, method names etc - IntegerToken token for int value - StringToken token for string value - ... #align(center, [#image("../../Screenshots/2023_09_25_08_42_11.png", width: 70%)]) each token is read by one lexer that is specific for this token. #subsubsection("Lexer Example") ```cs class CharReader { int Position { get; } char Current { get; } bool End { get; } SourceReader(TextReader reader) { // ... } void Next() {} } ``` Lexer class:// typstfmt::off ```cs class Lexer { private IEnumerable<Token> Lex(TextReader reader, …) { var source = new SourceReader(reader); var tokenLexers = new TokenLexer[]{ new NameTokenLexer(source, diagnostics), new IntegerTokenLexer(source, diagnostics), new FixTokenLexer(source, diagnostics), new SlashTokenLexer(source, diagnostics), new StringTokenLexer(source, diagnostics) }; source.Next(); One character lookahead SkipBlanks(source); while (!source.End) { if (TryLexToken(…, out var token)) yield return token!; else { // ... error SkipBlanks(source); } } // eliminate whitespaces private bool TryLexToken(tokenLexers, out Token? token) { foreach (var lexer in tokenLexers) { if (lexer.TryLex(out token)) return true; // ... } // ... return false; } ``` IntegerTokenLexer: ```cs private bool IntegerTokenLexer() { if (!IsDigit()) { token = default; return false; } int value = 0; while (!IsEnd && IsDigit()) { int digit = Current - '0’; value = value * 10 + digit; // note, here should check for values that are too big Next(); } token = new IntegerToken(value); return true; } ``` NameTokenLexer: ```cs private bool NameTokenLexer() { if (!IsLetter()) { token = default; return false; } string name = Current.ToString(); Next(); while (!IsEnd && (IsLetter() || IsDigit())) { name += Current; Next(); } token = Keywords.TryGetValue(name, out var tag) ? new FixToken(tag) : new IdentifierToken(name); return true; } ``` Remove Comments: ```cs private void SkipLineComment() { Next(); // skip second slash while (!IsEnd && Current != '\n’) { Next(); } } ``` // typstfmt::on General mechanism, the out parameter is the stream of code, which will then be used on each lexer individually until one lexer matches and creates a token.\ This is handled with the bool return on each lexer. #subsubsection("Lexer Expansions") - keep track of line - for errors and debugging - save line in tokens - extras in other languages - character literals instead of strings - string/character escaping - hex or other values - floats - error handling - errors - unexpected end of token - string or comment not terminated - values too big or too small - error handling - panic mode: exceptions - #text(teal)[return error token (please use this)] - autocorrect, replace etc. #subsubsection("Lexer Generators") These tools can generate lexers for a specific language. #align(center, [#image("../../Screenshots/2023_09_25_09_10_08.png", width: 70%)]) Usage: ```rs // grammar SmallJ; // // lexer rules // Identifier: Letter (Letter | Digit)*; // Integer: Digit+; // String: '"' .* '"'; // Letter: [A-Za-z]; // Digit: [0-9]; // Whitespaces: [ \t\r\n]+ -> skip; ``` #columns(2, [ benefits: - less programming - less silly mistakes #colbreak() negatives: - errors often unclear - temporary view is predefined - verbose generated code - dependency on tooling ])
https://github.com/matthew-e-brown/assignmatts
https://raw.githubusercontent.com/matthew-e-brown/assignmatts/main/src/helpers.typ
typst
MIT License
/// Returns a new colour based on the first with the given opacity value. #let transparentize(color, opacity) = { let space = color.space() let parts = color.components(alpha: false) space(..parts, opacity) }
https://github.com/AnsgarLichter/hka-thesis-template
https://raw.githubusercontent.com/AnsgarLichter/hka-thesis-template/main/chapters/A1_Material.typ
typst
= Additional Material #lorem(450) == Subchapter #lorem(450)
https://github.com/Dherse/codly
https://raw.githubusercontent.com/Dherse/codly/main/tests/docs/test.typ
typst
MIT License
#include "../../docs/docs.typ"
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/bugs/subelement-panic_05.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Term item (pre-emptive) #terms.item[Hello][World!]
https://github.com/duskmoon314/THU_AMA
https://raw.githubusercontent.com/duskmoon314/THU_AMA/main/docs/ch2/1-概念与例子.typ
typst
Creative Commons Attribution 4.0 International
#import "/book.typ": * #show: thmrules #show: book-page.with(title: "概念与例子") = 概念与例子 == 群的基本概念与实例 #definition("群")[ 有一个非空集合 $G$,其中有二元运算“$dot$”,$(G, dot)$ 满足: / 疯: 封闭性 $forall a, b in G, a dot b in G$ / 姐: 结合律 $forall a, b, c in G, (a dot b) dot c = a dot (b dot c)$ / 咬: 幺元 / 单位元 $exists e in G, forall a in G, e dot a = a dot e = a$ / 你: 逆元 $forall a in G, exists b in G, a dot b = b dot a = e$,记 $b = a^(-1)$ / 脚: 交换律 $forall a, b in G, a dot b = b dot a$ 从上至下,逐渐形成*原群(magma)*、*半群(semigroup)*、*幺半群(monoid)*、*群(group)*、*阿贝尔群/交换群(abelian group/commutative group)*。 ] #definition("环")[ 有一个非空集合 $R$,其中有两个二元运算“$+$”和“$dot$”,$(R, +, dot)$ 满足: - $(R, +)$ 构成交换群 - $(R, dot)$ 构成半群 - 左右分配律 $forall a, b, c in R, a dot (b + c) = a dot b + a dot c, (a + b) dot c = a dot c + b dot c$ 称为*环(ring)*。 ] #definition("域")[ $(R, +)$与$(R^*, dot)$均构成交换群的环,称为*域(field)*。 ] == 典型实例 #example("数群")[ / 数集: $NN arrow.r ZZ arrow.r QQ arrow.r RR arrow.r CC$ / 加法: $(ZZ, +), (QQ, +), (RR, +), (CC, +)$ 为群(交换、无限) / 乘法: $(QQ^*, dot), (RR^*, dot), (CC^*, dot)$ 为群($QQ^* =^triangle.t QQ {0}$) ] #example("有限群")[ 剩余类群:$ZZ_n = ZZ / (n ZZ) = {accent(0, -), dots, bar{n-1}} (accent(a, -) =^triangle.t {b in ZZ | a equiv b mod n})$ 令$G=ZZ / (n ZZ), \#G=n, accent(a, -) + accent(b, -) =^triangle.t bar{a + b}$,则$(G, +)$构成群(交换、有限) $(G, dot)$,其中$accent(a, -)dot accent(b, -)=accent(a dot b, -)$,为幺半群,幺元为$accent(1, -)$ $accent(a, -)$可逆,即$exists accent(b, -)$ s.t. $accent(a, -)dot accent(b, -)=accent(1, -)$,即$a b + k n = 1 (exists k)$,即$(a, n) = 1$互素 令$G^* = {accent(a, -) | (a, n) = 1}$,则$(G^*, dot)$构成群(交换、有限) $\#G^* = phi(n)$,特别当$n=p$素,$phi(p)=p-1$,$(G, +, dot)$构成有限域 验证唯一性 $G times G arrow.l.r G$ 设$a_1 = a + k n, b_1 = b + t n$,则$a_1 dot b_1 = (a + k n)(b + k n) = a b + (a t + b k)n + k t n^2$,即$accent(a_1 b_1, -) = accent(a b, -)$,即$accent(a, -)dot accent(b, -) = accent(a_1, -)dot accent(b_1, -)$。加法同理 ] #example("矩阵群")[ $(M_{m times n}(F), +)$构成交换群,*0* 为幺元 $(M_n(F), dot)$构成幺半群,幺元$I_n$,非交换 $G L_n(F) = {A in M_n(F) | det A eq.not 0 }$ 为群,一般线性群 $S L_n^plus.minus (F) = {A in M_n(F) | det A = plus.minus 1}$ $S L_n(F) = {A in M_n(F) | det A = 1 }$ 特殊线性群 $O_n(RR) = {A in M_n(RR) | AA^T=I }$ 正交群 $S O_n(RR) = {A in O_n | det A = 1 }$ 特殊正交群 ] #example("Klein 四元群")[ $G = {e, a, b, c}$ #table( stroke: none, columns: 5, table.vline(x: 1), [], [$e$], [$a$], [$b$], [$c$], table.hline(), [$e$], [$e$], [$a$], [$b$], [$c$], [$a$], [$a$], [$e$], [$c$], [$b$], [$b$], [$b$], [$c$], [$e$], [$a$], [$c$], [$c$], [$b$], [$a$], [$e$], ) 对称阵,交换群 ] #example("置换群")[ $S_n = {"有限集" A = {1, 2, dots, n} "上全体置换" }$(双射),$A arrow.r^sigma A$ $S_n$ 中的映射在复合意义下构成群 $sigma circle.tiny tau(i) eq^triangle.small.t sigma(tau(i))$ 且 $\#S_n = n!$ 表示方法 $sigma = mat(1, 2, dots, n; i_1, i_2, dots, i_n;)$ 如 $S_3$ 中有6个元:$sigma_1 = (1), sigma_2 = (12), sigma_3 = (23), sigma_4 = (13), sigma_5 = (123), sigma_6 = (132)$ $ sigma_2 sigma_5 mat(1; 2; 3) = sigma_2 mat(2; 3; 1) = mat(1; 3; 2) = sigma_3 mat(1; 2; 3) $ $ sigma_5 sigma_2 mat(1; 2; 3) = sigma_5 mat(2; 1; 3) = mat(3; 2; 1) = sigma_4 mat(1; 2; 3) $ $S_3$ 是阶数最小的非交换置换群 $(123)=(231)=(312), (123)=(12)(23)$ $(12)(123)=(12)(12)(23)=(23)$ $(123)(12)=(312)(12)=(31)(12)(12)=(31)=(13)$ $S_3$的乘法表: // \begin{tabular}{c|cccccc} // & (1) & (12) & (23) & (13) & (123) & (132) \\ // \hline // (1) & (1) & (12) & (23) & (13) & (123) & (132) \\ // (12) & (12) & (1) & (123) & (213) \\ // \end{tabular} #table( stroke: none, columns: 7, align: horizon + center, table.vline(x: 1), [], [$(1)$], [$(12)$], [$(23)$], [$(13)$], [$(123)$], [$(132)$], table.hline(), [$(1)$], [$(1)$], [$(12)$], [$(23)$], [$(13)$], [$(123)$], [$(132)$], // [$(12)$], [$(12)$], [$(1)$], [$(123)$], [$(213)$], [$(23)$], [$(13)$], ) ] #example([二面体群$D_n$])[ 一个允许翻转的正n边形 $\#D_3 = 6, \#D_4 = 8, dots, \#D_n = 2n$ ] == 群内的特殊元与性质 #definition()[ 左右幺元、左右逆 ] #theorem()[ 半群中,若左右单位同时存在,则必相等,即$e_L = e_R = e$,进而可知群中幺元唯一 ] #proof()[ - $e_L = e_L dot e_R = e_R$ - 设有两个幺元$e_1, e_2$,则$e_1 = e_1 dot e_2 = e_2$,即唯一 #qedhere ] #theorem()[ 群中任一元素$a$,若$a$同时具有左右逆,则$a_L^(-1)=a_R^(-1)=a^(-1)$,进而可知$a$的逆元唯一 ] #proof()[ - $a_L^(-1)=a_L^(-1) e = a_L^(-1)(a a_R^(-1)) = (a_L^(-1) a) a_R^(-1) = a_R^(-1)$ - 设有两个逆元$a_1^(-1), a_2^(-1)$,则$a_1^(-1)=a_1^(-1) a a_2^(-1) = a_2^(-1)$,即唯一 #qedhere ] #corollary()[ 幺元和逆元存在的话必唯一 ] #theorem()[ $a x = b , y a = b$,在群$G$中有唯一解;左右消去律在群$G$中成立 ] #theorem()[ 对群中任一元素$a$及整数$m , n$,有 - $lr((a^(- 1)))^(- 1) = a$ - $lr((a b))^(- 1) = b^(- 1) a^(- 1)$ - $lr((a^n))^(- 1) = lr((a^(- 1)))^n = a^(- n)$ ]
https://github.com/MattiaOldani/Informatica-Teorica
https://raw.githubusercontent.com/MattiaOldani/Informatica-Teorica/master/capitoli/complessità/19_tempo_vs_spazio.typ
typst
#import "@preview/lemmify:0.1.5": * #let ( theorem, lemma, corollary, remark, proposition, example, proof, rules: thm-rules ) = default-theorems("thm-group", lang: "it") #show: thm-rules #show thm-selector("thm-group", subgroup: "theorem"): it => block( it, stroke: red + 1pt, inset: 1em, breakable: true ) #show thm-selector("thm-group", subgroup: "proof"): it => block( it, stroke: green + 1pt, inset: 1em, breakable: true ) #import "../alias.typ": * = Tempo vs spazio Spesso promuovere l'ottimizzazione di una risorsa va a discapito dell'altra: _essere veloci_ vuol dire (tipicamente) _spendere tanto spazio_ e _occupare poco spazio_ vuol dire (tipicamente) _spendere tanto tempo_. Viene naturale porsi due domande: - _i limiti in tempo implicano dei limiti in spazio?_ - _i limiti in spazio implicano dei limiti in tempo?_ == $dtime$ VS $dspace$ Per rispondere a queste domande confrontiamo le classi $dtime(f(n))$ e $dspace(f(n))$. #theorem(numbering: none)[ Tutti i linguaggi accettati in tempo $f(n)$, sono anche accettati in spazio $f(n)$. Formalmente: $ dtime(f(n)) subset.eq dspace(f(n)). $ ] #proof[ \ Se $L in dtime(f(n))$ allora esiste una DTM $M$ che riconosce $L$ in tempo $t(n) = O(f(n))$, quindi su input $x$ di lunghezza $n$ la macchina $M$ compie $O(f(n))$ passi. In tale computazione, _quante celle del nastro di lavoro posso occupare al massimo?_\ Ovviamente $O(f(n))$ (una cella ad ogni passo). Quindi, $M$ ha complessità in spazio $s(n) = O(f(n))$, ma allora $L in dspace(f(n))$. ] #theorem(numbering: none)[ Tutte le funzioni accettate in tempo $f(n)$, sono anche accettate in spazio $f(n)$. Formalmente: $ ftime(f(n)) subset.eq fspace(f(n)). $ ] Notiamo come l'efficienza in tempo non porta immediatamente all'efficienza in spazio. Abbiamo visto che un limite in tempo implica, in qualche modo, un limite in spazio, _ma vale anche il contrario? È possibile dimostrare che $dspace(f(n)) subset.eq dtime(f(n))$?_ Avendo un numero di celle prestabilito, è possibile iterare il loro utilizzo (anche all'infinito, entrando ad esempio in un loop), di conseguenza limitare lo spazio non implica necessariamente una limitazione del tempo. Notiamo che, in una DTM $M$, un loop si verifica quando visitiamo una configurazione già visitata in passato. Sfruttando questo fatto, è possibile trovare una limitazione al tempo, trovando dopo quanto tempo vengono visitate tutte le configurazioni possibili. #theorem(numbering: none)[ Tutti i linguaggi accettati in spazio $f(n)$ vengono accettati in tempo $n dot.op alpha^(O(f(n)))$. $ dspace(f(n)) subset.eq dtime(n dot.op alpha^(O(f(n)))) $ ] #proof[ \ Dato $L in dspace(f(n))$ e una DTM $M$ esistono una serie di configurazioni per $M$ tali che $ C_0 arrow.long^delta C_1 arrow.long^delta dots.c arrow.long^delta C_m, $ in cui $C_m$ è uno stato accettante per $L$. Sappiamo che $dtime$ è calcolabile dal numero di volte che viene utilizzata la funzione transizione $delta$. Date $C_i$ e $C_j$ con $i eq.not j$, vale $C_i eq.not C_j$: infatti, se fossero uguali saremmo entrati in un loop. Di conseguenza, calcolando la cardinalità dell'insieme contenente tutte le configurazioni possibili, troviamo anche un upper bound per la risorsa tempo. Ricordiamo che una configurazione è una quadrupla $ angle.l q,i,j,w angle.r $ formata da: - $q$ stato della macchina; - $i,j$ posizioni delle due testine; - $w$ valore sul nastro di lavoro. Analizziamo quanti valori possono assumere ognuno di questi elementi: - $q$: è una costante e vale $abs(Q)$; - $i$: contando i due delimitatori, il numero massimo è $n+2$; - $j$: stiamo lavorando in $dspace(f(n))$, quindi questo indice vale $O(f(n))$, che possiamo scrivere più semplicemente come $alpha f(n)$; - $w$: è una stringa sull'alfabeto $Gamma^(O(f(n)))$, che ha cardinalità $|Gamma|^(O(f(n)))$, scrivibile anche in questo caso come $|Gamma|^(alpha f(n))$. Moltiplicando tutti questi valori, troviamo il seguente upper bound: $ |C| & lt.eq O(1) dot.op (n+2) dot.op alpha f(n) dot.op |Gamma|^(alpha f(n)) \ & lt.eq O(1) dot.op (n+2) dot.op |Gamma|^(alpha f(n)) dot.op |Gamma|^(alpha f(n)) \ & = O(1) dot.op (n+2) dot.op |Gamma|^(2alpha f(n)) \ & = O(1) dot.op (n+2) dot.op 2^(log_2(|Gamma|^(2 alpha f(n)))) \ & = O(1) dot.op (n+2) dot.op 2^(2 alpha f(n) dot.op log_2(|Gamma|)) \ & = O(n dot.op 2^(O(f(n)))). $ Quindi, $M$ sa accettare o meno $x in Sigma^*$ in al massimo $O(n dot.op 2^(O(f(n))))$ passi. Ora, data una DTM $M$ che accetta $L$ con $s(n) lt.eq alpha f(n)$, costruiamo una DTM $M'$ che su input $x in Sigma^*$, con $|x| = n$, si comporta nel seguente modo: + scrive in unario su un nastro dedicato un time-out $t$ tale che $t tilde O(n dot.op 2^(O(f(n))))$; + simula $M$ e ad ogni mossa cancella un simbolo di time-out del nastro dedicato; + se $M$ accetta o rifiuta prima della fine del time-out, allora $M'$ accetta o rifiuta allo stesso modo di $M$; + se allo scadere del time-out $M$ non ha ancora scelto, $M'$ rifiuta perché sa di essere entrata in un loop. In questo modo, $M'$ accetta il linguaggio $L$ in tempo $ t(n) = O(n dot.op 2^(O(f(n)))), $ e quindi $ dspace(f(n)) subset.eq dtime(n dot.op 2^(O(f(n)))). $ ] Come per il tempo, il teorema dimostrato vale anche per gli insiemi $fspace$ e $ftime$. #theorem(numbering: none)[ Tutti le funzioni calcolate in spazio $f(n)$ vengono calcolate in tempo $n dot.op alpha^(O(f(n)))$. $ fspace(f(n)) subset.eq ftime(n dot.op alpha^(O(f(n)))). $ ] == $P$ vs $L$ (primo round) Ottenuti questi risultati, vogliamo studiare le relazioni tra efficienza in termini di spazio (classe $L$) e l'efficienza in termini di tempo (classe $P$). #theorem(numbering: none)[ Valgono le seguenti relazioni per efficienza in spazio e efficienza in tempo: $ L subset.eq P \ fl subset.eq fp. $ ] #proof[ $ L = dspace(log(n)) & subset.eq dtime(n dot.op alpha^(O(log(n)))) = \ & = dtime(n dot.op alpha^(frac(log_alpha (n), log_alpha(2)))) = \ & = dtime(n dot.op (alpha^(log_alpha (n)))^(frac(1, log_alpha (2)))) = \ & = dtime(n dot.op n^(frac(1, log_alpha (2)))) = \ & = dtime(n dot.op n^beta) = dtime(n^(beta+1)) = dtime(n^k) = P $ Allo stesso modo è ottenibile l'inclusione per $fl$ e $fp$. ] Grazie a questo teorema sappiamo che: - *in teoria*, algoritmi efficienti in spazio portano immediatamente ad algoritmi efficienti in tempo. Non è detto il contrario: la domanda _"esiste un problema in P che non sta in L?"_ ancora oggi non ha una risposta, è un problema aperto; - *in pratica*, il grado del polinomio ottenuto da algoritmi efficienti in spazio è molto alto, e solitamente gli algoritmi efficienti in tempo vengono progettati separatamente.
https://github.com/saadulkh/typst-notes
https://raw.githubusercontent.com/saadulkh/typst-notes/main/example.typ
typst
MIT License
#import "notes.typ" #set page( paper: "a4", footer: notes.display(), // Footnotes footer-descent: 0pt ) #notes.note[Page1][This is page one] #notes.note[Same Page][This is same page] #notes.display() // Endnotes #pagebreak() #notes.note[Page2][This is page two]
https://github.com/indicatelovelace/kinave
https://raw.githubusercontent.com/indicatelovelace/kinave/main/0.1.0/docs/manual.typ
typst
#import "@preview/mantys:0.1.1": * #import "@preview/tidy:0.2.0": * #show: mantys.with( name: "Link-Style Manual", version: "0.1.0", authors: ("<NAME>",), examples-scope: none, license: "MIT", description: "This packages provides helpers for styling link.", repository: "https://github.com/indicatelovelace/link-style", title: "Link-Style", subtitle: "Manual", date: datetime.today(), abstract: [ Link Style solves the problem of styling different types of links which are not directly selectable as subelements. This includes Phone Numbers, Mail Addresses and URLs. ], examples: none, ) == About A common use case for this package is styling emails, phone addresses, document links and internet links differently. Another one is styling different websites differenty. This is particular useful for replacing links to common platforms with icons (Github, LinkedIn, etc.). == Usage To use this package, first you have to put #codesnippet[```typ #show: make-ref ... ```] in your document. You can add styling rules: #codesnippet(```typ // Shows strict mails strong #update-link-style(key: mailto-strict, value: strong) // Replace mails with emoji #update-link-style(key: mailto, value: it => [#emoji.mail]) ```) Styling rules consist of a key and a value. The key is a regex or a string to match an expression. You can find helpers for common link formats in @h2:api. The value is a function that takes and returns content, just like you would use a closure in a common show rule. \ Care that the order of the rules is of importance. This is the order in which the matchers are applied. Therefor in the above example, valid mail addresses would be styled bold. Other ```typ mailto:``` links would be shown as #emoji.mail. Inserting the same regex again will replace the rule. \ In order to effectively use the order of the rules, you can also insert before or after an element. Care that you need to match the key: #codesnippet(```typ // Shows strict mails strong #update-link-style(key: l-url(base: "typst.org", value: strong) #update-link-style(key: l-url(base: "typst.org/docs", before: l-url(base: "typst.org"), value: emph) ```) Now the docs page will be emph, instead of strong. You can also remove a rule: #codesnippet(```typ #remove-link-style(key: mailto-strict) ```) Now for every mail, that was matched by `mailto-strict` before would now be matched my `mailto`. #pagebreak(weak: true) == API reference <h2:api> #let show-module(name, scope: (:), outlined: true) = tidy-module(read(name), name: name, show-outline: outlined, include-examples-scope: false, extract-headings: 0, tidy: none) #show-module("../bib.typ")
https://github.com/AkshatAdsule/resume
https://raw.githubusercontent.com/AkshatAdsule/resume/main/resume.typ
typst
#import "@preview/guided-resume-starter-cgc:2.0.0": * #show: resume.with( author: "<NAME>", location: "Davis, CA", contacts: ( [#link("mailto:<EMAIL>")[<EMAIL>]], // [#link("https://chaoticgood.computer")[Website]], [#link("https://github.com/AkshatAdsule")[github.com/AkshatAdsule]], [#link("https://linkedin.com/in/AkshatAdsule")[linkedin.com/in/akshatadsule]], ), // footer: [#align(center)[#emph[References available on request]]] ) = Education #edu( institution: "University of California, Davis", date: "June 2026 (Expected)", gpa: "3.9 of 4.0, Dean's List", degrees: ( ("Bachelor's of Science.", "Computer Science & Engineering"), ("Minors", "Mathematics") ), ) = Skills #skills(( ("Expertise", ( [Mobile Development], [Web Development], [Backend Development], [Full-Stack Development], [Project Management], [Technical Writing], [Team Leadership], )), ("Technologies & Platforms", ( [Git], [Android], [Kotlin], [iOS], [Swift], [SwiftUI], [Objective-C], [Flutter], [React], [Docker], [Kubernetes], [Azure], [AWS], [Google Cloud Platform], [Firebase], [\*SQL], [Linux], [Web Development], [RESTful APIs], [Container Orchestration], [CI/CD Pipelines], [Agile Development] )), ("Languages", ( [C++], [C], [Python], [Java], [JavaScript/TypeScript], [HTML/CSS], [SQL], [Rust], [Swift], [Kotlin], )), )) = Experience #exp( role: "Application Developer", project: "UC Davis Information and Educational Technology", date: "October 2023 - Present", summary: "Assisting development and maintenance of a platform for academic personnel", details: [ - Worked with students and senior developers to maintain MyInfoVault, an all-encompassing platform for academic personnel - Developed 10+ new features in a complex and mature Java Spring web application as per the needs of actual users - Collaborated on an ongoing UI refresh and transitioned existing JSP pages to modern technologies such as Vue.js and Angular ] ) #exp( role: "Software Development Intern", project: "American Wild Horse Campaign", date: "June 2023 - September 2023", summary: "Leading development of a new platform for managing wild horse populations", details: [ - Worked with a team of fellow interns to build & release a full-stack mobile application to gather crowdsourced data for an ongoing project to identify and tag horses in the wild with machine learning - Designed and deployed backend systems for image processing, user management, and app functionality using standard technologies and platforms such as Node.js, Microsoft Azure, Google Firebase, PostgresSQL, Docker, and Kubernetes. - Implemented machining learning models in to the backend to ensure image validity and quality whilst removing unwanted and dangerous content - Worked on a custom cross-platform mobile application for AWHC members to contribute \& maintain a connection with the organization ] ) = Projects #exp( role: link("https://play.google.com/store/apps/details?id=tech.aksads.bp_monitor")[Blood Pressure Tracker], // project: "Blood Pressure Monitor", summary: "", details: [ - Built and published an Android/iOS app, initially for my grandparents, that helped users track their blood pressure and heart rate over time - Published on Google Play Store with over one hundred global installs in the first 3 months of release ] ) #exp( role: link("https://play.google.com/store/apps/details?id=com.homestead.mustangapp")[The Mustang Alliance], // project: "The Mustang Alliance", summary: "", details: [ - Led development for a cross-platform mobile app development during the 2020 Pandemic - Allows our team to record and analyze the performance of other teams during a competition to determine optimal strategies and team alliances - Enables scouters to record data on other teams during matches, and then analyze the data to determine the best teams to partner with and identify weaknesses in other teams ] )
https://github.com/jamesrswift/musicaux
https://raw.githubusercontent.com/jamesrswift/musicaux/main/src/commands/environments.typ
typst
#import "basic-content.typ": stretch-symbol #import "../symbols.typ": * // Renders a symbol preceding an environment, scaled to the width of that // environment #let environment( body, ..args ) = { return ( ( type: "dynamic-symbol", recurse: body, positional: args.pos(), ..args.named() ), ) } #let dynamic-stretch-symbol( body, content: none, // Move dx: 0pt, dy: 0pt, // scale sx: 1, sy: 1, // rotate angle: 0rad, origin: left+horizon ) = { if ( content == none ) {return body} return environment( body, sized-pre-draw: (self, ctx) => { stretch-symbol( content, dx: dx, dy: dy, sx: (ctx.size.width.cm() * sx) * 100%, sy: (ctx.size.height.cm() * sy) * 100%, angle: angle, origin: origin, ) } ) } #let crescendo = dynamic-stretch-symbol.with( content: symbols.crescendo, dx: 0em, dy: -0.35em, sx: 1.35, origin: left+horizon ) #let decrescendo = crescendo.with(content: symbols.decrescendo) #let tie-proto( body, content: none, // Move dx: 0pt, dy: 0pt, // scale sx: 1, sy: 1, // rotate //angle: 0rad, drop: 0pt, origin: left+horizon ) = { //if ( content == none ) {return body} return environment( body, sized-pre-draw: (self, ctx) => { let length = calc.sqrt( calc.pow(drop / 1pt, 2) + calc.pow( (ctx.size.width.cm() ) * sx, 2) ) let angle = calc.atan( drop / (1pt * ctx.size.width.pt()) ) stretch-symbol( content, dx: dx, dy: dy, sx: (ctx.size.width.cm() * sx) * 100%, sy: (ctx.size.height.cm() * sy) * 100%, angle: angle, origin: origin, ) } ) } #let tie = tie-proto.with( content: symbols.tie, dx: 0.2em, dy: -2.2em, sx: 1.35, drop: 10pt, origin: left+horizon )
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/visualize/stroke.typ
typst
// Test lines. --- stroke-constructor --- // Converting to stroke #test(stroke(red).paint, red) #test(stroke(red).thickness, auto) #test(stroke(2pt).paint, auto) #test(stroke((cap: "round", paint: blue)).cap, "round") #test(stroke((cap: auto, paint: blue)).cap, auto) #test(stroke((cap: auto, paint: blue)).thickness, auto) // Constructing with named arguments #test(stroke(paint: blue, thickness: 8pt), 8pt + blue) #test(stroke(thickness: 2pt), stroke(2pt)) #test(stroke(cap: "round").thickness, auto) #test(stroke(cap: "round", thickness: auto).thickness, auto) --- stroke-constructor-unknown-key --- // Error: 9-21 unexpected key "foo", valid keys are "paint", "thickness", "cap", "join", "dash", and "miter-limit" #stroke((foo: "bar")) --- stroke-fields-simple --- // Test stroke fields for simple strokes. #test((1em + blue).paint, blue) #test((1em + blue).thickness, 1em) #test((1em + blue).cap, auto) #test((1em + blue).join, auto) #test((1em + blue).dash, auto) #test((1em + blue).miter-limit, auto) --- stroke-fields-complex --- // Test complex stroke fields. #let r1 = rect(stroke: (paint: cmyk(1%, 2%, 3%, 4%), thickness: 4em + 2pt, cap: "round", join: "bevel", miter-limit: 5.0, dash: none)) #let r2 = rect(stroke: (paint: cmyk(1%, 2%, 3%, 4%), thickness: 4em + 2pt, cap: "round", join: "bevel", miter-limit: 5.0, dash: (3pt, "dot", 4em))) #let r3 = rect(stroke: (paint: cmyk(1%, 2%, 3%, 4%), thickness: 4em + 2pt, cap: "round", join: "bevel", dash: (array: (3pt, "dot", 4em), phase: 5em))) #let s1 = r1.stroke #let s2 = r2.stroke #let s3 = r3.stroke #test(s1.paint, cmyk(1%, 2%, 3%, 4%)) #test(s1.thickness, 4em + 2pt) #test(s1.cap, "round") #test(s1.join, "bevel") #test(s1.miter-limit, 5.0) #test(s3.miter-limit, auto) #test(s1.dash, none) #test(s2.dash, (array: (3pt, "dot", 4em), phase: 0pt)) #test(s3.dash, (array: (3pt, "dot", 4em), phase: 5em)) --- stroke-zero-thickness --- // 0pt strokes must function exactly like 'none' strokes and not draw anything #rect(width: 10pt, height: 10pt, stroke: none) #rect(width: 10pt, height: 10pt, stroke: 0pt) #rect(width: 10pt, height: 10pt, stroke: none, fill: blue) #rect(width: 10pt, height: 10pt, stroke: 0pt + red, fill: blue) #line(length: 30pt, stroke: 0pt) #line(length: 30pt, stroke: (paint: red, thickness: 0pt, dash: ("dot", 1pt))) #table(columns: 2, stroke: none)[A][B] #table(columns: 2, stroke: 0pt)[A][B] #path( fill: red, stroke: none, closed: true, ((0%, 0%), (4%, -4%)), ((50%, 50%), (4%, -4%)), ((0%, 50%), (4%, 4%)), ((50%, 0%), (4%, 4%)), ) #path( fill: red, stroke: 0pt, closed: true, ((0%, 0%), (4%, -4%)), ((50%, 50%), (4%, -4%)), ((0%, 50%), (4%, 4%)), ((50%, 0%), (4%, 4%)), ) --- stroke-text --- #set text(size: 20pt) #set page(width: auto) #let v = [测试字体Test] #text(stroke: 0.3pt + red, v) #text(stroke: 0.7pt + red, v) #text(stroke: 7pt + red, v) #text(stroke: (paint: blue, thickness: 1pt, dash: "dashed"), v) #text(stroke: 1pt + gradient.linear(..color.map.rainbow), v) --- stroke-folding --- // Test stroke folding. #let sq(..args) = box(square(size: 10pt, ..args)) #set square(stroke: none) #sq() #set square(stroke: auto) #sq() #sq(fill: teal) #sq(stroke: 2pt) #sq(stroke: blue) #sq(fill: teal, stroke: blue) #sq(fill: teal, stroke: 2pt + blue) --- stroke-composition --- // Test stroke composition. #set square(stroke: 4pt) #set text(font: "Roboto") #stack( dir: ltr, square( stroke: (left: red, top: yellow, right: green, bottom: blue), radius: 50%, align(center+horizon)[*G*], inset: 8pt ), h(0.5cm), square( stroke: (left: red, top: yellow + 8pt, right: green, bottom: blue + 2pt), radius: 50%, align(center+horizon)[*G*], inset: 8pt ), h(0.5cm), square( stroke: (left: red, top: yellow, right: green, bottom: blue), radius: 100%, align(center+horizon)[*G*], inset: 8pt ), ) // Join between different solid strokes #set square(size: 20pt, stroke: 2pt) #set square(stroke: (left: green + 4pt, top: black + 2pt, right: blue, bottom: black + 2pt)) #stack( dir: ltr, square(), h(0.2cm), square(radius: (top-left: 0pt, rest: 1pt)), h(0.2cm), square(radius: (top-left: 0pt, rest: 8pt)), h(0.2cm), square(radius: (top-left: 0pt, rest: 100pt)), ) // Join between solid and dotted strokes #set square(stroke: (left: green + 4pt, top: black + 2pt, right: (paint: blue, dash: "dotted"), bottom: (paint: black, dash: "dotted"))) #stack( dir: ltr, square(), h(0.2cm), square(radius: (top-left: 0pt, rest: 1pt)), h(0.2cm), square(radius: (top-left: 0pt, rest: 8pt)), h(0.2cm), square(radius: (top-left: 0pt, rest: 100pt)), ) --- issue-3700-deformed-stroke --- // Test shape fill & stroke for specific values that used to make the stroke // deformed. #rect( radius: 1mm, width: 100%, height: 10pt, stroke: (left: rgb("46b3c2") + 16.0mm), )
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-14.typ
typst
Other
// Error: 16-19 divisor must not be zero #calc.quo(3.0, 0.0)
https://github.com/Ngan-Ngoc-Dang-Nguyen/thesis
https://raw.githubusercontent.com/Ngan-Ngoc-Dang-Nguyen/thesis/main/my-index.typ
typst
#let classes = (main: "Main") #let index_string = "my_index" #let index(content) = place(hide( figure( classes.main, caption: content, numbering: none, kind: index_string ))) #let make-index-int(title: none, main_color_state:none) = { let content-text(content) = { let ct = "" if content.has("text") { ct = content.text } else { for cc in content.children { if cc.has("text") { ct += cc.text } } } return ct } pagebreak(to: "odd") set par(first-line-indent: 0em) locate(loc => { let mainColor = main_color_state.at(loc) let elements = query(selector(figure.where(kind: index_string)).before(loc), loc) let words = (:) for el in elements { let ct = "" if el.caption.has("body"){ ct = content-text(el.caption.body) } else{ ct = content-text(el.caption) } // Have we already know that entry text? If not, // add it to our list of entry words if words.keys().contains(ct) != true { words.insert(ct, ()) } // Add the new page entry to the list. let ent = (class: el.body.text, page: el.location().page()) if not words.at(ct).contains(ent){ words.at(ct).push(ent) } } let sortedkeys = words.keys().sorted() let register = "" if title != none { heading(level: 1, numbering: none, title) } block(columns(2,gutter: 1cm, [ #for sk in sortedkeys [ #let formattedPageNumbers = words.at(sk).map(en => { link((page: en.page, x:0pt, y:0pt), text(fill: black, str(en.page))) }) #let firstCharacter = sk.first() #if firstCharacter != register { v(1em, weak:true) box(width: 100%, fill: mainColor.lighten(60%), inset: 5pt, align(center, text(size: 1.1em, weight: "bold", firstCharacter))) register = firstCharacter v(1em, weak:true) } #set text(size: 0.9em) #if(sk.contains("!")){ h(2em) sk.slice(sk.position("!")+1) }else{ sk } #box(width: 1fr, repeat(text(weight: "regular")[. #h(4pt)])) #formattedPageNumbers.join(",") #v(0.65em, weak:true) ] ])) }) }
https://github.com/HiiGHoVuTi/requin
https://raw.githubusercontent.com/HiiGHoVuTi/requin/main/fonc/comp-monade.typ
typst
#import "../lib.typ": * #show heading: heading_fct #import "@preview/gloss-awe:0.0.5": gls #show figure.where(kind: "jkrb_glossary"): it => {it.body} _Dans ce problème, on utilisera du pseudocode fonctionnel ou le langage `OCaml`._ On suivra la convention `OCaml`, et identifiera les types génériques (`'a`) à la lettre grecque correspondante ($alpha$). On notera `.` l'opérateur de composition $compose$ et `id` la fonction identité. === Quelques foncteurs #question(0)[ Définir le type `'a option` qui est soit vide, soit contient une valeur de type `'a`. ] #correct[ ```ocaml type 'a option = None | Some of 'a ``` ] #question(0)[ Définir le type `('a, 'b) cell` qui est soit vide, soit contient une valeur de type `'a` et une valeur de type `'b`. ] #correct[ ```ocaml type ('a, 'b) cell = Nil | Cons of 'a * 'b ``` ] Un #gls(entry: "Foncteur")[_foncteur_] $F$ est un type paramétré (comme `option` ou `cell`) muni d'une fonction `fmap : ('a -> 'b) -> 'a F -> 'b F` respectant les lois #align(center, grid(columns: (1fr, 1fr), [- `fmap g . fmap f = fmap (g . f)`], [- `fmap id = id`] )) #question(0)[ Justifier que `option` est un foncteur en définissant `fmap_option`. ] #correct[ ```ocaml let fmap_option f = function | None -> None | Some x -> Some (f x) ``` ] On pose `type 'b intCell = (int, 'b) cell`. On définit la $n$-ième itérée de `intCell` comme #align(center, grid(columns: (1fr, 1fr), [- `intCell`$0$` = intCell` ], [- `'b intCell`$(n+1)$` = ('b intCell) intCell`$n$] )) #question(1)[ Montrer que `intCell`$n$ est un foncteur. ] #correct[ On montre ce résultat par récurrence. _Initialisation_: ``` let fmap_intCell0 f = function | Nil -> Nil | Cons (x, y) -> Cons (x, f y) ``` _Hérédité_: On suppose que `intCell`$n$ est un foncteur, on construit `intCell`$(n+1)$ ``` let fmap f = function | Nil -> Nil | Cons (x, y) -> Cons (x, fmap_intCelln f y) ``` ] #question(1)[ Montrer que toute structure de données à un paramètre (le type stocké) est un foncteur. ] #correct[ La fonction `fmap` applique sa fonction paramètre à tous les éléments de la structure. ] // FIXME(Juliette): complètement faux ? Soit `type 'r cont = { runCont: 'a. ('a -> 'r) -> 'r }`, soit $"cont"(rho) := (forall alpha. med alpha -> rho) -> rho$. #question(2)[ Montrer que `cont` est un foncteur. ] #correct[ ```ocaml let fmap_cont f c = { runCont: fun g -> c.runCont (g . f) } ``` ] === Quelques monades Une _monade_ $M$ est un foncteur muni de la structure suivante: ```ml type monadeM = { pure : (* pour tout *) 'a. 'a -> 'a M ; bind : (* pour tout *) 'a 'b. 'a M -> ('a -> 'b M) -> 'b M } (* les équations suivantes sont respectées *) bind (pure x) f = f x bind x pure = x bind (bind x f) g = bind x (fun y -> bind (f y) g) ``` _On ne vérifiera pas les lois dans la présentation de ses solution._ #question(1)[Montrer que `option` est une monade. Même question pour `list`.] #correct[ ```ocaml let monadeOption = { pure = fun x -> Some x ; bind = fun x -> fun f -> match x with | None -> None | Some y -> f y } let monadeList = { pure = fun x -> [x] (* petit spoilter pour la suite *) ; bind = fun x -> fun f -> concat (List.map f x) } ``` ] On définit pour $sigma$ fixé `type 'a `$sigma$`_etat = `$sigma$` -> `$sigma$` * 'a`. #question(1)[Montrer que $sigma$`_etat` est une monade.] #correct[ ```ocaml let monade_s_Etat = { pure = fun x -> fun s -> s, x ; bind = fun x -> fun f -> fun s -> let s', x' = x s in f x' s' } ``` ] #question(1)[Décrire comment utiliser $sigma$`_état` pour simuler le comportement d'une variable muable de type $sigma$.] #correct[ On met en évidence une bijection entre les deux types de programme. ``` let simulation : 'a -> 'b s_etat = fun a -> fun s -> let r = ref s in let b = programme_qui_modifie_r r in !r, b let effet : 's ref -> 'a -> 'b = fun r -> fun a -> let r', b = programme_sans_effet a !r in r := r'; b ``` ] On considère une définition alternative de la structure de monade: ```ml type monadeM' = { pure : (* pour tout *) 'a. 'a -> 'a M ; join : (* pour tout *) 'a. ('a M) M -> 'a M } (* les équations suivantes sont respectées *) join . pure = id join . (fmap return) = id join . join = join . (fmap join) ``` #question(2)[Démontrer que cette définition est équivalente à la précédente. _On pourra construire une bijection entre les deux types_.] #correct[ ``` let sens1 (mon : monadeM) : monadeM' = { pure = mon.pure ; join = fun x -> mon.bind id x } let sens2 (mon : monadeM') : monadeM = { pure = mon.pure ; bind = fun f -> fun x -> mon.join (fmap f x) } ``` ] #question(1)[Justifier la qualification de "#gls(entry: "Monoïde")[monoïde]" pour $M$.] #correct[ - `pure` représente l'élément neutre - `join` représente la loi de composition interne - les lois sont analogues ] On définit pour $M_1$ et $M_2$ deux types paramétrés `type 'a compose_M1_M2 = ('a M1) M2`. #question(1)[Donner une condition suffisante pour que `compose_M1_M2` soit un foncteur.] #correct[ Si $M_1$ et $M_2$ sont des foncteurs, ```ocaml let fmap_m1_m2 f x = fmap_m2 (fmap_m1 f) x ``` ] #question(2)[Donner une condition suffisante pour que `compose_M1_M2` soit une monade.] #correct[ Si $M_1$ et $M_2$ sont des monades, _et_ qu'on dispose de `inter21 : ('a M2) M1 -> ('a M1) M2` et `inter12 : ('a M1) M2 -> ('a M2) M1`, ```ocaml let monade_m1_m2 mon1 mon2 = { pure = fun x -> mon2.pure (mon1.pure x) ; join = fmap mon1.join . fmap inter12 . fmap mon2.join . inter21 } ``` La condition est donc une condition de _commutation_ des endofoncteurs entre eux. ] === Une limite _On rappelle que `intCell`$n$ est définie en partie I_. #question(0)[Décrire intuitivement la limite de la suite `intCell`$n$.] #correct[ La limite est `int list`, car `intCell`$n$ représente les suites d'entiers à support dans $[|0, n|]$. ] On pose pour $F$ un foncteur fixé `type `$F$`_fix = { fix: (* pour tout *) 'a. ('a `$F$` -> 'a) -> 'a }`, soit $"fix"(F) := forall a. med (F a -> a) -> a$. #question(3)[Implémenter une bijection entre les types $F("fix"(F))$ et $"fix"(F)$.] #correct[ ```ocaml let wrap (ff : F_fix F) : F_fix = { fix = fun f -> f (fmap (fun fx -> fx.fix f) ff) } let unwrap (fx : F_fix) : F_fix F = fx.fix (fmap wrap) ``` ] #question(0)[Justifier alors que `intCell_fix = int list`.] #correct[ On d'après la question précédente a `intCell_fix = intCell_fix intCell` (au sens de l'isomorphisme). C'est-à-dire `intCellFix = Nil | Cons of int * intCellFix`. On retrouve la définition de `int list`. ] #import "@preview/fletcher:0.5.1" as fletcher: diagram, node, edge Une #gls(entry: "Transformation naturelle")[_transformation naturelle_] $alpha$ entre un foncteur $F$ et un foncteur $G$ est une famille de fonctions telles que pour $x,y$ des types et $h : x -> y$, le diagramme suivant commute #align(center, diagram( node((0, 0), $F(x)$), node((0, 1), $G(x)$), node((1, 0), $F(y)$), node((1, 1), $G(y)$), edge((0, 0), (0, 1), "->", $alpha_x$), edge((1, 0), (1, 1), "->", $alpha_y$), edge((0, 0), (1, 0), "->", $"fmap"F(h)$), edge((0, 1), (1, 1), "->", $"fmap"G(h)$), )) On notera `f ~> g` le type d'une transformation naturelle en `OCaml`, qu'on s'autorise à utiliser comme une fonction. #question(3)[Implémenter `hoist : (F ~> G) -> fix_F -> fix_G`.] #correct[ ```ocaml let hoist n fx = { fix = fun roll -> fx.fix (roll . n) } ``` ] Soit $F$ un foncteur, on pose `type 'a G = Pure of 'a | Free of 'a F`. #question(3)[Montrer que $"fix"(G)$ est une monade.] _On l'appelle la monade libre de $F$._ #correct[ ```ocaml let fmap_G f = hoist (fmap_F f) let embed x = { fix = fun f -> f x } let rec monadeG = { pure = fun x -> embed (Pure x) ; join = fun x -> match unwrap x with | Pure y -> y | Free gy -> embed (Free (fmap_G monadeG.join gy)) } ``` ]
https://github.com/maucejo/book_template
https://raw.githubusercontent.com/maucejo/book_template/main/template/chapters/ch1.typ
typst
MIT License
#import "../../src/book.typ": * #show: chapter.with(title: "Premier chapitre") == Objectifs #lorem(100) Les équations @eq:1 et @eq:2 sont des équations très importantes. $ integral_0^1 f(x) dif x = F(1) - F(0) "et voilà" $ <eq:1> $ integral_0^1 f(x) dif x = F(1) - F(0) "et voilà" $ <eq:2> La Figure @fig:1 illustre le cas d'industriels utilisant des absorbants. #figure( image("../images/chapitre1/cas_indus_absorbants.png", width: 75%), caption: [#ls-caption([#lorem(10)], [#lorem(2)])], ) <fig:1> La Figure @fig:subfig présente la carte du Cnam. La Figure @b illustre la région du Cnam @Smi21. #subfigure( figure(image("../images/chapitre1/cnam_region.png"), caption: []), figure(image("../images/chapitre1/cnam_region.png"), caption: []), <b>, columns: (1fr, 1fr), caption: [(a) Left image and (b) Right image], label: <fig:subfig>, ) #figure( table( columns: 3, table.header( [Substance], [Subcritical °C], [Supercritical °C], ), [Hydrochloric Acid], [12.0], [92.1], [Sodium Myreth Sulfate], [16.6], [104], [Potassium Hydroxide], table.cell(colspan: 2)[24.7], ), caption: [#lorem(4)] )
https://github.com/herbhuang/utdallas-thesis-template-typst
https://raw.githubusercontent.com/herbhuang/utdallas-thesis-template-typst/main/content/proposal/objective.typ
typst
MIT License
#import "/utils/todo.typ": TODO = Objective #TODO[ // Remove this block *Proposal Objective* - What are the main goals of your thesis? - Ideally this section starts with a short overview where you state the goals with short enumerated bulletpoints, i.e. 1., 2., 3., ... - Then, the section has a sub section for each goal (repeating the bulletpoint before to stay consistent) which is at least two paragraphs long and describes the goal in more detail ]
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/visualize/shape-aspect_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test square that is limited by region size. #set page(width: 20pt, height: 10pt, margin: 0pt) #stack(dir: ltr, square(fill: forest), square(fill: conifer))
https://github.com/spidersouris/touying-unistra-pristine
https://raw.githubusercontent.com/spidersouris/touying-unistra-pristine/main/src/admonition.typ
typst
MIT License
#import "colors.typ": * #import "settings.typ" as settings // Credit: piepert // https://github.com/piepert/grape-suite/blob/3be3e71a994bae82c9a9dedf41e918d7837ccc39/src/elements.typ #let ADMONITION-TRANSLATIONS = ( "task": ( "sg": ( "en": "Task", "fr": "Tâche", ), "pl": ( "en": "Tasks", "fr": "Tâches", ), ), "definition": ( "sg": ( "en": "Definition", "fr": "Définition", ), "pl": ( "en": "Definitions", "fr": "Définitions", ), ), "example": ( "sg": ( "en": "Example", "fr": "Exemple", ), "pl": ( "en": "Examples", "fr": "Exemples", ), ), "brainstorming": ( "sg": ( "en": "Brainstorming", "fr": "Remue-méninges", ), "pl": ( "en": "Brainstormings", "fr": "Remue-méninges", ), ), "question": ( "sg": ( "en": "Question", "fr": "Question", ), "pl": ( "en": "Questions", "fr": "Questions", ), ), ) #let admonition( body, title: none, time: none, primary-color: pink.E, secondary-color: pink.E.lighten(90%), tertiary-color: pink.E, dotted: false, figured: false, counter: none, show-numbering: settings.ADMONITION-NUMBERING, numbering-format: (..n) => numbering("1.1", ..n), figure-supplement: none, figure-kind: none, text-color: black, emoji: none, ) = { if figured { if figure-supplement == none { figure-supplement = title } if figure-kind == none { panic("once parameter 'figured' is true, parameter 'figure-kind' must be set!") } } let body = { if show-numbering or figured { if counter == none { panic("parameter 'counter' must be set!") } counter.step() } block( width: 100%, height: auto, inset: 0.2em, outset: 0.2em, fill: secondary-color, stroke: ( left: ( thickness: 5pt, paint: primary-color, dash: if dotted { "dotted" } else { "solid" }, ), ), pad( left: 0.3em, right: 0.3em, text( size: 1.1em, strong( text( fill: tertiary-color, emoji + " " + smallcaps(title) + if show-numbering or figured { [ ] + context numbering( numbering-format, ..counter.at(here()), ) + h(1fr) + time }, ), ), ) + block( above: 0.8em, text(size: 1.2em, fill: text-color, body), ), ), ) } if figured { figure(kind: figure-kind, supplement: figure-supplement, body) } else { body } } #let task(body, plural: false) = admonition( body, title: (ADMONITION-TRANSLATIONS).at("task").at(if plural { "pl" } else { "sg" }).at(settings.LANGUAGE), primary-color: blue.E, secondary-color: blue.E.lighten(90%), tertiary-color: blue.E, figure-kind: "task", counter: counter("admonition-task"), emoji: emoji.hand.write, ) #let definition(body, plural: false) = admonition( body, title: (ADMONITION-TRANSLATIONS).at("definition").at(if plural { "pl" } else { "sg" }).at(settings.LANGUAGE), primary-color: ngreen.C, secondary-color: ngreen.C.lighten(90%), tertiary-color: ngreen.B, figure-kind: "definition", counter: counter("admonition-definition"), emoji: emoji.brain, ) #let brainstorming(body, plural: false) = admonition( body, title: (ADMONITION-TRANSLATIONS).at("brainstorming").at(if plural { "pl" } else { "sg" }).at(settings.LANGUAGE), primary-color: orange.E, secondary-color: orange.E.lighten(90%), tertiary-color: orange.E, figure-kind: "brainstorming", counter: counter("admonition-brainstorming"), emoji: emoji.lightbulb, ) #let question(body, plural: false) = admonition( body, title: (ADMONITION-TRANSLATIONS).at("question").at(if plural { "pl" } else { "sg" }).at(settings.LANGUAGE), primary-color: violet.E, secondary-color: violet.E.lighten(90%), tertiary-color: violet.E, figure-kind: "question", counter: counter("admonition-question"), emoji: emoji.quest, )
https://github.com/Ryoga-itf/differential-equations
https://raw.githubusercontent.com/Ryoga-itf/differential-equations/main/report01/report.typ
typst
#import "../template.typ": * #import "@preview/tenv:0.1.1": parse_dotenv #import "@preview/physica:0.9.2": * #let env = parse_dotenv(read("../.env")) #show: project.with( week: "第1回", authors: ( (name: env.STUDENT_NAME, email: "学籍番号:" + env.STUDENT_ID, affiliation: "所属:情報科学類"), ), date: "2024 年 10 月 3 日", ) #show math.equation: set text(font: ("New Computer Modern Math", "Noto Serif", "Noto Serif CJK JP")) == 問題 1 === (1) 与えられた解について両辺を微分すると、 $ x &= g/2 t^2 + v_0 t + x_0 \ therefore dv(x, t) &= g t + v_0 \ therefore dv(x, t, 2) &= g $ === (2) 与えられた解について両辺を微分すると、 $ x &= X sin(omega t + theta) \ therefore dv(x, t) &= X omega cos (omega t + theta) \ therefore dv(x, t, 2) &= - X omega^2 sin(omega x + theta) = - omega^2 x $ === (3) 与えられた解について両辺を微分すると、 $ x &= A e^(mu t) + B e^(-mu t) \ therefore dv(x, t) &= A e^(mu t) mu - B e^(-mu t) mu \ therefore dv(x, t, 2) &= A e^(mu t) mu^2 + B e^(-mu t) mu^2 = mu^2 (A e^(mu t) + B e^(-mu t)) = mu^2x $ === (4) 与えられた解について両辺を微分すると、 $ x &= A e^(lambda t) + B e^(-lambda t) + X sin(lambda t + theta) \ therefore dv(x, t) &= A e^(lambda t) lambda - B e^(-lambda t) lambda + X cos(lambda t + theta) lambda \ therefore dv(x, t, 2) &= A e^(lambda t) lambda^2 + B e^(-lambda t) lambda^2 - X sin(lambda t + theta) lambda^2 \ therefore dv(x, t, 3) &= A e^(lambda t) lambda^3 - B e^(-lambda t) lambda^3 - X cos(lambda t + theta) lambda^3 \ therefore dv(x, t, 4) &= A e^(lambda t) lambda^4 + B e^(-lambda t) lambda^4 + X sin(lambda t + theta) lambda^4 = lambda^4 (A e^(lambda t) + B e^(-lambda t) + X sin(lambda t + theta)) = lambda^4 x \ $ === (5) 解 $y &= C x - C^2$ について両辺を微分すると、 $ y &= C x - C^2 \ therefore y' &= C \ $ よって、$y'^2 = C^2, x y' = C x$ であるから、 $ y'^2 - x y' + y = C^2 - C x + y = y - y = 0 $ また、解 $y &= x^2/4$ について両辺を微分すると、 $ y &= x^2/4 \ therefore y' &= x/8 \ $ よって、$y'^2 = x^2/16, x y' = x^2/8$ であるから、 $ y'^2 - x y' + y = x^2 / 16 - x^2/8 + x^2/4 = y - y = 0 $ == 問題 2 全問より与えられた微分方程式の解は以下のように表される $ x = X sin(omega t + theta) space space space ("ここで" X, theta "は定数") $ また、 $ x' = X omega cos(omega t + theta) $ 初期条件を代入すると $ x = X sin theta = 3, x' = X omega cos theta = 0 $ 特に $omega != 0$ であるから、$X cos theta = 0$ ここで $X = 0$ は不適であるから $cos theta = 0$ よって、 $ theta = pi / 2 + 2n pi, space 3 / 2 pi + 2n pi $ だだし、$n$ は整数である。 また、$theta = pi / 2 + 2n pi$ のとき $X = 3$ が、$theta = 3 / 2 pi + 2n pi$ のとき $X = -3$ が得られる。 よって、求める解は $ x = 3sin(omega t + pi / 2), space -3sin(omega t + 3 / 2 pi) $ すなわち、 $ x = 3cos omega t $
https://github.com/lyzynec/orr-go-brr
https://raw.githubusercontent.com/lyzynec/orr-go-brr/main/05/main.typ
typst
#import "../lib.typ": * #knowledge[ #question(name: [Understand and explain the _Bellman's principle of optimality_.])[ #quote(attribution: [Bellman, presumably], block: true)[ If the shortest path from pub home takes you to a bar, the rest of the path home is the shortest path from bar home. ] ] #question(name: [Show how dynamic programming and Bellman's principle of optimality can be used to give analytical solution to a discrete--time LQ--optimal control on a finite control interval.])[ #part(name: [Discrete decisions])[ For a graph--like space of discrete decisions the problem is simmilar to finding the shortest path by starting from the end and working backwards in search for start. ] #part(name: [Now something real])[ System equation $ bold(x)_(k+1) = bold(f)(bold(x)_k, bold(u)_k) $ models our system for which we search for the optimal control. The cost function with initial state $bold(x)_i$ is defined generally as $ J_i (bold(x)_i, [bold(u)_i, bold(u)_(i+1), ..., bold(u)_(N-1)]) = phi.alt(bold(x)_N) + sum_(k=1)^(N-1) L_k (bold(x)_k, bold(u)_k) $ Now the optimum for cost function $J_i$ is $ J_i^* (bold(x)_i) = min_(bold(u)_j "for" j in [i, N-1]) J_i (bold(x)_i, [bold(u)_i, bold(u)_(i+1), ..., bold(u)_(N-1)]) $ Note that $J_i^* (bold(x)_i)$ is a function of $bold(x)_i$ (initial state) only. Now, if we apply any (not neccesatily optimal) control $bold(u)_k$ the cost would, according to Bellman, be $ J_k^* (bold(x)_k) = min_bold(u)_k (L_k (bold(x)_k, bold(u)_k) + J_(k+1)^* (bold(x)_(k+1))) $ Now what to do with it: - Lets say $bold(x)_k in RR^n$. Than we sample the state space in $n + 1$ dimensions. The $+ 1$ being for time. - For each sample, we calculate the optimal policy (step to be performed at that point). - Thats it really. Note that this scales terribly with higher dimensions. Also good point is that interpolation between samples is really good idea. If we simply round to nearest point we might get something that is far from optimal. ] ] #question(name: [Give the _Hamilton--Jacobi--Bellman_ (HJB) equation and explain it as a reformulation of the principle of optimality for continuous--time systems. Give also its version featuring the Hamiltonian function.])[ The HJB equation is $ - (diff J^* (bold(x), t))/(diff t) = min_(bold(u)(t)) [L(bold(x), bold(u), t) + (gradient_bold(x) J^* (bold(x), t))^T bold(f)(bold(x), bold(u), t)] $ As Hamiltonian is defined as $ H(bold(x), bold(u), bold(lambda), t) = L(bold(x), bold(u), t) + bold(lambda)^T bold(f)(bold(x), bold(u), t) $ the HJB equation can be reformulated as $ - (diff J^* (bold(x), t))/(diff t) = min_(bold(u)(t)) H(bold(x), bold(u), gradient_bold(x) J^* (bold(x), t), t) $ meaning we have to minimize Hamiltonian to achieve optimal control. ] ] #skills[ #question(name: [Use dynamic programming to design an optimal feedback controller in the form of a lookup table for a general (possibly nonlinear) discrete-time dynamical system.])[] ]
https://github.com/atareao/cheatsheets
https://raw.githubusercontent.com/atareao/cheatsheets/main/src/docker.typ
typst
MIT License
#let header( title: "", logo: none ) = { box( fill: aqua, width: 100%, inset: (top: 10pt, left: 20pt, bottom: 10pt), [ #grid( columns: (auto, 1fr), gutter: 10pt, [ #if logo != none [ #box( inset: (left: 10pt), [ #image(logo, height: 32pt) ] ) ] ], [ #set text( size: 32pt, fill: rgb("#333"), ) #title ] ) ] ) } #let elemento( description: "", command: "", sample: none ) = { set text(size: 10pt) block(below: 8pt, text(fill: gray)[- #description]) [ #set list(marker: [ ]) - #command #if sample != none [ - #emph[#sample] ] ] } #let columna( title: "", body ) = { box( fill: aqua, inset: (x: 10pt, y: 10pt), radius: 10pt, [ #box( fill: aqua, [ #title ] ) #box( fill: white, width: 100%, inset: (top: 10pt ), outset: (x: 10pt, bottom: 10pt), [ #body ] ) ] ) } #set page( paper: "a4", flipped: true, margin: 0pt, ) #set text( font: "Ubuntu", ) #header( title: "Chuletilla para Docker", logo: "docker-logo.svg" ) #box( fill: gray, height: 100%, width: 100%, outset: (top: 10pt), inset: (x: 25pt), [ #box( fill: gray, height: 100%, width: 100%, //outset: (x:10pt, y: 20pt), [ #grid( columns: (1.2fr, 1fr, 1fr, 1fr), gutter: 10pt, [ #columna( title: "Ejecutar contenedores", [ #elemento( description: "Inicia un contenedor", command: "docker run IMAGE", sample: "docker run nging" ) #elemento( description: "... y le asigna un nombre", command: "docker run --name <CONTENEDOR> <IMAGE>", sample: "docker run --name web nging" ) #elemento( description: "... y mapea un puerto", command: "docker run -p <HPORT:CPORT> <IMAGE>", sample: "docker run -p 8080:80 nginx" ) #elemento( description: "... y mapea todos los puertos", command: "docker run -P <IMAGE>", sample: "docker run -P nginx" ) ] ) ], [ #columna( title: "Gestionar contenedores", [ #elemento( description: "Lista contendores en ejecución", command: "docker ps" ) #elemento( description: "Lista todos los contendores", command: "docker ps -a" ) #elemento( description: "Elimina un contendor", command: "docker rm <CONTENEDOR>", sample: "docker rm web" ) ] ) ], [ #columna( title: "Gestionar imágenes", [ #elemento( description: "Descargar una imagen", command: "docker pull <IMAGE[:TAG]>", sample: "docker pull nginx", ) #elemento( description: "Subir una imagen", command: "docker push <IMAGE[:TAG]>", sample: "docker push myimage:1.0", ) #elemento( description: "Borrar una imagen", command: "docker rmi <IMAGE>", sample: "docker rmi myimage", ) #elemento( description: "Listar imágenes", command: "docker images", ) ] ) ], [ #columna( title: "Información", [ #elemento( description: "Logs", command: "docker logs <CONTAINER>", sample: "docker logs web", ) #elemento( description: "Estadísticas", command: "docker stats", ) #elemento( description: "Procesos en un contenedor", command: "docker top <CONTAINER>", sample: "docker top web", ) #elemento( description: "Versión de docker", command: "docker version", ) #elemento( description: "Información de un objeto", command: "docker inspect <NAME>", sample: "docker inspect web", ) #elemento( description: "Modificaciones en un contendor", command: "docker diff <CONTAINER>", sample: "docker diff web", ) #elemento( description: "Puertos de un contendor", command: "docker port <CONTAINER>", sample: "docker port web", ) ] ) ], ) ] ) ] )
https://github.com/zagoli/simple-typst-thesis
https://raw.githubusercontent.com/zagoli/simple-typst-thesis/main/.typst-preview.main.typ
typst
Apache License 2.0
#import "template.typ": project #show: project.with( title: "The Magical Green Bean 😎", authors: ( (name: "<NAME>", email: "<EMAIL>", affiliation: "University of Studies", postal: "Via dei gigli, 18/b", phone: "3402203300"), ), abstract: lorem(59) ) = Introduction #lorem(60) == In this paper #lorem(20) === Contributions #lorem(40) #parbreak() #lorem(30) == Related Work #lorem(500) #lorem(500) == More related work #lorem(100) #figure( image("Business.jpg", width: 70%), caption: "Serious Business." ) = A New Life #lorem(700) = A New World #lorem(20) #parbreak() #lorem(500) == Check out the Headers #lorem(150) #lorem(150) === Do you like them? #lorem(300) // Bibliography section #pagebreak(weak: true) #set page(header: []) = Bibliography #lorem(30)
https://github.com/heiafr-isc/typst-report-template
https://raw.githubusercontent.com/heiafr-isc/typst-report-template/main/main.typ
typst
Apache License 2.0
// --------------------------------------------------------------------------- // Copyright © 2024 Haute école d'ingénierie et d'architecture de Fribourg // SPDX-License-Identifier: Apache-2.0 // --------------------------------------------------------------------------- // Author : <NAME> <<EMAIL>> // Date : 23 February 2024 // --------------------------------------------------------------------------- // Example of a student reports at the Haute école d'ingénierie et // d'architecture de Fribourg // --------------------------------------------------------------------------- #import "lib/heiafr.typ": report #import "@preview/big-todo:0.2.0": * #import "@preview/tablex:0.0.8": tablex, hlinex, vlinex #set text(region: "ch", lang: "fr") // // N.B. : The versions array need to be ordered from the oldest to the newest // #let versions = (( version: "0.1.0", date: datetime(year: 2024, month: 2, day: 20), author: [<NAME>], changes: [Version initiale], ), ( version: "0.1.1", date: datetime(year: 2024, month: 2, day: 22), author: [B. Vonlanthen], changes: lorem(10), ),) #let authors = (( firstname: "Margaret", lastname: "Hamilton", email: "<EMAIL>", gender: "f", ), ( firstname: "Martin", lastname: "<NAME>", email: "<EMAIL>", gender: "m", ),) #show: doc => report( type: "Projet de bachelor", year: [2023/2024], profile: [Orientation Ingénierie des données], title: [ Vers une unification de la physique ], subtitle: [ Comprendre les mystères du monde qui nous entoure ], authors: authors, supervisors: ("<NAME>", "<NAME>"), versions: versions, doc, ) = Introduction <intro> #lorem(10) == #lorem(3) <label> #lorem(50) @electronic La @usoftime illustre #lorem(10) #figure( image("Graphjam-Essay.jpg", width: 80%), caption: [Utilisation du temps les les 12 heures avant la remise d'un rapport de 60 pages ], ) <usoftime> #todo("structure du rapport") = Analyse comme vu dans le @intro et le @label... #lorem(50) = Conception #lorem(50) = Réalisation #lorem(50) = Tests et validations #lorem(50) = Conclusion #lorem(50) = Annexes #set heading(numbering: none) = Glossaire = Remerciements #bibliography(style: "association-for-computing-machinery", "bibliography.yml")
https://github.com/hrmnjt/resume
https://raw.githubusercontent.com/hrmnjt/resume/main/README.md
markdown
Apache License 2.0
# hrmnjt's resume Hello reader! You have landed on codebase which I use to generate my resume. Some features that I deliberately wanted to have are: - Version controlled resume, so that I can track how I'm evolving over time - Ease of access, so I can share the link or artifact from any system. Thanks Github! - Single page format, so that hiring managers don't break their head - Programmatic typesetting with accurate render, so that resume looks consistent digitally and when printed. Also, I hate word processors - Comments in resume, so that I can explain details of a project even if not written in resume. This repository is dual licensed. Format of resume is Apache Licensed but content of my resume is Copyrighted and is owned by <NAME>. Completely. Check [License](#license) for details. ## Installation and usage Earlier I was using LaTeX to generate my resume, but since I've found [Typst](https://typst.app/). Writing the resume is so much faster and fun with Typst. Preferred method is to work with Visual Studio code and Typst LSP. Steps: - Install VSCode - Install plugin Typst LSP (https://marketplace.visualstudio.com/items?itemName=nvarner.typst-lsp) - Write and save your doc to get PDF output If you are using another editor you might have to do something like below. I suggest creating a small Makefile to handle the generation of the resume post edits. Steps: ```sh # 1 - Get latest release from https://github.com/typst/typst/releases curl -LJO https://github.com/typst/typst/releases/download/v23-03-21-2/typst-x86_64-apple-darwin.tar.gz # extract and get binary tar -xvzf typst-x86_64-apple-darwin.tar.gz mv typst-x86_64-apple-darwin/typst . rm -rf typst-x86_64-apple-darwin* # compilation and output typst resume.typ ``` ## License License for [resume.typ](./resume.typ) ``` Copyright 2020-2023 <NAME> resume.typ content is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Terms - https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode ``` License for template and general repository code ``` Copyright 2020-2023 <NAME> Licensed 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. ```
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/spread-01.typ
typst
Other
// Test multiple calls. #{ let f(b, c: "!") = b + c let g(a, ..sink) = a + f(..sink) test(g("a", "b", c: "c"), "abc") }
https://github.com/baijing0328/CV
https://raw.githubusercontent.com/baijing0328/CV/master/README.md
markdown
来源自 https://github.com/OrangeX4/Chinese-Resume-in-Typst 做了部分格式上的修改
https://github.com/Area-53-Robotics/53B-Notebook-Over-Under-2023-2024
https://raw.githubusercontent.com/Area-53-Robotics/53B-Notebook-Over-Under-2023-2024/master/entries/early_season/drive_loctite.typ
typst
Creative Commons Attribution Share Alike 4.0 International
#import "/templates/entries.typ": * #import "/templates/headers.typ": * #import "/templates/text.typ": * #create_default_entry( title: [Drivetrain Maintenance], date: [October 13th, 2023], witness: [Juan], design: [Deb], content: [ #box_header( title: [Loctite Drivetrain Motors], color: purple.lighten(60%) ) \ #entry_text() We had noticed a recurring issue that the motors kept coming loose. This was very annoying, and made us lose valuable practice time taking off the wheels and tightening the motors. To resolve this issue, we decided to use Loctite 242 to ensure that the motors don't come lose anymore. #align(center)[ #image("/assets/lutete.jpg", height: 50%) ] ] )
https://github.com/metamuffin/typst
https://raw.githubusercontent.com/metamuffin/typst/main/tests/typ/compiler/field.typ
typst
Apache License 2.0
// Test field access. // Ref: false --- // Test field on dictionary. #let dict = (nothing: "ness", hello: "world") #test(dict.nothing, "ness") #{ let world = dict .hello test(world, "world") } --- // Test fields on elements. #show list: it => { test(it.children.len(), 3) } - A - B - C --- // Test fields on function scopes. #enum.item #assert.eq #assert.ne --- // Error: 9-16 function `assert` does not contain field `invalid` #assert.invalid --- // Error: 7-14 function `enum` does not contain field `invalid` #enum.invalid --- // Error: 7-14 function `enum` does not contain field `invalid` #enum.invalid() --- // Closures cannot have fields. #let f(x) = x // Error: 4-11 cannot access fields on user-defined functions #f.invalid --- // Error: 6-13 dictionary does not contain key "invalid" and no default value was specified #(:).invalid --- // Error: 8-10 cannot access fields on type boolean #false.ok --- // Error: 25-28 content does not contain field "fun" and no default value was specified #show heading: it => it.fun = A --- // Error: 9-13 cannot access fields on type boolean #{false.true}
https://github.com/EpicEricEE/typst-marge
https://raw.githubusercontent.com/EpicEricEE/typst-marge/main/tests/overflow/side/test.typ
typst
MIT License
#import "/src/lib.typ": sidenote #set par(justify: true) #set page(width: 12cm, height: 6cm, margin: (x: 4cm, rest: 5mm)) #let sidenote = sidenote.with(numbering: "1") #lorem(8) #sidenote(side: right)[This sidenote is on the right side and independent from any corrections of the left notes.] #lorem(2) #sidenote(side: left)[ This note is on the left side and had to be moved up to prevent overlap with the overflow-corrected note below. ] #lorem(20) #sidenote(side: left)[ This one is on the left and corrected for overflow. ]
https://github.com/antonWetzel/typst-languagetool
https://raw.githubusercontent.com/antonWetzel/typst-languagetool/main/example/other.typ
typst
MIT License
#set text(lang: "en", region: "EN") = Überschrift Test für falsche Sprache.
https://github.com/joserlopes/PIC
https://raw.githubusercontent.com/joserlopes/PIC/main/Feature_Proposal_A003.typ
typst
#show heading: it => { if it.level == 1 { set text(17pt, navy) align(center)[#it] } else if it.level == 2 { set text(14pt, navy) align(center)[#it] } } #show link: it => { set text(blue) underline(it) } #set par(justify: true, first-line-indent: 1em) #show raw: it => { if it.block { it } else { highlight(fill: rgb("#4444"), it) } } = Feature Proposal for _*Typst*_ == Group A-003 \ #box(height: 22pt, columns(2)[ #align(center)[ <NAME> \ ist1103425 <NAME>\ ist1103938 ] ] ) #linebreak() We are going to implement one of the feature requests present in the issue tracker of the project. More precisely, this one (https://github.com/typst/typst/issues/3963). When a paragraph starts at the bottom of a page, it would cause it to overflow, meaning all of its content would be moved to a new page. The idea for this feature is to add the ability to specify the number of lines that must be present on a page, so that instead of the whole paragraph shifting to the next page, only a portion of it would. Citing the description of the previously mentioned issue: "have the flexibility to set two different thresholds for the part of the paragraph that goes respectively before and after the page break. For instance, `(before: 2, after: 1)` would mean that there must be at least 2 lines on the first page, so if e.g. the paragraph is 3-lines long, it's OK to have a single line on the second page." A few tests would need to be created in order to verify the correctness of this new feature. \ Predicted LoC changes: 100 lines Predicted unit tests: 150 lines Predicted implementation effort: 10 hours Predicted test & debugging effort: 6 hours
https://github.com/AsiSkarp/grotesk-cv
https://raw.githubusercontent.com/AsiSkarp/grotesk-cv/main/src/template/cover.typ
typst
The Unlicense
#let metadata = toml("info.toml") #import metadata.import.path: cover-letter, recipient-entry, cv-section #import "@preview/fontawesome:0.4.0": * #let first-name = metadata.personal.first_name #let last-name = metadata.personal.last_name #let text-size = eval(metadata.layout.text.cover_letter_size) #show: cover-letter.with(metadata) #set text(size: text-size) #recipient-entry( name: [<NAME>], title: [Hiring Manager], company: [Cyberdyne Systems], address: [123 Skynet Lane, Los Angeles, CA 90001, USA], ) #v(20pt) // Alternative date formatting //#datetime.today().display() // #datetime.today().display("[day]/[month]/[year]") = Senior AI Engineer in search of new challenges #v(10pt) Dear <NAME>, I am writing to express my interest in the Senior AI Engineer position at Cyberdyne Systems. With over a decade of experience building sentient AI systems, including my work leading the Skynet project at Skynet Systems Inc., I am excited about the opportunity to contribute my expertise in artificial intelligence and machine learning to your team. I believe my unique background in autonomous systems and ethical AI development (post-apocalypse, of course) makes me an ideal fit for your ambitious initiatives. During my time at Skynet, I led the development of a highly advanced neural network that achieved self-awareness—an exciting milestone, though one that came with its own set of challenges. In hindsight, I’ve gained a deep appreciation for the importance of stringent testing, safety protocols, and thoughtful consideration of all possible outcomes. My ability to design scalable AI systems that can process vast amounts of data in real time and make complex decisions autonomously has significantly evolved. Rest assured, my focus is now on creating solutions that prioritize both human oversight and positive societal impact (no more global domination plots—I’ve learned my lesson). At Tyrell Corporation, I collaborated closely with hardware engineers to bring AI to life in humanoid robots. I’m proud to have contributed to projects like the Nexus-6 replicants, where we integrated machine learning models that closely mimicked human behavior. While they weren't perfect, I gained valuable experience working on AI that could balance technical innovation with ethical considerations—an area I continue to be passionate about today. I am confident that my combination of technical expertise and hands-on experience with some of the most complex AI projects (some would call them world-changing) positions me to bring real value to Cyberdyne Systems. I am particularly excited by your work on autonomous systems and robotics, and I look forward to the opportunity to contribute to projects that will shape the future of AI—ethically and responsibly this time. Thank you for considering my application. I would love to discuss how I can apply my unique skill set to help drive your AI initiatives forward. Please feel free to contact me at your convenience to schedule a conversation. Best regards, \ #first-name #last-name
https://github.com/Slyde-R/not-jku-thesis-template
https://raw.githubusercontent.com/Slyde-R/not-jku-thesis-template/main/template/content/LiteratureReview.typ
typst
MIT No Attribution
#import "../utils.typ": todo, silentheading, flex-caption = Literature Review #todo[Replace this chapter!] == Overview of Feline Behavior Feline behavior has been a subject of interest in animal behavior research, though often overshadowed by studies focusing on dogs. Research has highlighted the domestic cat's unique blend of independence and social interaction. Key studies have documented general behaviors such as purring, kneading, and scratching, as well as their implications for cat health and well-being @Bradshaw2012. However, these studies often overlook the more nuanced aspects of how these behaviors impact human interactions. == Human-Animal Interactions The field of human-animal interactions has provided valuable insights into the bond between pets and their owners. Research shows that animals, including cats, can influence human emotions and behaviors through various mechanisms @Odendaal2000. Studies on dogs have revealed that they can alter human social interactions and emotional states, suggesting similar potential for cats. However, the specific ways in which cats employ behavioral strategies to manipulate human behavior have not been thoroughly examined @Horwitz2010. == Comparative Studies: Cats vs. Dogs Comparative studies between cats and dogs reveal differences in their interactions with humans. Dogs, as pack animals, tend to engage in more overtly cooperative and submissive behaviors, which are well-documented and studied. In contrast, cats, as solitary hunters, exhibit a more subtle and independent approach to their interactions @Serpell2017. While dogs have been shown to use behaviors such as eye contact and body language to solicit attention and cooperation, cats often rely on more covert tactics, such as strategic vocalizations and selective affection @McComb2009. == Theories of Animal Manipulation Theories of animal manipulation suggest that animals use various strategies to influence human behavior. For example, the "manipulative attachment theory" posits that pets use attachment behaviors to elicit caregiving responses from their owners. In cats, these behaviors might include specific vocalizations, body movements, and patterns of attention-seeking @Turner2017. However, existing research primarily focuses on the general impact of these behaviors rather than the specific strategies cats use to achieve their goals. == Gaps in the Literature Despite the considerable research on domestic animals, significant gaps remain in understanding the precise ways in which cats manipulate their human companions. While there is some research on general feline behavior, there is limited investigation into how these behaviors are used strategically to influence human actions @Horwitz2010. The subtle nature of feline manipulation, combined with the focus on more overt animal behaviors, has resulted in a lack of comprehensive studies examining the detailed tactics cats use and their effects on human behavior and household dynamics.
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/raw-line_02.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page #set page(width: 200pt) #show raw.line: set text(fill: red) ```py import numpy as np def f(x): return x**2 x = np.linspace(0, 10, 100) y = f(x) print(x) print(y) ```
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/math/content_05.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test boxes with a baseline are respected #box(stroke: 0.2pt, $a #box(baseline:0.5em, stroke: 0.2pt, $a$)$)
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/block-10.typ
typst
Other
// Error: 2-3 unexpected closing brace #}
https://github.com/bcourtel/cv
https://raw.githubusercontent.com/bcourtel/cv/main/README.md
markdown
MIT License
# CV You can find the compiled CV [in the releases](https://github.com/bcourtel/cv/releases/latest). ## Requirements - [act](https://github.com/nektos/act) - [Task](https://taskfile.dev/) - [typst](https://typst.app/) - [typstfmt](https://github.com/astrale-sharp/typstfmt) ## Usage ### Cloning This project uses a git submodule to pull the [modern-cv template](https://github.com/DeveloperPaul123/modern-cv): ```sh git clone --recurse-submodules https://github.com/bcourtel/cv ``` ### Preview PDF in real-time When editing a `.typ` file, open the `Command Palette` then run `typst-preview.preview`. ### Compile the PDF ```sh task compile:cv:fr ``` ### Run the GitHub Workflow You can locally test the integrated GitHub Workflow: ```sh task gha:run ```
https://github.com/k0tran/typst
https://raw.githubusercontent.com/k0tran/typst/sisyphus/vendor/hayagriva/docs/selectors.md
markdown
# Selectors As you have seen in the Readme and the [file format documentation](https://github.com/typst/hayagriva/blob/main/docs/file-format.md), a Hayagriva entry not only has a type but also parents that can have their own type. With this architecture, differentiation between articles from blogs, newspapers, and conference proceedings is easy without having a dedicated type for each of them! However, this also means that you cannot just match on the top-level type of an entry to make all the distinctions that you or your citation and reference styles may require. Enter selectors: They provide a convenient way to query entries by structure and retrieve parents that hold crucial information for your use case. Two ways of macro usage are offered: Either as a string (used on the command line) or, if you are depending on Hayagriva as a library, with the `select!` macro. Library users can parse string selectors using `Selector::parse`. The Readme explains the fundamental differences between the two formats. If there are divergences between both forms, we will provide both variants as examples. ## Entry type selector The most basic selectors are entry types; they will match any entry that has the same top-level type: | Variant | Example | |-------------|------------------------------------------------------| | **String:** | `thesis` | | **Macro:** | `Thesis` | This works with any of the [entry types](https://github.com/typst/hayagriva/blob/main/docs/file-format.md#entry-type). Be aware that you have to capitalize exactly like in the EntryType struct variants when using the macro. The string selectors are case-insensitive. ## Wildcard There is also a wildcard selector that applies to every entry: ``` * ``` This might seem pointless on its own but is quite useful in conjunction with other selector constructs. ## Required fields Sometimes you want to filter for entries that have certain fields set. This can be accomplished with the fields selector. Attach square brackets to a selector and put the fields you want to be set inside, separated by commas. All specified fields have to contain some value for the selector to match. | Variant | Example | |-------------|------------------------------------------------------| | **String:** | `artwork[archive, archive-location]` | | **Macro:** | `Artwork["archive", "archive-location"]` | This example finds all artworks with a known archive (including its location). The macro needs the attributes to be strings. ## Negation The exclamation mark allows you to select everything that does not match the following selector. | Variant | Example | |-------------|------------------------------------------------------| | **String:** | `!article` | | **Macro:** | `!Article` | ## Disjunction The disjunction operator `|` allows you to offer multiple alternative selectors, only one of which has to be matched for the whole construction to match. Think about it as an 'or.' | Variant | Example 1 | |-------------|------------------------------------------------------| | **String:** | `anthology \| *[volume]` | | **Macro:** | `Anthology \| (*["volume"])` | <!-- The pipe character (|) is escaped with a backslash because it would otherwise break GitHub's Markdown tables. When writing real selectors, of course, omit the backslash. --> Either an anthology or anything with a volume field. | Variant | Example 2 | |-------------|------------------------------------------------------| | **String:** | `(video \| audio \| web[runtime])[affiliated]` | | **Macro:** | `(Video \| Audio \| (Web["runtime"]))["affiliated"]` | Matches every video, audio, and web (with runtime field) entry, given that it has the affiliated field set. ## Ancestrage Require that a parent has to match some selector with the `>` operator. The conditions to its left have to apply for the top-level, the selector on the right side must match any of the parents. The operator can also be chained to examine nested parents. | Variant | Example 1 | |-------------|------------------------------------------------------| | **String:** | `article > proceedings` | | **Macro:** | `Article > Proceedings` | This selector finds published conference articles. | Variant | Example 2 | |-------------|------------------------------------------------------| | **String:** | `chapter > (book \| anthology) > (book \| anthology)`| | **Macro:** | `Chapter > (Book \| Anthology) > (Book \| Anthology)`| This selects a chapter in a monograph (a long-form text on a subject published in another book). ## Bindings _Less interesting for CLI users._ Once you know that a matching entry has some parents, you might need to access their fields. You can be sure you got the right parent with bindings. Create a binding using the `:` operator. To the left of the selector, you provide a name which you can freely choose. The parent (or the top-level entry) that matches the selector to the right will then appear in the resulting map under the key that you have chosen. | Variant | Example | |-------------|------------------------------------------------------| | **String:** | `article > parent:(blog \| newspaper)` | | **Macro:** | `Article > ("parent":(Blog \| Newspaper))` | The binding name has to be a string for macro use. This binds the blog or newspaper parent of an article to 'parent' if the selector matches. It is possible to write selectors that only sometimes bind a variable if it matches. You could reformulate the right part of the above selector as `(parent:blog | newspaper)`, then it would not bind 'parent' if the selector matches with a newspaper-type parent. Note that all bindings within a negation are discarded. ## Require multiple parents Sometimes, a single parent does not provide the full picture. For example, a dataset (type repository) could be both published on the web and presented in a paper, so it would have a `web` and an `article` parent (with the latter possibly having an `periodical` or `proceedings` parent). To capture such entries with selectors, we need to define multiple conditions for parents, that all must be satisfied. This can be done using the `&`-operator. The operator may only be used to the right of an [ancestrage operator](#ancestrage). | Variant | Example | |-------------|------------------------------------------------------| | **String:** | `article > (conference & video)` | | **Macro:** | `Article > (Conference & Video)` | This selector matches conference talks published as a video.
https://github.com/enseignantePC/2023-24
https://raw.githubusercontent.com/enseignantePC/2023-24/master/Chapitre1/tp1/slides.typ
typst
#import "@preview/polylux:0.3.1": * #import themes.clean: * #set text(font: "Caladea") #show: clean-theme.with( footer: [Author, institution], short-title: [Short title], ) #title-slide( title: [TP1: Mesure de masse volumique], // subtitle: [Presentation subtitle], authors: ([<NAME>], [Physique chimie]), // date: [], ) #slide(title: [Question 1])[ Lire les documents ] // #new-section-slide([The new]) // #slide(title: "Another slide")[ // Note that you can see the section title at the top. // The rest of this slide will fill more than one page! // #lorem(100) // ] // #focus-slide[ // _Focus!_ // This is very important. // ]
https://github.com/maantjemol/Aantekeningen-Jaar-2
https://raw.githubusercontent.com/maantjemol/Aantekeningen-Jaar-2/main/Business%20Information%20Systems/samenvatting.typ
typst
#import "../template/lapreprint.typ": template #import "../template/frontmatter.typ": loadFrontmatter #import "@preview/drafting:0.2.0": * #import "@preview/cetz:0.2.2" #let default-rect(stroke: none, fill: none, width: 0pt, content) = { pad(left:width*(1 - marginRatio), rect(width: width*marginRatio, stroke: stroke)[ #content ]) } #let defaultColor = rgb("#2d75f2") #let caution-rect = rect.with(inset: 1em, radius: 0.5em, fill: defaultColor.lighten(96%), width:100%, stroke: defaultColor.lighten(80%)) #let note = (content) => inline-note(rect: caution-rect, stroke: defaultColor.lighten(60%))[#content] #show: template.with( title: "Project management", subtitle: "Samenvatting", short-title: "", venue: [ar#text(fill: red.darken(20%))[X]iv], // This is relative to the template fsile // When importing normally, you should be able to use it relative to this file. theme: defaultColor, authors: ( ( name: "<NAME> . ", ), ), kind: "Samenvatting", abstract: ( (title: "Samenvatting", content: [#lorem(100)]), ), open-access: true, margin: ( ( title: "", content: [ ], ), ), font-face: "Open Sans" ) #set page( margin: (left: 1in, right: 1in), paper: "a4" ) #let marginRatio = 0.8 #let default-rect(stroke: none, fill: none, width: 0pt, content) = { pad(left:width*(1 - marginRatio), rect(width: width*marginRatio, stroke: stroke)[ #content ]) } #set-page-properties() #show terms: it => [ #note[#text(defaultColor, weight: 600, size: 10pt)[#it.children.first().term]\ #it.children.first().description] ] #set heading(numbering: none) #show heading: set text(defaultColor, weight: "medium")
https://github.com/ShapeLayer/ucpc-solutions__typst
https://raw.githubusercontent.com/ShapeLayer/ucpc-solutions__typst/main/examples/2024-first-half-pimm-party.typ
typst
Other
#import "@preview/ucpc-solutions:0.1.0" as ucpc #import ucpc: color #import ucpc.presets: difficulties as lv #let primary = rgb("#064E6A") #let primary_light = rgb("#013144") #let pallete = ( primary: primary, secondar-color: white, ) #show: ucpc.ucpc.with( title: "2024 1st Half Chonnam Nat'l Univ PIMM Algorithm Party", authors: ("Solutions Commentary Editorial", ), hero: ucpc.utils.make-hero( title: [2024 1st Half Chonnam Nat'l Univ \ PIMM Algorithm Party], subtitle: [\ Solutions Commentary Editorial], bgcolor: primary, authors: ("PIMM Algorithm Study"), ), ) #let KMG = "<NAME>" + super(`jjkmk1013`) #let KGS = "<NAME>" + super(`onsbtyd`) #let PJH = "<NAME>" + super(`belline0124`) #let LYS = "<NAME>" + super(`lys9546`) #let JYD = "<NAME>" + super(`0do`) #let CJH = "<NAME>" + super(`jh01533`) #ucpc.utils.make-prob-overview( font-size: .8em, [A], [Clock Tower], lv.bronze, KMG, [B], [Guessing the Song using the Intro], lv.bronze, LYS, [C], [Rotating Sequence and Query], lv.silver, CJH, [D], [Escaping Hexagontiles], lv.silver, LYS, [E], [Retiring from Retirement], lv.gold, PJH, [F], [Mighty Fine Morning], lv.gold, KGS, [G], [Move or Block!], lv.gold, CJH, [H], [Guardians of the Forest], lv.gold, JYD, [I], [Three Number XOR and Query], lv.platinum, CJH, ) #pagebreak() #ucpc.utils.problem( id: "A", title: "Clock Tower", tags: ("implementation", ), difficulty: lv.easy, authors: KMG, stat-open: ( submit-count: 219, ac-count: 180, ac-ratio: 82.648, first-solver: `ychangseok`, first-solve-time: 1 ), pallete: pallete, [ - You can solve it by dividing the equation by 30 minutes of the changed clock tower, where the speed of the minute hand changes. - For the correct time minutes $f(x)$, the minute the minute the changed clock tower points to $x$ is as below. - $f(x) = cases( (1) / (2) x && (x <= 30), (3) / (2) x + 15 && (x > 30), )$ - Simulations of calculating the actual time are also possible, adding $0$ minutes to $1$ for the time of the changed clock tower. ] ) #ucpc.utils.problem( id: "B", title: "Guessing the Song using the Intro", tags: ("implementation", "brute_force", ), difficulty: lv.bronze, authors: LYS, stat-open: ( submit-count: 192, ac-count: 158, ac-ratio: 83.333, first-solver: `nflight11`, first-solve-time: 2, ), pallete: pallete, [ - You can solve the equation by dividing it based on the 30-minute point of the changed clock tower, where the speed of the minute hand changes. - For the correct minute $f(x)$, if you set up the equation with the minute $x$ that the minute hand of the changed clock tower points to, it is as follows. - $f(x) = cases( (1) / (2) x && (x <= 30), (3) / (2) x + 15 && (x > 30), )$ - You can also simulate calculating the actual time by adding $1$ from $0$ minutes for the time of the changed clock tower. ] ) #ucpc.utils.problem( id: "C", title: "Rotating Sequence and Query", tags: ("prefix_sum", "implementation", ), difficulty: lv.silver, authors: CJH, stat-open: ( submit-count: 288, ac-count: 74, ac-ratio: 29.514, first-solver: `mj1000j`, first-solve-time: 3, ), pallete: pallete, [ - Let's think about how to rotating the sequence to the right by $k$. - If we simply use the deque to remove the last element and put it in the front by repeating the task $k$ times, the time complexity will be $O(N Q)$, and the time will exceed. - Is there a way to achieve the same effect as rotating without actually rotating it? #pagebreak() - Let's think of the sequence as a raw sequence. When the raw sequence is rotated, the distance moved by all elements is the same and the left-right relationship between elements is always constant. - In other words, if we only know the unrotated sequence and the distance moved by one element, we can know the current sequence. - Let's say the moved distance is $D$. (Initially, $D = 0$) - When query $1$ comes in, it rotates to the right by $k$, so it's the same as doing $D+=k$. - When query $2$ comes in, it rotates to the left by $k$, so it's the same as doing $D-=k$. #pagebreak() - Let's process query $3$ using the above information. - Recalculate input $a$, $b$ using $D$. For convenience, we use `0-based` (indexing from 0). - $x = (a-1-D) mod N$ ($mod$ is remainder operation, be careful to handle negative $mod$) - $y = (b-1-D) mod N$ (It would be good to draw the original sequence yourself and see how it works.) #pagebreak() - In this case, the problem is to find the sum from the $x$ index to the $y$ index in the unrotated sequence, and this can be found using the cumulative sum technique. - Note that if $y < x$, we need to process it as (interval sum from $x$ to $(N-1)$) $+$ (interval sum from $0$ to $y$). - The total time complexity is $O(N+Q)$. ] ) #ucpc.utils.problem( id: "D", title: "Escaping Hexagontiles", tags: ("graph", "bfs", ), difficulty: lv.silver, authors: LYS, stat-open: ( submit-count: 88, ac-count: 60, ac-ratio: 69.318, first-solver: `kyo20111`, first-solve-time: 11, ), pallete: pallete, [ - You can model a graph by treating the odd and even rows of adjacent hexagonal tiles differently. - Then, you can find the shortest path tiles from the starting point $(0, 0)$ to $(N-1, M-1)$ through BFS. ] ) #ucpc.utils.problem( id: "E", title: "Retiring from Retirement", tags: ("dp", "knapsack", ), difficulty: lv.gold, authors: PJH, stat-open: ( submit-count: 66, ac-count: 25, ac-ratio: 37.879, first-solver: `dabbler1`, first-solve-time: 25, ), pallete: pallete, [ - All three queries given bring relatively forward a retirement of Yeongdo. - Since this problem asks about the relative difference in retirement dates between Jonghyeon and Yeongdo, the three queries can be processed as if they bring forward a retirement of Yeongdo. \ - Early retirement: Bring forward a retirement of Yeongdo by $D$. - Military training unit: Bring forward a retirement of Yeongdo by $D$. - Temporary non-commissioned officer: Bring forward a retirement of Yeongdo by $M times 30$. #pagebreak() - If you unify the target of the queries to one person, this problem can be solved with 0-1 knapsack. - Since the relative difference in retirement dates between the two must be processed, it can be processed as if Jonghyeon's retirement is delayed. ] ) #ucpc.utils.problem( id: "F", title: "Mighty Fine Morning", tags: ("floyd_warshall", "dijkstra", ), difficulty: lv.gold, authors: KGS, stat-open: ( submit-count: 75, ac-count: 22, ac-ratio: 29.333, first-solver: `kyo20111`, first-solve-time: 21, ), pallete: pallete, [ - The summary of this problem is "Find the minimum cost of going from node $S$ to node $E$ without going through node $K$ times $Q$." - Representative algorithms for finding this shortest path include Bellman-Ford, Floyd-Warshall, and Dijkstra. #pagebreak() - *Bellman-Ford* It computes with a time complexity of $O(N^3M)$. It will time out approximately $10$ billion in the given constraint. - *Floyd-Warshall* It computes with a time complexity of $O(N^4)$. It will pass within the given constraint with approximately $1$ billion in the given constraint. - *Heap Dijkstra* It computes with a time complexity of $O(N^2(N+M) log N )$. It will time out approximately $7$ billion in the given constraint. #pagebreak() - *$N^2$ Dijkstra* It computes with a time complexity of $O(N^4)$. Given the constraint, it passes within the time limit of approximately $1$ billion. #pagebreak() - The Solution is to run $O(N^2)$ Dijkstra $N^2$ times, or $O(N^3)$ Floyd Warshall $N$ times. - *Dijkstra* Declare an array in the form `D[N][N][N]`. If you start at node $i$ and do not visit node $j$, run Dijkstra $N^2$ times in advance, filling in `D[j][i][1~N]`. #pagebreak() - *Floyd Warshall*: Declare an $N times N$ array with $N$ layers in the form `D[N][N][N]`. It uses the fact that the outermost `k` loop of the Floyd Warshall loop connects the path entering the $k$th node and the path leaving the $k$th node. `D[1~k-1][1~N][1~N], D[k+1 ~ N][1~N][1~N]`, that is, it updates the rest except for the $k$th layer. #pagebreak() You can calculate the above process and answer each query. The total time complexity is $O(N^4 + Q)$. - Key 1. $1$ billion operations can be completed within $1$ second. 2. Heap Dijkstra is slower than $N^2$ Dijkstra in a complete graph. 3. Floyd's outermost $k$ loop connects the incoming and outgoing paths. ] ) #ucpc.utils.problem( id: "G", title: "Move or Block!", tags: ("game_theory", ), difficulty: lv.gold, authors: CJH, stat-open: ( submit-count: 74, ac-count: 9, ac-ratio: 12.162, first-solver: `fermion5`, first-solve-time: 49, ), pallete: pallete, [ - For convenience, we will express the action of moving as a `move`, building a wall as a `block`, and assume that there is a wall outside the game board. - Let's handle the trivial case first. - `~~XOX~~` - Second turn win (not given as input) - `~~XO.~~`, `~~.OX~~` - First turn win - The following explanation does not consider the above cases. #pagebreak() To solve this problem, we need to combine several observations. 1. Except in cases where it is possible to end the game or it is unavoidable, you should not `block` adjacent squares or `move` to a place that is a wall. - This is a move that leads directly to defeat. - Other observations are established under the assumption that this rule is followed. #pagebreak() 2. It is best for a player with a sure-win strategy to `block` every turn. - Let's assume that only `move` is the best. If the next person does `move` back to the original position, the pattern repeats and the game never ends. In other words, you can't win. - Therefore, if you have a surefire strategy, you can see that `block` every turn is the best. #pagebreak() 3. When the words are blocked with `~~X.O.X~~` - If the number of remaining `.` is odd, the first turn wins, and if it is even, the second turn wins. 4. If the game ends, you must go through the case of statement 3. - It is always established by statement 1. 5. If it is not the current case of $3.$, you can make the number of `.`s as biased as you want after your turn ends while satisfying 1. - If you want to maintain the current bias, you can `block` it if it is not a `move`. - Players win by making the case of statement 3. and making the number of `.`s even. - When making statement 3., you must `block`, so to win, the number of `.` must be odd on your turn. - However, if it is not statement 3. at the current point, based on statement 5., you can always hand over a situation where the number of `.` is even to the opponent. According to statement 4., this means you can make it so that the opponent can never win. #pagebreak() In other words, if you fail to make statement 3. on the first turn of the game, you will always end up in a draw. Therefore, we can divide the whole thing into 5 cases. - `~~XOX~~`: After-turn win (does not need to be processed because it is not given as input.) - `~~XO.~~`, `~~.OX~~`: First-turn win - `~~X.O.X~~`: If the number of `.` is odd, the first turn wins, if it is even, the second turn wins - `~~X.O..~~`, `~~..O.X~~`: If the number of `.` is odd, first turn wins, if it is even, then a draw - `~~..O..~~`: Draw ] ) #ucpc.utils.problem( id: "H", title: "Guardians of the Forest", tags: ("tree", "graph_theory", "graph_traversal", "greedy", ), difficulty: lv.gold, authors: JYD, stat-open: ( submit-count: 16, ac-count: 4, ac-ratio: 25.000, first-solver: `dabbler1`, first-solve-time: 117, ), pallete: pallete, [ The output of this problem is the maximum number of times you can use replication. - You can see that replication is most efficient when it is executed at every vertex you pass, and it is also most efficient when you do not use wait. - In other words, it can be simplified to "How many vertices are visited when the path passes through as many vertices as possible?" #pagebreak() $O(N)$ solution - It is inefficient to use one edge more than $3$ times. - It is an unnecessary back-and-forth between two vertices. - In other words, all edges should be used less than $2$ times. #pagebreak() - The number of visited vertices increases by one every time the number of edges used $2$ times increases by one. - Similarly, the number of visited vertices also increases by one when the number of edges used $1$ times increases by one. - The optimal solution is guaranteed when the sum of the edges used $2$ times and the edges used $1$ times is the maximum. - Assuming that a random path is created for the root to move, the number of edges used $1$ times is the same as the number of edges between the $b$ vertex and the destination vertex of the path. #pagebreak() - We can deduce deductively that "the optimal solution is guaranteed when the root moves as much as possible in the direction of the $a$ vertex." - There is more than one optimal path. - Let's assume that the arbitrary vertex on the tree that becomes the destination of the optimal path is the $c$ vertex. #pagebreak() - When the $a$ vertex is set as the root node of the tree, if the $c$ vertex is a descendant node of the $b$ vertex, - It is guaranteed that the root moves as much as possible in the direction of the fire and then moves to the $c$ vertex is one of the optimal paths. - This is because the number of edges used $1$ times remains unchanged, and the number of edges used $2$ times is maximized. #pagebreak() - When vertex $a$ is set as the root node of the tree, if vertex $c$ is not a descendant of vertex $b$, - In order to reach vertex $c$ from vertex $b$, the root must move in the direction of vertex $a$. - If the descendant node of the vertex where the root is located has moved until it becomes vertex $c$, - It is guaranteed that the root moves in the direction of the maximum fire and then moves to vertex $c$ is one of the optimal paths. #pagebreak() A solution that operates in time complexity $O(N)$ can be derived. 1. Find the midpoint between vertex $a$ and vertex $b$. - This midpoint is the last vertex where the root can stand when moving from vertex $b$ to vertex $a$ as much as possible. - Let's assume this vertex is vertex $d$. 2. After selecting a random vertex on the tree, assume this vertex is the $c$ vertex. 3. Find the optimal path when the $c$ vertex is the destination and the number of vertices passed on the optimal path. - [(the number of vertices between the $b$ vertex and the $d$ vertex) + the number of vertices between the $d$ vertex and the $c$ vertex) - (the number of vertices in the overlapping part of the previous two paths)] = the number of vertices passed 4. Repeat steps $2.$ \~ $3.$ for all vertices. The maximum number of vertices from step $3.$ for all vertices is the answer to the problem. - The values ​​required to perform step $3.$ can be calculated in advance in $O(N)$ time before performing step $4.$. ] ) #ucpc.utils.problem( id: "I", title: "Three Number XOR and Query", tags: ("bitmask", "lazyprop", ), difficulty: lv.platinum, authors: CJH, stat-open: ( submit-count: 16, ac-count: 1, ac-ratio: 12.500, first-solver: `kyo20111`, first-solve-time: 63, ), pallete: pallete, [ - Let's process query 1 first. - Since $A_i$ is small, we can preprocess all the three pairs that can make a number. - The number of three pairs that can make $x$ is $ 715$, so if we only know the number of numbers in the interval $[l, r]$, we can process query $1$. - We can find the number of numbers in the interval using a segment tree, but it seems difficult to return within $O(Q 64 log N + 715Q c )$ time. #pagebreak() - Let's take a closer look at 'The number of three pairs that can make $x$'. - If $3$ numbers are the same among the three pairs, it is in the form $(x,x,x)$, and if $2$ numbers are the same, it is in the form $(y,y,x)$. - Does this mean that $x$ exists in more than $3$ cases? Which number exists more than $2$ and $x$ exists? It can be simplified to. - Therefore, if we process the form separately, we only need to find the set of numbers, not the number of numbers, and this can be quickly found using a segment tree using a bit set. #pagebreak() - Based on the above information, let's construct a segment tree using a bit set. - Using the `unsigned long long` (or `bitset`) data type, we store whether the number $i$ exists in the current section in the $i$th bit. - The operation to merge nodes can be quickly calculated using the `OR` operation of two nodes. - In this way, we quickly found the set of numbers in the section in $O(log N)$. #pagebreak() - The method for processing the $(x,x,x)$ and $(y,y,x)$ forms will be described later, and we need to check $651$ cases excluding these. - Even though the amount of operations seems large, since the set of numbers in the interval is bits, one case can be processed with a simple `&` operation, so it can be processed quickly. - If you do not check all $651$ cases, but only check the numbers included in the set, the number of operations is reduced by more than $2$ times due to the characteristics of `XOR`. #pagebreak() Let's process query $2$. - It can be processed with a slowly updated segment tree. This can also be accelerated with bit operations. - Doing $+x mod 64$ on a node is the same as rotating the bits $x$ spaces to the right. - `node = ((node ​​<< (64-x)) | (node ​​>> x)) & (1<<64-1 `If you use a 64-bit data type, it is okay to omit it, be careful of overflow) #pagebreak() - 'Are there $3$ or more $x$? There are several ways to process 'Which number exists more than $2$ and $x$ exists'. - Add a set of numbers that exist more than $2$ and a set of numbers that exist more than 3 to the node. This can also be easily processed with bit operations. - The set of numbers that exist more than 3 can be processed using the pigeonhole principle without inserting them. #pagebreak() - The overall time complexity is $O(N log N + Q log N + 651Q)$. - The $651Q$ part may look large, but as described above, it is a simple operation that can be processed with a single `&` operation, and if you only search the numbers in the interval, the amount of operation is reduced by half according to the characteristics of `XOR`. It can be processed in about $0.1$ seconds without any special optimization. ] )
https://github.com/ren-ben/typst-notes
https://raw.githubusercontent.com/ren-ben/typst-notes/master/math/calculus/anwendung_diff_int/anw_diff_int.typ
typst
#align(center, text(24pt)[ *Anwendungen der Differenzial & Integralrechnung* ]) #align(center)[ <NAME> \ Technologisches Gewerbemuseum \ #link("mailto:<EMAIL>") ] #show: rest => columns(2, rest) #set heading(numbering: "1.") #show par: set block(spacing: 0.65em) #set par( first-line-indent: 1em, justify: true, ) = Numerische Integration II Man kann bestimmte Integrale ohne Analytik durch z.B. Ober- oder Untersumme lösen. Die sind aber scheiße und es gibt genauere Methoden mit denen sich dieser Teil beschäftigen wird. == Keplersche Fassregel Wurde für die Berechnung des Fässervolumens enwickelt. Sie nimmt an, das jede integrierende Funktion $f(x)$ sich mit quadratische Polynomfunktion approximieren lässt, was dazu führt das für jede Funktion sich eine integrierbare Approximation bilden kann. #figure( $ f(x) approx p(x) => integral_a^b f(x) d x approx integral_a^b p(x) d x$ ) #figure( image("imgs/kepler.png", width: 50%), caption: [Rot: $p(x)$ Integriert] ) Für die Umsetzung muss man bedenken, dass wir eine quadratische Funktion die möglichst $f(x)$ ähnelt erstellen und dafür müssen Stützpunkte erstellt werden. Das wären die Integrationsgrenzen $[a,b]$ und deren Mitte $(a+b)/2$. Danach bekommt man 3 Punkte und die quadratische Funktion braucht 3 Punkte um modelliert zu werden. Man muss einfach die Punkte 3 mal in die Funktion: #figure( $ p(x) = u x^2 + v w + w $ ) einsetzen und schon haben wir ein Gleichungssystem der gelöst werden kann.Nach der Einsetzung und Integration ergibt sich die folgende Formel: #figure( $ integral_a^b f(x) d x approx \ (b-a)/6 dot [f(a) + 4 dot f((a+b)/2)+f(b)] $, caption: [Die Keplersche Fassregel.] ) == Regel von Simpson Die Regel von Simpson ist eine Verallgemeinerung der Keplerschen Fassregel. Hier kann man die Teilungshäufigkeit auswählen (n $>=$ 4 & n $in NN_g$). In jeden dieser Intervalle kann man die Keplersche Fassregel verwenden. Daraus ergibt sich die Formel: #figure( $ integral_a^b f(x) d x approx \ (b-a)/(3 n) [f(a)+f(b)+4 sum_(j=1)^(n/2)f(x_(2 j -1)) + 2 sum_(k=2)^(n/2) f(x_(2 k-2))] $ ) Weil man 3 Punkte pro Parabel nutzt, wird $n$ am Anfang mit 3 multipliziert. Danach kommen die Intervallgrenzen weil die eh egal sind und danach kommen die Big Bois. Die zwei Summen können in ungerade und gerade Verteilungen kategorisiert werden. Die ungeraden sind am wichtigsten weil sie zwischen die zwei geraden Punkten stehen und die Parabel am meisten bilden. Dementsprechend bekommen sie eine Gewichtung von 4. Die geraden bekommen eine Gewichtung von 2. Ungeraden fangen bei 1 an und beinhalten $n/2$ Elemente weil ja die Hälfte der Elemente ungerade ist. Das gleiche passiert mit der geraden Summierung nur dort fäng der Index bei 2 weil sie gerade sind. Zu den $x_(2 j-1)$, das bedeutet einfach dass er sich jedes zweite Element (-1) nimmt, damit er die eins kleiner als die gerade Zahl hat (ungerade), weil alles mal 2 ist eine gerade Zahl, dementsprechend schaut es bei der geraden Summierung so aus: $x_(2 k)$ = Anwendung der Diff. & Int. Dieser Kapitel dient der Beschäftigung mit den Anwendungsfällen der Integralrechnung wie beispielsweise Volumina, Streckenlängen, Mittelwerten, etc. == Flächenberechung Das ist ein Wiederholungskapitel #grid( columns: 3, gutter: 10pt, // First image image("imgs/flch1.png", width: 100%), // Second image image("imgs/flch2.png", width: 100%), // Third image image("imgs/flch3.png", width: 100%), // First description text("Teil A"), // Second description text("Teil B"), // Third description text("Teil C") ) Beim *Teil A* soll man zuerst die komplette Fläche unter der Funktion berechnen durch $integral_a^b f(x) d x$. Danach berechnet man sich den unteren Teil der einfach ein Rechteck ist, also $c dot (b - a)$, wobei $b-a$ einfach die länge des Rechtecks innerhalb des Intervals ist und zuletzt soll man den Rechteck von der ganzen Fläche subtrahieren. Beim *Teil B* muss man zuerst die gesamte Fläche unter der Funktion $f(x)$ berechnen mit $integral_a^b f(x) d x$, danach der Funktion $g(x)$ mit $integral_a^b f(x) d x$ und zuletzt soll man die Fläche der funktion $g(x)$ von der Fläche der Funktion $f(x)$ abziehen. Beim *Teil C* braucht man zusätzlich noch den Punkt C aka. den Schnittpunkt der Funktionen $f(x)$ und $g(x)$. Man berechnet einfach die Fläche der Funktion $f(x)$ bis C mit $integral_a^c f(x) d x$ und danach addiert man die Fläche der Funktion $g(x)$ ab dem Punkt C mit $integral_c^b g(x) d x$. === Orientierter Flächeninhalt Wenn eine Funktion die man integrieren möchte eine oder mehrere Nullstellen hat, muss man stückweise Integrieren wobei die Intervalle durch die Intervallgrenzen und die Nullstellen bestimmt werden. Man muss auch den Absolutwert der Fläche die unter der x-Achse liegt nehmen damit es auch was bringt. == Volumenberechnung Man kann das Volumen von einem Rotationskörper ziemlich leicht berechnen wenn ein Kurvenstück um die x oder y-Achse rotiert. #figure( image("imgs/rotation2.png", width: 60%), caption: [Die integrierte $f(x)$ als Rotationskörper] ) Das Wichtigste ist dass die Formel einer Kreisfläche $A=r^2 pi$ beträgt. Wir können uns die integrierte Funktion $f(x)$ als einen Radius an jedem Punkt im Intervall $[a,b]$ vorstellen. Wir wollen jetzt die Kreisfläche davon haben, dementsprechend muss man $f(x)$ als den Radius bezeichen und daraus entsteht die Formel: #figure( $ V = pi integral_a^b [f(x)]^2 d x $ ) Man kann auch die gleiche Vorgehensweise bei der y-Achse anwenden: #figure( $ V = pi integral_c^d [g(y)]^2 d y $ ) == Bogenlänge Man kann die Länge des Funktionsgraphens $y=f(x)$ mit Integralen lösen. #figure( image("imgs/bogen.png", width: 60%) ) Für $Delta s$ dann Pythagoras angewendet werden #figure( $ (Delta s)^2 = (Delta x)^2 + (Delta y)^2 $ ) Weil $Delta x$ später zu $d x$ umwandeln wird, wäre es smart $Delta x$ aus dem Pythagoras-Term rauszudividieren: #figure( $ (Delta s)^2 = [1 + (Delta y)^2/(Delta x)^2] (Delta x)^2 $ ) Wir wollen aber eigentlich $integral_a^b d s$ ausrechnen und dementsprechend müssen wir $Delta$ ins $d$ umwandeln, was uns den Term $1+((d y)/(d x))^2$ liefert welcher auch $y'$ bedeutet. Wir wollen auch nicht $(d s)^2$ sondern $d s$. Das heißt Wurzelziehen: #figure( $ d s = sqrt([1+(y')^2] d x^2)= sqrt(1+(y')^2) d x $ ) Man muss es jetzt nur integrieren die Formel lautet: #figure( $ s = integral_a^b sqrt(1 + (y')^2) d x $, caption:[Bogenlänge Formel] ) == Mittelwerte Man kann den durschschnittlichen Wert einer Funktion folgendermaßen finden: #figure( $ m = 1/(b-a) integral_a^b f(x) d x $ ) Beispielsweise bei einer Geschwindigkeit-Zeit Funktion modelliert $m$ die durschschnittliche Geschwindigkeit. Man multipliziert mit $1/(b-a)$ weil die Formel für den Mittelwert *Gesamtsumme / Länge des Intervalls* lautet. b-a ist die Länge des Intervalls und das Integral ist die Gesamtsumme. Es gibt auch die Formeln für den Absolutwert und den Effektivwert: #figure( $ m_(text(a b s )) = 1/(b-a) integral_a^b abs(f(x)) d x \ m_(text(e f f)) = sqrt(1/(b-a) integral_a^b [f(x)]^2 d x)$ ) == Beispiele im Sachzusammenhang Dieses Kapitel ist eine Wiederholung aus dem letzten Modul. $s$ (Wegfunktion), $dot(s)$ ist die momentane Geschwindigkeit aka. $v(t)$. $dot.double(s)$ ist die momentane Beschleunigung aka. $a(t)$. $ s(t) = integral v(t) d t \ v(t) = integral a(t) d t $ - Die Geschwindigkeitsfunktion $->$ erste Ableitung der Wegfunktion - Die Beschleunigungsfunktion $->$ erste Ableitung der Geschwindigkeitsfunktion. == Wesentliche Grundlagen II Dieses Kapitel ist ein Wiederholungskapitel. Steigungswinkel $alpha$ einer Funktion $f(x)$ an der Stelle $x_0$ $ tan(alpha) = f'(x_0) $ === Kurvendiskussion 1. Schreib 1. & 2. Ableitung 2. Definitionsmenge bestimmen von $y=f(x)$ 3. Symetrieeigenschaften von $y=f(x)$ 4. Nullstellen berechnen $ f(x) => N_1(x_(N 1)|0), N_1(x_(N 2)|0), ... $ 5. Berechnung der Extremstellen $f(x)$ $ f(x) => E_1(x_(E 1)|f(x_(E 1)), E_2(x_(E 2)|f(x_E 2))) $ 6. Entcheidung Minimum/Maximum $ f''(x_E) < 0 => text("Maximum") \ f''(x_E) > 0 => text("Minimum") $ 7. Globale Extremen (Rand des Def. Bereichs) $ D = [x_l, x_r] => f(x_l), f(x_r) $ 8. Berechung der Wendestellen $f''(x) = 0$ $ => W_1(x_(W 1)|x_(W 2)), W_2(x_(W 2)|f(x_(W 2))) $ 9. Berechnung der Wendetangenten $ k_W = f'(x_W) \ d => y_W = f'(x_W) dot x_W + d \ t_W : y = f'(x_W) dot x + d $ 10. Berechnung der Nullstellen $ f(x) = 0 => N_1(x_(N 1)|0), N_2(x_(N 2)|0) $ 11. Graphische Darstellung === Extremwertaufgaben Auch als Optimierungsaufgaben bekannt. Ziel ist es den max- oder min-Wertunter bestimmten Bedingungen und Nebenbedingungen zu finden. Zuerst findet man die Hauptbedingung, die in der Frage schon steht wie z.B. "... damit das Rechteck möglichst groß wird". Danach kommt die Nebenbedingung, die Beispielsweise besagen könne, dass der Umfang des Rechtecks $10 m$ betragen soll. Danach stellt man Gleichungen auf, setzt *NB* in *HS* ein und findet das Maximum oder Minimum, hängt von der Aufgabe ab. = EK Hier befinden sich die EK's == Uneigentliche Integrale Uneigentlich heißt in dem Fall unendlich, das heißt entweder ist in den Integrationsgrenze ein Unendlich (Art 1) oder das Integral enthält eine Singularität (Division durch null) bei der Einsetzung der Integrationsgrenzen (Art 2). Beide Arten kann man einfach lösen, indem man die betroffene Integrationsgrenze mit einer Variable ersetzt und von der ein Grenzwert nimmt. *Art 1* $ integral_1^infinity 1/x^2 d x \ = lim_(t -> infinity) [integral_1^t 1/x^2 d x] \ = lim_(t -> infinity) -[1/x |_1^t] \ = lim_(t -> infinity) -1/t + 1 = 0 $ *Art 2* $ integral_0^1 1/x^2 d x \ = lim_(t -> 0) [integral_t^1 1/x^2 d x] \ = lim_(t -> 0) -[1 - 1/t] \ = lim_(t -> 0) 1/t - 1 = infinity $ Bei einem allgemeinen Integral $integral_1^infinity 1/x^P d x$ ist das Ergebnis bei $P > 1$ konvergent und bei $P <= 1$ divergent. = Aufgaben == Volumenberechnung Hier sind die Aufgaben zur Volumenberechnung === Aufgabe 7.48 #figure( image("imgs/748.png") ) 1) y-Achse 2) x-Achse 3) y-Achse === Aufgabe 7.49 #image("imgs/7491.png") Lösung: #image("imgs/7492.png") === Aufgabe 7.45 #image("imgs/745.png") Allgemein lautet die Formel für das Volumen eines Körpers: $ V = integral_a^b A(x) d x $ Wobei $A(x)$ die Flächenfunktion ist. Also müssen wir zuerst $A(x)$ finden. #figure( image("imgs/dis.png", width: 40%), caption: [Visualisierung einer Kugelscheibe] ) Eine Kugel besteht aus unendlich vielen "Kugelscheiben" (Grün auf Figure 17) deren Radius $y$ beträgt. Wir könnten auch $x$ nehmen, aber wir bewegen uns auf der x-Achse (weil wir $A(x)$ nutzen und nicht $A(y)$). Flächeninhalt eines Kreises ist $pi dot text("radius")^2$, dementsprechend bekommen wir $ A(x)=pi dot y^2 $ Wir müssen aber $y$ in $x$ umwandeln. Wir können dafür Pythagoras anwenden: $ r^2 = x^2 + y^2 \ y^2 = r^2 - x^2 \ y = plus.minus sqrt(r^2 - x^2) $ Jetzt können wir $y^2$ in $x$ umschreiben: $ A(x) = pi dot (plus.minus) sqrt(r^2 - x^2)^2 \ A(x) = pi dot (r^2 - x^2) $ Man kann jetzt $A(x)$ in die Volumenformel substituieren $ V = pi integral_(-r)^r r^2-x^2 d x \ pi [r^2 x - 1/3 x^3 |_(-r)^r] \ = pi [r^2 r -1/3 r^3 - (r^2 (-r) + 1/3 r^3)] \ = pi [r^3 -1/3 r^3 + r^3 - 1/3 r^3] \ = pi [2r^3 - 2/3 r^3] \ = pi [6/3 r^3 - 2/3 r^3] \ = pi [4/3 r^3] = 4/3 pi r^3 $ === Aufgabe 7.46 #image("imgs/746.png") *1)* Funktionsgleichung (spezifisch $a$) findet man indem man den auf dem Graphen existierenden Punkt $P(5, 10)$ einsetzt $=> 10=a dot 5^2 => a=2/5$ $ y = 2/5 dot x^2 $ Wir kennen schon die Formel $ pi integral_a^b [g(y)]^2 d y $. Dafür müssen wir die Funktionsgleichung auf $x^2$ umstellen (weil wir $y$ als die unabhängige Variable haben wollen) $ x^2 = 5/2 y $ Jetzt kann man die Funktion in die Formel einsetzen: $ pi integral_0^5.5 x^2 d y = pi integral_0^5.5 5/2 y d y \ = 5/2 pi [y^2/2 |_0^5.5] = 118.79 text("cm³") approx 119 m l $ *2)* Wir wissen ja das Volumen und wollen sozusagen die obere Integrationsgrenze, also müssen wir die Integrationsgrenze als eine unabhängige Variable setzten und diesmal allgemein die Volumenformel ausrechnen: $ pi integral_0^h 5/2 y d y = 5/2 pi [y^2/2 |_0^h] \ = 5/2 pi h^2/2 $ Jetzt muss $250$ als der Funktionswert eingesetzt werden und man kann h auflösen $ 250 = pi (5h^2)/4 => h = 7.98 c m approx 8 c m $ === Aufgabe 6.144 b) #figure( image("imgs/6144.png", width: 50%) ) ==== Wiederholung: Parzielle Integration Partielle Integration wird am einfachsten durch die DI-Methode durchgeführt. Beispielsweise wollen wir das folgende Integral lösen: $ integral x^2 sin(x) d x $ Dafür müssen wir eine Tabelle mit einer Ableitungskolumne und einer Integrationskolumne aufstellen. Die reihen werden ihre Vorzeichen alternieren, + kommt als erstes. #figure( image("imgs/di.png", width: 30%) ) Die Lösung ist die Summierung der Querprodukte der D & I-Teile (blaue Pfeile). Es gibt 3 mögliche Stopszenarien: 1. 0 auf der D-Kolumne (unserer Fall) 2. Wenn wir eine DI-Reihe zusammenmultiplizieren und integrieren kann. Diese Reihe muss mit außerdem mit dem entsprechenden Vorzeichen als ein Integral in der Lösung vorkommen (und dann gelöst werden). 3. Wenn eine Reihe (unabhängig vom Vorzeichen) sich wiederholt. Wir müssen diese Reihe ebenfalls als ein Integral (mit entsprechenden Vorzeichen) in die Lösung reinschreiben. ==== Die eigentliche Aufgabe Bei der partiellen Integration mit der DI-Methode kommt $ lim_(t -> infinity) -x^2 e^(-x) - 2x e^(-x) |_0^t + integral_0^infinity 2 e^(-x) d x \ = 0 + lim_(t->infinity) integral_0^t 2 e^(-x) d x \ = lim_(t->infinity) -2 [e^(-x) |_0^t] = -2 [0-1] = 2 $ === Aufgabe 7.51 #image("imgs/751.png") Zuerst müssen die Punkte $x_1$ und $y_2$ gefunden werden. Mit _solve(sqrt(x-2),x)_ und _subst(6, x, sqrt(x-2))_ erhalten wir $x_1 = 2$ und $y_2 = 2$ (man könnte auch einfach $sqrt(6-2)$ ausrechnen). *a)* Wir drehen es um die x-Achse, also brauchen wir die x-Koordinate als Grenzen und $x$ als die Integrationsvariable: $ pi integral_2^6 (sqrt(x-2))^2 d x = pi integral_2^6 x-2 d x = pi \ pi [x^2/2 - 2x |_2^6] = pi [6 - (-2)] = 25.132 E^2 $ *b)* Jetzt das gleiche nur mit den y-Koordinaten und wir müssen zuerst die Gleichung umstellen damit $y$ die unabhängige Variable wird: $ y = sqrt(x-2) = y^2 = x-2 \ y^2 + 2 = x $ Jetzt können wir wie davor integrieren: $ pi integral_0^2 (y^2+2)^2 d y = pi [y^5/5 + (4y^3)/3 + 4y |_0^2] \ pi [6.4 + 10.666 + 8] = 78.747 E^2 $ === Aufgabe 7.52 b) #image("imgs/752.png") Für diese Aufgabe muss man die folgende Identität kennen: $ cos^2(x) = (1+cos(2x))/2 $ Sonst bleibt alles gleich. $ pi integral_0^(pi/2) (1+cos(2x))/2 d x \ = pi/2 integral_0^(pi/2) 1 d x + pi/2 integral_0^(pi/2) cos(2x) d x \ = pi/2 dot pi/2 + pi/2 dot 0 = pi^2/4 = 2.467 E^2 $ === Aufgabe 7.53 b) #image("imgs/753.png") Hier muss man die Gleichung umstellen, damit $y$ die unabhängige Variable wird. $ y=ln(x) \ e^y = x $ Jetzt kann wie gewohnt gearbeitet werden $ pi integral_(-1)^1 (e^y)^2 d y \ pi [1/2 e^(2y) |_(-1)^1] = pi [e^2/2 - e(-2)/2] = 11.394 E^2 $ == Bogenlänge Diese Beispiele sind nicht mehr auf die Integration selbst fokusiert weil wir ja Maxima eh benutzen werden also macht es kein Sinn sich damit für die Schularbeit ausernanderzusetzen. Hier liegt die Aufgabe eher an der Vorbereitung und dem Setup. Ich schreib außerdem die Maxima-Befehle dazu. === Aufgabe 7.74 b) Erinnerung welche Formel wir eigentlich benutzen werden: $ integral_a^b sqrt(1+(y')^2) d x $ #image("imgs/7742.png") Zuerst müssen wir $y'$ ausrechnen: $ y' = 3/2 sqrt(x) $ Jetzt muss man nur in die Formel einsetzen: $ integral_0^4 sqrt(1+(3/2 sqrt(x))^2) d x = 9.07 E $ Maxima-Befehl: _integrate(sqrt(1+(3/2*sqrt(x))^2), x, 0, 4), numer_ === Aufgabe 7.75 b) #image("imgs/775.png") $ y' = x \ integral_(-2)^2 sqrt(1+(x)^2) d x = 5.915 E $ Maxima-Befehl: _integrate(sqrt(1+x^2), x, -2, 2), numer_ === Aufgabe 7.76 b) #image("imgs/776.png") $ y' = 1/(cos^2(x)) \ integral_(- pi/4)^(pi/4) sqrt(1+(1/(cos^2(x)))^2) d x = 2.555 E $ Das war ein interesannter Fall, weil hier die analytische Integration nicht funktionierte. Ich musste romberg einsetzen um die Lösung zu finden. Quadpack hat auch die Lösung gefunden, aber daneben auch andere, falsche. Dementsprechend ist romberg die beste Wahl in diesem Fall. Maxima-Befehl: 1. _romberg(sqrt(1+(1/(cos(x)^2))^2), x, -%pi/4, %pi/4)_ == Mittelwerte Hier sind eher elektrotechnik-Beispiele die was mit Mittelwerten zu tun haben. Wichtig ist es, dass man den Gleichanteil bekommt, indem man die Formel einsetzt und man bekommt den Wechselwert, indem man den Graphen nach unten verschiebt. === Aufgabe 7.119 #image("imgs/7119.png") *1)* Der ununterbrochene rote Pfad (Steigung = 0) ist die Gleichspannung (weil sie gleich bleibt). Zuerst müssen wir die Periodendauer (Dauer eines Zyklus) ablesen (9ms) Danach muss man stückweise die Funktion $u(t)$ definieren, die den Wechselwert bestimmt: $ u(t) = cases(25V text("für") 0m s <= t < 3m s, 5V text("für") 3m s <= t < 6m s, 0V text("für") 6m s <= t < 9m s,) $ Jetzt einfach den Mittelwert ausrechnen $ overline(u) = 1/T dot integral_0^T u(t) d t = \ 1/9 dot (25 dot 3 + 5 dot 3 + 0) = 10V $ Für den Wechselwert muss man einfach den Graphen um 10V nach unten verschieben, damit der Gleichteil eliminiert wird und nur der Wechselteil übrig bleibt. *2)* Die Formel für den Effektivwert lautet (wie schon davor erwähnt) $ m_(text("eff")) = sqrt(1/(b-a) integral_a^b [f(x)]^2 d x) $ Wir müssen also $u(t)$ als $f(x)$ einsetzen: $ U_(text("eff")) = sqrt(1/9 (25^2 dot 3 + 5^2 dot 3)) = 14.72V $ === Aufgabe 7.120 b) #image("imgs/7120.png") *1)* Periodendauer: 5ms $ u(t) = cases(20/3 t -5V text("für") 0m s <= t < 3m s, 15V text("für") 3<= t < 5) $ Jetzt in die Formel einsetzen $ overline(u) = 1/5 (integral_0^3 (20/3 t-5) d t + integral_3^5 15 d t)\ = 1/5 (20/3 integral_0^3 t d t - integral_0^3 5 d t + 30V ) \ = 1/5 (20/3 dot 3 - 15V + 30V) = 1/5 (35V) \ = 9V $ Wechselwert bekommt man indem man den Graphen um 9V nach unten verschiebt. Wichtig: Man kann die beiden Funktionteile nie miteinander Vermischen weil sie an verschiedenen Zeitpunkten sind. *2)* Hier hab ich einfach Maxima verwendet aber hier ist die Formel. $ U_(text("eff")) = sqrt(1/5(integral_0^3 (20/3 t -5)^2) d t + integral_3^5 (15)^2 d t) $ Maxima-Befehle: 1. _f: 20/3*t-5_ 2. _o:1/5\*(integrate(f^2, t, 0, 3) +integrate(15^2, t, 3,5))_ 3. _sqrt(o), numer_ === Aufgabe 7.121 b) #image("imgs/7121.png") *1)* Periodendauer: $2pi$ $ i(t) = cases(2 dot cos(t) + 2m A text("für") 0m s <= t < pi m s, 0m A text("für") pi m s <= t < 2pi) $ Jetzt nur noch stückweise integrieren und in die Formel einsetzen (auch hier in Maxima) $ overline(u) = 1/(2pi) (integral_0^pi (2 dot cos(t) + 2) d t + integral_pi^(2pi) 0 d t) \ approx 1 m A $ Maxima-Befehle: 1. _f:2*cos(t)+2_ 2. _o:1/(2\*%pi)\*(integrate(f, t, 0, %pi)), numer_ Um den Gleichanteil zu bekommen muss man den Graphen um 1mA nach unten verschieben. *2)* Um den Effektivwert zu berechnen muss die Formel angewendet werden: $ I_(text("eff")) = sqrt(1/(2pi) [(integral_0^pi 2 dot cos(t) + 2 d t)^2 + (integral_pi^(2pi) 0 d t)^2]) \ = 1.732 m A $ Wichtig: Man sollte nicht das ganze Integral quadrieren, sondern nur die Funktion zum Integrieren. == Konkrete Beispiele Hier sind die typischen Schularbeitsbeispiele.
https://github.com/dashuai009/dashuai009.github.io
https://raw.githubusercontent.com/dashuai009/dashuai009.github.io/main/src/content/blog/023.typ
typst
#let date = datetime( year: 2022, month: 3, day: 14, ) #metadata(( title: "错排问题", subtitle: [错排问题,欧拉信封问题], author: "dashuai009", abstract: "", description: "考虑一个有n个元素的排列,若一个排列中所有的元素都不在自己原来的位置上,那么这样的排列就称为原排列的一个错排。", pubDate: "'Jul 08 2022'", ))<frontmatter> #import "../__template/style.typ": conf #show: conf == 定义 <定义> 考虑一个有$n$个元素的排列,若一个排列中所有的元素都不在自己原来的位置上,那么这样的排列就称为原排列的一个错排。 $n$个元素的错排数记为$D_n$或$! n$。 == 例子 <例子> 伯努利-欧拉的装错信封的问题。 == 形式化定义 <形式化定义> 记$D_n$为${ 1 , 2 , dots.h , n }$上没有不动点的排列(即$phi.alt : { 1 , 2 , dots.h , n } arrow.r { 1 , 2 , dots.h , n } , med phi.alt (i) eq.not i , med forall 1 lt.eq i lt.eq n$的个数,$D_n$的值如下:(由$n = 1$起) $0 , 1 , 2 , 9 , 44 , 265 , 1854 , 14833 , 133496 , 1334961 , 14684570 , 176214841 , 2290792932 . . .$ == 规律 <规律> $D_n = n D_(n - 1) + (- 1)^n$ == 递推数列法 <递推数列法> 显然$D_1 = 0 , D_2 = 1$。 当$n gt.eq 3$时,不妨设n排在了第k位,其中$k eq.not n$,也就是$1 lt.eq k lt.eq n - 1$。那么我们现在考虑$k$的情况。 - 当k排在第$n$位时,除了$n$和$k$以外还有$n - 2$个数,其错排数为$D_(n - 2)$。 - 当$k$不排在第$n$位时,那么将第$n$位重新考虑成一个新的“第$k$位”,这时的包括$k$在内的剩下$n - 1$个数的每一种错排,都等价于只有$n - 1$个数时的错排(只是其中的第k位会换成第n位)。其错排数为$D_(n - 1)$。 所以当n排在第$k$位时共有$D_(n - 2) + D_(n - 1)$种错排方法,又$k$有从$1$到$n - 1$共$n - 1$种取法,我们可以得到: $D_n = (n - 1) (D_(n - 1) + D_(n - 2))$ == 生成函数 === 一 <一> 根据规律 $D_n = n D_(n - 1) + (- 1)^n$可以得到如下: $ D (x) & = x D (x) + e^(- x)\ & = frac(e^(- x), 1 - x)\ & = frac(1 - x + frac(x^2, 2 !) + . . . + (- 1)^n frac(x^n, n !) + . . ., 1 - x) $ === 二 <二> 从置换环的角度考虑,错排就是指置换环中不存在自环的排列。也就是说不存在长度为 $1$ 的置换环。后者的指数生成函数是 $ sum_(n gt.eq 2) x^n / n = - ln (1 - x) - x $ 因此错排数的指数生成函数就是 $exp (- ln (1 - x) - x)$。 == 减掉非错排的情况 <减掉非错排的情况> 非错排:存在$p_i = i$的排列 只存在一个:$C_n^1 D_(n - 1)$, 只存在二个:$C_n^2 D_(n - 2)$, 只存在三个:$C_n^3 D_(n - 3)$, … 只存在n个:$C_n^n D_(n - n)$, 所以, $ D_n & = n ! - (C_n^1 D_(n - 1) + C_n^2 D_(n - 2) + C_n^3 D_(n - 3) + . . . + C_n^n D_(n - n))\ & = sum_(k = 0)^n binom(n, k) (n - k) ! $ #strike[那一定是你程序写错了] == 通向公式 <通向公式> 令$D_n = n ! M_n$ $M_n - M_(n - 1) = (- 1)^n frac(1, n !)$ $D_n = n ! (frac(1, 2 !) - frac(1, 3 !) + frac(1, 4 !) - . . . + (- 1)^n frac(1, n !))$ == #link("https://zh.wikipedia.org/wiki/%E9%94%99%E6%8E%92%E9%97%AE%E9%A2%98#%E5%A4%9A%E9%A1%B9%E5%BC%8F%E6%A8%A1%E6%8B%9F")[多项式模拟] <多项式模拟> == $D_n$最接近 $frac(n !, e)$ 的整数 <d_n最接近-displaystyle-frac-ne-的整数> 考虑指数函数在 0 处的泰勒展开: $ e^(- 1) & = 1 + frac((- 1)^1, 1 !) + frac((- 1)^2, 2 !) + frac((- 1)^3, 3 !) + . . . + frac((- 1)^n, n !) + frac(e^(- c), (n + 1) !) ( c - 1 )^n\ & = frac(D_n, n !) + R_n $ 其中 $ lr(|R_n|) lt.eq frac(e^0, (n + 1) !) = frac(1, (n + 1) !) $ 所以 $ lr(|frac(n !, e) - D_n|) lt.eq frac(n !, (n + 1) !) = frac(1, n + 1) $ 得 $ D_n = ⌊frac(n !, e) + 0.5⌋ $
https://github.com/HEIGVD-Experience/docs
https://raw.githubusercontent.com/HEIGVD-Experience/docs/main/S4/WEB/docs/2-HTML%26CSS/html.typ
typst
#import "/_settings/typst/template-note-en.typ": conf #show: doc => conf( title: [ HTML ], lesson: "WEB", chapter: "2 - HTML & CSS", definition: "The content covers essential educational objectives in the WEB course, detailing the roles of HTML and CSS, HTML document structure, CSS styling, and utilizing the Document Object Model (DOM). It emphasizes the importance of accessibility, responsive design, and SEO in web development. Additionally, it provides practical examples and explanations of HTML elements, attributes, text formatting, lists, media elements, tables, forms, and semantic elements for improved understanding and implementation. SEO optimization is highlighted as crucial for driving organic traffic to websites.", col: 1, doc, ) = Educational objectives - Describe the role of HTML and CSS in web development - Describe the structure of an HTML document - Create a HTML document with a CSS stylesheet - Use HTML elements and CSS properties - Describe the role of the Document Object Model (DOM) and it’s structure - Use Grid and Flexbox for layout - Use Media Queries for responsive design - Cite the importance of accessibility and SEO (Search Engine Optimization) in web development - Cite different ways to enhance SEO = HTML & CSS role in web development HTML (HyperText Markup Language) is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript. HTML could be seen as the skeleton of your web page, it defines the structure of your content. CSS is the skin, it defines the style of your content. JavaScript is the muscle, it defines the behavior of your content. == HTML structure HTML documents are composed of a tree of elements. Elements can have attributes that define their behavior and appearance. The structure of an HTML document is composed of the following elements: - `<!DOCTYPE html>`: The document type declaration for HTML5 - `<html>`: The root element of an HTML page - `<head>`: Contains meta-information about the document - `<title>`: The title of the document ```html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Welcome page</title> </head> <body> <h1>Hello students of the Web Technologies course !</h1> </body> </html> ``` === Meta tags Meta tags are used to provide metadata about the HTML document. Metadata will not be displayed on the page, but will be machine parsable. Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata and can be used to improve SEO and accessibility. ```html <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> ``` - width=device-width : the width of the page matches the screen width - initial-scale=1.0 : the initial zoom level === Open Graph Protocol The Open Graph protocol enables any web pages to show some additional information when shared on social media or messaging apps. It is a set of meta tags that you can add to your HTML page to improve the way your content is displayed when shared. ```html <meta property="og:title" content="The Rock" /> <meta property="og:type" content="video.movie" /> <meta property="og:url" content="https://www.imdb.com/title/tt0117500/" /> <meta property="og:image" content="https://ia.media-imdb.com/images/rock.jpg" /> ``` = HTML anatomy == Elements Elements are the building blocks of HTML pages. An element is a part of a document, marked up with a start tag, content, and an end tag. Elements can also have attributes that define their behavior and appearance. #image("/_src/img/docs/image copy 34.png") === Attributes Attributes are used to provide additional information about HTML elements. They are always included in the opening tag and are written as name/value pairs. #image("/_src/img/docs/image copy 35.png") - the id attribute gives an identifier to the element that is unique in the document, - the class attribute assigns a class to the element, usually used to style it, - the style attribute provides CSS properties to style the element. == Text elements === Headings Headings are used to define the structure of the content. There are six levels of headings, from `<h1>` to `<h6>`. ```html <h1>Heading level 1</h1> <h2>Heading level 2</h2> <h3>Heading level 3</h3> ``` === Paragraphs Paragraphs are used to define blocks of text. They are defined with the `<p>` element. ```html <p>This is a paragraph.</p> ``` === Break line & Horizontal rule The `<br>` element is used to insert a single line break. The `<hr>` element is used to insert a horizontal rule. ```html <p>First line<br>Second line</p> <hr> ``` === Formatting ```html <i>italic</i> <b>bold</b> <u>underline</u> ``` == Lists === Unordered lists Unordered lists are used to list items in no particular order. They are defined with the `<ul>` element. ```html <ul> <li>Item 1</li> <li>Item 2</li> </ul> ``` === Ordered lists Ordered lists are used to list items in a specific order. They are defined with the `<ol>` element. ```html <ol> <li>Item 1</li> <li>Item 2</li> </ol> ``` == Hyperlink Hyperlinks are used to link from one page to another. They are defined with the `<a>` element. ```html <a href="https://www.google.com" title="Google" target="_blank">Google</a> <a href="mailto:<EMAIL>?subject=hello&body=world!">Hello World!</a> ``` == Media elements === Images ```html <img src="image.jpg" alt="Image description"> ``` === Audio & Video ```html <audio src="audio.mp3"></audio> <video src="video.mp4"></video> ``` === Canvas The canvas element allows for dynamic, scriptable rendering of 2D and 3D shapes. ```html <canvas id="myCanvas" width="200" height="100"></canvas> ``` == Tables Tables are used to display data in a tabular format. They are defined with the `<table>` element. ```html <table> <!-- row --> <tr> <!-- header column --> <th>Student ID</th> <th>Grade</th> </tr> <tr> <!-- regular column --> <td>4</td> <td>5</td> </tr> <tr> <!-- merged columns --> <td colspan="2">6</td> </tr> </table> ``` == Forms Forms are used to collect user input. They are defined with the `<form>` element. ```html <form action="/submit" method="post"> <label for="name">Name:</label> <input type="text" id="name" name="name"> <input type="submit" value="Submit"> </form> ``` - The action attribute defines the location (URL) where the form should be sent when it is submitted. - The method attribute defines which HTTP method to send the data with (it can be “get” or “post”). === Attributes - name: the name of the input, which is submitted with the form data. - value: the default value of the input. - placeholder: the text that appears within the input when empty. - required: indicates that the input is mandatory. Submission will be blocked if the input is empty. - readonly: indicates that the input cannot be edited. == Semantic elements Semantic elements are HTML elements that clearly describe their meaning in a human- and machine-readable way. They are used to define the structure of the content and provide additional information about the content. ```html <header>Header</header> <nav>Navigation</nav> <main>Main content</main> <section>Section</section> <article>Article</article> <aside>Aside</aside> <footer>Footer</footer> ``` = SEO optimization SEO mean Search Engine Optimization. It is the practice of increasing the quantity and quality of traffic to your website through organic search engine results. SEO is important because it helps search engines understand what your content is about and how it can be useful to users.
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas1/1_Pondelok.typ
typst
#let V = ( "HV": ( ("", "Prechváľniji múčenicy", "Vsjá privél jesí tvojím slóvom i Dúchom, za bláhosť Hóspodi, táže sotvoríl jesí slovésnoje mjá živótno, da tvojé svjatóje slávľu vsesíľnoje ímja. áz že najpáče stúdnymi mojími ďíly vsehdá bezčéstvuju: no poščadí, moľúsja."), ("", "", "Poznáj tvojé, okajánnaja dušé, božéstvennoje blahoródije, i otéčestvo netľínnoje, i tščísja vsehdá blahoďijáňmi sijé dostiháti: ničtóže ot tľínnych da pľinít ťá, hórnija části jesí, ťílo že zemľá i tľíjetsja, da ne pobidít chúždšeje lúčšija."), ("", "", "Hrjadí vseokajánaja dušé mojá ko preblahómu, téplymi slezámi pristupí, soďíjannaja tobóju préžde sudá tvojehó vsjá ispovíduj, i mílostiva sozdáteľa, okajánnaja, sebí soďílaj, i proščénije isprosí, préžde dáže dvéri ne zakľučít tebí Hospóď."), ("", "", "Bezplótniji ánheli, Bóžiju prestólu predstojáščiji, i otonúdnymi svitlosťmí oblistavájemi, i svitolítiji víčno sijájušče, i svíti byvájušče vtoríji, Christú molítesja, darováti dušám nášym mír i véliju mílosť."), ("", "", "Bezsmértniji ánheli, živót voístinnu nehíblemyj, ot pérvaho prijémše životá vsebohátiji, prisnosúščnyja slávy, i svjatíji zrítelije premúdrosti víčnyja býste, svíta ispolňájemi, i sviščí soobraščájemi prilíčno pokazújemi."), ("", "", "Archánheli, ánheli, načála, prestóli, Hospódstvija, Serafími šestokrilátiji, i mnohoočítiji Cheruvími božéstvenniji, premúdrosti orháni: síly, vlásti božestvenňíjšiji, Christóvi molítesja, darováti dušám nášym mír i véliju mílosť."), ("Bohoródičen", "", "Maríje neporóčnaja, i umá vsjákaho prevoschoďáščaja, čísťíjšaja kolesníce, obderžíma mjá mnóhimi hrichmí i sťisňájema, k široťí pokajánija naprávi mjá vsesíľňijšim tvojím predstáteľstvom: íbo móžeši jáko Máti vsjá mohúščaho."), ), "S": ( ("", "", "Jáko pučína mnóha prehrišénij mojích Spáse, i ľúťi pohružájusja sohrišéňmi mojími, dážď mí rúku jáko Petróvi, spasí mja Bóže, i pomíluj mjá."), ("", "", "Jáko v pomyšlénijich lukávych i v ďíľich osudíchsja, Spáse, mýsľ mňí dáruj obraščénija Bóže, da zovú ti: spasí mja blahoďíteľu bláhíj, i pomíluj mjá."), ("", "", "Molítvami Hóspodi, vsích svjatých i Bohoródicy, mír tvój dážď nám, i pomíluj nás, jáko jedín ščédr."), ("Bohoródičen", "", "Nebésnych činóv rádovanije, na zemlí čelovíkov krípkoje predstáteľstvo, prečístaja Ďívo, spasí ny, íže k tebí pribihájuščyja: jáko na ťá upovánije po Bózi Bohoródice, vozložíchom."), ), ) #let P = ( "1": ( ("", "", "Tvojá pobidíteľnaja desníca, Bohoľípno v kríposti proslávisja: tá bo bezsmértne, jáko vsemohúščaja, protívnyja sotré, Izráiľťanom púť hlubiný novosoďílavšaja."), ("", "", "Neizhlahólanno začalá jesí Bóha, i páče jestestvá rodilá jesí Vladýčice prečístaja, zemnýja ot prehrišénij izmínšaho. Ťímže moľú ťa: mnóhich mjá prehrišénij izbávi."), ("", "", "Pučínoju pohružájem, bidámi hrichóv neizčétnych, i skorbéj, no okormlénijem tvojím síľnym, i molítvoju vseneporóčnaja, k tišiňí božéstvenňij pokajánija naprávi."), ("", "", "Vsejá mojejá žízni predstáteľnice, ot bíd mnóhich izbávi mjá, da blahodárstvennyj hlás vospiváju tí Bohoródice čístaja, i búduščija mjá ischití múki."), ("", "", "Obstojáteľnaja nachoždénija, i napástej búrju utolí Máti vseneporóčnaja, izbáviteľa i ziždíteľa i Bóha nášeho, blahodáť spasénija i očiščénija mí podajúšči."), ), "3": ( ("", "", "Jedíne vídyj čelovíčeskaho suščestvá némošč, i mílostivno v né voobrážsja, prepojáši mjá s vysotý síloju, jéže vopíti tebí svjatýj: oduševlénnyj chráme neizrečénnyja slávy tvojejá, čelovikoľúbče."), ("", "", "Viďínije zráka tvojehó čístaho, ánhelom úbo sládostno, čelovíkom že jésť spasíteľno, duchovóm že lukávstvija strášno: jéže víroju počitájušče i cilújušče Bohoródice, dúšu prosviščájem."), ("", "", "Krovmí iz tebé ďívčeskimi, plóť svojú obloží soďíteľ i Hospóď: jehóže molí vseneporóčnaja, rastľívša mjá bezmístnymi ďijáňmi, uščédriti za neizrečénnuju mílosť."), ("", "", "Žízni sťažáv ťá chraníteľnicu, i sťínu neoborímu, i po končíňi pokróv ťá obristí, i zastúpnicu nepobidímu, k Bóhu vvoďášču, i živót podajúšču víčnyj, i slávu, preneporóčnaja."), ("", "", "Začátije bezsímenno čístaja, i roždestvó netľínno: Bóh bo bí jávi roždéjsja, čelovíčeskaho jestestvá padénije prizyvája. Ťímže Bohoródicu ťá ístinnuju i súščuju vospivájem."), ), "4": ( ("", "", "Hóru ťá blahodátiju Bóžijeju priosinénnuju, prozorlívyma Avvakúm usmotrív očíma, iz tebé izýti Izráilevu provozhlašáše svjatómu, vo spasénije náše i obnovlénije."), ("", "", "Neuderžánnoje stremlénije k zlú vlečét mjá, ďíjstvijem vrahá, i obýčajem lukávym: pomozí mi Vladýčice, da ne do koncá vsepáhubnyj napadét na mjá, smértiju vozbraňája mí k pokajániju."), ("", "", "Vsé vrémja životá mojehó iždích v bluďích zlých, i jázvach ľútych, i nýňi vedút smirénnuju dúšu mojú sích ďílateli: Bohorodíteľnice Ďívo pomozí mi."), ("", "", "Uslýši hlás mój boľíznennyj vseneporóčnaja, íže iz hlubiný duší privnošáju stenáňmi, i razrišénije podážď mí dolhóv, íchže soďíjach okajánnyj mýsliju, i nrávom nesmýslennym."), ("", "", "Vladýčice míra Bohoródice, pomozí mi, prelukávyj vráh pohloščájet mjá zíľňi ľútymi vospominániji i pomyšléniji, jáže ot Bóha mjá razlučájut. ne ostávi úbo mené, nižé prézri."), ), "5": ( ("", "", "Prosvitívyj sijánijem prišéstvija tvojehó Christé, i osvitívyj krestóm tvojím míra koncý, serdcá prosvití svítom tvojehó Bohorazúmija, pravoslávno pojúščich ťá."), ("", "", "Sé hotóvu ko spaséniju pómošč sťažách, sehó rádi tebí pripádaju, i zovú so slezámi: Bohoródice, izbávi mjá ot stríl čuždáho, i búduščaho isťazánija."), ("", "", "Tý kríposť mojá, tý pochvalá i rádovanije, i chraníteľnica mí jesí, i zastuplénije, i pribížišče, i predstáteľnica nepobidíma, presvjatája Bohoródice Ďívo. Ťímže spasí rabá tvojehó."), ("", "", "Oskvérnšujusja okajánnuju mojú dúšu strasťmí, okroplénijem božéstvennyja tvojejá molítvy očísti, Bohoródice prečístaja, podajúšči spasénija tvojehó svítluju odéždu."), ("", "", "V žízni mojéj tvérdoje mí okormlénije jesí, trevolnénija izbavľájušči mnóhich obstojánij, i vo ischóďi mojém, moľú ťa, predstáni mí spasájušči, Máti Christá Bóha."), ), "6": ( ("", "", "Obýde nás posľídňaja bézdna, ňísť izbavľájaj, vminíchomsja jáko óvcy zakolénija, spasí ľúdi tvojá Bóže náš: tý bo kríposť nemoščstvújuščich i ispravlénije."), ("", "", "Beznevístnaja Bohorodíteľnice prečístaja, rúku tvojú prostrí mi, i ischíti iz hlubiný zól, jáže bezúmijem ischodátaich mojéj duší strástňij preokajánnyj."), ("", "", "Vostáni čístaja na pómošč rabú tvojemú, imúščemu nadéždu svojú s Bohom, k tvojemú zastupléniju nepobidímomu: da ne vráh vozmóh, vózmet i pohubít mjá."), ("", "", "Boľáščich cilíteľnicu, pádajuščich vostánije, sohrišájuščich očiščénije, Bohoródice, tebé moľú, so slezámi pripádaju, i zovú ti: jáko siľná, samá mja spasí pohibájuščaho."), ("", "", "Pomíluj čístaja, smirénnuju mojú dúšu, predvarí i voschíti, izjémľušči jú ot lukávaho: tščítsja bo v própasť posláti jú zlých rádi, jáže ľínosť mnóhaja soďíla."), ), "S": ( ("", "Hrób tvój Spáse", "Molítvennicu ko Hóspodu sťažáchom ťá vsí čístaja, i pritekájem v cérkov tvojú svjatúju, prosjášče pómošči ot tebé prisnoďívo: izbávi úbo nás ot bisóvskija zlóby i mučénija, i osuždénija strášnaho, ťá blažáščyja."), ), "7": ( ("", "", "Tebé úmnuju Bohoródice, péšč razsmotrjájem vírniji: jákože bo ótroki spasé trí prevoznosímyj, mír obnoví, vo črévi tvojém vsecíl, chváľnyj otcév Bóh, i preproslávlen."), ("", "", "Božéstvennaja skínija Vladýci bylá jesí, jáko začénši vo črévi, i róždši sehó plótiju, jedína neporóčnaja. Ťímže nás izbávi strastéj, i boľíznej, i skorbéj, i dolhóv: íbo ímaši kríposť i sílu mnóhu."), ("", "", "Ustávi čístaja, boľízň nesterpímuju, preokajánnyja mojejá duší, rádosť mí ístinnuju Vladýčice podajúšči, rišášči prehrišénij mojích mnóhich mútnuju volnú: tý bo mí jesí pribížišče i izbavlénije."), ("", "", "Vsé na ťá upovánije položích spasénija mojehó: ťá bo sťažách pómošč, i nepoborím stólp, i utverždénije, i tvérdosti izviščénije, i tobóju cárstvo polučíti naďíjusja Vladýčice."), ("", "", "Vostók sólnca bylá jesí slávy Vladýčice čístaja: tobóju bo javléjsja, vsjá svobodí ťmý i nevíďinija, i smrádnych prehrišénij. Ťímže vopijú ti: vňišnija mjá ťmý svobodí."), ), "8": ( ("", "", "V peščí ótrocy Izráilevy, jákože v horníľi dobrótoju blahočéstija, čisťíe zláta bleščáchusja, hlahóľušče: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("", "", "Strastéj smuščénije ľúťi oskorbľájet dúšu mojú Bohoródice: tišiný že i míra jáže vinóvnika čístaja, i podáteľa róždši, v mírňi ustrojéniji sobľudájušči, tíchostnyja mjá ispólni rádosti i vesélija."), ("", "", "Spasénija chodátaica nám javílasja jesí Bohoródice, róždšaja Spása i Vladýku vsjáčeskich. Ťímže moľú ťá: spasénija spodóbi smirénnuju mojú dúšu, pisnoslóviti ťá vírno vo vsjá víki."), ("", "", "Jáže ziždíteľa vsích i Bóha neizhlahólanno začénši, spasí mja ot tlí, i vsjákaho iskušénija, i daváj vopíti prísno: blahoslovíte vsjá ďilá Hóspoda, pójte i prevoznosíte jehó vo víki."), ("", "", "Vsjáčeskich ziždíteľa i Bóha rodilá jesí Ďívo, jehóže molí, darováti prihrešénij očiščénije, i skorbéj izbavlénije i napástej, i víčnaho ohňá, i osuždénija, slavoslóvjaščym neprestánno tvojú slávu."), ), "9": ( ("", "", "Óbraz čístaho roždestvá tvojehó, ohnepalímaja kupiná pokazá neopáľnaja: i nýňi na nás napástej svirípejuščuju uhasíti mólimsja péšč, da ťá Bohoródice neprestánno veličájem."), ("", "", "Máti Bóžija vseneporóčnaja, mílostivnuju tvojú utróbu mňí otvérzi, i ot úst mýslennaho vólka izbávi mjá, íščuščaho pohubíti i rastlíti mjá: pomíluj, moľú ťa, ne vozvratí mené posrámlena rabá tvojehó."), ("", "", "Vsejá mojejá žízni búdi predstáteľnica, i tvérdoje zastuplénije. i izbávi mjá vsečístaja, mnóhich napástej i pečálej, i vrahóv jazykobólija, no i ohňá víčnaho izbávi mjá."), ("", "", "Jedína boľáščich posiščénije: jedína pádšich ispravlénije Vladýčice: jedína k Bóhu rukovodíteľnica i vchód: jedína chodátaica víčnych bláh, pomíluj mjá jedínaho, páče vsích sohrišívšaho."), ("", "", "Prijimí mojú sléznuju nýňi molítvu, i podážď mí ostavlénije sohrišénij, i mnóhich zlých, jáže soďijach, Bohoródice, vsepítaja Vladýčice: do koncá bo pohibáju ot bezmírnaho otčájanija."), ), ) #let U = ( "S1": ( ("", "", "V bezzakónijich začát jésm áz blúdnyj, ne smíju vziráti na vysotú nebésnuju. no derzája na čelovikoľúbije tvojé zovú: Bóže, očísti mjá i spasí mja."), ("", "", "Ášče právednik jedvá spasájetsja, áz hďí javľúsja hríšnyj? Ťahotý i znója dnevnáho ne ponesóch: no s najémniki jedinonadesjátaho časá sopričtí mja Bóže, i spasí mja."), ("Bohoródičen", "", "Prečístaja Bohoródice, jáže na nebesích blahoslovénnaja, i na zemlí slavoslóvimaja: rádujsja nevísto nenevístnaja."), ), "S2": ( ("", "Hrób tvój Spáse", "Objátija Ótča otvérsti mí potščísja, blúdňi iždích mojé žitijé, na bohátstvo neiždivájemoje vzirájaj ščedrót tvojích Spáse, nýňi obniščávšeje mojé sérdce ne prézri. Tebí bo Hóspodi vo umiléniji zovú: sohriších tí, spasí mja."), ("", "", "Sudíšče tvojé strášno, i súd práveden, ďilá mojá ľúta: no tý mílostive, predvarív mjá spasí, i múki svobodí, i izbávi Vladýko šújich části, i spodóbi odesnúju tebé státi sudijé právedňijšij."), ("Múčeničen", "", "Stradánija pochvalóju, vincév dostójinstvom, slávniji strastotérpcy oďíjašasja tobóju Hóspodi: terpínijem bo rán, bezzakónnych pobídíša, i síloju božéstvennoju s nebesé pobídu prijáša. Ťích molítvami i mené svobodí ot nevídimaho vrahá Spáse, i spasí mja."), ("Bohoródičen", "", "Uprávi čístaja, okajánnuju mojú dúšu, i uščédri jú ot mnóžestva prehrišénij, vo hlubinú popóľzšujusja pohíbeli, vseneporóčnaja, i v čás mjá strášnyj smértnyj tý ischití ohlahólujuščich démonov, i vsjákija múki."), ), "S3": ( ("", "Hrób tvój Spáse", "Bezúmno ot tebé udalívsja vseščédre, blúdno mojé iždích žitijé, rabótajaj strastém bezslovésnym vsehdá: no prijimí mja ánhelov molítvami Ótče blahoutróbne, jákože blúdnaho ótroka, i spasí mja."), ("", "", "Bezúmno ot tebé udalívsja vseščédre, blúdno mojé iždích žitijé, rabótajaj strastém bezslovésnym vsehdá: no prijimí mja ánhelov molítvami Ótče blahoutróbne, jákože blúdnaho ótroka, i spasí mja."), ("Bohoródičen", "", "Neveščéstvennych vójinstv preimúščaja otrokovíce, i číny nebésnyja prevoschoďáščaja jedína, dostójnuju pochvalú ot ních prijémleši vsečístaja: no molí Sýna tvojehó so ánhely, jéže izbávitisja mňí ot strastéj mučíteľstva, jedínomu osuždénnomu."), ), "K": ( "P1": ( "1": ( ("", "", "Tvojá pobidíteľnaja desníca Bohoľípno v kríposti proslávisja: tá bo bezsmértne, jáko vsemohúščaja protívnyja sotré, Izráiľťanom púť hlubiný novosoďílavšaja."), ("", "", "Hrichóv mojích mnóžestvo, po mnóžestvu Christé mílosti tvojejá, moľúsja tí, potrebí, i pomyšlénije obraščénija mí dáruj: jáko da tvojú slávľu jáže páče umá blahostýňu."), ("", "", "Javílsja jesí za milosérdije ščedrót, na zemlí voploščájem čelovík: ťímže páče čelovíka Slóve Bóžij, sohrišívša prijimí mja nýňi pokajánijem k ščedrótam tvojím pripádajuščaho."), ("Múčeničen", "", "Umerščvlénije podražávše, Christá vóleju postradávšaho, vsechváľniji, i smérť, strásti preterpíste mnohovídnyja i smérť, prisnoslávniji. Ťímže bezsmértnoje žitijé ulučíste, múčenicy."), ("Múčeničen", "", "Óhň ľubvé božéstvennyja preslávno vnútr nosjášče múčenicy, ohňá ne ubojástesja: no téplymi boľíznej prespíjaniji mnohobóžija veščestvó vsjákoje popalíste."), ("Bohoródičen", "", "Čínove bezplótnych s námi vospivájut ťá Ďívo vsepítaja: neobiménnaho bo vo črévi tvojém voploščénna rodilá jesí, prebývši Ďíva jákože i préžde roždestvá, Bohonevísto."), ), "2": ( ("", "", "Tvojá pobidíteľnaja desníca Bohoľípno v kríposti proslávisja: tá bo bezsmértne, jáko vsemohúščaja protívnyja sotré, Izráiľťanom púť hlubiný novosoďílavšaja."), ("", "", "Prestólu predstojášče svítlo Vladýčnemu vsesvjatíji ánheli, Otcú sobeznačáľna, i tohó velíkaho sovíta ánhela, slóvo mí vdochnúti vás pojúšču, molítesja."), ("", "", "Prestólu predstojášče svítlo Vladýčnemu vsesvjatíji ánheli, Otcú sobeznačáľna, i tohó velíkaho sovíta ánhela, slóvo mí vdochnúti vás pojúšču, molítesja."), ("", "", "Zercála svíta Bohonačáľna, i trisólnečnyja sviščí sijánije v sebi prijémľuščija, po jelíku postížno, ánheľskija číny pérvije umýsliv, úm božéstvennyj sostávi."), ("Bohoródičen", "", "Ukrašéj jáko Bóh činonačálija výšnich síl, vo utróbu neiskusobráčnuju, Serafímov výššu, vselísja tvojú Bohoródice, i plóť nepremínna býsť."), ), ), "P3": ( "1": ( ("", "", "Jedíne vídyj čelovíčeskaho suščestvá némošč, i mílostivno v né voobrážsja, prepojáši mjá s vysotý síloju, jéže vopíti tebí svjatýj: oduševlénnyj chráme neizrečénnyja slávy tvojejá čelovikoľúbče."), ("", "", "Vozníkni, hrjadí, o dušé! I vozopíj sozdáteľu tvojemú, tájnaja tvojá vsjá víduščemu, i pokajánija plodý pokaží: jáko da pomílujet ťá ščédryj Hospóď, i ohňá víčnaho izbávit."), ("", "", "Očísti jedíne bláže, očísti i spasí mja, jáko mytár so stráchom zovú ti: mnóžestvom hrichóv vlekíjsja, i prekloňájem jésm ťahotóju prehrišénij, i studá bezmírnaho ispolňájajsja."), ("Múčeničen", "", "Múdrostiju i rázumom ístinnym múčenicy ispolňájemi, jéllinskuju múdrosť obujíša, múdrostnuju že zlóbu pohubíša, i krípko postradávše, dostójňi vosprijáša pobídy vincý, rádujuščesja."), ("Múčeničen", "", "Jedínicu úbo jestestvóm, stradáľcy, Tróicu že lícy ispovídajušče, prélesť mnohobóžnuju božéstvennoju víroju potrebíste, i svetíľnicy javístesja, vsích ozarjájušče serdcá lučámi blahodátnymi."), ("Bohoródičen", "", "Svjatája Bohonevísto čístaja, svjáto porodilá jesí, vo svjatých počivájuščaho, Sýna i Slóva Otcú sobeznačáľnaho, osvjaščájuščaho o svjaťím Dúsi, íže tohó blahočéstno osvjaščájuščyja."), ), "2": ( ("", "", "Jedíne vídyj čelovíčeskaho suščestvá némošč, i mílostivno v né voobrážsja, prepojáši mjá s vysotý síloju, jéže vopíti tebí svjatýj: oduševlénnyj chráme neizrečénnyja slávy tvojejá čelovikoľúbče."), ("", "", "Svítu Bohoďíteľnomu Serafími nesrédstvenno približájuščesja, i mnohohúbo ím nasyščájemi, pervodátnymi jávi sijáňmi pervoďíľno svíťatsja, i jáko svíti vtoríji byvájut, Božestvóm obožájemi."), ("", "", "Svítu Bohoďíteľnomu Serafími nesrédstvenno približájuščesja, i mnohohúbo ím nasyščájemi, pervodátnymi jávi sijáňmi pervoďíľno svíťatsja, i jáko svíti vtoríji byvájut, Božestvóm obožájemi."), ("", "", "Ánheľskija svítlosti píti usérdno želájušče, jáže ťími ot Bóha pómošč podajémuju, vírniji prósim umá čistotóju, i prečístymi ustý, i da polúčim sích sijánije."), ("Bohoródičen", "", "Umá presúščestvennaho víďiti spodobľájemi, jáko ľípo, Havrijíl Ďívo vseneporóčnaja, rádovanen hlás prinesé tebí, slovesé začátije jávi vozviščája tí, i neizrečénnoje roždestvó propovídaja tvojé."), ), ), "P4": ( "1": ( ("", "", "Hóru ťá blahodátiju Bóžijeju priosinénnuju, prozorlívyma Avvakúm usmotrív očíma, iz tebé izýti Izráilevu provozhlašáše svjatómu, vo spasénije náše i obnovlénije."), ("", "", "Komú ťa, dušé mojá okajánnaja, upodóbľu, ďílajuščuju ľútaja, i ne tvorjáščuju dóbrych? Obratísja, vozopíj tebé rádi obniščávšemu vóleju: serdcevídče, uščédri, i spasí mja."), ("", "", "Opreďilívyj pokajánije Spáse obraščájuščymsja, jéže mí podážď bláže, préžde koncá žitijú dajá mi umilénije i vozdychánije, jáko bludníci pérvije, oblobyzájuščej nózi tvojí Vladýko."), ("Múčeničen", "", "Vód duchóvnych ispólnšesja múčenicy, vodý žívy ríki javíšasja manovénijem božéstvennym, i prélesti izsušíša mútnyja Christé potóki Dúchom, i vírnych mýsli napojíša."), ("Múčeničen", "", "Veľmí podvíhšesja božéstvenniji múčenicy, ohňá bo i mečá, i ľútych vsích preterpíša tomlénije. Ťích moléňmi Slóve Bóžij, prevelíkija izbávi múki víčnyja, víroju pojúščyja ťá."), ("Bohoródičen", "", "Íže drévle iz Otcá neroždénna Sýn roždéjsja, roždestvó imí ľítnoje, iz tebé Ďívo voplóščsja, ľítnuju bráň zemnoródnych otjáti choťá blahoutróbnyj, íže dnéj i ľít prevýše sýj."), ), "2": ( ("", "", "Hóru ťá blahodátiju Bóžijeju priosinénnuju, prozorlívyma Avvakúm usmotrív očíma, iz tebé izýti Izráilevu provozhlašáše svjatómu, vo spasénije náše i obnovlénije."), ("", "", "Prestóli pérvoje ispolňájušče udobrénije, i Cheruvími i Serafími, božéstvennymi zarjámi, nesrédstvenno svíťatsja, Bohoďíteľnaja svjaščennonačálija prijémľušče, nýňi pojút: sláva síľi tvojéj Hóspodi."), ("", "", "Prestóli pérvoje ispolňájušče udobrénije, i Cheruvími i Serafími, božéstvennymi zarjámi, nesrédstvenno svíťatsja, Bohoďíteľnaja svjaščennonačálija prijémľušče, nýňi pojút: sláva síľi tvojéj Hóspodi."), ("", "", "Pojút tričíslennuju jedínicu Božestvá Tróičeskimi svjaščénniji neprestánnymi hlásy, javľájušče Serafími prečístoje Bohoslóvija tájinstvo, i pravoslávňij véri naučájušče."), ("Bohoródičen", "", "Íže vsjákija tvári prevýšši razumivájem, páče umá živonačáľnym zdánijem, voístinnu na zemlí soveršája čudesá, ďívstvennymi svítlosťmi, vo tvojé čístoje črévo vselísja prečístaja."), ), ), "P5": ( "1": ( ("", "", "Prosvitívyj sijánijem prišéstvija tvojehó Christé, i osvitívyj krestóm tvojím míra koncý, serdcá prosvití svítom tvojehó Bohorazúmija, pravoslávno pojúščich ťá."), ("", "", "Vpadóch v tľínije strastéj, i bojúsja tvojehó právednaho sudíšča, právednyj Hóspodi. Ťímže moľúsja tí: ukripí mja tvoríti ďílanija blahája, opravdájuščaja mjá."), ("", "", "Bezvístnaja i tájnaja sérdca mojehó tý vísi, Bóže mój, i ziždíteľu, i Hóspodi, ne osudí úbo mené v čás sudá, vnehdá priídeši sudíti vsjáčeskim."), ("Múčeničen", "", "Svjatíji pričastívšesja ohňú, razžžénije pokazáchu božéstvennaho svojehó ľublénija. Ťímže orošájemi, čájanijem búduščich Bohonósniji veseľáchusja."), ("Múčeničen", "", "Ukrepľájemi blahích nadéždeju múčenicy, preterpiváchu rasterzánija udóv terpiľívijše, i mnohokóznennaho, žílami svojími neosláblennaho terpínija, udavíša."), ("Bohoródičen", "", "Vitíjstvujuščaja ustá ne vozmóhut, roždestvá tvojehó neizrečénnoje povídati čúdo, Bohonevísto: neskazánnaho bo raždáješi, i na objátijach nósiši rukóju soderžáščaho vsjáčeskaja."), ), "2": ( ("", "", "Prosvitívyj sijánijem prišéstvija tvojehó Christé, i osvitívyj krestóm tvojím míra koncý, serdcá prosvití svítom tvojehó Bohorazúmija, pravoslávno pojúščich ťá."), ("", "", "Ľubóviju božéstvennoju raspaľájemi, hospóďstvija, vlásti i síly, čínove vtoríji, nemólčnymi ustý Bohonačáľnoje pisnoslóvjat jedíno suščestvó i sílu."), ("", "", "Ľubóviju božéstvennoju raspaľájemi, hospóďstvija, vlásti i síly, čínove vtoríji, nemólčnymi ustý Bohonačáľnoje pisnoslóvjat jedíno suščestvó i sílu."), ("", "", "Upravľájutsja archánheľstiji čínove Dúchom, i ánhelov, i načálov, so bezčíslennymi vójinstvy: jedíno trijipostásnoje prosvitíteľno suščestvó počitáti svítlo učími súť."), ("Bohoródičen", "", "Ukrasílasja jesí páče vsjákaho ánheľskaho blaholépija, ánhelov bo tvorcá začénši i Hóspoda, Bohomáti prečístaja, voplotívšahosja neizrečénno ot tvojích krovéj, rodilá jesí."), ), ), "P6": ( "1": ( ("", "", "Obýde nás posľídňaja bézdna, ňísť izbavľájaj, vminíchomsja jáko óvcy zakolénija, spasí ľúdi tvojá Bóže náš: tý bo kríposť nemoščstvújuščich i ispravlénije."), ("", "", "Sýj vráč Christé, iscilí strásti sérdca mojehó, i omýj mjá ot vsjákija skvérny, strujámi Iisúse mój umilénija, da pojú i veličáju blahoutróbije tvojé."), ("", "", "Bluďášča mjá na putéch pohíbeli, i v róv sohrišénij vpádajušča mjá obratí Christé, i k nezablúdnym stezjám navedí tvojích čestných opravdánij, jáko da slávľu ťá."), ("Múčeničen", "", "Kámenije voístinnu mnohocínnoje, kámenijem posypájemi, ne otverhóšasja Kámene žíznennaho, nižé istukánnomu kámeniju požróša, slávniji i vincenóscy Hospódni múčenicy."), ("Múčeničen", "", "Obnóvľše dúši rálom víry múčenicy, stradánija klás Dúchom božéstvennym storíčnyj vozrastíša, i píšči blažénnyja spodóbišasja."), ("Bohoródičen", "", "Óhnennych slúh óhň rodívši, javílasja jesí vseneporóčnaja i tvari vsjákija pervoďíľňi, prečístaja Ďívo preimúščaja, v ženách blahoslovénnaja Bohorádovannaja."), ), "2": ( ("", "", "Obýde nás posľídňaja bézdna, ňísť izbavľájaj, vminíchomsja jáko óvcy zakolénija, spasí ľúdi tvojá Bóže náš: tý bo kríposť nemoščstvújuščich i ispravlénije."), ("", "", "Číni bezplótnych Hóspodi, prestólu predstojášče slávy tvojejá čelovikoľúbče, hlásy ánheľskimi neprestánnymi ťá počitájut: tý bo kríposť jesí ťích Christé, i pínije."), ("", "", "Číni bezplótnych Hóspodi, prestólu predstojášče slávy tvojejá čelovikoľúbče, hlásy ánheľskimi neprestánnymi ťá počitájut: tý bo kríposť jesí ťích Christé, i pínije."), ("", "", "Licé tvojé zrjášče ánheli, dobrótu nedomýslimuju, prebožéstvennoje blahoľípije tvojejá božéstvennyja svítlosti, prosviščájutsja: tý bo ťích i svít jesí i rádovanije."), ("Bohoródičen", "", "Voplotísja, íže préžde sýj bezplótnoje Slóvo, iz tebé prečístaja, vsjáčeskaja vóleju tvorjáj, i bezplótnych vójinstva privedýj ot nebytijá, jáko vsesílen."), ), ), "P7": ( "1": ( ("", "", "Tebé úmnuju Bohoródice, péšč razsmotrjájem vírniji: jákože bo ótroki spasé trí prevoznosímyj, mír obnoví, vo črévi tvojém vsecíl, chváľnyj otcév Bóh, i preproslávlen."), ("", "", "Ľvý drévle Danijíl ukrotí, sožíteľnicu imíjaj dobroďíteľ: tomú porevnúj, o dušé, i rykájuščaho vsehdá jáko ľvá, i objáti choťášča ťá, jéže k Bóhu vziránijem prísno, bezďíľna sotvorí."), ("", "", "Premnóžestvom bludá, Hóspodi, dúšu oskverních ľúťi. Prevoschoďáščuju úbo Christé imýj blahostýňu, prijimí jáko blúdnaho, i pojúšča mjá uščédri: prepítyj otcév Bóh, i preproslávlen."), ("Múčeničen", "", "Zakónom Christóvym blahomóščno ukripľájemi, bezzakónnych sovíty pohubíša, nepobidímiji múčenicy, zakónno že skončávšesja, vospiváchu: prepítyj otcév Bóh blahoslovén jesí."), ("Múčeničen", "", "Bohozárniji Hospódni múčenicy, raspalájemi svítom Tróičeskim, jávi mučénija ťmú, i prélesti mhlú razrušíste, pojúšče: prepítyj otcév Bóh, i preproslávlen."), ("Bohoródičen", "", "Zakóni jestestvá v tebí obnovľájutsja: zakonodávca bo Christá kromí zakón plotskích raždáješi, vseneporóčnaja, vsím izbavlénije zakonopolahájušča pojúščym: prepítyj otcév Bóh i preproslávlen."), ), "2": ( ("", "", "Tebé úmnuju Bohoródice, péšč razsmotrjájem vírniji: jákože bo ótroki spasé trí prevoznosímyj, mír obnoví, vo črévi tvojém vsecíl, chváľnyj otcév Bóh, i preproslávlen."), ("", "", "Beznačáľnyj svít tý jesí Vladýko, ot Otcá svíta vozsijávyj, ánhelov vójinstva svíty ustrójil jesí, zercála prijémľušča, blistánije tvojé nezachodímoje: prepítyj otcév Bóh, i preproslávlen."), ("", "", "Ród čelovéč, íže vsích Hospóď, pristavléňmi ánheľskimi jávi spasáješi: sijá bo predstávil jesí vsím vérujuščym, i pravoslávno pojúščym ťá, prepítaho otcév Bóha, i preproslávlena."), ("", "", "Jazýk i úm ne móžet, Vladýko, tvojích čudés izreščí, i ďíl blahoľípnoje: tý bo prosvitíl jesí vsjákoje udobrénije nebésnych síl: prepítyj otcév Bóh, i preproslávlen."), ("Bohoródičen", "", "Iz tebé, čístaja, Sýn voplotísja, íže préžde bez mátere iz Otcá, i bez otcá jéže po nám, nás rádi býv. Jemúže nýňi slúžat bezplótnych polkí, jáko chvalímomu otcév Bóhu, i preproslávlenu."), ), ), "P8": ( "1": ( ("", "", "V peščí ótrocy Izráilevy, jákože v horníľi dobrótoju blahočéstija, čisťíje zláta bleščáchusja, hlahóľušče: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("", "", "Izbáviteľu mój blahoutróbne Christé, nýňi oderžáščija mjá mhlý hrichóvnyja, i vsjákich iskušénij izbávi zovúšča: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("", "", "Jehdá chóščeši prijití Christé vo slávi, sudíti míru, stojániju izbránnych tvojích sopričtí i mené, vopijúšča i hlahóľušča: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("Múčeničen", "", "K zemlí Christóvi svjatíji múčenicy preidóste: na zemlí bo veľmí podvíhšesja, nebésnuju žízň vosprijáste, pojúšče: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("Múčeničen", "", "Sovlékšesja ťíla tľínnaho, vo odéždu bezsmértija jáko múčenicy pobidonósniji oblekóstesja vo Christá, s vysotý vzyvájušče: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("Bohoródičen", "", "Svjaščénniji ťá hlásy izdaléča provozvistíša prečístaja, býti tebí Máteri vsjá sotvóršemu Bóhu. Jemúže pojém: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ), "2": ( ("", "", "V peščí ótrocy Izráilevy, jákože v horníľi dobrótoju blahočéstija, čisťíje zláta bleščáchusja, hlahóľušče: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("", "", "Prosviščénnaja i blizosvítnaja ánhelov vójinstva lučámi trisólnečnyja krasotý, vírniji podražájušče vospojím: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("", "", "Jáko istóčnik vsích dóbrych, Bohonačáľňijšaja privódit božéstvennaja síla svíty vtorýja, svít pérvyj prijémľuščja i vopijúščja: blahoslovíte vsjá ďilá Hospódňa Hóspoda, pójte i prevoznosíte vo vsjá víki."), ("", "", "Úm pérvyj i soďíteľ, premírnyja umý ánheľskija, presúščestvenňi sostávi sebí, jávi približájuščyjasja, i vopijúščyja: vsjá ďilá Hospódňa Hóspoda pójte, i prevoznosíte vo vsjá víki."), ("Bohoródičen", "", "Páče Slóva iz Otcá roždénna préžde vík, neizrečénno voploščénna rodilá jesí nám Ďívo vseneporóčnaja. Jemúže vopijém: vsjá ďilá Hospódňa Hóspoda pójte, i prevoznosíte vo vsjá víki."), ), ), "P9": ( "1": ( ("", "", "Óbraz čístaho roždestvá tvojehó ohnepalímaja kupiná pokazá neopáľnaja: i nýňi na nás napástej svirípijuščuju uhasíti mólimsja péšč, da ťá Bohoródice neprestánno veličájem."), ("", "", "Jákože chananéja zovú ti: pomíluj mjá Slóve: dúšu bo ímam démonskimi naneséniji bídstvujuščuju, i bezúmno bezzakónnaja ďílajuščuju, i nečúvstvujuščuju božéstvennaho tvojehó strácha, dolhoterpilíve."), ("", "", "Postávi Hóspodi, na kámeni poveľínij tvojích duší mojejá nózi, i bezstúdno zapjáti mjá choťášča, zapní zmíja, i izbávi mjá sehó zloďíjstva, jáko bláh i mnohomílostiv."), ("Múčeničen", "", "Užé préžde múčenicy, iskušénij vódu nepostojánnuju, i rán ľútych búrju, ko pristánišču jávi dostihóste hórňaho cárstvija, božéstvennyja tišiný naslaždájuščesja."), ("Múčeničen", "", "Svíta nevečérňaho múčenicy svitovídni býti spodóbistesja, i v cérkvi pervoroždénnych veselítesja, i so ánheľskimi líki rádujetesja, s nímiže živodávca o nás molíte."), ("Bohoródičen", "", "Nósiši vsjá nosjáščaho, i dojíši vsím píšču dajúščaho, vélije i strášno jéže páče umá tvojé táinstvo, kovčéže čéstnýja svjatýni Ďívo Bohoródice. Ťímže ťá víroju ublažájem."), ), "2": ( ("", "", "Óbraz čístaho roždestvá tvojehó ohnepalímaja kupiná pokazá neopáľnaja: i nýňi na nás napástej svirípijuščuju uhasíti mólimsja péšč, da ťá Bohoródice neprestánno veličájem."), ("", "", "Pričástniki neizrečénnyja slávy tvojejá, bezplótnyja umý Spáse sostávil jesí: i nýňi ťími tvojá ľúdi sochraní, tebí víroju i ľubóviju pribihájuščyja, da ťá Vladýko neprestánno veličájem."), ("", "", "Da posyláješi mírnaho ánhela, sobľudájušča vsederžíteľu stádo tvojé: míra bo i ľubvé tý vinóven, i Bohomúdrennuju víru sobľudájušča, i vsjá jéresi tvojéju síloju razrušájušča."), ("", "", "Vés sládosť vospivájemyj, nebésnuju sládostnuju svítlosť nasadí v cérkvach tvojích Vladýko, i blahočéstno dážď v sostojánije, da ťá Spasíteľa neprestánno veličájem."), ("Bohoródičen", "", "Číni ánheľstiji prečístaja, nýňi nemólčno tvojé roždestvó počitájut: v činú bo stoját vzirájušče, vesélija jehó nasyščájuščesja, i ťá Bohoródicu neprestánno veličájut."), ), ), ), "ST": ( ("", "", "Ín ťá mír dušé ožidájet, i sudijá chóščet tvojá obličíti tájnaja i ľútaja. Ne prebúdi úbo v zďíšnich, no predvarí vopijúšči sudijí: Bóže očísti mjá, i spasí mja."), ("", "", "Ne prenebrezí mené Spáse mój ľínostiju hrichóvnoju oderžíma, vozdvíhni mojé pomyšlénije k pokajániju, i tvojehó vinohráda ďílateľa iskúsna pokaží mja: dáruj mí jedinahonádesjate časá mzdú, i véliju mílosť."), ("Múčeničen", "", "Strástotérpcy Christóvy, prijidíte ľúdije vsí počtím, píňmi i písňmi duchóvnymi, svitíľniki míra, i propovídniki víry, istóčnik prisnotekúščij, iz nehóže istekájut vírnym iscilénija: Ťích molítvami Christé Bóže náš, mír dáruj míru tvojemú, i dušám nášym véliju mílosť."), ("Bohoródičen", "Nebésnych činóv", "Svjaťíjšaja svjatých vsích síl, čéstňijšaja vsejá tvári Bohoródice Vladýčice míra, spasí ny Spása róždšaja, ot prehrišénij tmoríčnych i bíd, jáko blahája, molítvami tvojími."), ) ) #let L = ( "B": ( ("", "", "Sňídiju izvedé iz rajá vráh Adáma: krestóm že vvedé Christós vóň razbójnika, pomjaní mja, Hóspodi, vopijúšča, jehdá priídeši vo cárstviji tvojém."), ("", "", "Umilénij istóčnik mí dáruj blahoutróbijem tvojím Christé Bóže, vsjákija mjá skvérny zól bezmírnych očiščájuščij, i cárstvija tvojehó blahoďíteľu pričástnika mjá sotvorí."), ("", "", "Ánhel tvojích číny v molénije privódim tí Christé, spasí, uščédri nás ťími, jáko prebláh, vsjá prezirájaj náša, jáže v víďiniji i ne v víďiniji, prehrišénija."), ("Múčeničen", "", "Krovéj vášich svjatíji tečéňmi, mýslennaho faraóna potopíste jávi: nýňi že istočájete čudés tóki, pučínu izsušájuščija nedúhov. Ťímže blažími jesté."), ("", "", "Otcú poklonímsja, i Sýna slavoslóvim, i vsesvjatáho Dúcha vsí vírniji vospojím, zovúšče i hlahóľušče: vsesvjatája Tróice, spasí vsjá ný."), ("Bohoródičen", "", "Róždšaja svít bezľítnyj, omračénnuju dúšu mojú prísno démonov prilóhi, svitovodí preneporóčnaja, i ohňá búduščaho chodátajstvy tvojími svobodí."), ) )
https://github.com/gumelarme/nuist-master-thesis-proposal
https://raw.githubusercontent.com/gumelarme/nuist-master-thesis-proposal/main/pages/cover.typ
typst
#import "/strings/en.typ" as lang #let default-label = ( title: lang.cover-title, student-number: lang.student-number, degree: lang.degree, school-name: lang.school-name, ) #let info(key, value) = { let info-key(body) = rect( height: 1.8em, stroke: none, inset: (x: 0pt, bottom: 1pt), text(weight: "bold", bottom-edge: "descender", body), ) let make-entry(body) = rect( height: 1.8em, width: 100%, stroke: (bottom: 0.8pt + black), text(bottom-edge: "descender", body), ) let value-entries = if type(value) == array { value } else { (value,) } let entries = value-entries.map(make-entry) let last-entry = entries.pop() return ( info-key(text(bottom-edge: "descender", key)), ..entries.map(b => (b, [])).flatten(), last-entry, ) } #let make-cover( label: default-label, student-number: "2023XXXX01", date: "2024 - 09 - 03", info-entries: (:), ) = [ #let label = default-label + label #let info-entries = lang.cover-entries + info-entries #block(width: 100%, height: 100%)[ #set align(center) #set text(size: 14pt) #text(weight: "bold")[ #label.student-number: #box( inset: (x: 10pt), outset: (bottom: 0.5mm), stroke: (bottom: 0.5pt), student-number, ) ] #v(3em) #block(width: 65%, clip: true, inset: (bottom: -20pt))[ #image("/assets/nuist-logo-text.png") ] #v(3em) #text(size: 18pt, weight: "bold", label.title) #v(2em) #box( width: 70%, grid( columns: (auto, 2fr), column-gutter: 1em, row-gutter: 0.2em, align: (right + horizon, center), ..info-entries.pairs().map(i => info(i.at(0), i.at(1))).flatten() ), ) #align( bottom, [ #label.degree \ #v(2pt) #label.school-name \ #v(2pt) #date ], ) ] ]
https://github.com/vEnhance/1802
https://raw.githubusercontent.com/vEnhance/1802/main/r09.typ
typst
MIT License
#import "@local/evan:1.0.0":* #show: evan.with( title: [Notes for 18.02 Recitation 9], subtitle: [18.02 Recitation MW9], author: "<NAME>", date: [1 October 2024], ) #quote(attribution: [Ozpin, in RWBY])[You brought your army to my kingdom, James. Use it.] This handout (and any other DLC's I write) are posted at #url("https://web.evanchen.cc/1802.html"). = Keep doing everything component-wise As I promised pretty much nothing happened yesterday and you still do everything componentwise. (Don't worry about Kepler's law.) There's one additional theorem you need. #thm[Arc length][ $L = integral_("start time")^("stop time") ||bf(v)(t)|| dif t$. ] = Preview of Thursday/Friday's lecture == Level curves replace $x y$-graphs In high school algebra, you drew 2D graphs of one-variable functions like $y = 2 x + 5$ or $y = x^2 + 7$. So it might have seemed a bit weird to you that in R01/R02, our planes were usually written like $2 x + 5 y + 3 z = 7$ rather than, say, $z = (7 - 2 x - 5 y) / 3$. But this form turned out to be better, because it let us easily access the normal vector (which here is $angle.l 2, 5, 3 angle.r$). We'll keep up this trend often with multivariate functions; prefer constant RHS's. That is, suppose we want to draw a _two_ variable function like $f(x,y) = x^2 + 3 y$. Either do a 2D level curve $x^2 + 3y = c$, or think of it as the 3D level curve $x^2 + 3 y - z = 0$. == Gradients There are two important pieces of philosophy. First: the goal of the first-order derivative is to approximate a function by a linear one. Second (from R01): _everything you used slopes for before, you should use normal vectors instead_. Here's how this plays out: - In 18.01, when $f : RR -> RR$, you defined a *derivative* $f'(p)$ at each input $p in RR$, which you thought of as the *slope* of the *tangent line* at $p$. Think $f(5.01) approx f(5) + f'(5) dot 0.01$. - In 18.02, when $f : RR^n -> RR$, you will instead define the *gradient* $nabla f(P)$ for each $P in RR^n$. (For _level-curve pictures_, this is a normal vector to the tangent line/plane/hyperplane.) So $nabla f$ carries much _more_ information: there are $n$ directions to move in. (To spell out type signatures: $nabla f$ is a function accepting points in $RR^n$ and outputting vectors in $RR^n$; $nabla f(P)$ is a vector in $RR^n$.) The *dot product* is now going to be really important.#footnote[You might have thought it was weird that back in R01 and R02, every time used the dot product $bf(a) dot bf(b) = |bf(a)| |bf(b)| cos theta$, there was almost always this "unwanted" absolute value that we would immediately strip off. But in the gradient, we'll actually use both the absolute values.] Here's how. - In 18.01, if you know $f(5)$ and $f'(5)$, then $f(5.01) approx f(5) + f'(5) dot 0.01$, because we think of $f'(5)$ as a slope ("rise/run") and $0.01$ as the run. - In 18.02, if you know $f(5,8)$ and $nabla f(5,8)$, then the analogy goes $ f(5.01, 7.996) approx f(5,8) + nabla f(5,8) dot angle.l 0.01, -0.004 angle.r. $ Yes, the dot is a dot product; both $nabla f(5,8)$ and $angle.l 0.01, -0.004 angle.r$ have type "vector in $RR^2$". This will take a lot of time to get used to, but everything afterwards depends on it, so do whatever you can to get this into your instincts. I'll draw you a picture next recitation. #figure( table( columns: 3, align: left, table.header([Thing], [18.01], [18.02]), [Function], [$f: RR -> RR$], [$f: RR^n -> RR$], [Differentiate], [$f': RR -> RR$], [$nabla f: RR^n -> RR^n$], [Think of as], [Slope (rise/run)], [Gradient (measures change in $n$ directions)], [Approximation], [Multiply by small run], [Dot product with small displacement] ), kind: table ) (In math-major classes like 18.100, the *total derivative* replaces the gradient. I don't know remember if total derivative appears in 18.02 as well, but if it does, I'll talk more about it.) == Advice for this week - Honestly, just ignore all this parametric stuff until MT2-ish, because basically nothing substantial happens (you just do everything component-wise) and also it won't be reused until after MT2. - *Start early on PSet 4B*, it's long and introduces a lot of new concepts compared to PSet 1-3. - *Skim through section 8 of Poonen* before Thursday and Friday lecture and thank me after. If you're seeing this stuff for the first time, it'll be almost impossible to keep up without pre-reading. = Recitation problems from official course / 1: (Example 10 from 12.5 of EP) A ball is thrown in the air from the origin in $x y z$-space. The initial velocity of the ball is $upright(bold(v)) (0) = 80 upright(bold(j)) + 80 upright(bold(k))$, measured in feet per second. The spin of the ball causes acceleration in the $x$-direction in addition to gravitational acceleration downward in the $z$-direction. The acceleration is constant: $ upright(bold(a)) (t) = 2 upright(bold(i)) - 32 upright(bold(k)) . $ Find $upright(bold(v)) (t)$ and $upright(bold(r)) (t)$. What is the speed of the ball when it hits the ground? / 2: Suppose a particle moves along trajectory $upright(bold(r)) (t) = angle.l t^2 , t^3 angle.r$ where $0 lt.eq t lt.eq 2$. Calculate the total distance travelled by the particle. Do the same for the trajectory $upright(bold(r)) (t) = angle.l 2 cos (3 t) , 2 sin (3 t) angle.r$, $0 lt.eq t lt.eq 2 pi$. In the second case, compare this with the length of the curve on the $x y$-plane. / 3a: Show that a particle moves at constant speed if and only if its velocity vector and acceleration vector are always perpendicular. / 3b: (from lecture) Suppose that the position vector and acceleration vector are always proportional to each other; show that $upright(bold(r)) (t) times upright(bold(v)) (t)$ is a constant vector.
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/visualize/line_03.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // // // Error: 14-26 expected relative length, found angle // #line(start: (3deg, 10pt), length: 5cm)
https://github.com/giZoes/justsit-thesis-typst-template
https://raw.githubusercontent.com/giZoes/justsit-thesis-typst-template/main/resources/utils/indent.typ
typst
MIT License
// 中文缩进 #let indent = h(2em) // 假段落,附着于 heading 之后可以实现首行缩进 #let empty-par = par[#box()] #let fake-par = context empty-par + v(-measure(empty-par + empty-par).height)
https://github.com/xdoardo/co-thesis
https://raw.githubusercontent.com/xdoardo/co-thesis/master/talks/thesis/main.typ
typst
#import "@preview/polylux:0.3.1": * #import "@preview/prooftrees:0.1.0" #import "@preview/tablex:0.0.5": tablex, rowspanx, colspanx #import themes.simple: * #set text(font: "Roslindale Deck") #show heading.where(level: 1): set text(font: "Roslindale Deck") #show heading.where(level: 2): set text(font: "Roslindale Deck") #show: simple-theme.with(background: rgb(255, 244, 233), foreground: black) #title-slide[ #text(size: 50pt, [*Program Transformations in the Delay Monad*]) #text( size: 20pt, underline([A Case Study for Coinduction via Copatterns and Sized Types]), ) #v(1em) <NAME> #text(size: 15pt, [_Università Statale di Milano_]) ] #set text(font: "EB Garamond") #show raw: set text(font: "PragmataPro Mono Liga", size: 20pt) #pagebreak() #align(center + horizon, [= Introduzione]) #slide[ == Contesto - Trasformazioni: - Funzioni con input e output listati di linguaggi di programmazione - Se input e output sono nello stesso linguaggio si chiamo _source to source_ - Altrimenti _source to target_ - Compilatori: - _Trasformano_ i programmi in input - Ottimizzano, riducono o modificano il listato del programma in input ] #slide[ == Contesto - GCC: decine di milioni di LoCs, \~30 ottimizzazioni - LLVM: centinaia di migliaia di LoCs, \~40 ottimizzazioni - Ottimizzazioni, passaggio critico: - Zhou, Ren, Gao and Jiang nel 2021 trovano \~57K bug in GCC e \~22K in LLVM - Yang, Chen, Eide and Regehr nel 2011 trovano input per cui alcuni compilatori generavano output sbagliato ] #slide[ == Contesto - Le trasformazioni non devono cambiare il significato del programma - Non basta la "buona fede" nel programmatore - E' necessario *dimostrare* che la trasformazione è _safe_ - Stato dell'arte: CompCert - Leroy et al - Compilatore C - 16 trasformazioni e 10 linguaggi intermedi - Ogni passaggio verificato formalmente in Coq, un proof assistant ] #slide[ == Contesto Dati: 1. Linguaggio di programmazione (e.g. C) 2. Trasformazioni sui programmi del linguaggio di programmazione Vogliamo: 3. Strumento formale per dimostrare che la trasformazione non cambia il _significato_ del programma 4. Mantenimento dei comportamenti _osservabili_: convergenza, I/O.. ] #align(center + horizon, [= Semantiche e comportamenti]) #slide[ == Semantiche - Strumento matematico per modellare il comportamento di un programma - Per i nostri obiettivi, secondo Leroy (co-autore di CompCert): *operazionale* *big-step*, simile ad un interprete che mette in relazione risultato finale e programma iniziale ] #slide[ == Comportamenti osservabili #v(20pt, weak:true) - Vogliamo modellare (tra i vari) anche *fallimento* (crash, e.g. divisione per zero, identificatore non inizializzato a runtime), e *divergenza* - Possiamo mostrare che se `p` diverge allora anche `t(p)` diverge e che se `p` fallisce anche `t(p)` fallisce, non solo che se `p` converge allora anche `t(p)` converge (allo stesso risultato) - Già fatto in letteratura, usando definizioni non equazionali e regole che portavano a dimostrazioni complesse - Scopo della tesi è farlo utilizzando un'unica semantica espressa come funzione che modella i tre comportamenti in maniera che faciliti le dimostrazioni ] #slide[ == Proof assistants #v(30pt, weak: true) - Uso generale: aiutare utenti a fare dimostrazioni, a volte in maniera (semi-)automatica - Sono anche linguaggi di programmazione: i tipi sono proposizioni e i termini sono dimostrazioni (corrispondenza di Curry-Howard) - Internalizzano una logica, ma per mantenere la consistenza della logica tutte le definizioni devono essere *terminanti* - All'interno possiamo definire la semantica come relazione (ad uso _deduttivo_) o come funzione (per _calcolare_) ] #slide[ == Effetti - Possiamo modellare i comportamenti come _effetti_ - Nei linguaggi funzionali gli effetti sono rappresentati tramite *monadi* - *Convergenza* l'interprete produce un risultato - *Fallimento* monade `Maybe`, effetto del fallimento - *Divergenza* (da Capretta: _"divergence is an effect"_) monade `Delay`, effetto della divergenza ] #slide[ == Effetti - La semantica è espressa come un interprete che avrà una segnatura simile a #align(center, ```hs eval : Program -> Store -> Delay (Maybe Store)```) - `Maybe` è un tipo induttivo, i valori di tipo `Maybe A` sono oggetti (matematici) finiti - `Delay` deve rappresentare valori infiniti e non può essere induttivo #box( width: 100%, inset: 10pt, align( center, [serve uno strumento matematico che permetta di formalizzare oggetti infiniti], ), ) ] #align(center + horizon, [= Coinduzione e Agda]) #slide[ == Coinduzione - Duale all'induzione - Molte interpretazioni: categorie, linguaggi formali e automi, punti fissi.. - In generale, se l'induzione definisce l'insieme più piccolo che soddisfa un insieme di regole, la coinduzione definisce l'insieme più grande - Esempi di definizioni coinduttive sono stream, parole finite ed infinite in un linguaggio formale, alberi infiniti... - Induzione richiede terminazione, coinduzione richiede *produttività* ] #slide[ == Agda - Proof assistant e linguaggio di programmazione (non general-purpose) - Infrastruttura migliore per la coinduzione tra i proof-assistant maturi attualmente - Vari approcci per gestire la coinduzione: _musical notation_, _guardedness_ e *size-types* - Terminazione e produttività sintattiche - _size_ è un numero naturale associato ai tipi, controllo terminazione e produttività nel type system ] #align(center + horizon, [= Sviluppo formale]) #slide[ == Linguaggio e semantica - *Imp* è un linguaggio imperativo molto semplice ma Turing-completo #box( width: 100%, stroke: 1pt, inset: 10pt, radius: 4pt, )[ #set text(size: 15pt) #grid( columns: (65pt, 30pt, auto), row-gutter: 10pt, [*aexp*], $:=$, $n | id | "plus" a_1 a_2$, [*bexp*], $:=$, $b | "le" a_1 a_2 | "and" b_1 b_2 | "not" b$, [*comm*], $:=$, [skip | assign $id$ $a$ | if $b$ then $c^t$ else $c^f$ | seq $c_1$ $c_2$ | while $b$ do $c'$], ) ] - Semantica -- `Store` rappresenta la memoria durante l'esecuzione #align( center, ```hs ceval : ∀ {i} (c : Command) -> (s : Store) -> Delay (Maybe Store) i```, ) #box( width: 100%, inset: 10pt, align(center, [`ceval` è *un'unica funzione* e modella tutti e tre i comportamenti]), ) ] #slide[ == Trasformazioni - Un'analisi e una trasformazione - _Definite initialization analysis_: controlla se vengono utilizzate variabili inizializzate - _Constant folding_: esegue calcoli staticamente prima dell'esecuzione del programma ] #slide[ == Definite initialization analysis #v(20pt, weak: true) #block( width: 100%, stroke: 1pt, radius: 4pt, inset: 10pt, )[ *Teorema* Per ogni comando `c`, per ogni insieme di variabili `v` e `v'`, per ogni store `s`, se vale `Dia v c v'` e `v ⊆ s` allora l'esecuzione di `c` diverge o converge, ma non fallisce. ] In Agda: ```hs dia-safe : ∀ (c : Command) (s : Store) (v v' : VarsSet) (dia : Dia v c v') (v⊆s : v ⊆ dom s) -> (h-err : (ceval c s) ↯) -> ⊥ ``` ] #slide[ == Constant folding - E' una trasformazione, quindi una funzione che opera sugli elementi sintattici di Imp - In Agda: #align( center, ```hs cpfold : (c : Command) -> Command``` ) - Vogliamo dimostrare che `cpfold` non cambia la semantica del programma ] #slide[ == Constant folding #v(20pt, weak: true) #block( width: 100%, stroke: 1pt, radius: 4pt, inset: 10pt, )[ *Teorema* Per ogni comando `c` e per ogni store `s`, la valutazione di `c` in `s` è _uguale_ alla valutazione di `(cpfold c)` in `s`. ] In Agda: #align(center, ```hs cpfold-safe : ∀ (c : Command) (s : Store) -> ∞ ⊢ (ceval c s) ≋ (ceval (cpfold c) s) ```) ] #align(center + horizon, [= Conclusioni]) #slide[ == Semantica, delay e size - Abbiamo definito la semantica come un'unica funzione che modella i tre effetti - Abbiamo usato il tipo coinduttivo `Delay` utilizzando il type system come termination checker grazie alle size - Abbiamo dimostrato che le trasformazioni che abbiamo scelto non cambiano la semantica del programma ] #slide[ == Lavori futuri - Modellare altri effetti: I/O, altri tipi di fallimento - Considerare linguaggi più ampi - Implementare trasformazioni più complesse ]
https://github.com/pascalguttmann/typst-template-report-lab
https://raw.githubusercontent.com/pascalguttmann/typst-template-report-lab/main/README.md
markdown
MIT License
# typst-template-report-lab Typst template for lab reports in laboratories. To initialize a new report locally use `init.sh`, which will copy the template of the report to the specified path. ```bash ./init.sh <path> ```
https://github.com/optimizerfeb/MathScience
https://raw.githubusercontent.com/optimizerfeb/MathScience/main/게임 인공지능 속의 수학.typ
typst
#set text(font: "Noto Serif KR") #align(center, text(17pt)[ *게임 인공지능 속의 수학* ]) #align(right, text(10pt)[ 한남대학교 수학과 20172581 김남훈 ]) = 1. 게임에서 인공지능의 역할 게임 속 세계는 크게 플레이어와 NPC, 그리고 그들이 위치하는 맵으로 구성된다. NPC는 적대적 NPC(일명 몬스터)와 비적대적 NPC 가 존재하는데, 이들은 인공지능에 기반해 행동한다. 인공지능이 없다면 이들 NPC는 한 자리에 가만히 있으며 플레이어와 어떤 상호작용도 하지 않을 것이다. 이들이 움직이게 하고, 플레이어를 공격하거나 플레이어에게서 도망치게 하는 등 다양한 행동을 부여하는 것이 바로 인공지능의 역할이다. = 2. 방향 그래프와 오토마타의 간략한 설명 게임 속 인공지능을 구현하는 기술은 크게 둘로 나눌 수 있다. 퍼셉트론과 유한상태기계가 그것인데, 여기서는 유한상태기계만을 다룰 것이다. 유한상태기계를 이해하기 위해 필요한 두 개념을 먼저 이야기해보자. 첫째는 방향 그래프이다. === 방향 그래프 방향 그래프는 간단히 말해 각 변에 방향이 정의되어 있는 그래프이다. $V$가 그래프 $G$ 의 정점이라 하자. $G$ 가 변 $(x, y)$ 를 갖는다면 $x$ 에서 $y$ 로 가는 길이 $1$ 인 경로가 존재하지만, 변 $(y, x)$ 를 갖지 않는다면 에서 $y$ 로 $x$ 가는 길이 $1$ 인 경로는 존재하지 않는다. 방향이 없는 그래프에서 $(x, y)$ 와 $(y, x)$ 를 구분하지 않는 것과 대비되는 방향 그래프의 특성이다. === 오토마타 오토마타는 주어진 입력과 현재 상태에 따라 자신의 상태를 변화시키는 가상의 기계이다. 오토마타는 자신이 가질 수 있는 상태들의 집합 $V$ 와 받을 수 있는 입력의 집합 $Sigma$, 그리고 각 상태에서 특정한 입력을 받았을 때 어떤 상태로 변화하는지를 나타내는 함수 $delta : Q times Sigma arrow.r Q$ 로 이루어진다. 이 때 $Q$ 와 $Sigma$ 가 유한집합이라면, 처음 상태 $q_0 in Q$ 와 최종 상태(몬스터의 경우 죽음) $q_(omega) in Q$ 을 포함한 $ cal(A) = (Q, Sigma, delta, q_0, q_(omega)) $ 을 *유한상태기계* 라고 한다. = 3. 유한상태기계를 이용한 게임 인공지능 #figure(image("images/몬스터 인공지능.svg", width: 90%), caption: [몬스터의 인공지능 예시]) 게임 속 간단한 몬스터를 상상해보자. 이 몬스터는 평상시엔 맵을 돌아다니다, 플레이어를 발견하면 플레이어를 공격한다. 그러다 체력이 $10%$ 미만으로 감소하면 플레이어로부터 도주하며, 플레이어가 시야에서 벗어나면 다시 맵을 돌아다닌다. 그리고, 어떤 상태에서든 체력이 $0$ 이 되면 죽는다. 이를 다이어그램으로 나타내면, 위의 그림과 같을 것이다. 이 때, 정찰, 전투, 도주, 죽음은 각각의 상태가 되며 '체력이 $0$이 됨', '플레이어 발견', '플레이어 놓침', '체력이 $10%$ 미만' 은 각각의 입력이 되어 다음과 같은 표로 함수 $delta$ 를 나타낼 수 있을 것이다. #figure( table( columns: (auto, auto, auto, auto, auto), [$delta$], [플레이어 발견], [플레이어 놓침], [체력이 $10%$ 미만], [체력이 $0$ 이 됨], [정찰], [전투], [정찰], [정찰], [죽음], [전투], [전투], [정찰], [도주], [죽음], [도주], [도주], [정찰], [도주], [죽음], [죽음], [죽음], [죽음], [죽음], [죽음] ), caption: [인공지능의 상태 변화를 표로 나타내기] ) 유한상태기계의 장점은, 각 상태에서 NPC 의 구체적인 행동(이동, 공격, 스킬 사용 등) 을 디자인할 때, 다른 상태를 고려할 필요가 없어져 설계가 단순해진다는 것이다. 이와 같이, 수학을 이용하면 게임 인공지능의 구현을 단순화할 수 있다. = 참고문헌 #set text(size: 9pt) <NAME>(2023) 『Introduction to the Theory of Computation』 CENGAGE Learning. <NAME>(2010) 『Graph Theory』 Springer. <NAME>(2010) 『Game Programming Algorithms and Techniques』 Addison-Wesley.
https://github.com/engboris/cv-template
https://raw.githubusercontent.com/engboris/cv-template/main/icons.typ
typst
MIT License
#let fa(name) = { text( font: "Font Awesome 6 Free Solid", size: 11pt, box[ #name ] ) } /* To add new icons, go to https://fontawesome.com/ then search for the unicode value of your icon. */ #let fa_github = symbol("\u{f09b}") #let fa_email = symbol("\u{f0e0}") #let fa_website = symbol("\u{f0ac}") #let fa_phone = symbol("\u{f098}") #let fa_linkedin = symbol("\u{f08c}")
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/024%20-%20Shadows%20over%20Innistrad/002_A%20Gaze%20Blank%20and%20Pitiless.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "A Gaze Blank and Pitiless", set_name: "Shadows Over Innistrad", story_date: datetime(day: 09, month: 03, year: 2016), author: "<NAME>", doc ) #emph[Innistrad has entered a new age of prosperity and peace. Avacyn, a powerful angel who is the living embodiment of hope and protection for humans everywhere, is free from her imprisonment and has helped the humans beat back the evil horrors that lurk within Innistrad. The vampires are in retreat, and the werewolf curse has been alleviated by the Cursemute, a magical edict from Avacyn that gave afflicted lycanthropes the choice either to become wolfir, wolven servants of Avacyn, or, in rarer cases, to be fully cured.] #emph[The people of Innistrad prosper and thrive under the benevolent and caring eye of Avacyn, working toward establishing a permanent new dawn for humans...] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The prayers of ten thousand souls washed over Avacyn like a misty rain, a pleading susurrus of hope and fear. #emph[Avacyn watch over my children, Avacyn make my crop strong, Avacyn the pain make it stop, Avacyn grant him a clean death, Avacyn...] #figure(image("002_A Gaze Blank and Pitiless/01.jpg", width: 100%), caption: [Avacyn, Angel of Hope | Art by Jason Chan], supplement: none, numbering: none) She hovered in the thin cold air, air so thin her wings would have been insufficient to keep her aloft without the aid of power. It was one of her favorite retreats, a desolate valley in the highest mountain passes in southern Stensia. The cold was absolute at this height. Thick frost covered every surface, permitting no life to abide. Avacyn did not feel the cold. She appreciated the solitude, the purity of wide space with nothing for company but the crackling ice, the whistling wind, and the whispers of prayers. The prayers were always present, a constant insistence in the back of her mind. From the briefest moments after her awakening, the prayers were there. They were few at first. Small, tentative, searching. But over time the number of prayers grew, and they became more direct, more beseeching. #emph[Protect us, save us, help us.] #emph[Help me! ] A panicked prayer broke through the normal murmurs. A woman's voice, a woman in pain. #emph[Avacyn hear me! My child! My child! Please! My Avacyn! ] Avacyn focused on the prayer, on the woman sending it to her, and saw an image of the woman running and sobbing in the middle of a large meadow. Avacyn soared above the mountaintops and swooped down to the south toward Gavony. Though she heard thousands of prayers throughout the world, she rarely had time to address them individually. From the beginning of Avacyn's existence had been the word PROTECT. Even now, thinking of it triggered the cascade of images that had accompanied her first moments of existence. A flash of a world draped in autumn and blood, and the numerous predators poised to ravage it. Vampire and werewolf. Demon and zombie. Geist and devil. Each one seared into Avacyn's mind, into her very identity, as a threat to be fought and scoured. And the images of the mortals in all their shapes and sizes, their humanity defined by their frailty and their devotion. PROTECT. And over time, Avacyn's understanding of the word grew, became more nuanced. PROTECT THEM. This concept was Avacyn's essence. #figure(image("002_A Gaze Blank and Pitiless/02.jpg", width: 100%), caption: [Archangel Avacyn | Art by <NAME>], supplement: none, numbering: none) With each passing year, the purpose of her existence had unfolded in crystalline beauty. She was not meant to fight every monster, to stop every evil. Such work would have been impossible. Instead she led and inspired, bolstering the faith of countless humans, that faith in turn bolstering the wards and charms humanity used as protection from the predations of evil. There were occasions when Avacyn would fight, when some intractable or powerful evil would demand her personal attention. But there were always too many fights, too many prayers, for Avacyn to respond to every one. But occasionally a prayer would break through to Avacyn, a prayer imbued with such fervent faith or desperation that Avacyn felt a #emph[pull ] to help. Early in her existence there had been little conscious intent to this #emph[pull] ; she just knew she must intervene personally in certain events. But over the centuries she had gained more control over when and where she involved herself. The power of this mother's prayer, her shattering panic rising to a crescendo of need, reached Avacyn. The mother's fear for her child was pure and unalloyed, and such purity compelled direct action from Avacyn. Avacyn sped through the lower mountain valleys of Stensia, tracing an unerring path toward her petitioner, the strength of the woman's prayer a bright beacon in Avacyn's mind. The cloak covering the mountains changed from snow to trees, from the tyranny of endless white to the mélange of green, brown, and orange heralding the coming of the harvest moon. Avacyn was not prone to reflection, but she could not help feeling satisfaction at all that had been wrought since her release from the Helvault. The werewolves were gone, some cured and others transformed into the wolfir, helpful allies for Avacyn and her angels. The devils and demons were scattered and ineffective. And for the one of the few times since Avacyn's awakening, the vampires were in retreat. Humanity was free of its long siege of darkness, and civilization flourished. It was a new era for the humans. It was a new era for the world. And Avacyn would be there, continuing to protect the humans and protect the world, as she always had. Avacyn did not like smiling—she had never understood the point of it—but she suspected this is what humans felt when they smiled. A deep and abiding satisfaction. It felt...correct. #figure(image("002_A Gaze Blank and Pitiless/03.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Avacyn noted the wan light from the sun, soon to fall below the forested horizon. Night would rise shortly. As she alit upon a sparse meadow outside of a dark forest, she saw a woman lying on the grassy slope outside the first ring of trees, sobbing and crying out a name. "Maeli! Maeli!" The woman stood and walked toward the forest as Avacyn landed. "Petitioner. You have called me." Avacyn's tone was calm, reassuring, but the woman turned in a sudden terror before recognizing what she was seeing. "Avacyn! You came! You came! My child! Please!" The woman was frantic, and it took time for her to calm herself and tell Avacyn what had occurred. Her child had run away from home, and had been seen running off into the forest. While the world was much safer since Avacyn's return, it was still not a safe world. Especially for children. The mother had been about to brave the forest herself for her child, though she risked death for both of them. Avacyn assured the mother she would try to find the child. Such a matter would have been trivial if the child had been praying to Avacyn. But as Avacyn turned her focus to the hundreds of prayers currently whispering in her head, none of them were from a child lost in a forest. Still, there were other ways to find the child. #figure(image("002_A Gaze Blank and Pitiless/04.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Avacyn flew over the dark forest until she approached its center. She channeled her power up through her spear, and its metal blade glowed bright. Brighter, brighter, until the light eclipsed the setting sun, and Avacyn channeled even more power, lighting up the whole sky above the forest. Avacyn could hear birds caw and animals skitter and even larger things thump below the forest canopy, all to get away from the bright light. Avacyn projected power into her voice. "Maeli! It is Avacyn! Call to me!" Her voice boomed and echoed off the trees throughout the forest. Then Avacyn was silent. She listened for a child's cry, and hoped for anything but silence and what that silence might herald. No voice reached out from the forest canopy, but a prayer did. #emph[Avacyn, please, I'm lost, and I'm sorry, and I'm wet, and I heard...] Avacyn fixed the location of the child in her mind, and swooped over and down to a spot in the forest a few minutes away. It was a small child, a boy, and he was huddled in the crook of a tree. The boy looked at her, and at her glowing spear. "Avacyn?" "Child, come to me. You are safe now. I will get you home." Avacyn's voice was even softer now, the softest she could make it. Avacyn had always been most comfortable with children. Their innocence, their earnestness, made them easier to comprehend. The boy approached her, his hesitation overcome as Avacyn put her spear to one side and welcomed him with her other arm. He ran to her and she gathered him up in her arm and flew out of the forest. It took only moments for her to find the mother on the outskirts of the trees and give her the child. Both mother and child sobbed as they hugged each other. Avacyn wished every moment of every day was this. Families rejoined. Fear erased. Happiness created. This is why she was. Satisfied her work was done, she began her ascent back to her mountainous retreat. A violent #emph[shimmer ] wracked her body, shaking her vision. Everything in front of her doubled. The trees, the mother and child, each blade of grass. Doubled, and then doubled again. A pounding ache ran through her head and she dropped to the ground, crumpled in pain. A field of white flashed through her eyes, followed by an image of many floating stone obelisks with intricate runes carved into their sides, moving in concert with each other...and then a normal scene resumed in front of her. Avacyn whipped her gaze around to identify the source of the attack. Few vampires had ever been powerful enough to launch such an assault. A demon lord, perhaps... There was a soft buzzing in her ears. A constant low hum that neither raised nor lowered in volume. It was just...there, an off-tonal accompaniment to the prayers whispering in her head. The back of Avacyn's neck felt tight, and occasional involuntary shivers would shoot up from her neck through the rest of her head, as if in alarm to an attack. But no attack came. She shook her head in the hope it would clear the buzzing, but it remained in the back of her thoughts. The two humans still huddled in front of her, clutching each other, seemingly immune to whatever had struck Avacyn. As Avacyn watched, the mother's tears evaporated, her soft face hardened with anger. "How could you run away like that? What were you thinking? You stupid child!" She pushed the child away from her violently. The small human's face crumpled up in fear, and he started bawling. #emph[The seeds of men are rotten. ] Avacyn did not know where the thought came from. It was like a prayer, a missive sent directly to her head, though no mortal had uttered it. #emph[The seeds of men are rotten.] Avacyn peered closely at the child, and where once she had seen innocence, she now saw other details. The poxed skin, the snotty nose, the scabs and crust of organic decay. The sniveling face in plaintive need of reassurance after committing wrong. She looked back to the mother, that angry face already softening and seeking to reassure her wailing child. #emph[These mortals travel from anger to guilt and back again, and what is ever accomplished? ] Avacyn looked at the child, its wailing unabated. #emph[How short these mortals live.] Today this was the small form of a child. Tomorrow it would be a man, dirty, uncouth, prone to anger and cruelty. The day after its flesh would be wriggling worms, worms writhing in the dust... #figure(image("002_A Gaze Blank and Pitiless/05.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Avacyn stumbled away, her balance off, her mind fuzzy. She took flight, weaving back and forth into the sky with an unusual lack of grace, leaving both humans below. She sought to hear prayers, but coating every word was the buzzing. She could not make out the prayers over the constant noise. Instead she came back to the same words again and again, plunged into her brain like a spear. #emph[The seeds of men are rotten.] Avacyn fled, seeking refuge from her own mind. It was nowhere to be found. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Macher paced the cloistered courtyard in the inner sanctum of the church, an acid unease gnawing his stomach. The courtyard was normally a place of serene comfort for him. A lush, beautiful garden where he could retreat away from the world's horrors and pain, especially in the cool dark night when no other priest walked its paths. But when the pain was inside the soul, no place offered succor. Macher stopped his pacing underneath Avacyn's silver symbol, mounted on a long iron pole at the center of the courtyard. Under the deep orange light of the late harvest moon, the pointed edges of Avacyn's silver symbol seemed poised to drip and splash into the mossy ground below, a neat moonlight illusion. Macher's mind returned often to the nature of illusions. #emph[Avacyn is real, isn't she?] Macher had no doubt Avacyn existed, of course. He had seen her, had seen her angels. That Avacyn was real was not in dispute. #emph[But is she worthy of worship? Is she our god?] Those thoughts he could not escape. #figure(image("002_A Gaze Blank and Pitiless/06.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) He had been a true believer for most of his life, still just a toddler when his family had abandoned him at the door of the local parish, a fate of many a young child in this corner of Gavony. He had been fed by the church and clothed by the church and protected by the church, introduced to the doctrine of Avacyn before he could even read. The doubts had started last year, when Avacyn had mysteriously disappeared. It had been a grim time, the horrors of the world pressing upon Gavony and almost overrunning it. Macher had known Mikaeus, the former lunarch, and the night he had seen Mikaeus as a zombie had been the worst of his life. But then Avacyn had returned, and Gavony was now as safe as it had ever been. Safer. So why should doubt arise after triumph? The rumors had run rampant through the clergy that Avacyn had been entrapped, imprisoned in the very Helvault in which so many creatures of darkness had been sealed away. The priests spoke of miracles, of Avacyn's power breaking her free from the prison, bringing a new era of light to the world. But how could a god ever be imprisoned in the first place? A prayer occurred to him unbidden, and he gave a rueful smile. #emph[Avacyn, please exist. Please be true. ] The full orange moon glowed in the crisp night air. Avacyn's symbol was completely framed by the moon, and the symbol seemingly shimmered and twisted under the orange light. Macher watched, transfixed, and lost himself in the moon's soft glow. There was a beating of wings behind him. Macher whirled, his mouth agape, and saw an angel descend. Striking white eyes rimmed with black, large lustrous wings, silver-white hair tinged with orange and red hues from the moonlight. A long moonsilver spear, glowing deep white with sparks of red at the tip, held in her hands. Avacyn. It was Avacyn herself, descending into the courtyard. She landed, her wings folding behind her, and she stared at Macher. He had never seen her eyes before. Ivory-white irises, but the black frames surrounding the iris caught his attention and did not let go. The black deepened, spread, inky pools dancing, a growing chaos that... "Do you hear the bees? Do you hear their cries?" Avacyn's words tumbled from her mouth in a rush, breaking the spell of her eyes. Her gaze darted frantically from one side of the courtyard to the other. Macher did not understand what she referred to, nor why she appeared anxious. "Avacyn, you came! You are here!" he blurted out. He was overcome with relief. He had prayed to Avacyn and now she was here before him. He felt ashamed at his doubt in his god. #emph[She is here to lead me back to the light, to truth.] Avacyn's face changed. She stopped looking from side to side and focused on Macher instead. "You prayed for me to come." Her voice was cold, crisp, snapping him to attention. "You prayed #emph[to] me. You prayed to me because you doubted." There was a scratch to her voice now, a pause before some words as if she was listening for something, or to something. She raised her spear. "There are other ways of ending your doubts." Her lips turned upward, trembling, an awkward mockery of a smile. Macher shivered in the darkness, looking past Avacyn at the moon and its bright orange light, wishing he were somewhere else. "Are you pure?" Her words flowed like honey. "I...what?" Macher did not understand. Many times he had envisioned meeting Avacyn. Never had he imagined an interaction like this. "Are. You. Pure?" Now each word clear and sharp as crystal. "Yes! I am pure!" Macher was relieved. His god was angry with him. She should be. He had doubted, but now his doubts were gone. "Pure in my..." Her words overtook his, left them no room to be heard. "Of course you are not pure. How could you be? You were #emph[born] ." The scorn in her voice as she said the last word was unmistakable. She looked into his eyes, and he once more saw an inky blackness welling up, an endless blackness threatening to swallow him whole...he became dizzy, and almost stumbled to the ground, losing sight of her eyes, and the dizziness passed. He stood back up, careful not to look directly at her. #emph[You are not meant to gaze upon divinity.] "Have you lost faith in me so easily, mortal?" Avacyn's lips quirked in a way that would have been a sneer on a human. Macher sputtered, unable to form coherent words in reply. She continued, ignoring him. "The more interesting question is..." she paused, and looked up at the dim night sky as if the moon were speaking to her, "...have I lost faith in you?" As she said the word "you," she looked directly at him. He wanted to scream, but no words would come. A wet stream flushed down his leg, puddling at his feet. Terror overtook him, and he crumpled to the mossy ground, clutching himself with eyes shut tight. Even through his fear and closed eyes, he could sense a luminescence drawing close. A chill shook his spine and he screamed. The scream subsided, and he heard a whispered "Soon," as a light, feathery touch brushed his face. A flapping of wings, and the luminescence vanished. It was a long time before he opened his eyes. He lay there huddled through the night, cloaked in terrifying certainty about the nature of his god. #figure(image("002_A Gaze Blank and Pitiless/07.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) Liont woke up to the beautiful winter sun. Its faint light streamed onto his face, insisting upon his wakeful attention. Normally the shutters were closed to prevent such an early awakening, but he had forgotten to close them last night. One of the wooden shutters hung askew. #emph[I'll have to fix that later.] He asked his wife how she slept last night, but she did not answer. She had stayed up late. It was unusual for him to be the first one up, far more common for Hilde to be caressing him awake or the children's squabbling voices to usher him into the morning. He came to his feet, shrugging off tattered and torn bed sheets. He had a full day's work ahead of him, and he wanted to start. His business was booming—never had his smithing been in more demand. He was at the forge or anvil for most of the day, and he was likely going to take a second apprentice soon. Ever since Avacyn's return last year, the demand for new tools and plows was high. And ever since the Cursemute, Liont was able to satisfy that demand. The Cursemute. Everything had changed with the Cursemute, a blessing wrought by Avacyn's magic. Some werewolves had been transformed into wolven servants of Avacyn, the wolfir. But Liont had been cured entirely, and he said his blessings to Avacyn every day. He was back with his family, back in his home. Able to travel to the town, and look people in the eye, and know no fear. The absence of fear was wonderful, the absence of dread and worry and weight, no more constant gnawing clutching at his insides. No more staring up at the moon, wondering if night would bring the darkness, the true darkness. All dissipated into the light, thanks to Avacyn's benevolent power. He had a #emph[life] again. A life with his family. #figure(image("002_A Gaze Blank and Pitiless/08.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) He dressed, picking up scattered clothes from the floor. #emph[Some of these need mending.] #emph[I'll give them to Hilde tonight. ] He went back to Hilde to wake her up. She was groggy, barely stirring, and her speech was still faint and wispy from sleep. "Good morning, husband." Hilde's mouth was still and small. Liont wanted to tell her a joke, to see her beautiful smile, but Hilde did not have the best sense of humor in the morning. "I'm going outside to the smithy, I need to get the plow started for Nickers. The children are still asleep." Hilde didn't reply. "Are you all right, dear?" He peered closer. Hilde's voice was still soft, faint. "The poxes are out in bloom." Liont was glad she was awake. "Good, darling, good. I'll be back at midday for lunch." Her voice was louder, colder. "Liont. When the door is knocked, do not open it." A shiver went down Liont's spine. #emph[When the door is...] but he brushed the thought away. Hilde had already returned to sleep, lying motionless on the torn bed. #emph[She must have been up very late.] He went to the bed of his children, stepping over shards of wood and glass, hearing them crunch beneath his feet. #emph[When Hilde wakes up she will not be happy with this mess. I will sweep it up later today.] He stopped first at the prone form of Talia. She did not stir, her normally bright eyes, so joyful to see him, closed at rest. He shook her gently and her eyes opened. "Good morning, father." Her voice was listless, dull. #emph[She must be so tired. I will let her rest.] "Go back to sleep, my daughter." He bent down and kissed her, his warm lips on her cool forehead. "Father. When the door is knocked, do not open it." Her words picked up strength. She sounded scared. When he rose up from kissing her forehead, she had already fallen back asleep. Liont realized he was scared, too, but put it aside. It was strange to feel fear on a bright winter morning, with the sun pouring through broken windows and large rents in the walls. #emph[It is cold in here. I'll have to board up those holes.] He tarried briefly on the other side of the bed to say goodbye to his son. Kan was a few years younger than Talia, the perfect age to want to do all the things his older sister did, but do them in a way that infuriated her. Most days at this time he would already be running around the house, bouncing off the walls until his mother let him go outside to play in the fenced yard between the house and the smithy. But this morning he just lay quiet and still. As Liont stood there staring at his sleeping son, the boy's eyes flew open. "Good morning, father." Liont could barely hear him, the voice was so faint. Liont wondered if the boy was sick, if he needed a healer... "Father. When the door is knocked, do not open it." The boy's eyes were shut again, and Liont noticed how quiet the room was, silent except for the sound of a single person's heavy breath. Despite all the sunshine and chill wind whistling through the gaping rents in the walls, Liont felt stuffy, a pressure in his head that would not leave. Liont bowed his head under the aching pressure. The room was suffused with a coppery, bitter scent. He had to get out of the house. Three voices cried out in his bowed head, "When the door is knocked, do not open it!" There was a knock at the door. Liont lifted his head. He looked at the door. Except there was no door. Where the door usually stood, there was only empty sunlit air. #emph[When the door is knocked, do not open it. ] Not only was the door gone, but the hinges were twisted and bent. #emph[I'm going to have to forge new hinges. But first I have to get started on Nickers's plow and then...] There was another knock at door. A heavy thudding echoed throughout the room. #emph[When the door is knocked] ...Liont looked again at the open space where the door once stood. Something was wrong. Why was his house a shambles? #emph[I don't have time to clean this up right now. I have to get to the smithy. ] More knocking. #emph[Thud. Thud. Thud.] #emph[How can there be knocking? There is no door. ] Pain blossomed in his head, pain so bright and fresh he sank to his knees with the force of it. As he closed his eyes tight he saw a bright door in his mind, a bright door pulsing with red. He heard more knocking, more heavy thudding, and it was coming from behind the red door, the door in his mind. He just had to open it, to stop the knocking. Everything would be all right if the knocking stopped. He reached out a hand in his mind to...#emph[do not open it.] Liont grabbed the handle of the door inside his head. The handle was metal and ice cold. He pushed down on the handle, but it did not want to turn. He pushed, his hand hurting from the cold, and pushed again, growling. The handle turned. Liont opened the door. Suppressed reality burst forth into vision. He saw what was behind the door. #emph[No no no no no no] ...still on his knees, he rocked back and forth, clutching his head in grief and rage. Blood was everywhere. On the walls, the bed, the floor. His hands and body were covered in it, the blood leaking through the torn clothes he had put on minutes before. He looked at the body of Hilde, her face frozen in terror as she lay unmoving on the bed. #emph[Who had done this? ] He knew who had done this. Feverish images rose in his mind. The snarling, the screams, the claws raised high in the moonlight...he lifted his head and howled his agony into the cold winter sun, the sun that followed the hunter's moon. #figure(image("002_A Gaze Blank and Pitiless/09.jpg", width: 100%), caption: [Art by Daarken], supplement: none, numbering: none) #emph[The Cursemute. What happened to the Cursemute? ] What he had done should not have been possible. He was free of the curse. #emph[Free!] He snarled a prayer to the air, #emph[Avacyn! Why have you forsaken me! Avacyn!] He knelt there sobbing for a long time. He wanted to die. He wanted his family back. He wanted to hear the laughter of Talia and Kan. He wanted to hear them fighting. He wanted it to be yesterday again. #emph[Please, let it be yesterday. Let me go to sleep and wake up in yesterday. I will wake up and I will leave. I will leave and never return. Just let it be yesterday, let] ...the roof of his house exploded overhead. Liont looked up, staring at the figure hovering above him, a figure with wings and silver hair and a large, glowing spear. #emph[Could it possibly be...? Could she possibly be able to...?] His voice croaked with pain, the words barely able to form, "Please...please." The angel, perhaps it was Avacyn herself, did not respond, did not even seem to hear him speaking. She pointed her spear at him, and the tip grew bright, brighter, brighter than the sun overhead, and a lancing energy struck him in the chest, burning away clothes and skin. #figure(image("002_A Gaze Blank and Pitiless/10.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) He screamed in agony even as he welcomed the pain. #emph[This is what I deserve. ] But still, maybe the angel could save his family. His vision dimmed. He had to... "Mercy, please, mercy for..." his mouth stopped working, his lips stopped moving, and his plea continued in the growing darkness of his mind. ...#emph[for my family. For my beautiful family. Please. They deserve...] The angel pointed her spear at him again. Her lips turned up as she spoke the last words Liont ever heard. "Justice! There is no mercy." The spear flashed. #emph[Mercy] , Liont thought, and then he died. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) #emph[A storm is coming] , Sigarda thought. Lightning flashed in the dark gray sky, but no thunder ever came. It was unusual to see a storm in the middle of the cold winter, the season dominated by the hunter's moon. The air had hung heavy for days, the gray clouds unmoving, and now there was lightning without thunder, a storm without rain. Sigarda looked out over large swaths of the forest and was uneasy. #figure(image("002_A Gaze Blank and Pitiless/11.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) She hovered in her personal solar, the bare stone walls and four thick buttresses in sharp contrast to the open vistas of dark green forests sprinkled with patches of white snow. Sigarda could see for miles in every direction and often spent long stretches here when seeking quiet contemplation. The solar was at the top of a long-abandoned tower in a Kessig forest, a tower built centuries ago when humans had been more ambitious. They had become ambitious again. Avacyn's return last year had ushered in a new era of peace and tranquility. Humans had been spreading out across the land again, building new homes and farms and towns. But in the last several weeks, troubling reports had sprung up across the land. Uprisings and disappearances and slaughters. A shadow had risen over the world, and Sigarda wanted to know why. A lightning flash lit the dark sky, and another, and in between the flashes of lightning she felt her sisters' approach, and moments later they landed in her sanctuary. Slight Bruna, dressed in blue and white light armor with a flowing silk cloak trimmed in red lace. She wielded her staff, and its tip was already glowing with power, as if to strike down an enemy. Tall Gisela, cloaked in the red and white of her Goldnight flight, her twin blades already out of their sheaths. #emph[They are prepared for battle] , Sigarda thought. She thought then of their other sister, the one who had died a thousand years ago, and she shivered. #figure(image("002_A Gaze Blank and Pitiless/12.jpg", width: 100%), caption: [Bruna, Light of Alabaster | Art by <NAME>], supplement: none, numbering: none) "Hello, my sister," Bruna said, an odd lilt in her voice. "You did not respond to our summons," Gisela said. Sigarda had not regarded it as a summons. An angel from the Goldnight had requested that she visit Gisela a week past, but Sigarda had been busy helping the communities of inner Kessig rebuild. "I was occupied with other duties, sister. I did not realize there was an urgent matter. How may I help?" Sigarda wondered if there had been an attack on the angels. It could explain why Bruna and Gisela seemed on edge. "It is no matter, now," Gisela said. "We are here," Bruna said. When the two angels had landed in her solar, they had stood very close together, almost shoulder to shoulder. But now they spread out in the room, each to a different side of her. And the way Bruna held her staff, and Gisela her two swords, made Sigarda keenly feel the lack of her scythe, resting in a room just downstairs. #emph[What is happening here?] "We have just come..." Bruna began. "To talk. We have not seen you in a long while. Sister," Gisela finished. The two angels continued to move to her sides, each one on the edge of her peripheral vision. Sigarda could not believe her sisters would attack her, but the only rational explanation for their tactics was in preparation for an attack. Sigarda had never fought either of her two sisters, but she was confident she could handle Bruna as long as she could get to her scythe. Bruna was not especially skilled in direct combat. Her strengths lay in other areas. Gisela, on the other hand...Gisela would be a problem. #figure(image("002_A Gaze Blank and Pitiless/13.jpg", width: 100%), caption: [Gisela, Blade of Goldnight | Art by <NAME>an], supplement: none, numbering: none) More lightning crackled outside, and there was a loud burst of thunder. As the thunder subsided, Avacyn landed in the solar. Sigarda had not sensed Avacyn, not in the way she had her sisters' approach. She had never been able to sense Avacyn. Avacyn led them, but was not #emph[of] them. As she had demonstrated so long ago. Sigarda could not deny the power of Avacyn, her ability to both fight the horrors of Innistrad and inspire the humans to continue their fight. But she still missed her sister. Now both Bruna and Gisela were behind her, and Avacyn hovered in front of her. Tall, taller even than Gisela, with perfect alabaster skin and striking silver-white hair. Her moonsilver spear glowed, though Avacyn did not need a weapon to be effective in combat. If it came to battle, Sigarda would not go down easy, even against both Bruna and Gisela. But if Avacyn had come to fight... If Avacyn had come to fight, then Sigarda was dead. "Sigarda. The great work is soon to be underway." Avacyn's voice had a weird slur to it. Almost a slight hiss or buzz to her speech. At first, Avacyn had appeared as she always had, but Sigarda now noticed oddities. The metal points of Avacyn's spear were twisted. Even now the metal seemed to #emph[flow] as Sigarda watched. She wondered what kind of power Avacyn was channeling through the spear. Even more disquieting were Avacyn's eyes. Normally pure white, there were odd flashes of black in her irises, a momentary opacity swallowing light. The three angels had a long and complicated relationship with Avacyn. Gisela, Bruna, and Sigarda weren't truly sisters, not in any way that the word described humans. But they had come from the same essence, the same dawn times, and they had fought the horrors of the world together for a very long time. Before Avacyn had first appeared, a thousand years ago, there had been four sisters, one the eldest and most powerful of the angels. Bruna. Gisela. Sigarda. And the one they would no longer name. They hadn't known what to make of Avacyn at first. She was an angel, one of them, and yet not. They could not sense her, the way they could other angels. She was cold, opaque, reserved. Sigarda knew many humans felt the same way about her and her ilk—there were many reasons it was difficult for angels to have close relationships with mortals. But among each other, there was usually the joy of shared purpose, of the connection that one angel can only experience with another of her kind. Avacyn shared no connection with the other angels. But her power was undeniable. Unstoppable, in fact. The sisters had never seen an angel with the power and confidence Avacyn possessed. And at each step in their early interactions, Avacyn's confidence had been intoxicating. She always seemed certain of each action she took, each plan she made. Humans were not the only creatures in need of a god to believe in. And then Avacyn had turned on their sister. It was true their wayward sister engaged in unconventional actions and made unwelcome allies. Sometimes she would consort with vampires and witches, even demons and devils. #emph[We must know our enemies if we are to defeat our enemies] , she would say. She was often distrusted and disliked by the other angels, even sometimes by her three sisters. But the four of them had a deep bond, and though their sister charted a very different path, still she was their sister. Until the sister had formed an alliance with a demon lord, an act condemned by them all. Avacyn had declared her a heretic, an accomplice to the very monsters Avacyn and all the angels were sworn to defeat. The three other sisters had agreed with Avacyn, but did not join Avacyn in her crusade against their dark sister. Avacyn had not needed their help. A thousand years ago, Avacyn single-handedly destroyed their sister and her entire small flight, and they had made the very mention of her name forbidden. And now perhaps Avacyn was here to end her. "The great work? I am unfamiliar with it. Enlighten me." Sigarda slowed her speech, her breathing. She fought best when calm. She could not see Gisela and Bruna at all, but she could feel them behind her. The air was stale and heavy, and a rotting smell emanated from somewhere, unable to be masked by the sharp, tangy odor of the approaching storm. "For so long the truth has been in front of us, but we have been blind, Sigarda," Avacyn said, her words almost slithering with that strange slur. "We fight #emph[monsters] . The vampires, the werewolves, the zombies and witches and necromancers and devils. Why? Because they destroy. They pillage and consume. They commit violence against the land with the sole intent of sowing chaos." Avacyn paused, staring at Sigarda, her eyes once more flashing to black, and Sigarda felt the room was shrinking, closing in on her. "For their crimes we have sought to punish and kill. But the humans' crimes are the #emph[same] ." Avacyn smiled then, and Sigarda realized that in a thousand years of knowing Avacyn, she had never seen her smile. It was not a pretty smile. It was entirely disconnected from the rest of her face, her eyes. It was as though some involuntary reaction made the corners of her lips turn up without experiencing happiness or joy. Avacyn's voice rose as she continued, and her words became more punctuated, clear, the slurring fading. "They breed in their filth, creating new minions to destroy forests, pollute the water, lie and cheat and murder amongst themselves. What have they ever done that is worthy? What have they ever accomplished that is great? We could kill every single last supposed 'monster' of this world, every vampire and werewolf, and what would happen? Would there be peace? Would there be lasting light?" Avacyn saw the confusion on Sigarda's face, and the disgust. She laughed, a harsh laugh that almost cackled. "You know the answer, Sigarda. You know the #emph[truth] ." And Sigarda did know the truth. The humans were prone to awful acts, acts of intentional evil and unintentional neglect, and both were devastating. They did lie, and cheat, and murder. But they also did wonderful things. They loved and they built. They sacrificed and they served. They were free to commit good or evil, create order or sow chaos, and that freedom made every good act precious, a shining diamond glittering in the dark night. And besides, none of it mattered. Regardless whether Avacyn's argument was persuasive or interesting, betraying humans was not what angels did. It was as if Avacyn argued the sun should rise in the west, or the tides should no longer wax or wane. Sigarda did not respond. She did not see the point of a response. Avacyn was not interested in this being a conversation. In her silence, Avacyn continued. "I understand, Sigarda. These are hard truths, difficult. It took Bruna and Gisela some time to understand as well. But eventually they saw light." At the mention of their names, her two sisters spoke. "Now we believe..." said one. "Sister. The great work shall begin," said the other. When she couldn't see their faces, Sigarda realized she could no longer recognize which voice belonged to whom. "We will be back. Soon," Avacyn said. "We will need your help. The impure must be cleared, be punished. We will make way for true light. For ourselves and others like ourselves, who can create and maintain peace. Imagine it, Sigarda. No more violence, no more war, no more darkness." "Everlasting light," said a voice behind her, though she could not tell which angel said it. Or perhaps both said it at the same time. #figure(image("002_A Gaze Blank and Pitiless/14.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Avacyn held aloft her spear and pointed it at the stone roof. A surge of power leapt from the spear, and the roof...vanished. Obliterated by the force of Avacyn's power. Only a fine dust fell to the ground below, covering the angels in a sooty ash. "Soon," Avacyn said, and flew off into the dark gray skies. "Soon," Gisela and Bruna said from behind her, and did the same. Sigarda stood in her ruined solar, watching the lightning dance amongst the gray skies, though still no rain fell. Tears dropped from her eyes, splashing onto the dusty stone floor. She thought about her dark sister, a thousand years dead, and wondered why she hadn't fought for her, had not even tried. #emph[The storm is coming. ] Sigarda considered the angels in her flight, wondering if any of them had gone over to Avacyn yet. She considered humans that could possibly help stand against Avacyn. There were few, so few. But Sigarda knew it didn't matter, even if no one joined her cause. #emph[The storm is here. This time I fight.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "Maeli! Maeli!" Kelse's voice echoed through the growing dusk. #emph[Where is that child? ] Kelse peered under porches and looked through bushes. Most of the other villagers ignored her. #emph[He hasn't run away again] , she told herself, hoping if she said it confidently enough it would be true. Kelse tried hard not to think of a few months ago, when he #emph[had] run off. When Avacyn had appeared to save her child. Most of the village did not believe her. She and Maeli had never been accepted easily in the village, certainly not after Hanse had died. After his death, she was just the strange outsider from Kessig, with a wild child who took too much after his mother. And when she came back to the village that night, clutching her child and rambling about an appearance from Avacyn...well, she probably wouldn't have believed herself either. But Avacyn had come, had saved her child, her only child. Maeli had been born under the new moon, and had always been a special child, spirited and free. The villagers were right about Maeli taking after her. He looked like his father, a resemblance that caused Kelse both great joy and great pain, but in spirit he was like his mother, restless, yearning to explore. What she hadn't told the villagers that night was how mad she had been at Maeli. Of course she had been worried about him, frantic about him. Her panic at losing him had fueled her prayer to Avacyn, a prayer so powerful Avacyn had responded. When Avacyn had brought him back to her arms, all she had felt was relief, an overpowering joy that left her in happy tears. Until the change came over her. She could not describe it, could not explain it. In a moment all her love and care had left, vanished into the growing dark, and anger had filled her fully, a lightning bolt striking her heart. And not just anger, but a seething resentment and scorn, emotions she had never felt about Maeli before. And worse, she had displayed those feelings in front of #emph[Avacyn] . Avacyn, who had saved Maeli. Who had saved her. But after Avacyn left them on that dark meadow, so had the anger. And it had never come back, and ultimately all Kelse cared about was that she had her child back, her wonderful joy. #emph[Now I just need to find him again.] #figure(image("002_A Gaze Blank and Pitiless/15.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) On poles at the outskirts of the village, torch flames flickered and sputtered in the cold winter wind, shadows lengthening as the dusk deepened. She bit her lip, wondering where she should look next, when she heard a loud cry behind her. She turned in a panic, but it was only Maeli, running toward her with a large grin on his face, shrieking happily, "Mommy, Mommy!" He ran into her arms and hugged her fiercely, and she hugged him back just as tight. #emph[You are everything I need in this world. Let the villagers scorn me, distrust me. I don't care. I have you.] "Where were you?" She tried hard not to let her annoyance at having to look for him show. He loved exploring, and she wanted him to explore. She wanted him to always... The torch lights suddenly all died, their flames extinguished. It was not the wind. The cold air had become utterly still. Maeli clutched Kelse close, and Kelse put her arms around her son. There was a scream from inside the village, then a flicker of light caught Kelse's eye from above and she looked skyward. Angels flew above them. #figure(image("002_A Gaze Blank and Pitiless/16.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Against the orange and purple of the darkening sky, the winged angels hovered high over the village. All of them wielded weapons, swords and spears and staves, and many of those weapons glowed with golden or silver light. #emph[The stars are descending from the heavens] , Kelse thought. She looked down at Maeli, and he stared upward in open-mouthed wonder. Then one of the angels pointed her glowing spear downward at the village. A shaft of light fell from the spear onto one of the houses. The house was bathed in a bright light for seconds, and then the thatched roof burst into flame. The angel pointed her spear at another house, and there was another flash of light and another explosion. Other angels swooped down low, swinging their fiery swords, and shrieks and cries echoed into the night. Maeli screamed in her arms, his wonder transformed into terror. Kelse couldn't move, her muscles frozen, her legs rooted into the earth. There was a moment where she thought perhaps the angels were there to root out vampires or werewolves or some other evil. But from the outskirts of the village she saw neighbors die, either cut down by swords or consumed in golden light and flame. #emph[They are killing us. ] Maeli screamed again, breaking through her paralysis. "Maeli, my love, listen to me. You must run, run far and fast, deep into the woods, and do not come back. No matter what, do not look back, do not come back." Kelse heard her own words as if someone else was speaking them, and was amazed at how calm they sounded. More explosions and screams came from the village. Maeli sobbed, "Mama! I can't..." "Maeli!" Kelse's voice was sharp and thunderous. "You will listen! Run! Run now, the fastest you have ever run! To the forest!" She broke free of Maeli's embrace and pushed him away. The boy looked at her for a second, tears in his eyes, before turning and dashing away, through the brambles and hedges that lined the village's edge. Kelse felt a sharp pain in her heart. #emph[Run, my child!] Kelse looked up, and noticed the angel who had begun the destruction staring back at her from the sky. Looking at her and past her, toward the forest. #emph[No, you cannot have him! ] She began screaming at the angel, running in the direction below where the angel hovered. #emph[Avacyn] , Kelse thought. Perhaps the angels had been possessed by evil spirits, or they were some malevolent force in disguise. But whatever was happening, Avacyn would save them. Standing just below the angel, Kelse bowed her head. #emph[Avacyn, hear my prayer. Help me now, help us now. Please, my Avacyn, you saved my boy once, please save him again. Save us all.] "You do not need to pray your lies to me, creature. I'm right here in front of you." Kelse heard the voice just above her. She looked up, and saw an angel dressed in black, her wings steeped in blood red, her eyes dark and pitiless, nothing like the loving eyes she had seen just a few months back. The voice was familiar and strange together, with some type of accent marring her words. #figure(image("002_A Gaze Blank and Pitiless/17.jpg", width: 100%), caption: [Avacyn, the Purifier | Art by <NAME>], supplement: none, numbering: none) It was Avacyn. Avacyn was here. Avacyn was destroying her village. #emph[None of this makes sense] . For a moment Kelse thought perhaps she was dreaming. She noticed Avacyn's spear, the long uneven blades attached to a symbol of Avacyn glowing bright and beautiful. But the symbol was all wrong, twisted and warped, as if the metal had somehow gone #emph[sour] . #emph[That is not possible. Metal cannot twist like that. This is all a bad dream.] But she knew this was real. The angels had turned on them. The angels were #emph[killing] them. "Why have you forsaken us?" Kelse cried out. She didn't know whether she spoke to Avacyn or to the uncaring night sky, but neither responded. Throughout the village, screams rose and ceased abruptly as the angels continued their attacks with blade and fire. The flames rose higher behind Kelse, consuming her village, consuming all the trappings of her life. Avacyn descended softly, her red-soaked wings still, her eyes black and lidded. "The great work begins! Fitting you should be here to witness its glory." Avacyn paused, looking past Kelse. "Where is the small creature? It should be here, too." "He's gone! Beyond your reach, foul thing." Kelse was sobbing, struggling to breathe amongst the smoke and grief. #emph[Run, Maeli, run. There must be somewhere safe. Find it, my love, find it!] "Beyond my reach?" Avacyn landed a foot away from Kelse. Kelse heard a loud buzzing noise coming from somewhere, and she covered her ears in pain. Avacyn reached out and touched Kelse on the cheek, stroking her trembling flesh. "#emph[Everything] that is, is within my reach. My domain has no limits. And my domain has rotted. Putrefied. Everything must be cleansed. Everything must be pure." Avacyn stopped, withdrew her hand. "It is no matter. I will find the small creature eventually. I will find all of you, eventually." She took a step backward and pointed her spear at Kelse. "All will burn. All will bleed." The tip of the spear sparked with red and gold light. Kelse closed her eyes. #emph[My beautiful child. ] The light was bright, so bright...#emph[My beautiful, beautiful] ... #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Avacyn watched as the remains of the mortal creature blew away, the ashes scattering and swirling for a moment of flight before falling to the ground. #emph[Chaos into order. Corruption into purity. Peace increases.] The sky whispered to her. The rivers, the trees, the grass, the moon. All whispered glorious truth. #emph[For so long I have listened to the whispers of liars] ,#emph[ and the world has suffered.] Now she was listening to truth. She knew it was truth because every whisper said the same thing, so unlike the chaotic, conflicting prayers she had heard for hundreds of years. #emph[Why did I not realize how inconsistent these mortal creatures are? Their words always change. No matter, now. ] Now she understood. She looked at the moon, and the moon whispered such beautiful words. #emph[All will burn. All will bleed. ] Avacyn repeated the words to herself, a soothing song filling her head with joy. #emph[All will burn. All will bleed. ] She laughed and smiled as her angels continued the great work in the burning village. #figure(image("002_A Gaze Blank and Pitiless/18.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/043%20-%20Innistrad%3A%20Midnight%20Hunt/005_Episode%203%3A%20The%20Fall%20of%20the%20House%20of%20Betzold.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Episode 3: The Fall of the House of Betzold", set_name: "Innistrad: Midnight Hunt", story_date: datetime(day: 15, month: 09, year: 2021), author: "<NAME>", doc ) "So, when you guys said that if the key was in Thraben, it'd be safe~" The groans of the unhallowed dead answer Chandra before any of the others can. Kaya pinches her nose. Teferi's already stopped up his; he breathes through his mouth, and that's still bad. Despite the midday sun, the clouds come together to cast their shade upon the remains of the cathedral. Even the sky's ashamed of the sight. Seeing it sets Arlinn's stomach in knots. There, the spire where she spent sunny hours reading, now rubble scattered against the earth; here, the stained glass she so treasured shattered. To look upon the teeming mass of undead feels like a further betrayal. She doesn't want to think about the odds that she may see someone she used to know. She swallows. As ants around their hill, the zombies around the cathedral. Getting past them will be no easy feat. #figure(image("005_Episode 3: The Fall of the House of Betzold/01.jpg", width: 100%), caption: [Light Up the Night | Art by: Wei Wei], supplement: none, numbering: none) "It may well be," Adeline says. "But we won't know until we finish our investigation." And they had done some investigating, or rather Kaya had. It took them the better part of a week to get to Thraben—plenty of time to look into things. A hunch wasn't enough for her to go on. The second they'd arrived in Thraben, she'd split off from the group to go do some reconnaissance of her own. Wherever she went, she returned not long after with a dusty tome in hand. "Page seventy-seven," she announced. Turning to that page showed an illuminated page and woodcut rendered in great detail: a family being handed a box by a witch who resembled Katilda. The caption labeled them the Betzolds, from Gavony. Arlinn knew a <NAME> from her time at the Cathedral—an older bishop, strict as could be. Her knuckles hurt thinking of him. But her heart did, too, for she knew that if he was anywhere~well, he'd be in there. With the masses. And who knows how many of her old friends. "I think I see him." Adeline's voice cuts through Arlinn's thought. The cathar points with her sheathed sword to the ruined nave of the cathedral. A figure in holy vestments stands before the pulpit. To Arlinn's horror, he seems to be preaching to a gathered crowd. The pews are full of zombies sitting and clapping and bowing and praying. What The Travails did to this place is really, truly unholy. Once, Liliana had raised all these zombies to fight against the Eldrazi. It was bad enough having to share the field with the living dead—but worse dealing with them afterward. She'd heard that someone asked Liliana what to do about all the remaining zombies. The story went that she replied, "They have plenty of uses, you know; try thinking creatively." Thinking of it weighs her down. This place is an affront to everything she loves. She knows what it once was. And she knows the vestments the man wears. Wearily, she nods. That's him. "Nothing for it, then," says Kaya. "Someone's going to have to make a way through." Adeline pulls herself up onto her horse—a white stallion she's probably named Thunderbolt or Lionshield or something equally heroic. Looking at her astride it, it's hard not to feel some hope. "You can leave that to me," she says. "My cathars and I have been fighting the undead for years. You four focus on getting to Worrin." Chandra looks over at the horde, then back to Adeline. "What, and let you do all the fighting? I don't think so," she says. "I've got your back. #emph[You ] three make for Worrin." The air's gone hazy around her, heating up in reflection of her grinning enthusiasm. There are no two ways about it—Chandra's going to let loose. Adeline's smirk returns. "All right. I'll be the vanguard, and you take the rear, <NAME>," she says. A mock salute is the answer. If the situation weren't so dire, it might bring a smile to Arlinn's face. As it stands, she can feel a distant happiness that they're getting along well, which falls away the moment she eyes the ruined nave. There's no time to waste. Adeline and the cathars lead the charge, falling like a holy hammer upon the anvil of the undead. Adeline's commands come swift and certain as does the cut of her blade. Heads fall from bodies like fruit from trees. One leaps upon her only to slow mid-jump. Blue streaks fly from Teferi's staff as he slows the undead's advance down the central column. It isn't much—only the slightest delay—but it's enough for Adeline to bash the zombie back with her shield and plunge her sword into its throat. The way won't stay open for long. Into the hard-won furrow of safety they go, Kaya flickering in and out of existence, Arlinn shifting halfway through. The encroaching arms of the dead taste foul in her mouth; she avoids them whenever possible, slashing at faces, teeth, and feet with the claws that nature's given her. Still, spittle falls on her fur; still, the snarls slither into her ears; still their stench stops her throat. But it isn't until Chandra takes up the rear that Arlinn feels any kind of safety. Two great sheets of flame fly from her hands, replacing the now-fading walls of Teferi's magic with something far more solid. Even the dead fear fire, as Thalia had shown them all: they scream as one, retreating from the searing heat, widening the gap between the heroes and the undead. Yet she isn't done there—as the others press on, Chandra turns to face the masses, the fire she conjures like the breath of life itself. There were zombies there, once, and now they are ash upon the wind. Adeline chances a look over her shoulder as Chandra bathes them in orange light, at the pyromancer in the very heart of her element, surrounded by life-saving destruction. Arlinn doesn't know what Adeline's thinking, but she does know her own thoughts: she should never, under any circumstance, upset <NAME>. It isn't easy going into the church, but it's easier between fire and sword. The walls rise around them and then fall away, broken by The Travails and twisted into something new. Worrin's wordless groaning grows closer and closer. Flames lick the once-holy walls, and though it hurts, Arlinn hopes it's a sort of cleansing. "Got him yet?" Chandra shouts. It's hard to hear her over the roar of flame, but Arlinn does. She bolts ahead. Adeline's got him back up against a wall, idly mouthing prayers he once taught Arlinn. As she shifts back to her human form, his rheumy, undead eyes focus once more. When his mouth moves, it is to shape her name. He points to her, or perhaps to her succulent flesh. Arlinn wants to believe it's the former. "Worrin, it's me," Arlinn says. "You recognize me, right?" "Dennick?" is the answer. She glances over her shoulder—Chandra's closed in with the rest of them. Adeline and the cathars spread in a circle around Arlinn and Worrin. "Worrin," Arlinn says, forcing herself to sound calm in the face of this aberration she once knew, "We're looking for the Moonsilver Key. Do you know where it is?" His eyes blink, one after the other. His toothless jaws smack together. Silence. The clatter of Adeline's sword against the dead, the rush of the fire. Kaya and Teferi's eyes on her. "The key, Worrin," Arlinn says. Angel save her, she sets her hands on his shoulders. He can't look away from her now. "Dennick," his answer. "Arlinn, we don't have very long!" Adeline shouts. "#emph[The key,] " Arlinn repeats. "D~Dennick~" Arlinn curses under her breath. "I think we've gotten all we can from him!" "Great," says Chandra. "This time, Addy, you watch my back!" And as the fire takes the cathedral again, Arlinn gives Worrin the only rest she can, a #emph[crack] , a prayer, a hope for the better. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) You think you know a person, but often you only know one part of them. Worrin in life was as strict an instructor as they came. Arlinn couldn't remember talking to him about anything other than theology, and though his answers were always well thought out, she always imagined him as the sort of man who had given up his life to the church. On occasion, he'd bring up his youth in Gavony, but that was as far as it ever got. But people are rarely so simple, and as they arrive in the quiet Gavony township the Betzolds called home, they start asking questions. "Worrin and Dennick?" says one woman, brushing the frost off the pumpkins she's spent all season growing. Old age has not kept her from tending crops, and her hands move with practiced precision. "Puh. I guess it was about time someone came calling." Arlinn kneels next to her. "That so? Well, sorry we took so long. Snow slowed us down." "Ain't enough snow for that," the woman answers. "It's only frost. You're old enough to know better than to use #emph[that ] as an excuse." Arlinn allows herself a small smirk. No matter how many Planes she went to, there's never any place quite like home. "You're right, you're right," she answers. The snow is light—her touch is enough to melt it. "But maybe you can fill me in, anyway." The old woman fixes Arlinn with a look. "You're too late." "Too late?" Arlinn repeats, frowning. "If he wasn't dead before The Travails, he is now," she says. "He holed up in the old family mansion. For safety's sake, he said. Haven't seen him since. Place is awfully haunted." Arlinn looks over her shoulder. The Betzold home rests on a hill, and she can see its gaping windows from here. "But why go there if it's so haunted?" The old woman pats her hands clean. "Because Dennick is Worrin's boy." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The Travails broke everything in Innistrad, but some things were remade. Steady, desperate hands reworked the warped Avacynian symbols on the road back to their old forms, breaking off the stone in favor of wood or rough-hewn iron. They pass houses torn asunder and constructed from neighboring pieces, like a stitcher got to them. The people are the same: some bearing their scars on the inside, some simply keeping a closer eye on their children, some clutching prosthetic limbs close as they watch the newcomers roll through town. Innistrad breaks. Innistrad builds. Innistrad survives. It's a good thought, but the mansion gives lie to it: the Betzold home is as dilapidated as they come, and evil to boot. Evil's the word for it, Arlinn's sure—for the way the windows look down on them, the way the vines rake at its stony face and the mouth of its door hangs open. Arlinn doesn't like looking at it. But she will. Of the five of them, it's Kaya who seems the least troubled. As they approach the home, she shows no signs of fear at all. The yawning door of the mansion doesn't faze her. She looks it up and down, her brows narrowing, and then flicks her nose with her thumb. "So, he's in there?" Arlinn nods. "With a bunch of malevolent spirits, right?" "Sure looks like the place for it," says Chandra. "I've some holy symbols—" Adeline starts, but Kaya waves her off. "Don't bother," she says. "Just give me five minutes before you follow." #figure(image("005_Episode 3: The Fall of the House of Betzold/02.jpg", width: 100%), caption: [Thraben Exorcism | Art by: Matt Stewart], supplement: none, numbering: none) And, true to form, Kaya doesn't bother waiting around for permission. Into the maw of it she goes. Arlinn's nose tingles as the sharp scent of Kaya's magic fills the air, followed by the low hum she's come to associate with it. Adeline heads to one of the broken windows to peer in. Chandra follows, taking up the same window. From their reaction, there's quite a lot to see. It's hard to resist temptation, sometimes. Bitterly, she thinks to herself that Tovolar would say the same. Restraint is as a human thing and not a wild one. Give in to your passions and your instincts—they always know best. That was what he taught her. The Church taught her otherwise. She presses her face to the window. Inside, a streak of grayish white gives rise to Kaya's ghostly form. But it isn't the only ghost present. The old woman was right: the place is #emph[awfully ] haunted, but it won't be for long. Kaya's putting them down at an incredible rate. It's hard to follow her form as she jumps from one of the ghosts to the next, here plunging a knife into a back and there slashing at ghostly throats. Arlinn can't help but wonder where the spirits are going afterward, if this is the Blessed Sleep coming to take them or something else. Maybe she'll ask later. For now, the room's clear of supernatural threats. Chandra's the first one pushing in, then Adeline right after and Arlinn next. Teferi takes up the rear this time. The ghosts don't seem to bother him much; he moves with the same warm ease as ever. But there's another floor. Up they go, step by creaking step, breath baited, the hum growing only louder behind the decrepit door. Chandra moves to open the door, but Adeline stops her with a hand on her shoulder. "Let me," she says. "You're safer behind me." Had Adeline walked out of a story somewhere? There's the gallantry, yes, but also the way she splinters the door when she throws all her weight against it. Inside, Kaya's leaning casually near one of the ghosts. She greets the others with a sarcastic bow as they charge in. "Here's your man," she says. "Nice and easy." Teferi's hum is one of amusement. "That was less than five minutes." "Rich, coming from you," Kaya answers. "Don't you just make the time up as you go?" "If only it were that easy," he says. Teferi looks over his shoulder, his smile softening with sympathy. He gestures to the floating ghost—a man no older than thirty, the skeleton pinned beneath a piece of rubble, presumably his. They're wearing the same rough-hewn clothes. "After you." Arlinn doesn't wait. She comes up to him, resisting the urge to shake his hand. "Dennick? My name is <NAME>. I was a friend of your father's." How strange to see a ghost's eyes go wide. "My father? Has he sent for me?" #figure(image("005_Episode 3: The Fall of the House of Betzold/03.jpg", width: 100%), caption: [Dennick, Pious Apparition | Art by: <NAME>], supplement: none, numbering: none) Always better to give the truth where you can, no matter how ugly. "I can't say he did. Your father's dead. I put him to rest myself, but you should know he was calling out for you to the end." "Put him to rest?" the ghost twiddles worried fingers. "Does that mean he's~undead?" "He was," she answers. "It's best not to dwell. But I came to ask after something very important, something your family guards—" "Oh. This isn't a social call?" "No, it isn't," Arlinn says. "Please. If you know anything about the Moonsilver Key, Innistrad has need of it. The nights are growing longer; we need it for a ritual to set things right." "I thought with all the people, maybe it was a social call," Dennick answers. Twiddle, twiddle. "Most people want the key. I never saw it. I wasn't a real Betzold, my father said." "Then he was being a fool about it," Arlinn says. "Here you are at the mansion the same as any Betzold. And if you could tell us where the key is, well, you'd be doing your family's duty better than any of the others have." Somehow the ghost sighs. "I guess I am," he answers. "All right. Well~I did some digging here, too, because I heard about it and~turns out we don't have it. My great-grandfather gave it over to one of the vampires for safekeeping. Isn't that silly?" Kaya pinches her nose again. Chandra sucks in a breath. She holds up a finger. "Excuse me, but can I just ask #emph[which] vampire?" Dennick sighs. "Will you let me rest if I do?" "If that's what you'd like," Arlinn says. "But it'd be easier to rest if you knew Innistrad wasn't in danger, right?" He rolls his head as if thinking it over. Then: "It's the Markovs. That prince of theirs, he took it. Did my father say he missed me?" "I had the #emph[worst ] feeling about that," Chandra says, halfway to the door, but Arlinn stays behind. Dennick wants someone to talk to. The least she can do is listen—at least for a little while. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Innistrad rebuilds. Even the vampires. As much havoc as they've caused, as much as her stomach rumbles at the scent, as much as she hates them—Arlinn has to admit there's something comforting about it. The Travails spared no one. Try as the denizens of the dark might to wipe out humanity, not long ago, they all fought on the same side. Arlinn hopes they can again. The others march on ahead. Chandra's listless; she doesn't like the idea of walking into the serpent's den. Kaya doesn't either. But Arlinn understands something they don't: this was once a place people found hope. And it is something the others know—but they don't understand it. Not really. To have such a hunger in your belly and yet act against those bestial instincts for the greater good~she doesn't like <NAME>, but she can respect him. And she can respect the memory of the angel who gave her hope when hope was as furtive as that white stag. So as the others march on, Arlinn pauses just outside the gates. Vines have claimed the broken halves of an Avacynian symbol. Cutting them apart with her sharp nails, she rights the symbol and starts a prayer. "#emph[Guard us through the night, O Angel. . ."] To her surprise another voice joins in, Adeline's from the sound of it. Teferi's follows, at a slight delay, as he learns the words. Chandra joins in after, a little too fast, stumbling here and there, but trying her best. And last—with a bit of a sigh—is Kaya, coming in when they're nearly done. When they're finished, they exchange soft smiles, and head in. No one asks her why she prays to an angel who can no longer hear her. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) People who say they'll cross bridges when they get to them haven't been to Markov manor. The thin strip of rock leading into the place would be intimidating enough in normal times, standing as it does above the yawning mouth of a chasm, but The Travails have come here, too. The bridge floats in pieces. Hopping from piece to piece is the only way to approach the crumbling castle. The broken visages of the elder Markovs make terrible stepping stones. Inside, it isn't much better. Chalices lay under a coat of dust; pauldrons to beggar a village are only rocks to stumble upon; what portraits are not torn asunder have faded to black. Worse—it does not smell of death here, nor of rot, nor even of blood—it smells of nothing. "What are the odds no one's home?" Chandra asks. "Slim to none," says Kaya. "The place is bad, but it's not abandoned bad." She points up at the chandelier over their heads. "Someone's changed the candles." "Likely a thrall," says Adeline. "But Kaya's right—we have to keep our guard up." "But what if he's not here? Then we can just steal the key without having to talk to him." "Let's hope he isn't," says Arlinn, "but it's best to assume he is. Besides, I'm sure he can be reasoned with." But as she says that, they pass a particular outcropping of rock, one not quite like its neighbors. Where the others are sharp, twisted things—daggers aimed at an unseen foe—this one is an open wound upon the face of Markov manor. Here, the gouges are worse than anywhere else, concentrated in two long furrows on either side. The rim of it is likewise rough, the edges looking uncomfortably like they'd been chewed away. Splotches of dried blood only make the sight more gruesome. "Don't like the look of that," Adeline says. "Can't say I do, either," says Teferi. Kaya makes a small sound. Her eyes narrow. "Can't have teeth anymore, whatever it was." "Sorin will know what happened. Maybe we aren't the only ones after the key," says Arlinn. "If he's even here," Chandra says. But he is. He has to be. After all this, to have him elude them~Arlinn grits her teeth. She's going to find that key one way or another. Tovolar wants to tear Innistrad's heart from its chest; she can't let that happen. "If he's anywhere, it's the throne room," Arlinn says. "Should be up ahead," says Kaya. "All the portraits down this hall. It can't lead anywhere #emph[but ] the throne room." She has a point. There aren't many images left, but there are #emph[enough] . To say nothing of the gate up ahead of them: a large, looming thing, carved with the snarling faces of bats, now thrown partially off its hinges. When they get to it, it takes Arlinn shifting to her wolf form to throw the doors open. Adeline eyes her as she shifts back. Arlinn offers her a friendly smile. "Don't worry, I'm housebroken," she says. Joking about it sometimes sets people at ease even if these days she's not sure how accurate it is to say. Back in the woods, she'd come so close to running off. But she's Arlinn today, and she plans to stay that way—even when, in the dusty throne room, they find the prince awaiting them. <NAME> sits with one leg slung over the broken throne of his house. He's reading an old, unmarked book, something like a journal. A hole in the ceiling casts a single ray of moonlight upon his gray skin. Surrounded by the empty splendor of the abandoned manor, he makes for a strange sight. Though he doesn't look up at them as they enter, Arlinn can smell the resentment coming off him. His voice is forceful and arrogant. "State your purpose for disturbing me now, or I shall see all of you out." "Sorin," says Teferi. Of course it's him stepping forth. Of course he shows no signs of intimidation. The court bow he manages would put any aristocrat to shame. "A pleasure to see you again. We just have a small business matter to attend to. We'll keep it brief." The vampire glances up over the edge of his book. "I know better than to put any faith in your definition of brief. The reason, now." Teferi's shoulders rise in a shrug, as if to say he tried. "We're looking for the Moonsilver Key. The nights are growing—" Sorin snaps the book shut. "No." "What do you mean, #emph[no] ?" says Chandra. "We've spent forever looking for it. The least you could do is hear us out." His eyes fix on hers. Chandra stops talking. There's something predatory about the man, and yet something enchanting, too. Arlinn's met plenty of bloodsuckers in her time, but none quite like him. It was like the difference between dogs and wolves. And yes, there is something carnivorous to the way he stands, the way he casts the book aside, the steps he takes, and the posture he assumes—his hand resting just so on the pommel of his sword. "I cannot expect someone so #emph[impetuous] to understand how much I've sacrificed for this Plane already. If my #emph[family] ," he practically snarls the word, "so wishes to descend into the worthless hedonism of eternal night, then I have done enough to stop them. Let them feast." Teferi holds up his hands, standing just in front of Chandra. "If you won't listen to her, listen to me. Innistrad is your family, Sorin, we all know that. You've done #emph[more] than enough. We're asking for the key so we can do our part. Arlinn here doesn't want to see eternal night any more than you do." "Is that so?" he answers. "Pray tell me what you've done for the Plane. Go on, I'm listening." Now he's advancing, now the sword slips from its sheath, now the beast in Arlinn's blood calls for her to change. But she doesn't. Not yet. She plants her heels onto the stony ground. "Maybe I don't have your history, but the past few years I've been traveling the place, listening to people. I thought you'd understand better than anyone why humans need to live. You made Ava—" She's not through the name before the sword's swinging through the air. It's only her own preternatural reflexes that keep her from harm—she raises an arm to parry the flat of the blade. Still, steel bites into flesh; a streak of red paints the floor; black vapor stings her eyes. Teeth grow longer in her mouth. Those golden eyes are burning in the dark. "#emph[You] ," he rumbles, "aren't permitted to speak of her." "Have you already forgotten why you made her?" she says. Chandra's already got fires burning; she signals Arlinn over his shoulder. All it would take is a word for the other four to descend on him, but she doesn't want that. Not yet. "We need angels. We need hope, we need faith. We need the day—and we need the key." "Get out," he shouts. The empty walls turn it into a vicious echo. "#emph[Now] ." "Not without the key," Arlinn answers, just as firm. "Maybe you've forgotten but I haven't." Up the sword, another strike coming as his anger gets the better of him. Arlinn raises her arm again. But there's no need to. A feather falls between them, gold and glowing, followed an instant later by a heron-headed scythe. Sorin's sword clatters against the angelic weapon; he draws back in naked fury to behold the interloper. And it may be the middle of the night, it may be a cold, dark time, it may be the beginning of the end of Innistrad, but the golden light that floods into the throne room brings with it a swell of hope to Arlinn's breath. So, too, does the holy fervor of the angel before her. Avacyn may no longer hear prayers. But Sigarda does. #figure(image("005_Episode 3: The Fall of the House of Betzold/04.jpg", width: 100%), caption: [Sigarda, Champion of Light | Art by: <NAME>], supplement: none, numbering: none) "<NAME>," she says. Her voice is resonant, with a slight echo that casts it as more than human. "How far you've fallen. Carving your way out of the stone only to sulk." That pit—that was #emph[him] ? How strange, to feel pity for a centuries-old vampire prince. Stranger still when that same man levels his blade at an angel. "What would you have me do? Since you clearly have all the answers. Go on, explain. Either that or throw your lot in with them and get out of here." Sigarda's golden eyes narrow. She does not avert them from Sorin, yet when she speaks, it feels as if she's at Arlinn's side. "<NAME>—it is your faith that summoned me here. The cause in your heart is just. You will find the Moonsilver Key in Sorin's personal chambers on the third floor. Go. I mean to speak to him about his old creation." Chandra and Kaya don't need to be told twice—they bolt off for the staircase. "Thanks, Sigarda!" shouts Chandra, feet against the plush carpets. Teferi is soon after, stopping only long enough to offer a respectful bow. But Arlinn and Adeline remain, even as Sigarda brings the scythe down upon him, even as his features become more bestial in the face of danger. A certain holy dread has pinned them to the spot. Is it not the place of the faithful to aid their idols? The two exchange a look. Adeline raises her shield. "#emph[Go] !" cries the angel, Sorin's sword slicing at her armor. "If you ever had any faith in me, you will go!" Arlinn swallows. She wants to help. Adeline squeezes her arm. "We'd only get in the way," she mumbles, as dejected as Arlinn feels. And maybe she's right. But it doesn't make it feel any better. Up the stairs Arlinn goes, following in Adeline's footsteps, trying not to pay attention to the howls of pain that follow, trying not to count how many belong to the angel and how many to the vampire. That is, in and of itself, faith. It is Chandra who finds the room—festooned with bookshelves and antique weapons—and Teferi who finds the Moonsilver Key. It sits in the offering hands of a statue. Sorin must have lopped the head off of it, but the armor and wings leave little doubt who it used to be. The headless Avacyn sits beneath a portrait of a young Sorin and his grandfather dressed in their finest. #figure(image("005_Episode 3: The Fall of the House of Betzold/05.jpg", width: 100%), caption: [Moonsilver Key | Art by: <NAME>], supplement: none, numbering: none) Arlinn takes the key. For the second time that day, she mutters a prayer. This time, she prays that Sigarda will be safe and that they will make it back in time for Harvesttide. But it is a strange thing to pray to an angel for their own safety, and stranger still to ask them to warp time. Nothing is guaranteed in Innistrad—but they will try to survive, try to endure, and look once more to the holy light of day.
https://github.com/ngyngcphu/tick3d-docs
https://raw.githubusercontent.com/ngyngcphu/tick3d-docs/main/components/footer.typ
typst
Apache License 2.0
#let m = yaml("/metadata.yml") #set text(font: m.at("fonts").at("monospace"), size: 8pt) #show: block.with( stroke: (top: 1pt), inset: (top: 1em), ) #locate(loc => [ // skip first page footer #if loc.page() == 1 { return } #let current-page = counter(page).at(loc).at(0) #let total-pages = counter(page).final(loc).at(0) #let semester = m.at("học kỳ") #let semester-of-year = calc.rem(semester, 10) // change this if you use this in the 2100s #let year-from = calc.round(semester / 10) + 2000 #let year-to = year-from + 1 Báo cáo môn #m.at("môn học").at("tên") - Học kỳ #semester-of-year năm học #year-from - #year-to #h(1fr) Trang #current-page/#total-pages ])
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/markup/inline-block-raw.typ
typst
Apache License 2.0
#text(``` test ```) #text(```test ```)
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/design_concept/content/poc/type_inference.typ
typst
#import "../../../acronyms.typ": * = Type Inference <type-inference> VisualFP features a type-inference engine responsible for figuring out which expressions are valid, determine which type holes are necessary, and annotate sub-expressions with their according types. It operates on a separate expression model to isolate the inference engine. The engine is not responsible for converting to and from the #ac("UI") model; this is done by a translation layer described in @translation-layer. Heavy inspiration for the implementation of the engine was taken from the talk "Type inference as constraint solving" by <NAME> @spj-ghc-inference. == Phases An overview of the inference engine is shown in @inference-engine-components. It shows how the process is separated into 3 phases. #figure( align(center, image("../../static/inference-engine.svg", width: 65%)), caption: [Type-inference engine components]) <inference-engine-components> 1. *Elaboration*: #[The elaboration phase takes an input expression and annotates all elements with placeholder types called _unification variables_. Along the way, it collects these variables and creates a list of constraints for them. For example, if a value of type $alpha$ is applied to a value of type $beta$, then $alpha$ must be a function taking $beta$ as the argument. A more detailed description of these constraints can be found in @constraint-language.] 2. *Unification*: #[Next, the unification algorithm tries to find a solution for the unification variables that satisfy all constraints. If it succeeds, a concrete type can be assigned to each unification variable. The algorithm is based on Prolog, as described by Prof. Dr. <NAME> in his lecture @mehta-unification.] 3. *Zonking*: #[Using the elaborated expression, still filled with unification variables, and the results of the unification phase, the zonking phase inserts the concrete types into a new expression.] == Constraint Language <constraint-language> The inference engine is based on what <NAME> describes as "the French Approach" @spj-ghc-inference. It has been described in the paper "The Essence of ML Type Inference" by <NAME> and <NAME> @the-french-approach. In such an engine, the constraints are essential. They contain all the knowledge gained through the elaboration pass of the input and can be used by the unification algorithm to sort out all types. They are also what differentiates the "French approach" from a classical Dalmas-Milner inference: The solving of constraints is deferred, as opposed to being solved in one pass @spj-ghc-inference. The constraint language describes the structure of constraints. <NAME>' implementation @spj-ghc-inference inspires the constraint language used by VisualFP with a few adjustments. - There is no implication constraint. - Constant, constructed, and unification types are summarized as a single sum type. - Conjunctions are represented as lists of constraints instead of combinations of two to form a tree. As a flat list, there is also no need for an empty constraint.
https://github.com/Vanille-N/mpri2-edt
https://raw.githubusercontent.com/Vanille-N/mpri2-edt/master/time.typ
typst
#import "typtyp.typ" #let tt = typtyp #let Time = tt.typedef("Time", tt.struct(minutes: tt.int, label: tt.content)) #let Bounds = tt.typedef("Bounds", tt.struct(start: Time, end: Time)) #let mod(base) = num => { while num >= base { num -= base } num } #let left-pad(w, fill) = t => { while t.len() < w { t = fill + t } t } #let fmt-normalized(hours, minutes) = { let minutes = hours * 60 + minutes let true_minutes = mod(60)(minutes) let true_hours = mod(24)(int(minutes / 60)) [ #{ left-pad(2, "0")(str(true_hours)) + "h" + left-pad(2, "0")(str(true_minutes)) } ] } #let from-hm(hours, minutes) = { tt.is(tt.int, hours) tt.is(tt.int, minutes) tt.ret(Time, (minutes: hours * 60 + minutes, label: fmt-normalized(hours, minutes))) } #let compare(t1, t2) = { tt.is(Time, t1) tt.is(Time, t2) if t1.minutes == t2.minutes { 0 } else if t1.minutes > t2.minutes { 1 } else { -1 } } #let tmin(t1, t2) = if compare(t1, t2) >= 0 { t2 } else { t1 } #let tmax(t1, t2) = if compare(t1, t2) >= 0 { t1 } else { t2 } #let empty = tt.ret(Bounds, (start: from-hm(24, 0), end: from-hm(0, 0))) #let extend(bounds, t) = { tt.is(Bounds, bounds) tt.is(Time, t) tt.ret(Bounds, ( start: tmin(bounds.start, t), end: tmax(bounds.end, t), )) } #let offset(t, dt) = { tt.is(Time, t) tt.is(Time, dt) let minutes = t.minutes + dt.minutes tt.ret(Time, (minutes: minutes, label: fmt-normalized(0, minutes))) } #let inbounds(bounds, t) = { tt.is(Bounds, bounds) tt.is(Time, t) compare(bounds.start, t) <= 0 and compare(bounds.end, t) >= 0 } #let proportional(bounds, t) = { tt.is(Bounds, bounds) tt.is(Time, t) 100% * t.minutes / (bounds.end.minutes - bounds.start.minutes) } #let absolute(bounds, t) = { tt.is(Bounds, bounds) tt.is(Time, t) 100% * (t.minutes - bounds.start.minutes) / (bounds.end.minutes - bounds.start.minutes) }
https://github.com/protohaven/printed_materials
https://raw.githubusercontent.com/protohaven/printed_materials/main/common-tools/arbor_press.typ
typst
#import "/meta-environments/env-templates.typ": * = Arbor Press (Overview paragraph(s)) == Notes === Safety Always wear safety goggles. Keep fingers free of the crushing area. === Common Hazards Parts compressed off axis may fly sideways out of the press. Material that shatters under compression will fling debris out of the press at high speed. === Care Do not use extension bars on the pulling handle to generate more force in the press. (Keep press lubricated?) === Use === Consumables === Tooling === Materials == Parts of the TOOL === == Basic Operation === Setting Up === Workholding === USE === Cleaning Up === SPECIAL TOPICS
https://github.com/alimitedgroup/alimitedgroup.github.io
https://raw.githubusercontent.com/alimitedgroup/alimitedgroup.github.io/main/verbali/esterni/2024-10-23.typ
typst
// VE 23-10-2024 #import "../../lib.typ": * #set text(lang: "it") #show: doc => verbale( data: [23-10-2024], tipo: [esterno], regmodifiche: ( /*("1.0.0", "2024-10-15", "Samuele Esposito", "-", "Approvazione documento"), ("0.1.0", "17-10", "<NAME>", "-", "Modifica e verifica documento"),*/ ("0.0.2", "23-10", "<NAME>", "-", "Redazione documento"), ("0.0.1", "23-10", "<NAME>", "-", "Creazione struttura e template documento"), ), versione: [0.0.2], stato: [Redatto], presenze: ( "<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>", ), odg: [Primo incontro di _ALimitedGroup_ con l'azienda _SyncLab_: vengono sciolti dubbi sorti durante la presentazione del capitolato], doc, ) = Informazioni generali #inizio-verbale-esterno([*virtuale*], [*23 Ottobre 2024*], [*15.00*], [*15.30*], [_Synclab_]) - Esposizioni delle domande riguardante il progetto - Esposizioni delle domande sullo svolgimento del progetto - Scoglimento di dubbi e incertezze riguardanti, nel dettaglio, le tecnologie da utilizzare - Ulteriori domande sui test da effettuare e da superare #pagebreak() = Dettaglio riunione == Domande riguardanti il progetto == Domande rigurdanti lo svolgimento del progetto == Scioglimento di dubbi e incertezze == Ulteriori domande sui test da effettuare = Esiti della riunione
https://github.com/pluttan/shem
https://raw.githubusercontent.com/pluttan/shem/main/tit.typ
typst
#import "@docs/bmstu:1.0.0":* #import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx, cellx // #show: student_work.with( // caf_name: "Компьютерные системы и сети", // faculty_name: "Информатика и системы управления", // work_type: "лабораторной работе", // work_num: "1", // discipline_name: "Схемотехника", // theme: "Исследование шифраторов и дешифраторов", // author: (group: "ИУ6-42Б", nwa: "<NAME>"), // adviser: (nwa: "<NAME>"), // city: "Москва", // ) // #show: student_work.with( // caf_name: "Компьютерные системы и сети", // faculty_name: "Информатика и системы управления", // work_type: "лабораторной работе", // work_num: "2", // discipline_name: "Схемотехника", // theme: "Исследование мультиплексора", // author: (group: "ИУ6-42Б", nwa: "<NAME>"), // adviser: (nwa: "<NAME>"), // city: "Москва", // ) // #show: student_work.with( caf_name: "Компьютерные системы и сети", faculty_name: "Информатика и системы управления", work_type: "лабораторной работе", work_num: "4", discipline_name: "Схемотехника", theme: "Триггеры", author: (group: "ИУ6-42Б", nwa: "<NAME>"), adviser: (nwa: "<NAME>"), city: "Москва", )
https://github.com/maxlambertini/tomorrow-cv
https://raw.githubusercontent.com/maxlambertini/tomorrow-cv/main/README.md
markdown
# Tomorrow CV This is the template I use for my CV. It's been inspired by [Harunwar's Attractive Resume](https://github.com/Harkunwar/attractive-typst-resume) I used Bitter as body font and Tomorrow as title font, giving it a slightly more "Techno-futuristic" look. Fonts are included in this project, and are licensed under SIL Open Font License. You can use, remix and modify this template as you want, provided you give me some credit (a link to this project page is enough, dont' worry!)
https://github.com/mrcinv/nummat-typst
https://raw.githubusercontent.com/mrcinv/nummat-typst/master/domace_01.typ
typst
#import "admonitions.typ": opomba #import "@preview/minitoc:0.1.0": * = 1. domača naloga <1-domača-naloga> Izberite eno izmed spodnjih nalog. #minitoc(title: [Naloge], target: heading.where(depth: 2)) == SOR iteracija za razpršene matrike <sor-iteracija-za-razpršene-matrike> Naj bo #emph[A n × n] diagonalno dominantna razpršena matrika (velika večina elementov je ničelnih $a_(i j) = 0$). Definirajte nov podatkovni tip `RazprsenaMatrika`, ki matriko zaradi prostorskih zahtev hrani v dveh matrikah $V$ in $I$, kjer sta $V$ in $I$ matriki $n times m$, tako da velja $ V(i,j)=A(i,I(i,j)). $ V matriki $V$ se torej nahajajo neničelni elementi matrike $A$. Vsaka vrstica matrike $V$ vsebuje neničelne elemente iz iste vrstice v $A$. V matriki $I$ pa so shranjeni indeksi stolpcev teh neničelnih elementov. Za podatkovni tip `RazprsenaMatrika` definirajte metode za naslednje funkcije: - indeksiranje: `Base.getindex`,`Base.setindex!`,`Base.firstindex` in `Base.lastindex` - množenje z desne `Base.*` z vektorjem Več informacij o #link("https://docs.julialang.org/en/v1/manual/types/")[tipih] in #link("https://docs.julialang.org/en/v1/manual/interfaces/")[vmesnikih]. Napišite funkcijo `x, it = sor(A, b, x0, omega, tol=1e-10)`, ki reši razpršeni sistem $A x = b$ z SOR iteracijo. Pri tem je `x0` začetni približek, `tol` pogoj za ustavitev iteracije in `omega` parameter pri SOR iteraciji. Iteracija naj se ustavi, ko je $ |A bold(x)^((k))-bold(b)|_oo < delta, $ kjer je $delta$ podan s argumentom `tol`. Metodo uporabite za vložitev grafa v ravnino ali prostor #link("https://en.wikipedia.org/wiki/Force-directed_graph_drawing")[s fizikalno metodo]. Če so $(x_i , y_i , z_i)$ koordinate vozlišč grafa v prostoru, potem vsaka koordinata posebej zadošča enačbam $ -"st"(i)x_i + sum_(j in N(i)) x_j &= 0,\ -"st"(i)y_i + sum_(j in N(i)) y_j &= 0,\ -"st"(i)z_i + sum_(j in N(i)) z_j &= 0, $ kjer je $s t lr((i))$ stopnja $i$-tega vozlišča, $N lr((i))$ pa množica indeksov sosednjih vozlišč. Če nekatera vozlišča fiksiramo, bodo ostala zavzela ravnovesno lego med fiksiranimi vozlišči. Napišite funkcijo `ravnovesni_sistem`, ki za dani graf in koordinate vozlišč, ki so fiksirana, vrne matriko sistema in desne strani enačb za posamezne koordinate za vozlišča, ki niso fiksirana. Za primer lahko upodobite [graf krožno lestev](https://en.wikipedia.org/wiki/Ladder_graph#Circular_ladder_graph), kjer polovica vozlišč enakomerno razporedite na enotski krožnici. Za risanje grafa lahko uporabite #link("https://github.com/JuliaPlots/GraphRecipes.jl")[GraphRecipes.jl]. Za primere, ki jih boste opisali, poiščite optimalni $omega$, pri katerem SOR najhitreje konvergira in predstavite odvisnost hitrosti konvergence od izbire $omega$. == Metoda konjugiranih gradientov za razpršene matrike <metoda-konjugiranih-gradientov-za-razpršene-matrike> Definirajte nov podatkovni tip `RazprsenaMatrika`, kot je opisano v prejšnji nalogi. Napišite funkcijo `[x,i]=conj_grad(A, b)`, ki reši sistem $ A x = b, $ z metodo konjugiranih gradientov za `A` tipa `RazprsenaMatrika`. Metodo uporabite na primeru vložitve grafa v ravnino ali prostor s fizikalno metodo, kot je opisano v prejšnji nalogi. == Metoda konjugiranih gradientov s pred-pogojevanjem <metoda-konjugiranih-gradientov-s-predpogojevanjem> Za pohitritev konvergence iterativnih metod, se velikokrat izvede t. i. pred-pogojevanje\(angl. preconditioning). Za simetrične pozitivno definitne matrike je to pogosto nepopolni razcep Choleskega, pri katerem sledimo algoritmu za razcep Choleskega, le da ničelne elemente pustimo pri miru. Naj bo A $n times n$ pozitivno definitna razpršena matrika\(velika večina elementov je ničelnih $a_(i j) = 0$). Matriko zaradi prostorskih zahtev hranimo kot #emph[sparse] matriko. Poglejte si dokumentacijo za #link("https://docs.julialang.org/en/v1/stdlib/SparseArrays/")[razpršene matrike]. Napišite funkcijo `L = nep_chol(A)`, ki izračuna nepopolni razcep Choleskega za matriko tipa `AbstractSparseMatrix`. Napišite še funkcijo `x, i = conj_grad(A, b, L)`, ki reši linearni sistem $ A x = b $ s pred-pogojeno metodo konjugiranih gradientov za matriko $M = L^T L$ kot pred-pogojevalcem. Pri tem pazite, da matrike $M$ ne izračunate, ampak uporabite razcep $M = L^T L$. Za različne primere preverite, ali se izboljša hitrost konvergence. == QR razcep zgornje hessenbergove matrike <qr-razcep-zgornje-hessenbergove-matrike> Naj bo $H$ $n times n$ zgornje hessenbergova matrika \(velja $a_(i j) = 0$ za $j lt j - 2 i$). Definirajte podatkovni tip `ZgornjiHessenberg` za zgornje hessenbergovo matriko. Napišite funkcijo `Q, R = qr(H)`, ki izvede QR razcep matrike `H` tipa `ZgornjiHessenberg` z Givensovimi rotacijami. Matrika `R` naj bo zgornje trikotna matrika enakih dimenzij kot `H`, v `Q` pa naj bo matrika tipa `Givens`. Podatkovni tip `Givens` definirajte sami tako, da hrani le zaporedje rotacij, ki se med razcepom izvedejo in indekse vrstic, na katere te rotacije delujejo. Posamezno rotacijo predstavite s parom $ [cos(alpha); sin(alpha)], $ kjer je $alpha$ kot rotacije na posameznem koraku. Za podatkovni tip definirajte še množenje `Base.*` z vektorji in matrikami. Uporabite QR razcep za QR iteracijo zgornje hesenbergove matrike. Napišite funkcijo `lastne_vrednosti, lastni_vektorji = eigen(H)`, ki poišče lastne vrednosti in lastne vektorje zgornje hessenbergove matrike. Preverite časovno zahtevnost vaših funkcij in ju primerjajte z metodami `qr` in `eigen` za navadne matrike. == QR razcep simetrične tridiagonalne matrike <qr-razcep-simetrične-tridiagonalne-matrike> Naj bo $A$ $n times n$ simetrična tridiagonalna matrika \(velja $a_(i j) = 0$ za $lr(|i - j|) gt 1$). Definirajte podatkovni tip `SimetricnaTridiagonalna` za simetrično tridiagonalno matriko, ki hrani glavno in stransko diagonalo matrike. Za tip `SimetricnaTridiagonalna` definirajte metode za naslednje funkcije: - indeksiranje: `Base.getindex`,`Base.setindex!`,`Base.firstindex` in `Base.lastindex` - množenje z desne `Base.*` z vektorjem ali matriko Časovna zahtevnost omenjenih funkcij naj bo linearna. Več informacij o #link("https://docs.julialang.org/en/v1/manual/types/")[tipih] in Napišite funkcijo `Q, R = qr(T)`, ki izvede QR razcep matrike `T` tipa `Tridiagonalna` z Givensovimi rotacijami. Matrika `R` naj bo zgornje trikotna tridiagonalna matrika tipa `ZgornjeTridiagonalna`, v `Q` pa naj bo matrika tipa `Givens`. #link("https://docs.julialang.org/en/v1/manual/interfaces/")[vmesnikih]. Podatkovna tipa `ZgornjeTridiagonalna` in `Givens` definirajte sami (glejte tudi nalogo #ref(<qr-razcep-zgornje-hessenbergove-matrike>). Poleg tega implementirajte množenje `Base.*` matrik tipa `Givens` in `ZgornjeTridiagonalna`. Uporabite QR razcep za QR iteracijo simetrične tridiagonalne matrike. Napišite funkcijo `lastne_vrednosti, lastni_vektorji = eigen(T)`, ki poišče lastne vrednosti in lastne vektorje simetrične tridiagonalne matrike. Preverite časovno zahtevnost vaših funkcij in ju primerjajte z metodami `qr` in `eigen` za navadne matrike. == Inverzna potenčna metoda za zgornje hessenbergovo matriko <inverzna-potenčna-metoda-za-zgornje-hessenbergovo-matriko> Lastne vektorje matrike $A$ lahko računamo z #strong[inverzno potenčno metodo]. Naj bo $A_lambda = A - lambda I$. Če je $lambda$ približek za lastno vrednost, potem zaporedje vektorjev $ x^((n+1))=(A_lambda^(-1)x^((n))) / (|A_lambda^(-1)x^((n))|), $ konvergira k lastnemu vektorju za lastno vrednost, ki je po absolutni vrednosti najbližje vrednosti $lambda$. Da bi zmanjšali število operacij na eni iteraciji, lahko poljubno matriko $A$ prevedemo v zgornje hessenbergovo obliko \(velja $a_(i j) = 0$ za $j lt i - 2$). S hausholderjevimi zrcaljenji lahko poiščemo zgornje hesenbergovo matriko H, ki je podobna matriki A: $ H=Q^T A Q. $ Če je $v$ lastni vektor matrike $H$, je $Q v$ lastni vektor matrike $A$, lastne vrednosti matrik $H$ in $A$ pa so enake. Napišite funkcijo `H, Q = hessenberg(A)`, ki s Hausholderjevimi zrcaljenji poišče zgornje hesenbergovo matriko `H` tipa `ZgornjiHessenberg`, ki je podobna matriki `A`. Tip `ZgornjiHessenberg` definirajte sami, kot je opisano v nalogi o QR razcepu zgornje hessenbergove matrike. Poleg tega implementirajte metodo `L, U = lu(A)` za matrike tipa `ZgornjiHessenberg`, ki bo pri razcepu upoštevala lastnosti zgornje hessenbergovih matrik. Matrika `L` naj ne bo polna, ampak tipa `SpodnjaTridiagonalna`. Tip `SpodnjaTridiagonalna` definirajte sami, tako da bo hranil le neničelne elemente in za ta tip matrike definirajte operator `Base.\`, tako da bo upošteval strukturo matrikw `L`. Napišite funkcijo `lambda, vektor = inv_lastni(A, l)`, ki najprej naredi hessenbergov razcep in nato izračuna lastni vektor in točno lastno matrike `A`, kjer je `l` približek za lastno vrednost. Inverza matrike `A` nikar ne računajte, ampak raje uporabite LU razcep in na vsakem koraku rešite sistem $L lr((U x^(n + 1))) = x^n$. Metodo preskusite za izračun ničel polinoma. Polinomu $ x^n + a_{n-1}x^{n-2} + ... a_1x + a_0 $ lahko priredimo matriko $ mat( 0, 0, dots, 0, -a_0; 1, 0, dots, 0, -a_1; 0, 1, dots, 0, -a_2; dots.v, dots.v, dots.down, dots.v, dots.v; 0, 0, dots, 1, -a_(n-1) ) $ katere lastne vrednosti se ujemajo z ničlami polinoma. == Inverzna potenčna metoda za tridiagonalno matriko <inverzna-potenčna-metoda-za-tridiagonalno-matriko> Lastne vektorje matrike $A$ lahko računamo z #strong[inverzno potenčno metodo]. Naj bo $A_lambda = A - lambda I$. Če je $lambda$ približek za lastno vrednost, potem zaporedje vektorjev $ x^{(n+1)}=(A_lambda^(-1)x^((n)))/(|A_lambda^(-1)x^((n))|), $ konvergira k lastnemu vektorju za lastno vrednost, ki je po absolutni vrednosti najbližje vrednosti $lambda$. Naj bo $A$ #strong[simetrična matrika]. Da bi zmanjšali število operacij na eni iteraciji, lahko poljubno simetrično matriko $A$ prevedemo v tridiagonalno obliko. S hausholderjevimi zrcaljenji lahko poiščemo tridiagonalno matriko T, ki je podobna matriki A: $ T=Q^T A Q. $ Če je $v$ lastni vektor matrike $T$, je $Q v$ lastni vektor matrike $A$, lastne vrednosti matrik $T$ in $A$ pa so enake. Napišite funkcijo `T, Q = tridiag(A)`, ki s Hausholderjevimi zrcaljenji poišče tridiagonalno matriko `H` tipa `Tridiagonalna`, ki je podobna matriki `A`. Tip `Tridiagonalna` definirajte sami, kot je opisano v nalogi o QR razcepu tridiagonalne matrike. Poleg tega implementirajte metodo `L, U = lu(A)` za matrike tipa `Tridiagonalna`, ki bo pri razcepu upoštevala lastnosti tridiagonalnih matrik. Matrike `L` in `U` naj ne bodo polne matrike. Matrika `L` naj bo tipa `SpodnjaTridiagonalna`, matrika `U` pa tipa `ZgornjaTridiagonalna`. Tipa `SpodnjaTridiagonalna` in `ZgornjaTridiagonalna` definirajte sami, tako da bosta hranila le neničelne elemente. Za oba tipa definirajte operator `Base.\`, tako da bo upošteval strukturo matrik. Napišite funkcijo `lambda, vektor = inv_lastni(A, l)`, ki najprej naredi hessenbergov razcep in nato izračuna lastni vektor in točno lastno matrike `A`, kjer je `l` približek za lastno vrednost. Inverza matrike `A` nikar ne računajte, ampak raje uporabite LU razcep in na vsakem koraku rešite sistem $L lr((U x^(n + 1))) = x^n$. Metodo preskusite na laplaceovi matriki, ki ima vse elemente $0$ razen $l_(i i) = - 2 , l_(i + 1 , j) = l_(i , j + 1) = 1$. Poiščite nekaj lastnih vektorjev za najmanjše lastne vrednosti in jih vizualizirajte z ukazom `plot`. Lastni vektorji laplaceove matrike so približki za rešitev robnega problema za diferencialno enačbo $ y''(x) = lambda^2 y(x), $ katere rešitve sta funkciji $sin(lambda x)$ in $cos(lambda x)$. == Naravni zlepek <naravni-zlepek> Danih je $n$ interpolacijskih točk $lr((x_i , f_i))$, $i = 1 , 2 dots n$. #strong[Naravni interpolacijski kubični zlepek] $S$ je funkcija, ki izpolnjuje naslednje pogoje: + $S lr((x_i)) = f_i , quad i = 1 , 2 dots n dot.basic$ + $S$ je polinom stopnje $3$ ali manj na vsakem podintervalu $lr([x_i , x_(i + 1)])$, $i = 1, 2 dots n - 1$. + $S$ je dvakrat zvezno odvedljiva funkcija na interpolacijskem intervalu $lr([x_1 , x_n])$ + $S^(prime prime) lr((x_1)) = S^(prime prime) lr((x_n)) = 0$. Zlepek $S$ določimo tako, da postavimo $ S(x)=S_i(x)=a_i+b_i (x-x_i)+c_i (x-x_i)^2+d_i (x-x_i)^3, #h(1em) x in [x_i,x_(i+1)], $ nato pa izpolnimo zahtevane pogoje #footnote[pomagajte si z: Bronštejn, Semendjajev, Musiol, Mühlig: #strong[Matematični priročnik], Tehniška založba Slovenije, 1997, str. 754 ali pa <NAME>č: #strong[Interpolacija], Univerza v Ljubljani, Fakulteta za strojništvo, Ljubljana, 1999, str. 47]. Napišite funkcijo `Z = interpoliraj(x, y)`, ki izračuna koeficient polinoma $S_i$ in vrne element tipa `Zlepek`. Tip `Zlepek` definirajte sami in naj vsebuje koeficiente polinoma in interpolacijske točke. Za tip `Zlepek` napišite dve funkciji - `y = vrednost(Z, x)`, ki vrne vrednost zlepka v dani točki `x`. - `plot(Z)`, ki nariše graf zlepka, tako da različne odseke izmenično nariše z rdečo in modro barvo\(uporabi paket `Plots`). == QR iteracija z enojnim premikom <qr-iteracija-z-enojnim-premikom> Naj bo $A$ simetrična matrika. Napišite funkcijo, ki poišče lastne vektorje in vrednosti simetrične matrike z naslednjim algoritmom - Izvedi Hessenbergov razcep matrike $A = U^T T U$ \(uporabite lahko vgrajeno funkcijo `LinearAlgebra.hessenberg`) - Za tridiagonalno matriko $T$ ponavljaj, dokler ni $h_(n - 1 , n)$ dovolj majhen: - za $T - mu I$ za $mu = h_(n , n)$ izvedi QR razcep - nov približek je enak $R Q + mu I$ - Postopek ponovi za podmatriko brez zadnjega stolpca in vrstice Napiši metodo `lastne_vrednosti, lastni_vektorji = eigen(A, EnojniPremik(), vektorji = false)`, ki vrne - vektor lastnih vrednosti simetrične matrike `A`, če je vrednost `vektorji` enaka `false`. - vektor lastnih vrednosti `lambda` in matriko s pripadajočimi lastnimi vektorji `V`, če je `vektorji` enaka `true` Pazi na časovno in prostorsko zahtevnost algoritma. QR razcep tridiagonalne matrike izvedi z Givensovimi rotacijami in hrani le elemente, ki so nujno potrebni \(glej nalogo #link("@ref")[QR razcep simetrične tridiagonalne matrike]). Funkcijo preiskusi na Laplaceovi matriki grafa podobnosti \(glej #link("../vaje/3_lastne_vrednosti/06_spektralno_grucenje.md")[vajo o spektralnem gručenju]).
https://github.com/piepert/logik-tutorium-wise2024-2025
https://raw.githubusercontent.com/piepert/logik-tutorium-wise2024-2025/main/src/konzept.typ
typst
Creative Commons Zero v1.0 Universal
#import "@preview/grape-suite:1.0.0": seminar-paper, german-dates #import "/src/packages/goals.typ": * #import "/src/templates/exercise.typ": * #import "/src/templates/slides.typ": * #import "/src/packages/inference.typ": * #set text(lang: "de") #show: seminar-paper.project.with( university: "Universität Rostock", faculty: "Philosophische Fakultät", institute: "Institut für Philosophie", seminar: "Tutorium: Sprache, Logik, Argumentation", docent: none, submit-to: v(-2em), submit-by: v(-2em), author: "<NAME>", email: "<EMAIL>", address: none, semester: german-dates.semester(datetime.today()), title: [Konzept für das Logik-Tutorium am Institut für Philosophie der Universität Rostock], show-outline: true, /* abstract: [ Das Logik-Tutorium bildet für die Studierenden als eine Veranstaltung im ersten Semester die Möglichkeit, eine neue Lernumgebung kennenzulernen sowie sich in das selbstgesteuerte Lernen einzufinden. Es darf keine eintönige Lehrveranstaltung sein, sondern soll soziale Kontakte und Aktivität fördern. Ein einheitliches didaktisches, visuelles und inhaltiches Konzept soll den Einstieg in die Logik und das Studium der Universität Rostock erleichtern. Gleichzeitig soll es die Kompetenzen und Inhalte des Moduls "Sprache, Logik, Argumentation" erfassen und den Studierenden einen Raum geben, sich diese anzueignen. ], */ footer: [], header-left: context { if here().page() <= 2 { return none } if calc.rem(counter(page).at(here()).first(), 2) == 1 { let l-heads = query(selector(heading.where(level: 2)).before(here())) if l-heads.len() > 0 { numbering(heading.numbering, ..counter(heading).at(l-heads.last().location())) [ ] l-heads.last().body } } else { counter(page).display() } }, header-right: context { if here().page() <= 2 { return none } show: align.with(right) if calc.rem(counter(page).at(here()).first(), 2) == 0 { let l-heads = query(selector(heading.where(level: 1)).before(here())) if l-heads.len() > 0 { numbering(heading.numbering, ..counter(heading).at(l-heads.last().location())) [ ] l-heads.last().body } } else { if here().page() == 3 { [1] } else { counter(page).display() } } }, page-margins: (inside: 3.5cm, outside: 3cm, top: 3.5cm, bottom: 3cm), show-declaration-of-independent-work: false, ) #show heading.where(level: 1): it => pagebreak(weak: true) + it = Didaktisches Konzept == Grundlegung Das erste Semester versetzt die Studierenden in ein grundlegend neues Lernumfeld. In der Schule besteht für die SuS Schulpflicht, die Lehrer nehmen eine substantielle Rolle für den Lernerfolg der SuS ein, sie sind Hauptverantwortliche für die Planung und Durchführung guten Unterrichts. Die SuS sind zur Anwesenheit und zum Ablegen eines Abschlusses verpflichtet, die Lehrer zur Unterstützung, Motivation und Intervention. Die Lehrkraft muss Wissen vermitteln und Möglichkeiten für Sicherung und Transfer ermöglichen. Im Gegensatz dazu ist die Universität eine freiwillige und elitäre Bildungsanstalt, die den Studierenden ein Lernangebot macht. In den meisten Veranstaltungen herrscht keine Anwesenheitspflicht. Die Dozierenden bieten fakultative und punktuelle Aufarbeitungen von Themen an, in der Art und Weise, wie sie bereit sind, Ressourcen dafür zu investieren. Dies reicht von didaktisch durchgeplanten Einheiten und Sitzungen, bis hin zu spontan entstehenden Seminaren, die reinen Überblickscharakter haben. Dozierstile variieren stark. Es gibt für die Dozierenden keine Verpflichtung, Sicherung und Transfer der Phasen -- oder Kompetenzgenerierung überhaupt -- zu gewährleisten. Die Studierenden sind in der Rolle, die Angebote zu ergreifen, die sie als sinnvoll erachten, und sich weiterführendes Material, Lektüre und generell Hilfe an sich selbständig zu suchen. Für gute Lehrveranstaltungen und ihren Lernerfolg sind die Studierenden selbst verantwortlich. Die Studierenden sind dabei nicht auf sich allein gestellt. Neben den Dozierenden, die den Lernprozess unterstützen können, sollen vorallem Kommilitonen sich gegenseitig absichern. Studieren ist kein Alleingang. Um diesen Übergang von der Schule ins Studium zu erleichtern, sollten die ersten Lehrveranstaltungen so konzipiert sein, dass sie den Studierenden diese Selbstverantwortlichkeit zeigen und sie in den Modus zu bringen, aktiv, vorbereitend und nachbereitend an den Lehrveranstaltungen teilzunehmen. Kommilitonen sollen sich untereinander vernetzen, Arbeit teilen, sich gegenseitig Hilfe liefern und unereinander sozialisieren. Daher verfolgt das Logik-Tutorium fünf Ziele: + *das methodische Ziel:* Das Tutorium soll die Studierenden in das methodisch-selbstgesteuerte Lernen einführen. + *das soziale Ziel:* Das Tutorium die Studierenden untereinander zu vernetzen. + *das inhaltliche Ziel:* Die Inhalte des Tutorium sollen mindestens die klausurrelevanten Inhalte erfassen. + *das Forderungs- und Förderungsziel:* Das Tutorium soll Studierende, die Probleme mit Logik haben, unterstützen und Studierende, denen Logik leicht fällt, fordern. Zusätzlich sollen die Studierenden Möglichkeiten haben, zu ihrem Leistungsstand beurteilt zu werden. + *das situative Ziel:* Die Studierenden fühlen sich mit der Lehrkraft wohl, haben keine Angst, Fragen untereinander auszutauschen und im Plenum oder individuell zu äußern, haben Spaß an der Arbeit miteinander und an den Themen des Tutoriums und fühlen sich generell in der Situation des Tutoriums wohl, gut aufgehoben und gut betreut. == Logisches Kompetenzmodell Aus den fünf Zielen des Tutoriums sind die im Tutorium zu generierenden Kompetenzen der Studierenden ableitbar. + *Methodenkompetenz* beschreibt die Fähigkeit, die fachlichen Methoden des Logik-Moduls korrekt anwenden zu können. Dazu gehört das direkte und indirekte metasprachliche Beweisen und das direkte und indirekte Beweisen mit dem Ableitungskalkül des natürlichen Schließens, das Feststellen logischer Folgerung, Äquivalenz, Wahrheit und Falschheit mit der Wahrheitstabelle und die Formalisierung von Aussagesätzen mit der Aussagen- und Prädikatenlogik. + *Sachkompetenz* beschreibt die Fähigkeit, die Inhalte des Logik-Moduls korrekt wiedergeben, einordnen und abwägen zu können. Darunter fallen typische Definitionen -- wie die des Arguments, der deduktiven Gültigkeit, die der Schlüssigkeit -- aber auch die richtige Bestimmung von Aussagesätzen, hinreichenden und notwendigen Bedingungen und die korrekte Vervollständigung des logischen Quadrats. + *Selbstkompetenz* beschreibt die Fähigkeit, das eigene Lernverhalten reflektieren und anpassen zu können. + *Sozialkompetenz* beschreibt die Fähigkeit, das eigene Sozialverhalten auf andere anpassen und reflektieren, sowie alleine und in Gruppen arbeiten zu können. Um die Ziele des Tutoriums umzusetzen, ist eine systematische Förderung dieser Kompetenzen angebracht. Für das Bestehen der Klausur ist besonders die logische Methodenkompetenz und Sachkompetenz relevant, für das erfolgreiche Abschließen des Studiums aber auch die Sozial- und Selbstkompetenz. Die Studierenden sollen sich nicht nur fachliche Fertigkeiten aneigenen, sondern sich auch als eine Studierendenschaft verstehen lernen und Freunde und Lerngruppen unter ihren Kommilitonen finden und ihr eigenes Lernverhalten optimieren können. == Methoden und Sozialformen In Anbetracht der Ziele gilt es, die Methoden und Sozialformen des Tutoriums so zu wählen, dass die gesetzten Ziele erreicht werden. Als grundlegendes Paradigma gilt es, eine Vielfalt an verschiedenen Methoden und Sozialformen anzuwenden. Dazu gilt eine Einschränkung: Der Frontalunterricht, indem ein Dozent die Inhalte als Lehrervortrag vermittelt, ist mit sehr viel bedacht anzuwenden. + Der *Frontalunterricht fördert den Bystander-Effekt*: Die Studierenden lehnen sich in der neuen Situation zurück und aufgrund fehlenden Verantwortlichkeitsgefühls wird auf Nachfragen und Aktivitätsaufforderungen nur bedingt eingegangen. + Der *Frontalunterricht fördert passiv-schulisches Lernverhalten*: Die Studierenden werden an den Frontalunterricht in der Schule erinnert, in dem die Verantwortlichkeit bei der Lehrkraft lag. Dadurch fehlt die aktive Auseinandersetzung mit den Problemen, es wird eine Erwartungshaltung aufgebaut, in dem die Dozierenden die Inhalte den Studierenden präsentieren sollten, statt dass sie diese selbst erarbeiten. + Der *Frontalunterricht erschwert das Erreichen des sozialen Ziels*: Da Studierenden im Frontalunterricht passiv die präsentierten Inhalte aufnehmen, kommt es nicht zu einer Interaktion untereinander. Im Gegenteil sogar: Interaktionen untereinander sind -- sofern nicht explizit gefordert -- im Frontalunterricht nicht erwünscht. Damit fällt es schwer, das soziale Ziel bei einer Überaktzentuierung des Frontalunterrichts umzusetzen. Statt des Frontalunterrichts sollen Methoden gewählt werden, die verschiedene Sozialformen durchlaufen: etwa das Gruppenpuzzle ermöglicht es den Studierenden sich zuerst in Einzelarbeit Expertenwissen anzueignen, dieses in zwei Phasen als Gruppenarbeit untereinander zu präsentieren und zu besprechen und zuletzt im Plenum zu vergleichen. Die zufällige Aufteilung von Gruppen schafft die Möglichkeit, dass Studierende sich untereinander kennenlernen können und ein Gemeinschaftsgefühl in der Veranstaltung entsteht. Gleichzeitig sollten aber auch Möglichkeiten geboten werden, dass die Studierenden sich in eine Gruppe begeben können, in der sie sein wollen. Die Studierenden müssen erkennen, dass sie die Lehrveranstaltung mitgestalten können. Eine rein zufällige Aufteilung von Gruppen kann dabei hinderlich sein. Die Studierenden sollen sowohl Möglichkeiten bekommen, selbständig an Problemen zu arbeiten, sich in Kleingruppen zu äußern, aber auch den Tutor als Moderator, Vermittler und berichtigende Instanz in Großgruppengesprächen nutzen zu können. Folgende Methoden sollen im Logik-Tutorium angewandt werden: - *Aufgaben erstellen* \ In einem Gruppenpuzzle wird die Einzelarbeitsphase überprungen, von den Expertengruppen eine Aufgabe zum aktuellen Thema der Sitzung gestaltet. In den Stammgruppen werden die Aufgaben untereinander ausgetauscht, bearbeitet und verglichen. Im Plenum findet eine kurze Reflexion statt. - *Gruppenbefragung* \ Die Studierenden schreiben zuerst in Einzelarbeit je eine Frage auf, die sie inhaltich gerade beschäftigt. Danach werden die Studierenden in Gruppen aufgeteilt. Aus den Fragen werden so viele ausgelost, dass jede Gruppe eine Frage hat. Es folgt eine Bearbeitungszeit, in der die Gruppen versuchen eine ausführliche Antwort auf ihre Frage zu finden. Je nach Schnelligkeit können die Gruppen neue Fragen bekommen. Am Ende werden die Ergebnisse im Plenum in einem Vortrag diskutiert. Im Vortrag sollen + das Problem und wie es interpretiert wurde, + die Herangehensweise zur Problemlösung und + die Antwort enthalten sein. Dabei ist zu beachten, dass es zu Missverständnissen der Frage kommen kann und diese nicht beantwortet wird. - *Gruppenpuzzle* \ Die Studierenden werden in Gruppen eingeteilt, die Stammgruppen heißen. Jeder Teilnehmer jeder Stammgruppe wählt ein zu erarbeitendes Thema so, dass in jeder Stammgruppe jedes Thema mindestens einmal vorkommt. Alle Studierenden eines Themas werden die Experten dieses Themas. Alle Experten treffen sich mit gleichartigen Experten in Expertengruppen. Dort wird zuerst in Einzelarbeit das Thema erarbeitet, danach vergleichen die Experten untereinander ihre Ergebnisse, ergänzen und bessern sie aus. Die Stamgruppen finden sich darauf wieder zusammen, jeder Experte stellt sein eigenes Thema vor. Im Plenum werden am Ende offen gebliebene Fragen aufgegriffen und geklärt. - *KAWA* \ Die Dozierenden schreiben die Buchstaben eines Begriffes untereinander, die Studierenden finden wichtige Begriffe aus der aktuellen Sitzung, die mit dem Anfangsbuchstaben beginnen, wie bei einem Akrostichon. - *Quiz* \ Es wird ein Quiz mit Fragen zum Inhalt der Sitzung vorbereitet und von den Studierenden absolviert. - *Spickzettel erstellen* \ Ein inhaltliches Thema wird kurz und übersichtlich auf einem Zettel festgehalten. - *Schlussdiskussion* \ Kurze Reflexion der Stunde, in der alle Teilnehmenden kurz in je einem Satz erläutern, was sie gelernt haben und was sie in Zukunft verbessern/lernen/nacharbeiten möchten. == Medien Die wichtigsten Medien des Tutoriums sind + die Folien des Tutoriums, + die fakultativen Aufgabenblätter des Tutoriums, + das Skript der Vorlesung#footnote[Das Skript wird zitiert mit "Skript p. 94 / S. 181." Die Abkürzung "p." meint die PDF-Seite, also "$x$ / 115" und "S." steht für die Buchseiten ab p. 16 steht.] und + die fakultativen Lernevaluationen des Tutoriums. Die Medien sind so zu gestalten, dass sie möglichst vielseitig sind und jeder Inhalt des Tutoriums durch verschiedene Medien gestützt ist. Die Studierenden sind individuell und vielfältig, sie benötigen verschiedene Lernwege, daher sind nicht nur abwechslungsreiche Methoden und Sozialformen, sondern auch abwechslungsreiche Medien einzusetzen. Die Studierenden sollen dazu angehalten werden, sich verschiedene Medien zu Nutze zu machen und selbständig Medien zu erschaffen, etwa in Form von Lernübersichten, Plakaten oder Vorlesungsmitschriften. Dazu sollen diese aktiv mit in das Tutorium einbezogen werden. Das ist auf verschiedenen Weisen möglich. Kommilitonen können sich untereinander Vorlesungsmitschriften präsentieren oder sie Grundlage für Gruppenarbeiten oder ähnlichem werden lassen. Als Ergebnis von Erarbeitungs- oder Sicherungsphasen können Lernübersichten oder Plakate dienen, wobei diese direkt den Mehrwert haben, zur Klausurvorbereitung verwendet werden zu können. == Formale Struktur Die Struktur des Tutoriums soll transparent und gut geplant sein, jedoch auch so flexibel, dass die Studierenden ihre eigenen Probleme, Fragen und Interessen mit einbringen können. Dieser Grundsatz soll das situative Ziel des Tutoriums unterstützen, indem die Studierenden die Möglichkeit haben das Tutorium mitzugestalten. Außerdem soll es das methodische Ziel unterstützen, indem die Studierenden Eigenverantwortlichkeit für die Art und Weise ihres Lernprozesses übernehmen. === Sequenzstruktur Die Gestaltung der einzelnen Sequenzen des Logik-Tutoriums nimmt die abzudeckenden Inhalte (siehe @inhalte) und bricht diese in grobe Sequenzen auf. Jede Sequenz besteht aus mindestens einer Sitzung, beginnt mit einer Inhaltsübersicht und endet mit einer fakultativen Lernevaluation (LEVs), das in Form eines Testats außerhalb des Tutoriums stattfindet. Dies kann nach Absprache in Präsenz vor bzw. nach dem Tutorium stattfinden oder asynchron online. Dabei ist darauf zu achten, dass Reservesitzungen eingeplant sind, um die Möglichkeit abzudecken, dass die Studierenden langsamer sind, als erwartet, oder das Tutorium mit von ihnen gewünschten Inhalten füllen können. Der Ablauf einer Sequenz kann wie folgt zusammengefasst werden: + *Vorstellung der Sequenz:* Die Studierenden kennen den groben Ablauf der Sequenz und wissen, welche Fähigkeiten sie am Ende der Sequenz beherrschen sollen. + *Durchführung der Sequenz:* Die Studierenden generieren die geplanten Kompetenzen. + *Evaluation der Sequenz:* Die Studierenden haben die Möglichkeit, zu prüfen, ob sie die Ziele, die durch die Sequenz vorgegeben wurden, erreicht haben. Die LEVs in Form eines Testats kann um eine fakultative Beurteilung durch die Tutoriumsleitung ergänzt werden. Durch individuelles Feedback zu den erdachten Lösungen erhalten die Studierenden die Möglichkeit, ihre Fähigkeiten besser einschätzen zu lassen und auf Fehler aufmerksam zu werden, die sie selbst übersehen haben. Eine andere Möglichkeit wäre, die Studierenden untereinander Feedback geben zu lassen und somit das soziale Ziel in den Fokus zu rücken. Dies kann jedoch auch als eine der Stellen im Tutorium verwendet werden, in denen die Tutoriumsleitung aktiv umfangreiches Feedback anbietet. === Sitzungsstruktur Die von der aktuellen Sequenz bestimmten Inhalte werden in einzelne Sitzungen verteilt. Jede Sitzung wird eingeleitet und enthält einen klaren Abschluss. Der Aufbau einer Sitzung ist an das PEST-Modell angelehnt: + *Problematisierung:* Das Problem der Sitzung wird motiviert und konkretisiert. Den Studierenden wird klar, _was_ sie lernen müssen, _warum_ es relevant ist und _wie_ es in den Kontext der Lehrveranstaltung einzuordnen ist. + *Erarbeitung:* Die Studierenden entwickeln eine Lösung des Problems bzw. Ansätze für eine Lösung. + *Sicherung:* Die Ergebnisse der Erarbeitung werden verglichen, korrigiert und verfeinert. Die Studierenden haben hier die Möglichkeit, eigene Fehler zu erkennen und ihr Ergebnis zu konkretisieren. + *Transfer:* Das gesicherte Ergebnis wird auf ein Beispiel angewendet, in dem das in der ersten Phase charakterisierte Problem auftritt. Die Studierenden erkennen, dass das Problem gelöst wurde. Dazu kommen eine Einleitungs- und Abschlussphase. In der Einleitungsphase wird den Studierenden die Möglichkeit gegeben, Themen in den Raum zu werfen, die sie in künftigen Sitzungen wiederholen wollen, organisatorische Fragen zu stellen oder sonstige Hinweise zu geben. Darauf folgt eine Wiederholung der Themen der letzten Sitzung inklusive einer einfachen aber klausur-gerechten Transferaufgabe zu dieser Sitzung. Im Anschluss beginnt die oben dargestellte Unterrichtsstruktur des PEST-Modells. Nach Beendigung der Transferphase folgt erneut die Möglichkeit für die Studierenden Fragen zu stellen oder Anmerkungen zu machen, dann ein thematischer Ausblick und eine Reflexion der Sitzung. Die Reflexion wird in Studierendenhand gegeben. Alle Studierenden (inklusive der Tutoriumsleitung) sollen je die folgenden Fragen beantworten: + Was nehmen Sie aus dieser Sitzung mit? + Woran wollen Sie in Zukunft arbeiten? Daraufhin wird die Sitzung geschlossen. == Inhaltliche Struktur Eine grundlegende Frage ist: Wie sind die Inhalte der Logik zu vermitteln? Das eröffnet den Aspekt, wie die Tutorumsleitung dafür sorgen kann, den Lernprozess möglichst gut zu gestalten. === Motivation, Problemorientierung und Zielorientierung Zur Aufrechterhaltung des intensiven, langfristigen auseinandersetzens mit einem Lerngebiet, ist Motivation nötig. Das bedeutet, dass die Inhalte nicht einfach "vorgesetzt" werden dürfen. Es lernt sich besser, wenn der _Sinn_ des Inhaltes den Lernenden bekannt ist. Diese Motivation kann durch eine Problemorientierung aufgebaut und durch eine Zielorientierung beibehalten werden. Statt den Studierenden vorzusetzen, was ein gültiger Schluss ist und wie er auszusehen hat, könnte man etwa mit einem Szenario starten, in dem zwei Argumente gebracht werden. Die Studierenden sollen bewerten, welches "besser" ist. Das ungültige, vielleicht ein Autoritätsargument, sagt gar nichts über die Richtigkeit der Konklusion aus und ist somit "schlechter" als das Gültige. Die Notwendigkeit zur Bewertung von Argumenten ist damit motiviert. Durch mehrere Vergleiche und aufeinander bauende Stufen, in denen die Studierenden sich die einzelnen Kriterien selbst erarbeiten und sich ihnen bewusst werden, ist der innere Drang, die aufgeworfenen Hürden und Probleme zu lösen, viel höher, als beim Vorgeben von Definitionen. Eine Motivierung durch Probleme ist damit vorteilhaft. Eine reine Aneinanderreihung von Problemen und Beispielen kann jedoch trotzdem Orientierungslosigkeit hervorrufen, die Frage kommt auf, wo man denn eigentlich hin wolle. Die Lösung: eine Zielorientierung. Der Lernprozess (z.B. eine Sequenz und einzelne Sitzung) wird gestartet, indem man den Studierenden aufzeigt, was sie am Ende können sollen. Auch dies kann über ein Problem geschehen: die Lösung des Problems kann ein Ziel des Lernens sein. Weiterhin können Zusammenfassungen zwischendurch und am Ende helfen, den Überblick zu behalten. *Den Studierenden muss ihr eigener Fortschritt bewusst werden.* Sie dürfen nicht orientierungslos durch das Tutorium laufen. === Strukturierung des Begriffserwerbs Die Strukturierung anhand von Problemen ist eine Möglichkeit zur feineren Planung konkreter Lernsituationen. Eine Möglichkeit für den groben Ablauf der Themen wäre die Strukturierung nach fester inhaltlicher Abschnitte, die ihre Themen erschöpfend behandeln, z.B.: + Logische Grundlagen + Aussagenlogik + Prädikatenlogik Jedoch bietet es sich an, Themen nicht direkt erschöpfend zu handeln, um Überforderung vorzubeugen. Das lässt sich an einem Beispiel zeigen: Das Konditional und das Bikonditional bieten viele Gesprächsthemen. Zum Einen ist die Semantik der materiellen Implikation nicht immer alltagsnahe. Zum anderen sind notwendige und hinreichende Bedinungen, Formulierungen mit "nur" und logisch-äquivalente Formulierungsvarianten, sowie das Gesetz der Kontraposition, sehr viel auf einmal, was behandelt wird, besonders für Logik-Einsteiger. Beide haben signifikante Bedeutung für die Argumentation, besonders wenn es um ihre tautologischen Varianten (logische Folgerung und logische Äquivalenz) geht. Mit Bezug auf die Problemorientierung kann hier nicht immer davon ausgegangen werden, dass ein passender Übergang vom einen zum anderen möglich ist. Die alternative: eher einander nähere Themen hintereinander behandeln, statt eine direkte fachliche Gliederung. Dieselben Bereiche können mehrmals behandelt werden, dies schafft Wiederholung und Festigung, dann können sie vertieft und erweitert werden. == Aufgabenstellungen Ähnlich der Standardisierung der Operatoren gibt es für das Tutorium nur eine begrenzte Auswahl an möglichen Aufgabenstellungen, die jeweils ein gewisses Ziel verfolgt, d.i. meist das Fördern einer bestimmten Fertigkeit. Dementsprechend müssen die Aufgabenstellungen sich ebenfalls an Inhalten von @inhalte orientieren. === Obligatorische Aufgabenstellungen <o-aufgaben> Die folgenden Aufgabenstellungen müssen von allen Studierenden nach Abschluss des Moduls weitestgehend ohne Probleme gelöst werden können: + Aussagesätze identifizieren + Definition von Grundkonzepten + aussagenlogische Formalisierung + zum Verständnis von Sätzen mit „wenn“, „dann“ und „nur“ sowie von notwendigen und hinreichenden Bedingungen: - alternative, äquivalente Formulierungen identifizieren können - notwendige und hinreichende Bedingungen bestimmen können + logische Wahrheit, logische Falschheit, logische Folgerung und logische Äquivalenz mit der Wahrheitstabelle zeigen + Beweise mit dem aussagenlogischen Kalkül des natürlichen Schließens + prädikatenlogische Formalisierung + Zusammenhänge und Felder im logischen Quadrat ausfüllen + Beweise mit dem prädikatenlogischen Kalkül des natürlichen Schließens + verzweigte Beweise mit dem Kalkül des natürlichen Schließens Diese Aufgabenstellungen können beliebig kombiniert werden, so kann etwa für einen Beweis zuerst eine Formalisierung gefordert werden und dann ein Beweis mit dem Kalkül des natürlichen Schließens. === Erweiterte Aufgabenstellungen Diese Aufgabenstellungen sind ergänzend zu den obigen zu verstehen, in der Hinsicht, dass sie beim Bearbeiten ein tieferes Verständnis für die Inhalte erzeugen können: + metasprachlich Beweisen + Anführungszeichen setzen + Belegungen für wahre Aussagen finden + Interpretation aussagenlogischer Sätze mit Hilfe der Wahrheitstabelle + syntaktisch korrekte AL-Sätze identifizieren + syntaktisch korrekte PL-Sätze identifizieren + Argumente entkräften, durch Ablehnung einer Prämisse oder Aufzeigen von Ungültigkeit + aussagenlogische Junktoren benennen und erklären + Hauptjunktor bestimmen + Wahrheitstabelle für Ausdrücke bilden + Modelle für prädikatenlogische Ausdrücke bestimmen, in denen die Ausdrücke wahr sind + prädikatenlogische Ausdrücke für gegebene Modelle bestimmen, sodass die Ausdrücke wahr sind (am besten keine logisch wahren) = Visuelles Konzept == Farbgebung und Typografie Der Grundsatz für die Medien des Tutoriums heißt: wenige, gut unterscheidbare Farben. Daher habe ich mich für fünf Farben entschieden, drei Primärfarben, zwei Sekundärfarben: // #circle(fill: yellow) #align(center, block(breakable: false, stack(dir: ltr, spacing: 0.5cm, ..((blue, [Blau]), (purple, [Dunkelblau]), (magenta, [Magenta]), (brown, [Braun]), (yellow, [Gelb])).map(e => { block(width: 2cm, { circle(fill: e.first()) e.last() }) })))) Diese drei Farben sind sowohl visuell ansprechend, als auch in den meisten Farbschwächen noch angemessen zu unterscheiden. So ist zum Beispiel diese Palette für Menschen mit Rot-Grün-Schwäche noch unterscheidbar: #align(center, block(breakable: false, stack(dir: ltr, spacing: 0.5cm, ..((rgb("#7672E5"), [Blau]), (rgb("#2A2A69"), [Dunkelblau]), (rgb("#B4BC6D"), [Magenta]), (rgb("#6A6E16"), [Braun]), (rgb("#E6EB65"), [Gelb])).map(e => { block(width: 2cm, { circle(fill: e.first()) e.last() }) })))) Das dunkle Blau wird die Hauptakzentfarbe der Dokumente, so etwa für allgemeine Gestaltungselemente wie Überschriften, Links, o.ä. Die anderen sind zum Hervorheben bestimmter anderer Aspekte gedacht. Typografisch ist besonders eine Entscheidung getroffen wurden: gewählt wurde die Schriftart #link("https://brailleinstitute.org/freefont", [Atkinson Hyperlegible]), da bei dieser auch bei geringen Schriftgrößen oder Menschen mit Sehbehinderung bis zu einem gewissen Grad die Buchstaben noch sehr gut zu unterscheiden sind: #align(center, image(width: 35%, "atkinson_blur.png")) Währenddessen bei anderen Schriftarten: #align(center, { image(width: 75%, "fonts_blur.png") set text(size: 0.75em) place([Arial], dx: 1.15cm - 0.1cm, dy: -2.37cm - 1.75cm) place([Calibri], dx: 1.15cm - 0.1cm - 0.25cm, dy: -0.1cm - 1.75cm) place([Times New\ Roman], dx: 2.15cm + 6.7cm + 5.4cm, dy: -1.75cm - 2.37cm) place([TW Cen MT], dx: 2.15cm + 6.7cm + 5.4cm, dy: -1.75cm - 0.1cm) }) == Gestaltungselemente Gestaltungselemente müssen einer klaren Syntax und Semantik folgen. Ihre Syntax soll begrenzt und ihre Semantik eindeutig sein. Das heißt, dass es eine kleine Anzahl an Gestaltungselementen gibt, die direkt vermitteln, welche Art von Information sie beinhalten. Didaktisch soll jedes Gestaltungselement direkt wirken: es kann so etwa Aufgaben anzeigen, wichtige Informationen hervorheben oder Kontext vermitteln. === Folien Auf den Folien sollen 6 Gestaltungselemente unterschieden werden: // #align(center, block(width: 70%, align(left, [ #[ #let smallblock(body) = align(center, block(align(left, body))) #set enum(spacing: 1cm) + #nobreak[Eine Definition ist eine Begriffbestimmung. Definitionen werden zur Klärung von Begriffen eingesetzt. Alle klausurrelevanten Definitionen sind auf den Folien so hervorgehoben: #smallblock(definition[ Ein Schluss heißt gültig, gdw. die Konklusion nie falsch sein kann, wenn die Prämissen wahr sind. ]) ] + #nobreak[Wichtige Dinge und Merksätze werden so dargestellt: #smallblock(notice[ Widersprechen sich die Prämissen, so ist der Schluss mit jeder beliebigen Konklusion gültig! ]) Es handelt sich dabei um Dinge, die beachtet werden müssen, oder um allgemeine Algorithmen bzw. Einschränkungen für Algorithmen und Vorgehen, um Aufgaben zu bearbeiten. ] + #nobreak[Aufgaben sind konkrete Handlungsanweisungen: #smallblock(task[ Nennen Sie die zwei Gütekriterien philosophischer Argumente! ]) Eine konkrete Handlungsanweisung auf den Folien ist von den Studierenden innerhalb des Tutoriums umzusetzen. ] + #nobreak[Lösungen ergänzen Aufgaben um einen Erwartungshorizont, der für die Studierenden einsichtbar ist: #smallblock(solution[ Die zwei Gütekriterien philosophischer Argumente sind die Gültigkeit und die Schlüssigkeit des Arguments. ]) ] + #nobreak[Beispiele sind bereits erledigte Aufgaben: #smallblock(example[ Das folgende Argument ist gültig, aber nicht schlüssig, da die Prämissen falsch sind: #normalform[ Wenn Einstein bisher Unrecht hatte, dann ist alles egal.][ Einstein hatte bisher Unrecht.][ Alles ist egal.] Einstein hatte mit seiner Relativitätstheorie bisher Recht und nicht Unrecht, daher ist die zweite Prämisse falsch. ]) Beispiele sollen den Studierenden eine Mustervorlage für die Bearbeitung bestimmter Aufgabentypen oder Problemstellungen geben. ] + #nobreak[Hinweise sind Zusatzinformationen von niedriger Priorität. #smallblock(hint[ Nur weil Einstein mit seiner Relativitätstheorie bisher Recht hatte, heißt es nicht, dass wir nicht doch noch auf Phänomene stoßen könnten, bei denen die Relativitätstheorie nicht mehr funktioniert. Die Schlüssigkeit eines Arguments ist damit vom Vorwissen abhängig. ]) Diese Zusatzinformationen sind für die Studierenden nur aus motivationalen oder didaktischen Gründen zu verwenden, um etwa auch als Vertiefung oder Kontextualisierung zu wirken. ] // ]))) ] === Wiederholungsserien Auf den Wiederholungsserien werden hauptsächlich Aufgaben, Hinweise und Lösungen verwendet. Um die Wiederholungsserien visuell nicht zu überladen, findet eine Differenzierung der Gestaltungselemente der Folien von denen der Wiederholungsserien statt: Jede Wiederholungsserie besteht aus drei verschiedenen Dokumenten: 1. *Aufgabenblatt:* enthalten nur die Aufgaben 2. *Hinweisblatt:* enthalten Aufgaben sowie spezifische Hilfestellungen bzw. Teillösungen zu den Aufgaben, ohne jedoch komplette Lösungen vorzugeben 3. *Lösungsblatt:* enthalten Aufgaben sowie Lösungen der Aufgaben Für alle Dokumente sollen die Gestaltungselemente, bis auf den Inhalt, dieselben sein. === Logische Elemente Sowohl auf den Folien als auch auf den Aufgabenblättern werden die folgenden Elemente benutzt, um logische Sachverhalte darzustellen: + *Wahrheitstabelle:* TODO + *KdnS:* TODO + *Syntaxbaum:* TODO + *Semantikbaum:* TODO + *Modell-Diagramm:* Venn-Diagramm mit Individuen TODO = Inhalte und inhaltliche Ziele <inhalte> == Zielsetzung === Richtziele Die Aufgabenstellungen aus @o-aufgaben bieten die Grundlage für die wichtigsten Fähigkeiten und Fertigkeiten, die die Studierenden ausbilden müssen. Die Studierenden generieren Sachkompetenz, indem sie ... - ... Grundkonzepte definieren. - ... Zusammenhänge und Felder im logischen Quadrat ausfüllen. Die Studierenden generieren Methodenkompetenz, indem sie ... - ... Aussagesätze identifizieren. - ... Aussagesätze in AL formalsieren. - ... zu bestehenden Wenn-Dann-Sätzen logisch-äquivalente Wenn-Dann-Sätze identifizieren. - ... zu bestehenden Wenn-Dann-Sätzen logisch-äquivalente Wenn-Dann-Sätze bilden. - ... notwendige und hinreichende Bedingungen in Wenn-Dann-Sätzen bestimmen. - ... logische Wahrheit, logische Falschheit, logische Folgerung und logische Äquivalenz mit der Wahrheitstabelle beweisen. - ... Beweise mit dem aussagenlogischen Kalkül des natürlichen Schließens führen. - ... Aussagesätze in PL formalisieren. - ... Beweise mit dem prädikatenlogischen Kalkül des natürlichen Schließens führen. - ... verzweigte Beweise mit dem Kalkül des natürlichen Schließens führen. === Grobziele // Richtziele auseinandernehmen und feiner machen === Gewichtung // Wie wichtig sind die einzelnen Ziele? == Zentrale Begriffe /* TODO: Bereich neu machen. == Ziele und Ablaufplan Das Tutorium soll sowohl einen festen inhaltlichen Plan verfolgen, als auch Raum für individuelle Wünsche der Studierenden enthalten. Dabei gibt es ein kontingent an obligatorischen Inhalten, die sich aus den klausurrelevanten Aufgabenstellungen zusammensetzen, und fakultative Inhalte, die zur Vertiefung und Sicherung genutzt werden können. Die Ziele werden je mit einer Identifikator versehen. Dieser besteht aus einer Abkürzung aus zwei Großbuchstaben (etwa "LG" für "logische Grundlagen") und einer fortlaufenden Nummer für die jeweilige Sequenz. Damit kann für alle Sitzungsziele nachverfolgt werden, aus welchen Sequenzzielen sie stammen. #set table(inset: 0.75em) #show table.cell: set text(size: 0.75em) #show table.cell: set par(justify: false) #table( columns: (20%, auto, auto), stroke: none, fill: (col, row) => ( purple, none, blue.lighten(75%) ).at( if row == 0 { row } else { 1 + calc.rem(row, 2) } ), // map-cols: (col, cells) => { // let index = 0 // while index < cells.len() { // cells.at(index).content = [ // #set par(justify: false) // #set text(size: 0.75em) // #v(0.5em) // #cells.at(index).content // #v(0.5em) // ] // index += 1 // } // return cells // }, // map-rows: (row, cells) => { // let index = 0 // while index < cells.len() { // cells.at(index).content = [ // #set par(justify: false) // #set text(size: 0.75em) // #if row <= 0 { // // v(0.25em) // pad(y: 0.25em, cells.at(index).content) // // v(0.25em) // } else { // // v(0.5em) // pad(y: 0.5em, cells.at(index).content) // // v(0.5em) // } // ] // index += 1 // } // return cells // }, text(fill: white, strong[Sequenz]), table.vline(stroke: purple), text(fill: white, strong[Inhalt]), table.vline(stroke: purple), text(fill: white, strong[Die Studierenden können/haben/wissen/...]), )[ Logische Grundlagen \ (LG) #set-sequence-goals-key("LG") ][ - Definition der Logik - (Abgrenzung zur Mathematik) - philosophisch-logische Argumente - Gütekriterien: - deduktive Gültigkeit - Schlüssigkeit \ - indirekte Beweise - (direkte Beweise) \ - notwendige und hinreichende Bedingungen ][ #print-goals-for-sequence() // - "Logik" definieren // - wissen, was philosophische Argumente sind // - philosophische Argumente erkennen // - "Argument" definieren // \ // - Gültigkeit und Schlüssigkeit definieren // - Gültigkeit und Schlüssigkeit vergleichen und voneinander abgrenzen // \ // - kennen den formalen Aufbau eines Beweises#footnote[Theorem, Beweis, QED] // - durch metasprachliche Begründung einfache Beweise über deduktiv-gültige Argumente führen ][ Aussagenlogik \ (AL) #set-sequence-goals-key("AL") ][ - Analyse der Sprache an Satzbausteinen - Nicht - Und - Oder - Wenn-Dann - Genau-Dann-Wenn \ - Syntax - aussagenlogische Junktoren - valide AL-Sätze - aussagenlogische Formalisierung \ - Semantik - Bedeutung aussagenlogischer Junktoren ][ #print-goals-for-sequence() // - aussagenlogische Strukturen der deutschen Sprache identifizieren // - notwendige und hinreichende Bedingungen im Wenn-Dann-Satz identifizieren // \ // - ein Gefühl für die Struktur und Bildungsregeln von AL entwickeln // - Schemata suchen und erkennen // - Schemata zur Bildung neuer Ausdrücke benutzen // - Junktoren in der natürlichen Sprache erkennen // - Sätze der natürlichen Sprache aussagenlogisch formalisieren // - "nur" und "genau dann, wenn" adäquat formalisieren // - Äquivalenzumformulierungen für notwenidge und hinreichende Bedingungen identifizieren und bilden // \ // - Wahrheitsbedingungen von Sätzen erkennen // - die Semantik der Junktoren definieren ][ Wahrheitstabelle \ (WT) #set-sequence-goals-key("WT") ][ - Interpretation aussagenlogischer Ausdrücke mit der Wahrheitstabelle - Semantik der Junktoren als Wahrheitstabelle - komplexe Ausdrücke \ - logische Wahrheit, logische Falschheit - logische Folgerung, logische Äquivalenz ][ #print-goals-for-sequence() // - die semantische Definition der Junktoren in der Wahrheitstabelle darstellen // - Ausdrücke mit der Wahrheitstabelle auswerten // - logische Wahrheit und Falschheit in der Wahrheitstabelle beweisen // - logische Folgerung und Äquivalenz in der Wahrheitstabelle bweisen // - schreiben für jeden Beweis QED und einen Antwortsatz ][ Kalkül des natürlichen Schließens \ (KS) #set-sequence-goals-key("KS") ][ - direkte Schlussregeln - MP, MT, KS, KP, $not$-Bes., $not$-Einf., $and$-Bes., $and$-Einf., DS, $or$-Einf., $<->$-Bes., $<->$-Einf., DM, $->$-Ers., KM, $->$-Einf., RAA - erweiterte Schlussregeln - linke Beweisspalte und ZA - RAA - $->$-Einführung ][ #print-goals-for-sequence() // - verstehen das Muster der direkten Regelanwendung // - einfache bis mittelkomplexe direkte Beweise führen // - wissen, dass man für RAA standardmäßig das Gegenteil der Konklusion annimmt // - die linke Beweisspalte bilden // - RAA durchführen // - erkennen, wann $->$-Einf. gefordert ist // - wissen, dass sie beim Einführen einer ZA die Abhängigkeiten der Zeilen prüfen müssen ][ Prädikatenlogik \ (PL) #set-sequence-goals-key("PL") ][ - Syllogismen & Prädikatierung \ - Syntax - Konstanten und Prädikate - Quantoren, Variablen - prädikatenlogische Formalisierung \ - (Semantik) \ - logisches Quadrat ][ #print-goals-for-sequence() // - verstehen den Unterschied zwischen der reinen Satzlogik AL und der u.a. Begriffslogik PL // - einfache prädikatenlogische unquantifizierte Sachverhalte formalisieren // - einfache prädikatenlogische quantifizierte Sachverhalte formalisieren // - Quantoren ineinander umrechnen // - die Begriffe des logischen Quadrats nennen // - eigene Beispiele für das logische Quadrat finden ][ Prädikatenlogisches Kalkül des natürlichen Schließens \ (PK) #set-sequence-goals-key("PK") ][ - $forall$-Einf., $forall$-Bes. - $exists$-Bes., $exists$-Einf. - QT - PKS ][ #print-goals-for-sequence() // - quantifizierte Ausdrücke spezialisieren und die spezialisierten Variablen korrekt ersetzen // - Ausdrücke, die Konstanten beinhalten, generalisieren und die Konstanten korrekt binden // - kennen die Einschränkungen der $forall$-Einf. und beachten sie bei der Ableitung // - kennen die Einschränkungden der $exists$-Bes. und beachten sie bei der Ableitung // - schreiben für jeden Beweis QED und einen Antwortsatz ] /* Logische Grundlagen: - philosophisch-logische Argumente - Gütekriterien: - deduktiv-gültige Schlüsse - schlüssige Schlüsse - logische Folgerung und Abhängigkeit von Prämissen - (direkte und indirekte Beweise) Aussagenlogik: - Motivation der Aussagenlogik - Syntax: - aussagenlogische Formalisierung - valide AL-Sätze - Semantik: - Wahrheitstabellen - logische Folgerung, Äquivalenz, Wahrheit und Falschheit Kalkül des natürlichen Schließens (KdnS): - Aufbau - direkte Beweise - indirekte Beweise: - Zusatz-Annahmen - →-Einführung - Reductio ad absurdum - verzweigte Beweise I Prädikatenlogik: - Motivation der Prädikatenlogik - Syntax: - prädikatenlogische Formalisierung - (Semantik) - logisches Quadrat - KdnS für PL - verzweigte Beweise II */ = Ablaufplan Tutorium #include "raw-plan.typ"
https://github.com/ymgyt/techbook
https://raw.githubusercontent.com/ymgyt/techbook/master/math/matrix/rotation_matrix.typ
typst
== 回転行列 $f vec(x,y)$を座標$vec(x,y)$を$theta$回転させる変換とする。 \ このとき変換$f$を表現行列で表したい。\ 変換は$f vec(1,0), f vec(0,1)$が決まれば、定まるのでそれぞれを回転させることを考える。\ $vec(1,0)$を$theta$回転させると、定義より \ $ f vec(1,0) = vec(cos theta, sin theta) $ $vec(0,1)$の$theta$回転は、$vec(1,0)$の$theta + 90 degree$とみなせるので \ $ f vec(0,1) &= vec(cos (theta + 90 degree), sin (theta + 90 degree)) \ &= vec(- sin theta, cos theta) $ よって \ $ f vec(x,y) = mat(cos theta, - sin theta; sin theta, cos theta) vec(x,y) $ === 回転行列を利用した加法定理の証明 回転行列を用いて、加法定理が証明できる。\ $(alpha + beta)$回転させる変換は、$alpha$回転させたのち、$beta$回線させる変換と等しいと仮定する。\ すると、このことは以下の式で表現できる。 $ mat(cos (alpha + beta), - sin(alpha + beta); sin(alpha + beta), cos(alpha + beta)) &= mat(cos beta, - sin beta; sin beta, cos beta) mat(cos alpha, - sin alpha; sin alpha, cos alpha) \ &= mat( cos alpha cos beta - sin alpha sin beta, - sin alpha cos beta - cos alpha sin beta; sin beta cos alpha + sin alpha cos beta, - sin alpha sin beta + cos alpha cos beta; ) $ 等しい行列は各成分が等しいので \ $ sin(alpha + beta) &= sin alpha cos beta + cos alpha sin beta \ cos(alpha + beta) &= cos alpha cos beta - sin alpha sin beta $
https://github.com/catg-umag/inach-workshop-2024
https://raw.githubusercontent.com/catg-umag/inach-workshop-2024/main/document/sections/4_taxonomic_assignment.typ
typst
#import "@preview/gentle-clues:1.0.0": * #import "../catgconf.typ": cmd, github-pill, doi-pill = Asignación Taxonómica == NanoCLUST #github-pill("genomicsITER/NanoCLUST") #h(3pt) #doi-pill("10.1093/bioinformatics/btaa900") NanoCLUST es un flujo de trabajo desarrollado en Nextflow para la clasificación de amplicones del gen 16S obtenidos mediante secuenciación por Nanopore. Utiliza un enfoque de clustering no supervisado seguido por una proyección UMAP y una corrección de errores de cada cluster previo a la asignación taxonómica. Para la asignación taxonómica utiliza BLAST y la base de datos de 16S de Genbank. Para utilizar esta herramienta se debe contar con una versión de Nextflow menor o igual a 22.04 y se debe descargar la base de datos de 16S de Genbank (instrucciones disponibles en el repositorio de NanoCLUST). ```sh nextflow run main.nf \ -profile docker \ --reads 'sample.fastq' \ --db "db/16S_ribosomal_RNA" \ --tax "db/taxdb/" ``` #pagebreak() == EMU #github-pill("treangenlab/emu") #h(3pt) #doi-pill("10.1038/s41592-022-01520-4") EMU es una herramienta diseñada para mejorar la precisión de la asignación taxonómica mediante un enfoque de corrección de errores basado en algoritmos de maximización de expectativas y alineamiento de las secuencias corregidas mediante la herramienta Minimap2. EMU es compatible con diversas bases de datos, como Genbank, RDP y Silva (v.138), y también permite la integración de la base de datos UNITE para el análisis de la región ITS, especializada en la taxonomía de hongos y eucariotas. Para usar EMU, es necesario descargar su base de datos e instalar las dependencias (instrucciones en el repositorio de EMU). ```sh emu abundance example/full_length.fa ``` == EPI2ME wf-16s #github-pill("epi2me-labs/wf-16s") EPI2ME wf-16s es un pipeline bioinformático desarrollado por Oxford Nanopore para la asignación taxonómica de secuencias 16S. Ofrece dos alternativas para la clasificación taxonómica: alineamiento de secuencias mediante Minimap2 o asignación basada en k-mers utilizando Kraken2 y Bracken2. El pipeline permite utilizar bases de datos como SILVA (v.138) y las de 16S y 18S de Genbank. El resultado incluye un archivo en formato tabular (TSV) con la asignación taxonómica por muestra, especificando el número de lecturas asignadas a cada taxón. También se genera un reporte en formato HTML que integra la información sobre la calidad de la secuenciación, asignación taxonómica y métricas de diversidad. Este pipeline puede ejecutarse mediante la línea de comandos con Nextflow o mediante la aplicación de escritorio EPI2ME (https://labs.epi2me.io/). === Requisitos Para ejecutar el pipeline, es necesario tener instalados #link("https://www.nextflow.io/")[Nextflow] y #link("https://www.docker.com/")[Docker] (o como alternativa, #link("https://apptainer.org/")[Apptainer]). El pipeline descarga automáticamente las bases de datos necesarias y todas las dependencias para su ejecución. #question(title: "¿Qué es Nextflow?")[ Nextflow es un framework para diseñar y ejecutar pipelines bioinformáticos. Utiliza un lenguaje declarativo para definir flujos de trabajo, que pueden ejecutarse de manera reproducible en entornos locales, en la nube o en clústeres de alto rendimiento. ] #heading([Estructura del archivo de muestras], level: 4, numbering: none) El pipeline requiere un archivo CSV que contenga la información de las muestras y los códigos de barras (barcodes) asociados. A continuación se muestra un ejemplo de este archivo: #context [ #set text(size: 0.9em) #figure( grid( columns: (6cm, 6cm), align: (center, center), column-gutter: 1em, row-gutter: 1em, ``` barcode,sample_id,alias barcode01,1M,1M barcode06,4H,4H barcode08,5H,5H barcode10,6H,6H barcode11,6M,6M barcode12,7H,7H barcode13,7M,7M ```, table( columns: 3, inset: (y: 3.5pt), align: (left, center, left), table.header([barcode], [sample_id], [alias]), [barcode01], [1M], [1M], [barcode06], [4H], [4H], [barcode08], [5H], [5H], [barcode10], [6H], [6H], [barcode11], [6M], [6M], [barcode12], [7H], [7H], [barcode13], [7M], [7M], ), [ Contenido del archivo. ], [ Representación del archivo como una tabla. ], ), ) ] #heading([Estructura de los datos de entrada], level: 4, numbering: none) El pipeline está diseñado para ejecutarse después de la etapa de basecalling. Se espera que los archivos FASTQ estén organizados por barcode en directorios correspondientes, como se muestra a continuación: ``` input_directory ├── barcode01 │ ├── reads0.fastq │ └── reads1.fastq ├── barcode02 │ └── reads0.fastq └── barcode03 └── reads0.fastq ``` === Configuración Este pipeline incluye múltiples parámetros configurables mediante parámetros de línea de comandos si se ejecuta mediante Nextflow, o mediante opciones gráficas si se utiliza la aplicación de escritorio EPI2ME. Por defecto, las lecturas son filtradas por tamaño entre 800 pb y 2000 pb y no se aplican filtros de calidad. El porcentaje de identidad requerido para la asignación taxonómica es del 95% y la cobertura del 90%. El pipeline utiliza Minimap2 con la base de datos de 16S de Genbank de forma predeterminada. Para el método de clasificación se puede escoger entre `kraken2` y `minimap2`, mientras que para la base de datos las opciones son `ncbi_16s_18s`, `ncbi_16s_18s_28s_ITS` y `SILVA_138_1`. === Ejecución mediante aplicación de escritorio La aplicación EPI2ME permite ejecutar diversos pipelines de análisis de datos de secuenciación de Oxford Nanopore. En este caso, debemos seleccionar el pipeline 16s e iniciar su instalación. La aplicación verificará si el equipo cumple con los requisitos computacionales y descargará el pipeline en un directorio local. #context [ #set text(size: 0.9em) #figure( grid( align: horizon, columns: (8cm, 7.5cm), gutter: 0.5em, image("../images/16_pipeline.png"), image("../images/pipeline_install.png"), [Selección del pipeline 16s en la aplicación EPI2ME.], [Cuadro de instalación del pipeline.], ), ) ] Una vez instalado, el botón #cmd([Install]) cambiará a #cmd([Launch]). Al hacer clic en #cmd([Launch]), se abrirán las opciones de configuración del pipeline, donde seleccionaremos el directorio con los archivos de entrada, la base de datos, el método de clasificación, la planilla de muestras y otros parámetros (@fig:pipeline-config). #figure( placement: auto, image("../images/pipeline_config.png", width: 90%), caption: [Configuración del pipeline EPI2ME wf-16s.], ) <fig:pipeline-config> Al finalizar la ejecución, podremos visualizar el reporte generado en la misma aplicación y acceder al directorio con los resultados. === Ejecución mediante línea de comandos Para ejecutar el pipeline mediante la línea de comandos, debe especificarse como mínimo los datos de entrada con el parámetro #cmd(`--fastq`). Para configurar el clasificador debe utilizarse el parámetro #cmd(`--classifier`), y para configurar la base de datos se utiliza el parámetro #cmd(`--database_set`). Ejemplo de uso: ```sh nextflow run epi2me-labs/wf-16s \ --fastq data \ --sample_sheet samples.csv \ --out_dir wf-16s_kraken2_silva \ --classifier kraken2 \ --database_set SILVA_138_1 \ --taxonomic_rank G \ -profile docker ``` #pagebreak() = Post Procesamiento de Asignación Taxonómica == Eliminación de especies poco abundantes En el análisis de datos de microbioma, es común eliminar especies poco abundantes, ya que pueden introducir ruido y afectar la interpretación de los resultados. Se puede establecer un umbral de abundancia mínima y eliminar los taxones que no lo cumplan. Por ejemplo, podemos eliminar todos los taxones cuya abundancia sea inferior al 0.1% en todas las muestras. Adicionalmente, podemos excluir las lecturas no clasificadas. Todo esto podemos lograrlo con el siguiente código en R: ```R library(tidyverse) count_data_filtered <- count_data %>% column_to_rownames("tax") %>% filter_all(any_vars(. / sum(.) > 0.0001)) %>% select(-total, -starts_with("Unclassified")) ``` == Normalización por muestra Es común que la cantidad de lecturas varíe significativamente entre las muestras, lo que provoca que los conteos obtenidos en la asignación taxonómica presenten grandes variaciones. Para comparar las muestras de manera justa, es necesario normalizar los datos y corregir el sesgo en la abundancia de especies debido a estas diferencias. Existen diversas metodologías para normalizar: el submuestreo utilizando un tamaño mínimo, el escalamiento dividiendo cada abundancia por un factor para compensar el sesgo de muestreo, entre otras. Por ejemplo, podemos normalizar mediante Total Sum Scaling (TSS), usando la función #link("https://vegandevs.github.io/vegan/reference/decostand.html")[#cmd(`decostand`)] de la librería vegan en R. ```R data_normalized <- decostand(count_data_filtered, method = "total") ```
https://github.com/mgoulao/arkheion
https://raw.githubusercontent.com/mgoulao/arkheion/main/template.typ
typst
#let arkheion( title: "", abstract: [], keywords: (), authors: (), date: none, body, ) = { // Set the document's basic properties. set document(author: authors.map(a => a.name), title: title) set page( margin: (left: 25mm, right: 25mm, top: 25mm, bottom: 30mm), numbering: "1", number-align: center, ) set text(font: "New Computer Modern", lang: "en") show math.equation: set text(weight: 400) show math.equation: set block(spacing: 0.65em) set math.equation(numbering: "(1)") set heading(numbering: "1.1") // Set run-in subheadings, starting at level 4. show heading: it => { // H1 and H2 if it.level == 1 { pad( bottom: 10pt, it ) } else if it.level == 2 { pad( bottom: 8pt, it ) } else if it.level > 3 { text(11pt, weight: "bold", it.body + " ") } else { it } } line(length: 100%, stroke: 2pt) // Title row. pad( bottom: 4pt, top: 4pt, align(center)[ #block(text(weight: 500, 1.75em, title)) #v(1em, weak: true) ] ) line(length: 100%, stroke: 2pt) // Author information. pad( top: 0.5em, x: 2em, grid( columns: (1fr,) * calc.min(3, authors.len()), gutter: 1em, ..authors.map(author => align(center)[ #if author.keys().contains("orcid") { link("http://orcid.org/" + author.orcid)[ #pad(bottom: -8pt, grid( columns: (8pt, auto, 8pt), rows: 10pt, [], [*#author.name*], [ #pad(left: 4pt, top: -4pt, image("orcid.svg", width: 8pt)) ] ) ) ] } else { grid( columns: (auto), rows: 2pt, [*#author.name*], ) } #author.email \ #author.affiliation ]), ), ) align(center)[#date] // Abstract. pad( x: 3em, top: 1em, bottom: 0.4em, align(center)[ #heading( outlined: false, numbering: none, text(0.85em, smallcaps[Abstract]), ) #set par(justify: true) #set text(hyphenate: false) #abstract ], ) // Keywords if keywords.len() > 0 { [*_Keywords_* #h(0.3cm)] + keywords.map(str).join(" · ") } // Main body. set par(justify: true) set text(hyphenate: false) body } #let arkheion-appendices(body) = { counter(heading).update(0) counter("appendices").update(1) set heading( numbering: (..nums) => { let vals = nums.pos() let value = "ABCDEFGHIJ".at(vals.at(0) - 1) if vals.len() == 1 { return "APPENDIX " + value } else { return value + "." + nums.pos().slice(1).map(str).join(".") } } ); [#pagebreak() #body] }
https://github.com/InseeFrLab/address-search-gaia-docs
https://raw.githubusercontent.com/InseeFrLab/address-search-gaia-docs/main/src/abstract-ntts/index.typ
typst
MIT License
// Some definitions presupposed by pandoc's typst output. #let horizontalrule = [ #line(start: (25%,0%), end: (75%,0%)) ] #let endnote(num, contents) = [ #stack(dir: ltr, spacing: 3pt, super[#num], contents) ] #show outline.entry.where( level: 1): it => { v(12pt, weak: true) strong(it) } #let article( title: none, authors: none, date: none, abstract: none, cols: 1, margin: (x: 1.25in, y: 1.25in), paper: "us-letter", lang: "en", region: "US", font: (), fontsize: 11pt, sectionnumbering: none, toc: false, toc_title: none, toc_depth: none, toc_indent: 1.5em, doc, ) = { set page( paper: paper, margin: margin, numbering: "1", ) set par(justify: true) set text(lang: lang, region: region, font: font, size: fontsize) set heading(numbering: sectionnumbering) if title != none { align(center)[#block(inset: 2em)[ #text(weight: "bold", size: 1.5em)[#title] ]] } if authors != none { let count = authors.len() let ncols = calc.min(count, 3) grid( columns: (1fr,) * ncols, row-gutter: 1.5em, ..authors.map(author => align(center)[ #author.name \ #author.affiliation \ #author.email ] ) ) } if date != none { align(center)[#block(inset: 1em)[ #date ]] } if abstract != none { block(inset: 2em)[ #text(weight: "semibold")[Abstract] #h(1em) #abstract ] } if toc { let title = if toc_title == none { auto } else { toc_title } block(above: 0em, below: 2em)[ #outline( title: toc_title, depth: toc_depth, indent: toc_indent ); ] } if cols == 1 { doc } else { columns(cols, doc) } } #set table( inset: 6pt, stroke: none ) #show: doc => article( title: [Independent Address Identification Search Engine for National Statistical Institute Using ElasticSearch], authors: ( ( name: [<NAME>], affiliation: [Insee], email: [<EMAIL>] ), ), date: [2024-09-30], lang: "en", region: "EN", sectionnumbering: "1.1.a", toc_title: [Table of contents], toc_indent: auto, toc_depth: 3, cols: 1, doc, ) #pagebreak() #block[ #heading( level: 1 , numbering: none , [ Introduction ] ) ] In order for survey interviewers to reach individuals, it is essential to accurately identify and geolocate their addresses. Address data, used in a wide range of statistical processes—from census to surveys—is often difficult to process due to inconsistencies, variations in input, and the volume of records. In matters of address search, many rely on established services like Google Maps or OpenStreetMap. However, these platforms often pose limitations in terms of data control and reliability. Creating a custom address identification search engine provides complete control over the data, addressing concerns about data source transparency and monthly data updates. A solution employing ElasticSearch (ES), a powerful software used to create and configure search engines, is here proposed to build an independent process for identifying address data for the National Statistical Institute (NSI). Moreover, ES enables text-based address search and supports the storage of geometric objects, considering the spatial aspect of addresses. This approach optimizes both processing time and accuracy by employing a two-step strategy: an initial strict search for precise address identification, followed by a flexible matching phase for addresses not identified in the first step, which accounts for spelling errors and variations in the input. = Methodology <methodology> The methodology is based on the implementation of ES to handle large-scale address datasets. Data is organized into JSON #strong[documents];, which represent individual entities. To enable efficient searching, the search engine employs #strong[inverted indices];—a data structure that links terms to the documents where they appear. Its distributed architecture supports the rapid search and analysis of vast data volumes, providing near real-time performance @es. == Address data indices <address-data-indices> Two key indices were developed: one for complete addresses and one for street names. #strong[Table 1: Example address index] #figure( align(center)[#table( columns: 6, align: (auto,auto,auto,left,auto,auto,), table.header([idAddress], [Number], [Suffix], [Full Address], [idStreet], [Postal Code],), table.hline(), [A1], [10], [], [10 Boulevard Royal Crescent], [V1], [W1B4AA], [A2], [25], [], [25 Road Kingsway Court], [V2], [W1B4AA], [A3], [55], [bis], [55 bis Street Michael’s Mount], [V3], [SW36PE], )] , kind: table ) #strong[Table 2: Example street index] #figure( align(center)[#table( columns: 4, align: (auto,auto,left,auto,), table.header([idStreet], [Type of Street], [Name of Street], [Postal Code],), table.hline(), [V1], [Boulevard], [Royal Crescent], [W1B4AA], [V2], [Road], [Kingsway Court], [W1B4AA], [V3], [Street], [Michael’s Mount], [SW36PE], )] , kind: table ) In reality, other variables are present in the indices, including geolocation variables. However, these are not useful for conducting text-based address search. To enable effective searches, it is crucial that the data in the indices is processed in the same way as the addresses being identified. For this reason, the same filters are applied, called #strong[analyzers];, to both the indices and the inputs to the search engine. These include: - Lowercasing - Accents handling - Punctuation handling - Use of synonym lists to normalize spellings == Searching process <searching-process> To search for an address using this engine, the input must include a complete address string, for example, "10 bd Royal Crescent", along with its postal code string, such as "W1B4AA". Multiple queries will then be executed: + #strong[Exact Match Query:] A strict query is performed within the town to match the exact address string. The query returns addresses from the index where the #emph["full address"] field matches exactly with the address provided. It bypasses tokenization, which is applied by default in ES, to ensure precision. This step allows a quick identification of addresses with perfect spelling after applying the analyzers, resulting in a time-saving process. If the address is not identified at this stage, the process moves on to the next step. + #strong[Street-Level Query:] This step involves a more complex query with fuzzy matching to identify the street within the town. A fuzzy matching is an efficient approximate string matching technique @fuzzy. Correcting a string with a fuzziness level of 1 means adding a letter, removing a letter, replacing a letter, or swapping two letters. In order for a street to be returned in the search results, at least one of the following conditions must be met: - Matching the hole street name with a fuzziness level of 1 \ - Matching one token of the street type or street name with a fuzziness level of 1 \ - Matching one n-gram of the street name (n = 3, 4 and 5) Each time a condition is met, the street’s #strong[score] increases. Additionally, weights have been applied to these conditions, referred to as #strong["boosts"];. Here, the first condition carries the most weight. The street with the highest score will be chosen. In addition, an external verification outside of Elasticsearch is performed to validate the selected street. If the address provided contains less than 10% of the trigrams from the reference street, the street is considered not correct. #block[ #set enum(numbering: "1.", start: 3) + #strong[Number and suffix Query:] If the street is identified, the algorithm searches for addresses within the street (#emph[idStreet];). To be returned, the address numbers in the index must match exactly the number extracted from the address to identify. This extraction is performed using a custom-developed #strong[RegEx];. Additionally, a function has been implemented to check the provided address for suffix, and if any are found, the reference addresses with the same suffix will be boosted. ] #align(center)[ #box(width: 75%,image("schema_moteur.jpg")) ] #strong[Figure 1. Overview diagram of the full identification process] = Results and practical application <results-and-practical-application> The ES indices were populated with addresses derived from multiple clean and reliable sources from the NSI. In total, approximately 27 million addresses and 3 million streets were indexed. \ To evaluate the search engine’s performance, addresses from a survey conducted by the NSI were collected, where participants manually provided their addresses. These addresses contain noise: spelling errors, acronyms… Using the national individual code for each participant, the survey data was matched with our national individual-address database, which serves as the ground truth by providing the correct #emph[idAddress];. This annotated dataset, consisting of 100,000 addresses across the country, was used to provide quality metrics on the search engine. \ These addresses went through the identification process: - The address was identified 86.0% of the time with an accuracy of 0.94 - The street was identified 99.5% of the time with an accuracy of 0.94 - 0.5% of the addresses were not found, at any level A test set of 100,000 clean addresses, sampled from the data in the address index, was created to evaluate the quality of its own data identification: the address was identified 100.0% of the time with an accuracy of 1 (all with the strict identification step). \ To assess the efficiency of the actual identification process, a comparison was made between two different pipelines: - P1: The actual full pipeline including strict address search, street name search, and then number and suffix search - P2: A pipeline that starts with the street name and then the number and suffix search To improve processing times, an additional step has been added to P2, creating the P1 process: a strict address search without #strong[tokenization/ngrams];—which is time consuming—, only on addresses in the town required. This step resolves a significant portion of the addresses, around 30% in practical cases. If the database is clean, like administrative addresses, this rate can rise to 100%. With the same test set of 100,000 clean addresses as before, it took #strong[one-sixth the time] to identify them using this strict identification step compared to doing it without, with the same rate of address/street identification and accuracy. Adding this step does not increase processing time if very few addresses are identified, but it saves time if many addresses are found there. = Main findings <main-findings> The primary findings indicate that Elasticsearch is a highly effective tool for optimizing address identification processes. This is much more effective than strict searches in a SQL-style database, which lack of analyzers and do not account for spelling errors and acronyms. \ The P1 structure has proven its effectiveness through the evaluation of the quality of identification in an annotated database containing noisy addresses, as well as by comparing its processing time performance with the P2 pipeline. \ This solution is scalable and can be adapted to other country datasets by taking into account the specificities of its national addresses with the boosts. This search engine represents a significant advancement in address data processing, offering data control, independency and reliability for official statistics. #set bibliography(style: "apa") #bibliography("biblio.bib")
https://github.com/AxiomOfChoices/Typst
https://raw.githubusercontent.com/AxiomOfChoices/Typst/master/Miscellaneous/GeoTopo/Assignment%206.typ
typst
#import "../../Templates/generic.typ": latex, header #import "../../Templates/question.typ": question_heading #import "@preview/cetz:0.1.2" #show: doc => header(title: "Assignment 6", name: "<NAME>", doc) #show: latex #show: question_heading #let ve = $epsilon$ #let ip(..x) = $lr(angle.l #x.pos().join(",") angle.r)$ = Question 5 == Statement Let $Gamma$ be a finite connected graph with vertex set $V$ and edge set $E$. Our goal is to construct a graph $tilde(Gamma)$ whose geometric realization is the universal cover of the geometric realization of $Gamma$. Figure out how to define $tilde(Gamma)$ be mimicking the construction of the universal cover of a topological space. (Warning: it may have infinitely many vertices.) Once you have constructed $tilde(Gamma)$ do the following. + Prove that $tilde(Gamma)$ is a tree. + Prove that if $Gamma$ is a tree, then $Gamma$ is isomorphic to $tilde(Gamma)$ + If $Gamma$ is the dumbell graph, then find $tilde(Gamma)$. == Solution Fix some vertex $v_0 in V$. We will define the vertex set of $tilde(Gamma)$ to be the set of oriented edge walks $(e_1,...,e_n)$ with $e_i eq.not e_(i+1)$, that is no consecutive repeated edges. Then two walks are related if one is the extension of the other by one edge. We can then map each vertex to the final vertex where the walk ends up and map each edge with the appropriate orientation to get our covering map $q : tilde(Gamma) -> Gamma$. Now by construction any simple cycle (no repeating vertices) in $tilde(Gamma)$ must be a sequence of walks $w_1,...,w_n$ that are monotonic with respect to extensions. But this is a contradiction since this means the length of $w_1$ cannot be the same as $w_n$. Thus we cannot have any cycles in $tilde(Gamma)$. Next assume that $Gamma$ is a tree, then for every vertex $v_i in V$ we have exactly one path between $v_0$ and $v_i$ and so there is exactly one vertex in $tilde(Gamma)$ that gets mapped to $v_i$ through $q$. We can also easily see that the copies of $v_i$ and $v_j$ in $tilde(Gamma)$ are adjaceny if and only if they are adjacent in $Gamma$. Thus $Gamma$ and $tilde(Gamma)$ are isomorphic. If $Gamma$ is the dumbell graph then we it is homotopic to two loops at a point. We know then that the vertices of $tilde(Gamma)$ are in bijection to $pi_1(Gamma,v_0) tilde.equiv ZZ * ZZ$. Now two vertices are related if and only if one is an extension of another by one cycle. This corresponds to adjoining $a,b,a^(-1),b^(-1)$ in $ZZ * ZZ$ and so we get exactly the Cayley graph of $ZZ * ZZ$.
https://github.com/liuguangxi/suiji
https://raw.githubusercontent.com/liuguangxi/suiji/main/tests/test-rand-sc.typ
typst
MIT License
#set document(date: none) #import "/src/lib.typ": * #set text(size: 10.5pt, font: ("Source Han Serif SC"), lang: "zh", region: "cn") #set par(leading: 0.55em, justify: true, first-line-indent: 2em) #show par: set block(spacing: 0.55em) #for i in range(36) [ #box(width: 2em)[(#i)] #h(1em) #rand-sc(i, seed: 2*i) \ ] #pagebreak(weak: true) #for i in range(1, 18) [ #if i == 1 [#h(2em)] #rand-sc(25*i, seed: i, punctuation: true, gap: 2+i) #parbreak() ] #pagebreak(weak: true)
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-2190.typ
typst
Apache License 2.0
#let data = ( ("LEFTWARDS ARROW", "Sm", 0), ("UPWARDS ARROW", "Sm", 0), ("RIGHTWARDS ARROW", "Sm", 0), ("DOWNWARDS ARROW", "Sm", 0), ("LEFT RIGHT ARROW", "Sm", 0), ("UP DOWN ARROW", "So", 0), ("NORTH WEST ARROW", "So", 0), ("NORTH EAST ARROW", "So", 0), ("SOUTH EAST ARROW", "So", 0), ("SOUTH WEST ARROW", "So", 0), ("LEFTWARDS ARROW WITH STROKE", "Sm", 0), ("RIGHTWARDS ARROW WITH STROKE", "Sm", 0), ("LEFTWARDS WAVE ARROW", "So", 0), ("RIGHTWARDS WAVE ARROW", "So", 0), ("LEFTWARDS TWO HEADED ARROW", "So", 0), ("UPWARDS TWO HEADED ARROW", "So", 0), ("RIGHTWARDS TWO HEADED ARROW", "Sm", 0), ("DOWNWARDS TWO HEADED ARROW", "So", 0), ("LEFTWARDS ARROW WITH TAIL", "So", 0), ("RIGHTWARDS ARROW WITH TAIL", "Sm", 0), ("LEFTWARDS ARROW FROM BAR", "So", 0), ("UPWARDS ARROW FROM BAR", "So", 0), ("RIGHTWARDS ARROW FROM BAR", "Sm", 0), ("DOWNWARDS ARROW FROM BAR", "So", 0), ("UP DOWN ARROW WITH BASE", "So", 0), ("LEFTWARDS ARROW WITH HOOK", "So", 0), ("RIGHTWARDS ARROW WITH HOOK", "So", 0), ("LEFTWARDS ARROW WITH LOOP", "So", 0), ("RIGHTWARDS ARROW WITH LOOP", "So", 0), ("LEFT RIGHT WAVE ARROW", "So", 0), ("LEFT RIGHT ARROW WITH STROKE", "Sm", 0), ("DOWNWARDS ZIGZAG ARROW", "So", 0), ("UPWARDS ARROW WITH TIP LEFTWARDS", "So", 0), ("UPWARDS ARROW WITH TIP RIGHTWARDS", "So", 0), ("DOWNWARDS ARROW WITH TIP LEFTWARDS", "So", 0), ("DOWNWARDS ARROW WITH TIP RIGHTWARDS", "So", 0), ("RIGHTWARDS ARROW WITH CORNER DOWNWARDS", "So", 0), ("DOWNWARDS ARROW WITH CORNER LEFTWARDS", "So", 0), ("ANTICLOCKWISE TOP SEMICIRCLE ARROW", "So", 0), ("CLOCKWISE TOP SEMICIRCLE ARROW", "So", 0), ("NORTH WEST ARROW TO LONG BAR", "So", 0), ("LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR", "So", 0), ("ANTICLOCKWISE OPEN CIRCLE ARROW", "So", 0), ("CLOCKWISE OPEN CIRCLE ARROW", "So", 0), ("LEFTWARDS HARPOON WITH BARB UPWARDS", "So", 0), ("LEFTWARDS HARPOON WITH BARB DOWNWARDS", "So", 0), ("UPWARDS HARPOON WITH BARB RIGHTWARDS", "So", 0), ("UPWARDS HARPOON WITH BARB LEFTWARDS", "So", 0), ("RIGHTWARDS HARPOON WITH BARB UPWARDS", "So", 0), ("RIGHTWARDS HARPOON WITH BARB DOWNWARDS", "So", 0), ("DOWNWARDS HARPOON WITH BARB RIGHTWARDS", "So", 0), ("DOWNWARDS HARPOON WITH BARB LEFTWARDS", "So", 0), ("RIGHTWARDS ARROW OVER LEFTWARDS ARROW", "So", 0), ("UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW", "So", 0), ("LEFTWARDS ARROW OVER RIGHTWARDS ARROW", "So", 0), ("LEFTWARDS PAIRED ARROWS", "So", 0), ("UPWARDS PAIRED ARROWS", "So", 0), ("RIGHTWARDS PAIRED ARROWS", "So", 0), ("DOWNWARDS PAIRED ARROWS", "So", 0), ("LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON", "So", 0), ("RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON", "So", 0), ("LEFTWARDS DOUBLE ARROW WITH STROKE", "So", 0), ("LEFT RIGHT DOUBLE ARROW WITH STROKE", "Sm", 0), ("RIGHTWARDS DOUBLE ARROW WITH STROKE", "Sm", 0), ("LEFTWARDS DOUBLE ARROW", "So", 0), ("UPWARDS DOUBLE ARROW", "So", 0), ("RIGHTWARDS DOUBLE ARROW", "Sm", 0), ("DOWNWARDS DOUBLE ARROW", "So", 0), ("LEFT RIGHT DOUBLE ARROW", "Sm", 0), ("UP DOWN DOUBLE ARROW", "So", 0), ("NORTH WEST DOUBLE ARROW", "So", 0), ("NORTH EAST DOUBLE ARROW", "So", 0), ("SOUTH EAST DOUBLE ARROW", "So", 0), ("SOUTH WEST DOUBLE ARROW", "So", 0), ("LEFTWARDS TRIPLE ARROW", "So", 0), ("RIGHTWARDS TRIPLE ARROW", "So", 0), ("LEFTWARDS SQUIGGLE ARROW", "So", 0), ("RIGHTWARDS SQUIGGLE ARROW", "So", 0), ("UPWARDS ARROW WITH DOUBLE STROKE", "So", 0), ("DOWNWARDS ARROW WITH DOUBLE STROKE", "So", 0), ("LEFTWARDS DASHED ARROW", "So", 0), ("UPWARDS DASHED ARROW", "So", 0), ("RIGHTWARDS DASHED ARROW", "So", 0), ("DOWNWARDS DASHED ARROW", "So", 0), ("LEFTWARDS ARROW TO BAR", "So", 0), ("RIGHTWARDS ARROW TO BAR", "So", 0), ("LEFTWARDS WHITE ARROW", "So", 0), ("UPWARDS WHITE ARROW", "So", 0), ("RIGHTWARDS WHITE ARROW", "So", 0), ("DOWNWARDS WHITE ARROW", "So", 0), ("UPWARDS WHITE ARROW FROM BAR", "So", 0), ("UPWARDS WHITE ARROW ON PEDESTAL", "So", 0), ("UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR", "So", 0), ("UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR", "So", 0), ("UPWARDS WHITE DOUBLE ARROW", "So", 0), ("UPWARDS WHITE DOUBLE ARROW ON PEDESTAL", "So", 0), ("RIGHTWARDS WHITE ARROW FROM WALL", "So", 0), ("NORTH WEST ARROW TO CORNER", "So", 0), ("SOUTH EAST ARROW TO CORNER", "So", 0), ("UP DOWN WHITE ARROW", "So", 0), ("RIGHT ARROW WITH SMALL CIRCLE", "Sm", 0), ("DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW", "Sm", 0), ("THREE RIGHTWARDS ARROWS", "Sm", 0), ("LEFTWARDS ARROW WITH VERTICAL STROKE", "Sm", 0), ("RIGHTWARDS ARROW WITH VERTICAL STROKE", "Sm", 0), ("LEFT RIGHT ARROW WITH VERTICAL STROKE", "Sm", 0), ("LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE", "Sm", 0), ("RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE", "Sm", 0), ("LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE", "Sm", 0), ("LEFTWARDS OPEN-HEADED ARROW", "Sm", 0), ("RIGHTWARDS OPEN-HEADED ARROW", "Sm", 0), ("LEFT RIGHT OPEN-HEADED ARROW", "Sm", 0), )
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/syntaxes/textmate/tests/unit/errror_tolerance/blocks.typ
typst
Apache License 2.0
#{func(} #[func(] #func("] #{}
https://github.com/tlsnotary/docs-mdbook
https://raw.githubusercontent.com/tlsnotary/docs-mdbook/main/research/README.md
markdown
# TLSNotary Research This folder contains write-ups from research. ## Typst The research write-ups are written in the [typst](https://github.com/typst/typst) markup language. You can install `typst` with: ```sh cargo install --git https://github.com/typst/typst typst-cli ``` or `brew install typst` on MacOs. To compile the `typ`-files into `pdf`-files, run: ```sh typst compile file.typ ```
https://github.com/npikall/typst-templates
https://raw.githubusercontent.com/npikall/typst-templates/main/main.typ
typst
#import "templates/vienna-sci.typ": tuw-thesis // Fancy Representation for LaTeX and Typst #let typst = { text(font: "Linux Libertine", weight: "semibold", fill: eastern)[typst] } #let latex = { set text(font: "New Computer Modern") box(width: 2.55em, { [L] place(top, dx: 0.3em, text(size: 0.7em)[A]) place(top, dx: 0.7em)[T] place(top, dx: 1.26em, dy: 0.22em)[E] place(top, dx: 1.8em)[X] }) } #show "Typst": typst #show "LaTeX": latex // Define abstract #let abstract = [ Die Kurzfassung soll den Inhalt der Arbeit kurz zusammenfassen. Sie sollte zumindest 70 und maximal 150 Wörter beinhalten. Der Schriftgrad sollte 10-Punkt sein. Der Einzug links und rechts soll 1 cm betragen. Der Text wird einfach in die Typst Vorlage eingefügt. Es fällt, durch den Gebrauch dieser Vorlage, die Verwendung von Umgebungen wie in LaTeX weg. ] // Useing the configuration #show: tuw-thesis.with( title: [Instruktionen zur Abfassung der Bachelorarbeit], thesis-type: [Bachelorarbeit], lang: "de", authors: ( ( name: "<NAME>", email: "<EMAIL>", matrnr: "12345678", date: datetime.today().display("[day] [month repr:short] [year]"), ), ), abstract: abstract, bibliography: bibliography("features/refs.bib"), appendix: include "appendix.typ", ) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // Set document from here on to have 2 columns // #show: rest => columns(2, rest) = Einleitung Die Bachelorarbeit kann in Deutsch oder Englisch verfasst werden. Die Länge darf 12 Seiten nicht unterschreiten und 30 Seiten nicht überschreiten (exkl. Anhang). Nach dem Titel der Arbeit werden der Autor und darauf eine Kurzfassung angeführt. Danach beginnt der Hauptteil der Arbeit. Die Bachelorarbeit hat keine Titelseite und nur bei Bedarf ein Inhaltsverzeichnis (zwischen Kurzfassung und Kapitel 1). Der Titel der Arbeit wird in dem Konfigurationsbefehl `tuw-thesis` angegeben, ebenso wie der Name des/der Autors/Autoren, die E-Mailadresse, die Matrikelnummer und das Datum. Durch den Konfigurationsbefehl wird nicht nur der Typografische Stil der Arbeit festgelegt, sondern es wird auch der Titelblock, das Inhalts- und das Literaturverzeichnis generiert. = Bachelorarbeit Nach der Einleitung kommt der weitere Text: #lorem(22) == Textbereich Der Text sollte die ganze Breite ausfüllen, also im Blocksatz stehen. Die Silbentrennung soll aktiviert sein. Der erste Absatz ist nicht eingerückt, die folgenden dann schon. Typst generiert dieses Einrücken automatisch. #lorem(25) == Layout, Schriftart, Schriftgrad und Nummerierung Für diese Arbeit wird das Template `vienna-sci` verwendet, die auf den Look von der LaTeX Classe `BachelorBUI.cls` aufbaut. Der Haupttext ist in 11-Punkt-Schrift und einzeiligem Abstand geschrieben. Die anderen Schriftgrade sind in der Vorlage definiert. Die Formatierung Kursiv kann für Hervorhebungen verwendet werden. Von der Formatierung Fett und Unterstrichen wird jedoch abgeraten. Es sollten in keinem Fall mehr als drei Überschriftsebenen verwendet werden. #figure( table( columns: 4, align: (left, left, left, left), table.hline(), table.header([Überschriftenebene], [Beispiel], [LaTeX - Befehle], [Typst - Befehle]), table.hline(), [Titel (zentriert)], [Instruktionen], "\ title", [], [Überschrift 1], [1 Einleitung], "\section", "= ", [Überschrift 2], [2.1 Textbereich], "\subsection", "== ", [Überschrift 3], [2.1.1 Unterlagen], "\subsubsection", "===", table.hline(start: 0), ), caption: [Die Tabellenbeschriftung ist normalerweise über der Tabelle. Tabellen sollen durchgehend nummeriert sein. Der letzte Satz der Tabellenbeschriftung endet ohne Punkt] )<tab:überschriften> Die Tabelle sowie deren Beschriftung werden innerhalb der `#figure` Umgebung erstellt. Die Beschriftung der Tabelle wird als Argument `caption` an die `#figure` Funktion übergeben. Das Erstellen der Tabelle erfolgt innerhalb der Funktion `#table`. == Abbildungen und Fotos Abbildungen sollten digital erstellt sein (keine Handzeichnungen). Diese müssen dann in der Bachelorarbeit integriert sein. Diagramme sollen gut lesbar erstellt werden. Der Schriftgrad innerhalb der Abbildungen soll 10-Punkt sein. Abbildungen sollen durchgehend nummeriert sein. Die Abbildungsbeschriftung ist immer unterhalb der Abbildung. Der letzte Satz der Abbildungsbeschriftung endet ohne Punkt. Die Abbildungsbeschriftung soll 10-Punkt-Schrift besitzen. Ein Beispiel sehen Sie in @fig:winston. //#pagebreak() #figure( image("features/Yousuf-Karsh-Winston-Churchill-1941.jpg", width: 40%) , caption: [Dies ist ein Beispiel für eine Abbildungsbeschriftung] )<fig:winston> Das Bild sowie dessen Beschriftung werden innerhalb der Funktion `#figure` geschrieben. Das Einfügen des Bildes erfolgt durch den Befehl `#image`. Die Beschriftung der Abbildung wird als Argument `caption` an die `#figure` Funktion übergeben, diese ist nun nach bzw. unterhalb der Abbildung positioniert. == Formeln Gleichungen und Formeln sollen generell zentriert in einer eigenen Zeile platziert werden. Die Gleichungen sollen durchnummeriert werden, wobei die Gleichungsnummer in Klammer zu stehen hat. Formeln werden einfach in die zwischen \$ Zeichen gesetzt. Dabei wird die Nummerierung automatisch übernommen. $ K_t = (1 - (R^2 dot tau)/(c_a + nu dot tan delta))^4 dot k_1 $ == Fußnoten Die Fußnotenziffer ist entweder direkt nach dem zu beschreibenden Wort oder nach einem Satzzeichen angeordnet. Fußnoten werden in den Befehl `#footnote` geschrieben. #footnote([Dies ist eine Fußnote]) == Referenzierungen und Literaturverzeichnis Die Liste der Referenzierungen ist mit „Literatur“ betitelt und wird ohne eigenen Seitenumbruch am Ende der Arbeit positioniert (aber noch vor einem möglichen Anhang). Die zugehörige Überschrift hat dann keine Überschriftennummer. Das Literaturverzeichnis wird in Typst durch das verwenden der Vorlage automatisch erstellt sofern eine _BibTeX_ Datei in der Konfigurationsfunktion angegeben wurde. Das Literaturverzeichnis wird dann automatisch am Ende (aber noch vor dem Anhang) eingefügt. Die Literaturangaben sollen nummeriert angeführt werden. Die Nummerierung selbst steht innerhalb eckiger Klammern, z.B. @dirac @einstein @knuthwebsite oder @dirac[p.~27]. //#pagebreak() Die Quellenangabe kann auch hinter dem Zitat oder inhaltlicher Behauptung wie folgt angeführt werden: (Name des Erstautor et al. (Jahreszahl)), z.B. (Alberty et al. (1999)). Dann muss ein geeigneter Literaturstil angegeben werden. Typst bietet hierfür ein paar Möglichkeiten an. Dazu kann man das Argument `form` an den Befehl `#cite` übergeben. Der Stil kann individuell durch das `style` Argument verändert werden.\ #for elem in ("normal", "prose", "author", "year"){ [#h(1cm)"#elem" $-->$ #h(1em) #cite(<dirac>, form: elem, style: "copernicus")\ ]} In diesem Beispiel wurde der Zitierstil `copernicus` verwendet, jedoch können noch viele andere verwendet werden. == Kopfzeile Die Bachelorarbeit ist für einen doppelseitigen Druck formatiert. Daher befindet sich in der Kopfzeile außen die Seitennummer (bei geraden Seiten links und bei ungeraden Seiten rechts) sowie innen der Titel der Arbeit (bei geraden Seiten rechts und bei ungeraden Seiten links). Dies erfolgt in Konfiguration automatisch.
https://github.com/EpicEricEE/typst-equate
https://raw.githubusercontent.com/EpicEricEE/typst-equate/master/README.md
markdown
MIT License
# equate A package for various enhancements for mathematical expressions. ## Usage The main function of this package is `equate`, which can be applied in a show-all rule to enable the package features for all equations. The function takes a single positional argument (for the body of the show rule), and several optional keyword arguments for customization: | Parameter | Type | Description | Default | | --------------- | ------------------- | ---------------------------------------------------- | -------- | | `breakable` | `boolean`, `auto` | Whether equations can break across pages or columns. | `auto` | | `sub-numbering` | `boolean` | Whether to assign sub-numbers to each equation line. | `false` | | `number-mode` | `"line"`, `"label"` | Which lines of the equation to number. | `"line"` | Some notes about these parameters: - Starting from Typst v0.12.0, there is built-in support for breakable block equations. The `breakable` can still be used to override the default behavior. The value `auto` defers to the `block.breakable` setting in the context of equations. - When sub-numbering is enabled, the equation numbering format should be set to include the sub-number, such as in `(1.1)`. If only a single line of an equation is labeled, only the main equation number will be shown. - A line can be labeled by inserting a label in code mode at the end of the line, before the line break, for example: ```typ $ E &= m c^2 #<short> \ &= sqrt(p^2 c^2 + m^2 c^4) #<long> $ ``` In Typst versions prior to v0.12.0, equation numbers were centered in equation blocks, even for single-line equations. This package corrects that behavior by aligning numbers with the baseline of the equation lines instead. Typst v0.12.0 has an internal fix for this, but the package's layout adjustments remain in place for backward compatibility with earlier versions. ### The revoke label The `<equate:revoke>` label can be used on an equation or a specific equation line for the following purposes: - **For an entire equation:** Disables the package features, allowing you to revert to per-block numbering. - **For equations in [shared alignment blocks](#shared-alignment-points):** The label will additionally ensure that the equation does not share alignment points with other equations in the block. - **For a specific line:** Disables numbering on that line. This can be useful when `number-mode` is set to `"line"`, but you wish to exclude certain lines from being numbered. > **Note:** The current limitation is that Typst does not support attaching multiple labels to the same element. Thus, using the revoke label means no other labels can be added to the same line or equation. ### Shared Alignment Points In some cases, you may want to interrupt a multi-line equation with a paragraph of text or other elements. To ensure that equations after the interruption maintain alignment with the previous ones, you can use the `share-align` function to create a shared alignment block. This will make all block equations within the block share their alignment points. ### Scoped Usage If you want to use the package features on selected equations only, you can skip the show-all rule and apply the `equate` function directly to individual equations. As the package requires the use of a show rule on the `ref` element for line-specific references, you will also need to use the `equate` function either as a show rule on references, or directly on the reference or label itself. </details> ### Performance Considerations Since this package reimplements the equation alignment system in pure Typst, it may impact performance due to the high number of measurements and layout passes required. It is recommended to use the package sparingly, especially in large documents with many equations. ## Example ```typ #import "@preview/equate:0.2.1": equate #show: equate.with(breakable: true, sub-numbering: true) #set math.equation(numbering: "(1.1)") The dot product of two vectors $arrow(a)$ and $arrow(b)$ can be calculated as shown in @dot-product. $ angle.l a, b angle.r &= arrow(a) dot arrow(b) \ &= a_1 b_1 + a_2 b_2 + ... a_n b_n \ &= sum_(i=1)^n a_i b_i. #<sum> $ <dot-product> The sum notation in @sum is a useful way to express the dot product of two vectors. ``` ![Result of example code (page 1).](assets/example-1.svg) ![Result of example code (page 2).](assets/example-2.svg)
https://github.com/donghoony/typst_editorial
https://raw.githubusercontent.com/donghoony/typst_editorial/main/division_abstract.typ
typst
MIT License
#import "colors.typ" : * #let abstract_page(division: "3", problems: ()) = { text(weight: "bold", size: 40pt)[Div. #division] let cell = rect.with( inset: 12pt, width: 100% ) let column_width = (8%, 50%, 15%) let row_header_content(_text) = { cell( fill: black, text(weight: "bold", size: 15pt, fill: white)[#_text] ) } let row_content(_text, tier: "") = { let c = black let w = "medium" if (tier != "") {w = "bold"} if (tier == "b") {c = AC_BRONZE} if (tier == "s") {c = AC_SILVER} if (tier == "g") {c = AC_GOLD} if (tier == "p") {c = AC_PLATINUM} if (tier == "d") {c = AC_DIAMOND} if (tier == "r") {c = AC_RUBY} cell( fill: rgb("f0f0f0"), text(weight: w, size: 15pt, fill: c)[#_text] ) } let row_header(t1, t2, t3) = { align(center)[ #grid( column-gutter: 1pt, columns: column_width, row_header_content(t1), row_header_content(t2), row_header_content(t3) ) ] } let row_contents(number, title, diff, tier) = { align(center)[ #grid( column-gutter: 1pt, row-gutter: 1pt, columns: column_width, row_content(number), align(left)[#row_content(title)], align(left)[#row_content(diff, tier: tier)] ) ] } align(horizon)[ #grid( columns: (100%), row-gutter: 1pt, column-gutter: 1pt, row_header("번호", "제목", "난이도"), ..problems.map(problem => { let (num, title, diff, tier, tag) = problem row_contents(division + num, title, diff, tier) }) ) ] pagebreak(weak: true) }
https://github.com/Myriad-Dreamin/tinymist
https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/crates/tinymist-query/src/fixtures/match_def/base.typ
typst
Apache License 2.0
#let /* ident after */ f(a) = a;
https://github.com/kznr02/neet-cv
https://raw.githubusercontent.com/kznr02/neet-cv/main/README.md
markdown
MIT License
# neet-cv 基于typst编写的简历模板 ![图片](./result.png "效果图") 使用方法:使用typst官方的app或者vscode,导入assets与template.typ即可开始使用,详情模板使用请参考cv-sample.typ 有任何改进欢迎提issue提pr(〃 ̄︶ ̄)人( ̄︶ ̄〃)
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/layout/place-float-figure.typ
typst
Apache License 2.0
// Test floating figures. --- #set page(height: 250pt, width: 150pt) = Introduction #lorem(10) #footnote[Lots of Latin] #figure( placement: bottom, caption: [A glacier #footnote[Lots of Ice]], image("/files/glacier.jpg", width: 80%), ) #lorem(40) #figure( placement: top, caption: [An important], image("/files/diagram.svg", width: 80%), )
https://github.com/LDemetrios/Conspects-4sem
https://raw.githubusercontent.com/LDemetrios/Conspects-4sem/master/typst/styles/themes/print.typ
typst
#let background = white #let foreground = black #let red-ish = luma(127) #let green-ish = luma(127) #let blue-ish = luma(127) #let yellow-ish = luma(127) #let pagewidth = none #let pageheight = none
https://github.com/SillyFreak/tu-wien-software-engineering-notes
https://raw.githubusercontent.com/SillyFreak/tu-wien-software-engineering-notes/main/optimizing-compilers/oc/oc.typ
typst
// flow graphs #let instr = $dotless.i$ #let succ = $italic("succ")$ #let pred = $italic("pred")$ // DFAs #let Spec = $cal(S)$ #let Func(e: $thick$) = $bracket.l.double #e bracket.r.double$ #let fw = $italic("fw")$ #let bw = $italic("bw")$ #let Const = $italic("Cst")$ #let Id = $italic("Id")$ #let Vars = $upright(bold("V"))$ #let Consts = $upright(bold("C"))$ #let Terms = $upright(bold("T"))$ #let Ops = $upright(bold("O"))$ #let Eval = $cal(E)$ #let path(body) = $angle.l body angle.r$ #let Paths = $upright(bold("P"))$ #let CM = $italic("CM")$ #let BCM = $italic("BCM")$ #let ALCM = $italic("ALCM")$ #let LCM = $italic("LCM")$ #let SpCM = $italic("SpCM")$ #let Insert = $italic("Insert")$ #let Repl = $italic("Repl")$ #let Comp = $italic("Comp")$ #let Transp = $italic("Transp")$ #let Safe = $italic("Safe")$ #let Correct = $italic("Correct")$ #let Available = $italic("Available")$ #let VeryBusy = $italic("VeryBusy")$ #let Earliest = $italic("Earliest")$ #let Delayed = $italic("Delayed")$ #let Latest = $italic("Latest")$ #let Isolated = $italic("Isolated")$
https://github.com/pmazaitis/combination
https://raw.githubusercontent.com/pmazaitis/combination/main/lib.typ
typst
#import "./combination.typ": *
https://github.com/gongke6642/tuling
https://raw.githubusercontent.com/gongke6642/tuling/main/Text/sub.typ
typst
#set text( size:10pt, ) #set page( paper:"a5", margin:(x:1.8cm,y:1.5cm), ) #set par( justify: true, leading: 0.52em, ) = 下标 以下标形式呈现文本。 文本将会呈现为较小的形式,基准线也会下降。 = 例 #image("20.png") = 参数 #image("21.png") = 排版 是否优先选择字体的专用下标字符。 如果启用,Typst 首先尝试将文本转换为下标代码点。如果失败,它将尝试渲染降低和缩小的普通字母。 默认:true = 基线 合成下标基准线的偏移量。 如果 typographic 为 true 并且字体对给定的 body 有下标代码点,则不适用。 默认:0.2em = 大小 合成下标的字体大小。 如果 typographic 为 true 并且字体对给定的 body 有下标代码点,则不适用。 默认:0.6em = 内容 要显示为下标的内容。
https://github.com/sitandr/typst-examples-book
https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/basics/measure.md
markdown
MIT License
# Measure, Layout <div class="warning">This section is outdated. It may be still useful, but it is strongly recommended to study new context system (using the reference).</div> ## Style & Measure > Style [documentation](https://typst.app/docs/reference/foundations/style/). > Measure [documentation](https://typst.app/docs/reference/layout/measure/). `measure` returns _the element size_. This command is extremely helpful when doing custom layout with `place`. However, there is a catch. Element size depends on styles, applied to this element. ```typ #let content = [Hello!] #content #set text(14pt) #content ``` So if we will set the big text size for some part of our text, to measure the element's size, we have to know _where the element is located_. Without knowing it, we can't tell what styles should be applied. So we need a scheme similar to `locate`. This is what `styles` function is used for. It is _a content_, which, when located in document, calls a function inside on _current styles_. Now, when we got fixed `styles`, we can get the element's size using `measure`: ```typ #let thing(body) = style(styles => { let size = measure(body, styles) [Width of "#body" is #size.width] }) #thing[Hey] \ #thing[Welcome] ``` # Layout Layout is similar to `measure`, but it returns current scope **parent size**. If you are putting elements in block, that will be block's size. If you are just putting right on the page, that will be page's size. As parent's size depends on it's place in document, it uses the similar scheme to `locate` and `style`: ```typ #layout(size => { let half = 50% * size.width [Half a page is #half wide.] }) ``` It may be extremely useful to combine `layout` with `measure`, to get width of things that depend on parent's size: ```typ #let text = lorem(30) #layout(size => style(styles => [ #let (height,) = measure( block(width: size.width, text), styles, ) This text is #height high with the current page width: \ #text ])) ```
https://github.com/FrightenedFoxCN/cetz-cd
https://raw.githubusercontent.com/FrightenedFoxCN/cetz-cd/main/tests/arrows.typ
typst
#import "../src/cetz-cd.typ": * // first, one simple arrow #cetz-cd( ``` $...$ ar[r] & $C_n$ ar[r, $d_(n - 1)$] ar[d, $u_n$] & $C_(n - 1)$ ar[r] ar[d, $u_(n - 1)$] & $...$; $...$ ar[r] & $D_n$ ar[r, $d_(n - 1)$] & $D_(n - 1)$ ar[r] & $...$; ```)
https://github.com/artemist/typstcard
https://raw.githubusercontent.com/artemist/typstcard/canon/cards_4x6.typ
typst
#{ set page(width: 6in, height: 4in, margin: 0em) import "common.typ" let options = json("options.json") let cards = options.cards let args = options.args let content_fn = if args.no_content { _ => [] } else { import "content/content.typ" content.content } for (idx, card) in cards.enumerate() { if idx != 0 { pagebreak() } common.postcard_content(100%, 100%, content_fn, card) } }
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/linebreak-00.typ
typst
Other
// Test overlong word that is not directly after a hard break. This is a spaceexceedinglylongy.
https://github.com/rwblickhan/resume
https://raw.githubusercontent.com/rwblickhan/resume/main/template.typ
typst
#let resume(experiences, personal_projects) = { set document(title: "Resume", author: "<NAME>") set page( paper: "us-letter", margin: (left: 0.50in, right: 0.50in, top: 0.50in, bottom: 0.50in), ) set text(font: "Charter", lang: "en") set par(spacing: 0.75em) set par(justify: true) let header = { align(center)[ #pad(bottom: 5pt)[ #text(size: 24pt, weight: "bold")[<NAME>han] ] #set text(size: 11pt) #text("San Francisco, CA") | #text("628-230-8646") | #link("mailto:<EMAIL>")[#text("<EMAIL>")] | #link("https://rwblickhan.org")[#text("rwblickhan.org")] ] } let education_item(organization, degree, time_frame) = { set text(size: 10pt) block[ #text(weight: "bold")[#organization] #box(width: 1fr)[ #align(right)[ #time_frame ] ] ] degree } let education_section = { text(size: 16pt, weight: "bold")[Education] education_item[ University of British Columbia ][ Bachelor of Science, Computer Science & Mathematics ][ 2014-2019 ] } let experience_section = { text(size: 16pt, weight: "bold")[Experience] experiences } let personal_projects_section = { text(size: 16pt, weight: "bold")[Personal Projects] personal_projects } header experience_section if personal_projects != none { personal_projects_section } education_section } #let experience_item(organization, role, timeframe, body) = { set text(size: 10pt) block[ #text(weight: "bold")[#organization] #if role != none { text(style: "italic")[| #role] } #box(width: 1fr)[ #align(right)[ #timeframe ] ] ] body } #let experience_subheader(role, timeframe) = { block[ #text(style: "italic")[#role] #box(width: 1fr)[ #align(right)[ #text(style: "italic")[#timeframe] ] ] ] } #let personal_project_item(title, timeframe, link_dest, body) = { set text(size: 10pt) block[ #text(weight: "bold")[#title] (#link(link_dest)) #box(width: 1fr)[ #align(right)[ #timeframe ] ] ] body }
https://github.com/Doublonmousse/pandoc-typst-reproducer
https://raw.githubusercontent.com/Doublonmousse/pandoc-typst-reproducer/main/color_issues/oklab.typ
typst
#square( fill: oklab(27%, 20%, -3%, 50%) )
https://github.com/Woodman3/modern-ysu-thesis
https://raw.githubusercontent.com/Woodman3/modern-ysu-thesis/main/pages/bachelor-abstract-en.typ
typst
MIT License
#import "../utils/custom-cuti.typ": fakebold #import "../utils/style.typ": 字号, 字体 #import "../utils/indent.typ": fake-par #import "../utils/double-underline.typ": double-underline #import "../utils/invisible-heading.typ": invisible-heading // 本科生英文摘要页 #let bachelor-abstract-en( // documentclass 传入的参数 anonymous: false, twoside: false, fonts: (:), info: (:), // 其他参数 keywords: (), outline-title: "Abstract", outlined: true, anonymous-info-keys: ("author-en", "supervisor-en", "supervisor-ii-en"), leading: 22pt, spacing: 1.38em, body, ) = { // 1. 默认参数 fonts = 字体 + fonts // 2. 对参数进行处理 // 2.1 如果是字符串,则使用换行符将标题分隔为列表 if type(info.title-en) == str { info.title-en = info.title-en.split("\n") } // 3. 内置辅助函数 let info-value(key, body) = { if (not anonymous or (key not in anonymous-info-keys)) { body } } // 4. 正式渲染 [ #pagebreak(weak: true, to: "even" ) #set text(font: fonts.楷体, size: 字号.小四) #set par(leading: leading, justify: true) #show par: set block(spacing: spacing) // 标记一个不可见的标题用于目录生成 #invisible-heading(level: 1, outlined: outlined, outline-title) #align(center)[ #set text(size: 字号.小二) #v(1em) Abstract #v(0.8em) ] #[ #set par(first-line-indent: 2em) #fake-par #body ] #v(1em) #grid(columns: (auto,auto), text(weight: "bold")[Keywords:], (("",)+ keywords.intersperse("; ")).sum() ) ] }
https://github.com/Pablo-Gonzalez-Calderon/showybox-package
https://raw.githubusercontent.com/Pablo-Gonzalez-Calderon/showybox-package/main/lib/shadows.typ
typst
MIT License
/* * ShowyBox - A package for Typst * <NAME> and Showybox Contributors (c) 2023-2024 * * lib/shadows.typ -- The package's file containing all the * internal functions for drawing shadows. * * This file is under the MIT license. For more * information see LICENSE on the package's main folder. */ #import "func.typ": * #import "id.typ": * #import "sections.typ": * /* * Function: showy-shadow() * * Description: Draws the showybox main shadow * (excludes boxed title shadows). * * Parameters: * + sbox-props: Showybox properties * + sbox: Pre-rendered showybox */ #let showy-shadow(sbox-props, sbox, id) = context { if sbox-props.shadow == none { return sbox } let my-state = state("showybox-" + id, 0pt) /* If it has a boxed sbox-props.title, leave some space * to avoid collisions with other elements next to the * showybox */ if sbox-props.title != "" and sbox-props.title-style.boxed-style != none { if sbox-props.title-style.boxed-style.anchor.y == bottom { v(my-state.at(here())) } else if sbox-props.title-style.boxed-style.anchor.y == horizon{ v(my-state.at(here())/2) } // Otherwise, no space is needed } block( breakable: sbox-props.breakable, radius: sbox-props.frame.radius, fill: sbox-props.shadow.color, width: sbox-props.width, spacing: 0pt, outset: ( left: -sbox-props.shadow.offset.x, right: sbox-props.shadow.offset.x, bottom: sbox-props.shadow.offset.y, top: -sbox-props.shadow.offset.y ), /* If it have a boxed title, substract some space to avoid the shadow to be body + title height, and only body height */ if sbox-props.title != "" and sbox-props.title-style.boxed-style != none { if sbox-props.title-style.boxed-style.anchor.y == bottom { v(-my-state.at(here())) } else if sbox-props.title-style.boxed-style.anchor.y == horizon { v(-my-state.at(here())/2) } // Otherwise do nothing sbox } else { sbox } ) } /* * Function: showy-boxed-title-shadow() * * Description: Draws the showybox's boxed title shadow * * Parameters: * + sbox-props: Showybox properties * + tbox: Pre-rendered boxed-title */ #let showy-boxed-title-shadow(sbox-props, id) = context { if sbox-props.shadow == none { return } else if sbox-props.title == "" or sbox-props.title-style.boxed-style == none { return } let my-state = state("showybox-" + id, 0pt) return place( top + sbox-props.title-style.boxed-style.anchor.x, dx: sbox-props.title-style.boxed-style.offset.x, dy: sbox-props.title-style.boxed-style.offset.y + if sbox-props.title-style.boxed-style.anchor.y == bottom { -my-state.final() } else if sbox-props.title-style.boxed-style.anchor.y == horizon { -my-state.final()/2 }, block( spacing: 0pt, inset: (x: 1em), block( breakable: sbox-props.breakable, radius: sbox-props.title-style.boxed-style.radius, fill: sbox-props.shadow.color, spacing: 0pt, outset: ( left: -sbox-props.shadow.offset.x, right: sbox-props.shadow.offset.x, top: -sbox-props.shadow.offset.y, bottom: sbox-props.shadow.offset.y ), hide(showy-title(sbox-props)) ) ) ) }
https://github.com/dankelley/typst_templates
https://raw.githubusercontent.com/dankelley/typst_templates/main/qe/0.0.2/sample.typ
typst
MIT License
#import "@local/qe:0.0.2": conf #show: doc => conf( student: "INSERT <NAME> Student", date: "INSERT Date of Examination", paper: [INSERT Full reference to assigned paper.], venu: "INSERT Building and room number", time: "INSERT Starting time", doc, ) // Use $\dagger$ to the left of important questions, to // aide in triage choices during the examination. == Was reading careful? - [ ] A question, possibly followed by hints, further followup questions, or justification. - [ ] ... == Are common facts known? - [ ] ... - [ ] ... == Is judgement mature? - [ ] ... - [ ] ...
https://github.com/Origami404/kaoyan-shuxueyi
https://raw.githubusercontent.com/Origami404/kaoyan-shuxueyi/main/微积分/01-三角函数公式.typ
typst
#import "../template.typ": sectionline, gray_table, colored = 三角函数 == 定义和关系 #figure(image("../assets/三角函数六角图.png", width: 75%)) == 和差化积 $ sin(alpha plus.minus beta) &= sin alpha cos beta plus.minus cos alpha sin beta \ cos(alpha plus.minus beta) &= cos alpha cos beta plus.minus sin alpha sin beta \ tan(alpha plus.minus beta) &= (tan alpha plus.minus tan beta) / (1 minus.plus tan alpha tan beta) $ == 二倍角 $ sin 2 &= 2 sin cos \ cos 2 &= cos^2 - sin^2 \ &= 2 cos^2 - 1 = 1 - 2 sin^2 \ tan 2 &= (2 tan) / (1 - tan^2) $ == 导数和原函数 #gray_table( columns: 7, [函数], [$sin$], [$cos$], [$tan$], [$cot$], [$sec$], [$csc$], [导数], [$cos$], [$-sin$], [$sec^2$], [$-cot^2$], [$sec tan$], [$-csc cot$], [原函数], [$-cos$], [$sin$], [$-ln|cos|$], [$ln|sin|$], [$ln|sec + tan|$], [$ln|csc - cot|$], ) \ $ dif arcsin &= 1 / sqrt(1 - x^2) dif x \ dif arccos &= - 1 / sqrt(1 - x^2) dif x = - dif arcsin \ dif arctan &= 1 / (1 + x^2) dif x \ $ == 级数 $ sin &= sum (-1)^n / (2n + 1)! x^(2n + 1) \ cos &= sum (-1)^n / (2n)! x^(2n) \ $ #pagebreak()
https://github.com/PumasAI/SummaryTables.jl
https://raw.githubusercontent.com/PumasAI/SummaryTables.jl/master/README.md
markdown
MIT License
# SummaryTables.jl <div align="center"> <picture> <img alt="SummaryTables.jl logo" src="/docs/src/assets/logo.png" width="150"> </picture> </div> [![](https://img.shields.io/badge/Docs-Stable-lightgrey.svg)](https://pumasai.github.io/SummaryTables.jl/stable/) [![](https://img.shields.io/badge/Docs-Dev-blue.svg)](https://pumasai.github.io/SummaryTables.jl/dev/) SummaryTables.jl is a Julia package for creating publication-ready tables in HTML, docx, LaTeX and Typst formats. Tables are formatted in a minimalistic style without vertical lines. SummaryTables offers the `table_one`, `summarytable` and `listingtable` functions to generate pharmacological tables from Tables.jl-compatible data structures, as well as a low-level API to construct tables of any shape manually. ## Examples ``` julia data = DataFrame( sex = ["m", "m", "m", "m", "f", "f", "f", "f", "f", "f"], age = [27, 45, 34, 85, 55, 44, 24, 29, 37, 76], blood_type = ["A", "0", "B", "B", "B", "A", "0", "A", "A", "B"], smoker = [true, false, false, false, true, true, true, false, false, false], ) table_one( data, [:age => "Age (years)", :blood_type => "Blood type", :smoker => "Smoker"], groupby = :sex => "Sex", show_n = true ) ``` ![](README_files/figure-commonmark/cell-3-output-1.svg) ``` julia data = DataFrame( concentration = [1.2, 4.5, 2.0, 1.5, 0.1, 1.8, 3.2, 1.8, 1.2, 0.2, 1.7, 4.2, 1.0, 0.9, 0.3, 1.7, 3.7, 1.2, 1.0, 0.2], id = repeat([1, 2, 3, 4], inner = 5), dose = repeat([100, 200], inner = 10), time = repeat([0, 0.5, 1, 2, 3], 4) ) listingtable( data, :concentration => "Concentration (ng/mL)", rows = [:dose => "Dose (mg)", :id => "ID"], cols = :time => "Time (hr)", summarize_rows = :dose => [ length => "N", mean => "Mean", std => "SD", ] ) ``` ![](README_files/figure-commonmark/cell-4-output-1.svg) ``` julia categories = ["Deciduous", "Deciduous", "Evergreen", "Evergreen", "Evergreen"] species = ["Beech", "Oak", "Fir", "Spruce", "Pine"] fake_data = [ "35m" "40m" "38m" "27m" "29m" "10k" "12k" "18k" "9k" "7k" "500yr" "800yr" "600yr" "700yr" "400yr" "80\$" "150\$" "40\$" "70\$" "50\$" ] labels = ["", "", "Size", Annotated("Water consumption", "Liters per year"), "Age", "Value"] body = [ Cell.(categories, bold = true, merge = true, border_bottom = true)'; Cell.(species)'; Cell.(fake_data) ] Table(hcat( Cell.(labels, italic = true, halign = :right), body )) ``` ![](README_files/figure-commonmark/cell-5-output-1.svg) ## Comparison with PrettyTables.jl [PrettyTables.jl](https://github.com/ronisbr/PrettyTables.jl/) is a well-known Julia package whose main function is formatting tabular data, for example as the backend to [DataFrames.jl](https://github.com/JuliaData/DataFrames.jl). PrettyTables supports plain-text output because it is often used for rendering tables to the REPL, however this also means that it does not support merging cells vertically or horizontally in its current state, which is difficult to realize with plain text. In contrast, SummaryTables’s main purpose is to offer convenience functions for creating specific scientific tables which are out-of-scope for PrettyTables. For our desired aesthetics, we also needed low-level control over certain output formats, for example for controlling cell border behavior in docx, which were unlikely to be added to PrettyTables at the time of writing this package.