repo
stringlengths
27
90
file
stringlengths
57
176
language
stringclasses
2 values
license
stringclasses
13 values
content
stringlengths
25
180k
https://github.com/jamesrswift/springer-spaniel
https://raw.githubusercontent.com/jamesrswift/springer-spaniel/main/src/models/sidecaption.typ
typst
The Unlicense
#let sidecaption( body, direction: ltr, label: none, spacing: 1em, caption-width: 67%, caption-padding: arguments(), ) = { show figure: (it)=>{ stack( spacing: spacing, dir: direction, block( width: (caption-width) - (spacing), pad(..caption-padding, it.caption) ), it.body ) } place(float: true, auto, [#body#label]) }
https://github.com/pluttan/asmlearning
https://raw.githubusercontent.com/pluttan/asmlearning/master/lab4/lab4.typ
typst
#import "@docs/bmstu:1.0.0":* #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: "Москва", table_of_contents: true, ) = Ввод массива чисел Перепишем ввод чисел: в общую библеотеку добавим процедуру ```asm getmas```, которая будет принимать на вход число чисел, которые будут записаны через пробел и сохранять их в отдельном буфере. #img(image("getmas.svg", width: 40%), [Схема алгоритва для ввода массива]) Тут уже берется четкое количество байт, необходимых для сохранения чисел, поэтому отсчитывать цифры числа нам больше нет необходимости. Так же, как уже говорилось в лабораторной 2 разделителями теперь будут являться пробелы, а не переносы строки. В цикле по обработке чисел я это изменил. Это все изменения, которые я произвел с процедурой ```stoi```. А теперь подробнее разберем саму процедуру ввода массива чисел. Единственное, что в ней по логике должно отличаться от процедуры ```asm geti``` -- это ввод вместо одного числа -- `n`. Будем реализовывать это через цикл, запросив `n` в регистр ```asm esi```. Остальные значения будем запрашивать в тех же регистрах, что и в процедуре ```asm geti```. Для начала перед циклом выведем приглашение на ввод (в данной лабораторной это будут номер строк). После прочитаем ввод польщователя и подготовим некоторое смещение: из-за того что числа 4-ех байтовые, все вместе они займут $4n$ байт. Запишем это значение в ```asm edi```. В ```asm ecx``` будет храниться общее смещение, добавим к ```asm ecx``` ```asm edi```, таким образом получим смещение в памяти, указывающее на конечный байт. Теперь, вычитая ```asm edi``` из ```asm ecx```, мы сможем получать адрес первого элемента, а уменьшая ```asm edi``` на 4 за каждую итерацию цикла получим счетчик для цикла. #let input = parserasm(read("input.asm")) #code(funcstr(input, "getmas:"), "asm", [Процедура ```asm getmas```]) Каждую итерацию цикла будем вызывать ```asm stoi``` для обработки следующего числа. Так как ```asm stoi``` возвращает адрес, за текущим числом в тот же регистр, из которого читает адрес текущего числа, то адреса менять не придется. После выполнения ```asm stoi``` заносим результат выполнения в новый буфер для уже целочисленных данных, после чего выполняем проверку на выход, выходим если ```asm edi = 0```, иначе идем на следующую итерацию цикла. #code(funcstr(input, "getmasl:"), "asm", [Цикл для чтения элементов]) В выходе освобождаем весь использованный стек, загружая в регистры начальные их значения и выходим. #code(funcstr(input, "getmase:"), "asm", [Цикл для чтения элементов]) = Выполнение лабораторной работы == Цель Изучение приемов моделирования обработки массивов и матриц в языке ассемблера. == Задание Дана матрица $6 times 4$. Определить строку с максимальной суммой положительных элементов. Организовать ввод матрицы и вывод результатов. == Выполнение === Алгоритм выполнения Алгоритм тут простой: нам нет необходимости запрашивать все 4 строки у пользователя сразу, а потом обрабатывать -- вместо этого будем запрашивать у пользователя 1 строку, находить сумму положительных элементов, и если эта сумма больше сохраненной суммы, изменять сохраненную сумму на новую и сохранять номер строки (изначально сохраненная сумма равна 0 -- наименьшая возможная сумма положительных чисел), после чего проделываем весь цикл еще 3 раза. В результате не затрачивая памяти на хранение всех строк мы получаем готовый ответ, который выводим, используя библеотеку вывода из 2-ой лабораторной работы. === Работа с данными #let lab4 = parserasm(read("lab4.asm")) #code(funcstr(lab4, "section .data")+funcstr(lab4, "section .bss"), "asm", [Выделяем и инициализируем необходимые данные]) Метки ```asm max``` и ```asm maxi``` будут смещениями для адресов, хранящих наибольшую сумму и индекс строки с этой суммой соответственно. Метки ```asm iarr```, ```asm iarrn```, ```asm ot1```, ```asm ot2``` будут смещениями для адресов, хранящих строки для вывода пользователю, метки с такими же названиями с `l` в конце хранят количество букв. ```asm iarrn``` представляет особый интерес -- тут я записал массив строк по 3 буквы, для обозначения номера строки в память, смещением которой является одна метка, потом будем прибавлять к этой метке 3 и получать обрезанную строку с номером необходимой строки. ```asm arro``` -- место для массива чисел -- по 4 байта на 6 чисел. ```asm arri``` -- буфер, который будем использовать для ввода-вывода, я взял его побольше, но если знать максимальное количество символов, которые введет пользовалель за одну строку, его можно уменьшить. === Подсчет суммы неотрицательных элементов Сам алгоритм обработки массива для удобства выделим в отдельную процедуру, где в цикле пройдем по каждому элементу и сложим друг с другом все неотрицательные элементы. #img(image("calcsum.svg", width: 40%), [Схема алгоритма для обработки массива]) #code(funcstr(lab4, "calcsum:"), "asm", [Процедура ```asm calcsum```]) Тут воспользуемся той же хитростью, что и при вводе -- прибавим к отдельному регистру, содеждащему смещение (тут ```asm eax```) $4n$ байта (тут ```asm ebx```) и получим счетчик, вычитая 4 из ```asm ebx```, и текущее смещение, вычитая из ```asm eax``` ```asm ebx```. В цикле будет ветвление, поэтому для него потребуется несколько меток. #code(funcstr(lab4, "calcsuml:"), "asm", [Процедура ```asm calcsum```: цикл \#1]) Переносим текущее число в ```asm edx``` и организуем ветвление: если перенесенное число больше нуля идем на метку ```asm calcsumlsum```. #code(funcstr(lab4, "calcsumlsum:"), "asm", [Процедура ```asm calcsum```: цикл \#2]) Где добавляем число к получившемуся ответу и переходим к завершению итерации цикла (иначе -- сразу переходим к завершению итерации). #code(funcstr(lab4, "calcsumle:"), "asm", [Процедура ```asm calcsum```: цикл \#3]) В конце итерации уменьшаем счетчик на 4 и проверяем условие выхода. По завершению цикла переходим к завершению процедуры. В ней мы как обычно возвращаем все регистры и выходим из процедуры. #code(funcstr(lab4, "calcsume:"), "asm", [Процедура ```asm calcsum```: конец]) #pagebreak() === Основная программа #img(image("_start.svg", width: 40%), [Схема алгоритма для основной программы]) После описания процедуры для подсчета суммы положительных чисел в массиве перейдем к описанию основной программы, которая будет запрашивать данные, получать сумму, сравнивать сумму с наибольшей и выводить результаты. #code(funcstr(lab4, "_start:") + funcstr(lab4, "getarr:"), "asm", [Получаем матрицу]) Для получения матрицы необходимо в цикле вызвать 4 раза получение массива и на той же итерации этот массив обработать -- пока он не затерся. Для этого на этой метке вызываем ```asm getmas```, а после того, как он отработает вызываем ```asm calcsum```. ```asm calcsum``` только возвращает результат, но ни с чем не сравнивает, поэтому сравниваем результат с текущей максимальной суммой, если он больше переходим к ```asm ecxmovmax```. #code(funcstr(lab4, "ecxmovmax:"), "asm", [Получаем матрицу]) Тут мы запоминаем его наибольший резутьтат и номер строки, после чего программа переходит к концу получения строки матрицы -- ```asm getarre```. #code(funcstr(lab4, "getarre:"), "asm", [Завершаем обработку строки матрицы]) В завершении увеличиваем счетчик строк и проыеряем не равен ли он 4. Если не равен, по берем следующую строку, переходя к метке ```asm getarr```, если равен переходим к завершению программы. До разбора завершения программы хочу отметить приглашение пользователя к вводу: для этого мы использовали метку ```asm iarrn``` -- переместили ее смещение в запрашиваемый ```asm getmas``` регистр. После чего умножили 3 на счетчик текущей строки и прибавили к регистру, таким образом теперь смещение стоит на `#(номер строки)...`, так объявлена память. После мы перемещаем 3 в регистр, отвечающий за количество байт, которое будет выведено, таким образом мы выводим именно символ `#` за ним номер строки и пробел. Теперь перейдем к завершению основной программы. #code(funcstr(lab4, "exit:"), "asm", [Завершаем основную программу]) В завершении программы выводим номер строки с максимальной суммой и саму сумму, с соответствующими поясняющими сообщениями, после чего вызываем систему для выхода. #pagebreak() == Компиляция Название файла библеотеки вывода не изменилось, изменился файл, указанный в \$mod и файл библеотеки ввода. Вот, что необходимо ввести в терминал, для компиляции и сборки всех 3 файлов: #code("mod=lab4/lab4 # Название ассемблерного файла без расширения nasm -f elf -o $mod.o $mod.asm nasm -f elf -o lab4/input.o lab4/input.asm nasm -f elf -o lab2/output.o lab2/output.asm ld -m elf_i386 -o $mod $mod.o lab4/input.o lab2/output.o ", "bash", [Команда в терминале]) == Отладка Отладим всю программу на примере ввода одной строки. #grid( columns:2, gutter:10pt, img(image("img/1.png", width: 88%), [Входим в ```asm getmas```]), img(image("img/2.png", width: 88%), [Выводим приглашение 1 строки]) ) #grid( columns:2, gutter:10pt, img(image("img/3.png", width: 88%), [Вводим 6 чисел]), img(image("img/4.png", width: 88%), [Значения введены]) ) #grid( columns:2, gutter:10pt, img(image("img/5.png", width: 88%), [Готовим регистры к\ циклу]), img(image("img/6.png", width: 88%), [Заходим в цикл и\ вызываем ```asm stoi```]) ) #grid( columns:2, gutter:10pt, img(image("img/7.png", width: 88%), [```asm stoi``` вернула 20]), img(image("img/8.png", width: 88%), [Записали число в память]) ) #grid( columns:2, gutter:10pt, img(image("img/9.png", width: 88%), [Число 30]), img(image("img/10.png", width: 88%), [Число 40]) ) #grid( columns:2, gutter:10pt, img(image("img/11.png", width: 88%), [Число 50]), img(image("img/12.png", width: 88%), [Число 60]) ) #grid( columns:2, gutter:10pt, img(image("img/13.png", width: 88%), [Число 70]), img(image("img/14.png", width: 88%), [Конец ```asm getmas```]) ) #grid( columns:2, gutter:10pt, img(image("img/15.png", width: 88%), [Вернулись в ```asm getarr```]), img(image("img/16.png", width: 88%), [Вызываем ```asm calcsum```]) ) #grid( columns:2, gutter:10pt, img(image("img/17.png", width: 88%), [Начало ```asm calcsum```]), img(image("img/18.png", width: 88%), [Берем 1 число]) ) #grid( columns:2, gutter:10pt, img(image("img/19.png", width: 88%), [Сравниваем с 0]), img(image("img/20.png", width: 88%), [Переходим к добавлнию]) ) #grid( columns:2, gutter:10pt, img(image("img/21.png", width: 88%), [1-ое число добавлено]), img(image("img/22.png", width: 88%), [2-ое число добавлено]), ) #grid( columns:2, gutter:10pt, img(image("img/23.png", width: 88%), [3-ое число добавлено]), img(image("img/24.png", width: 88%), [4-ое число добавлено]) ) #grid( columns:2, gutter:10pt, img(image("img/25.png", width: 88%), [5-ое число добавлено]), img(image("img/26.png", width: 88%), [6-ое число добавлено]) ) #grid( columns:2, gutter:10pt, img(image("img/27.png", width: 88%), [Выходим из ```asm calcsum```]), img(image("img/28.png", width: 88%), [Проверяем больше ли получившееся сумма сохраненной]) ) #grid( columns:2, gutter:10pt, img(image("img/29.png", width: 88%), [Переходим к\ сохранению суммы]), img(image("img/30.png", width: 88%), [Сумма сохранена]) ) #grid( columns:2, gutter:10pt, img(image("img/31.png", width: 88%), [Индекс строки\ сохранен]), img(image("img/32.png", width: 88%), [Переходим к\ завершению ```asm getarr```]) ) #grid( columns:2, gutter:10pt, img(image("img/33.png", width: 88%), [Если меньше 4 строк обработано идем на следующую итерацию ]), img(image("img/34.png", width: 88%), [Начала ввода второй строки]) ) Далее программа повторит все те же действия для других значений и в результате выведет ответ и завершит работу. Это можно увидеть в тестах. #pagebreak() == Тестирование #img(image("img/35.png", width: 60%), [Тест 1]) #img(image("img/36.png", width: 60%), [Тест 2]) #img(image("img/37.png", width: 60%), [Тест 3]) #img(image("img/38.png", width: 60%), [Тест 4]) == Вывод В процессе выполения работы были изучены приемы моделирования обработки массивов и матриц в языке ассемблера. #pagebreak() == Контрольные вопросы 1. *Почему в ассемблере не определены понятия «массив», «матрица»?* Это связано с тем, что память имеет модель `flat`, то есть в ней все данные представлены последовательно (на одной прямой). 2. *Как в ассемблере моделируются массивы?* Например, ```asm A db 1, 2, 3, 4, 5, 6```, организуется массив, который в памяти будет представлен последовательно из 6 байтов. 3. *Поясните фрагмент последовательной адресации элементов массива? Почему при этом для хранения частей адреса используют регистры?* Используются регистры, для того чтобы увеличивать свое значение на один после каждой итерации цикла, таким образом обращаясь последовательно ко всем элементам массива. 4. *Как в памяти компьютера размещаются элементы матриц?* Последовательно. 5. *Чем моделирование матриц отличается от моделирования массивов? В каких случаях при выполнении операций для адресации матриц используется один регистр, а в каких – два?* Моделирование матриц от моделирования массивов отличается тем, что при работе с матрицами используются два цикла, один для определения строки матрицы, другой для определения столбца.
https://github.com/PA055/5839B-Notebook
https://raw.githubusercontent.com/PA055/5839B-Notebook/main/utils.typ
typst
#let tournament-from-csv(section: "", team-name: "", raw-data) = { let parse-match(name) = { let sample-name = "Qualifier #1" let result = name.matches(regex("Qualifier #(\d+)")) if result == () { return (false, name) } return (true, [Q#result.at(0).captures.at(0)]) } let data = csv.decode(raw-data) data = data.slice(1) let result = () for row in data { if row.contains(team-name) { let winning-alliance = row.at(8) let match-name = parse-match(row.at(1)) if section == "qualifications" and not match-name.at(0) { continue } if section == "eliminations" and match-name.at(0) { continue } let match = ( match: match-name.at(1), red-alliance: (teams: (row.at(2), row.at(3)), score: row.at(6)), blue-alliance: (teams: (row.at(4), row.at(5)), score: row.at(7)), auton: false, awp: false, ) match.won = if ( ( match.red-alliance.teams.contains(team-name) and winning-alliance == "Red" ) or ( match.blue-alliance.teams.contains(team-name) and winning-alliance == "Blue" ) ) { true } else { false } result.push(match) } } result } #let plot-from-csv(data) = { let raw-data = csv.decode(data) let labels = raw-data.at(0) let data = () for (label-index, label) in labels.enumerate() { if label-index == 0 { continue } let label-data = () for (row-index, row) in raw-data.enumerate() { if row-index == 0 { continue } label-data.push((row-index, float(row.at(label-index)))) // TODO: actually parse the datetime (I need millisecond accuracy for this) } data.push((name: label, data: label-data)) } return data } #let parse-timestamp(timestamp) = { let data = timestamp.matches(regex("(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}).(\d{3})")) let captures = data.at(0).captures datetime( year: int(captures.at(0)), month: int(captures.at(1)), day: int(captures.at(2)), hour: int(captures.at(3)), minute: int(captures.at(4)), second: int(captures.at(5)), ) } #let grid = grid.with(columns: (1fr, 1fr), gutter: 20pt) #let get-page-number(label) = locate(loc => { let elements = query(label, loc) if elements.len() == 0 { panic(label) } [ #counter(page).at(elements.first().location()).first() ] })
https://github.com/patrick-kidger/typst_pyimage
https://raw.githubusercontent.com/patrick-kidger/typst_pyimage/main/examples/lotka_volterra.typ
typst
Apache License 2.0
#import ".typst_pyimage/pyimage.typ": pyimage Consider the Lotka--Volterra (predator-prey) equations: #pyimage(" import diffrax import jax.numpy as jnp import matplotlib.pyplot as plt def func(t, y, args): rabbits, cats = y d_rabbits = rabbits - rabbits*cats d_cats = -cats + rabbits*cats return d_rabbits, d_cats term = diffrax.ODETerm(func) solver = diffrax.Tsit5() y0 = (2, 1) t0 = 0 t1 = 20 dt0 = 0.01 ts = jnp.linspace(t0, t1, 100) saveat = diffrax.SaveAt(ts=ts) sol = diffrax.diffeqsolve(term, solver, t0, t1, dt0, y0, saveat=saveat) plt.plot(ts, sol.ys[0], label='Rabbits') plt.plot(ts, sol.ys[1], label='Cats') plt.xlim(0, 20) plt.ylim(0, 2.5) plt.xlabel('Time') plt.ylabel('Population') plt.legend() ", width: 70%)
https://github.com/dyc3/senior-design
https://raw.githubusercontent.com/dyc3/senior-design/main/solution-overview.typ
typst
= Solution Overview <Chapter::SolutionOverview> == Current Architecture The Monolith's current internals is shown in @Figure::monolith-class-current. It heavily uses redis to communicate between the RoomManager and ClientManager. As clients send messages to the Monolith, the ClientManager handles them and sends them to the RoomManager. The RoomManager receives and processes the messages. Rooms are entirely managed by the RoomManager. When rooms send messages to clients, it must go back through the ClientManager. This is because the ClientManager is the only component that knows which clients are in which rooms. #figure( image("figures/monolith/monolith-class-current.svg", width: 50%), caption: "Class diagram for the Monolith's internals, before any changes were made to support the Balancer." ) <Figure::monolith-class-current> It suffers from years of ad-hoc development, and is not designed to scale. It's riddled with technical debt from previous attempts at horizontal scaling. In its current state, it is not possible to add more Monoliths without causing room synchronization issues. The solution to this problem is to use a load balancer. == A Smart Load Balancer The solution to scaling OTT is to use a load balancer. The Balancer will be an optional, separate component that would be deployed alongside the Monoliths. === What is a load balancer? A load balancer is a server that distributes load across multiple servers. It is a common solution to the problem of scaling a web application. The load balancer must be able to: - Distribute load across multiple Monoliths - Forward HTTP requests to the correct Monolith - Send WebSocket messages to the correct Monolith These requirements imply that a normal HTTP load balancer (like nginx) will not work, and the need for a specialized implementation. The specifics of how the load balancer will work will be discussed in the following chapters. == New Architecture With the load balancer, OTT's architecture will look like this: @Figure::deployment-new #figure( image("figures/deploy/deployment-new.svg", height: 80%), caption: [Deployment Diagram: High level overview of OTT's new architecture with a load balancer. A diagram of OTT's production deployment is shown in @Figure::deployment-geo.] ) <Figure::deployment-new> @Figure::monolith-class-new shows what the Monolith's internals will look like after we take into account the load balancer. #figure( image("figures/monolith/monolith-class-new.svg"), caption: "The Monolith's new internals" ) <Figure::monolith-class-new> The main differences between this and @Figure::monolith-class-current are: + Monoliths now have 2 types of clients representing how the client is connecting to the Monolith. + The RoomManager and ClientManager no longer communicate through Redis. == Production deployment Fly abstracts away the details of deploying applications to specific computers. Instead, Fly provides "machines" that are effectively Docker container instances. Machines can be deployed to multiple regions, but a machine can only be deployed to one region at a time because it maps directly to a physical server. Machines belong to "Apps", which represents a base docker image from which machines are created. The plan is to deploy OTT in multiple regions. Currently, OTT is deployed in the `ewr` region in Newark, NJ. `ewr` will remain the primary region. The `cdg` region will be the secondary region, located in Paris. To save on cost, exactly 1 Balancer and 1 Monolith will be deployed in each region. @Figure::deployment-geo shows how OTT will be deployed in production. `fly-proxy` is a reverse proxy managed by Fly that sits in front of every Fly application. It is used to terminate TLS and provide a single hostname for all applications. All inter-app communication is done in a wireguard network, encrypted. #figure( image("figures/deploy/deployment-geo.svg"), caption: "Deployment Diagram: How OTT will be deployed in production across multiple regions." ) <Figure::deployment-geo> == Project Structure #figure( image("figures/full-package-diagram.svg"), caption: "Package diagram of the entire OTT project. This diagram shows the high level structure of the entire project. It is useful for understanding the project's structure and how the different components interact." ) <Figure::full-package-diagram>
https://github.com/HynDuf/typst-cv
https://raw.githubusercontent.com/HynDuf/typst-cv/master/template/modules_en/professional.typ
typst
Apache License 2.0
// Imports #import "../../lib.typ": cvSection, cvEntry #let metadata = toml("../metadata.toml") #let cvSection = cvSection.with(metadata: metadata) #let cvEntry = cvEntry.with(metadata: metadata) #cvSection("Work Experience") #cvEntry( title: [Research Intern], society: [Ortho.fashion], logo: image("../src/logos/ortho.jpg"), date: [Jan 2024 - Jun 2024], location: [Ho Chi Minh City, Vietnam - Remote], description: list( [ Research virtual try-on systems. - Develop real-time cloth try-on using SMPL body models, implement cloth simulation with Extended Position Based Dynamics (XPBD) and Linear Blend Skinning (LBS), and cloth-body collision detection using PyOpenGL and Warp for GPU optimization. - Build a real-time virtual try-on pipeline with machine learning models for human detection, pose estimation, and cloth simulation. ], ), tags: ("Virtual Try-on", "Computer Graphics", "Machine Learning"), ) #cvEntry( title: [Software Engineer - Backend Developer Itern], society: [Phygital Labs], logo: image("../src/logos/phygital-lab.jpg"), date: [Jun 2023 - Sep 2023], location: [Ho Chi Minh City, Vietnam - Onsite], description: list( [ Golang backend developer for the #link("https://nomion.io/")[Nomion] project (https://nomion.io/) (connect physical identity to the digital world via Blockchain infrastructure). - Build robust and efficient APIs for the backend server of Nomion. - Interact with Blockchain infrastructure using Go Ethereum. ], ), tags: ("Golang", "MongoDB", "Blockchain"), )
https://github.com/Mc-Zen/tidy
https://raw.githubusercontent.com/Mc-Zen/tidy/main/examples/wiggly.typ
typst
MIT License
/// Draw a sine function with $n$ periods into a rectangle of given size. /// /// *Example:* /// #example(`draw-sine(1cm, 0.5cm, 2)`) /// /// - height (length): Width of bounding rectangle. /// - width (length): Height of bounding rectangle. /// - periods (int, float): Number of periods to draw. /// Example with many periods: /// #example(`draw-sine(4cm, 1.3cm, 10)`) /// -> content #let draw-sine(width, height, periods) = box(width: width, height: height, { let resolution = 100 let frequency = 1 / resolution * 2 * calc.pi * periods let prev-point = (0pt, height / 2) for i in range(1, resolution) { let x = i / resolution * width let y = (1 - calc.sin(i * frequency)) * height / 2 place(line(start: prev-point, end: (x, y))) prev-point = (x, y) } })
https://github.com/randyttruong/496notes
https://raw.githubusercontent.com/randyttruong/496notes/master/main.typ
typst
#import "preamble.typ":* #import "@preview/cetz:0.2.2":canvas, tree, draw #import emoji #set page(margin: ( x: 3cm, y: 2cm, )) #let def = $eq.delta$ #titlePage[COMP_SCI 496: Graduate Algorithms][<NAME>][Spring 2024] #show par: set block(spacing: 0.65em) #set par( first-line-indent: 1em, justify: true, ) #let var = math.italic #set heading( numbering: "1.1.1.1.1" ) #set math.equation( numbering: "(1)" ) #set enum(numbering: "(1).(a)") #set terms( separator: [. ] ) #pagebreak() #outline() #unit[Probability + Graph Theory][] #chap[A Prelude in Graph Theory and Combinatorics] #[This is a chapter that is devoted to Randy learning how graph theory works in finer granularity.] = Subgraphs / Subgraph: #[Given a graph $G=(V,E)$, a subgraph of $G$, which is denoted as $G' = (V', E')$ is a graph whose vertices $V'$ are a subset of $V$ and whose edges $E'$ are a subset of $E$.] = Induced Subgraphs / Induced Subgraph: #[Given a graph $G=(V,E)$, an induced subgraph $G' = (V', E')$ is a subgraph of $G$ that contains the following property: - all edges $e' in E'$ must have (both) endpoints be in $V'$] #[We define the subgraph induced by $V'$, where $V'$ is a set of vertices $V' subset.eq V$, as being the subgraph $G' = (V', E')$ in which all $e' in E'$ must have both endpoints $r'_1, r'_2 in V'$.] = Graph Orientations / Orientation: #[Given an undirected graph $G$, an _orientation_ of the graph $G$ would be the resulting graph in which we assign each edge a direction, resulting in a directed graph.] = Tournaments / Tournaments: #[Given a set of vertices $V$, a tournament of $V$, denoted as $T$ on $V$, is an _orientation_ of the vertices, such that the resulting graph is connected.] - #[Note, in a tournament, two endpoints $i, j$ can only have a single edge between them, in which $i arrow.r j$ or $j arrow.r i$, but not both] = Dominating Sets / Dominating Set: #[A _dominating set_ of an undirected graph $G = (V,E)$ is a set $U subset.eq V$ such that every vertex $v in V - U$ has at least one neighbor in $U$. ] #pagebreak() #chap[The Basic Method] = The Probabilistic Method - Powerful tool for tackling problems in discrete math - Main idea of the method - *Objective.* #[We see kto prove that a structure with certain desired properties _exists_] - We first define an appropriate probabilisty space of structures - #[then, we show that the desired properties hold in these structures with positive probability] = Example 1 <test> #[We note that the _Ramsey number_ $R(k, cal(l))$ is the smallest integer $n$ such that in any wo-coloring of the edges of a complete graph on $n$ vertices $K_n$ by red and blue, either there is a red $K_k$ (ie, a ocmplete subgraph on $k$ vertices all of whose edges are colored red) or there is a blue $K_cal(l)$.] - #[Ramsey showed that $R(k, cal(l))$ is finite for any two integers $k$ and $l$.] - #[We can obtain a lower bound for hte diagonal Ramsey numbers $R(k, k)$] - #rmk[Complete Graph][A _complete graph_ $K$ on $n$ (which is denoted as $K_(n)$) is a graph in which each pair of distinct $n$ vertices is connected together by an edge.] == *Prop. 1* <prop1> #[If $mat(n ; k) dot 2^(1-mat(k; 2)) < 1$, then $R(k, k) > n$. Thus $R(k, k) > floor(2^(k/2))$ for all $k gt.eq 3$ ] - #[Note, here $R(k,k)$ represents a graph $R$ in which the induced monochromatic graphs must _both_ be of size $k$, which is a stronger condition than $R(k, cal(l))$] *Proof.* In @prop1, we first derive the following: - #[We first seek out the probability that an induced graph $K_(n)$ is monochromatic, which is equiv. to] $ Pr[A_R] = (1/2)^(mat(n; 2)) arrow.r 2^(mat(n;2)) arrow.l.r 2^(1-mat(n;2)) $ - #[We next seek the probability that any induced graph (aka a $n$-combination of the original $k$-graph) is monochromatic] $ mat(k;n) dot 2^(1-mat(n;2)) $ - #[*Observation 1.* We understand that the probability of this event occuring must be bounded by $1$, thus leading us to the conclusion that $ mat(k;n) Pr[A_R] < 1 $ which must imply that the probability that event $Pr[A_R]$ doesn't occur must be non-zero] - #[What exactly is the _negation_ of event $A_R$? If $A_R$ denotes the event that the induced subgraph of $K_k$ on $R$ is monochromatic, then $not (A_R)$ must be the probability that a two-coloring of the graph $R$ does _not_ produce a monochromatic induced subgraph] - #[We would denote this is as the Ramsey number of induced grpah sizes $n$ and $n$, or $R(n, n)$. Given that we want the negation, then we know that the size must be greater than $n_0$, since the Ramsey number must be $n_0$] - #[*Observation 2.* We understand that if the size of the induced graph, denoted as $n >= 3$ and if we take the size of the graph $k$ to be $k= floor(2^(k/2))$, then we know that $ mat(k; n)2^(1-mat(n;2)) < ((2^(1+n/2)) / n!) dot (k^n/(2^(n^2/2))) < 1 $ Thus, $R(n,n) > floor(2^(n/2)) forall n >= 3$] = Optional Proof Notes - #[Because there are $mat(k;n)$ choosings of the graph $G$, then it follows that at least one of these events occurring must be non-zero but strictly less than 1. ] - #[Thus, the inverse of this statement must be true- ($exists$ a two-coloring of the graph $G$ of $k$ vertices $G_k$ that doesn't have a monochromatic induced graph $G_n$)] - #[This is represented as the Ramsey number $R(k, k)$, which semantically equates to smallest size of a graph that has a monochromatic edge-colored subgraph of size $k$] - #[Given that we know that the Ramsey number refers to the smallest $n$ for which there is a monochromatic induced subgraph of sizes $k$ or $cal(l)$, then it follows that in order for both monographic subgraph sto be of sizes $k$, then the graph must be at least the size of the graph whose Ramsey number $R(k, cal(l))$ is $n$.] = The Essence of the Probabilistic Method Note the way that we evaluated this problem. - #[*Objective.* Prove the existence of a good coloring $K_n$ given a graph $K$.] - #[We first defined what a "good" coloring was-- which was a non-monochromatic graph formed from the induced graph of the two-colored graph.] - #[Then, we showed that it _exists_, in a nonconstructive way] - #[We defined a probability space of events, and we narrowed that probability space down to events that described structure sof particular properties] - #[From there, we then just showed that the desired properties that we want will hold in this narrowed down probability space, with positive probability.] = Why is this approach effective? #[This approach is effective because the vast majority of probability spaces in combinatorial problems are _finite_] - #[Sure, we could use an algorithm to try and find such a structure with a particular property] - #[For example, if we wanted to actually find an edge two-coloring of $K_n$ without a monochromatic induced graph, we could just iterate through all possible edge-colorings and find their induced grpahs.] - #[Obviously, this is impractical (it's actually class $PP$ haha)] - #[Although these problems could be solved using _exhaustive searches_, we want a faster way. ] - #[This is the difference between _constructivist_ and _nonconstructivist_ ideas in proofs] - #[Although we don't have a deterministic way of forming the graph, we are able to define an algorithm that could potentially lead to the desired graph, which, which is more effective than just trying to deterministically create one] - #[In the case of the Ramsey-number problem, it would be more effective to find a good coloring (a non-monochromatic induced graph) by just letting a fair coin toss decide on how to color the nodes] = Second Look at the Probabilistic Method = Property $S_k$ #[We state that a tournament $T$ has the property $S_k$ if and only if, for every set of $k$ Players, there is one that beats them all.]/ - #[Formally, this would mean that given a tournament $T = angle.l V, E angle.r$ and subsets $K$ of size $k$ $ exists v in T - K : (v, k) forall k in K $ ] #[_*Claim.* Is it true that for every finite $k$ that there exists a tournament $T$ (on more than $k$ vertices) with the property $S_k$?_] #[*Proof.* In order to prove this, let us consider a random tournament $T$. \ \ Given this random tournament $T$, let's determine the probability that a node $v$ in $T-K$ beats all of the nodes $j in K$. This is a difficult probability to calculate, however, and it is this probability as the complement of its negation (that there isn't a node in $V-K$ that beats all the nodes $j in K$). Let us find probability that a fixed node $v$ in $V-K$ beats all the nodes $j in K$. - #rmk[Tournamentk][Because $T$ is a tournament, we know that if we're considering a vertex $v$, it must be connected to all of the nodes within the subset $K$. Thus, there is a $1/2$ probability with which the edge with endpoints $v, j : j in K$ is directed $v -> j$. ] - Since there are $k$ nodes in $K$ and that the event of $v$ beating a vertex $j$ is independent, then we just find the product $ Pr(v "beats them all") arrow.r product_(1)^(k) (1/2) -> (1/2)^k arrow.l.r (2)^(-k) $ From this, it follows that the probability that $v$ doesn't beat them all is given by $ Pr(v "does not beat them all") &= \ &= (1 - Pr(v "beats them all")) \ &= (1 - 2^(-k)) $ Now, we simply just need to find the probability that _any_ fixed $v$ doesn't beat them all. $ Pr("no vertex beats them all") &= \ &= ("number of possible" v in V-K) \ & times Pr(v "doesnot beat them all") \ &= product_(v in V-K) Pr(v "does not beat them all") \ &= product_(v in V-K) (1 - 2^(-k)) \ &= (1-2^(-k))^(n-k) $ Finally, we just need to consider this scenario for all subsets $K$ of size $k$ in $V$ $ sum_(K subset V \ |K|=k) Pr("no vertex beats them all") &= \ &= mat(n; k) Pr("no vertex beats them all") \ &= mat(n;k ) (1-2^(-k))^(n-k) $ ] #unit[Randomization Algorithms][ #figure( image("./img/rando.jpg", width: 100%), caption: [how it feels to learn probability for the first time while literally in a graduate class that uses probability] ) ] #chap[Hashing (TODO)] #pagebreak() #chap[Universal and Perfect Hashing (TODO)] #pagebreak() #chap[Bloom Filters (TODO)] #pagebreak() #chap[Balls and Bins (TODO)] #pagebreak() #chap[Power of Random C=hoi es (TODO)] #pagebreak() #chap[Power of 2 Random Choices (TODO)] #pagebreak() #chap[Hypercubes + Permutation Routing (TODO)] #unit[Streaming Algorithms][ #figure( image("./img/tyler1.jpg", width: 100%), caption: [] ) ] #chap[Motivation: Finding the Most Frequent Elements (TODO)] #pagebreak() #chap[Misra-Gries Algorithm (TODO)] #pagebreak() #chap[Count-Min Sketch (TODO)] #pagebreak() #chap[Counting Distinct Elements (TODO)] // =============================================== // ONLINE ALGORITHMS PART 1 // =============================================== #unit[Online Algorithms][ #figure( image("./img/online_alg.jpg", width: 100%), caption: [balling ] )] #chap[Online Algorithms (Part 1)] = Motivation - #[In the former lectures, we utlized and proved the runtime and correctness of algorithms that approximated the solutions of computationally difficult problems ] - #[However, we now move on to a new problem: ] \ #align(center, text[ _...how can we optimize the solution to a problem in which the algorithm doesn't have all of the information that it needs?..._ ]) \ _...by using *Online Algorithms!*_ \ \ #dfn[Online Algorithms][#[Algorithms used in settings where data/inputs arrive _over time,_ thus requiring us to _make decisions on the fly,_ without knowing what's going to happen in the future.]] Of course, the opposite type of algorithm is exactly what we're used to. - Using bubble sort? You usually know all of the inputs beforehand - #[We can think of data structures themselves as being inherently online algorithms, since they handle sequences of requests, without knowledge of the future] = List of Classical Online Algorithm Problems - Rent or buy? (Ski rental problem) - The elevator problem = The Ski Rental Problem (Rent or Buy?) - This is the problem statement: #align(center, [_"Say you are just starting to go skiing. You can either rent skis for \$50 or buy them again for \$500. You don't know if you're going to enjoy skiing, so you opt to rent. Then you decide to go again, and again, and after a while, you realize that you have shelled out more money renting and wish you had bought right at the start."_ ]) - The intuitive solution: - In order to optimally solve this problem, we just need to set a _threshold_. If we plan on going to ski for more than 10 days, then just buy the skis. Otherwise, if you don't plan on skiing for more than 10 days, then just rent them. - #[*Objective.* What is the optimal strategy for saving money, assuming that you didn't know how often you were going to ski?] = #[ What exactly makes an online algorithm solution (or any solution in this case) _good?_] - We consider the _competitive ratio_ of the algorithm. #dfn[Competitive Ratio][#[ The _competitive ratio_ of an online algorithm defines the *worst- case* ratio of the _online algorithm ALG_ would result in on an input sequence $I$ to the cost of the optimal offline algorithm _OPT_. $ "competitive ratio" = (var("ALG")(I)) / (var("OPT")(I)) $ ]] #ex[Competitive Ratio 1][#[ - #[*Case 1 (Buy instantly).* Let us consider the algorithm _ALG_ in which we just buy the skis instantly. We know that the worst case scenario for this problem occurs if we only ski once, ie $I = {1}$. If we utilize the competitive ratio definition, we observe $ (var("ALG")(I)) / (var("OPT")(I)) = 500 / 50 = 10. $ <oa1> @oa1 semantically equates to "the online algorithm _ALG_ is ten times worse than the most optimal offline algorithm _OPT_." ] ]] #ex[Competitive Ratio 2][#[ - #[*Case 2 (Rent forever).* Let us consider the algorithm _ALG_ in which we just continuously rent. The worst case set of futures $I$ is the same, as it is possible we just ski for one time. This results in $ (var("ALG")(I)) / (var("OPT")(I)) = (50 times infinity) / 50 = infinity. $ This ratio is unbounded, so we can safely say that this particular _ALG_ is not very good lol ] ]] #ex[Competitive Ratio 3][#[ Let us now consider a decent strategy, which we call the _better-late-than-never_ algorithm. This algorithm, denoted as _ALG_, simply states that we just rent the skis until we realize that we should have just bought them. At that point, we just buy the skis. - #[Formally, if rental cost is $r$ and the purchase cost is $p$, then the algorithm is to rent $ceil(p/r) - 1$ times, then buy.] #thm[Better-Late-Than-Never Performance][#[ The algorithm _better-late-than-never_ has a competitive ratio $<= 2$. If the purchase cost $p$ is an integer multiple of the rental cost $r$, then the competitive ratio is $2-(r / p)$ ]] #proof[Proof of BLTN Performance][#[ We can prove this theokem directly via case analysis. - #[*Case 1.* If you went skiing less than $ceil(p/r)$ times, which for $p=500$ and $q=50$ would be less than 10 times, then you are performing optimally] - #[This is because all you can do is rent, otherwise if you buy, then you're wasting money!] - #[*Case 2.* If you go skiing $>= ceil(p/r)$ times, then the best solution otherwise would have just been to buy the skis from the start or _OPT_ $= p$. We find that in the circumstance that we do buy, _ALG_ will pay $(r times (ceil(p/r) - 1)) + p $ which is essentially equivalent to the rental price $r$ multiplied by the maximum number of times we rent without exceeding $p$, plus the $p$ we pay whenever we buy the skis. We know that arithmetically $r times (ceil(p/r) -1) + p$ must be less than or equal to $2p$. If $p$ is a multiple of $r$, then it will just be $r times ((p/r) -1) + p$, which is equal to $p - r + p => 2p - r$ ] #[For case 1, we demonstrated that the competitive ratio was 1. In the second case, we demonstrated that the competitive ratio was $<= 2$. Given that the worst case is 2, this must be the competitive ratio.] ]] ]] #thm[BLTN Optimality][#[ Algorithm BLTN has the best possible competitive ratio for the ski-rental problem for determiinstic algorithms when $p$ is a multiple of $r$. ]] #proof[Proof of BLTN Optimality][#[ Let us consider the event that the day that you purchase the skis is the last day that you even use them. - #[Consider first that this is *feasible*, since] + #[_ALG_ never purchases $=>$ competitive ratio is unbounded, which is undesired] + #[_ALG_ is _deterministic_, which implies that a purchase _must_ occur at some point.] Now that we've established that it _is_ possible that we may purchase the skis and never use them again, let us consider the cases in which we rent _more_ times than BLTN as well as _less_ times: - #[Renting longer than BLTN $=>$ $r$ increases, which implies that the competitive ratio must increase, making the algorithm worse] - #[Renting less than BLTN $=>$ ratio of $r/p$ decreases, but this must imply that both the denominator and the numerator must decrease by $k times r$, which also increases the competitive ratio, which is still worse.] ]] #nt[i definitely need to look this over bc i need to mathematically work out why this is sound sad ] // =============================================== // ONLINE ALGORITHMS PART 2 // =============================================== #pagebreak() #chap[Online Algorithms (Part 2)] = From last time... In the last lecture, we were introduced to online algorithms as well as the ski rental problem. #rmk[Online Algorithms][ Online algorithms are algorithms that attempt to solve a problem _without_ knowing the entire input space. Online algorithms will optimize their answer as inputs come in, ie _on the fly_. ] #rmk[Ski Rental Problem][ The ski rental problem is as follows: #qt("Say you are just starting to go skiing. You can either rent skis for $50 or buy them again for $500. You don't know if you're going to enjoy skiing, so you opt to rent. Then you decide to go again, and again, and after a while, you realize that you have shelled out more money renting and wish you had bought right at the start.") ] In the previous lecture, we discussed a *deterministic* strategy for evaluating this problem. - #[Our strategy, the better-late-than-never strategy, was as follows:] - #[If the cost of renting was about to exceed the cost of buying the skis, then we would simply just by the skis at that point.] - #[We proved that in such a case, the online algorithm, denoted as _ALG_, would require that the customer rents the skis for $ceil(p/r) - 1$ times before buying the skis outright in order to guarantee the minimal loss. ] - Costs of rent vs buying - Best evaluated using _randomization_ #rmk[$k$-competitivity][ An algorithm is $alpha$-competitive iff $ EE[italic("ALG")(I)] <= alpha dot.c italic("OPT")(I) $] = Algorithm + Pick a "random" threshold $T in [0, B]$ #rmk[Deterministic Online Algorithms][$T$ was $B-1$ in deterministic variant] + Rent for the first $T$ days + Then, buy - Picking distribution for $T$? - Evaluate it utilizing a differnetial equation - #[In principal $T$ must be a continuous random variable for large values of $B$] - #[Assume that we can rent up until 4.75 days, then buying] = Picking a distribution for $T$ $ "rental cost" &= sum_i=1^n Pr("still rent on day" i) \ "rental cost" &= sum_i=1^n Pr(T > i) $ where $n$ is the number of days that we ski $ Pr(T <= t) = cases( 1 ", if" t >= B, (e^(t/b)-1)/e-1 ", for" t in [0, B] ) $ If $T=B => Pr(T) = 1$, and $T=0 => Pr(T) = 0$ - Let $ var("density") = f_T = 1/B dot.c (e^(t/b)) / (e-1), t in [0,B] $ Suppose that we ski for $n$ days, there are two cases: + Case 1 $(n <= B)$. $ var("OPT") = n $ $ EE[var("ALG") ]= EE["cost of renting"] + EE["cost of buying"] $ Let us derive $EE["cost of buying"]$ $ EE["cost of buying"] = Pr(T <= n) dot.c B $ We know from cases that this equals $ = (e^(n/B) - 1) / (e-1) dot.c B $ Now let us evaluate for the cost of renting $ EE["cost of renting"] $ We utilize the following equality $ EE["cost of renting"] = EE[min(n, T)] $ We either rent for first $n$ steps, or if $T$ is sufficiently small, then buy. - However, what is $EE[min(n, T)]$ $ = EE_T [integral_0^n II(t <= T)var("dt")] $ Conceptually, we are integrating from $[0,n]$. It happens that $T$ may be less tha nor equal to $n$. The indicator function states that the value of the function $II(t <= T) in [0,1]$. If $t <= T$, then this integral is just equal to $T$. - From here, what else can we do? We can utilize _linearity of expec. to swap the integral and the $EE$._ $ &=> integral_0^n EE_T [II(t <= T)] var("dt") \ &=> integral_0^n Pr(T <= T) var("dt") &= (*) $ This is just analogous utilizing a summation and finding the probability across multiple days - Now, let us substitute the value of $Pr(t <=T)$ as being $(1 - Pr(T <=t))$. $ (*) &= integral_0^n 1 - (e^(t/B) - 1)/(e-1) var("dt") \ &= integral_0^n (e-e^(t/B))/(e-1) var("dt") \ &= e/(e-1) dot.c n - (e^(n/B)-1)/(e-1) dot.c B $ #align(center, text[ Lmao, study up how to integrate again idiot ]) \ \ #[Up until this point, we have found $EE["renting"]$ and $EE["buying"]$, thus, we assert that $ var("ALG") = e/(e-1) dot.c n approx 1.58 dot.c n $ where $n$ is the value of $var("OPT")$. This already performs a lot better than the deterministic solution of the problem. \ Now let us consider the second case: ] - #[*Case 2* $> B$. We observe that for a sufficiently large $n$, then we are guaranteed that both algs would have bought skis at or before time $B$, thus the cost won't change. - #[Thus, the costs of both algorithms, the offline and online algorithms, would have bought the skis by time $B$]. ] Thus, we surmise that the online algorithm performs better than or equal to an optimal algorithm. \ #align(center, text[ _But can we do better?_ ]) There are two strategies here: - #[*Approach 1.* Assume there's a distribution $f$ with which the alg picks a threshold that is better than ours. We'll examine $n$ and thorugh computation, determine that $f$ is the best possible function.] ] - #[*Approach 2.* Utilize the _minimax_ principle (Yao's minimax principle for online algorithms)] - Instead of one $n$, look at the distribution of $n$'s, then do the analyss on the random distribution of $n$'s - Just "do things at random for various $n$'s" - If we assume that things are done at random, then it simplifies the computations = Caching \* Caching: All modern processors have caches L1, L2, etc. \ #[Let us imagine that we have a cache of size $k$ that can store $k$ elements/pages. Whenever we store data, we store it witihn the cache. If the cache is full, however, then we just evict an element. - What's the optimal strategy for choosing caches to read from and evict elements from? - LRU Cache is the most famous one - Basic, but practical - #[Essentially, we just keep track of whenever a cache was last used, and when we have a collision, we just evict the oldest one ] - *Motivation.* We want to compare LRU with the best offline algorithm ] *Theorem.* The competitive ratio is $k$, thus $ sup_I (var("ALG")(I))/(var("OPT")(I)) = k $ #[In the context of caches, we measure perforamnce based solely on the number of cache misses.] #[*Note.* If we care about randomized algorithms, then the best competitive ratio is $O(log k)$] \ *Objective.* We seek to prove that the number of cache misses that LRU has is bounded by $k dot.c var("OPT")(I) $. - Again, this could be improved utilizing ranodmization \ Let us consider a sequence of instances (sequences of numbers) $ I_1, I_2, dots, I_n $ #[Our strat: Fix an instance $I$. Let us consider a block $i$ that starts and ends with a cache miss. We find that in such a case, the optimal algorithm has 2 misses.] - #[How much does $var("OPT")$ page after the cache becomes completely full? $ "numMisses"(var("OPT")) = "number of blocks" $ Meanwhile $ "numMisses"(var("LRU")) = k $ - Analysis - How many ways does LRU page? - $k$, since if there's more zz - We claim that $var("LRU")$ has one cache miss - This is because $var("LRU")$ guarantees that no new element will be evicted - #[For any distinct number in an instance $I$, we iwll never evict it more than once per block] - Thus, since $var("OPT")$ must evict at least one element by definition of blocks - and $var("ALG")$ will evict at least $k$ elements, then we complete the proof $qed$ - Let us reiterate the strats here: - LRU always misses after filling the cache - #[The optimal strategy? Always evict the element that is least likely to be evicted per block. This, of course, works only for offline algs] ] = Next TIme (Beyond Worst Case Analysis) - #[If we use resource segmentation, we find that the competitive ratio of this algorithm improves. We can demonstrate that the competitive ratio can be reduced to 2. ] //-------------------------------------------------- // 2 - Competitive Algorithms for Online PAging //-------------------------------------------------- #pagebreak() #chap[2-Competitive Algorithm for Online Paging (05/14/24)] = Reminders - Homework 03 is due Friday (with extension to Monday) = Is 2-competitive real for LRU cache? #rmk[][We proved that $k$-competitive is the best that we can do] = Today - Look at randomized online algorithms - Martingale Algorithm - Beyond worst-case analysis - Resource augmentation = Resource Augmentation - Tactic for analyzing online algorithms - Compare this algorithm with the optimal offline algorithm _OPT_ - In order to compensate for difference, allocate more resources for _ALG_ = Scenario - _OPT_ - Has $k$ pages - _ALG_ - Has $2k$ pages (an advantage!) - Could be $1.5k$ or $k+1$, etc #nt[Intuition here is that: Suppose that more resources $=>$ comparable perforamnce with _OPT_. We can also imagine that for _OPT_, resource augmentation has similar perforamnce, thus the online must be comparable] = Why Resource Augmentation? - Allows us to bypass the worst-case scenario #thm[][ The number of LRU misses is $<= 2 times var("OPT")(I)$ where LRU runs with $2k$ pages and _OPT_ with $k$ ] #nt[Proof is similar to former proofs] #proof[Proof for LRU Augmentation][ Let us consider an arbitrary sequence of futures $I$. We partition this block. $ {1,5,11,1, dots} $ Let us split these into $2k$ distinct pages. For any block, consider the number of misses from both _OPT_ and _ALG_. - #[*_OPT_ analysis.* In the offline cache there are $k$ pages. If its lucky, $k$ pages are added to the cache. This leaves, by dfn of the block, $k$ remaining pages that weren't added, resulting in a miss. Thus, there are $>= k$ misses per block. ] - #[*_ALG_ analysis.* We argue that _ALG_ makes $<= 2k$ misses. By definition of LRU, and the old-new page system. We will never miss on the same page within a block, but since there are $2k$ pages, then we can potentially miss _every_ time] - #[] Thus, asymptotically, the ratio is 2. ] #nt[LRU Cache is a reasonable alg because it will perform twice as worse as _OPT_ in any time] #unit[FPT Algorithms][ #let data = ( [SLEEP DEPRIVATION], [ALGS], [OS], [VERIF] ) #align(center + horizon)[ #figure( canvas(length: 1cm, { import draw: * set-style(content: (padding: .2), fill: red.lighten(70%), stroke: red.lighten(70%)) tree.tree( data, direction: "up", spread: 4, grow: 3, draw-node: (node, ..) => { circle((), radius: 0.75, stroke: none) content((), node.content) }, draw-edge: (from, to, ..) => { line((a: from, number: .9, b: to), (a: to, number: .9, b: from), mark: (start: ">", end: ">")) }, name: "tree") // Draw a "custom" connection between two nodes // let (a, b) = ("tree.0-0-0", "tree.0-0-1",) // line((a, .6, b), (b, .6, a), mark: (end: ">", start: "|")) }), caption: [week 9]) ] ] #chap[Preview of Second Half for Class] = Motivation: Solving Computationally Hard Problems - #[Imagine we had a very hard problem to solve, perhaps one that is NP-complete.] - #[...What compromises can we make in order to "solve" the problem?] - #[We can find the _exact_ answer $arrow.l.r$ #text(red)[compromise on time]] - #[Exact algorithms] - #[We can _approximate_ the answer $arrow.l.r$ #text(green)[save on time]] - #[Approximation algorithms] - #[We can _reduce_ the problem as to focus on a particular parameter, rather than the entire input size $arrow.l.r$ #text(green)[save on time]] - #[Fixed Parameter Tractable Algorithms] Here's kind of the itinerary of algorithm analysis for reference lol = Fields of *Algorithm Design and Analysis* == Undergraduate Algorithms - #[Basically just looking at general solutions to non-computationally difficult problems] + #[*Greedy Algorithms*] + #[*Divide and Conquer*] + #[*Dynamic Programming*] == First Half of 496: - #[Basically just looking at new approaches to solving these problems in order to save space and time, as well as how to optimize the solution in uncertain situations] + #[*Randomized Algorithms*] + #[*Streaming Algorithms*] + #[*Online Algorithms*] #text(green)[== Second Half of 496] - #[*How can we solve computationally-hard problems?*] + #[#text(green)[*Fixed Parameter Tractable (FPT Algorithms).*]] + #[#text(green)[*Approximation Algorithms.* ]] - #[*Intuition.* We can't _exactly_ solve this problem in polynomial time. So let's just find an answer that is slightly worse than the optimal.] - #[Similar to online algorithms, since we just care about cost] - #[Emphasis on speed over correctness] + #[#text(green)[*Exact Algorithms.* ]] + #[#text(green)[*Beyond worst-case Analysis of Algorithms.*]] Definitions will be revealed... #pagebreak() #chap[FPT Algorithms] = Motivation #rmk[Techniques for Solving Computationally-Hard Problems][ One of the ways that we can solve computationally-hard problems is to utilize FPT (Fixed Parameter Tractable) algorithms. These algorithms are an alternative to *approximation algorithms*, which compromise correctness for speed. In the case of FPT, we will see that they make no compromises on correctness for speed. ] - #[If computing the problem over an _entire_ input space is too costly... what if we compute the answer utilizing smaller subproblems?] = Motivation (cont'd): DNA Strand Length Problem #nt[This problem isn't the _perfect_ situation for utilizing FPT, since this is a polynomial time problem that we're just reducing to constant time, whereas the typical FPT problem is reducing an exponential time of $n$ problem into an exponential time of $k$ problem.] Let us consider the following problem: #qt[Consider two strands of DNA. Align the two strands of DNA with the minimum possible cost (ie, with the minimum number of gaps $delta$).] - #[*Typical Solution.* We would just apply a two-dimensional dynamic programming algorithm.] - #[But what if a $n^2$ complexity was too slow? ] - #[What if we knew that we just wanted to see if an alignment existed for $k$-cost?] - #[*Optimization.* Instead of calculating all alignments of all costs for DNA strands, attempt to generate the alignments to some threshold $k$, thus we bound the number of computations by $k$.] #[The focus of FPT algorithms is to fix some parameter $k$, which we can derive based on the problem's input, or as a desired result of the problem. By fixing a parameter $k$, we can then design an algorithm that calculates over $k$, thereby reducing the overall complexity, while still preserving correctness.] = Defining FPT Algorithms #dfn[Fixed Parameter Tractable (FPT) Algorithms][ FPT Algorithms are algorithms whose asymptotic running time is upper-bounded by the exponential function of a _specific parameter_ $k$ of the problem. In practice, running time is represented as this exponential function $f(k)$ multiplied by a polynomial of the input size $n$. $ f(k) times var("poly")(n) $ ] == The Inputs in More Detail - What is $k$? - #[$k$ is some parameter of the input or the solution. $k$ is unique to the problem] - What is $n$? - The size of the input to the problem. = Examples of Problems that Can Be Optimized Using FPT + Hamiltonian Paths + $k$-paths (parameterized by $k$) + Feedback Vertex Set (parameterized by $k$) = Motivating Problem 1: Hamiltonian Paths #qt[*Problem Statement.* Suppose we have a graph $G$ that is unweighted. Find a path that visits every vertex exactly once.] #nt[We will get back to this one, since this one is a little difficult-- first discuss the $k$-paths problem ] = Motivating Problem 2: $k$-Paths (AKA Longest Simple Path) #qt[*Problem Statement.* Given a graph $G$, determine if there exists a simple path of $k$ vertices in $G$.] - #[Evaluating the $k$-paths problem $=>$ We can solve the hamiltonian path problem] == Naive Solution - #[*Solution 1*. Calculate all subsets of $k$ vertices and just determine if there exists a path $P$ between them.] - #[*Solution 2*. Starting from any vertex $v in G$, just perform a breadth-first search to see if there exists a valid $k$-path. ] - *Analysis.* Let us consider Solution (1). - Given a graph $G$ such that $G$ is $Delta$-regular: - #[(suppose that $Delta approx n$ or $Delta approx sqrt(n)$)] - #[*Runtime.* $O(Delta^k)$, since we exhausively search all paths of $k$ vertices for each vertex] - #[Clearly not FPT, since $Delta^k approx n^k$] #qt[Given our naive solution, can we do better?] #[Yes! We can improve our exponential, naive algorithm by utilizing the FPT framework. We can do this by utilizing the *color coding* technique.] == FPT Solution #rmk[$k$-paths Problem][ The graph $G$ in the problem is _unweighted_ and _undirected_. ] #[*Intuition.* If we can somehow transform $G$ into a directed graph, then we can evaulate the problem utilizing *dynamic programming*.] - #[Without DP, we were essentially just enumerating all possible combinations of the vertices and verifying them, which is _slow_] - #[By color coding the graph, we are able to filter out some combinations and make the verification process faster] #dfn[Color Coding][ Technique in which, given $G$, pick some $k$ colors s.t., and then color all vertices $1, dots, k$ at random (independently + uniformly) ] Let us now consider a basic usage of the color-coding technique, and then a more difficult one that optimizes it. = Evaluating $k$-Paths via Basic Color Coding - #[This algorithm is going to inherent the "randomization" aspect of our naive algorithm by randomly selecting $k$-element combinations, but will now utilize *dynamic programming*, due to the added coloring] - *Algorithm.* Given a graph $G$: + Color $G$ using $k$ colors (enumerated as colors ${1, dots, k}$) + #[Based on this coloring, determine if a good path exists by randomly selecting $k$-element subsets of vertices] - ie, determine if there exists a path of colors $1->2->dots->(k-1)->k$ - we can do this part using dp #nt[This algorithm only works if the $i$th vertex receives the $i$th color.] == Algorithm In Detail - *Intuition.* Split the graph into layers based on colors $1, dots, k$ - #[1-dimensional DP] - #[Utilize dynamic programming in order to demonstrate if there exists a path from $1$ to $k$] - For each layer: + #[Mark the $i$th layer (or $var("dp")_i$) as reachable if and only if the vertex that precedes it is reachable] #[ #let side = 14pt #let dpRow = stack( dir: ltr, rect(width: side, height: side, inset: 3pt)[1], rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side, inset: 3pt)[$dots$], rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side, inset: 3pt)[$k$], ) #let dpRowE = stack( rect(width: side, height: side, inset: 3pt), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side, inset: 3pt), rect(width: side, height: side), rect(width: side, height: side), rect(width: side, height: side, inset: 3pt), ) #align(center)[ #v(1cm) #figure( stack( dpRow, ), caption: [DP Table for the Longest Simple Path Problem] ) #v(1cm) ] ] == Algorithm Analysis #[We derived, by definition of the algorithm, that for any combination of $k$-vertices, it will take $k$ iterations to determine if its good. ] - #[That being said, however, how many graph colorings/repetitions do we have to try in order to get the answer? ] #[In order to evaluate this, we consider the probability that we're going find a good path.] #thm[Probability of Good Path][ The probability that, for a path of length $k$, the $i$th vertex has the correct corresponding color $i$ is given by $ Pr[i"-th vertex gets color " i "for" {1, dots, k}] = (1/k)^k = 1/k^k $ <gp1> at the lowest bound. ] #nt[This probability is the *worst-case bound*, which occurs assuming that there is only one path. If there are multiple paths, then it's better for us. ] #[We are able to use @gp1 in order to determine approximately how many times we will have to run the algorithm (coloring and all) in order to obtain the answer.] #clm[The maximum number of repetitions (of the algorithm) required to find the solution is $approx k^k$ (ofc there's $k^k$ different combinations).] #[Even though we have a bound on how many combinations we need to reveal the answer, we can concisely narrow down how many repetitions we need to guarantee that we find a path of $k$-colors] == Making the Bound of Repetitions More Accurate Let us now consider the failure bound of this algorithm (ie, the probability that we aren't able to find a good-colored path). In this case, we let $delta$ be this failure bound. #clm[The total number of repetitions $t$ of the Basic Graph Coloring Algorithm in order to evaluate the $k$-paths problem is $t approx k^k times ln(1/delta)$.] #proof[Proof to Claim][ - #[$"Let" delta "be the probability that we aren't able to find a path" P "of length " k $] - #[$"Let" p "be the probability that a path" P "of length" k "is good"$] - #[$"Let" t "be the number of repetitions"$] $ Pr["after" t "attempts" exists.not "path P of length" k] &= (1-p)^t \ Pr["after" t "attempts" exists.not "path P of length" k] &<= delta \ (1-p)^t &<= delta \ ln((1-p)^t) &<= ln(delta) \ t times ln(1-p) &<= ln(delta) \ approx t times (-p) &<= ln(delta) \ approx t &>= ln(1/delta) / p \ approx t &>= ln(1/delta) / (1/k)^k \ approx t &>= ln(1/delta) / (1/k^k) \ approx t &>= k^k times ln(1/delta)\ $ <naive1> Given @naive1, we observe that the number of repetitions needed to guarantee that we find a path-$P$ of length $k$, as required. ] Now, we can make some claims about the true runtime of the FPT algorithm, based on the definition of FPT. #clm[The total runtime of the basic color coding FPT algorithm is $ k^k times ln(1/delta) times O(m) &= \ &= O(k^k). $ ] #proof[Proof][We already know that the number of repetitions of the algorithm required in order to find a good path $P$ of length $k$ is given by $k^k times ln(1/delta)$. We simply add on the new fact: #align(center)[ #v(0.5cm) _during each repetition though, the amount of time that it takes in order to verify that the path is a good path is $var("poly")(n)$, which we will denote as $O(m)$._ #v(0.5cm) ] Thus, since we have to verify some $var("poly")(n)$ paths, as well as $k$ nodes for each path with probability $(1/k)$, then we know that the totla runtime must be $ = &f(k) times var("poly")(n) \ = &k^k times ln(1/delta) times O(m) \ $ <pr35a> as required. ] Although it may seem like we're done with this problem... as with all CS problems... #qt[...how can we improve this algorithm?...] = Evaluating $k$-Paths via Advanced Color Coding #rmk[Complexity of Naive Color Coding][ The asymptotic time complexity of the FPT $k$-Paths solution using basic color coding was $k^k times ln(1/delta) times O(m) = O(k^k)$. ] #qt[...how can we do better...?] = Algorithm Intuition (Advanced Color Coding) #[*Intuition.* In our new solution, we hope to improve the runtime of the original algorithm by increasing the probability of success by _loosening_ the constraint of a good path.] - #[In this case, we will be loosening the constraint of a good path by simply making a good path equivalent to a path in which all $k$ vertices have distinct colors] = Algorithm Design (Advanced Color Coding) - Given an unweighted, undirected graph $G$: - Color each vertex $v in V$ uniquely - #[Determine if $exists$ a good path $P$ in the resulting $k$-colored graph using dynamic programming] - #[A $k$-length path $P$ is good if and only if all $v in P$ have distinct colors] = Algorithm in Detail (Advanced Color Coding) - Given a fixed color $u$, find $var("path")(u, cal(S))$ where $cal(S) subset.eq {1,dots,k}$ - We want each path to have only one vertex of each color in $cal(S)$ - We can use $S$ in the original problem - The space of the DP will be $2^k times n$ (FPT) (still way better than $n^(log(n))$) - Visit all neighbors $v$ - We know that $var("path")(u, cal(S))$ exists if - $exists v in var("nei")(u$ where $var("path")(v, cal(S) / var("color")(u)$ exists - where, of course, $var("color")(u) in cal(S)$ - We would need to repeat this algorithm $e^k times log(1/delta)$ - Runtime is $e^k times log(1/delta)$ multiplid by runtime of dp = Algorithm Analysis (Advanced Color Coding) #clm[The probability that all colors in a $k$-length path $P$ are distinct is $(1/e)^k$.] #proof[Proof][ Let us first consider the probability of the event in which all colors in $P$ are distinct, then we bound it more precisely. #par[We know that for any path, there are $k^k$ possible ways to choose each vertex distinctly for a path that is $k$ elements long. We also know that there are $k!$ permutations of $k$ distinct elements. Thus, $ &Pr["all colors in" P "are distinct"] = \ &= ("num possible" k "color perms") times Pr["all elements in" P "are distinct"] \ &= k! times (1/k)^k = k!/k^k $ <p39> ] Based on @p39, we demonstrate that $Pr["all colors in" P "are distinct"] = k! / k^k$. We can better bound this probability by utilizing Stirling's Inequality. #rmk[Stirling's Approximation][ $ n! tilde.op sqrt(2pi n) times (n/e)^n $ which, we can simply just regard as $ n! tilde.op (n/e)^n $ ] Using Stirling's Approximation, $ Pr["all colors in" P "are distinct"] &= k! / k^k \ &approx.eq (k/e)^k / k^k \ &approx.eq (1/e)^k $ <prf39a> Based on our calculations in @prf39a, we determine that the probability that all colors in $P$ are distinct is $(1/e)^k$, as required. ] From here, we are able to utilize the same calculations as in @pr35a in order to demonstrate that the runtime of the Optimized Graph Color-Coding FPT solution is $(1/e)^k$. #clm[The runtime of the Optimized Graph Color Coding FPT solution is $ e^k times log(1/delta) times O(m) = O(e^k). $ ] #proof[Proof][Utilize the same calculations as in the basic graph color coding FPT solution.] #pagebreak() #chap[FPT Algorithms (Part 2) (05/16/24)] = Reminders - For HW3 - Questions about Q1 - #[Aim is to show that if you don't use a randomized routing approach, then delay suffers and will be $O(d)$ with high probaiblity and worsens exponentially] - #[Demonstrate that $O(k)$ for randomized approach and $Omega(2^k)$ for the naive/greedy approach] - We want to find the *optimal* algorithm for Q2 - ie, the most optimal _deterministic_ and _randomized_ strategies - For Q3 - We want a 2-competitive algorithm (ie, the competitive ratio is $1/2$) - Homework 03 is due Friday (with extension to Monday) = Remark - #[We previewed the color-coding technique in the last lecture:] #rmk[Color-Coding FPT Algorithm][We can utilize two variants of color coding: - #[*Basic.* We color the graph randomly, determining that a good path was one in which all vertices $v_1, dots, v_k in P$ were colored $1, dots, k$.] - #[Time complexity of $(k^k times ln(1/delta) times O(m))$] - #[*Optimized.* We color the graph randomly, determining that a good path was one in which all vertices $v_1, dots, v_k in P$ were colored _distinctly_.] - #[Time complexity of $(e^k times ln(1/delta) times O(m))$] ] = Outline of Lecture #[Today's lecture, we basically just finished up the discussion on FPT algorithms. We first revised the FPT algorithm for the $k$-paths problem as well as how to apply it to the Hamiltonian-path problem. Then we discussed a new problem that can be optimized utilizing FPT algorithms: - #[Vertex Cover] - #[Utilizes a technique called _kernelization_ in order to solve] which we then just used to motivate approximation algorithms, which offer us a different insight on solving the problem. Finally, we concluded this lecture by discussing the *set cover problem* which we also evaluate using approximation algorithms.] = Vertex Cover Problem == Introduction to Kernelization *Kernelization* is a technique that is employed with FPT (or generally parameterized) algorithms. #par[The primary intuition about kernelization is that we want to be able to take a problem, which we will denote as $Q$, and make an argument about an equivalent problem, of which we can make the same argument about the original problem.] \ #nt[Honestly, sounds a little fake, but as with most combinatorics/ discrete math-related arguments, it works. #qt[ ...(the "probabilistic method" is another fake argument btw)... ] ] #par[In kernelization, we call equivalent problems _instances_.] == Defining Kernels Not to be confused with _literally every other definition of a kernel in computer science_, kernelization is a _paradigm for solving parameterized problems_. #par[From _Parameterized Algorithms_ by <NAME> and Lokshtanov:] #dfn[Kernelization][ A _kernelization algorithm_, or simply a kernel, for a parameterized problem $Q$ is an algorithm $cal(A)$ that, given an instance $(I, k)$ of $Q$, works in polynomial time and returns an equivalent instance $(I', k')$ of $Q$ (Fomin et. Lokshtanov). ] #nt[It is required that size $(k)_cal(A) <= g(k)$ for some computable function $g: NN -> NN$. We can essentially think of $g$ as some computable function on $k$. ] #dfn[Reduction Steps][ A reduction rule for a parameterized problem $cal(Q)$ is a function $phi.alt$ such that $ phi.alt: Sigma^* times NN => Sigma^* times NN $ maps an instance $(I, k) in Q$ to an equivalent instance $(I, k')$ of $Q$ such that $phi.alt$ can be computed in $|I|$ and $k$ time. ] #thm[Safe and Soundness Rule][ We state that two instances of a problem $Q$ are equivalent if $(I,k) in Q$ if and only if $(I, k') in Q$ ] Essentially, we can think of kernelization algorithms as algorithms that utilize _reduction rules_ in order to reduce the a problem instance it into its "computationally difficult 'core' structure". - #[In other words, kernelization just algorithmically reduces a problem down into simpler instances until we reach the crux of the problem. We do this to make finding the true answer easier and more systematic.] == Introduction to Vertex Covers === Definitions #[In order to evaluate this problem, we first need a notion of what exactly a vertex cover is. ] #dfn[Vertex Cover][Given a graph $G = angle.l V, E angle.r$, a *vertex cover* of $G$ is a subset of vertices $cal(S) subset.eq V_G$ that includes all unique endpoints of every edge in $G$ at least once. Mathematically, this can be denoted as $ "cover"(G) = [S subset.eq V_G | forall (u,v) in E_G (u in cal(S)) or (v in cal(S)) or (u, v in cal(S))] $ #[For the purposes of the problem and its corresponding FPT algorithm, we will let $(G^((i)), k^((i)))$ represent the $i$th vertex cover (in the sequence of generated vertex covers) of size $k$.] ] === Example *Example 1.* Here is a 2-graph: #let data = ([Dmitrii], [Konstantin]) #align(center + horizon)[ #figure( canvas(length: 1cm, { import draw: * set-style(content: (padding: .2), fill: red.lighten(70%), stroke: red.lighten(70%)) tree.tree( data, direction: "right", spread: 2, grow: 3, draw-node: (node, ..) => { circle((), radius: 0.85, stroke: none) content((), node.content) }, draw-edge: (from, to, ..) => { line((a: from, number: .95, b: to), (a: to, number: .95, b: from), ) }, name: "tree") // Draw a "custom" connection between two nodes // let (a, b) = ("tree.0-0-0", "tree.0-0-1",) // line((a, .6, b), (b, .6, a), mark: (end: ">", start: "|")) }), ) ] $G$'s vertex cover could be $ &var("cover")(G) = {"Dmitrii"} \ or &var("cover")(G) = {"Konstantin"} $ since the edge that "Dmitrii" and "Konstantin" are incident to also connects their neighbor "Dmitrii" and "Konstantin," respectively. #nt[If it wasn't clear, we just want the vertices such that the connected edges to these vertices connects all of the other edges in the graph.] = #sc[Minimum Vertex Cover] Problem Statement #pb[#sc[Miminum Vertex Cover] Problem][Given a graph $G = angle.l V, E angle.r$, find the minimum size vertex cover. ] = FPT Algorithm Approach #rmk[FPT Algorithms][FPT algorithms are algorithms that are able to minimize the runtime of an NP-hard problem. They do this by reducing the exponential time $O(c^n)$ to one that is dependent on some parameter $k$. The runtime of such algorithms is defined as: $ f(k) times var("poly")(n) $ where $k$ is some _fixed parameter_ of the problem (which is problem/instance- dependent) and $n$ is the size of the input/universe. ] = FPT Algorithm Intuition (#sc[Vertex Cover] Problem) In our FPT solution for the Vertex Cover problem, we employ _two_ reduction steps that, informally: + #[Eliminate all _unnecessary vertices_ from the problem space and the solution] + #[Add all vertices that are _guaranteed_ to be in the solution.] #nt[Given that we are restricting the input space to a constant $k$ which is fixed, we are able to freely perform a _brute force_ algorithm on the input space, since it'll always be upper bounded by an algorithm on $n$.] = Algorithm Design (#sc[Vertex Cover] FPT Solution) #[Given the #sc[Vertex Cover] problem, we define the two following reduction rules for an instance $(G^((i)), k^((i)))$, where $(G^((i)), k^((i)))$ is defined as the $i$th vertex cover of $G$ that is of size $k$. - #[*Reduction Rule 1.* Given an instance $(G^((i)), k^((i)))$ , if there exists an isolated vertex $v$, then remove $v$ from the graph. The resulting instance is represented as $(G^((i))-v, k^((i))).$] - #[*Reduction Rule 2.* Given an instance $(G^((i)), k^((i)))$, if there exists a vertex $v in G^((i))$ such that $var("deg")(v) > k^((i)) + 1$, then remove $v$ and its incident edges from $G$.] = Algorithm (#sc[Vertex Cover] FPT Solution) Utilizing the two FPT reduction rules, we derive the following algorithm for the #sc[Vertex Cover] problem. algorithm: #v(0.5cm) ``` while kernel K is a valid cover randomly choose k or k' vertices if k or k' vertices are a valid vertex color do continue end return end ``` #v(0.5cm) ] // - #[2 Instances] // - #[We want to use some reduction steps] // - #[Guarantee that if the original instance has some solution of $k$, then // all other instances should have such a solution.] // - #[Likewise, if we know the solution for various instances, then we know // the solution to global] // - #[Instances will have a size of $k$ (in the context of this problem, // we shall use size $k^2$)] // // - Overview // - #[Utilize a sequence of reductions that reduce teh global problem into // variuos instances/sketches] // - #[We call these smaller instances of the problem _kernels_, such // that the size of each kernel is $<= g(k)$] // - #[With these kernels, we can utilize a _brute force algorithm_] // - #[Randomly choose $k$ or $k'$ vertices and just verifying if // they're a valid cover] // - #[This is fine because the algorithm is dependent on $k$, rather // than $n$] // - #[Exponential on $k$] // - #[We want to utilize an inductive argument, as if there's a solution for // one kernel of size $*$, then it should hold for the next, etc.] #rmk[Kernelization][_Kernelization_ is a technique that is utilized in parameterized algorithms in which, given an instance $(I, k)$ of a parameterized problem $Q$, returns an (easier) equivalent instance $(I', k')$ of $Q$. ] = Algorithm Analysis (#sc[Vertex Cover] FPT Solution) Utilizing the two reduction rules defined in the algorithm, let us make the following // We utilize *two rules*: // + #[If $(G^(i), k^(i))$ (the $i$th vertex cover of size $k$) has // isolated vertices, then remove them] // - #[This doesn't affect the instance-- since there would never // be a reason why we would want to keep them, since they won't affect // the result] // #nt[Duh, why would include vertices that don't matter?] // #nt[This is recursive. We will use the $(i-1)$th vertex cover in order // to derive the $i$th vertex cover] // + #[If there exists a vertex $v in G^i$ such that $var("deg")(v) > k^i$, // then we will add $v$ to the solution and remove $v$ and all // edges incident with it from $G$] // // #nt[If we have many edges that are incident to $u$, then just // remove $u$ and all edges that are incident with it. This will // result in various isolated vertices, which can be removed by rule (1)] // // == ...why does this work? // #todo() // #rmk[][We want a solution that is of cost at most $k$. If there's // a good vertex candidate-- just remove it since we know it must // be in the answer (or a valid answer).] // === Recurrence Relation // $ // G^((i+1)) = &(G^((i)) - u) \ and (&k^((i+1)) = k^((i)) - 1) // $ // // #[There must be $k^i$ edges incident to $u$. If not, then we would _eventually_ // remove the other vertices-- which wouldn't be optimal. // ] // // - #[If there are multiple vertices $v_i$ that are incident to $> k^(i)$ edges, // then we just remove all of them.] // // + #[If we can't apply rule (1) or rule (2):] // - #[If graph $|G^i| > (k^((i)))^2$, then _there is no solution_] // - #[Why is this the case?] // #thm[#sc[Vertex Cover] FPT Solution Feasibility][ If $(G^((i)), k^((i)))$ is a yes-instance of the #sc[Vertex Cover] problem and no further reductions can be performed on it, then + #[The number of vertices in $G^((i))$ must be less than or equal to $k^2 + k$. Formally, $ |V(G^((i)))| <= k^2 + k $ ] + #[The number of edges in $G^((i))$ must be less than or equal to $k^2$. Formally, $ |E(G^((i)))| <= k^2 $ ] ] #proof[Proof to #sc[Vertex Cover] FPT Solution Feasibility][ We can prove #sc[Vertex Cover] FPT Solution Feasibility by way of direct proof. + #[If an instance $(G^((i)), k^(i))$ is a yes-instance and is irreducible, then it must follow that for all vertices that exist outside of the cover, then there must exist an edge inside of the cover that is incident to it. #par[Formally, we notate this as] $ forall v in (G^((i)) \\ S), exists e in E(G^((i))) "where" e = (u,v) or e = (v,u) $ ] + #[This is true by definition of #sc[Reduction Rule 1]. #text(gray)[- The instance of the graph $G^((i))$ must be connected.]] + #[If an instance $(G^((i)), k^((i)))$ is a yes-instance and is irreducible, then the number of vertices not included in the vertex cover must be less than $k dot |S|.$ This, in turn, implies that the number of vertices in the graph must be upper-bounded by $(k+1) dot k$. #par[Formally, $ |V(G^((i)) \\ S)| <= k dot |S| => |V(G^((i)))| <= (k+1) dot k $ ] ] + #[$forall v in V(G^((i))), var(" deg")(v) <= k$ is true by definition of #sc[Reduction Rule 2].] #text(gray)[- This is because we removed all vertices with higher degrees. ] + #[$|V(G^((i)) \\ S)| <= k dot |S|$ is true by 2(a).] #text(gray)[- #[All vertices in the graph, and thus the cover can have at most $k$ edges, so the number of vertices not in the cover is at most the number of vertices in the cover multiplied by the upper bound of edges coming out of each vertex.]] + #[$|V(G^((i)))| <= (k+1) dot |S|$ is true by #sc[Reduction Rule 2] and 2(b). ] #text(gray)[- #[ By #sc[Reduction Rule 2], we know that the degree of any vertex is strictly less than $k+1$. Thus, it follows that the number of vertices in the graph must be striclty less than the number of vertices in $S$ multiplied by the upper bound $(k+1)$. ]] + #[If an instance $(G^((i)), k^((i)))$ is a yes-instance and is irreducible, then the number of edges in $G^((i))$ is bounded by $<= k^2$.] + #[This is true by definition of #sc[Reduction Rule 2]] #text(gray)[- #[ Any vertex $v$ can have at most $k$ outgoing edges, to which those vertices can have at most $k$ outgoing edges. ]] + QED + #[By (1) and (2) and (3)] ] Utilizing our #sc[Vertex Cover] Feasibility Theorem, we can now derive #sc[Reduction Rule 3], which will prove that the FPT algorithm will always create a solution to the #sc[Vertex Cover] Problem. - #[*Reduction Rule 3.* Let $(G^((i)), k^(i))$ be an input instance of the #sc[Vertex Cover] problem in which #sc[Rule 1] and #sc[Rule 2] are not applicable. If $k < 0$ or $G^((i))$ has more than $k^2+k$ vertices or $G^((i))$ has more than $k^2$ edges, then $(G^((i)), k^((i)))$ is a no-instance.] #text(gray)[- #[We know that if $k < 0$ or $G^((i))$ has more than $k^2+k$ vertices or $G^((i))$ has more than $k^2$ edges, then this must be invalid by the #sc[Vertex Cover] Feasibility Theorem.]] Using the theorem, we finally arrive at the following lemma utilizing our former calculations: #lem[][ If $G$ has $2^k k^2$, then $|E(G)| > k^2$. For any graph $G$ that has a vertex cover of size $<= k$, then $|E(G)| <= k^2$ edges.] #unit[Approximation Algorithms][#figure( image("./img/stonks.png"), caption: [\$FFIE TO THE MOON], )] #chap[Approximation Algorithms] = Citations + #[_Approximation Algorithms _ (<NAME>)] - Chapters Referenced + Chapter 1 (#sc[Introduction]) - #sc[An approximation algorithm for cardinality vertex cover ] (page 3) + Chapter 2 (#sc[Set Cover]) (pgs. 15-26) + Chapter 14 (#sc[Rounding Applied to Set Cover]) (pgs. 119-124) + #[UW CSE 421: Introduction to Algorithms] + #[Lecture 23: Approximation Algorithms (Set Cover)] + #[CMU 15-451/651: Design and Analysis of Algorithms] + #[Lecture \#17: Approximation Algorithms] = Introduction In this new section, we consider the design and analysis of *Approximation Algorithms*, which is another field of algorithms that tackles the issue of evaluating NP-hard and NP-complete problems with "good-enough" accuracy in polynomial time. #rmk[Motivation for Approximation Algorithms][We want to study approximation algorithms because they provide a polynomial time way of computing NP-hard problems.] #dfn[Approximation Algorithms][#[Approximation algorithms are algorithms that both maximize a *cost ratio* as well as a *value ratio* such that $ "Cost Ratio" = var("ALG")(I) &<= alpha times var("OPT")(I) \ "Value Ratio" = var("ALG")(I) &>= alpha times var("OPT")(I) $ where $alpha$ is the _approximation factor/ratio_ such that $alpha <= 1$, and we strive for $alpha$ to be as close to 1 as possible. ]] #nt[Whenever we discuss Approximation Algorithms, we will consider each algorithm based on their $alpha$ factor. For an approximation algorithm _ALG_ that has an approximation factor of $alpha$, then we consider that algorithm to be $alpha$-approximate. Additionally, we will also consider algorithms of paritcular $alpha$-approximate ratios. For example, we might discuss 2-approximation algorithms. + #[2-approximation algorithms] ] = (Re-)Introduction to the #sc[Minimum Vertex Cover] problem #rmk[FPT Approximation Solution for #sc[Minimum Vertex Cover]][] #todo() #[Now that we have some exposure on how we can _FPT reduce_ the #sc[Minimum Vertex Cover] problem in order to get an exact solution in $f(k) + var("poly")(n)$ time, let us now analyze various _approximation algorithms_ techniques for evlauating the #sc[Minimum Vertex Cover] problem. ] == #[Approximation Strategies for #sc[Minimum Vertex Cover]] + #[*Strategy 1.* Greedy Approximation] + #[*Strategy 2.* LP-Relaxation Approximation] = #[Strategy 1: Greedy Approximation Algorithm (#sc[Minimum Vertex Cover])] #[This section discusses the Greedy Approximation Algorithm strategy for evaluating the #sc[minimum vertex cover] problem.] #[As with most greedy algorithms, we can sum up the behavior of this algorithm as simply just adding vertices $v in V(G)$ as long as there exists an uncovered edge that is incident to it. ] == Algorithm Intuition (#sc[minimum vertex cover]) #int[If we pick an arbitrary edge $e in E(G)$, then we know that any vertex cover $var("cover")(G)$ must contain at least one of the endpoints of such an edge. Thus, add both endpoints to the solution, remove all edges covered by these endpoints, and repeat.] Here is the pseudocode for the Greedy Approximation Solution: #line(length:100%) ```pseudocode while exists (u,v) in E(G) such that (u,v) not covered by S do S.add(u) S.add(v) remove all (m, n) in E(G) covered by S end ``` #line(length:100%) Again, it is important to note that we are essentially doing the following + #[We iterate through all remaining edges in $G$] + #[If there is an edge in which at least one of the endpoints does not exist in $S$, then we just add the endpoints] + #[Then, based on the new vertex cover $S$, remove all edges from the graph $G$ that are now covered by $S$] == Analysis (#sc[Minimum Vertex Cover]) #[We find that based on the design of the algorithm, we arrive at the following performance claim: Claim ] #clm[ #[Using the greedy approximation algorithm for the #sc[Minimum Vertex Cover] problem, we find that the algorithm is 2-approximation. Mathematically: ] $ var("ALG")(I) <= 2 times var("OPT")(I) $ ] #todo() #proof[Proof][ _ALG_ considers edges $(u,v), dots, (u_k, v_k)$ $ u_i = u_j \ var("OPT")(S) >= k \ var("ALG")(S) = 2k $ ] = Problem 2: #sc[Set Cover] Problem #[In this section, we pivot to a new problem, the #sc[Set Cover problem], which is a fundamental problem that is one of the fundamental problems of approximation algorithms.] Here is the problem statement: #pb[#sc[Set Cover]][ Given a universe $Omega = {u_1, dots, u_n}$ and a collection of subsets $cal(S) = {S_1, dots, S_2}$ where $S_i subset.eq Omega$ for $1 <= i <= n$, find a minimum-size subcollection of $cal(C) subset.eq cal(S)$ such that $ union.big_(S_i in cal(C)) S_i = Omega $] #thm[][The $ln(n)$-approximation algorithm for $n = |Omega|$.] = Applications (#sc[Set Cover] Problem) + #[*Application 1.* Imagine that a company wants to hire candidates such that all required skills are covered] + #[*Application 2.* "Fuzz" testing in software] + #[*Application 3.* A manufacturer wants to get all items from different suppliers at minimum cost ] = Algorithm Strategies (#sc[Set Cover Problem]) + #[*Strategy 1.* Greedy Strategy] + #[*Strategy 2.* Linear/Integer Programming Strategy] #todo() = Greedy Approach Intuition (#sc[Set Cover Problem]) #int[ Pick the set that maximizes the number of *new* elements covered by the set cover of $G$, denoted as $var("cover")(G)$ ] Here is the algorithm's pseudocode: #line(length: 100%) ``` while (v_t != 0) find S_i that covers most elements in U_t add it to the solution v_t+1 = v_t \ S_i t = t + 1 ``` #line(length: 100%) = Greedy Approach Analysis (#sc[Set Cover] Problem) Given the greedy approach, let us make the following claim: #clm[The greedy approximation algorithm for the #sc[Set Cover] problem gives an $O(ln(n))$ approximation of the optimum.] #clm[If _OPT_ $= k$, then the greedy approximation algorithm _ALG_ will find at most $k times ln(n)$ sets.] #let colred(x) = text(fill: red, $#x$) #let colbl(x) = text(fill: blue, $#x$) #let colgr(x) = text(fill: gray, $#x$) #proof[Proof for Greedy Approach Approximation][ #[Let $var("OPT") = k$, where $k$ is a number of sets (ie, the minimum number of sets in order to construct a full set cover of $G$). Additionally, let $n$ represent the number of elements in the universe $Omega$.] + #[Since we know that $var("OPT") = k$, then there must exist a set of vertices that covers at least $n/k$ elements] + #[We know that in order for $k$ sets to cover all $n$ elements in the universe $Omega$ that there must be on average $>= n/k$ elements per set. ] + #[If each set did not have at least $n/k$ elements in $Omega$, then $var("OPT") > k$, which is false by definition of _OPT_.] #text(gray)[+ #[In terms of $n$, this would mean that each set, on average, contains $(n/k)/n = 1/k$th of the elements in $Omega$.]] #text(gray)[+ #[If each set did not have at least $1/k$th of the elements in $Omega$, then $var("OPT") > k$, which is false by definition of _OPT_.]] + #[The first set that _OPT_ chooses, denoted as $S_1$ will have a size of $>= n/k$. ] + #[By (1)(a), (1)(b), (1)(c)] + #[When _OPT_ picks $S_1$ such that $|S_1| >= n/k$, then the number of remaining elements in the set must be $n_1 <= n(1 - (1/k))$] #text(gray)[- #[...where $n_1$ represents the number of elements in the first state, after _OPT_ has removed elements from $Omega$ in order to add them to first set cover $S_1$.]] + #[We can prove (3) using the following computation: $ ("num. elements remaining") &<= [colbl(("original num. elements")) \ &bl - bl colred(("size of set cover after 1 iteration"))] \ n_1 &<= [colbl(n) - colred(S_1)] \ n_1 &<= [colbl(n) - colred(n/k)] \ n_1 &<= n(1-1/k) $ <msc1> ] + #[After _OPT_ chooses its first set cover $S_1$ after a single iteration of the algorithm, then there must exist a set $S_2$ with at least $(n_1)/(k-1)$ elements.] #text(gray)[+ #[We can utilize similar logic to that in (1)(a-c)]] + #[Given that _OPT_ $=k$, then the average number of elements per set $k_i$ is $n_1/(k-1)$.] + #[After the second iteration $S_2$, then the number of remaining elements that are left uncovered, denoted as $n_2$ must be upper-bounded by $n_1(1- 1/(k-1))$] + #[We simply just need to perform similar computations to @msc1 $ n_2 &<= [colbl(("num. elements in 1st iter")) - colred(("size of set cover after 2 iters."))] \ &<= [colbl(n_1) - colred((n_1)/(k-1))] \ &<= colbl(n_1)(1 - 1/(k-1)) \ &<= colbl(n(1-1/k))(1 - 1/(k-1)) bl bl bl bl bl colgr(triangle.stroked.b " by (51)") \ &<= colbl(n(1-1/k))(1 - 1/(k-1)) <= n(1-1/k)(1 - 1/(k)) \ &<= n times (1 - 1/k)^2\ $ ] + #[The number of elements left after the $i$th selection from _OPT_ is given by $ n_i <= n times (1 - 1/k)^i $ ] + #[By (1), (2), (3), (4), (5)] + #[The number of elements left behind by _OPT_ approaches $<1/n$] + #[Utilize upper bounds $1+ x <= e^x$ $ n_i <= n ( 1 - 1/k)^i <= n dot e^(-i/k) $ ] + #[After $k times ln(n)$ iterations, the number of uncovered elements must be less than $1$ (just multiply $k dot ln(n)$ with $n dot e^(-i/k)$).] $ colgr(|V_i| &<= (1-1/k)^i times n \r (1-1/k)^(k ln(n)) &< 1/n ) bl bl bl colgr(triangle.stroked.b "what is this?") $ #[Thus, we demonstrate that in order for _ALG_ to construct a Minimum Set Cover of $G$, it must utilize $k times ln(n)$ iterations, which is $O(log(n))$, which implies that it is a $O(log(n))$ approximation of _OPT_, as required. ]] #pagebreak() #chap[Approximation Algorithms Pt. 2 (05/17/24 Lecture)] = Citations + _Approximation Algorithms _ (<NAME>) - Chapters Referenced + Chapter 1 (#sc[Introduction]) - #sc[An approximation algorithm for cardinality vertex cover ] (page 3) + Chapter 2 (#sc[Set Cover]) (pgs. 15-26) + Chapter 14 (#sc[Rounding Applied to Set Cover]) (pgs. 119-124) = Remarks - Homework 4 assigned (due 05/31/24) - Problem 1 is about LRU Cache - Problem 2 is similar to the FPT problems discussed in class - Discusses a problem about *Contracting Edges* #dfn[*Contracting Edges*][Given two connected vertices, we contract the edge between them by removing that edge between them and then treat both vertices as the same vertex] - #[Problem 3 is going to cover one of today's problems, the "edge-deletion to make a graph triangle free" problem] #nt[Today we are going to be discussing linear programmming (which will be utilized in problem 3 on the homework)] = Last Time #rmk[#sc[Set Cover] Problem][ #qt[ Given two sets within a universe $Omega$ such that $|Omega| = n$. Assume that if we choose all sets that we will seleect all of the elements within $Omega$ ] ] = Lecture Skeleton + #[#smallcaps[Weighted Set Cover] problem ] - Variation on #sc[Set Cover] problem - Discuss traditional approximation algorithm solution - Discuss _linear programming_ solution + #[Linear Programming] - very informal definition in-class, formalities included post-lecture (thanks future-randy) + #sc[Minimum Triangle-Free Edge-Deletion] problem - Discuss linear programming solution = #sc[Set Cover with Weights] Problem == Problem Statement (#sc[Set Cover with Weights] Problem) #rmk[#sc[Set Cover] Problem][ #qt[ Given a universe $Omega = {u_1, dots, u_n}$ and a collection of subsets $cal(S) = {S_1, dots, S_2}$ where $S_i subset.eq Omega $ for $1 <= i <= n$, find a minimum-size subcollection of $cal(C) subset.eq cal(S)$ such that] $ union.big_(S in cal(C)) S = Omega $ ] #pb[#[Weighted Set Cover] Problem][Utilizing the #sc[Set Cover] problem, suppose now that each set $S_i in cal(S)$ has a corresponding weight $w_i$. Find a minimum-size subcollection $cal(C) subset.eq cal(S)$ in order to cover the universe $Omega$ while minimizing the total subcollection's weight. $ sum_(i) w_i : S_i subset.eq cal(C) $] = Strategy 1: Layering Technique (#sc[Weighted Set Cover]) #[In this section, we note the *layering technique* for evaluating the #sc[Weighted Set Cover] problem.] #int[Our basic strategy is to find the sets that cover the most amount of elements with the minimum possible cost. ] #[The primary basis for this algorithm is to uitlize _induction_. The premise here is to just demonstrate that after ] - Determine that after $t$ steps, _ALG_ _does not_ cover $ e^(-w_t/var("OPT")) times n "elements" $ This is pretty straightforward (supposedly lol) However, we'll learn an alternative method utilizing *linear programming* #rmk[Linear Programming][(will discuss next time)] = Linear Programming/Integer Programming Approach - But why use linear programming since there's another approximation approach? - #[An LP interpretation of the problems can be solved via IP solvers, which can be solved faster than a pure combinatorial approach] - #[A "good-enough" solution that can be solved in _polynomial time_] - #[We are able to "relax" the problem] - #[We can replace constraints to make the problem easier] #nt[Our intuitoin is to think of our set as a set of _equations_] We are now going to consider some indicator varaibles such that $ x_i = cases( 1 "if" s_i "is in the solution", 0 "otherwise" ) $ We want to minimize $ sum_(i) w_i times x_i $ <sum1> by the way of linear programming, we are able to add _linear constraints and equations_. Thus, for @sum1, we want to find all $u in Omega$, such that $ sum_(i : u in s_i) x_i >= 1 $ The value of @sum1 would correspond to _some_ combinatorial solution, which is true since @sum1 is only true if $x_1$ corresponds to 1. Let us now relax the problem such that $x in.not {0,1} $, but $x in [0,1]$ such that $ $ #dfn[Linear Programming (Informal)][A set of linear constriants on some variables $x_1, ..., x_n$. THis is similar to linear equations (which contains equalities) such as $ A times x = B $ where $A$ is a matrix and $x$ is a set of variables whereas for linear programming, we have $ A times x >= B $ with an additional constraint $angle.l c, x angle.r$ such that $ c^t times x = sum_(i) c_i x_i "where" x >= 0 $ ] If the non-LP interpretation of the problem is feasible by the original LP problem, it stays feasible by the LP-relaxed problem. #thm[][The optimal value of the LP problem, denoted as _LP_, $ var("LP") <= var("OPT") $ where _OPT_ represents the optimal solution to the combinatorial problem. ] #rmk[][_OPT_ in this case represents the _cost_ of the problem.] We find that this is not going to be a big issue _unless_ _LP_ is significantly lesser than that of _OPT_ (integrality gap). But how can we actually compare the solution of the LP problem with that of the combinatorial problem? - We want to _encode_ the solutions of the combinatorial problem = LP-Based Approximation Algorithm for #sc[Set Cover] == Roadmap + Solve the LP-problem - *Obj.* Acquire $x_1, dots, x_m$ where $0 <= x_i <= 1$ - But what exactly is a non-integral value of $x_i$? - Philosphically, we can think of it as a probability that $i$ is in the set + Select $S_i$ in the solution with probability $(x_i times ln(n)) or 1$ - Where $ln(n)$ is some multiplicative factor (that is usually small) - lol where did this come from + Two Possibilities - #[*Brute Force.* Be done here and repeat until a feasible solution is calculated (ie, all elements are covered)] - #[*Randomized Rounding Technique.* For any element $u$ that is uncovered, pick the cheapest set $S_i$ containing it and just add it to the solution] == Approach + Set a feasible solution with probability 1 + Evaluate the probability that after $ &Pr(u "is not covered (after step 2)") = Pr(forall i, u in S_i "where" S_i "is not chosen") \ = &product_(i: u in S_i) Pr(S_i "is not chosen") \ = &product_(i: u in S_i) (1 - x_i ln(n)) \ $ Assume that any term $(1 - x_i ln(n)) >= 0$ $ &= product_(i: u in S_i) max(1 - x_i ln(n), 0) \ $ Using the inequality that $e^(-t) >= 1-t$, $ &<= product_(i : u in S_i) e^(-x_i ln(n)) \ $ #[ #show math.equation: set text(size: 15pt) $ &<= e^(- sum_(i: u in S_i) x_i ln(n)) &<= e^(-ln(n)) = 1/n $ ] Let us now consider the cost of the LP solution #rmk[][Cost of sets included in step 2] $ &EE["cost at Step 2"] = (sum_i w_i times x_i) times ln(n) \ = &"LP" times ln(n) $ #rmk[][Cost of sets included in step 3] $ &EE["cost at Step 3"] <= sum_(u in Omega) Pr(u "is not covered (after Step 2)") times var("OPT") \ <= &n times 1/n times var("OPT") = var("OPT") $ where $sum_i w_i times x_i$ is our linear program expression. #nt[_OPT_ is not known by the algorithm. The algorithm doesn't need to know it in this case ] = Minimum Triangle-Free Edge-Deletion Problem #pb[#sc[Minimum Triangle-Free Edge-Deletion]][Given a graph $G$, find the minimum number of edges needed to make $G$ triangle-free.] To remove any confusion, if we had a graph that had multiple triangles (ie, connected components containing 3 vertices), we just want to remove the minimum number of edges to remove those connected components. == Motivation - #[Triangles are found constantly in _social networks_ for friend recommendation, since we would want to find vertices (people) who are adjacent to other people] = Solution Approach (Triangle-Free Edge-Deletion Problem) Here, we detail a linear/integer-programming based solution for the triangle-free edge-deletion problem. Let us first consider what exactly the solution to the equivalent LP-problem would actually represent. #clm[The solution to the triangle-free edge-deletion problem would be *the number of edges* that need to be deleted in order to make the graph triangle-free.] == Linear Programming Construction (Triangle-Free Edge-Deletion Problem) #rmk[Soln. for the Triangle-Free Edge-Deletion Problem][The solution to the triangle-free edge-deletion problem would be *the number of edges* that need to be deleted in order to make the graph triangle-free.] - Construct an LP for the problem - #[Construct an indicator varaible that indicates whether or not we should delete an edge ] For an edge $e in E(G)$, we have the LP/objective function $ min sum_(e in E(G)) x_e : x_e in [0,1] "by our \"default constraint\"" $ <tri1> Are there any other constraints that we can impose? + For each triangle $(u, v, w)$, at least one edge _must_ be removed - (such that $ (u,v), (u,w), (v,w) in E(G)$) We can represent this as $ x_((u,v)) + x_((v,v)) + x_((u,w)) >= 1 $ <tri2> thus, we utilize the objective function @tri1 with the new consraint @tri2. #nt[] == Algorithm #algDfn[Triangle Deletion LP Algorithm][ + Solve the LP to obtain the optimal set of edges + Delete all edges $(u,v)$ with $x_((u,v)) >= 1/3$ ] By utilizing this algorithmic solution, we will _not_ obtain a feasible solution. #nt[For the homework, you want to modify this algorithm to achieve a better approximation] == Discussing Feasibility of the Approximation Soluiton #rmk[][there r triangles in the graph] #[By our LP and its constraint, we know that for each edge, its can either be part of triangle(s) or not (ie, it must be either $>= 1/3$ or $0$)] == The Cost of the LP Solution $ &m' def "# edges whose value is " >= 1/3 \ = &sum_((u,v) in E(G)) $ $ &= var("ALG") = m' \ &=var("OPT") >= var("ALG") >= m' / 3 \ &= var("LP") >= sum_((u,v) in E(G)) x_((u,v)) >= sum_((u,v) "is removed") x_((u,v)) >= m' times 1/3 $ <70> Thus by @70, $var("ALG") << 3 times var("OPT")$ = Next Time - LP-Duality #pagebreak() #chap[Approximation Algorithms (Part 3)] = Remarks + In the last lecture, we discussed two problems: + #sc[Weighted Set Cover] Problem - Layering Solution (Combinatorial) - Linear Programming Solution + #sc[Minimum Triangle-Free Edge-Deletion] Problem - Linear Programming Solution = Lecture Skeleton #[In this lecture we will be discussing three problems as well as multiple ways to evaluate them utilizing various combinatorics, linear programming, and even real analysis methods.] + #[#sc[Minimum $s-t$ Cut]] Problem + Ellipsoid Technique + Linear Programming Technique + Metric Space Technique + #[#sc[Multiway Cut/Multiterminal Cut]] Problem + Isolated Cut Heuristic (Combinatorics) + Linear Programming + #[#sc[Max Cut]] Problem + Semi-definite Programming = #sc[Minimum $s-t$ Cut] Problem #pb[#sc[Minimum $s-t$ Cut] Problem][ #[Given an directed graph $G = angle.l V, E angle.r$ with edge costs $c: E -> RR^+$. Let $s,t in V(G)$ be distinct vertices. ] #[The #sc[Minimum $s-t$ Cut] problem is to find the cheapest set of edges $E' subset.eq E$ such that there is no $s-t$ path in $G-E'$. ] ] = Background == The #sc[Ellipsoid Algorithm] #par[In this method, we will be utilizing the #sc[Ellipsoid Algorithm] in order to solve the #sc[Minimum $s-t$ Cut] problem.] #dfn[#sc[Ellipsoid Algorithm]][ #par[The #sc[Ellipsoid Algorithm] is a theoretically-polynomial algorithm for evaluating linear programs.] ] #par[The #sc[Ellipsoid Algorithm] works as follows: + #[Given a linear program, denoted as $cal(P)$, consider an initial ellipsoid that contains the feasible region of the answer] + #[In each iteration of the algorithm, determine whether or not the center of the ellipsoid is a feasible solution to $cal(P)$ (ie, satisfies all constraints)] + #[If not feasible, identify the violated constraint. The constraint acts as a hyperplane that separates the current center from the feasible region] + #[Update the ellipsoid accordingly to the violated constraint] + #[Repeat algorithm until ellipsoid is sufficiently small, which indicates that the center must be close to the optimal solution.] ] #[Now, let us define what a _hyperplane_ is as well as a _separation oracle_.] #dfn[Hyperplanes][A _hyperplane_ in $RR^(n)$ is any set of points in $n$-dimensional space that obey a _single_ linear constraint within a linear programming problem. - #[In 3D, a hyperplane would be a plane, and we can generalize this for any $n$-dimensional space.] ] #dfn[Separation Oracle][ A _separation oracle_ for a convex set $S subset.eq RR^n$ is a function that, given a point $x in RR^n$: + #[If $x in S$, then the separation oracle will confirm that $x$ is feasible (ie, $x in S$)] + #[If $x in.not S$, then the separation oracle provides a vector $a in RR^n$ that defines the hyperplane that separates $x$ from the feasible region $S$] + #text(gray)[tbh this is not relevant for this application, since we'll just ignore all the wrong answers...] ] = Solution 1: #sc[Ellipsoid Algorithm] (#sc[Minimum $s-t$ Cut]) #[In order to evaluate the #sc[Minimum $s-t$ Cut] problem, let us generalize the problem via linear programming, utilizing a typical linear programming method, the #sc[Ellipsoid Algorithm]]. #rmk[#sc[Minimum $s-t$ Cut] Problem][Given a directed $G = angle.l V, E angle.r$ the #sc[Minimum $s-t$ Cut] Problem seeks to find the minimum cost set of edges $E' in E(G)$ such that if $E'$ is removed, there is no path between two vertices $s$ and $t$. ] #par[By way of the #sc[Ellipsoid Algorithm], we must define and utilize a #sc[separation oracle], which will offer us a metric for determining whether or not a point $x in RR^n$ is part of our solution/feasible space $S$.] \ #par[In the context of this problem, the separation oracle will simply indicate whether or not a point $x$ is a feasible solution.] #int[A separation oracle for the #sc[Minimum $s-t$ Cut] problem will indicate whether or not there exists a "good path" from $s$ to $t$. In this case, we will consider a "good path" $P$ as having a weight that is $|P|<= 1$] - #[Given some $x$, in this case a vector of $x$ that assigns values to each edge, we want to determine if for each path, a constraint is violated] $ min sum_((u,v) in E(G)) X_((u,v)) $ such that $forall$ paths $P$ from $s$ to $t$: $ sum_((u,v) in P) x_((u,v)) >= 1 $ such that $x_((u,v)) in [0,1]$ - We want to utilize an "oracle" as a calback function - #[This oracle needs to be given a constraint that is violated within the LP ] - "I found a point $x$, is this point feasible?" - Ellipsoid algorithm $ x_((u,v)) = cases( 1", if feasible", 0 "else" ) $ == Strategy Let our Oracle be Dijkstra's algorithm - #[Looking at each path, if a path is not good, ie the distance from $s$ to $t$ is less than 1, then we just add it to the constraints] = Alternative Stsrategy - #[We utilize a new constraint] $ x_((u,v)) = cases( 1", if " (u in S, u in T, u in T, u in S) \ 0,"if " (u,v in S or u,v in T) ) $ #let colgr(x) = text(gray)[$#x$] #dfn[Metric Space][Given a universe $Omega$ and a funciton $d$ where $ d: Omega times Omega -> RR^+ \ $ That upholds the following properties: $ d(u,v) &= d(v,u) forall u,v in Omega \ d(u, u) &= 0 \ colgr(d(u,v) &> 0 "if " u != v) \ d(u, w) &<= d(u,v) + d(v, w) bl bl colgr("triangle inequality!") $ ] #rmk[LP][We want to minimize the sum of weights across all edges $ min sum_(u,v in E(G)) x_((u,v)) $ with the following constraints, which we derived from the definition of a metric space: + $x_((u,v)) = x_((v,u)) colgr("metric space property")$ + $x_((u,v)) >= 0 colgr("metric space property")$ + $forall u,v,w x_((u,w)) <= x_((u,v)) + x_((v,w)) colgr("metric space property")$ + $x_((s,t)) >= 1$colgr("metric space property") ] Now that we have an LP defined for this problem, how can we exactly deal with non-integral answers? + *Randomized Rounding* + *Threshold Rounding* - #[Not optimal] = New Technique: Random Threshold #int[Given two vertices $s$ and $t$, draw a ball around $s$ or radius $R$ (the set of all points $u$ around $r$ such that $var("dist")_((s,u)) <= r$, also denoted as $X_((s,u) <= R$). $ var("ball")(s, R). $ We observe that so long as $R in [0,1]$, then $t$ will always be outside of the ball. ] Given this ball, let us pick a radius $R in (0,1)$, uniformly at random. == Algorithm + Let $S = var("ball")(s,R)$ + Let $T = V - S $ #[Now, given this new algorithm, what exactly is the expected value? What is the approximation factor? ] = Algorithm Analysis $ EE["size of" (S,T)] = EE[sum_((u,v) in E(G)) XX] \ XX = cases( 1", " (u,v) "is cut", 0", otherwise" ) $ $ = sum_((u,v) in E(G)) Pr((u,v) "is cut") $ In order to find $Pr$, let us first make the assumption that $ x_((s,u)) <= x_((s,v)) $ by definition of the ball, we know that $(u,v)$ must be cut if and only if $u$ is in the ball and $v$ is not in the ball $ Pr((u,v) "is cut") &= Pr(mat(x_((s,u)) <= R; x_((s,v)) > R)) \ &= Pr(x_((s,u)) <= R < x_((s,v))) \ &= Pr(R in [x_((s,u)), x_((s,v))]) \ &= | x_((s,v)) - x_((s,u)) | <= x_((u,v)) $ Again, we know that $(u,v)$ is cut if and only if the radius is larger than that of $(u,v)$ - What other information can we extrapolate? - #[If we form a triangle between $s, u,$ and $v$, then we are able to determine the distance form $(s,u)$ via the triangle inequality. ] $ x_((s,v)) &<= x_((s,u)) + x_((u,v)) \ x_((s,v)) - x_((s,u)) &<= x_((u,v)) \ $ Thus, $ EE["size of cut"] <= sum_((u,v) in E(G)) x_((u,v)) = var("LP") <= var("OPT") $ $colgr("In summary, we demonstrated that it doesn't matter what cut we're taking, its value must always be the same.")$ #[For every cut ball$(s,r)$, the cost $= var("OPT")$] = #sc[Multiway Cut]/ #sc[Multiterminal Cut] Problem == Sources + _Approximation Algorithms_ (Vazirani) + Chapter 19 (Multiway Cut) + UIUC 598CSC: Approximation Algorithms + Lecture 7 (Multiway Cut and $k$-Cut Problem) *(THIS IS A REALLY GOOD SOURCE)* = Background (#sc[Multiway Cut/ Multiterminal Cut]) Let us first re-define what a cut is: == Graph Cuts #dfn[Cut][ Given a connected, undirected graph $G = angle.l V, E angle.r$ with an assignment of weights to edges, $w: E -> RR^+$, a _cut_ is a partition of $V(G)$ into two sets $V'$ and $V(G) - V'$ and consists of all edges that have one endpoint in each partition. ] Now, let us discuss a new problem, the #sc[Multiway Cut] problem. #pb[#sc[Multiway Cut] Problem][Given an undirected graph $G = (V,E)$ with edge weights $w: E -> RR^(+)$, and a set of terminals $S={s_1, dots, s_n} subset.eq V(G)$. A _multiway cut_ is a set of edges that leaves each of the terminals in a _separate component_. Find the minimum weight of such a set of edges $E' subset.eq E(G)$ where removing $E'$ from $G$ separates all terminals. #v(0.25cm) #[Let us define such a set of edges as the _isolating cut_.]] = Solutions (#sc[Multiway Cut/Multiterminal Cut]) We observe that there are two primary ways of evaluating the #sc[Multiway Cut] problem: + #[Isolating Cut Heuristic (Combinatorics/Greedy)] + #[Linear Programming] In either case, whether it be the Isolating Cut Heuristic solution or the linear programming solution, we make the following claim about the approximation ratio for both solutions: #clm[There exists a 2-approximate algorithm that solves the #sc[Multiway Cut] problem, which we can formalize as being the following $ min [sum_((u,v) in E') x_(u v) ] colgr("is this formulation correct?") $ where $x_(u v)$ represents the weight of the edge from vertex $u$ to vertex $v$ and $E'$ represents the _isolating cut_. #[This semantically, of course, simply just refers to the minimum total weight of all edges in the isolating cut $E'$.] ] = #[Algorithm 1: Isolating Cut Heuristic Solution (#sc[Multiway Cut])] #[In this first solution, known as the #sc[Isolating Cut Heuristic], we, as with most approximation algorithms, apply a _greedy_ approach. #[More specificlaly, we leverage the intuition of finding all necessary _isolating cuts_ to isolate each terminal $s_i$ from each other.] After computing all _isolating cuts_, simply just union the cuts in order to derive a cut that isolates each terminal from each other.] #int[For each terminal $s_i$, find the _minimum isolating cut_ that removes it from all other terminals $s_j, i != j$. In practice, we will connect all other terminals $s_j, i != j$ to a new shared vertex $t$ with "uncuttable"/infinite weight edges. ] #[By repeatedly finding the minimum isolating cut for each of the terminals, we can find the union between all of these minimum isolating cuts in order to achieve a superset cut that isolates each terminal.] #nt[For the sake of lecture, Prof. Makarychev stated that we union _all_ of these isolating cuts; however, the optimal solution (as Makarychev also stated) requires us to just union the first $k-1$ cuts, where $k$ is the number of terminals.] #nt[If there are overlapping cuts-- we just disregard them.] = Algorithm Pseudocode: Isolating Cut Heuristic (#sc[Multiway Cut]) #v(0.5cm) #line(length: 100%) ``` For each i = 1,...,k do -> compute the minimum weight isolating cut C(i) end union all isolating cuts C(i) ``` #line(length: 100%) #v(0.5cm) = Algorithm Analysis: Isolating Cut Heuristic (#sc[Multiway Cut]) #[Now, let us analyze the algorithm and prove why the Isolating Cut Heuristic is a 2-approximation of the optimal solution.] #rmk[#sc[Multiway Cut] Problem][In the #sc[Multiway Cut] problem, we seek the _isolating cut_ $E' subset.eq E(G)$ of minimum weight, that isolates all terminals $S = {s_1, dots, s_k}$. $ $ ] #rmk[Isolating Cut Heuristic Solution][For each terminal $s_i in S$, we calculate the _minimum weight isolating cut_ that isolates $s_i$ from $s_j in S - {s_i}$. At the end of the algorithm, we find the union of all such minimum weight isolating cuts in order to form a superset cut that isolates all terminals.] #thm[Isolating Cut Heuristic Accuracy][The Isolating Cut Heuristic is a 2-approximate solution to the #sc[Multiway Cut] problem.] #proof[Proof of Isolating Cut Heuristic Accuracy][ #par[In order to demonstrate that the Isolating Cut Heuristic is a 2-approximate solution to the #sc[Multiway Cut] problem, we must first derive some terminology and some structures for comparing the optimal solution _OPT_ to the Isolating Cut Heuristic algorithm _ALG_.] \ #par[Let us denote the _minimum isolating cuts_ that isolate each terminal in the set of terminals $S = {s_1, dots, s_k}$ as $E_1, dots, E_k$. Let _OPT_ represent the optimal multiway cut of $G$, which we will denote as $E^*$.] \ #par[By definition, we understand that by removing the superset of cuts $E^*$ from the edges of the original graph $E(G)$, then we will have $k$ individual, connected components, denoted as $V_1, dots, V_k$ where $V_i$ contains its corresponding terminal $s_i$.] \ #par[Let $E^*_i$ represent the cut that separates the component $V_i$ containing terminal $s_i$ from the rest of the graph.] \ #par[Thus, $ E^* = union.big_(i=1)^k E^*_i $ ] #par[Let $partial(V_i)$ represent the set of all edges leaving the component $V_i$, which we will call the _edge boundary_ of $V_i$. Formally, we find that $ partial(P_i) = {(u,v) : u in P_i, v in.not P_i} $ ] With this background in mind, let us now formulate our proof. + #[We observe that the weight of a minimum isolating cut for a terminal $s_i$ must be less than or equal to the weight of all edges leaving its corresponding component $V_i$. Mathematically, $ |E_i| < |partial(V_i)| "for all" 1 <= i <= k $ ] + #[This is true because $partial(V_i)$ is an isolating cut of $s_i$ (and intuitively, the isolating cut can either consist of all of the outgoing edges of $V_i$ or less.)] + #[The weight of the set of the optimal solution is equivalent to $1/2$ of the total weight of all edge boundaries for all components $V_i$ for all $1 <= i <= k$. Formally, $ E^* &= 1/2 sum_(i=1)^k |partial (V_i)| \ colgr(&>= 1/2 sum_(i=1)^k |E^*_i| "...i think this is wrong") \ 2 times E^* &= sum_(i=1)^k |partial (V_i)| \ $ <comb1> ] + #[We observe that every edge in the superset of _isolated cuts_ must be incident to two components. (This makes sense intuitively because in order to isolate the different components, we must remove their ougoing edges.)] + #[Given that each edge, in order to be within the superset of _isolated cuts_, must contain an endpoint in two unique components, then we need to _normalize_ the total weight by dividing the total weight of the edge boundaries by 2.] #nt[The edge boundary of $V_i$, denoted as $partial(V_i)$, must isolate a terminal $s_i$, thus this must be a feasible solution for a multiway cut.] + #[The Isolating Cut Heuristic is a 2-approximate algorithm of _OPT_.] + #[By 1(a), 2(a), 2(b)] #[In @comb1, we simply just showed that the Isolated Cut Heuristic is a feasible solution to the #sc[Multiway Cut] Problem that is upper-bounded by the optimal solution. Thus, the Isolated Cut Heuristic must be 2-approximate of the optimal solution, as required.] ] \ #v(0.5cm) #line(length: 100%) #v(0.5cm) #par[Now that we have designed and analyzed a combinatorial/greedy solution, let us now examine the linear programming solution.] = Algorithm 2: Linear Programming Solution (#sc[Multiway Cut]) Let us define the following constraints: + $x_((u,v)) = x_((v,u))$ + $x_((u,v)) <= x_((u,v)) + x_((v,w))$ + $x_((u,v)) >= 0$ + $x_((t_i, t_j)) >= 1$ #[We note that this is a *very similar* set of constraints to the single terminal variation of this problem. As it turns out, there is a better way of evaluating this problem.] #todo() = #sc[Max Cut] Problem In this section, we detail the #sc[Max Cut] problem, which is _another_ graph theory problem that is NP-hard. == Citations == Background #rmk[Cuts][Given a connected, undirected graph $G = angle.l V, E angle.r$ with an assignment of weights to edges $w: E -> RR^(+)$, a _cut_ is a partition of $V(G)$ into two sets $V'$ and $V(G) - V'$ and consists of all edges that have one endpoint in each partition.] #pb[#sc[Max Cut]][ Given a graph $G$, and two components $L$ and $R$, we want to maximize the number of cut edges in order to cut $G$ in $L$ and $R$. ] The primary idea here is that for any two components $L subset.eq G$ and $R subset.eq G$, we want to maximize the number of edges necessary to split $G$ into $L$ and $R$. == #sc[Max Cut] Solutions 1. Randomized Algorithm 2. = Naive Solution/Algorithm (#sc[Max Cut]) We just split the graph into two parts randomly. #clm[Utilizing the random assignment solution, there exists a 0.5-approximation algorithm.] #dfn[Approximation Resistant Algorithms][] #proof[][ Let us first consider $ Pr((u,v) "is cut") &= \ &= 1/2 \ $ Thus, $ EE["cut edges"] = 1/2 times |E| >= 1/2 var("OPT") $ ] #nt[It's worth noting that even a greedy algorithm can also achieve $0.5$-approximation] = Improved Solution: Linear Programming (#sc[Max Cut] Problem) Let us define the following integer program $ max sum_((u,v) in E(G)) x_((u,v)) $ where it is $x$-metric and $x_((u,v)) in [0,1]$ - #[This is a very weak LP, since essentially it allows us to just delete all edges, which is feasible, but not worthwhile] LP is useless! #nt[] We want to now try semi-definite programming, which is essentially a generalization of LP. #int[We want to fix the graphs onto a high-dimensional sphere in high-dimensional space, thus the distance from each vertex to the center is exactly 1.] $ max sum_((u,v) in E(G)) ||X_u - X_v || $ such that $||x_u|| = 1$ #int[We want to maximize the distance between the vertices within the high-dimensional space] #nt[As it turns out, no LP can solve this problem as is, we can only solve the new problem:] $ max sum_((u,v) in E(G)) ||X_u - X_v ||^2 $ such that $||x_u||^2 = 1$. #[Now, we just have a lot of $X_u$'s and $X_v$'s in high dimensional space. ] #[The ideal solution here is that the distance must exist within $[-1, 1]$, in which we can delineate into the $L$ and $R$ components.] Here is our new objective function: $ max sum_((u,v) in E(G)) (|| X_u - X_v||^2) / 4 colgr("we normalize using" 1/4) $ #[*Next time.* We will discuss the actual algorithm, which occurs whenever we cut a hyperplane randomly, and split it into two halves $L$ and $R$. ] #chap[(05/28/24 Lecture)] = Semi-Definite Programming = #sc[Max Cut] Problem, Continued == Structure of the Solution 1. We want to define a SDP-relaxation of the problem 2. Evaluate the SDP-relaxation of the problem and obtain a set of nodes ${X_u}u in V$ 3. Pick a random unit vector $z$ (in practice, a Gaussian vector or normal vector) such that $ L = { u : angle.l x_u, z angle.r <= 0 } \ R = { u : angle.l x_u, z angle.r > 0 } $ where $z$ is normal to the hyperplane. == Solution (cont'd) #sc[Max Cut] #rmk[][We derived the objective function $ (|| X_u - X_v||^2) / 4 $ as a means of _relaxing_ the constraints of the problem, ] We just want to determine whether or not a vertex exists in the $L$ half or the $R$ half. After imposing the graph into $n$-dimensional space, what kind of algorithm can we utilize? #int[Randomly choose a hyperplane that cuts our imposed sphere into two halves, $L$ and $R$, respectively.] - #[Surprisingly, this is the _best_ possible algorithm for evaluating this problem (under particular constraints)] = Algorithm #sc[Max Cut] = Algorithm Analysis #sc[Max Cut] #thm[Randomized #[Max Cut] Approximation][ $ var("ALG") >= alpha dot "SDP" $ where $alpha$ is 0.87. ] #rmk[][The optimal value must be upper-bounded by the solution to the relaxation of the SDP-problem. $ var("OPT") <= "SDP" $ ] We seek to show that $ EE[var("ALG")] >= alpha dot "SDP" >= alpha dot var("OPT") $ We can achieve this by simply maximizing the following expression for $alpha$: $ sum_(u, v in E(G)) Pr("sign"(angle.l x_u, z angle.r ) != "sign" (angle.l x_v, z angle.r)) >= alpha dot sum_((u,v) in E(G)) (*) $ Let us now represent $X_u$ and $X_v$ using $theta$, versus their explicit values: $ (*) &= (||x_u||^2 +||x_v||^2 - 2 angle.l x_u, x_v angle.r ) / 4 \ &= (1 - angle.l x_u, x_v angle.r) / 2 \ &= (1-cos(theta)) / 2 $ As for the $Pr(-)$, we have $ Pr(-) &= theta / pi$. Now, we can perform the necessary substitutions in order to obtain $ Pr(-) &>= Pr(*) \ theta / pi & >= alpha dot (1- cos(theta)) / 2 $ From, here we can find a generalizable $alpha$ + $theta = pi => alpha = 1$ + $dots$ For all possible theta values, however, we find that the best possible one is located at $theta^star = 3/4$. Given $theta^* = 3/4$, then, $ &= (1 - cos(theta^star)) / 2 \ &= (1 + sqrt(2)/2) / 2 \ &approx.eq 0.87 $ In the worst possible case, then _ALG_ is 0.87-approximate, in the best-case. = Linear Programming = Definition (Linear Programming) Given a set of variables $ X = (x_1, dots, x_n), $ we seek to minimize some objective function: $ min angle.l c, x angle.r \ dots \ min c^T x \ dots \ min sum_i c_i dot x_i $ In which we possess constraints, which have the form $ A x >= b $ = Standard Forms of Linear Programs In the minimization sense, we will be given a problem $ min (c ,x) $ with which we have constraints $A x >= b$ where $x >= 0$. \ which is also equivalent to $ max (b, y) $ for constraints $ A^T y <= c $ where $y >= 0$. == Intuition of Constraints For a minimization problem, we can think of the constraints as simply setting the floor for the problem, as well as constraints setting a ceiling in the context of a maximization problem. #par[Whenever we are actually visualizing this, the constraints are simply just a line, and we want to determine on which side of the line our solution should be in. If we had multiple lines, then we would form a polygon.] == Intuition of Linear Programming We can think our linear program, then we just want to find the minimum of the maximum value of that polytope. #nt[The points that satisfy a LP are convex] = Defining Convexity #dfn[Convexity][] = Solving Linear Programs There are three common algorithms for solving LPs: + #[Simplex Method] + #[Interior Point Method] + #[Ellipsoid Method] = Simplex Method #dfn[Simplex Method][Given the constraints, examine a vertex of the polytope and examine the incident edges, following the points until we cannot possibly minimize/ maximize the value of the problem] = Interior Point Method #dfn[Interior Point Method][Starting from _any_ interior point of the polytope, walk down to the minimum value.] = Ellipsoid Method #dfn[Ellipsoid Method][Define an ellipsoid $cal(E)$ such that $cal(E)$ encapsulates the polytope. Then, examine the center of such an ellipsoid, by which we split the ellipse, then we just perform divide-and-conquer.] #chap[LP Duality] = Motivation Let us minimize $ min x_1 $ given the following constraints: $ x_1 - 2 x_2 &>= 3 \ x_1 + x_2 &>= 9 $ Let us now consider two arbitrary points $ x_1 &= 7 \ x_2 &= 2 $ We know that $(7,2)$ is a feasible solution, so we know that it is at least upper-bounded by $(7,2)$. But how can we prove this? Isolate $x_1$ $ x_1 - 2x_2 &>= 3 \ - 2(x_1 + x_2 &>= 9) \ = 3x_1&>=21 $ We can perform this isolation for any $n$- dimensional linear-programming problem. = Ball and Cone as LP Duality Our constraints represent "counter forces" which we can leverage #unit[Dynamic Graph Algorithms][] #chap[]] #chap[Graph Orienting]
https://github.com/duskmoon314/mdbook-typst-math
https://raw.githubusercontent.com/duskmoon314/mdbook-typst-math/main/README.md
markdown
MIT License
# mdbook-typst-math An mdbook preprocessor to use [typst](https://typst.app/) to render math. ## Installation ```shell cargo install --git https://github.com/duskmoon314/mdbook-typst-math # OR git clone https://github.com/duskmoon314/mdbook-typst-math.git cargo build --release ``` ## Usage ### Setup preprocessor Add the following to your `book.toml`: ```toml [preprocessor.typst-math] command = "/path/to/mdbook-typst-math" ``` The path is usually `~/.cargo/bin/mdbook-typst-math` if you installed it using `cargo`. Other configurations see the following section: [Configuration](#configuration). ### Control the style Add css to control the style of the typst block: ```css /* css/typst.css as an example */ .typst-inline { display: inline flex; vertical-align: bottom; } .typst-display { display: block flex; justify-content: center; } .typst-display > .typst-doc { transform: scale(1.5); } ``` Add the following to your `book.toml`: ```toml [output.html] additional-css = ["css/typst.css"] ``` ### What this preprocessor does This preprocessor will convert all math blocks to a `<div>` with the class `typst-inline`/`typst-display` (depends on the type of math blocks) and a `<svg>` with the class `typst-doc` inside. Say you have the following code block in your markdown: ```markdown hello $$ y = f(x) $$ world ``` This preprocessor will first change it to: ```diff hello $$ + #set page(width:auto, height:auto, margin:0.5em) + $ y = f(x) $ - y = f(x) $$ world ``` The above is a valid `typst` code. The dollar signs `$` and whitespaces are used to let typst knows it is a math block instead of an inline math. Then preprocessor will leverage `typst` to render the math block and change it to: ```html hello <div class="typst-display"> <svg class="typst-doc" ...></svg> </div> world ``` ### Configuration Currently, only following configurations are supported. Here we use an example to show how to set them: ````toml [preprocessor.typst] # Additional fonts to load # # Two types are supported: a string or an array of strings # # Usually, you don't need to set this since the default build of preprocessor # will load system fonts and typst embedded fonts. fonts = ["Fira Math"] # or "Fira Math" # Preamble to be added before the typst code # # The default preamble is: # ``` # #set page(width:auto, height:auto, margin:0.5em) # ``` preamble = """ #set page(width:auto, height:auto, margin:0.5em) #set text(size: 12pt) #show math.equation: set text(font: "Fira Math") """ # Preamble to be added before the typst code for inline math # # If not set, the `preamble` will be used. # # Usually, this is not needed. But if you want to use different settings for # inline math and display math, you can set this. inline_preamble = """ #set page(width:auto, height:auto, margin:0.5em) #set text(size: 12pt) #show math.equation: set text(font: "Fira Math") """ # Preamble to be added before the typst code for display math # # If not set, the `preamble` will be used. # # Usually, this is not needed. But if you want to use different settings for # inline math and display math, you can set this. display_preamble = """ #set page(width:auto, height:auto, margin:0.5em) #set text(size: 14pt) #show math.equation: set text(font: "Fira Math") """ ```` ## TODO - [x] Integrate `typst` in code instead of using `std::process::Commend` - [ ] Refactor the code to improve readability and maintainability - [x] Allow user to configure the preambles through `book.toml`
https://github.com/artemist/typstcard
https://raw.githubusercontent.com/artemist/typstcard/canon/common.typ
typst
#let address_text(card) = { text(font: ("OCR-B", "Noto Emoji"), size: 8pt, card.address) } #let place_avatar(text_height, card) = { style(styles => { let text_offset = (text_height - measure(address_text(card), styles).height) / 2 place( top + left, dx: 0.1in, dy: calc.max(text_offset + 4pt - 0.15in, 0pt), image(card.avatar, width: 0.3in) ) }) } #let address_content(width, height, card) = { set par(leading: 0.5em) let text_height = if card.imb == "" { height } else { height - 1in/8 } place( top + left, dx: 0.5in, block( width: width - 0.5in, height: text_height, align( start + horizon, address_text(card) ) ) ) if card.imb != "" { place( top + left, dy: height - 1in/8, dx: 0.05in, block( width: 100%, height: 1in/8, align( top + left, text(font: "USPSIMBCompact", size: 12pt, card.imb) ) ) ) } if card.avatar != none { place_avatar(text_height, card) } } #let address_block(width, height, card) = { block( width: width, height: height, breakable: false, address_content(width, height, card) ) } #let postcard_content(width, height, content_fn, card) = { // Content block place( top + left, dx: 1in/8, dy: 1in/8, block( width: width - 2in - 7in/8, height: height - 0.25in, breakable: false, content_fn(card) ) ) // Stamp placement guide place( top + right, dx: -0.25in, dy: 0.25in, image("nixowos.png", width: 0.5in) ) // Address block place( horizon + right, dx: -1in/8, address_block(2.5in, 1in, card) ) } #let postcard_block(width, height, content_fn, card) = { block( width: width, height: height, breakable: false, postcard_content(width, height, content_fn, card) ) } #let postcard_square(width, height, margin, content_fn, card) = { rect( width: width + margin * 2, height: height + margin * 2, inset: margin, postcard_block(width, height, content_fn, card) ) } #let card_sheets(width, height, margin, args, cards) = { let content_fn = if args.no_content { _ => [] } else { import "cache/content/content.typ" content.content } for (idx, card) in cards.enumerate() { let row = calc.rem(idx + args.skip, 2) if idx != 0 and row == 0 { pagebreak() } place( top + left, dx: 50% - width / 2 - margin, dy: 25% - height / 2 - margin + 50% * row, postcard_square(width, height, margin, content_fn, card) ) } }
https://github.com/brainworkup/neurotyp-adult
https://raw.githubusercontent.com/brainworkup/neurotyp-adult/main/README.md
markdown
MIT License
# Neurotyp Adult Report Format for Typst using Quarto ## Use template ```bash quarto use template brainworkup/neurotyp-adult ``` This will install the format extension and create an example qmd file that you can use as a starting place for your document. ## Update template ```bash quarto update template brainworkup/neurotyp-adult ``` This will update to the latest version. ## Add template ```bash quarto add template brainworkup/neurotyp-adult ``` Alternatively, you can add the format (without the template) into an existing project or directory: ## Using _TODO_: Describe how to use your format.
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tools/test-helper/README.md
markdown
Apache License 2.0
# Test helper This is a small VS Code extension that helps with managing Typst's test suite. When installed, three new buttons appear in the menubar for all `.typ` files in the `tests` folder. - Open: Opens the output and reference images of a test to the side. - Refresh: Refreshes the preview. - Rerun: Re-runs the test. - Update: Copies the output into the reference folder and optimizes it with `oxipng`. For the test helper to work correctly, you also need to install `oxipng`, for example with `cargo install oxipng`. ## Installation The simplest way to install this extension (and keep it up-to-date) is to add a symlink from `~/.vscode/extensions/typst-test-helper` to `path/to/typst/tools/test-helper`.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1100.typ
typst
Apache License 2.0
#let data = ( ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>-KIYEOK", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("H<NAME> RIEUL-HIEUH", "Lo", 0), ("H<NAME> KAPYEOUNRIEUL", "Lo", 0), ("H<NAME>ONG MIEUM-PIEUP", "Lo", 0), ("H<NAME>ONG KAPYEOUNMIEUM", "Lo", 0), ("<NAME>ONG PIEUP-KIYEOK", "Lo", 0), ("HANGUL CHOSEONG PIEUP-NIEUN", "Lo", 0), ("HANGUL CHOSEONG PIEUP-TIKEUT", "Lo", 0), ("HANGUL CHOSEONG PIEUP-SIOS", "Lo", 0), ("H<NAME>ONG PIEUP-SIOS-KIYEOK", "Lo", 0), ("HANGUL CHOSEONG PIEUP-SIOS-TIKEUT", "Lo", 0), ("HANGUL CHOSEONG PIEUP-SIOS-PIEUP", "Lo", 0), ("H<NAME>ONG PIEUP-SSANGSIOS", "Lo", 0), ("HANGUL CHOSEONG PIEUP-SIOS-CIEUC", "Lo", 0), ("HANGUL CHOSEONG PIEUP-CIEUC", "Lo", 0), ("HANGUL CHOSEONG PIEUP-CHIEUCH", "Lo", 0), ("H<NAME>ONG PIEUP-THIEUTH", "Lo", 0), ("HANGUL CHOSEONG PIEUP-PHIEUPH", "Lo", 0), ("HANGUL CHOSEONG KAPYEOUNPIEUP", "Lo", 0), ("HANGUL CHOSEONG KAPYEOUNSSANGPIEUP", "Lo", 0), ("HANGUL CHOSEONG SIOS-KIYEOK", "Lo", 0), ("HANGUL CHOSEONG SIOS-NIEUN", "Lo", 0), ("HANGUL CHOSEONG SIOS-TIKEUT", "Lo", 0), ("HANGUL CHOSEONG SIOS-RIEUL", "Lo", 0), ("HANGUL CHOSEONG SIOS-MIEUM", "Lo", 0), ("HANGUL CHOSEONG SIOS-PIEUP", "Lo", 0), ("HANGUL CHOSEONG SIOS-PIEUP-KIYEOK", "Lo", 0), ("HANGUL CHOSEONG SIOS-SSANGSIOS", "Lo", 0), ("HANGUL CHOSEONG SIOS-IEUNG", "Lo", 0), ("HANGUL CHOSEONG SIOS-CIEUC", "Lo", 0), ("HANGUL CHOSEONG SIOS-CHIEUCH", "Lo", 0), ("H<NAME>ONG SIOS-KHIEUKH", "Lo", 0), ("HANGUL CHOSEONG SIOS-THIEUTH", "Lo", 0), ("HANGUL CHOSEONG SIOS-PHIEUPH", "Lo", 0), ("HANGUL CHOSEONG SIOS-HIEUH", "Lo", 0), ("HANGUL CHOSEONG CHITUEUMSIOS", "Lo", 0), ("HANGUL CHOSEONG CHITUEUMSSANGSIOS", "Lo", 0), ("HANGUL CHOSEONG CEONGCHIEUMSIOS", "Lo", 0), ("HANGUL CHOSEONG CEONGCHIEUMSSANGSIOS", "Lo", 0), ("HANGUL CHOSEONG PANSIOS", "Lo", 0), ("HANGUL CHOSEONG IEUNG-KIYEOK", "Lo", 0), ("HANGUL CHOSEONG IEUNG-TIKEUT", "Lo", 0), ("HANGUL CHOSEONG IEUNG-MIEUM", "Lo", 0), ("HANGUL CHOSEONG IEUNG-PIEUP", "Lo", 0), ("HANGUL CHOSEONG IEUNG-SIOS", "Lo", 0), ("<NAME>UNG-PANSIOS", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>UNG-CIEUC", "Lo", 0), ("<NAME>UNG-CHIEUCH", "Lo", 0), ("<NAME>UNG-THIEUTH", "Lo", 0), ("<NAME>UNG-PHIEUPH", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>UMCIEUC", "Lo", 0), ("<NAME>ANGCIEUC", "Lo", 0), ("<NAME>CHIEUMCIEUC", "Lo", 0), ("<NAME>IEUMSSANGCIEUC", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>-TIKEUT", "Lo", 0), ("<NAME>UN-SIOS", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME> YA-O", "Lo", 0), ("<NAME> YA-YO", "Lo", 0), ("H<NAME>UNGSEONG EO-O", "Lo", 0), ("H<NAME>UNGSEONG EO-U", "Lo", 0), ("H<NAME>UNGSEONG EO-EU", "Lo", 0), ("<NAME> YEO-O", "Lo", 0), ("<NAME>ONG YEO-U", "Lo", 0), ("<NAME> O-EO", "Lo", 0), ("H<NAME>ONG O-E", "Lo", 0), ("HANGUL JUNGSEONG O-YE", "Lo", 0), ("<NAME> O-O", "Lo", 0), ("<NAME> O-U", "Lo", 0), ("<NAME> YO-YA", "Lo", 0), ("<NAME>ONG YO-YAE", "Lo", 0), ("<NAME>ONG YO-YEO", "Lo", 0), ("<NAME> YO-O", "Lo", 0), ("<NAME> YO-I", "Lo", 0), ("<NAME>ONG U-A", "Lo", 0), ("<NAME>ONG U-AE", "Lo", 0), ("<NAME>UNGSEONG U-EO-EU", "Lo", 0), ("H<NAME>UNGSEONG U-YE", "Lo", 0), ("<NAME> U-U", "Lo", 0), ("<NAME> YU-A", "Lo", 0), ("<NAME> YU-EO", "Lo", 0), ("<NAME> YU-E", "Lo", 0), ("H<NAME>UNGSEONG YU-YEO", "Lo", 0), ("<NAME>-YE", "Lo", 0), ("<NAME>-U", "Lo", 0), ("<NAME> YU-I", "Lo", 0), ("<NAME> EU-U", "Lo", 0), ("<NAME> EU-EU", "Lo", 0), ("<NAME>-U", "Lo", 0), ("<NAME>-A", "Lo", 0), ("<NAME> I-YA", "Lo", 0), ("<NAME>-O", "Lo", 0), ("<NAME> I-U", "Lo", 0), ("<NAME> I-EU", "Lo", 0), ("<NAME> I-ARAEA", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>-EO", "Lo", 0), ("<NAME>-U", "Lo", 0), ("<NAME>-I", "Lo", 0), ("<NAME> SSANGARAEA", "Lo", 0), ("<NAME> A-EU", "Lo", 0), ("<NAME> YA-U", "Lo", 0), ("<NAME> YEO-YA", "Lo", 0), ("<NAME> O-YA", "Lo", 0), ("<NAME> O-YAE", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME> KIYEOK-SIOS", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME> KIYEOK-SIOS-KIYEOK", "Lo", 0), ("<NAME> NIEUN-KIYEOK", "Lo", 0), ("<NAME> NIEUN-TIKEUT", "Lo", 0), ("<NAME>-SIOS", "Lo", 0), ("<NAME> NIEUN-PANSIOS", "Lo", 0), ("<NAME>-THIEUTH", "Lo", 0), ("<NAME> TIKEUT-KIYEOK", "Lo", 0), ("<NAME> TIKEUT-RIEUL", "Lo", 0), ("<NAME> RIEUL-KIYEOK-SIOS", "Lo", 0), ("<NAME>-NIEUN", "Lo", 0), ("<NAME>UL-TIKEUT", "Lo", 0), ("<NAME>-TIKEUT-HIEUH", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME> RIEUL-MIEUM-KIYEOK", "Lo", 0), ("<NAME> RIEUL-MIEUM-SIOS", "Lo", 0), ("<NAME> RIEUL-PIEUP-SIOS", "Lo", 0), ("<NAME>UL-PIEUP-HIEUH", "Lo", 0), ("<NAME>IEUL-KAPYEOUNPIEUP", "Lo", 0), ("<NAME>UL-SSANGSIOS", "Lo", 0), ("<NAME> RIEUL-PANSIOS", "Lo", 0), ("<NAME>UL-KHIEUKH", "Lo", 0), ("<NAME> RIEUL-YEORINHIEUH", "Lo", 0), ("<NAME> MIEUM-KIYEOK", "Lo", 0), ("<NAME> MIEUM-RIEUL", "Lo", 0), ("<NAME> MIEUM-PIEUP", "Lo", 0), ("<NAME> MIEUM-SIOS", "Lo", 0), ("<NAME> MIEUM-SSANGSIOS", "Lo", 0), ("<NAME> MIEUM-PANSIOS", "Lo", 0), ("<NAME> MIEUM-CHIEUCH", "Lo", 0), ("<NAME> MIEUM-HIEUH", "Lo", 0), ("<NAME>YEOUNMIEUM", "Lo", 0), ("<NAME>-RIEUL", "Lo", 0), ("<NAME> PIEUP-PHIEUPH", "Lo", 0), ("<NAME> PIEUP-HIEUH", "Lo", 0), ("<NAME> KAPYEOUNPIEUP", "Lo", 0), ("<NAME> SIOS-KIYEOK", "Lo", 0), ("<NAME> SIOS-TIKEUT", "Lo", 0), ("<NAME> SIOS-RIEUL", "Lo", 0), ("<NAME> SIOS-PIEUP", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME> IEUNG-KIYEOK", "Lo", 0), ("<NAME> IEUNG-SSANGKIYEOK", "Lo", 0), ("<NAME> SSANGIEUNG", "Lo", 0), ("<NAME>ONG IEUNG-KHIEUKH", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>-PANSIOS", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), ("<NAME>", "Lo", 0), )
https://github.com/alberto-lazari/unipd-typst-doc
https://raw.githubusercontent.com/alberto-lazari/unipd-typst-doc/main/readme.md
markdown
MIT License
# Unipd doc ## Install Clone this repo in the Typst data directory, with ```bash data_dir="$( if [[ $(uname) = Linux ]]; then echo "${XDG_DATA_HOME:-$HOME/.local/share}" elif [[ $(uname) = Darwin ]]; then echo "$HOME/Library/Application Support" fi )" git clone --depth=1 https://github.com/albertolazari/unipd-typst-doc \ "$data_dir/typst/packages/local/unipd-doc/0.0.1" ``` On Windows use ```powershell git clone --depth=1 https://github.com/albertolazari/unipd-typst-doc ^ "%APPDATA%\typst\packages\local\unipd-doc\0.0.1" ``` Then use this package in your document with ```typst #import "@local/unipd-doc:0.0.1": * ``` ## Usage At the beginning of the document you should put this ```typst #show: unipd-doc( title: [Your document's title], subtitle: [A subtitle], author: [Your name], date: [Some date], ) ``` It will create the title and outline, and style the document
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/pagebreak-numbering.typ
typst
Apache License 2.0
// https://github.com/typst/typst/issues/2095 // The empty page 2 should not have a page number #set page(numbering: none) This and next page should not be numbered #pagebreak(weak: true, to: "odd") #set page(numbering: "1") #counter(page).update(1) This page should
https://github.com/andrin-geiger/hslu_template_typst
https://raw.githubusercontent.com/andrin-geiger/hslu_template_typst/master/template.typ
typst
// The project function defines how your document looks. // It takes your content and some metadata and formats it. // Go ahead and customize it to your liking! #import "@preview/anti-matter:0.1.1": anti-matter, fence, set-numbering #let project( title: "", subtitle: "", abstract: [], authors: (), betreuer: "", experte: "", auftraggeber: "", institut: "", date: datetime.today().display("[day].[month].[year]"), logo: "", body, version: "", studiengang: "" ) = { // Set the document's basic properties. set document(author: authors, title: title) show: anti-matter set-numbering(none) //set page(numbering: "1", number-align: center) set text(font: "Liberation Sans", lang: "de") set heading(numbering: "1.1") // Title page. // The page can contain a logo if you pass one with `logo: "logo.png"`. v(0.6fr) if logo != none { align(right, image(logo, width: 26%)) } v(1.6fr) align(center)[ #text(2em, weight: 700, title) #v(1.2em, weak: true) #text(1.2em, subtitle) // Author information. #pad( top: 0.7em, grid( gutter: 1em, ..authors.map(author => align(start, strong(author))), ), ) // Betreuer information. #text([Betreuer: #betreuer]) #v(4.6fr) #v(1.2em, weak: true) #text(1.1em, date) #v(1.2em, weak: true) #text(1.1em, institut) #v(1.2em, weak: true) #text(1.1em, version) ] v(2.4fr) pagebreak() // Eidesstattlicheerklärung v(1fr) align(left)[ #heading( outlined: false, numbering: none, //text(smallcaps[Wirtschaftsprojekt an der Hochschule Luzern – Informatik]), text(smallcaps[Bacherlorarbeit an der Hochschule Luzern – Informatik]), )#v(10pt) #strong[Titel: #title]#linebreak() \ #strong[Student: ]#str(authors.at(0)) \ #v(10pt) // If there are two authors, display the second one. //#strong[Student: ]#str(authors.at(1)) \ #v(10pt) #strong[Studiengang: ]#studiengang \ #v(10pt) #strong[Jahr: ]#datetime.today().display("[year]") \ #v(10pt) #strong[Betreuer: ]#betreuer \ #v(10pt) #strong[Experte: ]#experte \ #v(10pt) #strong[Auftraggeber: ]#auftraggeber \ #v(10pt) #strong[Codierung / Klassifizierung der Arbeit: ]\ #text([⊠ Öffentlich □ Vertraulich]) \ #v(10pt) #text(strong([Eidesstattliche Erklärung:])) #text([Ich erkläre hiermit, dass wir die vorliegende Arbeit selbständig und ohne unerlaubte fremde Hilfe angefertigt haben, alle verwendeten Quellen, Literatur und andere Hilfsmittel angegeben haben, wörtlich oder inhaltlich entnommene Stellen als solche kenntlich gemacht haben, das Vertraulichkeitsinteresse des Auftraggebers wahren und die Urheberrechtsbestimmungen der Hochschule Luzern respektieren werden.]) \ #v(10pt) #strong[Ort / Datum, Unterschrift: ]#box(line(length: 5cm)) \ #v(10pt) // If there are two authors, display the second one. //#strong[Ort / Datum, Unterschrift: ]#box(line(length: 5cm)) \ #v(10pt) // Portfoliodb paragraph only for bachelor thesis #strong[Abgabe der Arbeit auf der Portfolio Datenbank:] \ #text[Bestätigungsvisum Studentin/Student] \ #text[Ich bestätige, dass ich die Bachelorarbeit korrekt gemäss Merkblatt auf der Portfolio Datenbank abgelegt habe. Die Verantwortlichkeit sowie die Berechtigungen habe ich abgegeben, so dass ich keine Änderungen mehr vornehmen kann oder weitere Dateien hochladen kann.] \ #v(10pt) #strong[Ort / Datum, Unterschrift: ]#box(line(length: 5cm)) \ #v(10pt) #strong[Ausschliesslich bei Abgabe in gedruckter Form:] \ #strong[Eingangsvisum durch das Sekretariat auszufüllen] \ #v(10pt) #text[Rotkreuz, den] #box(line(length: 5cm)) #text[Visum: ] #box(line(length: 5cm)) ] v(1.618fr) pagebreak() // Abstract page. set-numbering("I") v(1fr) align(center)[ #heading( outlined: false, numbering: none, text(0.85em, smallcaps[Abstract]), ) #abstract ] v(1.618fr) pagebreak() // Table of contents. outline(depth: 3, indent: true) fence() pagebreak() // Main body. set par(justify: true) body }
https://github.com/LDemetrios/Typst4k
https://raw.githubusercontent.com/LDemetrios/Typst4k/master/src/test/resources/suite/styling/show-set.typ
typst
// Test show-set rules. --- show-set-override --- // Test overriding show-set rules. #show strong: set text(red) Hello *World* #show strong: set text(blue) Hello *World* --- show-set-on-same-element --- // Test show-set rule on the same element. #set figure(supplement: [Default]) #show figure.where(kind: table): set figure(supplement: [Tableau]) #figure( table(columns: 2)[A][B][C][D], caption: [Four letters], ) --- show-set-same-element-and-order --- // Test both things at once. #show heading: set text(red) = Level 1 == Level 2 #show heading.where(level: 1): set text(blue) #show heading.where(level: 1): set text(green) #show heading.where(level: 1): set heading(numbering: "(I)") = Level 1 == Level 2 --- show-set-same-element-matched-field --- // Test setting the thing we just matched on. // This is quite cursed, but it works. #set heading(numbering: "(I)") #show heading.where(numbering: "(I)"): set heading(numbering: "1.") = Heading --- show-set-same-element-synthesized-matched-field --- // Same thing, but even more cursed, because `kind` is synthesized. #show figure.where(kind: table): set figure(kind: raw) #figure(table[A], caption: [Code]) --- show-set-same-element-matching-interaction --- // Test that show-set rules on the same element don't affect each other. This // could be implemented, but isn't as of yet. #show heading.where(level: 1): set heading(numbering: "(I)") #show heading.where(numbering: "(I)"): set text(red) = Heading --- show-set-on-layoutable-element --- // Test show-set rules on layoutable element to ensure it is realized // even though it implements `LayoutMultiple`. #show table: set text(red) #pad(table(columns: 4)[A][B][C][D]) --- show-function-order-with-set --- // These are both red because in the expanded form, `set text(red)` ends up // closer to the content than `set text(blue)`. #show strong: it => { set text(red); it } Hello *World* #show strong: it => { set text(blue); it } Hello *World* --- show-function-set-on-it --- // This doesn't have an effect. An element is materialized before any show // rules run. #show heading: it => { set heading(numbering: "(I)"); it } = Heading
https://github.com/kotfind/typst_task
https://raw.githubusercontent.com/kotfind/typst_task/master/example/main.typ
typst
#import "../task.typ": conf #show: conf.with( title: [My Example Competition], short_title: [MEC], ) #include "first_tour.typ" #include "second_tour.typ"
https://github.com/janlauber/bachelor-thesis
https://raw.githubusercontent.com/janlauber/bachelor-thesis/main/thesis_typ/appendix.typ
typst
Creative Commons Zero v1.0 Universal
#include("../appendix/meeting_log.typ") #pagebreak() == Lighthouse Report <lighthouse> #figure( image("../figures/lighthouse/lighthouse-one-click-1.png", width: 100%), caption: "Lighthouse report page 1" ) #pagebreak() #figure( image("../figures/lighthouse/lighthouse-one-click-2.png", width: 100%), caption: "Lighthouse report page 2" ) #pagebreak() #figure( image("../figures/lighthouse/lighthouse-one-click-3.png", width: 100%), caption: "Lighthouse report page 3" ) #pagebreak() #figure( image("../figures/lighthouse/lighthouse-one-click-4.png", width: 100%), caption: "Lighthouse report page 4" ) #pagebreak() #figure( image("../figures/lighthouse/lighthouse-one-click-5.png", width: 100%), caption: "Lighthouse report page 5" )
https://github.com/robertjndw/typst-tum-presentation
https://raw.githubusercontent.com/robertjndw/typst-tum-presentation/main/example.typ
typst
#import "theme.typ": * #show: tum-theme.with( authors: ("<NAME>",), title: "My awesome topic I want to put into a presentation", footer-infos: ("Excellence",) ) #title-slide() #title-slide(flags: true) #title-content-slide(title: "Section 1", [ #text("This is the first section of the presentation.") #pause #text("It is a very important section.") #pause #text("It is the best section.") ]) #title-image-slide(title: "Section 2", image_path: "/resources/TUM-turm.jpg") #title-content-slide(title: "Section 3", lorem(100))
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1200.typ
typst
Apache License 2.0
#let data = ( ("ETHIOPIC SYLLABLE HA", "Lo", 0), ("ETHIOPIC SYLLABLE HU", "Lo", 0), ("ETHIOPIC SYLLABLE HI", "Lo", 0), ("ETHIOPIC SYLLABLE HAA", "Lo", 0), ("ETHIOPIC SYLLABLE HEE", "Lo", 0), ("ETHIOPIC SYLLABLE HE", "Lo", 0), ("ETHIOPIC SYLLABLE HO", "Lo", 0), ("ETHIOPIC SYLLABLE HOA", "Lo", 0), ("ETHIOPIC SYLLABLE LA", "Lo", 0), ("ETHIOPIC SYLLABLE LU", "Lo", 0), ("ETHIOPIC SYLLABLE LI", "Lo", 0), ("ETHIOPIC SYLLABLE LAA", "Lo", 0), ("ETHIOPIC SYLLABLE LEE", "Lo", 0), ("ETHIOPIC SYLLABLE LE", "Lo", 0), ("ETHIOPIC SYLLABLE LO", "Lo", 0), ("ETHIOPIC SYLLABLE LWA", "Lo", 0), ("ETHIOPIC SYLLABLE HHA", "Lo", 0), ("ETHIOPIC SYLLABLE HHU", "Lo", 0), ("ETHIOPIC SYLLABLE HHI", "Lo", 0), ("ETHIOPIC SYLLABLE HHAA", "Lo", 0), ("ETHIOPIC SYLLABLE HHEE", "Lo", 0), ("ETHIOPIC SYLLABLE HHE", "Lo", 0), ("ETHIOPIC SYLLABLE HHO", "Lo", 0), ("ETHIOPIC SYLLABLE HHWA", "Lo", 0), ("ETHIOPIC SYLLABLE MA", "Lo", 0), ("ETHIOPIC SYLLABLE MU", "Lo", 0), ("ETHIOPIC SYLLABLE MI", "Lo", 0), ("ETHIOPIC SYLLABLE MAA", "Lo", 0), ("ETHIOPIC SYLLABLE MEE", "Lo", 0), ("ETHIOPIC SYLLABLE ME", "Lo", 0), ("ETHIOPIC SYLLABLE MO", "Lo", 0), ("ETHIOPIC SYLLABLE MWA", "Lo", 0), ("ETHIOPIC SYLLABLE SZA", "Lo", 0), ("ETHIOPIC SYLLABLE SZU", "Lo", 0), ("ETHIOPIC SYLLABLE SZI", "Lo", 0), ("ETHIOPIC SYLLABLE SZAA", "Lo", 0), ("ETHIOPIC SYLLABLE SZEE", "Lo", 0), ("ETHIOPIC SYLLABLE SZE", "Lo", 0), ("ETHIOPIC SYLLABLE SZO", "Lo", 0), ("ETHIOPIC SYLLABLE SZWA", "Lo", 0), ("ETHIOPIC SYLLABLE RA", "Lo", 0), ("ETHIOPIC SYLLABLE RU", "Lo", 0), ("ETHIOPIC SYLLABLE RI", "Lo", 0), ("ETHIOPIC SYLLABLE RAA", "Lo", 0), ("ETHIOPIC SYLLABLE REE", "Lo", 0), ("ETHIOPIC SYLLABLE RE", "Lo", 0), ("ETHIOPIC SYLLABLE RO", "Lo", 0), ("ETHIOPIC SYLLABLE RWA", "Lo", 0), ("ETHIOPIC SYLLABLE SA", "Lo", 0), ("ETHIOPIC SYLLABLE SU", "Lo", 0), ("ETHIOPIC SYLLABLE SI", "Lo", 0), ("ETHIOPIC SYLLABLE SAA", "Lo", 0), ("ETHIOPIC SYLLABLE SEE", "Lo", 0), ("ETHIOPIC SYLLABLE SE", "Lo", 0), ("ETHIOPIC SYLLABLE SO", "Lo", 0), ("ETHIOPIC SYLLABLE SWA", "Lo", 0), ("ETHIOPIC SYLLABLE SHA", "Lo", 0), ("ETHIOPIC SYLLABLE SHU", "Lo", 0), ("ETHIOPIC SYLLABLE SHI", "Lo", 0), ("ETHIOPIC SYLLABLE SHAA", "Lo", 0), ("ETHIOPIC SYLLABLE SHEE", "Lo", 0), ("ETHIOPIC SYLLABLE SHE", "Lo", 0), ("ETHIOPIC SYLLABLE SHO", "Lo", 0), ("ETHIOPIC SYLLABLE SHWA", "Lo", 0), ("ETHIOPIC SYLLABLE QA", "Lo", 0), ("ETHIOPIC SYLLABLE QU", "Lo", 0), ("ETHIOPIC SYLLABLE QI", "Lo", 0), ("ETHIOPIC SYLLABLE QAA", "Lo", 0), ("ETHIOPIC SYLLABLE QEE", "Lo", 0), ("ETHIOPIC SYLLABLE QE", "Lo", 0), ("ETHIOPIC SYLLABLE QO", "Lo", 0), ("ETHIOPIC SYLLABLE QOA", "Lo", 0), ("ETHIOPIC SYLLABLE QWA", "Lo", 0), (), ("ETHIOPIC SYLLABLE QWI", "Lo", 0), ("ETHIOPIC SYLLABLE QWAA", "Lo", 0), ("ETHIOPIC SYLLABLE QWEE", "Lo", 0), ("ETHIOPIC SYLLABLE QWE", "Lo", 0), (), (), ("ETHIOPIC SYLLABLE QHA", "Lo", 0), ("ETHIOPIC SYLLABLE QHU", "Lo", 0), ("ETHIOPIC SYLLABLE QHI", "Lo", 0), ("ETHIOPIC SYLLABLE QHAA", "Lo", 0), ("ETHIOPIC SYLLABLE QHEE", "Lo", 0), ("ETHIOPIC SYLLABLE QHE", "Lo", 0), ("ETHIOPIC SYLLABLE QHO", "Lo", 0), (), ("ETHIOPIC SYLLABLE QHWA", "Lo", 0), (), ("ETHIOPIC SYLLABLE QHWI", "Lo", 0), ("ETHIOPIC SYLLABLE QHWAA", "Lo", 0), ("ETHIOPIC SYLLABLE QHWEE", "Lo", 0), ("ETHIOPIC SYLLABLE QHWE", "Lo", 0), (), (), ("ETHIOPIC SYLLABLE BA", "Lo", 0), ("ETHIOPIC SYLLABLE BU", "Lo", 0), ("ETHIOPIC SYLLABLE BI", "Lo", 0), ("ETHIOPIC SYLLABLE BAA", "Lo", 0), ("ETHIOPIC SYLLABLE BEE", "Lo", 0), ("ETHIOPIC SYLLABLE BE", "Lo", 0), ("ETHIOPIC SYLLABLE BO", "Lo", 0), ("ETHIOPIC SYLLABLE BWA", "Lo", 0), ("ETHIOPIC SYLLABLE VA", "Lo", 0), ("ETHIOPIC SYLLABLE VU", "Lo", 0), ("ETHIOPIC SYLLABLE VI", "Lo", 0), ("ETHIOPIC SYLLABLE VAA", "Lo", 0), ("ETHIOPIC SYLLABLE VEE", "Lo", 0), ("ETHIOPIC SYLLABLE VE", "Lo", 0), ("ETHIOPIC SYLLABLE VO", "Lo", 0), ("ETHIOPIC SYLLABLE VWA", "Lo", 0), ("ETHIOPIC SYLLABLE TA", "Lo", 0), ("ETHIOPIC SYLLABLE TU", "Lo", 0), ("ETHIOPIC SYLLABLE TI", "Lo", 0), ("ETHIOPIC SYLLABLE TAA", "Lo", 0), ("ETHIOPIC SYLLABLE TEE", "Lo", 0), ("ETHIOPIC SYLLABLE TE", "Lo", 0), ("ETHIOPIC SYLLABLE TO", "Lo", 0), ("ETHIOPIC SYLLABLE TWA", "Lo", 0), ("ETHIOPIC SYLLABLE CA", "Lo", 0), ("ETHIOPIC SYLLABLE CU", "Lo", 0), ("ETHIOPIC SYLLABLE CI", "Lo", 0), ("ETHIOPIC SYLLABLE CAA", "Lo", 0), ("ETHIOPIC SYLLABLE CEE", "Lo", 0), ("ETHIOPIC SYLLABLE CE", "Lo", 0), ("ETHIOPIC SYLLABLE CO", "Lo", 0), ("ETHIOPIC SYLLABLE CWA", "Lo", 0), ("ETHIOPIC SYLLABLE XA", "Lo", 0), ("ETHIOPIC SYLLABLE XU", "Lo", 0), ("ETHIOPIC SYLLABLE XI", "Lo", 0), ("ETHIOPIC SYLLABLE XAA", "Lo", 0), ("ETHIOPIC SYLLABLE XEE", "Lo", 0), ("ETHIOPIC SYLLABLE XE", "Lo", 0), ("ETHIOPIC SYLLABLE XO", "Lo", 0), ("ETHIOPIC SYLLABLE XOA", "Lo", 0), ("ETHIOPIC SYLLABLE XWA", "Lo", 0), (), ("ETHIOPIC SYLLABLE XWI", "Lo", 0), ("ETHIOPIC SYLLABLE XWAA", "Lo", 0), ("ETHIOPIC SYLLABLE XWEE", "Lo", 0), ("ETHIOPIC SYLLABLE XWE", "Lo", 0), (), (), ("ETHIOPIC SYLLABLE NA", "Lo", 0), ("ETHIOPIC SYLLABLE NU", "Lo", 0), ("ETHIOPIC SYLLABLE NI", "Lo", 0), ("ETHIOPIC SYLLABLE NAA", "Lo", 0), ("ETHIOPIC SYLLABLE NEE", "Lo", 0), ("ETHIOPIC SYLLABLE NE", "Lo", 0), ("ETHIOPIC SYLLABLE NO", "Lo", 0), ("ETHIOPIC SYLLABLE NWA", "Lo", 0), ("ETHIOPIC SYLLABLE NYA", "Lo", 0), ("ETHIOPIC SYLLABLE NYU", "Lo", 0), ("ETHIOPIC SYLLABLE NYI", "Lo", 0), ("ETHIOPIC SYLLABLE NYAA", "Lo", 0), ("ETHIOPIC SYLLABLE NYEE", "Lo", 0), ("ETHIOPIC SYLLABLE NYE", "Lo", 0), ("ETHIOPIC SYLLABLE NYO", "Lo", 0), ("ETHIOPIC SYLLABLE NYWA", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL A", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL U", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL I", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL AA", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL EE", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL E", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL O", "Lo", 0), ("ETHIOPIC SYLLABLE GLOTTAL WA", "Lo", 0), ("ETHIOPIC SYLLABLE KA", "Lo", 0), ("ETHIOPIC SYLLABLE KU", "Lo", 0), ("ETHIOPIC SYLLABLE KI", "Lo", 0), ("ETHIOPIC SYLLABLE KAA", "Lo", 0), ("ETHIOPIC SYLLABLE KEE", "Lo", 0), ("ETHIOPIC SYLLABLE KE", "Lo", 0), ("ETHIOPIC SYLLABLE KO", "Lo", 0), ("ETHIOPIC SYLLABLE KOA", "Lo", 0), ("ETHIOPIC SYLLABLE KWA", "Lo", 0), (), ("ETHIOPIC SYLLABLE KWI", "Lo", 0), ("ETHIOPIC SYLLABLE KWAA", "Lo", 0), ("ETHIOPIC SYLLABLE KWEE", "Lo", 0), ("ETHIOPIC SYLLABLE KWE", "Lo", 0), (), (), ("ETHIOPIC SYLLABLE KXA", "Lo", 0), ("ETHIOPIC SYLLABLE KXU", "Lo", 0), ("ETHIOPIC SYLLABLE KXI", "Lo", 0), ("ETHIOPIC SYLLABLE KXAA", "Lo", 0), ("ETHIOPIC SYLLABLE KXEE", "Lo", 0), ("ETHIOPIC SYLLABLE KXE", "Lo", 0), ("ETHIOPIC SYLLABLE KXO", "Lo", 0), (), ("ETHIOPIC SYLLABLE KXWA", "Lo", 0), (), ("ETHIOPIC SYLLABLE KXWI", "Lo", 0), ("ETHIOPIC SYLLABLE KXWAA", "Lo", 0), ("ETHIOPIC SYLLABLE KXWEE", "Lo", 0), ("ETHIOPIC SYLLABLE KXWE", "Lo", 0), (), (), ("ETHIOPIC SYLLABLE WA", "Lo", 0), ("ETHIOPIC SYLLABLE WU", "Lo", 0), ("ETHIOPIC SYLLABLE WI", "Lo", 0), ("ETHIOPIC SYLLABLE WAA", "Lo", 0), ("ETHIOPIC SYLLABLE WEE", "Lo", 0), ("ETHIOPIC SYLLABLE WE", "Lo", 0), ("ETHIOPIC SYLLABLE WO", "Lo", 0), ("ETHIOPIC SYLLABLE WOA", "Lo", 0), ("ETHIOPIC SYLLABLE PHARYNGEAL A", "Lo", 0), ("ETHIOPIC SYLLABLE PHARYNGEAL U", "Lo", 0), ("ETHIOPIC SYLLABLE PHARYNGEAL I", "Lo", 0), ("ETHIOPIC SYLLABLE PHARYNGEAL AA", "Lo", 0), ("ETHIOPIC SYLLABLE PHARYNGEAL EE", "Lo", 0), ("ETHIOPIC SYLLABLE PHARYNGEAL E", "Lo", 0), ("ETHIOPIC SYLLABLE PHARYNGEAL O", "Lo", 0), (), ("ETHIOPIC SYLLABLE ZA", "Lo", 0), ("ETHIOPIC SYLLABLE ZU", "Lo", 0), ("ETHIOPIC SYLLABLE ZI", "Lo", 0), ("ETHIOPIC SYLLABLE ZAA", "Lo", 0), ("ETHIOPIC SYLLABLE ZEE", "Lo", 0), ("ETHIOPIC SYLLABLE ZE", "Lo", 0), ("ETHIOPIC SYLLABLE ZO", "Lo", 0), ("ETHIOPIC SYLLABLE ZWA", "Lo", 0), ("ETHIOPIC SYLLABLE ZHA", "Lo", 0), ("ETHIOPIC SYLLABLE ZHU", "Lo", 0), ("ETHIOPIC SYLLABLE ZHI", "Lo", 0), ("ETHIOPIC SYLLABLE ZHAA", "Lo", 0), ("ETHIOPIC SYLLABLE ZHEE", "Lo", 0), ("ETHIOPIC SYLLABLE ZHE", "Lo", 0), ("ETHIOPIC SYLLABLE ZHO", "Lo", 0), ("ETHIOPIC SYLLABLE ZHWA", "Lo", 0), ("ETHIOPIC SYLLABLE YA", "Lo", 0), ("ETHIOPIC SYLLABLE YU", "Lo", 0), ("ETHIOPIC SYLLABLE YI", "Lo", 0), ("ETHIOPIC SYLLABLE YAA", "Lo", 0), ("ETHIOPIC SYLLABLE YEE", "Lo", 0), ("ETHIOPIC SYLLABLE YE", "Lo", 0), ("ETHIOPIC SYLLABLE YO", "Lo", 0), ("ETHIOPIC SYLLABLE YOA", "Lo", 0), ("ETHIOPIC SYLLABLE DA", "Lo", 0), ("ETHIOPIC SYLLABLE DU", "Lo", 0), ("ETHIOPIC SYLLABLE DI", "Lo", 0), ("ETHIOPIC SYLLABLE DAA", "Lo", 0), ("ETHIOPIC SYLLABLE DEE", "Lo", 0), ("ETHIOPIC SYLLABLE DE", "Lo", 0), ("ETHIOPIC SYLLABLE DO", "Lo", 0), ("ETHIOPIC SYLLABLE DWA", "Lo", 0), ("ETHIOPIC SYLLABLE DDA", "Lo", 0), ("ETHIOPIC SYLLABLE DDU", "Lo", 0), ("ETHIOPIC SYLLABLE DDI", "Lo", 0), ("ETHIOPIC SYLLABLE DDAA", "Lo", 0), ("ETHIOPIC SYLLABLE DDEE", "Lo", 0), ("ETHIOPIC SYLLABLE DDE", "Lo", 0), ("ETHIOPIC SYLLABLE DDO", "Lo", 0), ("ETHIOPIC SYLLABLE DDWA", "Lo", 0), ("ETHIOPIC SYLLABLE JA", "Lo", 0), ("ETHIOPIC SYLLABLE JU", "Lo", 0), ("ETHIOPIC SYLLABLE JI", "Lo", 0), ("ETHIOPIC SYLLABLE JAA", "Lo", 0), ("ETHIOPIC SYLLABLE JEE", "Lo", 0), ("ETHIOPIC SYLLABLE JE", "Lo", 0), ("ETHIOPIC SYLLABLE JO", "Lo", 0), ("ETHIOPIC SYLLABLE JWA", "Lo", 0), ("ETHIOPIC SYLLABLE GA", "Lo", 0), ("ETHIOPIC SYLLABLE GU", "Lo", 0), ("ETHIOPIC SYLLABLE GI", "Lo", 0), ("ETHIOPIC SYLLABLE GAA", "Lo", 0), ("ETHIOPIC SYLLABLE GEE", "Lo", 0), ("ETHIOPIC SYLLABLE GE", "Lo", 0), ("ETHIOPIC SYLLABLE GO", "Lo", 0), ("ETHIOPIC SYLLABLE GOA", "Lo", 0), ("ETHIOPIC SYLLABLE GWA", "Lo", 0), (), ("ETHIOPIC SYLLABLE GWI", "Lo", 0), ("ETHIOPIC SYLLABLE GWAA", "Lo", 0), ("ETHIOPIC SYLLABLE GWEE", "Lo", 0), ("ETHIOPIC SYLLABLE GWE", "Lo", 0), (), (), ("ETHIOPIC SYLLABLE GGA", "Lo", 0), ("ETHIOPIC SYLLABLE GGU", "Lo", 0), ("ETHIOPIC SYLLABLE GGI", "Lo", 0), ("ETHIOPIC SYLLABLE GGAA", "Lo", 0), ("ETHIOPIC SYLLABLE GGEE", "Lo", 0), ("ETHIOPIC SYLLABLE GGE", "Lo", 0), ("ETHIOPIC SYLLABLE GGO", "Lo", 0), ("ETHIOPIC SYLLABLE GGWAA", "Lo", 0), ("ETHIOPIC SYLLABLE THA", "Lo", 0), ("ETHIOPIC SYLLABLE THU", "Lo", 0), ("ETHIOPIC SYLLABLE THI", "Lo", 0), ("ETHIOPIC SYLLABLE THAA", "Lo", 0), ("ETHIOPIC SYLLABLE THEE", "Lo", 0), ("ETHIOPIC SYLLABLE THE", "Lo", 0), ("ETHIOPIC SYLLABLE THO", "Lo", 0), ("ETHIOPIC SYLLABLE THWA", "Lo", 0), ("ETHIOPIC SYLLABLE CHA", "Lo", 0), ("ETHIOPIC SYLLABLE CHU", "Lo", 0), ("ETHIOPIC SYLLABLE CHI", "Lo", 0), ("ETHIOPIC SYLLABLE CHAA", "Lo", 0), ("ETHIOPIC SYLLABLE CHEE", "Lo", 0), ("ETHIOPIC SYLLABLE CHE", "Lo", 0), ("ETHIOPIC SYLLABLE CHO", "Lo", 0), ("ETHIOPIC SYLLABLE CHWA", "Lo", 0), ("ETHIOPIC SYLLABLE PHA", "Lo", 0), ("ETHIOPIC SYLLABLE PHU", "Lo", 0), ("ETHIOPIC SYLLABLE PHI", "Lo", 0), ("ETHIOPIC SYLLABLE PHAA", "Lo", 0), ("ETHIOPIC SYLLABLE PHEE", "Lo", 0), ("ETHIOPIC SYLLABLE PHE", "Lo", 0), ("ETHIOPIC SYLLABLE PHO", "Lo", 0), ("ETHIOPIC SYLLABLE PHWA", "Lo", 0), ("ETHIOPIC SYLLABLE TSA", "Lo", 0), ("ETHIOPIC SYLLABLE TSU", "Lo", 0), ("ETHIOPIC SYLLABLE TSI", "Lo", 0), ("ETHIOPIC SYLLABLE TSAA", "Lo", 0), ("ETHIOPIC SYLLABLE TSEE", "Lo", 0), ("ETHIOPIC SYLLABLE TSE", "Lo", 0), ("ETHIOPIC SYLLABLE TSO", "Lo", 0), ("ETHIOPIC SYLLABLE TSWA", "Lo", 0), ("ETHIOPIC SYLLABLE TZA", "Lo", 0), ("ETHIOPIC SYLLABLE TZU", "Lo", 0), ("ETHIOPIC SYLLABLE TZI", "Lo", 0), ("ETHIOPIC SYLLABLE TZAA", "Lo", 0), ("ETHIOPIC SYLLABLE TZEE", "Lo", 0), ("ETHIOPIC SYLLABLE TZE", "Lo", 0), ("ETHIOPIC SYLLABLE TZO", "Lo", 0), ("ETHIOPIC SYLLABLE TZOA", "Lo", 0), ("ETHIOPIC SYLLABLE FA", "Lo", 0), ("ETHIOPIC SYLLABLE FU", "Lo", 0), ("ETHIOPIC SYLLABLE FI", "Lo", 0), ("ETHIOPIC SYLLABLE FAA", "Lo", 0), ("ETHIOPIC SYLLABLE FEE", "Lo", 0), ("ETHIOPIC SYLLABLE FE", "Lo", 0), ("ETHIOPIC SYLLABLE FO", "Lo", 0), ("ETHIOPIC SYLLABLE FWA", "Lo", 0), ("ETHIOPIC SYLLABLE PA", "Lo", 0), ("ETHIOPIC SYLLABLE PU", "Lo", 0), ("ETHIOPIC SYLLABLE PI", "Lo", 0), ("ETHIOPIC SYLLABLE PAA", "Lo", 0), ("ETHIOPIC SYLLABLE PEE", "Lo", 0), ("ETHIOPIC SYLLABLE PE", "Lo", 0), ("ETHIOPIC SYLLABLE PO", "Lo", 0), ("ETHIOPIC SYLLABLE PWA", "Lo", 0), ("ETHIOPIC SYLLABLE RYA", "Lo", 0), ("ETHIOPIC SYLLABLE MYA", "Lo", 0), ("ETHIOPIC SYLLABLE FYA", "Lo", 0), (), (), ("ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK", "Mn", 230), ("ETHIOPIC COMBINING VOWEL LENGTH MARK", "Mn", 230), ("ETHIOPIC COMBINING GEMINATION MARK", "Mn", 230), ("ETHIOPIC SECTION MARK", "Po", 0), ("ETHIOPIC WORDSPACE", "Po", 0), ("ETHIOPIC FULL STOP", "Po", 0), ("ETHIOPIC COMMA", "Po", 0), ("ETHIOPIC SEMICOLON", "Po", 0), ("ETHIOPIC COLON", "Po", 0), ("ETHIOPIC PREFACE COLON", "Po", 0), ("ETHIOPIC QUESTION MARK", "Po", 0), ("ETHIOPIC PARAGRAPH SEPARATOR", "Po", 0), ("ETHIOPIC DIGIT ONE", "No", 0), ("ETHIOPIC DIGIT TWO", "No", 0), ("ETHIOPIC DIGIT THREE", "No", 0), ("ETHIOPIC DIGIT FOUR", "No", 0), ("ETHIOPIC DIGIT FIVE", "No", 0), ("ETHIOPIC DIGIT SIX", "No", 0), ("ETHIOPIC DIGIT SEVEN", "No", 0), ("ETHIOPIC DIGIT EIGHT", "No", 0), ("ETHIOPIC DIGIT NINE", "No", 0), ("ETHIOPIC NUMBER TEN", "No", 0), ("ETHIOPIC NUMBER TWENTY", "No", 0), ("ETHIOPIC NUMBER THIRTY", "No", 0), ("ETHIOPIC NUMBER FORTY", "No", 0), ("ETHIOPIC NUMBER FIFTY", "No", 0), ("ETHIOPIC NUMBER SIXTY", "No", 0), ("ETHIOPIC NUMBER SEVENTY", "No", 0), ("ETHIOPIC NUMBER EIGHTY", "No", 0), ("ETHIOPIC NUMBER NINETY", "No", 0), ("ETHIOPIC NUMBER HUNDRED", "No", 0), ("ETHIOPIC NUMBER TEN THOUSAND", "No", 0), )
https://github.com/danbalarin/vse-typst-template
https://raw.githubusercontent.com/danbalarin/vse-typst-template/main/lib/title-page.typ
typst
#let title-page( title: "Thesis Title", date: "January 2025", university: "Prague University of Economics and Business", faculty: "Faculty of Informatics and Statistics", study-program: "Study Program", specialization: "", author: "<NAME>", supervisor: "Ing. <NAME>", consultant: "", city: "Prague", ) = { set align(center) set block(spacing: .6em) text(20pt, university) v(4pt) text(20pt, faculty) block(above: 1fr, below: 2fr, width: 100%, [ #image("imgs/FIS_2_logo_2_rgb_EN.svg", width: 50%) ]) text(24pt, weight: "bold", title) v(8mm) text(24pt, "MASTER THESIS") v(8mm) grid( columns: (auto, auto), column-gutter: 10pt, row-gutter: 4mm, align(right, "Study program:"), align(left, study-program), if specialization.len() > 0 [#align(right, "Specialization:")], if specialization.len() > 0 [#align(left, specialization)], ) v(8fr) grid( columns: (auto, auto), column-gutter: 10pt, row-gutter: 4mm, align(right, "Author:"), align(left, author), align(right, "Supervisor:"), align(left, supervisor), if consultant.len() > 0 [#align(right, "Consultant:")], if consultant.len() > 0 [#align(left, consultant)], ) v(8mm) text([#city, #date]) pagebreak() }
https://github.com/RandomcodeDev/FalseKing-Design
https://raw.githubusercontent.com/RandomcodeDev/FalseKing-Design/main/game/intro.typ
typst
= Introduction False King is an adventure game where the player conquers five kingdoms each associated with a classical element (#text(orange)[fire], #text(teal)[air], #text(blue)[water], #text(green)[earth], and #text(purple)[aether]). #image("elements.jpg", width: 45%) == Inspiration The general layout of the world and some aspects of the gameplay are heavily inspired by Hyper Light Drifter. == Player experience The player will have the chance to explore, talk to NPCs, solve puzzles, and fight a variety of enemies using their elemental powers, which can be combined together to make even stronger effects. == Target audience The game will have multiple difficulty levels, to allow both casual and advanced players alike to enjoy the game as they choose. == Availability The game will be available wherever possible, and the price will be equivalent to 20 Canadian dollars, and in places where that's expensive (such as Brazil), it'll be cheaper so people are less likely to pirate it. == Translations Translations into French, Russian, and Polish are possible.
https://github.com/GartmannPit/Praxisprojekt-II
https://raw.githubusercontent.com/GartmannPit/Praxisprojekt-II/main/Praxisprojekt%20II/PVA-Templates-typst-pva-2.0/template/tablesList.typ
typst
#let createListofTables() = { set heading(numbering: none) par[= Tabellenverzeichnis] // change heading here for other languages outline(title: none, target: figure.where(kind: table)) }
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/design_concept/content/poc/options_compiler_decision.typ
typst
#import "../../../acronyms.typ": ac = Compiler Platform Decision Since VisualFP will rely heavily on the chosen platform, a platform change later down the road would be expensive. #ac("GHC") is the only still actively developed compiler platform out of the considered platforms. But after testing and research, the #ac("GHC") #ac("API") was deemed to complex, and not easy enough to integrate within the limited timeframe available for the #ac("PoC"). This is why VisualFP will implement a custom compiler platform. Given the low requirements, it could be considered an exaggeration to call such an implementation a compiler platform, which is why it'll be called an inference engine from now on.
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/math/fn-comma.typ
typst
Apache License 2.0
$ sin(x) $ $ sin(x,) $ $ sin(x,,,) $ $ mat(1,;,1) $ $ mat(1,;,;,1;1) $
https://github.com/kfijalkowski1/typst-diff-tool
https://raw.githubusercontent.com/kfijalkowski1/typst-diff-tool/main/README.md
markdown
# typst-diff-tool #### Authors: - <NAME> - <NAME> #### Instructor: - <NAME> #### Project Concept: CLI tool for comparing versions of Typst documents ### What is Typst A markup-based language for creating elegant documents. Similar to LaTeX but more user-friendly and interactively editable, it can be described in the following points: - Built-in tags for common formatting tasks - Flexible functions for everything else - A tightly integrated scripting system - Mathematical composition, bibliography management, and more - Fast compilation times due to incremental compilation - User-friendly error messages in case of problems ### Problem Description Unlike LaTeX, there is no tool for comparing generated files, which makes reviewing new versions of documentation challenging. ### Sub-problems and General Solutions - Parsing the .typ file into an AST and understanding how elements are aggregated - Converting the AST into JSON format using pandoc or Rust typst_ast - Comparing ASTs - finding a way to comfortably compare files - Displaying differences (potentially using libraries for comparing large text segments), parsing these differences back to the appropriate places in the AST - Creating a resultant .typ file. ### Planned Tools and Technologies - Extracting AST from a file using typst-syntax - C4 for illustrating the architecture - Rust - Linters and static code analysis - clippy ### Project structure ![c4.drawio.png](docs%2Fc4.drawio.png) ### Usefully links: [Typst](https://typst.app/) -- online editor [Typst github](https://github.com/typst/typst) -- Typst repo [Typst crates](https://crates.io/crates/typst-syntax) -- crates.io types syntax pack [Typst docs](https://typst.app/docs/reference/visualize/color/) -- docs (use of colors) [github content struct](https://github.com/typst/typst/blob/main/crates/typst/src/foundations/content.rs#L75) - content structure Typst [ast in json](https://esdiscuss.org/topic/ast-in-json-format) - AST in JSON [installing pandoc](https://pandoc.org/installing.htm) - in order to run proj install pandoc v. 3.1.13 [rust-docs](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) - how to create docs in rust ### Running project 0. Pre-requestions: - git - cargo - rust, how to install rust on linux: ``` bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` 1. Clone repository with typst-diff-tool ``` bash git clone https://github.com/kfijalkowski1/typst-diff-tool ``` 2. Enter typst-diff-tool ``` bash cd typst-diff-tool/typst_ast_parser ``` 3. Run typst-diff ``` bash cargo build --release ./target/release/typst_ast_parser <old_file.typ> <new_file.typ> ``` 4. This will create result.typ file as a result of diff tool ### Creating docs ```bash cargo doc ``` ### Running tests Enter repository directory and find directory with Cargo.toml in current scope (typst_ast_parser/). If repository has just been cloned then enter the repository and execute following command ``` bash cd typst_ast_parser && cargo test ``` ### Running linter As a linter we are using clippy, first use [instruction](https://github.com/rust-lang/rust-clippy) to install clippy In order to run: ``` bash cargo clippy ``` In order to apply clippy fixes: ```bash cargo clippy --fix ``` ### Running formatter In order to use formatter simply run rust fmt ```bash cargo fmt ``` ### How our algorithm works? Read about it in [this](docs/compareDocs.md) file
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/meta/link_04.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // // // Verify that opening brackets without closing brackets throw an error. // // Error: 1-22 automatic links cannot contain unbalanced brackets, use the `link` function instead // https://exam(ple.com/
https://github.com/kyanbasu/pwr-typst
https://raw.githubusercontent.com/kyanbasu/pwr-typst/main/polylux/README.md
markdown
MIT License
# pwr-typst Typst [Polylux](https://github.com/andreasKroepelin/polylux "Polylux github") PWr template # Requirements polylux (tested working with version 0.3.1) # Usage Example 1. ```typst #import "@preview/polylux:0.3.1": * #import "pwr.typ": * #let today = datetime.today() #let month = "styczeń" // default "[month repr:long]", it sadly doesn't support language localization yet https://typst.app/docs/reference/foundations/datetime #show: pwr-theme.with(author: "Jan", date: today.display("[day] month, [year]".replace("month", month)), lang: "en") // defaults: "pl" #title-slide(title: "Analiza pomiarów biometrycznych") #slide[ = Wprowadzenie Prezentacja przedstawia analize pomiarów biometrycznych 706 badanych oraz ich wyników w różnych dyscyplinach. ] ``` Preview: ![image1](example1_1.png) ![image1](example1_2.png)
https://github.com/eratio08/learn-typst
https://raw.githubusercontent.com/eratio08/learn-typst/main/conf.typ
typst
#let conf( title: none, authors: (), abstract: [], doc, ) = { set page( paper: "us-letter", header: align(right + horizon, title), numbering: "1", ) set par(justify: true) set text( font: "Linux Libertine", size: 11pt, ) show heading.where(level: 1): it => block(width: 100%)[ #set align(center) #set text(12pt, weight: "regular") #smallcaps(it.body) ] show heading.where(level: 2): it => text( size: 11pt, weight: "regular", style: "italic", it.body + [.], ) set align(center) text(17pt, title) let count = authors.len() let ncols = calc.min(count, 3) grid( columns: (1fr,)*ncols, row-gutter: 24pt, ..authors.map(author => [ #author.name\ #author.affiliation\ #link("mailto:" + author.email) ]), ) par(justify: false)[ *Abstract*\ #abstract ] set align(left) columns(2, doc) }
https://github.com/OrangeX4/typst-talk
https://raw.githubusercontent.com/OrangeX4/typst-talk/main/examples/poster.typ
typst
// 中文通用设置 #let skew(angle, vscale: 1, body) = { let (a, b, c, d) = (1, vscale * calc.tan(angle), 0, vscale) let E = (a + d) / 2 let F = (a - d) / 2 let G = (b + c) / 2 let H = (c - b) / 2 let Q = calc.sqrt(E * E + H * H) let R = calc.sqrt(F * F + G * G) let sx = Q + R let sy = Q - R let a1 = calc.atan2(F, G) let a2 = calc.atan2(E, H) let theta = (a2 - a1) / 2 let phi = (a2 + a1) / 2 set rotate(origin: bottom + center) set scale(origin: bottom + center) rotate(phi, scale(x: sx * 100%, y: sy * 100%, rotate(theta, body))) } #let fake-italic(body) = skew(-12deg, body) #show emph: it => box(fake-italic(it)) #set text(font: ("IBM Plex Serif", "Source Han Serif SC"), lang: "zh", region: "cn") #set underline(offset: .2em) #show raw.where(block: true): block.with( width: 100%, fill: luma(240), inset: 5pt, radius: 4pt, ) // 简单海报设置 #set page(width: 20em, height: auto) #show heading.where(level: 1): set align(center) #show "Typst": set text(fill: blue, weight: "bold") #show "LaTeX": set text(fill: red, weight: "bold") #show "Markdown": set text(fill: purple, weight: "bold") = Typst 讲座 Typst 是为 *学术写作* 而生的基于 _标记_ 的排版系统。 Typst = LaTeX 的排版能力 + Markdown 的简洁语法 + 现代的脚本语言 #underline[本讲座]包括以下内容: + 快速入门 Typst + Typst 编写各类模板 - 笔记、论文、简历和 Slides + Typst 高级特性 - 脚本、样式和包管理 + Typst 周边生态开发体验 - Pinit、MiTeX、Touying 和 VS Code 插件 ```py print('Hello Typst!') ```
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/meppp/0.1.0/README.md
markdown
Apache License 2.0
# meppp A simple template for modern physics experiments (MPE) courses at the Physics School of PKU. ## meppp-lab-report The recommended report format of MPE course. Default arguments are shown as below: ```typ #import "@preview/meppp:0.1.0": * #let meppp-lab-report( title: "", author: "", info: [], abstract: [], keywords: (), author-footnote: [], heading-numbering-array: ("I","A","1","a"), heading-suffix: ". ", doc )=... ``` - `title` is the title of the report. - `author` is the name of the author. - `info` is a line (or lines) of brief information of author and the report (e.g. student ID, school, experiment date...) - `abstract` is the abstract of the report, not shown when it is empty. - `keywords` are keywords of the report, only shown when the abstract is shown. - `author-footnote` is the phone number or the e-mail of the author, shown in the footnote. - `heading-numbering-array` is the heading numbering of each level. Only shows the numbering of the deepest level. - `heading-suffix` is the suffix of headings It is recommended to use `#show` to use the template: ```typ #show: doc=>meppp-lab-report( ..args, doc ) ...your report below. ``` ## meppp-tl-table Modify your input `table` to a three-lined table (AIP style), returned as a `figure`. Double-lines above and below the table, and a single line below the header. ```typ #let meppp-tl-table( caption: none, supplement: auto, stroke:0.5pt, tbl )=... ``` - `caption` is the caption above the table, center-aligned - `supplement` is same as the supplement in the figure. - `stroke` is the stroke used in the three lines (maybe five lines). - `tbl` is the input table, which must contains a `table.header` Example: ```typ #meppp-tl-table( table( columns:4, rows:2, table.header([Item1],[Item2],[Item3],[Item4]), [Data1],[Data2],[Data3],[Data4], ) ) ``` ## pku-logo The logo of PKU, returned as a `image` ```typ #let pku-logo(..args) = image("pkulogo.png",..args) ``` Example: ``` #pku-logo(width:50%) #pku-logo() ```
https://github.com/drbartling/obsidian-to-typst
https://raw.githubusercontent.com/drbartling/obsidian-to-typst/master/examples/feature_guide/Widget.md
markdown
# Widget ## Section #1 ### SubSection #### SubSubSection ##### Paragraph ###### SubParagraph Lorem ipsum *dolor* sit _amet_. consectetur adipiscing elit. Duis sed nunc et dolor aliquam ultricies. Proin vitae urna mollis, viverra nibh quis, sollicitudin ipsum. Duis tempus molestie erat, eu placerat felis ullamcorper vel. Proin congue risus id congue aliquam. Praesent ac condimentum leo. In interdum augue eget malesuada euismod. Morbi sodales volutpat massa, quis tempus tortor blandit ac. Curabitur aliquet tortor ac lectus luctus lacinia sed sit amet eros. Fusce metus libero, convallis at feugiat tempus, vehicula id mi. Fusce semper magna quis tellus iaculis ornare. Nam gravida est quis mauris porta semper. Suspendisse imperdiet massa sed mattis egestas. Sed hendrerit, tellus eget posuere placerat, leo sapien imperdiet turpis, sit amet rhoncus turpis felis interdum ligula. Curabitur luctus purus erat, nec ultricies nunc dignissim in. ```mermaid graph widget --> lw[left widgeting] widget --> rw[right widgeting] ``` - This is a list - with 2_items - with 2_items ![[Widgeting]] ```typst #import "@preview/cetz:0.1.2" #cetz.canvas({ import cetz.draw: * let chart(..values, name: none) = { let values = values.pos() let offset = 0 let total = values.fold(0, (s, v) => s + v.at(0)) let segment(from, to) = { merge-path(close: true, { line((0, 0), (rel: (360deg * from, 1))) arc((), start: from * 360deg, stop: to * 360deg, radius: 1) }) } group(name: name, { stroke((paint: black, join: "round")) let i = 0 for v in values { fill(v.at(1)) let value = v.at(0) / total // Draw the segment segment(offset, offset + value) // Place an anchor for each segment anchor(v.at(2), (offset * 360deg + value * 180deg, .75)) offset += value } }) } // Draw the chart chart((10, red, "red"), (3, blue, "blue"), (1, green, "green"), name: "chart") set-style(mark: (fill: white, start: "o", stroke: black), content: (padding: .1)) // Draw annotations line("chart.red", ((), "-|", (2, 0))) content((), [Red], anchor: "left") line("chart.blue", (1, -1), ((), "-|", (2,0))) content((), [Blue], anchor: "left") line("chart.green", ((), "-|", (2,0))) content((), [Green], anchor: "left") }) ```
https://github.com/denkspuren/typst_programming
https://raw.githubusercontent.com/denkspuren/typst_programming/main/wrapText/README.md
markdown
# `wrapText` Bedauerlicherweise musste ich auf Discord erfahren, dass das Wrapping von Text um eine Textbox momentan in Typst nicht wirklich möglich ist. https://discord.com/channels/1054443721975922748/1171205428760285275/1171205428760285275 Ich habe diesen Effekt nach zwei Tagen der Suche nach einem geeigneten Paket und einigen Experimenten mit `wrapstuff` und `tcolorbox` realisieren können: ![](wrapTextExample.png) Die Frage ist, ob man feinere Layout-Kontrolle in Typst über primitive Funktionen bekommen könnte. Ich weiß nicht, ob das Konzept der Galleys von Lout (das Typesetting-System von Jeff Kingston) leistungsfähig genug wäre, um als Grundlage für solche Wrapping-Lösungen zu dienen. Zum Galley-Konzept liegt ein Artikel von [Kahl (1999)](Kahl-1999a.pdf) bei. Das GitHub-Issue, dem ich dazu folgen solle, ist [Typst-Issue 533](https://github.com/typst/typst/issues/553). Meinen Fall stelle ich an [dieser Stelle](https://github.com/typst/typst/issues/553#issuecomment-1798066424) dort ebenso vor. Mittlerweile (26.1.2024) ist eine Implementierung umgesetzt worden ([Pull Request #357](https://github.com/typst/packages/pull/357)), die die Wrapping-Funktionalität zum Teil umsetzt: https://github.com/ntjess/wrap-it
https://github.com/munzirtaha/typst-cv
https://raw.githubusercontent.com/munzirtaha/typst-cv/main/cv.typ
typst
MIT License
#import "lib.typ": * #set text(10pt, font: ("Libertinus Serif", "Noto Color Emoji", "Symbols Nerd Font")) #set page( paper: "a4", margin: (x: 1.4cm, y: 1.5cm), footer: [ #text( size: 8pt, secondary-color, smallcaps(datetime.today().display("[month repr:long] [day], [year]")) + h(1fr) + context counter(page).display() ) ], ) #header( name: [*Munzir* Taha], title: "Senior System Engineer · IT Consultant", mobile: "+90 123 456 78 90", email: "<EMAIL>", github: "https://github.com/munzirtaha", linkedin: "https://linkedin.com/in/munzirtaha", photo: "assets/photo.jpg", ) #section("Education") #entry( logo: image("assets/logos/uofk.jpg"), title: [University of Khartoum], entity: [B.Sc. (Honours) in Electrical Engineering], location: [Sudan], date: [1993 - 1998], details: list([*Thesis:* Implementing a digital filter using Borland C++Builder]), tags: ( "Solid State Devices", "Control Systems", "Electronics & Computing", "Microprocessors", ), ) #section("Professional Experience") #entry( logo: image("assets/logos/dolphin.svg"), title: [Co-founder & CTO], entity: [Dolphin ICT], location: [Riyadh, SA], date: [Jan 2014 - Sep 2021], details: list( [Increased productivity by 200% (in my dreams)], [Proficient in looking focused while browsing social media], [Advanced skills in creating unnecessarily complex spreadsheets], [Unparalleled ability to stretch 5-minute tasks into hour-long endeavors], ), tags: ("Cybersecurity", "Cloud Computing", "Ethical Hacking", "Sysadmin"), ) #section("Projects & Associations") #entry( logo: [], title: [Packager], entity: [Arch Linux], date: [2003 - Present], details: list( [*sos:* (https://aur.archlinux.org/packages/sos)], [*chessx:* (https://aur.archlinux.org/packages/chessx)], [*Amiri Font:* (https://aur.archlinux.org/packages/ttf-amiri)], [*hunspell-ar:* (https://aur.archlinux.org/packages/hunspell-ar)], [*ttf-scheherazade-new:* (https://archlinux.org/packages/extra/any/ttf-scheherazade-new)], [*King Fahd Glorious Quran Printing Complex fonts:* (https://aur.archlinux.org/packages/ttf-qurancomplex-fonts)], ), ) #section("Honors & Awards") #honor( date: [Feb 2006], logo: [🏅], title: [Certificate of Appreciation], issuer: [ALKHALEEJ TRAINING & EDUCATION, Riyadh], ) #honor( date: [Jan 2004], logo: image("assets/logos/Mandriva.svg"), title: [Mandrake Club member], issuer: [MandrakeSoft (later Mandriva S.A.)], ) #honor( date: [Jan 2003], logo: [🥇], title: [Instructor of the Year], issuer: [New Horizons, Riyadh], ) #section("Certifications") #honor( date: [Aug 2014], logo: image("assets/logos/Linux_Foundation.svg"), title: [LFS101x: Introduction to Linux], issuer: [The Linux Foundation, *Score:* 100%], ) #honor( date: [Jan 2013], logo: [], title: [SUSE Certified Linux Professional], issuer: [SUSE], ) #honor( date: [Mar 2012], logo: [], title: [Red Hat Certified Engineer (RHCE)], issuer: [Red Hat, *Score:* 300], ) #section("Skills") #skill( type: [ OS], info: [Linux | HP-UX | Solaris | AIX], ) #skill( type: [⌨ Coding], info: [C++ | Python | PHP/MySQL/PostgreSQL | HTML/CSS | Typst], ) #skill( type: [📀 Software], info: [podman | LibreOffice | MS Office | Lotus Notes | Scribus | GnuCash | GIMP | Inkscape], ) #skill( type: [🖥 Hardware], info: [Intel/AMD | Raspberry Pi | Performa 6360 | PA-RISC | RS/6000 | SPARC], ) #skill( type: [ Languages], info: [Arabic (Native) | English (Fluent) | Turkish (Intermediate)], ) #skill( type: [🏃Hobbies], info: [🏊 Swimming | 🏇 Horse Riding | 🏓 Table Tennis | ♟ Chess], )
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-1CC00.typ
typst
Apache License 2.0
#let data = ( ("UP-POINTING GO-KART", "So", 0), ("RIGHT-POINTING GO-KART", "So", 0), ("LEFT-POINTING STICK FIGURE", "So", 0), ("RIGHT-POINTING STICK FIGURE", "So", 0), ("DOWN-POINTING STICK FIGURE", "So", 0), ("LOWER HORIZONTAL RULER SEGMENT", "So", 0), ("RIGHT VERTICAL RULER SEGMENT", "So", 0), ("LOWER RIGHT RULER SEGMENT", "So", 0), ("ANTENNA", "So", 0), ("HORIZONTAL RESISTOR SEGMENT", "So", 0), ("VERTICAL RESISTOR SEGMENT", "So", 0), ("LEFT THIRD INDUCTOR", "So", 0), ("MIDDLE THIRD INDUCTOR", "So", 0), ("RIGHT THIRD INDUCTOR", "So", 0), ("LEFT-POINTING DIODE", "So", 0), ("RIGHT-POINTING DIODE", "So", 0), ("NPN TRANSISTOR", "So", 0), ("PNP TRANSISTOR", "So", 0), ("RECEPTACLE", "So", 0), ("HORIZONTAL CAPACITOR", "So", 0), ("VERTICAL CAPACITOR", "So", 0), ("LOGIC GATE OR", "So", 0), ("LOGIC GATE AND", "So", 0), ("LOGIC GATE INVERTED INPUTS", "So", 0), ("LOGIC GATE INVERTED OUTPUT", "So", 0), ("LOGIC GATE BUFFER", "So", 0), ("LOGIC GATE BUFFER WITH INVERTED INPUT", "So", 0), ("BOX DRAWINGS LIGHT HORIZONTAL AND UPPER RIGHT", "So", 0), ("BOX DRAWINGS LIGHT HORIZONTAL AND LOWER RIGHT", "So", 0), ("BOX DRAWINGS LIGHT TOP AND UPPER LEFT", "So", 0), ("BOX DRAWINGS LIGHT BOTTOM AND LOWER LEFT", "So", 0), ("BOX DRAWINGS DOUBLE DIAGONAL UPPER RIGHT TO LOWER LEFT", "So", 0), ("BOX DRAWINGS DOUBLE DIAGONAL UPPER LEFT TO LOWER RIGHT", "So", 0), ("SEPARATED BLOCK QUADRANT-1", "So", 0), ("SEPARATED BLOCK QUADRANT-2", "So", 0), ("SEPARATED BLOCK QUADRANT-12", "So", 0), ("SEPARATED BLOCK QUADRANT-3", "So", 0), ("SEPARATED BLOCK QUADRANT-13", "So", 0), ("SEPARATED BLOCK QUADRANT-23", "So", 0), ("SEPARATED BLOCK QUADRANT-123", "So", 0), ("SEPARATED BLOCK QUADRANT-4", "So", 0), ("SEPARATED BLOCK QUADRANT-14", "So", 0), ("SEPARATED BLOCK QUADRANT-24", "So", 0), ("SEPARATED BLOCK QUADRANT-124", "So", 0), ("SEPARATED BLOCK QUADRANT-34", "So", 0), ("SEPARATED BLOCK QUADRANT-134", "So", 0), ("SEPARATED BLOCK QUADRANT-234", "So", 0), ("SEPARATED BLOCK QUADRANT-1234", "So", 0), ("UPPER LEFT TWELFTH CIRCLE", "So", 0), ("UPPER CENTRE LEFT TWELFTH CIRCLE", "So", 0), ("UPPER CENTRE RIGHT TWELFTH CIRCLE", "So", 0), ("UPPER RIGHT TWELFTH CIRCLE", "So", 0), ("UPPER MIDDLE LEFT TWELFTH CIRCLE", "So", 0), ("UPPER LEFT QUARTER CIRCLE", "So", 0), ("UPPER RIGHT QUARTER CIRCLE", "So", 0), ("UPPER MIDDLE RIGHT TWELFTH CIRCLE", "So", 0), ("LOWER MIDDLE LEFT TWELFTH CIRCLE", "So", 0), ("LOWER LEFT QUARTER CIRCLE", "So", 0), ("LOWER RIGHT QUARTER CIRCLE", "So", 0), ("LOWER MIDDLE RIGHT TWELFTH CIRCLE", "So", 0), ("LOWER LEFT TWELFTH CIRCLE", "So", 0), ("LOWER CENTRE LEFT TWELFTH CIRCLE", "So", 0), ("LOWER CENTRE RIGHT TWELFTH CIRCLE", "So", 0), ("LOWER RIGHT TWELFTH CIRCLE", "So", 0), ("SPARSE HORIZONTAL FILL", "So", 0), ("SPARSE VERTICAL FILL", "So", 0), ("ORTHOGONAL CROSSHATCH FILL", "So", 0), ("DIAGONAL CROSSHATCH FILL", "So", 0), ("DENSE VERTICAL FILL", "So", 0), ("DENSE HORIZONTAL FILL", "So", 0), ("SPECKLE FILL FRAME-1", "So", 0), ("SPECKLE FILL FRAME-2", "So", 0), ("LEFT-FACING BASSINET", "So", 0), ("RIGHT-FACING BASSINET", "So", 0), ("FLYING SAUCER WITH BEAMS", "So", 0), ("FLYING SAUCER WITHOUT BEAMS", "So", 0), ("ALIEN MONSTER OPEN JAWS", "So", 0), ("ALIEN MONSTER CLOSED JAWS", "So", 0), ("ALIEN SQUID OPEN TENTACLES", "So", 0), ("ALIEN SQUID CLOSED TENTACLES", "So", 0), ("ALIEN CRAB STEPPING RIGHT", "So", 0), ("ALIEN CRAB STEPPING LEFT", "So", 0), ("ALIEN SPIDER CROUCHING", "So", 0), ("ALIEN SPIDER SPREAD", "So", 0), ("ALIEN MONSTER STEP-1", "So", 0), ("ALIEN MONSTER STEP-2", "So", 0), ("LEFT-POINTING ROCKET SHIP", "So", 0), ("UP-POINTING ROCKET SHIP", "So", 0), ("RIGHT-POINTING ROCKET SHIP", "So", 0), ("DOWN-POINTING ROCKET SHIP", "So", 0), ("TOP HALF LEFT-FACING ROBOT", "So", 0), ("TOP HALF FORWARD-FACING ROBOT", "So", 0), ("TOP HALF RIGHT-FACING ROBOT", "So", 0), ("BOTTOM HALF LEFT-FACING ROBOT", "So", 0), ("BOTTOM HALF FORWARD-FACING ROBOT", "So", 0), ("BOTTOM HALF RIGHT-FACING ROBOT", "So", 0), ("LEFT-POINTING ATOMIC BOMB", "So", 0), ("UP-POINTING ATOMIC BOMB", "So", 0), ("RIGHT-POINTING ATOMIC BOMB", "So", 0), ("DOWN-POINTING ATOMIC BOMB", "So", 0), ("MUSHROOM CLOUD", "So", 0), ("LEFT-POINTING RIFLE", "So", 0), ("UP-POINTING RIFLE", "So", 0), ("RIGHT-POINTING RIFLE", "So", 0), ("DOWN-POINTING RIFLE", "So", 0), ("EIGHT RAYS INWARD", "So", 0), ("EIGHT RAYS OUTWARD", "So", 0), ("BLACK LARGE CIRCLE MINUS LEFT QUARTER SECTION", "So", 0), ("BLACK LARGE CIRCLE MINUS UPPER QUARTER SECTION", "So", 0), ("BLACK LARGE CIRCLE MINUS RIGHT QUARTER SECTION", "So", 0), ("BLACK LARGE CIRCLE MINUS LOWER QUARTER SECTION", "So", 0), ("BLACK NEUTRAL FACE", "So", 0), ("LEFT-FACING SNAKE HEAD WITH OPEN MOUTH", "So", 0), ("UP-FACING SNAKE HEAD WITH OPEN MOUTH", "So", 0), ("RIGHT-FACING SNAKE HEAD WITH OPEN MOUTH", "So", 0), ("DOWN-FACING SNAKE HEAD WITH OPEN MOUTH", "So", 0), ("LEFT-FACING SNAKE HEAD WITH CLOSED MOUTH", "So", 0), ("UP-FACING SNAKE HEAD WITH CLOSED MOUTH", "So", 0), ("RIGHT-FACING SNAKE HEAD WITH CLOSED MOUTH", "So", 0), ("DOWN-FACING SNAKE HEAD WITH CLOSED MOUTH", "So", 0), ("LEFT-POINTING ENERGY WAVE", "So", 0), ("UP-POINTING ENERGY WAVE", "So", 0), ("RIGHT-POINTING ENERGY WAVE", "So", 0), ("DOWN-POINTING ENERGY WAVE", "So", 0), ("SQUARE SPIRAL FROM TOP LEFT", "So", 0), ("SQUARE SPIRAL FROM TOP RIGHT", "So", 0), ("SQUARE SPIRAL FROM BOTTOM RIGHT", "So", 0), ("SQUARE SPIRAL FROM BOTTOM LEFT", "So", 0), ("STRIPED LEFT-POINTING TRIANGLE", "So", 0), ("STRIPED UP-POINTING TRIANGLE", "So", 0), ("STRIPED RIGHT-POINTING TRIANGLE", "So", 0), ("STRIPED DOWN-POINTING TRIANGLE", "So", 0), ("VERTICAL LADDER", "So", 0), ("HORIZONTAL LADDER", "So", 0), ("WHITE LOWER LEFT POINTER", "So", 0), ("WHITE LOWER RIGHT POINTER", "So", 0), ("TWO RINGS ALIGNED HORIZONTALLY", "So", 0), ("SQUARE FOUR CORNER SALTIRES", "So", 0), ("SQUARE FOUR CORNER DIAGONALS", "So", 0), ("SQUARE FOUR CORNER BLACK TRIANGLES", "So", 0), ("SQUARE APERTURE", "So", 0), ("INVERSE BLACK DIAMOND", "So", 0), ("LEFT AND UPPER ONE EIGHTH BLOCK CONTAINING BLACK SMALL SQUARE", "So", 0), ("INVERSE BLACK SMALL SQUARE", "So", 0), ("VERTICAL LINE WITH FOUR TICK MARKS", "So", 0), ("HORIZONTAL LINE WITH FOUR TICK MARKS", "So", 0), ("LEFT-FACING FISH", "So", 0), ("RIGHT-FACING FISH", "So", 0), ("LEFT-FACING FISH WITH OPEN MOUTH", "So", 0), ("RIGHT-FACING FISH WITH OPEN MOUTH", "So", 0), ("FLAPPING BIRD", "So", 0), ("LEFT-POINTING RACING CAR", "So", 0), ("UP-POINTING RACING CAR", "So", 0), ("RIGHT-POINTING RACING CAR", "So", 0), ("DOWN-POINTING RACING CAR", "So", 0), ("HORIZONTAL RACING CAR", "So", 0), ("VERTICAL RACING CAR", "So", 0), ("VERTICAL GO-KART", "So", 0), ("LEFT-POINTING TANK", "So", 0), ("RIGHT-POINTING TANK", "So", 0), ("LEFT-POINTING ROCKET BOOSTER", "So", 0), ("RIGHT-POINTING ROCKET BOOSTER", "So", 0), ("LEFT-POINTING ROLLER COASTER CAR", "So", 0), ("RIGHT-POINTING ROLLER COASTER CAR", "So", 0), ("LEFT HALF FLYING SAUCER", "So", 0), ("RIGHT HALF FLYING SAUCER", "So", 0), ("UPPER LEFT QUADRANT FACE WITH OPEN EYES", "So", 0), ("UPPER RIGHT QUADRANT FACE WITH OPEN EYES", "So", 0), ("UPPER LEFT QUADRANT FACE WITH CLOSED EYES", "So", 0), ("UPPER RIGHT QUADRANT FACE WITH CLOSED EYES", "So", 0), ("LOWER LEFT QUADRANT SMILING FACE", "So", 0), ("LOWER RIGHT QUADRANT SMILING FACE", "So", 0), ("LOWER LEFT QUADRANT NEUTRAL FACE", "So", 0), ("LOWER RIGHT QUADRANT NEUTRAL FACE", "So", 0), ("LOWER LEFT QUADRANT FACE WITH OPEN MOUTH", "So", 0), ("LOWER RIGHT QUADRANT FACE WITH OPEN MOUTH", "So", 0), ("LOWER LEFT QUADRANT FROWNING FACE", "So", 0), ("LOWER RIGHT QUADRANT FROWNING FACE", "So", 0), ("UPPER LEFT QUADRANT TELEVISION", "So", 0), ("UPPER RIGHT QUADRANT TELEVISION", "So", 0), ("LOWER LEFT QUADRANT TELEVISION", "So", 0), ("LOWER RIGHT QUADRANT TELEVISION", "So", 0), ("UPPER LEFT QUADRANT MICROCOMPUTER", "So", 0), ("UPPER RIGHT QUADRANT MICROCOMPUTER", "So", 0), ("LOWER LEFT QUADRANT MICROCOMPUTER", "So", 0), ("LOWER RIGHT QUADRANT MICROCOMPUTER", "So", 0), ("UPPER LEFT QUADRANT CHESS KING", "So", 0), ("UPPER RIGHT QUADRANT CHESS KING", "So", 0), ("LOWER LEFT QUADRANT CHESS KING", "So", 0), ("LOWER RIGHT QUADRANT CHESS KING", "So", 0), ("UPPER LEFT QUADRANT CHESS QUEEN", "So", 0), ("UPPER RIGHT QUADRANT CHESS QUEEN", "So", 0), ("LOWER LEFT QUADRANT CHESS QUEEN", "So", 0), ("LOWER RIGHT QUADRANT CHESS QUEEN", "So", 0), ("UPPER LEFT QUADRANT CHESS ROOK", "So", 0), ("UPPER RIGHT QUADRANT CHESS ROOK", "So", 0), ("LOWER LEFT QUADRANT CHESS ROOK", "So", 0), ("LOWER RIGHT QUADRANT CHESS ROOK", "So", 0), ("UPPER LEFT QUADRANT CHESS BISHOP", "So", 0), ("UPPER RIGHT QUADRANT CHESS BISHOP", "So", 0), ("LOWER LEFT QUADRANT CHESS BISHOP", "So", 0), ("LOWER RIGHT QUADRANT CHESS BISHOP", "So", 0), ("UPPER LEFT QUADRANT CHESS KNIGHT", "So", 0), ("UPPER RIGHT QUADRANT CHESS KNIGHT", "So", 0), ("LOWER LEFT QUADRANT CHESS KNIGHT", "So", 0), ("LOWER RIGHT QUADRANT CHESS KNIGHT", "So", 0), ("UPPER LEFT QUADRANT CHESS PAWN", "So", 0), ("UPPER RIGHT QUADRANT CHESS PAWN", "So", 0), ("LOWER LEFT QUADRANT CHESS PAWN", "So", 0), ("LOWER RIGHT QUADRANT CHESS PAWN", "So", 0), ("UPPER LEFT QUADRANT STANDING KNIGHT", "So", 0), ("UPPER RIGHT QUADRANT STANDING KNIGHT", "So", 0), ("LOWER LEFT QUADRANT STANDING KNIGHT", "So", 0), ("LOWER RIGHT QUADRANT STANDING KNIGHT", "So", 0), ("OUTLINED LATIN CAPITAL LETTER A", "So", 0), ("OUTLINED LATIN CAPITAL LETTER B", "So", 0), ("OUTLINED LATIN CAPITAL LETTER C", "So", 0), ("OUTLINED LATIN CAPITAL LETTER D", "So", 0), ("OUTLINED LATIN CAPITAL LETTER E", "So", 0), ("OUTLINED LATIN CAPITAL LETTER F", "So", 0), ("OUTLINED LATIN CAPITAL LETTER G", "So", 0), ("OUTLINED LATIN CAPITAL LETTER H", "So", 0), ("OUTLINED LATIN CAPITAL LETTER I", "So", 0), ("OUTLINED LATIN CAPITAL LETTER J", "So", 0), ("OUTLINED LATIN CAPITAL LETTER K", "So", 0), ("OUTLINED LATIN CAPITAL LETTER L", "So", 0), ("OUTLINED LATIN CAPITAL LETTER M", "So", 0), ("OUTLINED LATIN CAPITAL LETTER N", "So", 0), ("OUTLINED LATIN CAPITAL LETTER O", "So", 0), ("OUTLINED LATIN CAPITAL LETTER P", "So", 0), ("OUTLINED LATIN CAPITAL LETTER Q", "So", 0), ("OUTLINED LATIN CAPITAL LETTER R", "So", 0), ("OUTLINED LATIN CAPITAL LETTER S", "So", 0), ("OUTLINED LATIN CAPITAL LETTER T", "So", 0), ("OUTLINED LATIN CAPITAL LETTER U", "So", 0), ("OUTLINED LATIN CAPITAL LETTER V", "So", 0), ("OUTLINED LATIN CAPITAL LETTER W", "So", 0), ("OUTLINED LATIN CAPITAL LETTER X", "So", 0), ("OUTLINED LATIN CAPITAL LETTER Y", "So", 0), ("OUTLINED LATIN CAPITAL LETTER Z", "So", 0), ("OUTLINED DIGIT ZERO", "Nd", 0), ("OUTLINED DIGIT ONE", "Nd", 0), ("OUTLINED DIGIT TWO", "Nd", 0), ("OUTLINED DIGIT THREE", "Nd", 0), ("OUTLINED DIGIT FOUR", "Nd", 0), ("OUTLINED DIGIT FIVE", "Nd", 0), ("OUTLINED DIGIT SIX", "Nd", 0), ("OUTLINED DIGIT SEVEN", "Nd", 0), ("OUTLINED DIGIT EIGHT", "Nd", 0), ("OUTLINED DIGIT NINE", "Nd", 0), (), (), (), (), (), (), ("BLOCK OCTANT-3", "So", 0), ("BLOCK OCTANT-23", "So", 0), ("BLOCK OCTANT-123", "So", 0), ("BLOCK OCTANT-4", "So", 0), ("BLOCK OCTANT-14", "So", 0), ("BLOCK OCTANT-124", "So", 0), ("BLOCK OCTANT-34", "So", 0), ("BLOCK OCTANT-134", "So", 0), ("BLOCK OCTANT-234", "So", 0), ("BLOCK OCTANT-5", "So", 0), ("BLOCK OCTANT-15", "So", 0), ("BLOCK OCTANT-25", "So", 0), ("BLOCK OCTANT-125", "So", 0), ("BLOCK OCTANT-135", "So", 0), ("BLOCK OCTANT-235", "So", 0), ("BLOCK OCTANT-1235", "So", 0), ("BLOCK OCTANT-45", "So", 0), ("BLOCK OCTANT-145", "So", 0), ("BLOCK OCTANT-245", "So", 0), ("BLOCK OCTANT-1245", "So", 0), ("BLOCK OCTANT-345", "So", 0), ("BLOCK OCTANT-1345", "So", 0), ("BLOCK OCTANT-2345", "So", 0), ("BLOCK OCTANT-12345", "So", 0), ("BLOCK OCTANT-6", "So", 0), ("BLOCK OCTANT-16", "So", 0), ("BLOCK OCTANT-26", "So", 0), ("BLOCK OCTANT-126", "So", 0), ("BLOCK OCTANT-36", "So", 0), ("BLOCK OCTANT-136", "So", 0), ("BLOCK OCTANT-236", "So", 0), ("BLOCK OCTANT-1236", "So", 0), ("BLOCK OCTANT-146", "So", 0), ("BLOCK OCTANT-246", "So", 0), ("BLOCK OCTANT-1246", "So", 0), ("BLOCK OCTANT-346", "So", 0), ("BLOCK OCTANT-1346", "So", 0), ("BLOCK OCTANT-2346", "So", 0), ("BLOCK OCTANT-12346", "So", 0), ("BLOCK OCTANT-56", "So", 0), ("BLOCK OCTANT-156", "So", 0), ("BLOCK OCTANT-256", "So", 0), ("BLOCK OCTANT-1256", "So", 0), ("BLOCK OCTANT-356", "So", 0), ("BLOCK OCTANT-1356", "So", 0), ("BLOCK OCTANT-2356", "So", 0), ("BLOCK OCTANT-12356", "So", 0), ("BLOCK OCTANT-456", "So", 0), ("BLOCK OCTANT-1456", "So", 0), ("BLOCK OCTANT-2456", "So", 0), ("BLOCK OCTANT-12456", "So", 0), ("BLOCK OCTANT-3456", "So", 0), ("BLOCK OCTANT-13456", "So", 0), ("BLOCK OCTANT-23456", "So", 0), ("BLOCK OCTANT-17", "So", 0), ("BLOCK OCTANT-27", "So", 0), ("BLOCK OCTANT-127", "So", 0), ("BLOCK OCTANT-37", "So", 0), ("BLOCK OCTANT-137", "So", 0), ("BLOCK OCTANT-237", "So", 0), ("BLOCK OCTANT-1237", "So", 0), ("BLOCK OCTANT-47", "So", 0), ("BLOCK OCTANT-147", "So", 0), ("BLOCK OCTANT-247", "So", 0), ("BLOCK OCTANT-1247", "So", 0), ("BLOCK OCTANT-347", "So", 0), ("BLOCK OCTANT-1347", "So", 0), ("BLOCK OCTANT-2347", "So", 0), ("BLOCK OCTANT-12347", "So", 0), ("BLOCK OCTANT-157", "So", 0), ("BLOCK OCTANT-257", "So", 0), ("BLOCK OCTANT-1257", "So", 0), ("BLOCK OCTANT-357", "So", 0), ("BLOCK OCTANT-2357", "So", 0), ("BLOCK OCTANT-12357", "So", 0), ("BLOCK OCTANT-457", "So", 0), ("BLOCK OCTANT-1457", "So", 0), ("BLOCK OCTANT-12457", "So", 0), ("BLOCK OCTANT-3457", "So", 0), ("BLOCK OCTANT-13457", "So", 0), ("BLOCK OCTANT-23457", "So", 0), ("BLOCK OCTANT-67", "So", 0), ("BLOCK OCTANT-167", "So", 0), ("BLOCK OCTANT-267", "So", 0), ("BLOCK OCTANT-1267", "So", 0), ("BLOCK OCTANT-367", "So", 0), ("BLOCK OCTANT-1367", "So", 0), ("BLOCK OCTANT-2367", "So", 0), ("BLOCK OCTANT-12367", "So", 0), ("BLOCK OCTANT-467", "So", 0), ("BLOCK OCTANT-1467", "So", 0), ("BLOCK OCTANT-2467", "So", 0), ("BLOCK OCTANT-12467", "So", 0), ("BLOCK OCTANT-3467", "So", 0), ("BLOCK OCTANT-13467", "So", 0), ("BLOCK OCTANT-23467", "So", 0), ("BLOCK OCTANT-123467", "So", 0), ("BLOCK OCTANT-567", "So", 0), ("BLOCK OCTANT-1567", "So", 0), ("BLOCK OCTANT-2567", "So", 0), ("BLOCK OCTANT-12567", "So", 0), ("BLOCK OCTANT-3567", "So", 0), ("BLOCK OCTANT-13567", "So", 0), ("BLOCK OCTANT-23567", "So", 0), ("BLOCK OCTANT-123567", "So", 0), ("BLOCK OCTANT-4567", "So", 0), ("BLOCK OCTANT-14567", "So", 0), ("BLOCK OCTANT-24567", "So", 0), ("BLOCK OCTANT-124567", "So", 0), ("BLOCK OCTANT-34567", "So", 0), ("BLOCK OCTANT-134567", "So", 0), ("BLOCK OCTANT-234567", "So", 0), ("BLOCK OCTANT-1234567", "So", 0), ("BLOCK OCTANT-18", "So", 0), ("BLOCK OCTANT-28", "So", 0), ("BLOCK OCTANT-128", "So", 0), ("BLOCK OCTANT-38", "So", 0), ("BLOCK OCTANT-138", "So", 0), ("BLOCK OCTANT-238", "So", 0), ("BLOCK OCTANT-1238", "So", 0), ("BLOCK OCTANT-48", "So", 0), ("BLOCK OCTANT-148", "So", 0), ("BLOCK OCTANT-248", "So", 0), ("BLOCK OCTANT-1248", "So", 0), ("BLOCK OCTANT-348", "So", 0), ("BLOCK OCTANT-1348", "So", 0), ("BLOCK OCTANT-2348", "So", 0), ("BLOCK OCTANT-12348", "So", 0), ("BLOCK OCTANT-58", "So", 0), ("BLOCK OCTANT-158", "So", 0), ("BLOCK OCTANT-258", "So", 0), ("BLOCK OCTANT-1258", "So", 0), ("BLOCK OCTANT-358", "So", 0), ("BLOCK OCTANT-1358", "So", 0), ("BLOCK OCTANT-2358", "So", 0), ("BLOCK OCTANT-12358", "So", 0), ("BLOCK OCTANT-458", "So", 0), ("BLOCK OCTANT-1458", "So", 0), ("BLOCK OCTANT-2458", "So", 0), ("BLOCK OCTANT-12458", "So", 0), ("BLOCK OCTANT-3458", "So", 0), ("BLOCK OCTANT-13458", "So", 0), ("BLOCK OCTANT-23458", "So", 0), ("BLOCK OCTANT-123458", "So", 0), ("BLOCK OCTANT-168", "So", 0), ("BLOCK OCTANT-268", "So", 0), ("BLOCK OCTANT-1268", "So", 0), ("BLOCK OCTANT-368", "So", 0), ("BLOCK OCTANT-2368", "So", 0), ("BLOCK OCTANT-12368", "So", 0), ("BLOCK OCTANT-468", "So", 0), ("BLOCK OCTANT-1468", "So", 0), ("BLOCK OCTANT-12468", "So", 0), ("BLOCK OCTANT-3468", "So", 0), ("BLOCK OCTANT-13468", "So", 0), ("BLOCK OCTANT-23468", "So", 0), ("BLOCK OCTANT-568", "So", 0), ("BLOCK OCTANT-1568", "So", 0), ("BLOCK OCTANT-2568", "So", 0), ("BLOCK OCTANT-12568", "So", 0), ("BLOCK OCTANT-3568", "So", 0), ("BLOCK OCTANT-13568", "So", 0), ("BLOCK OCTANT-23568", "So", 0), ("BLOCK OCTANT-123568", "So", 0), ("BLOCK OCTANT-4568", "So", 0), ("BLOCK OCTANT-14568", "So", 0), ("BLOCK OCTANT-24568", "So", 0), ("BLOCK OCTANT-124568", "So", 0), ("BLOCK OCTANT-34568", "So", 0), ("BLOCK OCTANT-134568", "So", 0), ("BLOCK OCTANT-234568", "So", 0), ("BLOCK OCTANT-1234568", "So", 0), ("BLOCK OCTANT-178", "So", 0), ("BLOCK OCTANT-278", "So", 0), ("BLOCK OCTANT-1278", "So", 0), ("BLOCK OCTANT-378", "So", 0), ("BLOCK OCTANT-1378", "So", 0), ("BLOCK OCTANT-2378", "So", 0), ("BLOCK OCTANT-12378", "So", 0), ("BLOCK OCTANT-478", "So", 0), ("BLOCK OCTANT-1478", "So", 0), ("BLOCK OCTANT-2478", "So", 0), ("BLOCK OCTANT-12478", "So", 0), ("BLOCK OCTANT-3478", "So", 0), ("BLOCK OCTANT-13478", "So", 0), ("BLOCK OCTANT-23478", "So", 0), ("BLOCK OCTANT-123478", "So", 0), ("BLOCK OCTANT-578", "So", 0), ("BLOCK OCTANT-1578", "So", 0), ("BLOCK OCTANT-2578", "So", 0), ("BLOCK OCTANT-12578", "So", 0), ("BLOCK OCTANT-3578", "So", 0), ("BLOCK OCTANT-13578", "So", 0), ("BLOCK OCTANT-23578", "So", 0), ("BLOCK OCTANT-123578", "So", 0), ("BLOCK OCTANT-4578", "So", 0), ("BLOCK OCTANT-14578", "So", 0), ("BLOCK OCTANT-24578", "So", 0), ("BLOCK OCTANT-124578", "So", 0), ("BLOCK OCTANT-34578", "So", 0), ("BLOCK OCTANT-134578", "So", 0), ("BLOCK OCTANT-234578", "So", 0), ("BLOCK OCTANT-1234578", "So", 0), ("BLOCK OCTANT-678", "So", 0), ("BLOCK OCTANT-1678", "So", 0), ("BLOCK OCTANT-2678", "So", 0), ("BLOCK OCTANT-12678", "So", 0), ("BLOCK OCTANT-3678", "So", 0), ("BLOCK OCTANT-13678", "So", 0), ("BLOCK OCTANT-23678", "So", 0), ("BLOCK OCTANT-123678", "So", 0), ("BLOCK OCTANT-4678", "So", 0), ("BLOCK OCTANT-14678", "So", 0), ("BLOCK OCTANT-24678", "So", 0), ("BLOCK OCTANT-124678", "So", 0), ("BLOCK OCTANT-34678", "So", 0), ("BLOCK OCTANT-134678", "So", 0), ("BLOCK OCTANT-234678", "So", 0), ("BLOCK OCTANT-1234678", "So", 0), ("BLOCK OCTANT-15678", "So", 0), ("BLOCK OCTANT-25678", "So", 0), ("BLOCK OCTANT-125678", "So", 0), ("BLOCK OCTANT-35678", "So", 0), ("BLOCK OCTANT-235678", "So", 0), ("BLOCK OCTANT-1235678", "So", 0), ("BLOCK OCTANT-45678", "So", 0), ("BLOCK OCTANT-145678", "So", 0), ("BLOCK OCTANT-1245678", "So", 0), ("BLOCK OCTANT-1345678", "So", 0), ("BLOCK OCTANT-2345678", "So", 0), ("TOP HALF STANDING PERSON", "So", 0), ("BOTTOM HALF STANDING PERSON", "So", 0), ("TOP HALF RIGHT-FACING RUNNER FRAME-1", "So", 0), ("BOTTOM HALF RIGHT-FACING RUNNER FRAME-1", "So", 0), ("TOP HALF RIGHT-FACING RUNNER FRAME-2", "So", 0), ("BOTTOM HALF RIGHT-FACING RUNNER FRAME-2", "So", 0), ("TOP HALF LEFT-FACING RUNNER FRAME-1", "So", 0), ("BOTTOM HALF LEFT-FACING RUNNER FRAME-1", "So", 0), ("TOP HALF LEFT-FACING RUNNER FRAME-2", "So", 0), ("BOTTOM HALF LEFT-FACING RUNNER FRAME-2", "So", 0), ("TOP HALF FORWARD-FACING RUNNER", "So", 0), ("BOTTOM HALF FORWARD-FACING RUNNER FRAME-1", "So", 0), ("BOTTOM HALF FORWARD-FACING RUNNER FRAME-2", "So", 0), ("BOTTOM HALF FORWARD-FACING RUNNER FRAME-3", "So", 0), ("BOTTOM HALF FORWARD-FACING RUNNER FRAME-4", "So", 0), ("MOON LANDER", "So", 0), ("TOP HALF FLAILING ROBOT FRAME-1", "So", 0), ("TOP HALF FLAILING ROBOT FRAME-2", "So", 0), ("DOWN-POINTING AIRPLANE", "So", 0), ("LEFT-POINTING AIRPLANE", "So", 0), ("SMALL UP-POINTING AIRPLANE", "So", 0), ("UP-POINTING FROG", "So", 0), ("DOWN-POINTING FROG", "So", 0), ("EXPLOSION FRAME-1", "So", 0), ("EXPLOSION FRAME-2", "So", 0), ("EXPLOSION FRAME-3", "So", 0), ("RIGHT HALF AND LEFT HALF WHITE CIRCLE", "So", 0), ("LOWER HALF AND UPPER HALF WHITE CIRCLE", "So", 0), ("EXPLOSION AT HORIZON", "So", 0), ("UPPER HALF HEAVY WHITE SQUARE", "So", 0), ("LOWER HALF HEAVY WHITE SQUARE", "So", 0), ("HEAVY WHITE SQUARE CONTAINING BLACK VERY SMALL SQUARE", "So", 0), ("WHITE VERTICAL RECTANGLE WITH HORIZONTAL BAR", "So", 0), ("TOP LEFT BLACK LEFT-POINTING SMALL TRIANGLE", "So", 0), ("FUNNEL", "So", 0), ("BOX DRAWINGS DOUBLE DIAGONAL LOWER LEFT TO MIDDLE CENTRE TO LOWER RIGHT", "So", 0), ("BOX DRAWINGS DOUBLE DIAGONAL UPPER LEFT TO MIDDLE CENTRE TO UPPER RIGHT", "So", 0), ("LEFT HALF WHITE ELLIPSE", "So", 0), ("RIGHT HALF WHITE ELLIPSE", "So", 0), ("LEFT HALF TRIPLE DASH HORIZONTAL", "So", 0), ("RIGHT HALF TRIPLE DASH HORIZONTAL", "So", 0), ("HORIZONTAL LINE WITH TICK MARK", "So", 0), ("LEFT HALF HORIZONTAL LINE WITH THREE TICK MARKS", "So", 0), ("RIGHT HALF HORIZONTAL LINE WITH THREE TICK MARKS", "So", 0), ("HORIZONTAL LINE WITH THREE TICK MARKS", "So", 0), ("LOWER HALF VERTICAL LINE WITH THREE TICK MARKS", "So", 0), ("UPPER HALF VERTICAL LINE WITH THREE TICK MARKS", "So", 0), ("VERTICAL LINE WITH THREE TICK MARKS", "So", 0), ("BOX DRAWINGS LIGHT VERTICAL AND TOP RIGHT", "So", 0), ("BOX DRAWINGS LIGHT VERTICAL AND BOTTOM RIGHT", "So", 0), ("BOX DRAWINGS LIGHT VERTICAL AND TOP LEFT", "So", 0), ("BOX DRAWINGS LIGHT VERTICAL AND BOTTOM LEFT", "So", 0), ("LARGE TYPE PIECE UPPER LEFT ARC", "So", 0), ("LARGE TYPE PIECE UPPER LEFT CORNER", "So", 0), ("LARGE TYPE PIECE UPPER TERMINAL", "So", 0), ("LARGE TYPE PIECE UPPER LEFT CROTCH", "So", 0), ("LARGE TYPE PIECE LEFT ARM", "So", 0), ("LARGE TYPE PIECE CROSSBAR", "So", 0), ("LARGE TYPE PIECE CROSSBAR WITH LOWER STEM", "So", 0), ("LARGE TYPE PIECE UPPER HALF VERTEX OF M", "So", 0), ("LARGE TYPE PIECE DIAGONAL LOWER LEFT", "So", 0), ("LARGE TYPE PIECE SHORT UPPER TERMINAL", "So", 0), ("LARGE TYPE PIECE UPPER RIGHT ARC", "So", 0), ("LARGE TYPE PIECE RIGHT ARM", "So", 0), ("LARGE TYPE PIECE UPPER RIGHT CROTCH", "So", 0), ("LARGE TYPE PIECE UPPER RIGHT CORNER", "So", 0), ("LARGE TYPE PIECE STEM WITH RIGHT CROSSBAR", "So", 0), ("LARGE TYPE PIECE STEM", "So", 0), ("LARGE TYPE PIECE DIAGONAL UPPER RIGHT AND LOWER RIGHT", "So", 0), ("LARGE TYPE PIECE DIAGONAL UPPER RIGHT", "So", 0), ("LARGE TYPE PIECE DIAGONAL LOWER RIGHT", "So", 0), ("LARGE TYPE PIECE SHORT LOWER TERMINAL", "So", 0), ("LARGE TYPE PIECE LOWER LEFT AND UPPER LEFT ARC", "So", 0), ("LARGE TYPE PIECE CENTRE OF K", "So", 0), ("LARGE TYPE PIECE LOWER HALF VERTEX OF M", "So", 0), ("LARGE TYPE PIECE UPPER HALF VERTEX OF W", "So", 0), ("LARGE TYPE PIECE CENTRE OF X", "So", 0), ("LARGE TYPE PIECE CENTRE OF Y", "So", 0), ("LARGE TYPE PIECE CENTRE OF Z WITH CROSSBAR", "So", 0), ("LARGE TYPE PIECE RAISED UPPER LEFT ARC", "So", 0), ("LARGE TYPE PIECE STEM WITH LEFT CROSSBAR", "So", 0), ("LARGE TYPE PIECE LOWER RIGHT AND UPPER RIGHT ARC", "So", 0), ("LARGE TYPE PIECE DIAGONAL UPPER LEFT AND LOWER LEFT", "So", 0), ("LARGE TYPE PIECE STEM WITH LEFT JOINT", "So", 0), ("LARGE TYPE PIECE STEM WITH CROSSBAR", "So", 0), ("LARGE TYPE PIECE DIAGONAL UPPER LEFT", "So", 0), ("LARGE TYPE PIECE LOWER TERMINAL", "So", 0), ("LARGE TYPE PIECE LOWER LEFT CORNER", "So", 0), ("LARGE TYPE PIECE LOWER LEFT ARC", "So", 0), ("LARGE TYPE PIECE LOWER LEFT CROTCH", "So", 0), ("LARGE TYPE PIECE CROSSBAR WITH UPPER STEM", "So", 0), ("LARGE TYPE PIECE VERTEX OF V", "So", 0), ("LARGE TYPE PIECE LOWER HALF VERTEX OF W", "So", 0), ("LARGE TYPE PIECE LOWER RIGHT ARC", "So", 0), ("LARGE TYPE PIECE LOWER RIGHT CORNER", "So", 0), ("LARGE TYPE PIECE LOWER RIGHT ARC WITH TAIL", "So", 0), ("LARGE TYPE PIECE LOWER RIGHT CROTCH", "So", 0), ("LARGE TYPE PIECE STEM-45", "So", 0), ("LARGE TYPE PIECE STEM-2345", "So", 0), ("LARGE TYPE PIECE STEM-4", "So", 0), ("LARGE TYPE PIECE STEM-34", "So", 0), ("LARGE TYPE PIECE STEM-234", "So", 0), ("LARGE TYPE PIECE STEM-1234", "So", 0), ("LARGE TYPE PIECE STEM-3", "So", 0), ("LARGE TYPE PIECE STEM-23", "So", 0), ("LARGE TYPE PIECE STEM-2", "So", 0), ("LARGE TYPE PIECE STEM-12", "So", 0), ("SEPARATED BLOCK SEXTANT-1", "So", 0), ("SEPARATED BLOCK SEXTANT-2", "So", 0), ("SEPARATED BLOCK SEXTANT-12", "So", 0), ("SEPARATED BLOCK SEXTANT-3", "So", 0), ("SEPARATED BLOCK SEXTANT-13", "So", 0), ("SEPARATED BLOCK SEXTANT-23", "So", 0), ("SEPARATED BLOCK SEXTANT-123", "So", 0), ("SEPARATED BLOCK SEXTANT-4", "So", 0), ("SEPARATED BLOCK SEXTANT-14", "So", 0), ("SEPARATED BLOCK SEXTANT-24", "So", 0), ("SEPARATED BLOCK SEXTANT-124", "So", 0), ("SEPARATED BLOCK SEXTANT-34", "So", 0), ("SEPARATED BLOCK SEXTANT-134", "So", 0), ("SEPARATED BLOCK SEXTANT-234", "So", 0), ("SEPARATED BLOCK SEXTANT-1234", "So", 0), ("SEPARATED BLOCK SEXTANT-5", "So", 0), ("SEPARATED BLOCK SEXTANT-15", "So", 0), ("SEPARATED BLOCK SEXTANT-25", "So", 0), ("SEPARATED BLOCK SEXTANT-125", "So", 0), ("SEPARATED BLOCK SEXTANT-35", "So", 0), ("SEPARATED BLOCK SEXTANT-135", "So", 0), ("SEPARATED BLOCK SEXTANT-235", "So", 0), ("SEPARATED BLOCK SEXTANT-1235", "So", 0), ("SEPARATED BLOCK SEXTANT-45", "So", 0), ("SEPARATED BLOCK SEXTANT-145", "So", 0), ("SEPARATED BLOCK SEXTANT-245", "So", 0), ("SEPARATED BLOCK SEXTANT-1245", "So", 0), ("SEPARATED BLOCK SEXTANT-345", "So", 0), ("SEPARATED BLOCK SEXTANT-1345", "So", 0), ("SEPARATED BLOCK SEXTANT-2345", "So", 0), ("SEPARATED BLOCK SEXTANT-12345", "So", 0), ("SEPARATED BLOCK SEXTANT-6", "So", 0), ("SEPARATED BLOCK SEXTANT-16", "So", 0), ("SEPARATED BLOCK SEXTANT-26", "So", 0), ("SEPARATED BLOCK SEXTANT-126", "So", 0), ("SEPARATED BLOCK SEXTANT-36", "So", 0), ("SEPARATED BLOCK SEXTANT-136", "So", 0), ("SEPARATED BLOCK SEXTANT-236", "So", 0), ("SEPARATED BLOCK SEXTANT-1236", "So", 0), ("SEPARATED BLOCK SEXTANT-46", "So", 0), ("SEPARATED BLOCK SEXTANT-146", "So", 0), ("SEPARATED BLOCK SEXTANT-246", "So", 0), ("SEPARATED BLOCK SEXTANT-1246", "So", 0), ("SEPARATED BLOCK SEXTANT-346", "So", 0), ("SEPARATED BLOCK SEXTANT-1346", "So", 0), ("SEPARATED BLOCK SEXTANT-2346", "So", 0), ("SEPARATED BLOCK SEXTANT-12346", "So", 0), ("SEPARATED BLOCK SEXTANT-56", "So", 0), ("SEPARATED BLOCK SEXTANT-156", "So", 0), ("SEPARATED BLOCK SEXTANT-256", "So", 0), ("SEPARATED BLOCK SEXTANT-1256", "So", 0), ("SEPARATED BLOCK SEXTANT-356", "So", 0), ("SEPARATED BLOCK SEXTANT-1356", "So", 0), ("SEPARATED BLOCK SEXTANT-2356", "So", 0), ("SEPARATED BLOCK SEXTANT-12356", "So", 0), ("SEPARATED BLOCK SEXTANT-456", "So", 0), ("SEPARATED BLOCK SEXTANT-1456", "So", 0), ("SEPARATED BLOCK SEXTANT-2456", "So", 0), ("SEPARATED BLOCK SEXTANT-12456", "So", 0), ("SEPARATED BLOCK SEXTANT-3456", "So", 0), ("SEPARATED BLOCK SEXTANT-13456", "So", 0), ("SEPARATED BLOCK SEXTANT-23456", "So", 0), ("SEPARATED BLOCK SEXTANT-123456", "So", 0), ("UPPER LEFT ONE SIXTEENTH BLOCK", "So", 0), ("UPPER CENTRE LEFT ONE SIXTEENTH BLOCK", "So", 0), ("UPPER CENTRE RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("UPPER RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("UPPER MIDDLE LEFT ONE SIXTEENTH BLOCK", "So", 0), ("UPPER MIDDLE CENTRE LEFT ONE SIXTEENTH BLOCK", "So", 0), ("UPPER MIDDLE CENTRE RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("UPPER MIDDLE RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER MIDDLE LEFT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER MIDDLE CENTRE LEFT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER MIDDLE CENTRE RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER MIDDLE RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER LEFT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER CENTRE LEFT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER CENTRE RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("LOWER RIGHT ONE SIXTEENTH BLOCK", "So", 0), ("RIGHT HALF LOWER ONE QUARTER BLOCK", "So", 0), ("RIGHT THREE QUARTERS LOWER ONE QUARTER BLOCK", "So", 0), ("LEFT THREE QUARTERS LOWER ONE QUARTER BLOCK", "So", 0), ("LEFT HALF LOWER ONE QUARTER BLOCK", "So", 0), ("LOWER HALF LEFT ONE QUARTER BLOCK", "So", 0), ("LOWER THREE QUARTERS LEFT ONE QUARTER BLOCK", "So", 0), ("UPPER THREE QUARTERS LEFT ONE QUARTER BLOCK", "So", 0), ("UPPER HALF LEFT ONE QUARTER BLOCK", "So", 0), ("LEFT HALF UPPER ONE QUARTER BLOCK", "So", 0), ("LEFT THREE QUARTERS UPPER ONE QUARTER BLOCK", "So", 0), ("RIGHT THREE QUARTERS UPPER ONE QUARTER BLOCK", "So", 0), ("RIGHT HALF UPPER ONE QUARTER BLOCK", "So", 0), ("UPPER HALF RIGHT ONE QUARTER BLOCK", "So", 0), ("UPPER THREE QUARTERS RIGHT ONE QUARTER BLOCK", "So", 0), ("LOWER THREE QUARTERS RIGHT ONE QUARTER BLOCK", "So", 0), ("LOWER HALF RIGHT ONE QUARTER BLOCK", "So", 0), ("HORIZONTAL ZIGZAG LINE", "So", 0), ("KEYHOLE", "So", 0), ("OLD PERSONAL COMPUTER WITH MONITOR IN PORTRAIT ORIENTATION", "So", 0), ("BLACK RIGHT TRIANGLE CARET", "So", 0), )
https://github.com/DawnEver/csee-typst-template
https://raw.githubusercontent.com/DawnEver/csee-typst-template/main/template.typ
typst
MIT License
#let font_2p = 22pt #let font_s2p = 18pt #let font_3p = 16pt #let font_s3p = 15pt #let font_4p = 14pt #let font_s4p = 12pt #let font_5p = 10.5pt #let font_s5p = 9pt // Windows #let font_hei = "simhei" #let font_sun = "simsun" #let font_times = "Times New Roman" #let font_arial = "Arial" #let font_kai = "kaiti" #let font_fsun = "fangsong" // MacOS #let font_hei = "Hei" #let font_sun = "Songti SC" #let font_times = "Times" #let font_arial = "Arial" #let font_kai = "Kai" #let font_fsun = "STFangsong" #let font_body = (font_times,font_sun) #let font_title = (font_arial,font_hei) #let font_caption = (font_times,font_hei) #let font_def = (font_times,font_hei) #let project( title: "", authors: (), address: "", title_cn: "", authors_cn: (), address_cn: "", abstract: none, abstract_cn: none, keywords:(), keywords_cn:(), bibliography-file: none, body ) = { // Set document metdata. set document(title: title_cn, author: authors_cn) // Configure the page. set page( paper: "a4", margin: (left:2.0cm, right:2.0cm, top: 3.2cm, bottom: 2.5cm), header: locate(loc => { let page_counter = counter(page) let page_number = page_counter.at(loc).first() if page_number==1 [ #align(center)[ #text(font:font_body,size:font_s5p,)[信#h(0.4cm)号#h(0.4cm)与#h(0.4cm)控#h(0.4cm)制#h(0.4cm)综#h(0.4cm)合#h(0.4cm)实#h(0.4cm)验\ Signal and Control Experiment] ] ]else if calc.odd(page_number) [ #v(-5pt, weak: true) #align(right)[ #page_number ] ]else[ #align(center)[ #text(font:font_body,size:font_s5p,)[信#h(0.4cm)号#h(0.4cm)与#h(0.4cm)控#h(0.4cm)制#h(0.4cm)综#h(0.4cm)合#h(0.4cm)实#h(0.4cm)验] ] #v(-5pt, weak: true) #page_number ] v(5pt, weak: true) line(length: 100%,stroke: 0.5pt) v(1.3pt, weak: true) line(length: 100%,stroke: 0.5pt) }), ) // Configure equation numbering and spacing. set math.equation(numbering: "(1)",supplement:[]) show math.equation: it =>{ set block(spacing: 0.65em) it h(0em,weak: false) } set raw(align: left) show raw: it =>{ set block(spacing: 0.65em) text(size: font_s5p,font: font_body)[#it] h(0em,weak: false) } // Configure figures and tables. set figure(supplement:[]) show figure: it => { set text(font: font_caption,weight: "black",size:font_s5p) set align(center) if it.kind == image [ #box[ #it.body #v(14pt, weak: true) 图 #it.caption//\ // Fig #it.caption ] ] else if it.kind == table [ #box[ 表#it.caption//\ // Tab.#it.caption #v(14pt, weak: true) #it.body ] ] else [ ... ] } set table(stroke: 0.5pt,) show table: set text(8pt) // Configure lists. set enum(indent: 10pt, body-indent: 9pt) show enum: it =>{ it h(0em,weak: false) } set list(indent: 10pt, body-indent: 9pt) show list: it =>{ it h(0em,weak: false) } // Configure headings. set heading(numbering: "1.") show heading: it => { if it.level == 1 [ #if it.body == "致谢" [ #align(center)[ #text(font:font_title,size:font_s4p)[#it.body] ] #set text(font:font_kai) ]else if it.body == "参考文献" [ #text(font:font_title,size:font_s4p)[#it.body] #v(font_s4p, weak: true) ]else[ // #text(font:font_title,size:font_s4p)[ // #counter(heading).display()#h(6pt)#it.body] #text(font:font_title,size:font_s4p)[#it] #v(font_s4p, weak: true) ] ] else if it.level == 2 [ // #text(font:font_title,size:font_5p)[ // #counter(heading).display()#h(6pt)#it.body] #text(font:font_title,size:font_5p)[#it] #v(font_5p, weak: true) ] else [ // Third level headings are run-ins too, but different. #if it.level == 3 [ // #text(font:font_body,size:font_5p)[ // #counter(heading).display()#h(6pt)#it.body] #text(font:font_body,size:font_5p)[#it] #v(font_5p, weak: true) ] ] // v(10pt, weak: true) h(0em) } // ================================================== // ================================================== // Display the paper's title. set text(fallback: false) align(center)[ #text(title_cn, size: font_2p, font: font_title) #v(font_4p, weak: true) #text(authors_cn.join(","), size: font_4p, font: font_fsun) #v(font_4p, weak: true) #text("("+address_cn+")", size: font_5p, font: font_kai) #v(font_5p*2, weak: true) #text(title, size: font_s4p, font: font_times, weight: "black") #v(font_5p, weak: true) #text(authors.join(", "), size: font_5p, font: font_times) #v(font_5p, weak: true) #text("("+address+")", size: font_s5p, font: font_times) #v(font_5p+font_s4p, weak: true) ] // Start two column mode and configure paragraph properties. show: columns.with(2, gutter: 12pt) set par(justify: true) // Display abstract , index terms or keywords. set text(size: font_s5p,font: font_body) set par(leading: font_s5p) if abstract != none [ *ABSTRACT:* #abstract #if keywords != () [ *KEY WORDS:* #keywords.join(", ") ] ] if abstract_cn != none [ *#text(font:font_hei)[摘要]:* #abstract_cn #if keywords_cn != () [ *#text(font:font_hei)[关键字]:* #keywords_cn.join(", ") ] ] // Display the paper's contents. set par(justify: true, first-line-indent: 0.74cm) set text(font_5p,font:font_body) //会自动匹配前面的是英语字体,后面的是中文字体 body // Display bibliography. if bibliography-file != none { show bibliography: set text(size:font_5p,font:font_body) bibliography(bibliography-file, title: text(size:font_s4p,font:font_hei)[参考文献], style: "gb-7714-2015-numeric") // bibliography(bibliography-file, title:"参考文献", style: "gb-7714-2015-numeric") } }
https://github.com/dantevi-other/kththesis-typst
https://raw.githubusercontent.com/dantevi-other/kththesis-typst/main/parts/3-swe-abstract.typ
typst
MIT License
//-- Configurations #set page( numbering: "i" ) //-- Content = Sammanfattning #lorem(200)
https://github.com/lucannez64/Notes
https://raw.githubusercontent.com/lucannez64/Notes/master/Philosophie_Argument_2.typ
typst
#import "template.typ": * // Take a look at the file `template.typ` in the file panel // to customize this template and discover how it works. #show: project.with( title: "Philosophie Argument 2", authors: ( "<NAME>", ), date: "10 Août, 2024", ) #set heading(numbering: "1.1.") == Question: #emph[Les lois politiques empêchent-elles la liberté ?] <question-les-lois-politiques-empêchent-elles-la-liberté> \ #emph[Les lois politiques n’empêchent pas la liberté];. En effet la liberté peut-être définie comme le fait de pouvoir faire ce que l’on veut sans empiéter sur celle des autres. De plus les lois politiques établissent des règles qui garantissent des droits. Or ces droits permettent d’exercer des libertés fondamentales, comme par exemple la liberté de mouvement ou la liberté d’expression. Et les règles établissent des limites pour ne pas empiéter sur la liberté et les droits des autres, comme avec l’interdiction de la diffamation garantissant le respect de la dignité. On peut objecter que toute règle restreint forcément la liberté, en limitant les actions possibles. Or on peut établir que le rôle de la loi n’est pas d’offrir une liberté parfaite mais de la modérée pour éviter le chaos et donner un compromis. En conclusion les lois politiques n’empêchent pas la liberté mais n’offre pas une liberté complète pour conserver l’ordre.
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/grid/header-footer.typ
typst
Apache License 2.0
#table( columns: 3, table.header( [Substance], [Subcritical °C], [Supercritical °C], repeat: true, ), [Hydrochloric Acid], [12.0], [92.1], [Sodium Myreth Sulfate], [16.6], [104], [Potassium Hydroxide], [24.7], [114.514], )
https://github.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024
https://raw.githubusercontent.com/Area-53-Robotics/53E-Notebook-Over-Under-2023-2024/giga-notebook/entries/tournament-hereford/entry.typ
typst
Creative Commons Attribution Share Alike 4.0 International
#import "/packages.typ": notebookinator, diagraph #import notebookinator: * #import themes.radial.components: * #import diagraph: * #show: create-body-entry.with( title: "Tournament: Hereford Stampede", type: "test", date: datetime(year: 2023, month: 12, day: 2), author: "<NAME>", witness: "<NAME>", ) = Qualification Matches #tournament(( match: "Q5", red-alliance: (teams: ("7135E", "53E"), score: 57), blue-alliance: (teams: ("53C", "960W"), score: 49), won: true, auton: false, awp: false, ), ( match: "Q13", red-alliance: (teams: ("5588H", "9290A"), score: 22), blue-alliance: (teams: ("53E", "5588B"), score: 70), won: true, auton: false, awp: false, ), ( match: "Q28", red-alliance: (teams: ("53E", "960Z"), score: 59), blue-alliance: (teams: ("53D", "9080C"), score: 122), won: false, auton: false, awp: false, ), ( match: "Q33", red-alliance: (teams: ("1893P", "929S"), score: 93), blue-alliance: (teams: ("53E", "82856A"), score: 139), won: true, auton: false, awp: false, ), ( match: "Q44", red-alliance: (teams: ("53E", "5599T"), score: 106), blue-alliance: (teams: ("7135B", "9080S"), score: 86), won: true, auton: false, awp: false, ), ( match: "Q60", red-alliance: (teams: ("1893C", "53E"), score: 170), blue-alliance: (teams: ("934Z", "929X"), score: 58), won: true, auton: false, awp: false, )) = Alliance Selection We were 10th place in eliminations, so we didn't have very many options. We hoped that we could get a team above us to pick us. We talked to 1893C, 929N, 82856A. We thought that it was highly unlikely that 1893C would pick us, so we hoped 929N or 82856A would. If one of these teams doesn't pick us, we'll need to pick a team. We thought that 1727R's bot would complement ours very well, so we reached out to them. We also talked to 53C and 1727A. #raw-render[```dot digraph { rankdir=LR; start->"929N picks us" "929N picks us"->"82856A picks us" [label = "no"] "929N picks us"->"end" [label = "yes"] "82856A picks us"->"We pick 1727R" [label = "no"] "82856A picks us"->"end" [label = "yes"] "We pick 1727R"->"We pick 53C" [label = "no"] "We pick 53C"-> end [label = "yes"] "We pick 53C"->"We pick 1727A" [label = "no"] "We pick 1727A"->end start[shape=Mdiamond] end[shape=Msquare] } ```] The above flow chart represents our decision making plan. In the end, 1893C partnered with 929N, and 82856A ended up picking us. = Elimination Matches #tournament(( match: "R16 #8-1", red-alliance: (teams: ("82856A", "53E"), score: 196), blue-alliance: (teams: ("9290C", "929R"), score: 72), won: true, auton: false, awp: false, ), ( match: "QF #4-1", red-alliance: (teams: ("5588E", "53A"), score: 89), blue-alliance: (teams: ("82856A", "53E"), score: 115), won: true, auton: false, awp: false, ), ( match: "SF #2-1", red-alliance: (teams: ("1893C", "929N"), score: 71), blue-alliance: (teams: ("82856A", "53E"), score: 103), won: true, auton: false, awp: false, ), ( match: "Final #1-1", red-alliance: (teams: ("1727B", "1727K"), score: 140), blue-alliance: (teams: ("1893C", "929N"), score: 120), won: false, auton: false, awp: false, )) = Reflection #grid( columns: (1fr, 1fr), pie-chart( (value: 8, color: green, name: "wins"), (value: 2, color: red, name: "losses") ), [ Overall we're extremely happy with the performance of our robot. We won nearly all of our qualification matches, and got all the way to finals. ], ) Our overall robot performance was as follows: #pro-con( pros: [ - Flywheel was able to quickly and consistently fire the triballs across the field - Intake was able to quickly and consistently grab the triballs ], cons: [ - Our robot could not elevate at all. - We cannot consistently get AWP. ], ) Overall our focus in the coming meetings should be to improve our climbing mechanism, and getting our auton as consistent as possible. The other parts of our robot work extremely well and don't need to be changed.
https://github.com/astrale-sharp/typst-assignement-template
https://raw.githubusercontent.com/astrale-sharp/typst-assignement-template/main/libs/eval.typ
typst
MIT License
#let title(x , point : 20) = { let p = place(dx : -15pt,dy : 28pt)[ #set text(22pt) #rect(stroke : 1pt, radius: 20pt ,fill : rgb(255, 255, 255), inset: 6pt)[#point points] ] set text(29pt); align(center, rect(inset: 15pt, p + [*#x*] )) } #let question(body, point : 1,answer : []) = { (body : body, point : point, answer : answer, type : "question") } #let eval( ..args, // can contain question node or plain content that will be inserted between the questions show_correction : false, // formats the questions qfmt : i => [ *_Question #{i+1})_*], // format the rectangle that will contain how much point the question is worth prfmt : x => [ #h(1fr) #box( radius: 50pt, fill : gray.lighten(35%), width: 55pt, height: 1.1em)[ #set align(center + horizon) #x pt#{if x>1 {[s]}} ]], answerfmt : i => [#set text(red);\ *#i*] ) = { if not show_correction { answerfmt = i => [] } let is_question(i) = {( type(i) == "dictionary" and i.type == "question" )} let q = args.pos().filter(is_question) let ca = q.map(i => i.body) let pa = q.map(i => i.point) let correction_array = q.map(i => if show_correction {i.answer} else {[]} ) let ca = range(ca.len()) .map( // format questions and adds a point rectangle i => qfmt(i) + ca.at(i) + prfmt(pa.at(i)) + answerfmt(correction_array.at(i)) ) // adds intermediary content let tmp = args.pos() while tmp.len() > ca.len() {ca.push[]} // just to make sure you can add content that comes after the last question while tmp.position(i => not is_question(i)) != none { let pos = tmp.position(i => not is_question(i)) // repr(tmp.remove(pos)) ca.at(pos) = [#tmp.remove(pos) \ ] + ca.at(pos) } ca.join([\ #v(-5pt)]) v(1fr) align(center,table( [Questions ], ..range(pa.len()).map(i => [#{i+1}]),[Total], //numéro de la question [Points], ..pa.map(repr), [#pa.fold(0, (i,j)=> i + j )], [Score], ..pa.map(i => []), [], // score à avoir columns: range(pa.len() + 2).map(i => auto), inset : 10pt, align : center + horizon )) v(15pt) } #let template(body) = [ #set text(font: "Caladea",12pt, fallback: true, slashed-zero: true, lang: "fr") #set page( "a4", margin: ( top : 1.5cm, bottom : 1.35cm, rest : 1cm), footer : align(horizon + right,text(8pt, counter(page).display())) ) #let headercontent = [ Classe: ..................... #h(1fr) Nom et Prénom: ................................................... ] //footer: i => align(horizon + right,text(8pt, [#i])) //header : i => if i == 1 {align(horizon + left, headercontent)}, #body ]
https://github.com/fuchs-fabian/typst-template-aio-studi-and-thesis
https://raw.githubusercontent.com/fuchs-fabian/typst-template-aio-studi-and-thesis/main/template/chapters/summary.typ
typst
MIT License
#let summary() = [ #lorem(20) ]
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/109.%205founders.html.typ
typst
5founders.html Five Founders April 2009Inc recently asked me who I thought were the 5 most interesting startup founders of the last 30 years. How do you decide who's the most interesting? The best test seemed to be influence: who are the 5 who've influenced me most? Who do I use as examples when I'm talking to companies we fund? Who do I find myself quoting?1. Steve JobsI'd guess Steve is the most influential founder not just for me but for most people you could ask. A lot of startup culture is Apple culture. He was the original young founder. And while the concept of "insanely great" already existed in the arts, it was a novel idea to introduce into a company in the 1980s.More remarkable still, he's stayed interesting for 30 years. People await new Apple products the way they'd await new books by a popular novelist. Steve may not literally design them, but they wouldn't happen if he weren't CEO.Steve is clever and driven, but so are a lot of people in the Valley. What makes him unique is his sense of design. Before him, most companies treated design as a frivolous extra. Apple's competitors now know better.2. TJ RodgersTJ Rodgers isn't as famous as <NAME>, but he may be the best writer among Silicon Valley CEOs. I've probably learned more from him about the startup way of thinking than from anyone else. Not so much from specific things he's written as by reconstructing the mind that produced them: brutally candid; aggressively garbage-collecting outdated ideas; and yet driven by pragmatism rather than ideology.The first essay of his that I read was so electrifying that I remember exactly where I was at the time. It was High Technology Innovation: Free Markets or Government Subsidies? and I was downstairs in the Harvard Square T Station. It felt as if someone had flipped on a light switch inside my head.3. Larry & SergeyI'm sorry to treat Larry and Sergey as one person. I've always thought that was unfair to them. But it does seem as if Google was a collaboration.Before Google, companies in Silicon Valley already knew it was important to have the best hackers. So they claimed, at least. But Google pushed this idea further than anyone had before. Their hypothesis seems to have been that, in the initial stages at least, all you need is good hackers: if you hire all the smartest people and put them to work on a problem where their success can be measured, you win. All the other stuff—which includes all the stuff that business schools think business consists of—you can figure out along the way. The results won't be perfect, but they'll be optimal. If this was their hypothesis, it's now been verified experimentally.4. <NAME>Few know this, but one person, <NAME>, is responsible for three of the best things Google has done. He was the original author of GMail, which is the most impressive thing Google has after search. He also wrote the first prototype of AdSense, and was the author of Google's mantra "Don't be evil."PB made a point in a talk once that I now mention to every startup we fund: that it's better, initially, to make a small number of users really love you than a large number kind of like you. If I could tell startups only ten sentences, this would be one of them.Now he's cofounder of a startup called Friendfeed. It's only a year old, but already everyone in the Valley is watching them. Someone responsible for three of the biggest ideas at Google is going to come up with more.5. <NAME>manI was told I shouldn't mention founders of YC-funded companies in this list. But <NAME> can't be stopped by such flimsy rules. If he wants to be on this list, he's going to be.Honestly, Sam is, along with <NAME>, the founder I refer to most when I'm advising startups. On questions of design, I ask "What would Steve do?" but on questions of strategy or ambition I ask "What would Sama do?"What I learned from meeting Sama is that the doctrine of the elect applies to startups. It applies way less than most people think: startup investing does not consist of trying to pick winners the way you might in a horse race. But there are a few people with such force of will that they're going to get whatever they want.
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/019%20-%20Magic%20Origins/005_Nissa’s Origin: Home.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Nissa’s Origin: Home", set_name: "Magic Origins", story_date: datetime(day: 08, month: 07, year: 2015), author: "<NAME> & <NAME>", doc ) #emph[<NAME> found herself woven into an unending stream of living light.] #emph[It was a place she never wanted to leave, for it embraced and cared for her. It wound around her and supported her limbs, giving her the feeling of weightlessness.] #emph[After a timeless moment, though, the stream began to disentangle itself. How she hated to see it go.] #emph[As it floated past her, she noticed that it was actually made up of hundreds of thousands of tiny filaments. It was a glittering river of jewels. It glided so close that she could reach out and touch it. She let her fingertips run through it, and as the tiny filaments passed, she felt each individual essence, all of them unique. Under everything, she felt a great sense of contentment. She wanted to stay like this, connected to the stream, forever.] #emph["Ow!"] #emph[Something hit Nissa from behind, in the back of her head. She reached to rub it.] #emph["Ah!"] #emph[Again. This time in her back. Hard.] #emph[She turned.] #emph[The stream was caught up on her, caught up because there was a knot—a large, black knot that was preventing the flow, holding the stream back.] #emph[It slammed once, twice, and again into Nissa’s arm. It hurt.] #emph[She tried to push it away, tried to shift its course, but it refused to be dissuaded.] #emph[It made strange sounds, sounds like writhing and gnashing, awful sounds too close to her ear. It was darkening and growing. Soon it would be larger than her.] #emph[Nissa tried to run, tried to swim away.] #emph[She reached for the light, but all that was left was the darkness.] #emph[It consumed her.] #emph[It suffocated her.] #emph[It would end her.] #figure(image("005_Nissa’s Origin: Home/01.png", width: 100%), caption: [Art by Chase Stone], supplement: none, numbering: none) Nissa awoke with a start, screaming and gasping for breath. It took her three blinks of her eyes to realize: "Home, I’m home." Her breathing slowed as she stared up at the familiar wooden roof, tracing the pattern of vines that lashed it together. She knew the pattern well, for this was not the first time she had awakened in her bed after a vision of darkness. As she slipped further into this reality, her other senses came back to her as well. She could smell the aroma of her mother’s stew. It must have been warming over the fire. Had she missed dinner again? She could feel the evening’s dampness on the air, a dampness brought on by the rain, which she could hear pattering on the roof. The sound of the rain was gentle and calming, but there was something turbulent under it: two voices, hushed and tense. She pushed herself up to sitting and pressed her long elf ear against the wall. "Was she not just screaming again?" This was Numa, Chief of the Joraga. "Screaming of an evil darkness?" He was talking about her vision! That meant he had heard. Nissa cursed herself for screaming so loudly; she knew the trouble it would cause. "What do we do when it comes looking for her, for us?" Numa asked. "Nothing is looking for anyone." This was her mother, Meroe. "It was never after anything other than random destruction." "Random? Your people angered Zendikar and they paid the price. There is a reason that you are the last of the animists." Nissa shivered, the dampness on her skin turning cold. "Zendikar is not vengeful," her mother argued. "If you believe that, you are blind. You and your daughter are putting all of us at risk. I cannot allow it." Nissa pulled her blanket up around her. This was not the first time that she had heard her mother and Numa argue about her visions, but she had never heard Numa speak in such a hard tone. "You understand that I must put the tribe first," he went on. "I must protect my people." "Are you…are you sending us away?" Her mother’s tone was disbelief. "I have no choice, Meroe. I cannot risk Zendikar’s retribution. I’m sorry. Truly, I am." Numa’s words were followed by the sound of his retreating footsteps. Her mother’s hurried footfalls followed. Nissa clutched the corner of her blanket, rubbing the soft spot over and over again. Her mind reeled. Numa was going to kick them out of the Joraga camp. Where would they go? What would they do? More, how could he do that to her mother after all Meroe had been through? Nissa’s heart ached at the thought of her mother suffering. She wanted to hate Numa, but she couldn’t blame him for protecting his people. He was right. She was a danger, the last of the animists and the only one remaining who still had visions. Her mother told her the visions were a gift. She said they were Zendikar’s way of talking to Nissa. But her mother did not understand. Meroe had never seen the darkness, she had never heard the writhing and gnashing, she had never felt the suffocating pressure, so she could not know. For many moons now, Nissa had believed that Zendikar was hunting her, and now Numa’s words confirmed her fears. Her visions were not a gift, they were a warning. Zendikar was speaking to her and its message was clear. It would have its retribution. It would finish what it had started with the animists. The dark knot was coming for Nissa, and that meant that anyone near her was in horrible danger. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Nissa slipped out of the house before her mother returned. The darkness was complete, the stars hidden by the clouds that were still sprinkling the land with rain. She packed light—her staff-sword, bow, arrows, bedroll, and a few provisions—she’d hunt on the way. The only other thing she brought with her were the bits of nature magic that she knew, which somehow seemed less impressive now as she was slinking through the darkness alone. When her feet wanted to turn around, she reminded herself of why she was leaving; she would not lead the horror to those she loved. When it came for her, it would find only her. Nissa didn’t stop or even slow until she saw the first hint of deep, blue light through the trees. She had kept such a pace that she would be ahead of any Joraga trackers by at least half a day, and that’s only if they could find her trail. But they wouldn’t. She had been using her nature magic to cover it, putting every last blade of grass back in its place. She glanced over her shoulder to reassure herself. Her spell had worked flawlessly; there was no sign that she had travelled here. Not even the most skilled tracker would be able to find her. #figure(image("005_Nissa’s Origin: Home/02.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) As the reality of that thought set in, Nissa’s mouth went dry. She took a deep breath, forcing down the feeling of dread, and turned forward to press on. "What the…?" Nissa squinted at the ground. Was it a trick of the light? She shielded her eyes from the dim pre-dawn. It was still there. A shimmering stream extended out in front of her. Nissa gasped. It was just like the stream of light from her vision. "No." Her stomach clenched. It was happening already—the stream would lead the dark knot right to her. She took a step back. It moved with her. "Stay away from me!" Nissa kicked at the stream and took off at a run in the other direction. But there it was in front of her again. She somersaulted and changed course. After two steps it was pointing to her once more. She turned a third time and leapt over a log. This time it was there before her first foot landed. When the sole of her boot touched the ground, the glowing stream swirled up to meet her. Before she could turn again, before she could run, it wrapped itself around her like a cocoon. It happened so fast that Nissa’s struggles were pointless. She went to reach for her sword, but her sword hand was bundled up in a sparkling tendril, floating weightless like her other limbs. She tried to twist her way out, she tried to panic, but neither worked. The embrace was so comforting, so calming that she couldn’t help but soften into it. It was telling her it would not hurt her, that it was not evil. But it was; she knew it was…wasn’t it? Her confusion turned to awe as the stream enveloped her completely. In that moment, deep in the heart of the Joraga forest, <NAME> connected with Zendikar. She understood then. The glowing stream of light and life was the land’s soul. And it was the most beautiful, most wonderful thing Nissa had ever touched. It eased her into a vision, guiding her gently into its thoughts, its memories, and its hopes. #figure(image("005_Nissa’s Origin: Home/03.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) #emph[The stream swirled around her, each of its jewels sparkling, but Nissa understood that they were more than just jewels; each sparkle was a living being. All the beasts, plants, and races of Zendikar were a part of the endless stream.] #emph[What was more, the stream was not just a stream, it was the land. It was the contours and the depressions. It was every blade of grass, every pebble of dirt, every grain of sand. It was everything, and it was all connected.] #emph[The glowing creatures frolicked around her, coming into focus as they passed by her eyes. She watched the baloth roar, the great jurworrel tree wave in the wind, the long, slender nectar snake slither across the ground, and the barutis bird soar through the sky. And then she saw an elf, an elf that looked very familiar.] #emph[It was a perfect, crystalline version of her.] #emph[The glowing Nissa walked along the streaming land. Each step she took sent shimmers through Zendikar’s soul. She followed the stream through the forest, picking up speed as she went, running faster, faster, leaping, and then flying. She crossed a desert, a bog, a mountain range, and then a hundred other places that flew by too quickly for Nissa to recognize.] #emph[Finally the stream slowed and the glowing Nissa came to rest. She stood on a rocky ledge, looking up at a mountain peak.] #emph[Inside the mountain, Nissa could hear the horrid writhing and buzzing, and she could sense the dark knot. She recoiled, fear rising up inside of her. Had this all been a trick?] #emph[But the glowing Nissa did not seem to be scared. She held her ground. She raised her hands, her palms facing the darkness. Her lips moved, but Nissa could not hear what she uttered.] #emph[And then, suddenly, a bright light blasted through the whole vision, consuming everything—the mountain, the knot, and the glowing Nissa.] When Nissa woke, the cocoon was gone. She was on the ground, and she was looking up at what seemed to be a pair eyes. "Nissa?" And a mouth. "Nissa?" The mouth formed her name again. It took another moment before Nissa recognized the voice. "Mazik?" Nissa struggled to sit up. "Are you okay?" "Yeah, I’m all right. I…wait." Nissa blinked up at her friend. "What are you doing here? Were you following me?" She jumped to her feet, her ears flicking around for signs of approach. "Don’t worry, no one else is here." "Do they know you came?" "Only your mom. I had to tell her when I saw you go." "Mazik!" "Don’t be mad. She was glad you went out into the forest. She thinks your visions will be clearer out here." "She said that?" Mazik nodded. "And she said she wants you to follow them. My dad and I do too. We believe in the animist ways. We believe your visions are important. You just had another one, didn’t you?" "You were watching me?" Nissa flushed. "The light…did you, did you see it?" "I did…" Mazik hurried on before Nissa could scold him. "But don’t worry, I’m not scared. I think it’s amazing." Mazik’s eyes were so hopeful that Nissa relaxed a little. "What did this one tell you?" Nissa looked into his familiar face, a face she had thought she might never see again, and she decided to trust her friend. "Oh, Mazik, everything I thought was wrong. Zendikar isn’t after me. It’s not after any of us. It’s not evil or vengeful. It’s magnificent. But it’s in pain. Something horrid is hurting it." She shivered at the thought of the dark knot. "And I think, I think…oh never mind, I don’t know what I think." "You think Zendikar wants your help to save it." "How did you know that?" Mazik pointed down to Nissa’s feet. The glowing stream of light was back. It was swirling around her legs playfully like an eager pet. Nissa’s heart soared at seeing it again. "Hello, Zendikar," she said. The stream trilled with excitement and shot up, whirling around her and Mazik like a funnel cloud. It blew their hair into the air and filled them with a feeling of enchantment. Before their hair even had a chance to settle, the light was tugging on their wrists, asking for them to follow. #figure(image("005_Nissa’s Origin: Home/04.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Nissa looked to Mazik. The stream tugged again. "Okay, okay, we’re coming," Mazik laughed. Together, they followed the stream of glowing light deeper into the forest. They agreed without having to discuss it that they would travel together. The stream of light, it seemed, wouldn’t have it any other way. Mazik could see it as long as Nissa was close by. If he wandered off to hunt or forage he reported that he lost sight of it, but as soon as he returned to her side, the path glowed for him again. Like an excited child, it showed them all the secrets and beauty of the forest: hidden alcoves, trees that twisted so high into the sky that their tops were lost to the clouds, vines that danced, and babbling brooks that sang sweet songs. It was like they were in a new land, a land of wonder. Nissa felt that she, too, was new. The bond she had made with the soul of Zendikar grew stronger with each step, and so did her magic. When she cast spells, even simple ones, they burst forth with flourish. The jaddi nuts she enchanted to light their way at night arranged themselves like the stars, forming the shapes of animals to guide them. When they encountered an angry tree stalker it only took a slight flick of her wrist to change its course and free them of worry. She moved the leaves of the trees to shelter them from rain, and she drew up the sweet nectar of the flowers to lift their spirits when they grew weary. But even amid all the wonder, Nissa couldn’t entirely shake the foreboding feeling that crept into the corners of her stomach. With every step they took they were getting closer to the darkness. And when they arrived at the mountain she would have to face the knot, for that’s what the glowing Nissa had done. But how? #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) After two days in the enchanted sanctuary, Nissa and Mazik reached the edge of the forest. The world beyond fell away, opening into a canyon land of red rocks, dry trees, and wind-scoured mesas. As they stepped out, it felt to Nissa like she was leaving home all over again. But this was where the stream of light was going; this was where it was leading her. The elves were not used to the bright heat of the sun. Their delicate skin was so accustomed to the protection of the forest’s canopy that it turned hot and red within hours. They drank all but a few drops of the water they were carrying before the first nightfall, and their feet ached from walking on the hardened ground. On the second day Nissa began to worry. She didn’t want to believe that the soul of Zendikar would lead them out here to their deaths, but if they didn’t get fresh water soon, their fates would be sealed. "Where are you taking us?" she asked the stream. "We’re thirsty." It only shimmered in response, leading them on through the canyon. By midday on the fourth day, Nissa was so hot and thirsty that, when they crested a hill and saw a vast marshland below, she let out a whoop of pure joy. The elves raced down the hill to the marshland, kneeling at the edge of a brackish bog. Nissa used her magic to draw out streams of pure, cool water. They drank until their bellies were full, and then they snacked on the wild mushrooms that grew along the bank, and drank some more.   Nissa was utterly content until Mazik spoke.   "Now we have to cross that?" he asked, pointing ahead. It was a rhetorical question; he could see the shimmering stream just as well as she, and it very clearly went straight through the bog.   "At least there’s water…" Nissa offered. She tried to sound cheerful, but her voice was tinged with fatigue. "Wasn’t there another way around?" she whispered to the glowing stream.   It twittered and shimmered and tugged her along as though it was completely unaware of their current predicament. And perhaps it was unaware, Nissa thought. It was the soul of the land after all; all of the land, not just part of it. The bog was as much a part of Zendikar as the forest was. With that thought came a sense of compassion, and Nissa’s eyes opened anew.   As they picked their way deeper into the marshland, Nissa formed a connection with it. She saw the beauty in the moss-laden trees, felt the magic in the mists that rose up from the brackish waters, and swayed to the song of the swarms of lion flies that circled them. She never would have believed a bog had so much to offer.   #figure(image("005_Nissa’s Origin: Home/05.jpg", width: 100%), caption: [Art by Tianhua X], supplement: none, numbering: none)   "Uh, I think we should get out of here." Mazik’s voice came from behind.   Channeling her new-found sense of love for the bog, Nissa ran her fingertips across the swardy surface of a nearby snap fern. "It’s okay Mazik, if you just open yourself to it you’ll see…."   "No, Nissa, we have to go…NOW!"   Nissa spun at Mazik’s shout. As she did, she caught a biting scent in the air: oil, unguents, death.   Vampires.   Mazik grabbed her arm and pulled her along, high-stepping through the muck.   "Where are they?" Nissa glanced about frantically as they ran.   "I don’t know." Mazik sniffed. "Everywhere!"   A hiss from behind made them both turn.   Five vampiric horrors loped after them. The biggest one, a shirtless male streaked in blood, led the charge.   "We have to get out of the bog! Help us!" Nissa cried as they ran.   The soul of Zendikar responded to her need. The stream of light cut a new path through the marsh, one Nissa knew would lead them to safety.   She ran like an arrow along the glowing stream, faster than she had ever run. The connection she had made to the bog allowed her to move through it like she did the forest; she leapt from log to log and swung on low-hanging vines to cross a dark ravine.   She felt the vampires’ presence recede even before she broke through a thick line of trees and out into a clearing.   Panting, she clutched her knees. The stream of light gathered around her feet, which were now on solid, non-bog ground again. "That was…close," she said between great gulps of air. "Did you see the teeth on that big one, Mazik?"   When he didn’t respond, Nissa looked up. "Mazik?"   Nissa’s racing heart plummeted. "Mazik!" Her call fell flat against the thick bog.   She turned to the glowing stream. "Where is he?"   Suddenly a sharp, strained cry sounded from the trees.   "No!" Nissa sprinted back into the bog. She did it without thinking, but a few steps in, her thoughts caught up with her feet; she was most certainly running toward her death. She shook off the cold fingers that tried to pull her back. She wouldn’t go back, not without her friend.   There were ten of them now. The reeking, shrieking vampires were circling one of the tallest trees. Nissa looked up into the branches. Mazik was clinging precariously to a bent perch, his arm bloodied.   With a spiting hiss, two of the nearest vampires sprang up toward him, securing handholds on the lowest branches.   "Get away from him!"   #figure(image("005_Nissa’s Origin: Home/06.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)   Nissa hadn’t realized she was going to call out. The sound of her voice startled the vampires too. They turned as one, and seeing her, their hungry eyes locked onto their new prey.   Nissa only had the space of a few heartbeats to react. Her instincts took over. She reached for the land, for Zendikar, channeling its power. She hoped to pull up a few roots, enough to make a barricade, enough to give her time to run. But rather than roots, she pulled up what felt like an entire tree. Though as it emerged, she realized it wasn’t a tree at all, it was the land itself.   It rose up in a wave, growing out of the muck and taking on form. It was as tall as a baloth. It charged at the vampires, teeth gnashing and legs flailing.   It took the first two out merely by crashing into them. It wasn’t until Nissa felt the pull at her fingertips that she realized the elemental was under her control. She directed it at a cluster of three vampires. It swiped with its massive paw, knocking them to the ground in a blast of green light.   There were five left. Nissa turned her elemental on them.   One tried to run, the big one, the leader.   "Oh no you don’t." Nissa summoned the bog’s dangling, dancing vines. They snapped to attention, making themselves into spears, and they pierced the vampire straight through his heart.   "Nissa? Nissa!" Mazik clambered down from the tree and ran to her with his arms open.   Nissa stepped into his embrace. They stayed that way for a long time, their hearts pounding against each other.   "You saved my life," Mazik finally said, pulling away enough to look into her eyes. "Thanks."   "Don’t mention it." Nissa tried to laugh, but it came out more like a hiccup.   "So yeah, you really…" Mazik pointed at the fallen vampires. "And then you…" He gestured to the land.   "Yeah, what was that?" Nissa mused.   "That," Mazik said, "is how you’re going to save Zendikar."   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)   They broke free of the swamp just before dawn. Nissa missed it more than she thought she would. She had grown attached to the muck and the saggy trees and the moss that covered every surface. Now they were in the foothills of Akoum, yet another new part of the land to learn.   Mazik encouraged Nissa to practice using her new powers. She agreed; it felt like the right thing to do. To hone her skills, she called together the detritus that littered the ground and lifted it to form a hovering canopy that shaded them, sending crevice miners and trench giants alike scattering away. She moved enormous boulders that blocked their path, and she made stairways and bridges out of the land so they could cross the deep canyons.   #figure(image("005_Nissa’s Origin: Home/07.jpg", width: 100%), caption: [Art by David Gaillet], supplement: none, numbering: none)   Mazik was convinced Nissa's magic was the key to destroying the darkness. He repeated back to her what she had told him of her most recent vision, citing the way that the glowing Nissa had lifted her hand and muttered what he thought must have been a spell.   Nissa wanted to believe him; she wanted to trust that she would be ready when they got to the mountain, that she would be strong enough, powerful enough to face the dark knot. She wanted to believe that she could defeat it, because she had to; Zendikar was counting on her, she could feel it in her soul.   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)   It happened deep in the forested mountains of Akoum just moments after Nissa had calmed a charging hurda’s violent tantrum. She came up short.   "What is it?" Mazik asked.   Nissa didn’t answer. She scanned the trees in front of her, searching, but it was gone. The glowing stream was gone.   "Nissa?" Mazik prompted.   "I don’t know—I lost it—do you see it?"   Mazik turned his eyes to the ground, searching along with her. "It was here just a moment ago."   Nissa knelt, feeling around for her connection, for the glowing soul, but there was no trace of it.   "Do you think we should backtrack?" Mazik asked. "Maybe we took a wrong turn."   "I don’t think so, I…" Nissa’s words were cut short when the land shifted beneath her. The shift was subtle at first, but very quickly the unstable feeling of vertigo grew along with a strange sense of incoherence.   Nissa realized it in the same moment Mazik said it. "The Roil! It’s happening!" He ran for the cover of a rocky outcropping that was protected by a large tree and Nissa followed.   #figure(image("005_Nissa’s Origin: Home/08.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none) Nissa had heard stories of the Roil, the force of Zendikar that consumed everything in its path. The stories didn’t seem to be exaggerations. Rocks were raining down around them and the land was shuddering and undulating like the violent waves of an ocean.   The elves lost their balance and tumbled to the ground. Nissa reached for Mazik’s hand and together they scrambled under the overhang. The world around them turned on its head. Trees twisted and bent, jutting out from the ground at odd angles. Boulders popped high into the air and slammed together, cracking and splitting and then hovering like long, jagged teeth. An immense force lurched and snaked through the land itself like a blind madman; roots, rocks, and soil warped and folded to its will.   "Nissa, you have to do something!" Mazik was looking to her like she held the secret, like she knew what to do. But she didn’t. Her connection to Zendikar was gone. She was just as scared as he.   A rock smashed down mere paces in front of them and splinters flew at their faces. Mazik shielded his eyes. "Please," he begged her. "Make it stop. Just try."   Another rock rained down and then another. If she didn’t do something, they would be buried alive.   "Okay, yes, okay, I will try." Nissa said the words more for herself than for Mazik. She placed her palms on the land. "Come," she whispered. "I need you. Please." She sent her own soul out, reaching for her connection, but there was nothing there. She dove deeper, extending her reach as far as she could. "Zendikar."   And then all at once it came to her, an overwhelming flood. It was cold and oppressive; it was fear. Nissa had found her connection, she had found the land, and the land was terrified.   She could see it then; the Roil wasn’t an alien force; the Roil was Zendikar’s reaction to the dark knot. It was the land rearing like a spooked horse. So horrified was it of the darkness that it had lost itself to fear.   #figure(image("005_Nissa’s Origin: Home/09.jpg", width: 100%), caption: [Art by Izzy], supplement: none, numbering: none)   "Hush," Nissa said. "Be at ease."   But the land did not respond. If anything it bucked more.   "It’s not working!" Mazik cried.   Boulders crashed into the overhang above their heads, sending chunks of rock raining down on them. It wouldn’t hold for much longer.   "Nissa, what do we do?" Mazik’s voice was filled with panic.   Nissa closed her eyes. She did the only thing she could think to do: she began to hum. It was an animist song, the tune that her mother had hummed to her so many times. She dwelled on each note, infusing it with peace, comfort, and reassurance.   When the song ended, everything became still and silent.   Nissa opened her eyes. The land had ceased moving mid-wave. Trees were caught tilting out like elbows. Rocks were paralyzed half-way up their trajectory, and trails of dirt hung like stars in the night sky. It was as though time had stopped.   And there before her was the glowing stream.   "You’re back," Nissa whispered. She offered her hand.   Tentatively, it rose up to meet her touch.   Uniting with Zendikar was everything.   Nissa had not realized how empty she felt without it until it returned to her. Now she was whole again; now she was home.   "I know you’re hurting," she said. "But I promise I will help."   The stream warmed in thanks.   "I need you to show me, though. I need you to show me where to go."   The stream swirled around her fingers and then, with a quick flick, it dove down into the land.   Nissa worried that she had scared it off again, but a heartbeat later, the land began to pop and tremble. It called to it all of the free bits and pieces: leaves, grass, twigs, dirt, and stone. They came from everywhere, rushing toward one singular point as though they couldn’t get there fast enough.   First a head emerged with a long snout cut out of rock, then a neck followed by two stocky legs.   Nissa took a step back as a fully formed elemental stepped out of the earth.   "Nissa?"   Nissa blinked at the sound of Mazik’s voice, and with her blink, time resumed. But the chaos did not. The land calmed, the trees and the rocks fell back into place, and the wind picked up again.   The elemental stood before them. Its nose was glowing; Nissa recognized the glow as the light of the stream. Zendikar had come to her. Even here, even in this place so close to the darkness, even though it was scared—it had come to guide her.   "Thank you," she said.   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)   Nissa and Mazik followed the elemental just as they had followed the glowing stream. It led them up into the mountains and through the high, jagged peaks known as the Teeth of Akoum. Nissa had a sense that she had been here before. Certain rock formations seemed familiar and images from her visions flashed before her. They were getting close.   For days they traversed the mountainscape, taking breaks only for the necessities—to hunt and forage, to eat, mostly slugs, to refill their water supply, and rarely, to sleep. They couldn’t sleep much, and when they did they both had nightmares, nightmares of painful, writhing darkness.   Nissa worried about Mazik. His steps had slowed and his breathing grew heavier each day. She kept a close eye on him, for it seemed that the knot was hurting him more than it was hurting her.   Early one evening just as the sun was dipping under the highest peaks and the sling-tail nighthawks were beginning to rustle in their perches, the elemental stopped. It pawed the ground anxiously and reared its head, nodding at a tall column of rock.   "What is it?" Nissa asked, inching closer to the corner.   The elemental backed away. Nissa peered around the rock and her breath caught.   Huge, diamond-shaped stones floated in the air, hovering in unsettling stillness, each one spaced with an unnatural perfection and held there by what must have been an immense magical force. The sun reflected off the strange markings on their flat sides. They formed a ring around the highest peak of Akoum.   "We’re here," Nissa said. She knew the peak well from her vision; that was where the dark knot was.   "Nissa." Mazik’s voice was weak. She turned to see him stagger and fall.   "Mazik!" She rushed to him.   "Something’s wrong. I don’t know…" He clasped a hand his to his face as blood dribbled from his nose.   "It’s the dark knot." Nissa pulled Mazik back around the corner. "We have to get you away from it."   "No." Mazik held up a quivering hand. "No, Nissa. You’re finally here. You have to go. You have to help."   Nissa looked from Mazik to the elemental that was bucking and trembling. It was clear to her that neither could go any further. Whatever she did next, she would have to do alone. Her heart broke at the thought of leaving them.   "It’s okay, Nissa." Mazik spoke in a tone that said he understood. "I want you to go. I’ll be okay. We’ll be okay." He rested his hand on the elemental’s thick, rocky leg and its trembling lessened.   "You’ll be okay," Nissa agreed.   She helped Mazik up onto the elemental’s back, and she laid her hands on both of her friends. "Be safe," she said, sending a calming stream of magic to them.   "Be strong, <NAME>," Mazik whispered.   The elemental’s nose glowed as it padded away down the path. To stop herself from following them, Nissa turned back to the mountain, and she took her first step toward the darkness.   After the first step, she did not stop. She could not allow herself to pause or she feared she would not work up the courage to continue. She approached the ring of glowing stones and then she hurried under them, skirting their shadows. Once inside she slowed and stared up at the towering peak, the highest peak of Akoum.   This was it; she had arrived. The dark knot was here waiting for her.   It buzzed and writhed, making noises that scratched at the inside of her ears. She hated it then. She hated it for what it had done to Zendikar, for what it had done to the animists, and for what it had done to Mazik.   She circled the peak, climbing slightly higher with each step. She was feeling out the knot, planning her attack. Though there wasn’t much to plan. She had decided days ago that when the time came she would do just as the glowing Nissa had done. And so she did.   She found the spot, the same ledge that the glowing Nissa had stood on, and she planted her feet on the ground.   "I call on you now, Zendikar," she said. "I am here to rid you of this darkness." With that she reached down deep into the land. She knew that the stream would not be easy to find here, that it would not dwell so close to the knot it feared, but she also knew that it would come to her call.   It seemed to understand the importance of the moment, for she did not have to reach quite as deep as she thought to find it. Once she connected with Zendikar she drew upon its power. She pulled it into her, as much power as she could hold…and then more. She didn’t stop until her chest felt as though it would burst.   Then she lifted her hands, oppressively heavy with power, and sent forth a blast so great that the entire sky filled with the energy she had summoned. She screamed with the effort and stumbled back, straining to hold her hands up as the power flowed from her.   When the last of the magic had drained from her fingertips she sucked in a long breath and looked to the mountain. She expected to see a ruined peak, a crack from which darkness was oozing out; she expected to face her enemy, and for that she was prepared. But she need not be. The mountain was unblemished and the darkness was still writhing inside; it was as though her spell had done nothing.   "How?"   The dark knot contorted and gnarled in a way that sounded like evil laughter. The scratching cackle pulsed forth in a shockwave of madness that rushed Nissa, piercing her eyes and burning through her psyche. It showed her everything. She saw what was inside the mountain, she saw what it wanted, she saw what it had done.   She saw the monster.   Nissa screamed again, this time in terror, and she crumpled to her knees as wave upon wave of monstrous madness washed over her.   Just when she thought she would not survive another wave, something inside her cracked, like an egg breaking open, and a warm, thick, all-consuming force spilled out of the crack. It surged through her with an unmatched intensity, greater than the madness of the monster—capable of ripping her apart from the inside, capable of ripping apart the very fabric of Zendikar.   It was over then. This was the end for her. She had not destroyed the darkness; it had destroyed her.   Nissa let go.   #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em)   What happened next was impossible for Nissa to understand. Excruciating pain shot through her, and Nissa was sent hurtling out into a void. She saw light and energy, swirls and holes. There was no up or down. There was no land or sky. It was black and then it was bright. She was tumbling, but there was no way to stop; there was nothing to hold on to. If this was her end, she wanted it just to end. She didn’t want to suffer anymore. She squeezed her eyes shut and curled into a ball, clutching her legs to her chest.   And then suddenly there was solid ground beneath her. It had come out of nowhere. Had she landed back on the mountain again?   When her heart settled slightly, she risked cracking her eye open, the right one.   The left opened only a moment after the right; there was too much for just one eye alone to see. The colors were vivid and unprecedented, in shades she had never seen before. The shapes of the plants and trees were also foreign, their leaves and the texture of their bark unidentifiable. And then there was the smell. It was at once sweeter and heavier than any scent she had ever known.   She was not on the mountain. She was in a forest, but it wasn’t a forest on Zendikar. Something told her she was very, very far away from Zendikar.   There was a flutter of relief that accompanied the realization; she was not in the same place as the monster. She had escaped the dark, knotted madness, escaped the pain. But the relief was followed closely by a sense of failure. She had broken her promise to Zendikar. She had faced the darkness, and she had lost.   "No!" Nissa slammed her fist into the ground in rage. When she did, the land reacted. Something inside of it jumped up to meet her and it pulled her in.   #emph[She fell into this new land. Lorwyn, it called itself. It was nothing like Zendikar. The only thing the two worlds shared was that they were both worlds, beyond that they were as different as two snowflakes, each with its own markings, its own ways, its own inhabitants. Where Zendikar embraced her, this land was standoffish. Where Zendikar was playful, this land was somber.]   #emph[But they were both in pain.]   #emph[How? Nissa wondered. How could there be so much pain, so much darkness, so much evil?]   #emph[The evil in this land was not far under the surface. It was bubbling up, ready to release; a thousand shadowy spiders had been growing and now were chewing through their silken egg casings.]   #emph["The Great Aurora brings the night] …#emph[as Death reveals its door] …#emph[shadows fast obscure the light] …#emph[unleashing Shadowmoor."]   #emph[The spider-things hissed.]   #emph[Nissa shuddered. "Get back." She swatted at the shadows.]   #emph["We will not go back. It is our time. We are coming. Soon everything will be ours."]   #emph[A wave of crawling darkness washed over Nissa.]   Nissa woke to a circle of scowling faces and realized that she had been screaming, again. The faces were elf-like, but the beings had horns growing out of their heads and hooves instead of feet. Their swords and spears were leveled at her.   #figure(image("005_Nissa’s Origin: Home/10.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)   The group muttered as they looked at Nissa with a mixture of suspicion and curiosity.   "No horns?"   "No hooves."   "Look at her eyes!"   "Her eyes are glowing!"   "Stay back." This voice was firm and strong and it came from a tall, poised female, clearly the leader. She brandished her sword, its tip coming inches from stabbing Nissa’s nose.   Nissa started and let out a small squeak.   "Enough with the noises," the strange elf said. "Do you want to ruin our hunt?"   "Y-your hunt?" Nissa asked, confused.   "The blight hunt. Those horrid creatures will flee if you keep up your screaming like a banshee."   "Yes!" Nissa jumped up. "You know of the blight too! I saw them. They’re coming. They said they were going to take over everything."   "Ha! Did they now? They think they could stand against us?"   "You won’t let them?"   "You’re not from around here, are you, little elfling? This is our land, my land. And we will not let those horrors poison its beauty. Do you hunt?"   "I…I do, but I don’t know…."   "Eyeblights on the right!" one of the elves shouted from behind the leader.   "Now’s your chance, you strange, beautiful, green-eyed creature," the leader said to Nissa. "Take up your blade and prove yourself." With that, she charged into the thicket of trees on the right.   "My blade." Nissa unsheathed her sword. "Yes." Something felt so right about this, about the charge and the hunt. This was what was supposed to happen when a land was threatened.   She ran into the trees after the hooved elves of Lorwyn.   A male elf, not much older than Nissa, caught her eye as she entered. He held up his hand and motioned for her to move to the fringe of the trees. She did so without making a sound.   Together, they crept along the perimeter of the thicket. Nissa could hear a grunting, yapping sound like wild pigs or goblins.   "They’re close." The male elf smirked. "I’m Galed by the way."   "Nissa," Nissa said.   "Nice to meet you. It looks like you’ve caught Dwynen’s eye. She doesn’t make a habit of inviting strange elves along on her prized hunt. But I can see why she let you tag along. You’re one of the most beautiful creatures I have ever seen." Galed leaned in as he spoke and breathed in Nissa’s scent.   Nissa shuddered at his closeness. There was something intoxicating about the moment—these elves, this place, the hunt for evil. In a way, she felt like she was finally where she belonged.   "There it is!" Galed said. A heartbeat later he sprang out from the trees and jabbed with his spear.   Nissa pounced behind him, landing next to him just in time to see him slash the throat of a small creature that yelped in fear.   "There’s more! Get them!" Galed pointed.   Nissa dove on top of another small creature her blade raised, ready to strike. But something stopped her.   This wasn’t one of the evil spider-creatures from the cocoon in her vision. This was a squat creature with greenish-gray skin that was all lumpy and warty. Two eyes bulged out of its head in a toad-like masquerade, and its mouth flapped open and shut as it tried to make a sound.   Nissa was frozen, her hunter’s instinct halted by the look in its eyes.   "D-d-don’t kill," the little creature stammered. "P-p-please."   There was no way that Nissa could slaughter this innocent creature. She jumped off of it and it scampered away. "Galed!" she shouted. "What are you doing? These aren’t the evil!"   Galed didn’t hear a word; he was lost in the heat of bloodletting, dispatching one creature after another.   "Galed! Stop!" Nissa ran for Galed as he cornered yet another one.   #figure(image("005_Nissa’s Origin: Home/11.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)   The small creature squealed for mercy.   "Don’t hurt it!" Nissa cried.   But she was too late, his spear sunk into the creature’s chest.   "No!" Nissa sank to her knees next to the small body. The creature blinked up at her, its eyes wet and lost.   Nissa’s hands fluttered around it, unsure of where to move or what to do. There was nothing to do. She rested her palm on its forehead. "I’m sorry," she said. And in that moment she connected with the strange creature. She felt its place in the glowing stream of life that was Lorwyn’s soul. She felt its hopes and dreams, its fear; she felt its pain and suffering. And then she felt it die.   "Why?" Nissa jumped to her feet and spun around. Galed was standing so close she could feel his hot breath on her cheeks. He must have been watching her. Good. "Why did you kill it?"   "Because the boggarts are a blight."   "They’re not a blight. They’re living things. They’re part of this land. You’re an elf! An elf!"   "And you’re insane." Galed looked down at his chest.   Nissa followed his eyes and realized that her blade was poking his garment right over his heart. She saw it but she didn’t lower it. "There is so much evil," she said. "So much darkness already. I’ve seen it. I’ve seen it all. It’s horrible. It’s awful." Tears welled in her eyes as she thought of her precious Zendikar. "Yet you insist on adding more."   "Get away from him!" Dwynen’s voice cut through the woods. She stormed up to Nissa. "What are you doing?"   #figure(image("005_Nissa’s Origin: Home/12.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)   "What are #emph[you] doing?" Nissa spat back. She turned from Galed to Dwynen. "You cannot kill these innocent creatures. I will not let you."   Dwynen drew back her bow. "How dare you?" she said. "How dare you come to my forest and tell me what I can do?" She nodded and Galed lunged at Nissa.   Nissa dodged and spun away from the attack. She held up her blade to block a second strike, but it never came.   Both Galed and Dwynen stood shocked, staring ahead, their mouths hanging open.   Nissa turned slowly, dreading what she would see. Her worst fears were realized.   A towering wall of twisted, squirming night was approaching them. As it moved across the land it left dark destruction in its wake.   #emph["Shadowmoor," ] the darkness hissed.   "No!" Dwynen gasped. "Not my Lorwyn. Not my beautiful Lorwyn!" She summoned her magic and blasted a spell at the approaching darkness. Galed followed suit.   Nissa stepped up next to them, reaching down for her own magic.   "What are you doing?" Dwynen glared at Nissa.   "I’m helping you!"   "You’re not helping. This is all your fault! Witch!" In one motion, Dwynen threw Nissa to the ground and landed with her knee on Nissa’s chest.   "I didn’t do this," Nissa choked out. "Let me help, please. Maybe together we can…."   Dwynen pressed a nocked arrow to Nissa’s throat. "You destroyed my world!" She moved to release the bowstring, but just as she did, the wall of darkness touched her.   Dwynen was paralyzed, caught in the Great Aurora of Shadowmoor. She changed before Nissa’s eyes, darkening and hardening.   Before the dark wall could touch her too, Nissa slid out from under the tip of Dwynen’s arrow, sprang to her feet, and ran.   #emph["Where are you going, pretty little elf] ?" the dark voice hissed in her mind.   Nissa didn’t look back. She just kept running—she kept running and thinking of Zendikar.   #emph["Oh, you want to go home, do you? But what will you do when you get there? You’re powerless against the evil that haunts Zendikar."]   Nissa’s steps slowed, but for just a heartbeat. She forced herself to press on; she was only barely avoiding the wall of shadow.   #figure(image("005_Nissa’s Origin: Home/13.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)   "Zendikar, Zendikar, Zendikar," she chanted.   She felt the spark inside her, the one she had felt at Akoum before she had been hurtled into the void. It had ignited again and it was tearing her apart from the inside.   #emph["You will regret it if you go,"] the voice said. #emph["You will fail. Again."] No. She would find a way. She just had to get there. Nissa charged through the pain toward the place where she could feel the world opening to let her out. #emph["Stay here, little spark walker, stay and join me. I will make you more powerful. I will give you what you need to save your precious Zendikar."] The void had opened. It was right in front of her, and Nissa stood at the threshold. She could see the swirling eternities on the other side. All she had to do was step through. But she hesitated. #emph["Stay, Nissa, stay with me forever."] That was the thing though, wasn’t it? If she stayed, she would never leave. She would be powerful, yes, but she would lose herself, and she would lose her connection to her land. If she stayed, she would lose Zendikar. In Nissa’s moment of clarity, a thread extended before her. It was like the glowing stream of light she had come to know so well, but much brighter and thicker. It ascended to meet her. This was her path. It was the very thing that she had been searching for all her life. She reached out with a trembling hand and took hold of it. It pulled her with great force through the tear in the fabric of Lorwyn and out into the void. As she tumbled into the vast space, she saw her path unravel through the eternities. It would lead her many places, but for now it would lead her home. #figure(image("005_Nissa’s Origin: Home/14.jpg", width: 100%), caption: [Art by <NAME>], supplement: none, numbering: none)
https://github.com/yochem/apa-typst
https://raw.githubusercontent.com/yochem/apa-typst/main/examples/multi-author-multi-affiliations.typ
typst
#import "../template.typ": apa7 #show: apa7.with( title: "Example of APA7 Document in Typst", authors: ( (name: "<NAME>", affiliations: (1,)), (name: "<NAME>", affiliations: (2, 3)), (name: "<NAME>", affiliations: (1,)), ), affiliations: ( "Educational Testing Service, Princeton, New Jersey, United States", "MRC Cognition and Brain Sciences Unit, Cambridge, England", "Department of Psychology, University of Cambridge", ), ) #lorem(40)
https://github.com/andrin-geiger/hslu_template_typst
https://raw.githubusercontent.com/andrin-geiger/hslu_template_typst/master/chapters/05_realization.typ
typst
= Realisierung #pagebreak()
https://github.com/typst-community/harbinger
https://raw.githubusercontent.com/typst-community/harbinger/main/README.md
markdown
MIT License
# harbinger A package for shadow boxes in Typst.
https://github.com/gtn1024/resume
https://raw.githubusercontent.com/gtn1024/resume/master/resume.typ
typst
#import "lib.typ": * #show: resume.with( author: ( firstname: "葛", lastname: "涛宁", email: "<EMAIL>", homepage: "https://gtn1024.me", // phone: "(+1) 111-111-1111", github: "gtn1024", // twitter: "typstapp", // scholar: "", birth: "2002/10", // linkedin: "Example", // address: "111 Example St. Example City, EX 11111", positions: ( "后端开发工程师", "全栈开发工程师", ), ), date: "", language: "zh", colored-headers: true, font: "PingFang SC" ) #show link: set text(fill: blue) = 实习经历 #resume-entry( title: "后端开发工程师", // location: "Example City, EX", date: "2024 年 6 月至今", description: "厦门代码源教育科技有限公司", // title-link: "https://github.com/DeveloperPaul123", ) #resume-item[ - 独立开发程序设计竞赛数据库平台 CPC Finder。 - 开发工单平台,便于用户在使用平台时遇到问题时,可以获取到技术支持。后端与前端之间使用 #strong("WebSocket") 进行通信,实现实时答疑功能。同时,管理员可以在后台查看工单处理情况,便于后续的数据分析、相关人员的绩效考核等。 ] = 项目经历 #resume-entry( title: "CPC Finder", location: [#link("https://cpcfinder.com")], // description: "厦门代码源教育科技有限公司 - 全栈开发", ) #resume-item[ - 主要用于查询程序设计类竞赛(如 ICPC、CCPC)选手的比赛经历,支持通过学生姓名、学校等方式进行搜索 - 项目后端使用 #strong("Quarkus") 框架进行开发 - 使用 #strong("Hibernate ORM") 进行数据库操作,#strong("Flyway") 进行数据库版本控制,使用 #strong("PostgreSQL") 作为数据库 - 使用 #strong("Docker/TestContainers") 构建测试环境,编写单元测试、集成测试。并使用 GitHub Actions 进行 #strong("CI/CD") - 使用 JaCoCo 进行代码覆盖率测试 - 前端使用 #strong("React.js")、#strong("Tailwind CSS")、shadcn/ui 等技术进行开发 ] #resume-entry( title: "NTOJ - 基于 Spring Boot 和 React.js 的分布式 OJ 系统", location: [#github-link("gtn1024/ntoj")], // date: "2023 年 6 月 - 2024 年 5 月", // description: "全栈开发", ) #resume-item[ - 分布式架构的在线评测平台,可随意增删后端节点、评测节点。通过 #strong("HTTP 协议") 实现后端与评测节点的通信。 - 使用 #strong("RBAC") 模型进行用户授权,支持在后台动态创建用户角色、动态选择用户角色权限。 - 获得软件著作权(#strong("针对编程学习的综合智能教辅平台"))一项,登记号:#strong("2024SR0872447") ] #resume-entry( title: "基于 Spring Boot 和 Vue 的 ACM 校队管理平台", location: github-link("nytdacm-dev/oa"), // date: "2023 年 2 月 - 2023 年 5 月", // description: "全栈开发", ) #resume-item[ - 使用 Apache HttpComponents、Jsoup 等库开发网络爬虫,对于竞赛平台数据进行爬取,便于校队内部训练管理 ] = 技能清单 - RTFM、STFW、STFSC - 熟练掌握 #strong("Java")、#strong("Kotlin")、JavaScript、TypeScript 等编程语言。 - 熟练掌握 #strong("Spring Boot") 框架,熟悉 #strong("Gradle")、Maven 构建工具 - 熟悉 #strong("Git") 工具,能够使用 bisect、rebase 等高级命令。熟练使用 GitHub、GitLab、云效等代码托管平台 - 了解 Vert.x、Quarkus 等异步 / 响应式开发框架 - 了解 MySQL、PostgreSQL、Redis、MongoDB 等数据库,熟悉 SQL 语言 - 了解计算机网络的基本知识,熟悉 HTTP、TCP/IP 协议 - 掌握 Linux 操作系统,熟悉 #strong("Docker")、#strong("GitHub Actions") 等 CI/CD 工具 - 熟悉 #strong("React.js")、Vue.js 等前端开发框架 - 了解 #strong("仓颉编程语言"),开发的 #strong(link("https://github.com/gtn1024/snowflake4cj", "snowflake4cj"))、#strong(link("https://github.com/gtn1024/cjdotenv", "cjdotenv")) 均已进入 #strong(link("https://gitcode.com/Cangjie-SIG/", "仓颉官方 SIG 组织")) 孵化。 = 荣誉奖项 #resume-certification("第 48 届国际大学生程序设计竞赛(ICPC)亚洲区域赛(杭州)铜牌", "2023/12") #resume-certification("第 14 届蓝桥杯大赛 C/C++ B 组国赛三等奖", "2023/05") #resume-certification("2023 江苏省大学生程序设计竞赛(JSCPC)铜牌", "2023/05") #resume-certification("2023 团体程序设计天梯赛团队三等奖", "2023/04") #resume-certification("第 4 届计算机能力挑战赛 Java 组国赛一等奖", "2022/12") #resume-certification("第 13 届蓝桥杯大赛 Java B 组省赛二等奖", "2022/04") = 教育经历 #resume-entry( title: "南京邮电大学通达学院", location: "江苏扬州", ) #resume-item[ #block[ #box[ === 网络工程(嵌入式培养) #box(width: 1fr)[ #align(right)[ 2021 年 9 月 - 2022 年 6 月 ] ] ] #box[ === 软件工程 #box(width: 1fr)[ #align(right)[ 2022 年 6 月 - 2025 年 6 月 ] ] ] ] ] #resume-item[ - 主修课程:#strong("软件工程")、#strong("软件体系结构")、#strong("UML系统分析与设计")、#strong("数据结构")、#strong("算法分析与设计")、#strong("计算机网络")、#strong("数据库系统")、高级语言程序设计、面向对象程序设计 - 平均绩点 4.13/5.0,专业排名前 10% - 获得 #strong("三好学生 1 次")、#strong("二等奖学金 2 次") - 在校期间,取得 #strong("CET-4")、#strong("CET-6")、#strong("江苏省计算机二级") 等资格证书 - 多次参与迎新志愿服务 ] = 校园经历 #resume-entry( title: "南京邮电大学通达学院程序设计校队", // location: "江苏扬州", date: "2023 年 2 月 - 2024 年 8 月", description: "主要负责人", ) #resume-item[ - 多次开展程序设计宣讲会,主管 2023 年程序设计校赛(秋季赛)、2024 年程序设计校赛(春季赛)出题。 - 多次组织安排程序设计校队日常、寒暑假集训,为程序设计校队更换全新的 OJ 平台,负责校队 OJ 的 #strong("运维")。 ] #resume-entry( title: "南京邮电大学通达学院大学生科学与技术协会", // location: "江苏扬州", date: "2022 年 6 月 - 2023 年 5 月", description: "信息技术中心部长", ) #resume-item[ - 开发全校统一社团招新系统。 - 同时为本部门的后端组开展 Java 基础培训。 ]
https://github.com/heytentt/typst-cv
https://raw.githubusercontent.com/heytentt/typst-cv/main/README.md
markdown
MIT License
# typst-cv ## How to compile? Two ways: 1. Official web app: https://typst.app 2. or `typst` command line, recommend VS Code & typst plugin: 1. Install typst: `brew install typst`, other platforms see https://github.com/typst/typst 2. Compile: `typst compile file.typ`
https://github.com/mrtz-j/typst-thesis-template
https://raw.githubusercontent.com/mrtz-j/typst-thesis-template/main/template/utils/symbols.typ
typst
MIT License
// TeX and LaTeX logos #let TeX = { set text(font: "New Computer Modern", weight: "regular") box( width: 1.7em, { [T] place(top, dx: 0.56em, dy: 0.22em)[E] place(top, dx: 1.1em)[X] }, ) } #let LaTeX = { set text(font: "New Computer Modern", weight: "regular") box( width: 2.55em, { [L] place(top, dx: 0.3em, text(size: 0.7em)[A]) place(top, dx: 0.7em)[#TeX] }, ) } #let BibTeX = { set text(font: "New Computer Modern", weight: "regular") box( width: 3.4em, { [Bib] place(top, dx: 1.5em)[#TeX] }, ) }
https://github.com/alimitedgroup/alimitedgroup.github.io
https://raw.githubusercontent.com/alimitedgroup/alimitedgroup.github.io/main/verbali/esterni/2024-10-23_2.typ
typst
// VE 23-10-2024_2 #import "../../lib.typ": * #set text(lang: "it") #show: doc => verbale( data: [23-10-2024], tipo: [esterno], regmodifiche: ( /*("1.0.0", "2024-10-15", "Sam<NAME>", "-", "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 _Ergon_: vengono sciolti dubbi sorti durante la presentazione del capitolato], doc, )
https://github.com/v1j4y/intro_qmech
https://raw.githubusercontent.com/v1j4y/intro_qmech/master/intro_huckel.typ
typst
#import "template.typ": project #import "@preview/physica:0.8.1": * #import "@preview/cetz:0.1.2" #import "@preview/showybox:2.0.1": showybox #show: project.with( title: "Introduction to Model hamiltonians", authors: ( (name: "<NAME>", email: "<EMAIL>", affiliation: "University of Aix-Marseille", postal: "Avenue Escadrille Niemen - 130013", phone: "+33413945595"), ), abstract: [A simple introduction to model hamiltonians for quantum chemists.] ) #set math.equation(numbering: "1.") = Introduction Model hamiltonians are of premordial importance for understanding chemical and physical behavior of molecules and materials. Here, we shall briefly describe the various models and their formulation in as simple terms as possible. = Derivation of the Schrodinger equation The schrodinger equation can be derived using the path integral formulation as shown by Feynman.@feynman1948 == Lagrangian In order to demonstrate the derivation by Feynman, one needs to first define the notion of the lagrangian @eq:deriv1. $ L = T - V $ <eq:deriv1> Where, $T$ is the kinetic energy and $V$ is the potential energy. //#showybox( // title: "Stokes' theorem", // frame: ( // border-color: blue, // title-color: blue.lighten(30%), // body-color: blue.lighten(95%), // footer-color: blue.lighten(80%) // ), // footer: "Information extracted from a well-known public encyclopedia" //)[ // Let $Sigma$ be a smooth oriented surface in $RR^3$ with boundary $diff Sigma equiv Gamma$. If a vector field $bold(F)(x,y,z)=(F_x (x,y,z), F_y (x,y,z), F_z (x,y,z))$ is defined and has continuous first order partial derivatives in a region containing $Sigma$, then // // $ integral.double_Sigma (bold(nabla) times bold(F)) dot bold(Sigma) = integral.cont_(diff Sigma) bold(F) dot dif bold(Gamma) $ //] // //// First showybox //#showybox( // frame: ( // border-color: red.darken(50%), // title-color: red.lighten(60%), // body-color: red.lighten(80%) // ), // title-style: ( // color: black, // weight: "regular", // align: center // ), // shadow: ( // offset: 3pt, // ), // title: "Red-ish showybox with separated sections!", // lorem(20), // lorem(12) //) In order to better understand the lagrangian and its relation to Newton's equations of motion, in @eq:deriv2, @eq:deriv3 we derive the equations of motion in lagrange formulation and its connection to the usual newtons equations of motion. $ L(r, dot(r)) &= T - V \ L(r, dot(r)) &= sum_i frac(1,2)m dot(r)_i^2 - V(r_1,...,r_n) \ $ <eq:deriv2> where, $r$ is the position and $dot(r)=frac(d r,d t)$ is the velocity. Using this definition of the lagrangian, we can derive the so called Euler-Lagrange equation which is equivalent to Newton's equation @eq:deriv3. $ frac(d, d t)(pdv(L,dot(r)_i)) - pdv(L,r_i)&= 0 $ <eq:deriv3> Where, the second term on the left of @eq:deriv3 is the derivative of the potential i.e. the force (@eq:deriv4). $ pdv(L,r_i) = pdv(V(r_1,...,r_n),r_i) = F_i $ <eq:deriv4> and the first term of @eq:deriv3 is the acceleration (@eq:deriv5). $ pdv(,t) pdv(L,dot(r)_i) = m pdv(dot(r)_i,t) = m a_i $ <eq:deriv5> where, $a_i = dot.double(r)_i$. Therefore @eq:deriv3 is equivalent to Newton's equation (@eq:deriv6). $ F_i = m a_i $ <eq:deriv6> == Action The action is defined as the integral of the Lagrangian along a specific path between two points, $A$ at time $t_a$ to point $B$ in time $t_b$ @eq:action1. $ S[r(t)] = integral_(t_a)^(t_b) L(r(t),dot(r)(t)) d t $ <eq:action1> The action is an important quantity and describes the weight and phase of each path. Using the action, we can derive the @eq:deriv3. This can be done using the principle of least action which says that the path that survives is the one that minimises the action @eq:action2. $ integral_(t_a)^(t_b) delta L d t &= 0 \ delta S &= 0 $ <eq:action2> The derivation of @eq:deriv3 follows from the above @eq:action2 once it is simplified using integration by parts (@eq:action3). $ integral_(t_a)^(t_b) delta L d t &= integral_(t_a)^(t_b) sum_i^n ( pdv(L,r_i) + frac(d ,d t)(pdv(L,dot(r)_i)) - frac(d, d t) pdv(L,dot(r)_i) ) d t\ &= sum_i^n [ pdv(L,dot(q))delta q_j ]_(t_a)^(t_b) + integral_(t_a)^(t_b) sum_i^n ( pdv(L,r_i) - frac(d, d t)(pdv(L,dot(r)_i)) ) d t $ <eq:action3> Therefore, if $integral_(t_a)^(t_b) delta L d t = 0$, the left hand side of @eq:action3 is $0$. All terms of @eq:action3 including the value of the integral. This implies @eq:deriv3. == Postulates of Feynman Feynman put forth two postulates to derive the schrodinger equation. @feynman1948 #showybox( footer-style: ( sep-thickness: 0pt, align: right, color: black ), title: "Feynman's postulates of Quantum Mechanics: Postulate I", footer: [ Note that the sum is over all possible paths $r_i (t)$ which are possible to take from point $r_0$ to $r_1$ in time $t_0$ to $t_1$. ] )[ The first postulate says that the total action is the sum of the actions of individual paths, i.e. @eq:postul1. $ S = sum_i S[r_i (t)] $ <eq:postul1> ] #showybox( footer-style: ( sep-thickness: 0pt, align: right, color: black ), title: "Feynman's postulates of Quantum Mechanics: Postulate II", footer: [ where the integral is over the region $R$ which contains all the paths. ] )[ The second postulate says that the wavefunction $phi$ can be be expressed as an exponential function of the position $r(t)$ and its first deriavtive $dot(r)(t)$, i.e. @eq:postul2. $ phi(x_k,t) = lim_(epsilon arrow.r 0) integral_R exp( epsilon frac(i,hbar) sum_i S[r_i (t)]) ...frac(d x_(i-1), A) frac(d x_(i-2), A)... $ <eq:postul2> ] == Derivation The equation of motion describes the evolution of the wavefunction $phi(x_(k+1),t)$ from time $t$ to time $t+epsilon$ (@eq:deriv7). $ phi(x_(k+1), t + epsilon) = lim_(epsilon arrow.r 0) integral_R exp( frac(i,hbar) sum_i S[r(t)_i]) ...frac(d x_(i), A) frac(d x_(i-1), A)... $ <eq:deriv7> Using the definition of $phi(x_k, t)$ given in @eq:postul2, we can use it to obtain the wavefunction at time $t+epsilon$ (@eq:deriv8). $ phi(x_(k+1),t+epsilon) = [ integral_R S[x_(k+1),x_k]] phi(x_k, t)frac(d x_k, A) $ <eq:deriv8> The integral in @eq:deriv8 can be interpreted as the hamiltonian once we substitute the action (@eq:deriv9). $ S(x_(k+1),x_k) = frac(m epsilon,2) (frac(x_(k+1)-x_k,epsilon))^2 - epsilon V(x_(k+1)) $ <eq:deriv9> now the @eq:deriv8 becomes, $ phi(x_(k+1),t+epsilon) = [ integral frac(m epsilon,2) (frac(x_(k+1)-x_k,epsilon))^2 - epsilon V(x_(k+1))] phi(x_k, t)frac(d x_k, A) $ <eq:deriv10> Expanding the wavefunction $phi(x_(k+1),t)$ around $x_k$ using the taylor series gives, $ phi(x_(k+1),t+epsilon) =\ exp(frac(-i epsilon V, hbar)) times integral exp(frac(i epsilon xi^2,2 hbar epsilon))[psi(x, t) - xi pdv(psi(x,t),x) + frac(xi^2,2) pdv(psi(x,t),x,2) - ...] (d xi)/A $ <eq:deriv11> where, $x_(k+1) - x_k = xi$. Expanding the left hand also around $xi$ gives. $ phi(x_(k+1),t) + epsilon pdv(phi(x,t),t)= \ exp(frac(-i epsilon V, hbar)) times integral exp(frac(i epsilon xi^2,2 hbar epsilon))[psi(x, t) - xi pdv(psi(x,t),x) + frac(xi^2,2) pdv(psi(x,t),x,2) - ...] (d xi)/A $ <eq:deriv12> The factors in the integrand on the right of @eq:deriv12 which contain $xi$, $xi^3$ etc are zero because they are odd integrals (@eq:deriv13). $ phi(x_(k+1),t) + epsilon pdv(phi(x,t),t)= \ exp(frac(-i epsilon V, hbar)) times sqrt(2 pi hbar i /m)/A [ psi(x, t) + frac(hbar epsilon i,2 m) pdv(psi(x,t),x,2) + ...] $ <eq:deriv13> Finally, equating the terms of same order in $epsilon$, we get @eq:deriv14 $ -hbar/i pdv(psi,t) &= 1/(2 m) (hbar/i pdv(,x) )^2 psi + V(x) psi \ -hbar/i pdv(psi,t) &= H psi $ <eq:deriv14> The above equation can be compared to the time dependent schrodinger equation. The time independent form describes stationary wavefunctions which is given as @eq:deriv15. $ H psi = lambda psi $ <eq:deriv15> = Discretization of the Hamiltonian The position operator can be written as shown in @eq:dis1 $ hat(q) phi(x) = x phi(x) $ <eq:dis1> Similarly, the momentum operator can be written as given in @eq:dis2. $ hat(p) phi(x) = -i pdv(phi(x),x) " " " " (hbar"= 1 in a.u") $ <eq:dis2> Both these operators can be discretized on a uniform grid of a fixed number of points separated by a distance $d$ as shown in @eq:dis3. $ hat(q) phi(x_i) &= x_i phi(x) \ hat(p) phi(x_i) &= -i frac(phi(x_(i+1)) - phi(x_(i-1)), 2d) $ <eq:dis3> The hamiltonian is then given by the square of the momentum operator $p$ @eq:dis4. $ hat(H) = hat(p)^2/(2m) = -1/2 pdv(,x,2) $ <eq:dis4> Note that the hamiltonian is real and depends on the coordinate $x$ in this one-dimensional example. $ hat(H) = -frac(phi(x_(i+1)) + phi(x_(i-1)) - 2 phi(x_i),2 d^2) $ <eq:dis5> This follows from the fact that the second derivative can be discretized using the approximation $(f(x_(i+1)) + f(x_(i-1)) - 2 f(x_i)) / d^2$. = 1D particle in a box The problem of a particle in a box can be defined as shown in @fig:partin1dbox. The position of the particle inside the box can be defined via the wavefunction $psi(x)$. The particle is inside a box with infinitely large walls. Therefore, the probability of finding the particle on the wall is zero. These constitute the boundary conditions for for the wavefunction of the particle $psi(x)$, i.e. @eq:part1. $ psi(0) &= 0 \ psi(L) &= 0 $ <eq:part1> #figure( cetz.canvas({ import cetz.draw: * // Your drawing code goes here line((0, 0), (4.0, 0), stroke: (thickness: 4pt), name: "base") place-marks( line((0.0, -0.07), (0.0, 4.0), stroke: (thickness: 4pt)), (mark: ">", size: .7, pos: 1), fill: black ) place-marks( line((4.0, -0.07), (4.0, 4.0), stroke: (thickness: 4pt)), (mark: ">", size: .7, pos: 1), fill: black ) circle((2,1), radius: 3pt, fill: red) content( (-1,2), "V=∞") content( ( 5,2), "V=∞") content( ( 2,2), "V=0") line((0, -1.0), (4.0, -1.0), stroke: (thickness: 4pt), name: "base", mark: (begin: "<")) content( (2,-1.5), "L") circle((2,0), radius: 3pt, fill: black) content( (2,-0.5), "O") }), caption: [Particle in an infinite potential well.] ) <fig:partin1dbox> == Finite difference equations The schrodinger equation is given as shown in @eq:part2. $ hat(H)psi(x) = -1/2 grad^2 psi(x) = -1/2 frac(d^2 psi,d x^2) = lambda psi(x) $ <eq:part2> Here, $lambda$ represents the eigenvalues and $psi$ the eigenvectors of the hamiltonian. The @eq:part2 is a second order differential equation also known as the one dimensional Laplace equation or the Poisson equation. This equation can be solved using numerical integration techniques. Using Taylor series expansion of @eq:part2, one can obtain the finite difference formulae to evaluate the derivative at point $x_i$. $ lr(frac(d psi,d x) bar)_(x_i) &= lim_(epsilon arrow.r 0) ( psi(x_i + epsilon/2) - psi(x_i - epsilon/2) ) / (epsilon) \ lr(frac(d psi,d x) bar)_(x_i+epsilon/2) &= lim_(epsilon arrow.r 0) ( psi(x_i + epsilon) - psi(x_i) ) / (epsilon) \ lr(frac(d psi,d x) bar)_(x_i-epsilon/2) &= lim_(epsilon arrow.r 0) ( psi(x_i) - psi(x_i - epsilon) ) / (epsilon) \ lr(frac(d^2 psi,d x^2) bar)_(x_i) &= lim_(epsilon arrow.r 0) ( psi'(x_i + epsilon/2) - psi'(x_i - epsilon/2) ) / (epsilon) \ lr(frac(d^2 psi,d x^2) bar)_(x_i) &= lim_(epsilon arrow.r 0) ( psi(x_i + epsilon) - 2psi(x_i) + psi(x_i - epsilon) ) / (epsilon^2) $ <eq:part3> The above operator on the right hand side of @eq:part3 (called $T$ ) can be used to write the finite difference form of the schrodinger equation @eq:part2. This finite difference form shown in @eq:part4 can be used to find the eigenvalues and eigenvectors of the schrodinger equation by dividing the segment into a finite numebr of uniformly distributed points. $ T psi (x) = epsilon^2 lambda psi(x) $ <eq:part4> The matrix form of T is shown in @eq:part5 below where one can clearly see the tridiagonal form of the Laplace operator. #let matright(..aa) = math.mat(..aa.pos().map(row => row.map(y => {y; [$&$]}))) $ T = 1/(2 epsilon^2) mat( delim: "[", -1,2, -1, . , ..., ., ., .; . , -1,2, -1, ..., ., ., .; ... , ..., ..., ...,..., ..., ..., ...; . , ., ., ., ...,2, -1, .; . , ., ., ., ..., -1,2, -1; ) $ <eq:part5> The parts not shown in the matrix above are all zeros. The finite difference form of the schrodinger equation can then be written as @eq:part6. $ T psi(x) &= lambda psi(x) \ (T - lambda) psi(x) &= 0 $ <eq:part6> The matrix above can be diagonalized using the Lanczos or other algorithms to obtain the eigenvalues and eigenvectors for the problem of particle in a box. == Eigenvalues and eigenvectors The eigenvectors with $n=16$ is shown in @fig:eigen1. #figure( image("laplace_n16.png", width: 350pt), caption: [The solution of the Laplace equation with $n=16$ points.], ) <fig:eigen1> As one can see, the boundary values are not consistent with the boundary conditions defined for the problem in @eq:part1. This is due to the finite step size (i.e. $epsilon$) and depends on the number of points chosen for the discretization. Increasing the number of points from $n=16$ to $n=1024$ gives a much better agreement to the bounday values defined above. #figure( image("laplace_n1024.png", width: 350pt), caption: [The solution of the Laplace equation with $n=1024$ points.], ) <fig:eigen2> Since the solutions $psi_i$ are eigenfunction of the laplacian operator, they are by definition orthonormalized. $ braket(psi_i , psi_i) &= 1, forall i \ braket(psi_i , psi_j) &= 0, forall i,j $ <eq:part7> Since we are here in real space, i.e. real coordinates $x$, the overlap (also known as the measure) is defined as simply the integral @eq:part8. $ braket(psi(x), psi(x)) = integral_0^1 psi(x)^(dagger) psi(x) d x $ <eq:part8> where $psi(x)^(dagger)$ is the complex conjugate of $psi(x)$. Here, since the laplacian $T$ is hermitian (i.e. $T^(dagger) = T$), the eigenvalues are real. In the present case, where we have used a numerical method to perform the integration, we can also perform the integral numerically as shown in @eq:part9. $ integral_0^1 psi(x)^dagger psi(x) d x = sum_k^N psi_i^dagger (k)psi_i (k) = 1 $ <eq:part9> where $N$ is the total number of points. Similarly, the orthogonality constraint says that @eq:part10 holds. $ integral_0^1 psi(x)^dagger psi(x) d x = sum_k^N psi_i^dagger (k)psi_j (k) = 0 $ <eq:part10> As can be easily verified using basic linear algebra. == Probability density The eigenvectors obtained in the previous section $psi(x)$, can be used to plot the probability density for the various states as given by @eq:part11. $ rho(x) = psi(x)^dagger psi(x) $ <eq:part11> Numerically, this can be written as the dot product between the wavefunction as shown in @eq:part12. $ rho_i = sum_k psi_i (k) psi_i (k) $ <eq:part12> where we have assumed that the wavefunction $psi(x)$ is real. The probability density can be shown to be positive everywhere and defines the nodes of the state, i.e. the regions where the probability of finding the particle is zero as shown in @fig:part1. #figure( image("density_n1024.png", width: 350pt), caption: [The solution of the Laplace equation with $n=1024$ points.], ) <fig:part1> The ground state has zero nodes, the first excited state has exactly one node, the second excited state has two nodes etc. In general, the nodes of the function increase with increasing energy compared to the ground state. == Analytic solution Analytic solution to the problem of particle in a one-dimensional box is of the form shown in @eq:ana1. $ psi_k (x) = A_k cos(k x) + B_k sin(k x) $ <eq:ana1> where, $k$ refers to the state in question. The unknowns, $A_k$ and $B_k$ can be found using the boundray conditions and the @eq:part2. Using the boundray conditions, we get @eq:ana2. $ psi(-L/2) &= psi(L/2) = 0 \ psi_k (-L/2) &= A_k cos(k L/2) - B_k sin(k L/2) = 0 \ psi_k ( L/2) &= A_k cos(k L/2) + B_k sin(k L/2) = 0 $ <eq:ana2> which gives the final analytical solution as shown in @eq:ana3. $ psi(x) := cases( sqrt(2/L) sin((n pi )/L x) "if" n "is even", sqrt(2/L) cos((n pi )/L x) "if" n "is odd", ) $ <eq:ana3> //== Dipole moment and transition dipole moment // //The dipole moment operator for a given state //is given as shown below @eq:part13. // //$ //angle.l x_i angle.r = integral_0^1 rho(x) x d x //$ <eq:part13> // //The transition dipole moment between two states //$i$ and $j$ is defined as shown in @eq:part14. // //$ //angle.l x_(i j) angle.r = integral_0^1 psi_i(x) x psi_j(x) d x //$ <eq:part14> // //The table @fig:table1 shows the //dipole moment for the first state and the transition dipole //between the ground and first excited state. // // #figure( // table( columns: (auto, auto), inset: 10pt, align: center, // [$(i,j)$], [$angle.l x angle.r_(Psi^2)$], // [(1,1)], [ 0.000489237 ], // [(1,2)], [-0.180655 ], // [(1,3)], [ 0.0 ], // [(2,2)], [ 0.000489237 ], // [(2,3)], [ 0.195108 ], // ), // caption: [The dipole moment and transition dipole moment //between the pairs of states shown in the first column.], // ) <fig:table1> = Second quantization = Huckel hamiltonian = Hubbard hamiltonian = Double exchange hamiltonian // Bibliography section #pagebreak(weak: true) #set page(header: []) #bibliography("biblio.bib")
https://github.com/MaxAtoms/T-705-ASDS
https://raw.githubusercontent.com/MaxAtoms/T-705-ASDS/main/content/week2.typ
typst
#import "../template.typ": note, example #import "../boxes.typ": definition #import "../tags.typ": week, barron == Joint distributions and marginal distributions #week("2") #barron("3.2.1") #definition[ If $X$ and $Y$ are random variables, then the pair $(X,Y)$ is called a joint distribution of $X,Y$. Individual distributions of $X$ and $Y$ are called marginal distributions. ] #note[ - All concepts can be extended to a vector of random variables \ (i.e. $(X_1, X_2,dots,X_n)$) - The joint distribution is a collection of probabilities for the vector $(X, Y)$ to take the value $(x,y)$ - Two vectors are equal, i.e. $(X,Y) = (x,y)$, if $X = x$ and $Y = y$ #pagebreak() - The joint probability mass function of $X$ and $Y$ is: $ P(x,y) = P{(X,Y) = (x,y)} = P(X=x sect Y=y) $ - Since the events ${(X,Y) = (x,y)}$ are exhaustive and mutually exclusive, we have $ sum_(x) sum_(y) P(x,y) = 1 $ ] #strong("Addition Rule") The marginal probability mass functions of $X$ and $Y$ can be obtained from the joint pmf: $ P_X (x) = P{X = x} = sum_y P_((X,Y))(x,y) $ $ P_X (y) = P{Y = y} = sum_x P_((X,Y))(x,y) $ #example[ - Throw a coin: $X: "#heads"$ - Roll a die: Value of the die #columns(2, gutter: 11pt)[ #figure( caption: "Joint pmf", table( columns: (auto, auto, auto, auto, auto), table.vline(x: 2, start: 0), table.vline(x: 4, start: 0), inset: 10pt, align: horizon, [], [], table.cell(colspan: 2)[$X$], [], [], [], [$0$], [$1$], [$P_X (x)$], table.hline(start: 0), table.cell(rowspan: 6, align: horizon)[$Y$], [$1$], [$frac(1,12)$], [$frac(1,12)$], [$frac(1,6)$], [$2$], [$frac(1,12)$], [$frac(1,12)$], [$frac(1,6)$], [$3$], [$frac(1,12)$], [$frac(1,12)$], [$frac(1,6)$], [$4$], [$frac(1,12)$], [$frac(1,12)$], [$frac(1,6)$], [$5$], [$frac(1,12)$], [$frac(1,12)$], [$frac(1,6)$], [$6$], [$frac(1,12)$], [$frac(1,12)$], [$frac(1,6)$], table.hline(start: 0), [], [$P_Y (y)$], [$frac(1,2)$], [$frac(1,2)$], [$1$] ) ) #colbreak() #v(1em) #figure( caption: [Marginal pmf of $X$], table( columns: (auto, auto, auto), table.vline(x: 1), inset: 10pt, align: horizon, [$X$], [$0$], [$1$], table.hline(), [$P_X (x)$], [$0.5$], [$0.5$], ) ) #v(1em) #figure( caption: [Marginal pmf of $Y$], table( columns: (auto, auto, auto, auto, auto, auto, auto), table.vline(x: 1), inset: 10pt, align: horizon, [$Y$], [$1$], [$2$], [$3$], [$4$], [$5$], [$6$], table.hline(), [$P_Y (y)$], [$frac(1,6)$], [$frac(1,6)$],[$frac(1,6)$],[$frac(1,6)$],[$frac(1,6)$],[$frac(1,6)$], ) ) ] ] #pagebreak() == Independence of random variables #week("2") #barron("3.2.2") #definition[ Random variables $X$ and $Y$ are independent if $ P(x, y) = P_((X,Y))(x,y) = P_X (x) P_Y (y) #h(.2em) forall #h(.2em) x,y $ ] #example[ A program with two modules. The number of errors $X$ in $M_1$ and number of errors $Y$ in $M_2$ have a joint distribution: - $P(0,0) = P(0,1) = P(1,0) = 0.2$ - $P(1,1) = P(1,2) = P(1,3) = 0.1$ - $P(0,2) = P(0,3) = 0.05$ #set enum(numbering: "a)") + Find the marginal pmf of $X$ and $Y$ #figure(caption: [Marginal pmf of $X$ and $Y$], table( columns: (auto, auto, auto, auto, auto, auto, auto), table.vline(x: 2, start: 0), table.vline(x: 6, start: 0), [], [], table.cell(colspan: 4, [$Y$]), [], [], [], [$0$], [$1$], [$2$], [$3$], [$P_X (x)$], table.hline(start: 0), table.cell(rowspan: 2, align: horizon, $X$), [$0$], [$0.2$], [$0.2$], [$0.05$], [$0.05$], [$0.5$], [$1$], [$0.2$], [$0.1$], [$0.1$], [$0.1$], [$0.5$], table.hline(start: 0), [], [$P_Y (y)$], [$0.4$], [$0.3$], [$0.15$], [$0.15$], [$1.0$], ) ) + Find the probability of no errors in the first module $ P_X (0) = 0.5 $ + Find the distribution of the total number of errors in the program Let $Z = X + Y$ be the total number of errors. Distribution of $Z$: $ P_Z (0) &= P_Z (X + Y = 0) = P_Z (X = 0 sect Y = 0) = P_((X,Y)) (0,0) = 0.2 \ P_Z (1) &= P_Z (X = 1 sect Y = 0) + P_Z (X = 0 sect Y = 1) = 0.2 + 0.2 = 0.4 \ P_Z (2) &= P(0,2) + P(1,1) = 0.15 \ P_Z (3) &= P(0,3) + P(1,2) = 0.15 \ P_Z (4) &= P(1,3) = 0.1 $ #figure( caption: [pmf of $Z$], table( table.vline(x: 1), columns: (auto, auto, auto, auto, auto, auto), [$Z$], [$0$], [$1$], [$2$], [$3$], [$4$], table.hline(), [$P(Z)$], [$0.2$], [$0.4$], [$0.15$], [$0.15$], [$0.1$], ) ) + Find out if the errors in $M_1$ and $M_2$ occur independently #pagebreak() Counterexample: $ P_((X,Y)) (0,1) &= 0.2 \ P_X (0) P_Y (1) &= 0.5 dot.op 0.3 = 0.15 \ P_((X,Y)) (0,1) &eq.not P_X (0) P_Y (1) $ ] == Expectation of a function #week("2") #barron("3.3.2") $ mu = E(X) = sum_x x P(X) $ If $Y$ is a random variable is a function of another random variable $X$, so that $Y=g(x)$ then the expected value of $Y$ is $ E(Y) = E(g(X)) = sum_x g(x) P(x) $ #example[ Store selling computers. They make 1,000 in profit for every sold computer, but they have operational cost of 2,000 per month. #figure( caption: "", table( columns: (auto, auto, auto, auto), table.vline(x:1), [$X$], [$8$], [$9$], [$10$], table.hline(), [$P(X)$], [$0.35$], [$0.45$], [$0.2$], ) ) What is the expected profit? The random variable for profit is $Y = 1000 * X - 2000$. $ E(Y) = sum_x g(x) P(X) = sum_x (1000x - 2000) * P(X) \ = (1000 * 8 - 2000) * 0.35 + ... + (1000 * 10 - 2000) * 0.2 \ = 6850 $ ] #note[ - For any random variable $X$ and $Y$ and any $a, b, c in RR$: $ E(a X + b Y + c) = a E(X) + b E(Y) + c $ - For $X$ and $Y$ independent: $ E(X Y) = E(X) E(Y) $ ] #example[ In the two module problem: $ E(X) &= 0 * 1/2 + 1 * 1/2 = 0.5 \ E(Y) &= 0 * 0.04 + 1 * 0.3 + 2 * 0.15 + 3 * 0.15 = 1.05 \ E(Z) &= E(X+Y) = E(X) + E(Y) = 0.5 + 1.05 = 1.55 $ ] #pagebreak() == Chebyshev's inequality #week("2") #barron("3.3.7") If we know $mu$ and $sigma$ of a random variable, then we can find the range where most of its values lie. Let $X$ be a random variable with expected $mu = E(X)$ and variance $sigma^2 = "Var"(X)$ then $P{|X - mu| > epsilon} <= (sigma / epsilon)^2 )$ for $epsilon > 0$. Chebyshev's Inequality says that $X in [mu - epsilon, mu + epsilon] $ with a probability pf at least \ $1-(sigma / epsilon)^2$.
https://github.com/LugsoIn2/typst-htwg-thesis-template
https://raw.githubusercontent.com/LugsoIn2/typst-htwg-thesis-template/main/lib/titlepage.typ
typst
MIT License
#import "textTemplate.typ": * #let titlepage( lang: "", title: "", degree: "", program: "", supervisor: "", advisors: (), author: "", startDate: datetime, submissionDate: datetime, studentnumber: "", title-font: "Arial", physicalPrint: true, ) = { { set page( margin: (left: 20mm, right: 20mm, top: 40mm, bottom: 40mm), numbering: "i", number-align: center, background: image("../assets/report_titel_page.svg"), ) let htwg-color-dark = rgb(43,57,75) // rgb(51,65,82) let htwg-color-green = rgb(0,155,145) let background-color = white let languageText = textTemplate(pagetype: "titlepage" ,lang: lang) set text( font: title-font, size: 12pt, lang: lang, ) // --- -------------- ---- // --- -------------- ---- // ----- Title Page ------ v(40mm) box( fill: background-color, outset: (x: 40pt, y: 10pt), if degree == "Bachelor" or degree == "Master" { align(left, text(font: title-font, fill: htwg-color-green, 2em, weight: 100, degree + "thesis")) } else { align(left, text(font: title-font, fill: htwg-color-green, 2em, weight: 100, degree)) } + align(left, text(font: title-font, fill: htwg-color-green, 2em, weight: 700, title)) ) v(10mm) align(left, text(font: title-font, weight: 100, languageText.at(0))) v(5mm) box( fill: background-color, outset: (x: 10pt, y: 10pt), align(left, text(font: title-font, size: 15pt, weight: 800, author)) ) v(15mm) align(left, text(font: title-font, weight: 100, languageText.at(1))) v(6mm) box( fill: background-color, outset: (x: 10pt, y: 10pt), if degree == "Bachelor" { align(left, text(font: title-font, weight: 800, "Bachelor of Science")) } else if degree == "Master" { align(left, text(font: title-font, weight: 800, "Master of Science")) } ) align(left, text(font: title-font, weight: 100, languageText.at(2) + program )) v(6mm) box( fill: background-color, outset: (x: 10pt, y: 10pt), align(left, text(font: title-font, weight: 100, languageText.at(3))) ) v(15mm) let entries = () entries.push((languageText.at(4), studentnumber)) entries.push((languageText.at(5), startDate.display("[day].[month].[year]"))) entries.push((languageText.at(6), submissionDate.display("[day].[month].[year]"))) entries.push((languageText.at(7), supervisor)) if advisors.len() > 0 { entries.push((languageText.at(8), advisors.join(", "))) } box( fill: background-color, outset: (x: 5pt, y: 10pt), pad( grid( columns: 2, gutter: 1.1em, ..for (term, desc) in entries { (strong(term), desc) } ) ) ) } if physicalPrint { pagebreak() } { set page( margin: (left: 20mm, right: 20mm, top: 40mm, bottom: 40mm), numbering: "i", number-align: center, ) } }
https://github.com/piepert/grape-suite
https://raw.githubusercontent.com/piepert/grape-suite/main/src/library.typ
typst
MIT License
#import "exercise.typ" as exercise #import "slides.typ" as slides #import "seminar-paper.typ" as seminar-paper #import "colors.typ" as colors #import "german-dates.typ" as german-dates
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/foundations-18.typ
typst
Other
// Error: 7-32 cannot access file system from here #eval("include \"../coma.typ\"")
https://github.com/SWATEngineering/Docs
https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/VerbaliInterni/VerbaleInterno_231114/content.typ
typst
MIT License
#import "meta.typ": inizio_incontro, fine_incontro, luogo_incontro #import "functions.typ": glossary, team #let participants = csv("participants.csv") = Partecipanti / Inizio incontro: #inizio_incontro / Fine incontro: #fine_incontro / Luogo incontro: #luogo_incontro #table( columns: (3fr, 1fr), [*Nome*], [*Durata presenza*], ..participants.flatten() ) = Sintesi Elaborazione Incontro /*************************************/ /* INSERIRE SOTTO IL CONTENUTO */ /*************************************/ Nella riunione tenutasi in data odierna sono stati trattati i seguenti argomenti. == Chiarire conflitto riguardante le versioni del software e della documentazione È stato deciso di consultare i professori al fine di trovare una best practice per poter definire come la versione della documentazione e del prodotto software possano progredire in sincronia. == Elementi da aggiungere al documento "Norme di progetto" È stato fatto notare che i seguenti punti devono essere aggiunti al documento _Norme di progetto_: - Definire una procedura per definire come le issues possano essere aggiunte in maniera asincrona, al backlog, da qualsiasi componente, nell'eventualità in cui si verifichino problemi o necessità da affrontare; - Va reso più dettagliato il ruolo del Responsabile. È stata quindi proposta l'aggiunta della specifica riguardo le mansioni relative al suo compito: - Gestire la comunicazione con la Proponente (e.g. mail o l'uso della piattaforma Element); - Preparare l’ordine del giorno per la successiva riunione, anche sulla base dei punti individuati dagli altri componenti; - Redigere i verbali interni ed esterni; - Stendere e far progredire il documento _Piano di progetto_; - Creare i diari di bordo. Questa aggiunta di dettagli sul ruolo del Responsabile è stata ritenuta necessaria in quanto ci si è resi conto che il Responsabile non aveva abbastanza mansioni e quindi aveva molto tempo libero. Di conseguenza, sono state individuate mansioni per poter impiegare meglio il suo tempo, andando ad alleggerire il carico di lavoro dagli altri ruoli (e.g. la stesura dei verbali, precedentemente svolta dagli Analisti). == Cambiamento dei ruoli straordinario È stato ritenuto necessario un cambiamento dei ruoli per via dei seguenti motivi: - La proponente ha suggerito la stesura del Proof of Concept in contemporanea alla definizione dell'analisi dei requisiti e non era stata prevista la figura del Programmatore nello sprint attuale; - Si ritiene che un Verificatore sia più che sufficiente per lo sprint attuale. Le motivazioni a riguardo sono: - Quantità limitata di documenti da verificare; - Semplicità organizzativa. Con un numero ridotto di documenti, la gestione delle attività di verifica risulta semplificata. Un solo Verificatore può concentrarsi sull'assicurare che i pochi documenti prodotti rispettino gli standard stabiliti; - La rotazione dei ruoli, tuttavia, verrà attuata venerdì 17/11/2023, in quanto sono da portare a termine delle issue con i ruoli precedentemente assegnati. La nuova assegnazione dei ruoli è la seguente: - *<NAME>*: Amministratore; - *<NAME>*: Analista; - *<NAME>*: Analista; - *<NAME>*: Responsabile; - *<NAME>*: Verificatore; - *<NAME>*: Programmatore. Si vuole comunque ribadire che d'ora in poi il team si impegnerà a mantenere la suddivisione dei ruoli per l'intera durata dello sprint, facendo maggiore attenzione a questo aspetto durante il planning. == Creare sito web per la presentazione dei documenti Per migliorare l'accessibilità ai documenti è stato deciso di creare un sito web ufficiale per la repository documentale. Lo strumento che verrà utilizzato sarà GitHub.io: uno strumento offerto dalla piattaforma GitHub. == Passaggio dall'uso di Notion alla Google Suite A causa delle notevoli limitazioni imposte dal piano gratuito di Notion, si è deciso di rimpiazzarlo con la Google Suite. Ora documenti come note e appunti verranno redatti in Google Documents mentre gli elementi di natura tabellare verranno realizzati mediante l’uso di Google Fogli. Erano state prese in considerazione altre scelte come #link("https://coda.io/welcome")[Coda] o #link("https://clickup.com/")[ClickUp], tuttavia impongono vincoli ancora più stringenti rispetto a quelli ritrovati in Notion, nelle versioni gratuite, e quindi sono state considerate non adeguate.
https://github.com/Quaternijkon/Typst_FLOW
https://raw.githubusercontent.com/Quaternijkon/Typst_FLOW/main/src/slides.typ
typst
#import "utils.typ" #import "configs.typ" #import "core.typ" #import "magic.typ" /// Touying slides function. /// /// #example(``` /// #show: touying-slides.with( /// config-page(paper: "presentation-" + aspect-ratio), /// config-common( /// slide-fn: slide, /// ), /// ..args, /// ) /// ```) /// /// `..args` is the configurations of the slides. For example, you can use `config-page(paper: "presentation-16-9")` to set the aspect ratio of the slides. /// /// `body` is the contents of the slides. #let touying-slides(..args, body) = { // get the default config let args = (configs.default-config,) + args.pos() let self = utils.merge-dicts(..args) // get the init function let init = if "init" in self.methods and type(self.methods.init) == function { self.methods.init.with(self: self) } else { body => body } show: body => { if self.at("scale-list-items", default: none) != none { magic.scale-list-items(scale: self.at("scale-list-items", default: none), body) } else { body } } show: body => { if self.at("nontight-list-enum-and-terms", default: true) { magic.nontight-list-enum-and-terms(body) } else { body } } show: body => { if self.at("align-list-marker-with-baseline", default: false) { magic.align-list-marker-with-baseline(body) } else { body } } show: init show: core.split-content-into-slides.with(self: self, is-first-slide: true) body }
https://github.com/spewwerrier/hut
https://raw.githubusercontent.com/spewwerrier/hut/master/hut.typ
typst
#let paper_title = "A Pragmatic Approach to Living in A Hut And Live Happily" #set text( font: "CMU Serif", size: 10pt, ) #set heading(numbering: "I.") #show heading: it => [ #set align(center) #set text(12pt, weight: "regular") #block(smallcaps(counter(heading).display()+ " " + it.body)) #linebreak() ] #show heading.where( level: 2 ): it => text( size: 11pt, weight: "regular", style: "italic", linebreak() + linebreak() + counter(heading).display() + " " + it.body + linebreak() + linebreak(), ) #show heading.where( level: 3 ): it => text( size: 10pt, weight: "regular", style: "italic", linebreak() + linebreak() + counter(heading).display() + " " + it.body + linebreak() + linebreak(), ) #set page( width: 8.5in, height: 11in, margin: (x: 0.625in, y: 0.75in), columns: 1, ) #align(center)[#text(size: 14pt, font: "CMU Classical Serif")[*#paper_title*]] #move(dx: -40pt, dy: 500pt)[ #stack( dir: ltr, spacing: 1fr, rotate(270deg, origin: left)[#text(font: "CMU Classical Serif", size: 11pt)[#linebreak() #linebreak() #paper_title]] ) ] #columns(2, gutter: 11pt)[ #set par(justify: true) = Introduction Mugen ni aru #lorem(150) == Where to live? #lorem(200) === Will you actually survive? #lorem(280) ]
https://github.com/kdog3682/2024-typst
https://raw.githubusercontent.com/kdog3682/2024-typst/main/src/mmgg.typ
typst
#import "/home/kdog3682/2024/base-utils.typ": bold #let mmgg-layouter(items) = { let store = () for (index, item) in items.enumerate() { store.push(bold(index + 1)) store.push(item) } let attrs = (columns: (auto, 1fr), column-gutter: 10pt, row-gutter: 24pt) return grid(..attrs, ..store) } #let mmgg-v1(data) = { set page(margin: 0.5in, paper: "us-letter", columns: 2, numbering: "1") set par(leading: 1.5em) [ = #data.title #line(length: 100%) ] data.body } // this time the lines will be numbered #let mmgg-v2(data) = { set page(margin: 0.5in, paper: "us-letter", columns: 2, numbering: "1") set par(leading: 1.2em) [ = #data.title #line(length: 100%) ] mmgg-layouter(data.body) } #let mmgg = mmgg-v1 #let mmgg = mmgg-v2 #mmgg(json("/home/kdog3682/2024/temp.json"))
https://github.com/MilanR312/ugent_typst_template
https://raw.githubusercontent.com/MilanR312/ugent_typst_template/main/ugent_template.typ
typst
MIT License
#import "template/methods/globals.typ": ublue, default_font, default_fontsize, parlead #import "template/methods/title_page.typ": * #import "template/methods/glos.typ": * #import "template/methods/todo.typ": * #import "template/methods/introduction.typ": * #import "template/methods/table_notes.typ": init_note_tables #import "template/methods/header.typ": default_header #let ugent-template( title: none, short_title: none, header: default_header, authors: (), other_people: (), language: "en", team_text: none, include_copyright: false, bibliography-file: none, glossary-file: none, body, ) = { set document(author: authors.map(author => author.name), title: title) state("appendix").update(false) state("body").update(false) set text( lang: language, fallback: true, font: default_font, size: default_fontsize, hyphenate: false, overhang: true, ) set quote(block: true) // Configure equation numbering and spacing. set math.equation(numbering: "(1)", block: true) show math.equation: set block(spacing: 1.65em) set page(number-align: right, margin: 2.5cm, paper: "a4", numbering: none) set par(justify: false, first-line-indent: 0em) //change to 1em for actual texts show par: set block(spacing: 1em) // Configure lists. set enum(indent: 10pt, body-indent: 9pt) set list(indent: 10pt, body-indent: 9pt) show figure.where(kind: table): set figure.caption(position: top) show figure: set block(breakable: true) set figure(supplement: n => { if n.func() == image { "Figure" } else if n.func() == table { "Table" } else if n.func() == raw { "Code fragment" } else if n.func() == math.equation { "Equation" } else { "Unkown item, append to template at line 336" } }) // set copyright align( if include_copyright == true [ #sym.copyright 2023-2024 #authors.map(author => author.name).join(", ") Ghent University All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the author(s). #pagebreak() ], bottom ) state("init").update(true) title_page(title: title, authors: authors, other_people: other_people) pagebreak() title_page(title: title, authors: authors, other_people: other_people) show link: it => if type(it.dest) == str { //set text(stroke: ublue) underline(it) } else { it } //counter(page).update(1) set page(footer: locate( loc => if calc.even(loc.page()) { align(right, counter(page).display("I")); } else { align(left, counter(page).display("I")); } )) set page(header: header(title, short_title)) /* set page(header: ) */ // dit is een copy van later, alle begin titels hebben ook een grote display maar geen nummering //we stellen wel een counter in sinds het nodig is counter(heading).update(0) show heading: it => { let header_count = counter(heading).at(it.location()) set text(stroke: ublue, fill: ublue) set par(first-line-indent: 0pt) if it.level == 1 { //highest level headers are blue and have a big number set text(size: 80pt, weight: "thin", fill: luma(50%), stroke: luma(50%)) pagebreak(weak: true) v(1em) counter(heading).step() set text(size: 25pt, weight: "extrabold", stroke: ublue, fill: ublue) align( it, right ) } else if it.level == 2 { set text(size: 20pt, weight: "extrabold", stroke: ublue, fill: ublue) it v(0.2em) } else if it.level == 3 { set text(size: 18pt, weight: "extrabold", stroke: ublue, fill: ublue) it } else { it } } { set par(leading: parlead) include "template/prependices.typ" pagebreak(weak: true) } show outline.entry: it => { let loc = it.element.location() if state("init").at(loc) == true { //in the init state we only show the highest headers and we show it in roman numerals let page = numbering("I", ..counter(page).at(loc)) let body = it.element.body if it.element.level == 1 [ #link(loc)[ #body ]#box(width: 1fr, it.fill)#page ] } else { it } } outline(indent: 1em, depth: 3) pagebreak() //toont enkel image en table overzicht indien er bestaan context { if counter(figure.where(kind: image)).final().first() != 0 { outline(title: "Figures", target: figure.where(kind: image)) pagebreak() } } context { if counter(figure.where(kind: table)).final().first() != 0 { outline(title: "Tables", target: figure.where(kind: table)) pagebreak() } } context { if counter(figure.where(kind: math.equation)).final().first() != 0 { outline(title: "Equations", target: figure.where(kind: math.equation)) pagebreak() } } if glossary-file != none { glossary(glossary-file, full: true) } outline-todos() state("init").update(false) state("body").update(true) counter(heading).update(0) set page(footer: { set text(size: default_fontsize) grid( columns: (50%, 50%), if team_text != none [#team_text] else [], align(right, counter(page).display("1")) ) }) //set page(footer: align(right, counter(page).display("1"))); set heading(numbering: "1.1.1", supplement: [Chapter]) show heading: it => { let header_count = counter(heading).at(it.location()) set text(stroke: ublue, fill: ublue) set par(first-line-indent: 0pt) if it.level == 1 { //highest level headers are blue and have a big number set text(size: 80pt, weight: "thin", fill: luma(50%), stroke: luma(50%)) pagebreak(weak: true) v(1em) align( numbering(it.numbering, ..header_count), right ) set text(size: 30pt, weight: "extrabold", stroke: ublue, fill: ublue) align( it.body, right ) } else if it.level == 2 { set text(size: 24pt, weight: "extrabold", stroke: ublue, fill: ublue) it v(0.2em) } else if it.level == 3 { set text(size: 19pt, weight: "extrabold", stroke: ublue, fill: ublue) it } else { set text(size: 16pt) set text(weight: 300) it.body } } pagebreak(weak: false) counter(page).update(1) //show: gloss-init set par(leading: parlead) body pagebreak(weak: true) // Display bibliography. if bibliography-file != none { show bibliography: set text(8pt) [ = Bibliograpy ] bibliography(bibliography-file, title: none, style: "ieee") } state("body").update(false) state("appendix").update(true) set heading(numbering: "A.1.1.1", supplement: [Appendix]) counter(heading).update(0) pagebreak(weak: true) include "template/appendices.typ" pagebreak(weak: true) }
https://github.com/YDX-2147483647/typst-pointless-size
https://raw.githubusercontent.com/YDX-2147483647/typst-pointless-size/main/lib.typ
typst
MIT License
#import "./zihao.typ": zh, zihao
https://github.com/TGM-HIT/typst-diploma-thesis
https://raw.githubusercontent.com/TGM-HIT/typst-diploma-thesis/main/template/chapters/implementierung.typ
typst
MIT License
#import "../lib.typ": * = Implementierung Hier wird die Umsetzung des Projekts beschrieben und auf Details zu den einzelnen Technologien eingegangen. Im Optimalfall werden die Lösungen und Wege zu den zuvor definierten Problemen und Zielen geschildert. Eine bestehende Dokumentation, welche während der Arbeit erstellt wurde kann hier von großem Vorteil sein!
https://github.com/FlyinPancake/bsc-thesis
https://raw.githubusercontent.com/FlyinPancake/bsc-thesis/main/thesis/pages/chapters/chapter_2_background.typ
typst
// LTeX: enabled=true #import "@preview/glossarium:0.2.4": make-glossary, print-glossary, gls, glspl = Background and Related Work <background> == What are containers? Containers are a way to package software in a format that can run isolated on a shared operating system. Unlike virtual machines, containers do not bundle a full operating system -- only libraries and settings required to make the software work are needed. This makes for efficient, lightweight, self-contained systems and guarantees that software will always run the same, regardless of where it is deployed. The use of containers to deploy applications is called containerization. We can utilize the power of containerization to create a portable, lightweight, and secure environment for running our applications. Containers are useful in many settings, including development, testing, and production environments. === Docker Docker is a tool that introduced the concept of containers to the masses. #footnote[ BSD had a similar feature: jails for a while; however it never reached mass-market adoption, since Linux did not support it.", ] It is a platform for developers and sysadmins to develop, deploy, and run applications with containers. Docker is integrated with DockerHub, a registry of Docker images, which are pre-built containers that include everything needed to run an application. DockerHub is a public registry, but as Docker is a free and open-source software, one can also host theiw own private registry. While the runtime environment is given with a Docker image, the Docker command line interface (CLI) provides many options that allow us to customize the environment. The most important options are: ports, volumes, and environment variables. With the Docker CLI we can open up a container to the host's resources. For example, we can open up a port on the host machine and map it to a port in the container. This allows us to access the containerized application from the host machine. ==== Docker Compose Docker comes bundled with a tool called Docker Compose#footnote[This tool is not exclusive for Docker, there is a runtime-agnostic implementation called `oci-runtime-compose`, that is in fact forked from Docker Compose], which allows us to easily define and run multi-container applications. Without Docker Compose we would have to use the Docker CLI to run each container individually, which can be cumbersome. It may lead to hacky shell scripts, resulting in errors, and decreased portability. With Compose, we use a YAML file to configure our application's services. Then, with a single command, we create and start all the services from our configuration. Compose works in all environments: production, staging, development, testing, as well as CI (Continuous Integration) workflows.#footnote[Usually, the CI workflow has bespoke scripting that uses Compose to build and publish the application's images] Using Compose is a three-step process: - Define our app's environment with a Dockerfile, so it can be reproduced anywhere. - Define the services that make up our app in `docker-compose.yaml` so they can be run together in an isolated environment. - Use the Docker Compose CLI to run `docker compose up`#footnote[`docker-compose up` in previous versions] and start our app. Docker Compose is great for single host deployments like development environments, but it falls short when it comes to multi-host deployments. For example, if we want to deploy our application to many machines, we would have to use a different tool, such as Kubernetes. == Kubernetes Kubernetes, commonly abbreviated as K8s, is an open-source orchestration system for automating software deployment, scaling, and management. Originally designed by Google, it is now maintained by the Cloud Native Computing Foundation. #cite(<kuberntes-wikipedia>) Kubernetes is used industry-wide to manage containerized applications. It is a powerful tool that allows us to deploy and manage our applications in a scalable and reliable way. Scaling allows us to increase the number of containers running our application, which in turn increases the capacity of our application. This can be done manually, or automatically, based on certain metrics, such as CPU usage or memory usage or even custom metrics. To run an application on Kubernetes, we have to define a set of resources, such as pods, services, and deployments. These resources together define our application's environment. They define similar things as Docker Compose, but in a more complex way. === Kubernetes Cluster A Kubernetes cluster is a set of machines, called nodes, that run containerized applications managed by Kubernetes. By design, unlike Docker, Kubernetes operates on a cluster level, not on a single machine. Kubernetes uses a controller-worker architecture, where the controller is responsible for managing the cluster, and the worker is responsible for running the applications. Sometimes it is beneficial to run a Kubernetes cluster on a single machine, or use the controller node as a worker, but this is not usually recommended for production environments, only in special cases; for example, when redundancy is achieved by other means and not necessary in the cluster. Preferably, Kubernetes clusters are deployed with multiple controller nodes, which is called a high-availability cluster. This allows for redundancy, and makes the cluster more resilient to failures. Worker nodes are usually deployed as multiple nodes too, to allow for horizontal scaling. In case of a worker node failure, the master node will automatically reschedule the now also failed workloads onto a healthy worker node. === Kubernetes Platforms Kubernetes is a complex system based on solid protocols and standards. It makes Kubernetes greatly expandable and customizable. There are many Kubernetes platforms, which are Kubernetes implementations that are tailored to specific use cases. Kubernetes ditributions can become certified by the Cloud Native Computing Foundation (CNCF). This means that the distribution is compliant with the CNCF's standards, and is guaranteed to work with other CNCF certified tools. Kubernetes platforms can be categorized by their approach to hosting Kubernetes. ==== Hosted Kubernetes Most cloud providers offer their own Kubernetes hosting solutions, which usually include deep integration with the cloud provider's other services. They are usually a managed solution, which means that the user does not have to manage the cluster, only the applications running on it. Some notable examples are: - Google Kubernetes Engine (GKE) - Amazon Elastic Kubernetes Service (EKS) - Azure Kubernetes Service (AKS) - DigitalOcean Kubernetes ==== Kubernetes Distributions There are also many Kubernetes distributions, which are maintained by the company that created the distribution. Some of them are open-source and allow the user to audit the code, and even contribute to the project. Some notable examples are: - k3s -- Lightweight Kubernetes distribution by Rancher Labs - Ericsson Cloud Container Distribution (ECCD) - k0s -- Zero Friction Kubernetes - OpenShift -- Kubernetes distribution by Red Hat - VMware Tanzu Kubernetes Grid (TKG) - Canonical Kubernetes (Charmed Kubernetes) -- Kubernetes distribution by Canonical - MicroK8s -- Lightweight Kubernetes distribution by Canonical ==== Kubernetes Installers Kubernetes installers are tools that allow the user to install Kubernetes on a set of machines. They usually provide a custom Kubernetes distribution, and a set of tools tailored to it, to manage the cluster. Some notable examples are: - `kubeadm` -- Kubernetes installer by the Kubernetes project - `kind` -- Kuberetes in Docker for development by the Kubernetes project - `kwok` -- Kubernetes WithOut Kubelet, a simulator by the Kubernetes project - `kubespray` -- Production ready Kubernetes installer by the Kubernetes project - `rke` -- Rancher Kubernetes Engine by Rancher Labs #figure( image("../../figures/kubernetes-arch.excalidraw.svg", width: 95%), caption: "Kubernetes Architecture", ) <k8s-arch> === Kubernetes Components A Kubernetes cluster is built from building blocks with stable interfaces. An example "default" Kubernetes cluster's logical components can be seen in @k8s-arch. We can see, that Kubernets has separate control plane, and worker processes. The control plane is responsible for the global, cluster-scoped decisions (i.e.: scheduling) as well as detecting and acting on cluster events (i.e.: creating a new pod when a deployment's `replicas` field requires it). Typically all control plane services run on a dedicated host, but it is not required. Control plane services include: - API Server -- The API server is a component of the Kubernetes control plane that exposes the Kubernetes API. The API server is the front end for the Kubernetes control plane. - `etcd` -- `etcd` is a distributed reliable key-value store for the most critical data of a distributed system. It is used as Kubernetes' backing store for all cluster data. - `sched` -- The Kubernetes scheduler is a control plane process that assigns Pods to Nodes. The scheduler determines which Nodes are valid placements for each Pod in the scheduling queue according to constraints and available resources. - `controller-manager` -- The Kubernetes controller manager is a control plane process that watches the shared state of the cluster through the API server and makes changes attempting to move the current state towards the desired state. - `cloud-controller-manager` -- The cloud controller manager is a Kubernetes control plane component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that just interact with your cluster. The worker nodes run the Pods that are the components of the application workload. To achieve this, the worker nodes run the following Kubernetes processes: - `kubelet` -- An agent that runs on each node in the cluster. It makes sure that containers are running in a Pod. - `kube-proxy` -- `kube-proxy` is a network proxy that runs on each node in your cluster, implementing part of the Kubernetes Service concept. === Kubernetes Resources Kubernetes resources are the building blocks of Kubernetes applications. They are the basic unit of deployment, and they are used to define the application's environment. They are defined in YAML files, and can be created, updated, and deleted with the Kubernetes API. ==== Pods A Pod is a Resource, that is the basic element of Kubernetes' workload. It is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod models an application-specific "logical host": it contains one or more application containers which are relatively tightly coupled. Pods are usually created by a controller, such as a Deployment or a StatefulSet. These controllers are responsible for creating and managing the Pods. ==== Deployments <deployment> A Deployment is used to descirbe an application's lifecycle. It is a Resource, that creates and manages ReplicaSets. ReplicaSets are used to ensure that a specified number of pod replicas are running at any given time. ==== StatefulSets <sts> StatefulSets are similar to Deployments, however they are used for stateful applications. They are used to manage the deployment and scaling of a set of Pods, and provide guarantees about the ordering and uniqueness of these Pods. Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. ==== Services Services describe a method of accessing a set of Pods. They are usually used to expose an application to the outside world. They can be used to expose an application inside the cluster too. Services define a logical set of endpoints -- usually Pods -- and a policy by which to access them. There are multiple types of Services: - `ClusterIP` -- Exposes the Service on a cluster-internal IP. Choosing this value makes the Service only reachable from within the cluster. This is the default `ServiceType`. - `NodePort` -- Exposes the Service on each Node's IP at a static port (the `NodePort`). A `ClusterIP` Service, to which the `NodePort` Service routes, is automatically created. You'll be able to contact the `NodePort` Service, from outside the cluster, by requesting `<NodeIP>:<NodePort>`. This is similar to `--publish` in `docker run`. `NodeProt` Services can use ports in the range `30000-32767`. - LoadBalancer -- Exposes the Service externally using a cloud provider's load balancer. `NodePort` and `ClusterIP` Services, to which the external load balancer routes, are automatically created. - ExternalName -- Maps the Service to the contents of the `externalName` field (e.g. `foo.bar.example.com`), by returning a `CNAME` record with its value. No proxying of any kind is set up. This is useful for transitioning from a `externalName` Service to a `ClusterIP` Service. === Kubernetes Namespaces In Kubernetes, namespaces provide a mechanism for isolating groups of resources within a single cluster. Namespaces provide some level of isolation, however their primary goal is to prevent scoping issues, since resources' names are namespace-scoped i.e.: (one can have a pod named `unicorn` in the namespace `default`, and in the namespace `wonderland` too). The official Kubernetes documentation mentions, that namespaces should not be the default method for isolation. For example deployments of slightly different versions of the same service can be differentiated by using tags. #cite(<kube-docs>) Namespaces are not a security feature, and provide only limited isolation. Kubernetes comes with three (plus one) pre-defined namespaces#cite(<kube-docs>): - `default` -- The default namespace for objects with no other namespace - `kube-system` -- The namespace for objects created by the Kubernetes system - `kube-node-lease` -- This namespace for the lease objects associated with each node which improves the performance of the node heartbeats as the cluster scales. - `kube-public` -- This namespace is readable by all users (including those not authenticated). This namespace is mostly reserved for cluster usage, in case that some resources should be visible and readable publicly throughout the whole cluster. The public aspect of this namespace is only a convention, not a requirement. === Kubernetes Operator Pattern People who run workloads on Kubernetes clusters often like to use automation to take care of repeatable tasks. The operator pattern captures how you can write code to automate a task beyond what Kubernetes itself provides.#cite(<kube-docs>) The operator pattern is a method for extending Kubernetes' functionality. With operators, we can extend Kubernetes' API with @crd[s], and controllers#cite(<kube-docs>). This allows us to create custom resources, that can be managed by Kubernetes. For example, we can create a @crd for a database, and a controller that will create a database pod when a database resource is created. A Kubernetes Operator is usually a combination of a controller and a custom resource definition; however, the latter is not a requirement. Controllers are responsible for managing the custom resources. They are watching the Kubernetes API for changes in the custom resources, and act accordingly. Controllers are usually written in Go, and are compiled into a binary, but that is not a requirement. There are many libraries that can be used to write controllers in other languages, such as `kube-rs`#cite(<kube-rs>) for Rust, `KubeOps`@kubeops for `.NET` and `Kopf`@kopf for Python. If the controller is made specifically for Kubernetes it usually ships with its own Custom Resource. Custom Resources are defined by @crd[s]. They are usually generated from the controller's source code. They can be scoped to a namespace, or cluster-wide. This will depend on how the controller is implemented and what the use case is. The most common Kubernetes Operators can be found in the OperatorHub@operatorhub, which is a registry of operators. It is maintained by Red Hat, and is a part of the @olm [#ref(<olm-section>)]. OperatorHub is a great place to find operators for common use cases, such as databases, message queues, and monitoring solutions. It provides `helm` charts for easy installation. #figure( image("../../figures/kubernetes-deployment-example.excalidraw.svg"), caption: "Simple Kubernetes Deployment", ) <k8s-deployment> === A Simple Kubernetes Deployment In @k8s-deployment we can see a simple Kubernetes deployment, that hosts a web application. This web application requires a database, which is managed by a StatefulSet. The database is deployed as two replicas, to ensure high availability. Its data is stored in @persistentvolume[s], which is mounted to the database pod. Since our web application is stateless, it can be deployed as a Deployment. The Deployment ensures that the web application is always running, and it is scaled to three replicas. It is exposed to the outside world with an ingress, which is a Kubernetes resource that allows us to expose a service to the outside world. === Common Kubernetes Use Cases Due to Kubernetes' architecture, it can be adapted to a wide variety of tasks. The most obvious of them is cloud infrastructure. Many commercial "container running" solutions use Kubernetes under the hood. Larger organizations can use Kubernetes to optimize their costs and response times. The widespread adoption of Kubernetes gave way to a newfound trend to the microservice architecture, that is well known and loved. Kubernetes allows for never-before seen flexibility, and it is a great tool for running microservices. == vCluster vCluster is an open-source solution, that enables a single Kubernetes cluster to host multiple virtual Kubernetes clusters. It utilizes Kubernetes' namespaces feature, and improves on it. Compared to fully separate Kubernetes cluster, virtual clusters do not have their own node pool nor networking. Instead, they inherit these from the parent cluster. They are scheduling workloads on the host cluster, however they have their own virtual control plane. #figure( image("../../figures/vcluster-arch.excalidraw.svg"), caption: "vCluster Architecture", ) <vcluster-arch-fig> === vCluster Architecture <vcluster-arch-sec> vCluster is used in conjunction with `kubectl`, the Kubernetes CLI. It creates an alternative Kubernetes API server, that can be used with `kubectl`. When connected to the virtual cluster, `kubectl` will behave as if it was connected to a regular Kubernetes cluster. This is achieved by connecting to the API server of the virtual cluster control plane #cite(<vcluster>). As we can see in @vcluster-arch-fig, this control plane has high-level and low-level components. The high-level components only interact with the Kubernetes API, and do not have any knowledge of the host cluster. This includes, but is not limited to: Deployments, StatefulSets, and CustomResourceDefinitions. Low-level components on the other hand, have to interact with the host cluster. To do this, they use the vCluster syncer, which copies the pods created in the virtual cluster to the host cluster. This will allow the host cluster to schedule the pods. ==== vCluster Control Plane The vCluster control plane is a set of Kubernetes resources, that are used to manage the virtual cluster. These resources are: - *Kubernetes API server* -- this handles the API requests from `kubectl` - *Data store* -- the API stores its data in a data store, on real clusters this is usually etcd - *Controller Manager* -- the controller manager works similarly to the Kubernetes controller manager, however it only manages the virtual cluster's resources - (Optional) *Scheduler* -- schedules workloads inside the virtual cluster ==== Scheduling By default, vCluster uses the host cluster's scheduler to schedule pods. This is done to avoid the overhead of running a scheduler for each virtual cluster, however it introduces some limitations. 1. Labelling nodes inside the virtual cluster has no effect on scheduling. 2. Draining or tainting the nodes inside the virtual cluster has no effect on scheduling. 3. Custom schedulers cannot be used. To overcome these limitations, vCluster can be configured to use a dedicated scheduler for each virtual cluster.// #figure(caption: "vCluster Scheduler Configuration")[ // ```yaml // sync: // nodes: // enabled: true // enableScheduler: true // # Either syncAllNodes or nodeSelector is required // syncAllNodes: true // ``` // ] If the `PersistentVolumeClaim`-s are synced too, the virtual cluster's scheduler will be able to make storage-aware scheduling decisions. ==== Note on Multi-Namespace Sync This feature is in alpha state, and is not enabled by default, therefore it was not used for testing in this thesis. The multi namespace sync feature allows vCluster to create and manage namespaces in the host cluster specific to one virtual cluster. ==== Node Syncing By default, vCluster will create fake nodes in the virtual cluster, that correspond to the nodes in the host cluster. If there are multiple nodes in the host cluster, vCluster will only create fake nodes for the nodes, that have pods from the virtual cluster scheduled on them. There are other options for node syncing: - *Real Nodes* -- vCluster will copy the nodes' metadata from the host cluster to the virtual cluster. Not all of the nodes will be visible in the virtual cluster, only the ones that have pods from the virtual cluster scheduled on them, similarly to the default behavior. - *Real Nodes All* -- vCluster will copy all nodes from the host cluster to the virtual cluster. This is useful when DaemonSets are used in the virtual cluster. - *Real Nodes Label Selector* -- vCluster will only sync nodes that match a `key=value` label set on the host cluster nodes. This can be used to create a dedicated node pool for the virtual cluster. To enforce this behavior the `--enforce-node-selector` flag has to be set. - *Real Nodes + Label Selector* -- vCluster will sync nodes that match the label selector and the information in `spec.nodeName` from vCluster's `values.yaml` file. == Kubernetes Operator Version Conflict <version-conflict-sec> Especially in case of purpose-built software, it is common to depend on a very specific version of a Kubernetes operator. This provides a stable environment, where the operator will be bug-for-bug compatible. However, this can lead to version conflicts when we introduce some other software that depends on a different version of the same operator. This is a common problem, and in Kubernetes namespaces can be used as a workaround, to isolate the different versions of the operator. Some of these operators have to be installed cluster-wide, and cannot be installed in a namespace. This creates a problem, since we cannot use namespaces to isolate them. === #gls("olm", long: true) <olm-section> @olm is a tool that helps users install, update, and manage the lifecycle of all Operators and their associated services running across their Kubernetes clusters. The Operator Lifecycle includes its installation, updates, and removal in a Kubernetes cluster. Operators can be installed from Catalogs, which are collections of Operators that have been built, tested, and are maintained for Kubernetes and OpenShift users by independent software vendors (ISVs), community members, and Red Hat (the makers of @olm). @olm extends Kubernetes' native API and CLI to provide a declarative way to manage Operators and their dependencies in a cluster. To solve the version conflict dependency resolution can be used. Dependency resolution solves version mismatch problems by installing the adequate version of the operator that satisfies all of the version reuqirements in the cluster. This relies on the the operator follows the semantic versioning scheme, and declares its dependencies correctly. For example: if we have two operators: `foo` and `bar` that both depend on `baz`, @olm will look at the version requirements of `foo` and `bar`. If `foo` requires `baz` version `1.2` to `1.8`, and `bar` requires `baz` version `1.7` exactly, @olm will install `baz` version `1.7`, since it satisfies both requirements. In an other exampel if `foo` requires `baz` version `1.2` to `1.8`, and `bar` requires `baz` version `1.9` exactly, @olm will not be able to install `baz`, since there is no version that satisfies both requirements. In this case, the user has to manually resolve the conflict somehow. This is why @olm is not a silver bullet, and it cannot solve all version conflicts. === OpenStack Projects Kubernetes is rarely installed on bare metal, and is usually installed on top of some cloud infrastructure. OpenStack is a popular open-source cloud infrastructure software, that is used by many organizations. When using OpenStack the maintainer has the option to split the installation into multiple projects, that can be managed separately. This allows for the creation of a dedicated project for each cluster, which then can be used to isolate the different versions of the operator. This solution is not sufficient, since it removes the ability to dynamically scale the cluster, and the maintenance overhead is increased. === How can vCluster help? <vcluster-version-conflict-sec> Since the @crd[s] can be scoped to cluster-wide or namespace-scoped, we cannot always use namespaces to isolate the different versions of the operator. However, vCluster considers the @crd[s] high-level components, as we have seen in @vcluster-arch-fig and does not sync them to the host cluster. Since the @crd[s] are not synced to the host cluster, they do not appear in the host cluster, only in the virtual control plane. This leads to the conclusion, that we may have conflicting @crd[s], that are isolated to their virtual cluster. == PostgreSQL PostgreSQL, an open-source relational database management system (RDBMS), stands as a robust and versatile solution within the realm of data management. Developed with a strong emphasis on extensibility, standards compliance, and ACID (Atomicity, Consistency, Isolation, Durability) properties, PostgreSQL has emerged as a preferred choice for diverse applications ranging from small-scale projects to large-scale enterprise systems. Its extensible nature allows users to define custom data types, operators, and functions, fostering adaptability to specific project requirements. The support for various programming languages, including but not limited to, SQL, Python, and Java, further enhances its flexibility. With a mature and active community contributing to its development, PostgreSQL continually evolves, incorporating advanced features such as advanced indexing mechanisms, full-text search capabilities, and support for complex data types, positioning itself as a pivotal element in the landscape of relational databases#cite(<postgres-wikipedia>). In this thesis we will utilize PostgreSQL as an example application, to showcase the performance and capabilities of vCluster. // === pgbench // Pgbench, a benchmarking tool for PostgreSQL is an extra component of PostgreSQL, // it enables the assessment of the database system's performance, scalability, and // concurrency handling. This open-source tool offers a streamlined approach to // simulate various workloads, aiding researchers and developers in evaluating // PostgreSQL's capabilities under different conditions. With its simplicity and // efficiency, pgbench serves as a valuable instrument for gauging the // responsiveness and stability of PostgreSQL databases. == Apache Kafka Apache Kafka, a distributed event streaming platform, plays a pivotal role in modern data architectures, standing out as a key element in various data processing scenarios. Built for high-throughput, fault tolerance, and real-time data streaming, Kafka facilitates the seamless exchange of information between different components in a distributed system. Its publish-subscribe model and durable storage capabilities make it ideal for building scalable and resilient data pipelines. Kafka's ability to handle massive volumes of data with low latency has made it a go-to solution for applications ranging from real-time analytics to log aggregation#cite(<kafka-wikipedia>). In this thesis we will utilize Apache Kafka as an example application, for our latency benchmarks.
https://github.com/rainerwein/typst-fahrkarte
https://raw.githubusercontent.com/rainerwein/typst-fahrkarte/main/ticket.typ
typst
#let ticket="Deutschland-Ticket" #let ticket_alt="Deutschlandticket" #let preis="49€" #let inhaber="<NAME>" #let beginn="2023-05-01" #let geburtsdatum="2001-09-11" #let ende="2023-09-30" #let qrcode="./assets/qrcode.png" #let bgcolor=rgb(10, 50, 123) #let accolor=bgcolor.darken(10%) #set page(width: 87.6mm, height: 56mm, margin: 2mm, background: rect(width: 100%, height: 100%, fill: bgcolor)) #set text(fill: white) #place(center, dx: 1.3cm, dy: -0.4cm, text(font: "DB Sans", weight: "bold", size: 113pt, fill: accolor, preis)) #place(left, dx: 2.25mm, dy: 23.8mm, text(font: "DB Head", weight: "black", size: 18pt, tracking: 0.0pt, ticket)) #place(left, dx: 2.6mm, dy: 16.95mm, text(font: "DB Head", weight: "light", size: 16.5pt, tracking:0.0pt, "2. Klasse")) #place(bottom+left, dx: 2.6mm, dy: -4.1mm, text(font: "DB SansCond", weight: "bold", size: 10.75pt, tracking:0.35pt, inhaber)) #place(bottom+right, dx: -3.1mm, dy: -10.05mm, text(font: "DB Sans Comp", weight: "bold", size: 9pt, tracking:0.0pt, "Gültig von " + beginn + " bis")) #place(bottom+right, dx: -2.75mm, dy: -4.1mm, text(font: "DB Head", weight: "black", size: 14.5pt, tracking:0.1pt, ende)) #place(top+left, dx: 2.25mm, dy: 1.6mm, rect(width: 5.75mm, height: 0.815cm, stroke: none, fill: white, radius: 0.4mm)) #place(top+left, dx: 2.6mm, dy: 2.45mm, image("./assets/signet_deutschlandticket.png", width: 0.5cm)) #place(top+right, dx: -2.55mm, dy: 2.85mm, image("./assets/db_logo_white.svg", width: 0.8cm)) #pagebreak() #place(right+horizon, dx: -1.45mm, rect(width: 4.89cm, height: 4.89cm, fill: white, radius: 1mm)) #place(right+horizon, dx: -2.15mm, image(qrcode, width: 4.75cm)) #place(right+horizon, dx: -2.15mm, rect(width: 4.75cm, height: 4.75cm, stroke: white+1.25mm, fill: none, radius: 1.5mm)) #place(top+left, dx: 1.25mm, dy: 1.8mm, place(rect(stroke: white+0.6mm, radius: 1mm, fill: none, width: 3.05cm, height: 3.4cm)) + place(dx: 1.4mm, dy: 2.4mm, text(font: "DB SansCond", size: 9.75pt, "Deutschlandticket")) + place(dx: 2.1mm, dy: 9.9mm, text(font: "DB Sans Comp", size: 7.75pt, "Gültig ab: " + beginn)) + place(dx: 2.1mm, dy: 13.2mm, text(font: "DB Sans Comp", size: 7.75pt, "Gültig bis: " + ende)) + place(dx: 2.1mm, dy: 18.2mm, text(font: "DB Sans Comp", weight: "bold", size: 7pt, inhaber)) + place(dx: 2.1mm, dy: 21.5mm, text(font: "DB Sans Comp", size: 7pt, "Geburtsdatum: " + geburtsdatum)) + place(dx: 2.2mm, dy: 27.55mm, image("./assets/sru_white.svg", width: 2.4cm)) + place(dy: 34.23mm, image("./assets/br111.png", width: 3cm)) )
https://github.com/mangkoran/utm-thesis-typst
https://raw.githubusercontent.com/mangkoran/utm-thesis-typst/main/README.md
markdown
MIT License
# UTM Thesis Typst > [!IMPORTANT] > Help wanted! Feel free to submit issue(s) and pull request(s)! You are here because: 1. MS Word sucks, and/or 2. LaTeX sucks ## Todo ### Pages - [x] 01 Front Cover - [x] 02 Declaration of Thesis/Dissertation/Project Form - [x] 03 Declaration by Supervisor(s) - [x] 04 Declaration of Cooperation - [x] 05 Certification of Examination - [x] 06 Title Page - [x] 07 Author's Declaration of Originality - [x] 08 Acknowledgement - [x] 09 Abstract (English) - [x] 10 Abstract (Malay) - [ ] 11 Table of Contents - [ ] 12 List of Tables - [ ] 13 List of Figures - [ ] 14 List of Abbreviations - [ ] 15 List of Symbols - [ ] 16 List of Appendices ### Formatting - [ ] Paper size - [ ] Typeface and font size - [ ] Margin - [ ] Spacing - [ ] Chapter title and first line - [ ] Last line and sub-section - [ ] Sub-section title and first line - [ ] Between paragraphs - [ ] Number and title of sub-section - [ ] First line of paragraph - [ ] New paragraph must not begin on last line - [ ] Last line and table or figure - [ ] Spacing after comma - [ ] Pagination - [ ] Preliminary and main pages - [ ] Chapter start on odd page - [ ] Chapter end on even page ## Useful Resources - [Modules](https://typst.app/docs/reference/scripting/#modules)
https://github.com/HiiGHoVuTi/requin
https://raw.githubusercontent.com/HiiGHoVuTi/requin/main/log/compacite.typ
typst
#import "../lib.typ": * #show heading: heading_fct Pour $A$ un ensemble de formules de la logique propositionnelle, on dit qu'une valuation $mu$ _satisfait_ $A$ si $forall F in A, mu tack.double F$. On note cela $mu tack.double A$. On dit que $A$ est _finement satisfiable_ si pour tout $E subset.eq A$ fini, $E$ est satisfiable. On pose $(X_n)_n$ une suite de variables propositionelle. #question(0)[ Les ensembles suivants sont-ils satisfiables ? - $A_1 = { X_(2n) : n in NN } union { not X_(2n+1) : n in NN}$ - $A_2 = { X_i or not X_(i+1) : i in NN }$ - $A_3 = { X_i and not X_(i+1) : i in NN }$ ] #correct([ - Sat pour $mu : X_n |-> cases(top &"si" n equiv 0 [2],bot &"si" n equiv 1 [2])$ - Sat pour la même mu ou pour $mu : X_n |-> top$ - Unsat: on suppose par l'absurde qu'il existe $mu$. alors $mu tack.double X_0 and not X_1$ et $mu tack.double X_1 and not X_2$. Donc $mu(X_1) = top$ et $mu(X_1) = bot$, absurde. ]) On cherche à montrer le _théorème de compacité_: $A$ est satisfiable si et seulement si $A$ est finement satisfiable #question(1)[ Montrer que si $A$ est satisfiable alors il est finement satisfiable.] #question(3)[ Dans le cas ou l'ensemble des variables propositionnelles de $A$ est dénombrable, démontrer le théorème de compacité. On pourra chercher à construire une valuation par récurrence sur les variables propositionnelles.] #correct([ 2. Soit $mu$ qui sat $A$. Soit $B subset.eq A$ fini. Alors pour tout $F in B$, $F in A$, donc $mu tack.double F$ 3. Supposons $A$ finement satisfiable. On note les variable propositionelle $(X_n)_(n in NN)$. On crée par récurrence une suite de valeurs $(epsilon_n)_(n in NN) in {top, bot}^NN$ tel que pour tout $n in NN$, pour tout $B subset.eq A$ fini, on a une valuation $mu tack.double B$ et telle que $forall i < n, epsilon_i = mu(X_i)$. - Rien à faire pour l'initialisation. - Heredité: Supposons que en posant $epsilon_n = top$ on a pas $H(n)$. Donc il existe un $B subset.eq A$ fini tel que, soit $mu tack.double B$, on a nécessairement $mu(X_n) = bot$. On pose alors $epsilon_n = bot$. Soit $C subset.eq A$ fini. Alors $B union C$ est fini, donc il existe une valuation $mu tack.double B union C$. Donc $mu tack.double B$ et donc $mu(X_n) = bot$, et en même temps $mu tack.double C$. Donc $H(n)$ est toujours vérifié. ]) On dit qu'un graphe non orienté $G = (S,E)$ avec $E subset.eq S^2$ et $S$ potentiellement infini est $N$-coloriable s'il existe une fonction $c: S -> [| 1; N|]$ tel que $forall (x,y) in E, c(x) != c(y)$ #question(2)[ Utiliser le théorème de compacité pour montrer que un graphe infini est $N$ coloriable si et seulement si tout ses sous-graphes fini sont $N$ coloriables.] #correct([ Soit $G=(S,E)$ un graphe. On pose $X_(u,k)$ pour $u in S$ et $k in [|1;N|]$ qui représente la variable valant vrai ssi $c(u) = k$. On pose $ F_u := \"or.big_(i=1)^N X_(u,i) and (and.big_(j !=i) not X_(u,j))\" $ qui indique qu'un sommet admet une unique couleur et $ F_((u,v)) := \"and.big_(1<=j<=N) not (X_(u,i) and X_(v,i)) \" $ qui indique que deux sommets relié sont de couleurs différentes. Maintenant, par compacité, ${F_u : u in S} union {F_e : e in E}$ est finement satifiable ssi il est satifiable. Il faut juste arriver à poser $c : S --> [|1; N |]$ le coloriage à partir d'une valuation et $mu : "Var" -> {top, bot}$ à partir du coloriage. ])
https://github.com/Az-21/typst-components
https://raw.githubusercontent.com/Az-21/typst-components/main/style/1.0.0/Components/showybox-presets.typ
typst
Creative Commons Zero v1.0 Universal
#import "../dependencies.typ": * #import "../Colors/m3.typ": * #let m3 = material3 #let kshowybox( container, onContainer, containerMediumContrast, onContainerMediumContrast, containerHighContrast, onContainerHightContrast, ) = showybox.with( title-style: ( color: onContainerHightContrast, boxed-style: ( anchor: (x: left, y: horizon), radius: 2pt, ), ), body-style: (color: onContainer), footer-style: (color: onContainerMediumContrast), frame: ( border-color: containerHighContrast, title-color: containerHighContrast, body-color: container, footer-color: containerMediumContrast, radius: 4pt, ), ) #let blue-box = kshowybox( m3.blue.light.primaryContainer, m3.blue.light.onPrimaryContainer, m3.blue.light.primaryContainerMediumContrast, m3.blue.light.onPrimaryContainerMediumContrast, m3.blue.light.primaryContainerHighContrast, m3.blue.light.onPrimaryContainerHighContrast, ) #let green-box = kshowybox( m3.green.light.primaryContainer, m3.green.light.onPrimaryContainer, m3.green.light.primaryContainerMediumContrast, m3.green.light.onPrimaryContainerMediumContrast, m3.green.light.primaryContainerHighContrast, m3.green.light.onPrimaryContainerHighContrast, ) #let red-box = kshowybox( m3.red.light.primaryContainer, m3.red.light.onPrimaryContainer, m3.red.light.primaryContainerMediumContrast, m3.red.light.onPrimaryContainerMediumContrast, m3.red.light.primaryContainerHighContrast, m3.red.light.onPrimaryContainerHighContrast, ) // TODO: purple-box
https://github.com/pawarherschel/typst
https://raw.githubusercontent.com/pawarherschel/typst/main/modules/publications.typ
typst
Apache License 2.0
#import "../template/template.typ": * #import "../helpers/helpers.typ": * #let SOT = yaml("../SOT.yaml") #let publications = () #if SOT.keys().contains("publications") { publications = SOT.publications } #if publications.len() != 0 { cvSection("Publications") for publication in publications { let title = publication.title let society = publication.society let date = publication.date let location = for key in publication.location.keys() { let v = publication.location.at(key) if key == "github" { github-link(v) } } let description = join-as-bullet-list(publication.description) cvEntry( title: title, society: society, date: date, location: location, description: description ) } } #if SOT.keys().contains("bibliography") { let bib = SOT.bibliography let bibPath = bib.bibPath if bibPath.len() != 0 { bibPath = "../" + bibPath } let refStyle = bib.refStyle if bibPath.len() != 0 { cvPublication( bibPath: bibPath, refStyle: refStyle, ) } }
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/visualize/svg-text.typ
typst
Apache License 2.0
// Test SVG with text. --- #set page(width: 250pt) #figure( image("/files/diagram.svg"), caption: [A textful diagram], ) --- #set page(width: 250pt) #show image: set text(font: ("Roboto", "Noto Serif CJK SC")) #figure( image("/files/chinese.svg"), caption: [Bilingual text] )
https://github.com/tingerrr/hydra
https://raw.githubusercontent.com/tingerrr/hydra/main/doc/examples/skip/a.typ
typst
MIT License
#import "/doc/examples/template.typ": example #show: example.with(skip-starting: true) #include "content.typ"
https://github.com/Wuvist/lcpc
https://raw.githubusercontent.com/Wuvist/lcpc/main/paper_template.typ
typst
/////////////////////////////// // This Typst template is for working paper draft. // It is based on the general SSRN paper. // Copyright (c) 2024 // Author: <NAME> // License: MIT // Version: 0.4.2 // Date: 2024-02-17 // Email: <EMAIL> /////////////////////////////// #import "@preview/ctheorems:1.1.0": * #import "@preview/tablex:0.0.8": tablex, rowspanx, colspanx, hlinex #import "@preview/tablem:0.1.0": tablem #let paper( font: "Times New Roman", fontsize: 12pt, title: none, authors: (), date: "", abstract: [], keywords: [], JEL: [], acknowledgments: none, // bibloc: "", // bibstyle: "ieee", // bibtitle: "References", doc, ) = { set par(leading: 1em) // Set and show rules from before. set text( font: font, size: fontsize ) set footnote(numbering: "*") set footnote.entry( separator: line(length: 100%, stroke: 0.5pt) ) set footnote.entry(indent: 0em) set align(left) text(17pt, align(center,{title;footnote(acknowledgments)})) v(15pt) let count = authors.len() let ncols = calc.min(count, 3) set footnote.entry(indent: 0em) grid( columns: (1fr,) * ncols, row-gutter: 24pt, ..authors.map(author => { text(14pt,align(center,{author.name; { if author.note != "" { footnote(author.note) } };[\ ] author.affiliation; [\ ] link("mailto:" + author.email)}) ) }), ) v(20pt) if date != "" { align(center,[This Version: #date]) v(25pt) } if abstract != [] { par(justify: true)[ #align(center, [*Abstract*]) #abstract ] v(10pt) } if keywords != [] { par(justify: true)[ #set align(left) #emph([*Keywords:*]) #keywords ] v(5pt) } if JEL != [] { par(justify: true)[ #set align(left) #emph([*JEL Classification:*]) #JEL ] v(5pt) } pagebreak() set heading(numbering: "1.") set math.equation(numbering: "(1)") set footnote(numbering: "1") set footnote.entry( separator: line(length: 100%, stroke: 0.5pt) ) set footnote.entry(indent: 0em) set align(left) columns(1, doc) // pagebreak() // bibliography( // bibloc, // style: bibstyle, // title: bibtitle, // ) } // #set heading(numbering: "1.1.") #let theorem = thmbox("theorem", "Theorem", fill: rgb("#eeffee")) #let corollary = thmplain( "corollary", "Corollary", base: "theorem", titlefmt: strong ) #let definition = thmbox( "definition", "Definition", base_level: 1, stroke: rgb("#0000ff") + 1pt, fill: rgb("#eeeeff") ) #let lemma = thmbox( "theorem", "Lemma", base: "theorem", fill: rgb("#eeffee"), titlefmt: strong) #let example = thmplain("example", "Example").with(numbering: none) #let proof = thmplain( "proof", "Proof", base: "theorem", bodyfmt: body => [ #body #h(1fr) $square$ ] ).with(numbering: none) #let remark = thmplain( "remark", "Remark" ).with(numbering: none)
https://github.com/AU-Master-Thesis/thesis
https://raw.githubusercontent.com/AU-Master-Thesis/thesis/main/sections/5-discussion/mod.typ
typst
MIT License
#import "../../lib/mod.typ": * = Discussion <Discussion> #include "study-1.typ" #include "study-2.typ" #include "study-3.typ" #include "./future-work.typ"
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/compiler/hint.typ
typst
Apache License 2.0
// Test hints on diagnostics. // Ref: false --- // Error: 1:17-1:19 expected length, found integer: a length needs a unit - did you mean 12pt? #set text(size: 12) --- #{ let a = 2 a = 1-a a = a -1 // Error: 7-10 unknown variable: a-1 // Hint: 7-10 if you meant to use subtraction, try adding spaces around the minus sign a = a-1 } --- #{ // Error: 3-6 unknown variable: a-1 // Hint: 3-6 if you meant to use subtraction, try adding spaces around the minus sign a-1 = 2 } --- = Heading <intro> // Error: 1:20-1:26 cannot reference heading without numbering // Hint: 1:20-1:26 you can enable heading numbering with `#set heading(numbering: "1.")` Can not be used as @intro --- // This test is more of a tooling test. It checks if hint annotation validation // can be turned off. // Hints: false = Heading <intro> // Error: 1:20-1:26 cannot reference heading without numbering Can not be used as @intro
https://github.com/Jollywatt/typst-fletcher
https://raw.githubusercontent.com/Jollywatt/typst-fletcher/master/tests/example-gallery/test.typ
typst
MIT License
#set page(width: auto, height: auto, margin: 1em) #import "/src/exports.typ" as fletcher: diagram, node, edge #[ #diagram(cell-size: 15mm, $ G edge(f, ->) edge("d", pi, ->>) & im(f) \ G slash ker(f) edge("ur", tilde(f), "hook-->") $) ] #pagebreak() #[ #import fletcher.shapes: diamond #diagram( node-stroke: 1pt, edge-stroke: 1pt, node((0,0), [Start], corner-radius: 2pt, extrude: (0, 3)), edge("-|>"), node((0,1), align(center)[ Hey, wait,\ this flowchart\ is a trap! ], shape: diamond), edge("d,r,u,l", "-|>", [Yes], label-pos: 0.1) ) ] #pagebreak() #[ #diagram( node-stroke: .1em, node-fill: gradient.radial(blue.lighten(80%), blue, center: (30%, 20%), radius: 80%), spacing: 4em, edge((-1,0), "r", "-|>", `open(path)`, label-pos: 0, label-side: center), node((0,0), `reading`, radius: 2em), edge(`read()`, "-|>"), node((1,0), `eof`, radius: 2em), edge(`close()`, "-|>"), node((2,0), `closed`, radius: 2em, extrude: (-2.5, 0)), edge((0,0), (0,0), `read()`, "--|>", bend: 130deg), edge((0,0), (2,0), `close()`, "-|>", bend: -40deg), ) ] #pagebreak() #[ #diagram($ e^- edge("rd", "-<|-") & & & edge("ld", "-|>-") e^+ \ & edge(gamma, "wave") \ e^+ edge("ru", "-|>-") & & & edge("lu", "-<|-") e^- \ $) ] #pagebreak() #[ #import fletcher.shapes: house, hexagon #set text(font: "Fira Sans") #let blob(pos, label, tint: white, ..args) = node( pos, align(center, label), width: 26mm, fill: tint.lighten(60%), stroke: 1pt + tint.darken(20%), corner-radius: 5pt, ..args, ) #diagram( spacing: 8pt, cell-size: (8mm, 10mm), edge-stroke: 1pt, edge-corner-radius: 5pt, mark-scale: 70%, blob((0,1), [Add & Norm], tint: yellow, shape: hexagon), edge(), blob((0,2), [Multi-Head Attention], tint: orange), blob((0,4), [Input], shape: house.with(angle: 30deg), width: auto, tint: red), for x in (-.3, -.1, +.1, +.3) { edge((0,2.8), (x,2.8), (x,2), "-|>") }, edge((0,2.8), (0,4)), edge((0,3), "l,uu,r", "--|>"), edge((0,1), (0, 0.35), "r", (1,3), "r,u", "-|>"), edge((1,2), "d,rr,uu,l", "--|>"), blob((2,0), [Softmax], tint: green), edge("<|-"), blob((2,1), [Add & Norm], tint: yellow, shape: hexagon), edge(), blob((2,2), [Feed Forward], tint: blue), ) ] #pagebreak() #[ #diagram( node-defocus: 0, spacing: (1cm, 2cm), edge-stroke: 1pt, crossing-thickness: 5, mark-scale: 70%, node-fill: luma(97%), node-outset: 3pt, node((0,0), "magma"), node((-1,1), "semigroup"), node(( 0,1), "unital magma"), node((+1,1), "quasigroup"), node((-1,2), "monoid"), node(( 0,2), "inverse semigroup"), node((+1,2), "loop"), node(( 0,3), "group"), { let quad(a, b, label, paint, ..args) = { paint = paint.darken(25%) edge(a, b, text(paint, label), "-|>", stroke: paint, label-side: center, ..args) } quad((0,0), (-1,1), "Assoc", blue) quad((0,1), (-1,2), "Assoc", blue, label-pos: 0.3) quad((1,2), (0,3), "Assoc", blue) quad((0,0), (0,1), "Id", red) quad((-1,1), (-1,2), "Id", red, label-pos: 0.3) quad((+1,1), (+1,2), "Id", red, label-pos: 0.3) quad((0,2), (0,3), "Id", red) quad((0,0), (1,1), "Div", yellow) quad((-1,1), (0,2), "Div", yellow, label-pos: 0.3, "crossing") quad((-1,2), (0,3), "Inv", green) quad((0,1), (+1,2), "Inv", green, label-pos: 0.3) quad((1,1), (0,2), "Assoc", blue, label-pos: 0.3, "crossing") }, ) ]
https://github.com/EpicEricEE/typst-marge
https://raw.githubusercontent.com/EpicEricEE/typst-marge/main/tests/container/place/test.typ
typst
MIT License
#import "/src/lib.typ": sidenote #set par(justify: true) #set page(width: 8cm, height: auto, margin: (outside: 4cm, rest: 5mm)) #let sidenote = sidenote.with(numbering: "1") #lorem(20) #place( bottom, dy: -32pt, dx: 5pt, block(width: 3cm, inset: 3pt, fill: yellow, stroke: black)[ #lorem(6) #sidenote[This sidenote comes from a placed block.] ] )
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/text/tracking-spacing-04.typ
typst
Other
// Test word spacing. #set text(spacing: 1em) My text has spaces.
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/143.%20ycstart.html.typ
typst
ycstart.html How Y Combinator Started March 2012Y Combinator's 7th birthday was March 11. As usual we were so busy we didn't notice till a few days after. I don't think we've ever managed to remember our birthday on our birthday. On March 11 2005, Jessica and I were walking home from dinner in Harvard Square. Jessica was working at an investment bank at the time, but she didn't like it much, so she had interviewed for a job as director of marketing at a Boston VC fund. The VC fund was doing what now seems a comically familiar thing for a VC fund to do: taking a long time to make up their mind. Meanwhile I had been telling Jessica all the things they should change about the VC business � essentially the ideas now underlying Y Combinator: investors should be making more, smaller investments, they should be funding hackers instead of suits, they should be willing to fund younger founders, etc. At the time I had been thinking about doing some angel investing. I had just given a talk to the undergraduate computer club at Harvard about how to start a startup, and it hit me afterward that although I had always meant to do angel investing, 7 years had now passed since I got enough money to do it, and I still hadn't started. I had also been thinking about ways to work with <NAME> and <NAME> again. A few hours before I had sent them an email trying to figure out what we could do together. Between Harvard Square and my house the idea gelled. We'd start our own investment firm and Jessica could work for that instead. As we turned onto Walker Street we decided to do it. I agreed to put $100k into the new fund and Jessica agreed to quit her job to work for it. Over the next couple days I recruited Robert and Trevor, who put in another $50k each. So YC started with $200k. Jessica was so happy to be able to quit her job and start her own company that I took her picture when we got home. The company wasn't called Y Combinator yet. At first we called it Cambridge Seed. But that name never saw the light of day, because by the time we announced it a few days later, we'd changed the name to Y Combinator. We realized early on that what we were doing could be national in scope and we didn't want a name that tied us to one place. Initially we only had part of the idea. We were going to do seed funding with standardized terms. Before YC, seed funding was very haphazard. You'd get that first $10k from your friend's rich uncle. The deal terms were often a disaster; often neither the investor nor the founders nor the lawyer knew what the documents should look like. Facebook's early history as a Florida LLC shows how random things could be in those days. We were going to be something there had not been before: a standard source of seed funding. We modelled YC on the seed funding we ourselves had taken when we started Viaweb. We started Viaweb with $10k we got from our friend <NAME>, the husband of <NAME>, whose painting class I took as a grad student at Harvard. Julian knew about business, but you would not describe him as a suit. Among other things he'd been president of the National Lampoon. He was also a lawyer, and got all our paperwork set up properly. In return for $10k, getting us set up as a company, teaching us what business was about, and remaining calm in times of crisis, Julian got 10% of Viaweb. I remember thinking once what a good deal Julian got. And then a second later I realized that without Julian, Viaweb would never have made it. So even though it was a good deal for him, it was a good deal for us too. That's why I knew there was room for something like Y Combinator. Initially we didn't have what turned out to be the most important idea: funding startups synchronously, instead of asynchronously as it had always been done before. Or rather we had the idea, but we didn't realize its significance. We decided very early that the first thing we'd do would be to fund a bunch of startups over the coming summer. But we didn't realize initially that this would be the way we'd do all our investing. The reason we began by funding a bunch of startups at once was not that we thought it would be a better way to fund startups, but simply because we wanted to learn how to be angel investors, and a summer program for undergrads seemed the fastest way to do it. No one takes summer jobs that seriously. The opportunity cost for a bunch of undergrads to spend a summer working on startups was low enough that we wouldn't feel guilty encouraging them to do it. We knew students would already be making plans for the summer, so we did what we're always telling startups to do: we launched fast. Here are the initial announcement and description of what was at the time called the Summer Founders Program. We got lucky in that the length and structure of a summer program turns out to be perfect for what we do. The structure of the YC cycle is still almost identical to what it was that first summer. We also got lucky in who the first batch of founders were. We never expected to make any money from that first batch. We thought of the money we were investing as a combination of an educational expense and a charitable donation. But the founders in the first batch turned out to be surprisingly good. And great people too. We're still friends with a lot of them today. It's hard for people to realize now how inconsequential YC seemed at the time. I can't blame people who didn't take us seriously, because we ourselves didn't take that first summer program seriously in the very beginning. But as the summer progressed we were increasingly impressed by how well the startups were doing. Other people started to be impressed too. Jessica and I invented a term, "the Y Combinator effect," to describe the moment when the realization hit someone that YC was not totally lame. When people came to YC to speak at the dinners that first summer, they came in the spirit of someone coming to address a Boy Scout troop. By the time they left the building they were all saying some variant of "Wow, these companies might actually succeed." Now YC is well enough known that people are no longer surprised when the companies we fund are legit, but it took a while for reputation to catch up with reality. That's one of the reasons we especially like funding ideas that might be dismissed as "toys" � because YC itself was dismissed as one initially. When we saw how well it worked to fund companies synchronously, we decided we'd keep doing that. We'd fund two batches of startups a year. We funded the second batch in Silicon Valley. That was a last minute decision. In retrospect I think what pushed me over the edge was going to Foo Camp that fall. The density of startup people in the Bay Area was so much greater than in Boston, and the weather was so nice. I remembered that from living there in the 90s. Plus I didn't want someone else to copy us and describe it as the Y Combinator of Silicon Valley. I wanted YC to be the Y Combinator of Silicon Valley. So doing the winter batch in California seemed like one of those rare cases where the self-indulgent choice and the ambitious one were the same. If we'd had enough time to do what we wanted, Y Combinator would have been in Berkeley. That was our favorite part of the Bay Area. But we didn't have time to get a building in Berkeley. We didn't have time to get our own building anywhere. The only way to get enough space in time was to convince Trevor to let us take over part of his (as it then seemed) giant building in Mountain View. Yet again we lucked out, because Mountain View turned out to be the ideal place to put something like YC. But even then we barely made it. The first dinner in California, we had to warn all the founders not to touch the walls, because the paint was still wet.
https://github.com/kaarmu/typst.vim
https://raw.githubusercontent.com/kaarmu/typst.vim/main/tests/italic-bold.typ
typst
MIT License
= Italic // Italic _Lorem ipsum_ // Not italic Lorem\_ipsum // Italic _Lorem\_ipsum_ // Error _Lorem ipsum\_ // Ialic _Lorem ipsum_ // Error _Lorem ipsum_ // Citations _Lorem ipsum_ @dolor_sit _Lorem ipsum_ #cite("dolor_sit") = Bold // Bold *Lorem ipsum* // Not bold Lorem\*ipsum // Bold *Lorem\*ipsum* // Error *Lorem ipsum\* // Bold *Lorem ipsum* // Error *Lorem ipsum* // Citations *Lorem ipsum* @dolor_sit *Lorem ipsum* #cite("dolor_sit")
https://github.com/YonniGashu/resume
https://raw.githubusercontent.com/YonniGashu/resume/main/resume.typ
typst
#import "template.typ": resume, header, resume_heading, edu_item, exp_item, project_item, skill_item, exp_item_DOD #show: resume #header( name: "<NAME>", phone: "202-816-2145", email: "<EMAIL>", linkedin: "linkedin.com/in/ygashu", site: "ygashu.dev", ) #resume_heading[Education] #edu_item( name: "Georgia Institute of Technology", degree: "Bachelor of Science in Computer Science - GPA 3.85/4.0", location: "Atlanta, GA", date: "Graduating May 2027", [Specializing in #emph[Artificial Intelligence] & #emph[Information Internetworks]], [Coursework: Data Structures & Algorithms, Computer Organization, Object-Oriented Programming, Linear Algebra], ) #resume_heading[Experience] #exp_item_DOD() #exp_item( role: "Verizon", name: "System Engineer Intern", location: "Remote", date: "Jul. 2022 - Aug. 2022", [Implemented GitLab and Jenkins for streamlined continuous integration and continuous deployment (CI/CD) processes, facilitating efficient code management], [Acquired expertise in essential systems, encompassing DevOps practices, AWS, microservices architecture, and cloud computing solutions], ) #resume_heading("Awards and Additional Experience") #skill_item( category: "Georgia Tech Provost Scholarship", skills: "Prestigious merit scholarship awarded to 60 out-of-state students, from a pool of thousands", ) #skill_item( category: "Stokes Educational Scholarship", skills: "Selected to receive up to $30,000 in tuition scholarship annually, a year-round salary, and summer internships", ) #skill_item( category: "VIP Member", skills: "Member of the Autonomous and Connected Driving Simulator VIP on the Cybersecurity subteam", ) #resume_heading("Technical Skills") #skill_item( category: "Languages", skills: "Java, Python, C#, TypeScript, HTML, CSS", ) #skill_item(category: "Frameworks", skills: "React, Node.js, Vue, JUnit") #skill_item( category: "Developer Tools", skills: "Linux, Git, Docker, Amazon Web Services, Google Cloud Platform, VS Code, IntelliJ, Jenkins, Agile, JIRA, Unity", )
https://github.com/Lich496/Typst-with-Docker
https://raw.githubusercontent.com/Lich496/Typst-with-Docker/main/CHANGELOG.md
markdown
Apache License 2.0
# Change Log All notable changes to the "typst-with-docker" extension will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. ## [Unreleased] - Initial release
https://github.com/SkytAsul/fletchart
https://raw.githubusercontent.com/SkytAsul/fletchart/main/src/lib.typ
typst
#import "elements.typ" #import "declarative.typ" #import "logical.typ" #import "internals.typ" #import "deps.typ" #import "utils.typ"
https://github.com/vEnhance/1802
https://raw.githubusercontent.com/vEnhance/1802/main/src/mt1.typ
typst
MIT License
#import "@local/evan:1.0.0":* = Challenge review problems up to Midterm Exam 1 <ch-mt1> This is a set of six more difficult problems that I crafted for my students to help them prepare for their first midterm exam (which covered all the linear algebra parts and complex numbers). You can try them here if you want, but don't be discouraged if you find the problems tricky. All of these are much harder than anything that showed up on their actual midterm. Suggested usage: think about each for 15-30 minutes, then read the solution. I hope this helps you digest the material; I tried to craft problems that teach deep understanding and piece together multiple ideas, rather than just using one or two isolated recipes. #prob[ In $RR^3$, compute the projection of the vector $vec(4,5,6)$ onto the plane $x+y+2z=0$. ] <prob-mt1p1> #prob[ Suppose $A$, $B$, $C$, $D$ are points in $RR^3$. Give a geometric interpretation for this expression: $ |arrow(D A) dot (arrow(D B) times arrow(D C))|. $ ] <prob-mt1p2> #prob[ Fix a plane $cal(P)$ in $RR^3$ which passes through the origin. Consider the linear transformation $f : RR^3 -> RR^3$ where $f(bf(v))$ is the projection of $bf(v)$ onto $cal(P)$. Let $M$ denote the $3 times 3$ matrix associated to $f$. Compute the determinant of $M$. ] <prob-mt1p3> #prob[ Let $bf(a)$ and $bf(b)$ be two perpendicular unit vectors in $RR^3$. A third vector $bf(v)$ in $RR^3$ lies in the span of $bf(a)$ and $bf(b)$. Given that $bf(v) dot bf(a) = 2$ and $bf(v) dot bf(b) = 3$, compute the magnitudes of the cross products $bf(v) times bf(a)$ and $bf(v) times bf(b)$. ] <prob-mt1p4> #prob[ Compute the trace of the $2 times 2$ matrix $M$ given the two equations $ M vec(4,7) = vec(5,9) " and " M vec(5,9) = vec(4,7). $ ] <prob-mt1p5> #prob[ There are three complex numbers $z$ satisfying $z^3 = 5 + 6 i$. Suppose we plot these three numbers in the complex plane. Compute the area of the triangle they enclose. ] <prob-mt1p6> Solutions to these six problems are in @ch-sol-mt1.
https://github.com/ludwig-austermann/typst-din-5008-letter
https://raw.githubusercontent.com/ludwig-austermann/typst-din-5008-letter/main/examples/template_letter.typ
typst
MIT License
#import "../letter.typ" : letter, letter-styling, block-hooks, debug-options #let block-hooks = block-hooks( letter-head: pad(10mm)[*header.* A DIN 5008 based Typst letter template, to be found at:\ #link("https://github.com/ludwig-austermann/typst-din-5008-letter")], footer: [some footer] ) #show: letter.with( name: text(green)[sender name], return-information: [@name, somewhere\ further information], address-zone: [recipient name\ recipient address], information-field: grid(columns: 2, column-gutter: 5mm, row-gutter: 6pt)[Sender:][@name][Address:][sender address], title: [subject of letter], reference-signs: ( ([Reference 1], [A2-335-F12]), ([Reference 2], [137 288]), ([Date], [@date]) ), block-hooks: block-hooks, wordings: "debug" ) #for i in (3, 12, 3, 12, 15, 35, 1) { lorem(10*i) parbreak() }
https://github.com/optimizerfeb/MathScience
https://raw.githubusercontent.com/optimizerfeb/MathScience/main/고속 역제곱근 알고리즘.typ
typst
#set text(font: "KoPubBatang_Pro") #align(center, text(17pt)[ *고속 역제곱근 알고리즘* ]) #align(right, text(10pt)[ 한남대학교 수학과 20172581 김남훈 ]) = 1. 고속 역제곱근 알고리즘 고속 역 제곱근 알고리즘은 UC버클리 수학과 교수인 윌리엄 카한이 $1986$년 아이디어를 제시하고, 그 아이디어에 기반하여 실리콘 그래픽스 사가 90년대 초 개발한 알고리즘으로, 간단히 설명하면 실수 $a$ 에 대해 $a^(- 1/2)$ 를 빠르게 계산하는 알고리즘이다. 우선 코드를 보면 다음과 같다. #figure( box( fill: luma(240), radius: 5%, outset: 3%, ```C float q_rsqrt(float number) { long i; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; y = number; i = * ( long * ) &y; // evil floating point bit level hacking i = 0x5f3759df - ( i >> 1 ); // what the fuck? y = * ( float * ) &i; y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration // y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed return y; } ``` ) , caption: [출처: https://en.wikipedia.org/wiki/Fast_inverse_square_root], supplement: none ) 위 코드는 1999년 발매된 게임 *퀘이크 $3$ 아레나* 의 소스코드 중 일부로, 유명 프로그래머인 존 카멕이 작성했다고 알려져 있으며, 주석에는 이해할 수 없는 코드에 대한 동료 프로그래머의 당혹감이 담겨 있다. 위 함수가 어떻게 $("number")^(- 1/2)$ 을 반환하는지 지금부터 알아보자. = 2. 컴퓨터가 숫자를 저장하는 방법 컴퓨터에 숫자가 저장되는 방법은 크게 두 가지, 정수형과 실수형으로 나눌 수 있다. 컴퓨터 메모리는 $0$ 과 $1$ 만을 저장할 수 있으므로, 정수형과 실수형 모두 기본적으로 이진법으로 저장된다. 이 때, $0$ 또는 $1$ 의 값을 갖는 각 자리수를 비트(bit) 라고 한다. === 정수형\ 정수형은 주어진 정수를 다음과 같이 $32$ 자리 또는 $64$ 자리의 이진법으로 저장한다. 이 때, 첫 번째 비트는 수의 부호($0$ 이면 양수, $1$ 이면 음수) 를 나타내며, 뒤의 비트들은 이진수의 각 자릿수를 나타낸다. $ 537 = 0 space 0000000 space 00000000 space 00000010 space 00011001_((2)) $ === 실수형 실수형은 다른 말로 부동소수점(floating point)이라고 한다. 수학과 학생들은 다음과 같은 표현에 익숙할 것이다. $ 373.884 = 3.73884 times 10^2 $ 여기서 $3.73884$ 을 *유효숫자*, $2$ 를 *지수* 라고 한다. 컴퓨터가 실수를 저장하는 방법도 동일하다. $ 373.884 &= 101110101.11100010010011011101_((2))\ &= 1.0111010111100010010011011101_((2)) * 2^8\ $ 현대의 표준 규격은 부호를 나타내는 $1$ 비트, 지수를 나타내는 $8$ 비트, 유효숫자를 나타내는 $23$ 비트로 총 $32$ 비트로 실수를 저장한다. 표준 규격대로 위의 수를 저장하면 $ 373.884 tilde.eq 0 space underbrace(10000111, 8) space underbrace(01110101111000100100110, 23) space.hair_((2)) $ 가 된다. 여기서, 지수가 $00001000_((2))$ 이 아니라 $10000111_((2))$ 인 이유는, 지수에 $2^8 - 1 = 127$ 을 더해 저장하기 때문이다. 이러한 방식의 장점은 $1$ 보다 작은 실수도 저장할 수 있다는 것이다. 실제로 $32$ 비트 부동소수점 방식은 $2^(-127) ~ 2^(127)$ (약 $10^(-38) ~ 10^(38)$) 사이의 실수를 저장할 수 있다. = 2. 정수형과 실수형의 관계 고속 역제곱근 알고리즘에는 실수형 변수를 정수형으로 인식시키는 과정과, 반대로 정수형 데이터를 실수형으로 인식시키는 과정이 존재한다. 이것을 이해하기 위해, 먼저 정수형과 실수형의 관계를 수학적으로 나타내보자. 먼저, 실수형 변수 $x$ 를 이루는 $32$ 비트 중 중 맨 앞의 $1$ 비트를 $s$, 뒤의 $8$ 비트를 $a$, 그 뒤의 $23$ 비트를 $b$ 라 하자. #figure( $ 3.14 = underbrace(0, s) space underbrace(10000000, a) space underbrace(10010001111010111000010, b) $, caption: [실수형 변수를 $s, a, b$ 로 나누는 예시], supplement: none ) 이제 이것을 정수로 인식시켰을 때 받아들이는 값을 $y$ 라 하자. 그러면 $y$ 는 다음과 같이 표현된다. $ y &= (-1)^s (a times 2^23 + b) $ = 3. Newton-Raphson Method 수치해석학을 수강한 학생이라면 들어 보았을 Newton-Raphson Method(이하 뉴턴법)는 주어진 방정식의 근사해를 찾는 수치해석적 방법이다. 미분 가능한 함수 $f$ 에 대해 방정식 $ f(x) = 0 $ 이 주어졌을 때, 뉴턴법은 다음과 같은 절차를 통해 방정식의 근사해 $x$ 를 찾는다. + 임의의 실수 $x_0$ 을 선택한다. + 다음 과정을 반복한다. + $x = x_i$ 에서 $f(x)$ 의 접선 $l$ 을 구한다. + $l$ 의 $x$ 절편을 $x_(i + 1)$ 로 놓는다. 그래프로 보면 다음과 같다. #figure( image("images/newtonraphson.png"), caption: [함수 $f(x)$ 의 $x = 1$ 에서의 접선 $l$ 의 $x$ 절편] ) 이러한 과정을 오차 $abs(f(x_i))$가 허용 오차 $epsilon$ 보다 작아질 때까지 반복하여 근사해를 구한다. = 4. 알고리즘 설명 이제 주어진 코드를 첫 줄부터 살펴보자. + ```C x2 = number * 0.5F;``` 입력 $"number"$ 을 실수 $0.5$ 로 나눈 값을 $x_2$ 에 저장한다. + ```C y = number``` 변수 $y$ 에 입력 $"number"$ 을 저장한다. + ```C i = * ( long * ) &y;``` 실수형 변수 $y$ 를 정수형으로 인식시킨 값을 변수 $i$ 에 저장한다. 우리가 구하고자 하는 것은 제곱근의 역수이므로 $0 < y$ 라고 가정하자. $y$ 를 이루는 비트들을 위와 같은 방법으로 $s, a, b$ 로 나눈다면 $i = a^(23) + b$ 임을 알 수 있다. + ```C i = 0x5f3759df - ( i >> 1 );``` ```C 0x5f3759df``` 는 $16$ 진수 $"5f3759df"$, 즉 $10$ 진수 $1 #h(1pt) 597 #h(1pt) 463 #h(1pt) 007$ 을 의미하며, ```C i >> 1``` 은 $i$ 를 이루는 모든 비트를 오른쪽으로 한 칸 이동한 것을 의미한다. 정수형 변수에서 ```C i >> n``` 은 $floor(i / 2^n)$ 과 같으므로, 이 줄은 변수 $i$ 에 $1597463007$ 에서 $i / 2$ 를 뺀 값을 다시 저장한다. 그러면 위의 계산에 따라 $ y &= [1 + b times 2^(-23)] times 2^(a - 127)\ log_2(y) &= log_2(1 + 2^(-23)b) + a - 127 $ 이다. 이 때 항상 $0 lt.eq 2^(-23)b < 1$ 이다. #figure( image("images/logapproxpro.png", width: 90%), caption: [$[0, 1]$ 범위에서 $log_2 (b + 1)$ 과 $b + 0.043$ 의 그래프] ) 위 그래프에서 보이듯, $b in [0, 1]$ 일 때 $log_2(b + 1)$ 은 $b + 0.043$ 와 매우 가까운 값을 가지므로 $b + 0.043$ 으로 근사할 수 있다. 따라서 $ log_2(y) &tilde.eq 2^(-23)b + a - 127 + 0.043\ &= 2^(-23)i - 127 + 0.043 $ 이다. 이제 $x = y^(- 1/2)$ 로 놓고, $x$ 를 이루는 비트들을 위와 같이 $s, c, d$ 로 나눈 뒤 $j$ 를 $x$ 를 정수로 인식시킨 값이라 하자. 그러면 $ log_2(x) &tilde.eq 2^(-23)j - 127 + 0.043\ &= - 1/2 [2^(-23) i - 127 + 0.043] $ 이므로 $ &&2^(-23)j - 127 + 0.043 &=& - 1/2 [2^(-23) i - 127 + 0.043]\ &arrow.r.double& 254 - 0.086 - 2^(-22)j &=& 2^(-23)i - 127 + 0.043\ &arrow.r.double& 381 - 0.129 - 2^(-23)i &=& 2^(-22)j\ &arrow.r.double& 381 times 2^(22) - 0.129 times 2^(22) - 1 / 2 i &=& j\ &arrow.r.double& 1 space 597 space 488 space 759 - 1 /2 i &tilde.eq& j $ 이다. 여기서 구해진 $1597488759$ 는 $1597463007$ 과 매우 가까운 값이며, $x + C$ 를 $log_2(b + 1)$ 에 근사시키기 위해 사용한 상수 $C$ 가 약간 달라 근소한 차이가 발생했을 것이라 예상할 수 있다. + ```C * ( float * ) &i;``` 변수 $y$ 에 정수형 변수 $i$ 를 실수로 인식시킨 값을 저장한다. + ```C y = y * (threehalfs - (x2 * y * y));``` ```C treehalfs``` 는 실수 상수 $1.5$ 이다. 이 줄은 변수 $y$ 에 $y (3 / 2 - (x_2 y^2) / 2)$ 를 저장한다. 주어진 $y$ 는 이제 $("number")^(- 1/2)$ 에 매우 가까운 값이지만, 여전히 오차가 존재한다. 이 줄에서는 오차를 최소화하기 위해 $y$ 에 뉴턴법을 $1$ 회 적용한다. 뉴턴법을 적용하기 위한 과정은 다음과 같다. 상수 $C$ 에 대해 $x = C^(- 1/2)$ 이면 방정식 $ 1 / x^2 - C = 0 $ 이 성립한다. 방정식의 좌변을 $f(x)$ 라 하면 $ f'( x ) = - 1 / ( 2 x^3 ) $ 이고, 따라서 $x = x_0$ 에서 $f(x)$ 의 접선의 방정식은 $ 0 &= - (2x) / x_0^3 + 2 / x_0^2 + (1 / x_0^2 - C)\ &= - (2x) / x_0^3 + 3 / x_0^2 - C\ &= ( 3x_0 - 2x ) / x_0^3 - C $ 이며, $x$ 절편은 $ x = x_0 ( 3 / 2 - x_0^2 C / 2 ) $ 이다. 첫 줄에서 $x_2 = "number" / 2$ 로 정의했으므로 $ ("number")^(- 1/2) tilde.eq y ( 3 / 2 - (x_2 y^2) / 2 ) $ 가 된다. 즉, 우리는 $("number")^(- 1/2)$ 의 근사값을 계산했다. + ```C return y;``` 마지막으로 $y$ 의 값을 반환한다. 우리는 위에서 $y tilde.eq ("number")^(- 1/2)$ 임을 보였다. = 5. 응용 고속 역제곱근 알고리즘이 가장 많이 응용되는 분야는 컴퓨터 그래픽이다. 예시로 어떤 벡터 $v = (v_1, v_2, v_3)$ 이 주어졌을 때 $v$ 와 방향이 같은 단위벡터 $u$ 를 찾으려 한다고 가정하자. 그러면 $ u = v / norm(v) $ 이며, 이 때 $ norm(v) = sqrt(v_1^2 + v_2^2 + v_3^2) $ 이므로, $"number" = v_1^2 + v_2^2 + v_3^2$ 로 놓고 $"number"$ 에 고속 역제곱근 알고리즘을 취한 값을 $y$ 라 하면 $u = y v$ 로 간단히 나타낼 수 있다. 단위 벡터를 구하는 것은 컴퓨터 그래픽에서 매우 중요하고 기본적이며 자주 쓰이는 연산으로 이 연산의 실행 속도를 개선함으로서 그래픽 성능을 크게 향상시킬 수 있다. 테일러 급수를 이용한 기존의 방법에 비해 고속 역제곱근 알고리즘은 매우 빠르게 계산되므로, 이 방법으로 컴퓨터 게임 업계는 본격적인 *3D 그래픽* 시대를 열 수 있었다. 현대의 CPU 에는 역제곱근을 계산하는 기능이 내장되어 있으므로 더이상 프로그래머가 그것을 직접 구현할 필요가 없어져 사용되지 않지만, 이 알고리즘은 역사적으로 매우 중요한 의미를 갖는다고 할 수 있다. = 부록 #figure( box( fill: luma(240), radius: 5%, outset: 5%, ```rust const mult32:f32 = 12102203.161561485; const adder32: f32 = 1064872507.1615615; fn fast_exp32(x: f32) -> f32 { union U { f: f32, i: i32, } unsafe { let mut u = U { f: x }; u.i = (u.f * mult32 + adder32) as i32; u.f } } ``` ) , caption: [\ 같은 방법으로 설계한, 지수함수를 빠르게 계산하는 알고리즘], supplement: none ) 위 코드에 대해 설명하면, $x, y$ 는 $e^x = y$ 를 만족하는 Float32 타입의 수, $i, j$ 는 각각 $x, y$ 의 각 비트를 보존한 채 Int32 로 인식시킨 수라고 하자. $b in [0, 1]$ 일 때 $log_2 (1 + b)$ 를 $b + 0.0573$ 으로 근사시킬 수 있으므로 $ x &= ln y\ &= (log_2 y) / (log_2 e)\ &tilde.eq 1 / (log_2 e) [2^(-23)j - 127 + 0.0573]\ $ 이다. 우변을 정리하여 $ 2^(23) (x log_2 e + 127 - 0.0573) = j $ 을 얻을 수 있다. 따라서, $ y tilde.eq "* ( Float32 * ) " (2^(23) (x log_2 e + 127 - 0.0573) "as Int32") $ 이 된다. 따라서 위와 같은 코드로 지수함수를 계산할 수 있다. 역제곱근과 마찬가지로 현대의 CPU 는 지수함수를 하나의 어셈블리 명령어로 계산하므로 의미 있는 알고리즘은 아니다. = 참고문헌 <NAME>. (2003). Fast inverse square root. Tech-315 nical Report, 32.\ <NAME>. (2011). Numerical analysis. Brooks/Cole Cengage Learning.
https://github.com/TGM-HIT/typst-diploma-thesis
https://raw.githubusercontent.com/TGM-HIT/typst-diploma-thesis/main/README.md
markdown
MIT License
# TGM HIT diploma thesis template This is a port of the [LaTeX diploma thesis template](https://github.com/TGM-HIT/diploma-thesis) available for students of the information technology department at the TGM technical secondary school in Vienna. ## Getting Started Using the Typst web app, you can create a project by e.g. using this link: https://typst.app/?template=tgm-hit-thesis&version=latest. To work locally, use the following command: ```bash typst init @preview/tgm-hit-thesis ``` ## Usage The template ([rendered PDF](example.pdf)) contains thesis writing advice (in German) as example content. If you are looking for the details of this template package's function, take a look at the [manual](docs/manual.pdf).
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/058%20-%20Duskmourn%3A%20House%20of%20Horror/005_Episode%203%3A%20Don't%20Look%20Back.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Episode 3: Don't Look Back", set_name: "Duskmourn: House of Horror", story_date: datetime(day: 22, month: 08, year: 2024), author: "<NAME>", doc ) Winter walked across the small parlor, moving with an almost rolling gait, like he was crossing the deck of a moving ship, not an unmoving house. Niko watched his feet, making note of the way the man's seemingly careless steps managed to avoid stepping on any of the moth motifs woven through the faded carpet. Looking up again, they studied their new acquaintance for a moment. Nothing about him was as casual as it seemed, from the way he walked to the strips of wallpaper worked into his clothing; if he held still in the right light, close enough to the right wall, he would all but disappear. #emph[If nothing about him was coincidental, had his presence in the freezer room been a coincidence? Or had he engineered it, the way he was engineering his walk across the floor, stepping with precision?] #emph[And did it matter one way or the other? ] Whether Winter had encountered them by chance or by design, he had saved them from the creature he called a razorkin. That bought him a little trust, at least until he showed himself to not deserve it. Decision made, Niko began to follow him. "Stop!" said Winter, twisting at the waist without moving his feet; they remained planted firmly where they were, in the blank spaces formed by the rug's design. "Don't step on any of the moths!" "The … moths?" asked the Wanderer politely. "In the carpet." Winter gestured to the room around them. The warmth, which had seemed so soothing when they first emerged into it, was quickly becoming sweltering; whoever last fed the fire had stoked it a bit too enthusiastically, and as the chill seeped out of their bones, it was being replaced by an uncomfortable heat. Niko followed the sweep of Winter's hand, frowning as they noticed that the moth motifs in the carpet continued up into the wallpaper. Some of the framed pictures on the walls were entomological diagrams of moths they almost recognized, species they'd seen flitting around the temple braziers on Theros. The rest were unfamiliar, united by their oddly shaped wings marked with rough-sketched, watching eyes. The whole room felt like it was watching them, through the moths. There were no windows. The Wanderer continued to watch Niko, an almost perplexed expression on her face. "Are you going to explain #emph[why] we shouldn't step on the nicely woven moths?" Winter exhaled, the ghost of a laugh clinging to the sound. "I knew you were new, but I didn't think you were #emph[that] new," he said. "How did you survive long enough to reach the Floodpits? Duskmourn should have had you long before you could get that far. Unless the House isn't hungry, but if the House weren't hungry, it wouldn't be setting lures." "What are you talking about?" asked Niko, a cold pit opening in the bottom of their stomach. Every plane had its ambush hunters, the great anglers who dangled a lure that looked like a worm or a spider or an entire human body, using it to coax prey close enough to catch. "You came here through a door, didn't you?" asked Winter. "A door you'd never seen before, that didn't belong wherever it was you found it? And it wasn't locked, and it opened easily when you tried it, and the House was on the other side, like an invitation to adventure. Like it wanted you to come in and look around. But when you tried to turn around and go, the door wasn't there anymore. You belong to Duskmourn now." "You said that before." "I'll say it a hundred times if that's what it takes for you to understand." "Duskmourn is the House?" Winter nodded fiercely. "Yes." "And the House is … aware? Intelligent? It hunts?" "The House is aware; whether it's intelligent or not has never mattered enough to care about. You don't ask the thing that's trying to swallow you whole whether it understands what it's doing—if it understood enough to care, it would have listened to you screaming for it to stop." Niko looked around the room again. It felt more ominous by the second, the heat less like a roaring fire and more like the sickly warmth that radiated off a fresh dragon carcass, something living and looming. The eyes of the moths in the walls were a weight against their skin, making it clear that they couldn't escape notice even if they tried. Instinctively, they reached for the warmth of their spark—not to flee, not to leave their allies behind, but to cup it in the hollow of their will, to feel its reassurance and know that their fate was not yet sealed. And, as had always been the case since the invasion, they found nothing where that tiny flicker of the Blind Eternities should have been, only void, a vessel too broken to contain anything but dust. They recoiled from the sensation—not an easy thing when the feeling was anchored to their soul—and returned their attention to Winter, who was still watching the Wanderer from his place by the fire. How could he stand so close without overheating? "We didn't come through the door because we were lured," said the Wanderer. "We came seeking a child who has been lost, although he wouldn't thank me for referring to him as such. His mother was—she was also lost, in a different way. I have a responsibility to him, and when I discovered that he had entered your 'Duskmourn,' I had no choice but to follow. My friend here agreed to come with me." "Just the two of you, hunting this cursed place for a single kid?" Winter scoffed. "You know, there are easier ways to die." "Stop that talk," said Niko. "Our fates are not sealed. We have allies in the House, and as soon as we find them again, we'll be able to get out of here." Kaito was still a Planeswalker, his vessel unbroken, and even if he hadn't been, the square box Niko had been given by Niv-Mizzet was still hanging over their shoulder, humming contentedly to itself. Small lights blinked at one corner. It was transmitting information back to Ravnica. Help was coming. Help was coming, and they were far from helpless, even in this strange place, with its unfamiliar rules. Winter was looking at them like they had made the biggest mistake the world had ever known by coming here, but they hadn't arrived by mistake: they'd been looking for Nashi. An innocent, who needed their help. Niko had no more been able to refuse than they were able to cross the Blind Eternities under their own power. Winter scoffed again, only to freeze as the Wanderer was suddenly in front of him, having crossed the floor with quick, graceful steps that evaded the moths woven into the rug seemingly without effort. Her sword, which had been belted at her hip, was suddenly in her hands, the blade only inches from Winter's face. "It would not be wise to threaten a new ally," said the Wanderer. "So this is not a threat. Only a promise. Don't taunt us over things we have no way to know. Do we understand one another?" Winter nodded slowly, eyes fixed on the gleaming blade of the Wanderer's sword. He didn't begin to relax until she lowered her weapon and returned it to its sheath. "The House is a hunter, you say, but this time, it may have bitten off more than it can chew," she said. "You won't be the first one to think that," said Winter, still looking uneasy, but less so with every passing second. "Duskmourn has swallowed heroes and villains without a hint of hesitation. You think you know how to survive here, because you survived wherever it was you came from. Well, you're not seasoned heroes here. You're seasoned meat. You say you have allies in the House? Were you separated, one by one, by impossible things?" The Wanderer grimaced. "The floor opened wide and swallowed our companion," she said. "That was after we heard someone screaming for help in the distance, and two of our companions went running after it," said Niko. "They went through a door into a hallway, and when we tried to follow them, there was a wall there. We didn't see it appear, but it can't have been there when they left." "That's Duskmourn, splitting you from your friends," said Winter. "It's one of the House's favorite tricks. It wants you isolated and afraid. The more frightened you are, the more the House desires you. You must have reached the threshold of fear it needed to start sending razorkin after you, back in the freezer. It knows you're here now, if it didn't before." "What #emph[was] that thing?" asked Niko. Winter shrugged. "A survivor once, most likely. Duskmourn repairs and rebuilds the people it takes, the same way an upholsterer might re-cover a couch. It beguiles the ones who manage to survive in razorkin territory until they lose themselves and slide into a slaughterhouse skin. If you're lucky, when they catch you, they kill you. If you're not lucky, you get to join them. I don't know how much they understand of what they are, but they can be clever, and they're relentless once they have your scent. That miss back there was narrower than you think it was." "And they're how this house hunts?" "Not just the razorkin," said Winter. "The House has many hands, and it won't stop grabbing for you until it has you." "Or we escape," said the Wanderer. Winter looked at her like she had no idea what she was saying. "Sure," he said, voice dry. "Escape." "I thought we were being polite now," said Niko. "Yeah, sorry, sorry," said Winter. "Look, you're basically beacons for every hungry thing in this house while you're so hopeful and sure of yourselves. Stick with me if you want to stay alive, and maybe we'll be lucky enough to find your friends." "But you don't think we will," said Niko. "I've seen this play out too many times to think you're getting a happy ending," admitted Winter. "Still. Stay together; don't trust anything you see to stay the way you think it is; don't touch the moths, even when they're just chalk drawings or someone fingerpainting with someone else's blood." "I wouldn't touch that even if you hadn't said something," said Niko. Winter cracked a smile at that. "Move fast and try not to linger in open areas," he said. "Assume everything is hostile and has the potential to do you harm. Everything but those." He stabbed his finger into the air, indicating a spot next to the Wanderer. She blinked, then turned. There, floating several feet above the parlor floor, hovered a golden dragon etched entirely of light, moving in a sinuous curve as it hung in place. The Wanderer gasped. "Kyodai?" she asked, then corrected herself: "No. I wouldn't wish her here. This spirit is too small to be my dear one. What is this?" "Your glimmer," said Winter. "Everyone in Duskmourn has one. It's your hopes and dreams—or whatever's left of them, anyway. I think the House makes them. No one really knows." "Where's yours?" asked Niko. "Where's #emph[mine] ?" Winter only shrugged. "My Kamigawa," breathed the Wanderer. Niko said nothing. "We shouldn't stay here any longer," said Winter. "The only reprieves Duskmourn offers are brief ones. But if we follow her glimmer, it should lead us along a relatively safe path." "Can it take us to Nashi?" asked the Wanderer. "Only one way to find out," said Winter. The Wanderer leaned in toward the floating spirit. "Please," she said, and the glimmer began to swim through the air to a doorway on the far wall. The others followed. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Kaito fell without a sound, pulling on every ounce of his training to remain as calm as possible while he was dropping through the dark. Himoto's claws dug into his shoulder as she anchored herself, refusing to be separated from him, and the fall was long enough to allow a flicker of amusement: He might be the only one who'd fallen, but he still wasn't alone in the House. Himoto was with him, as she always was, as she always would be. Just as it seemed he must be destined to fall forever, his descent ended with in a hard impact with what felt like a forest floor. Rocks and roots dug into his hip and side, and the smell of wet loam filled his nostrils, thick and earthy. He blinked, then sat up, rubbing his eyes as he assessed himself for injuries. Given how far he'd fallen, he should have broken several bones, or at the very least knocked himself unconscious. Instead, he ached like he'd just done a long training session against a superior opponent without any protective gear. It was jarring. Not that he #emph[wanted] to be in pain, but the implications were unnerving. #emph[How much control did the House have over what happened inside it? ] He stood carefully, still surrounded by total darkness, and began to breathe deeply, in and out, trying to use his remaining senses to orient himself. The smell of loam dominated everything, a thick layer across the smell of a decaying pine forest, its trees broken and dying in the absence of the sun. There was a cool dampness to the air, and a sharp scent of petrichor mingling with the trees; fog, then, the kind of thick fog that blanketed an entire forest floor and turned it treacherous even under the best of circumstances. As he breathed the forest in, the darkness began to lift. It wasn't an improvement. Revealed, the forest was just as unpleasant as Kaito had assumed; the nearest trees were rotted and leaning against each other, giving the impression that they were just waiting for an excuse to fall. The trees that weren't on the verge of coming down looked sick and listless, if listlessness could be attributed to a tree; their branches drooped, and patches of lichen dotted their bark, gray and scabrous. Kaito shuddered and looked around, Himoto shifting on his shoulder to direct her eyes along with his and provide a little extra light. "How does a house have a forest #emph[under] its ballroom?" asked Kaito. Himoto chittered. Before Kaito could decide which of the many unpromising directions looked the least unpleasant, a shadow passed over him, and he tensed, crouching and looking up at the same time. Whatever it was, it was too high to see in the dark—while the forest was no longer draped in absolute blackness, it was still about as bright as a moonless night, without even stars for the shadow's source to block. The shadow swooped by again, this time accompanied by a brilliant burst of flame that illuminated the entire beast that had been circling overhead. The fire chewed at the rotting trees, turning them to ash, as the dragon flapped its wings and circled for another pass. Kaito looked frantically around, the way now lit by the fire devouring the trees. There was nowhere to go. He could go deeper into the trees, but the trees were burning. It was better than standing still waiting to be baked alive. He began to walk as quickly as he dared across the root-twisted ground, feet hidden by the fog. He hadn't made it very far before the dragon swept by again, this time directing its fire at the motion on the forest floor. Kaito had barely a moment to realize the depth of his mistake, and then the dragon's fire was sweeping over him, blisteringly, blazingly hot, turning the world white and gold with flame— And then it was over, and he was standing in the middle of a smoking, ash-strewn plain, surrounded by the remains of the burned-out forest. Something about the moment felt wrong, the way it did when Teferi used his time magic, and close on the feeling of relief came the feeling that all this had happened a very long time ago, if it had happened at all; it was a performance being put on for Kaito's benefit—or for the House's. The fire had burned the fog away. Dragons wheeled through the sky overhead, dozens of them, their attention fixed on a burning city. Occasionally, one or more would dart toward the inferno, adding another stream of fire to the damage already done. Not that there was much left to burn. Nothing moved apart from the dragons, and flames. If the city had been occupied, its occupants were gone now. The sky was still dark, ripe with heavy gray clouds that crackled with lightning, filling the air with the smell of ozone. Himoto chittered. Kaito put a hand on her back, lending them both comfort, and waited for the dragons to return. There was a sound like someone slicing through shoji with an improperly cleaned sword, rough and ragged and grating, and the landscape began to flicker and fade, moving in and out of visibility as if transforming all around him. The sound of ripping paper grew louder, then stopped as abruptly as it had begun. The forest was gone. #figure(image("005_Episode 3: Don't Look Back/01.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) Instead, he appeared to be standing in an underground room with rough stone walls and a staircase in one corner, leading upward to an unseen destination. Piles of furniture and boxed-up belongings lined one wall, and the only light came from a flickering girandole hanging from the center of the ceiling. Its candles were almost burned out; soon enough, the room would return to darkness. And he wasn't alone. Zimone's dissertation on the movement of air wasn't wrong; his training #emph[had] involved learning how to know when someone was nearby just from the changes in the atmosphere around him. He tensed, more worried now than he had been by a mystery forest filled with phantom dragons. This was something physical, something that could potentially do him harm. Something that was moving closer, trying to be quiet, but still approaching. Kaito tensed further, controlling his breath to keep it light and easy, and when the feeling of presence drew too close, he whirled, driving his right fist square into the face of the slender, dark-haired man who'd been walking up behind him. Jace made an undignified squawking sound and stumbled backward, clapping one hand over his nose, which was already gushing blood. "Hello to you, too!" he said, voice muffled by his hand and injury. Kaito blinked and straightened, not lowering his fists just yet. "Jace?" "You were expecting someone else?" "I wasn't expecting—what are you #emph[doing] here?" "You're not happy to see an old friend?" Kaito stared at him. "An #emph[old friend] ?" he asked. "Last time I saw you, we were trying to kill each other on New Phyrexia!" "Where you prevented me from stopping the Phyrexian invasion before it could begin. I'd call us roughly equal." "I did it to save Kamigawa from the sylex #emph[you] were trying to activate." Jace shrugged, the gesture so thoughtlessly dismissive that Kaito's fists tightened. "It would have worked if we'd been faster, or if we hadn't been separated." "You're the reason we lost Nahiri!" "I lost #emph[myself ] at the same time, in case you've forgotten." Kaito narrowed his eyes. "I haven't forgotten anything," he said. "Where have you been?" "Does it matter? I'm here now." "Yes, I'm going to say it matters. It matters very much." Jace sighed, removing his hand from his nose and wiping the blood on his cloak. "I don't think it's broken, if #emph[that ] matters to you." "Want me to try again?" Himoto chittered, almost like she was encouraging Kaito to take another swing. Before he could, a groaning sound rang through the basement, seeming to pour out of the very walls. Jace and Kaito both stiffened, instinctively falling into position back to back as they braced against the coming danger. "Fight later?" asked Jace. "Fight later," Kaito agreed. "But we #emph[are] going to fight." "I look forward to it." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The library had remained a library, to Zimone's delight and Tyvar's disappointment. He hadn't tried the stairs again, preferring to stay where he could watch over Zimone. The academic seemed to have forgotten that they were in possibly mortal peril; she was happily wandering from shelf to shelf, pulling out an endless succession of books and handing them off to Tyvar to carry to the large study table she had claimed for her research. Really, it was like seeing her in her natural environment—an environment which he presumed had very few predators, as she was completely at ease now that she had accepted her surroundings. He sat sprawled in the chair next to hers, elbow propped on the table and cheek resting on his knuckles. He would have been happy to explore, if it hadn't meant letting her out of his sight. In this place, he didn't trust she'd be there when he came back—whether due to perfidy from the House or because she'd just wandered off into the deeper stacks, he couldn't have said. <NAME> was not a man well-suited to an academic setting. Every inch of him screamed that they were in the middle of a grand, terrible adventure, filled with danger and the chance for glory. But "what is this place" and "how is this happening" weren't enemies he could punch. All he could do was make sure Zimone was safe, or as close to it as any of them could be in this terrible house. Zimone frowned at something in the book she was reading, then shoved it away and pulled another toward her, eyes darting across the text with remarkable quickness. "This #emph[is] a house," she finally announced. Tyvar frowned at her. "I thought that had been established." "It was, but that didn't mean it was going to stay established. Sometimes when you test a thing, you find out it isn't what you thought in the beginning. It's called camouflage." "I am aware," said Tyvar. "We have such concepts on Kaldheim." Zimone's cheeks flushed red. "I didn't mean—I'm just excited, that's all. This is a house, it was built, the original architect lived here with her family, a long, long time ago, at least if I'm reading this correctly. It looks like the place has had at least a dozen owners. I had to find one of the early ones to confirm the architect." "That's a bit of a relief," said Tyvar. "Things made by hand are often easier to overcome than those made by nature." "I don't know if you've noticed, but this library is pretty focused. There's some local history—none of the names are familiar, even from the Biblioplex; I don't think this is a place any of us have ever been before—but mostly it's occultism and the kind of magic that makes Professor Vess recommend you rethink your academic goals." "Bad magic?" "Magic isn't inherently good or bad any more than a mathematical equation is, but some of it is so based on entropy and weaponized obligation that bad magic is probably the best way to describe it." Zimone looked back at her book, shaking her head. "I don't know why anyone would want to study this stuff, but look, someone studied it pretty hard." Tyvar looked, obligingly. The book she was looking at now had extensive notes in the margins, written in dark ink with a strangely effervescent hand, as if the one who made them had treated this as a marvelous game. "Do you think this … academically unpleasant magic is the reason the House is behaving in its current manner?" "I'd be shocked if they weren't related," said Zimone. "Some of these spells are the sort of thing that could distort space and time if you cast them in the right order, and I'm not really sure how some of these rituals would even #emph[work] ." The monitoring device she had been given by Niv-Mizzet beeped, the sound bright and out of place in the library. Zimone patted the box with one hand and kept reading. A fleshy ripping sound, moist and visceral, echoed from the nearest corridor of bookshelves, not seeming to grow any quieter as it moved away from its source. Tyvar straightened, attention snapping toward the sound. "Zimone?" "I think if you drained an entire person's lifeforce, you might be able to—" "#emph[Zimone] !" She lifted her head. "Hmm?" "Your college education is #emph[not] preparing you properly for survival," said Tyvar, knocking his chair over as he stood and faced the sound. The bookshelves were beginning to … twist, almost, warping into strange, asymmetrical shapes. The books were warping with them, becoming something entirely new. It hurt his eyes to watch, and so he didn't allow himself to look away. Something that distorted the world as it approached was something that #emph[wanted] you to look away. He wasn't going to make them easier targets. Zimone squeaked and scrambled to her feet, moving partially behind Tyvar as he stepped forward, toward the distorting patch of space. "Stay back!" "I approach no closer than needed," he assured her, even as something terrible ripped itself out of the twisting hole and launched for his chest. It was technically bipedal, with skin the color of old, dried clay that had been exposed to the elements for too many years. It had no hair and wore no clothing, but it had six eyes, clustered on its face like the eyes of a spider, and a mouth that opened too wide to be functional, bristling with teeth like shards of broken glass. Its limbs bent in too many places, and it moved with a horrific, spidery grace. It slammed into Tyvar's chest, claws digging deep into bare shoulders as it twisted to rip his throat out. He twisted at the same time, using the creature's own momentum against it as he flung it over his shoulder, opening deep gashes in his own skin in the process, but leaving his throat unripped. "Tyvar!" shouted Zimone. "Stay where you are," he yelled back, and threw himself after the creature. It roared and squared up to meet him, oddly jointed limbs moving easily to find purchase in the surrounding shelves. The distortion it had emerged from was almost faded now, the bookshelves slowly easing back to normal, but the shelves it had anchored itself against were starting to warp. The twisting was a function of the creature, then, and something to watch for. Zimone grabbed her monitor from the table, hugging it to her chest. The creature's head snapped around, attention caught by the motion, and its eyes fixed on her. Smoothly, it began to turn in her direction. Marble busts of humans and elves had been shoved into some of the gaps on the shelves, serving as bookends and adding a haunted quality to the library that Tyvar could easily have done without. He grabbed the closest of them, feeling the structure of the stone bleeding into his skin, and flung the bust as hard as he could at the creature's head. This wasn't a friendly throw, or even the sort of throw he would have aimed at a wolf that wandered too close to the village flock: this was a throw designed to do as much damage as possible. The bust burst against the beast's skull, and it lost interest in Zimone immediately, whipping around to resume snarling at Tyvar. He clapped his hands together, stone still spreading up his arms, until it had encased the wounds in his shoulders and stopped the bleeding. "A Planeswalker spark is too much for one heart to hold; it makes you complacent," he snapped. "I've been working on my legend since mine blew out." The creature snarled again and leapt for him. This time, he was braced. He grabbed it by the wrists and swung it around, slamming it into the floor before kicking it in the side of the head. It hissed and snarled. He planted a foot at the center of its chest, keeping it where it was. "She's not for you to harm," he spat. The creature snarled again. The sound was somehow hollow. Tyvar raised his foot, stone spreading down his body, and when he felt it close over his ankle, he stomped down as hard as he could, driving his foot through the creature's sternum. It splinted and broke like a rotting plank, and the beast went limp. Tyvar sneered, releasing its wrists, and turned to walk back over to Zimone, the stone fading from his skin. "That … how …?" "The natural world answers to my call," he said. "I used to need a fragment of the material close to hand to shift my skin, but now I can carry the memory with equal closeness." "Well, that's great, but look." Zimone pointed behind him, hand trembling. Tyvar turned. The creature was pulling itself back together, chest expanding, blood beading up and rolling back to the body, where it poured back into the creature's rapidly sealing wounds. With a whining grumble, it got back to its feet and snarled at them. Tyvar paled. Zimone grabbed his arm, tugging. "Maybe we should run," she said. "Brave deeds only carry honor when recounted," said Tyvar, and together they turned and fled deeper into the library, away from the snarling creature, into the shadows of the shelves.
https://github.com/Fabioni/Typst-TUM-Thesis-Template
https://raw.githubusercontent.com/Fabioni/Typst-TUM-Thesis-Template/main/abstract.typ
typst
MIT No Attribution
#let abstract(body, lang: "en") = { let überschriften = (en: "Abstract", de: "Zusammenfassung") set text( size: 12pt, lang: lang ) set par(leading: 1em) v(1fr) align(center, text(1.2em, weight: 600, überschriften.at(lang))) align( center, text[ #body ] ) v(1fr) pagebreak() }
https://github.com/typst-community/glossarium
https://raw.githubusercontent.com/typst-community/glossarium/master/tests/debug/debug.typ
typst
MIT License
#import "../../themes/default.typ": * #show: make-glossary #show link: set text(fill: red) #let entry-list-0 = ( ( key: "potato", short: "potato", long: "long potato", plural: "potatoes", longplural: "long potatoes", description: [#lorem(5)], ), ) #let entry-list-1 = ( ( key: "potato A", short: "potato@A", plural: "potatoes@A", description: [#lorem(5)], group: "A", ), ( key: "potato B", short: "potato@B", long: "long potato@B", plural: "potatoes@B", longplural: "long potatoes@B", description: [#lorem(5)], group: "B", ), ( key: "hidden potato", short: "hiddenpotato", group: "show-all test", description: [This potato does not appear, unless `print-glossary` is called with `show-all: true`], ), ) #let entry-list-2 = ( ( key: "potato C", short: "potato@C", long: "long potato@C", plural: "potatoes@C", longplural: "long potatoes@C", description: [#lorem(5)], group: "C", ), ( key: "potato D", short: "potato@D", long: "long potato@D", plural: "potatoes@D", description: [#lorem(5)], group: "D", ), ( key: "potato E", short: "potato@E", long: "long potato@E", longplural: "long potatoes@E", description: [#lorem(5)], group: "E", ), ( key: "potato F", short: "potato@F", long: "long potato@F", longplural: "long potatoes@F", description: [This potato should not appear in the document.], group: "F", ), ) #let entry-list-3 = ( ( key: "potato G", short: "potato@G", long: "long potato@G", longplural: "long potatoes@G", description: [This potato should appear in the document.], group: "G", ), ) #let entry-list-4 = ( ( key: "potato H", short: "potato@H", description: [This potato only has a short key.], ), ( key: "potato I", long: "long potato@I", description: [This potato only has a long key.], ), ) #let entry-list-5 = ( ( key: "potato J", description: [This potato has neither a short nor a long key.], ), ) #for entries in ( entry-list-0, entry-list-1, entry-list-2, entry-list-3, entry-list-4, ) { register-glossary(entries) } = Typst Compiler Version: #sys.version, #type(sys.version) = Normalization #set text(size: 8pt) #columns(2)[ == entry-list-0 #entry-list-0 == entry-list-1 #entry-list-1 == entry-list-2 #entry-list-2 #colbreak() == #repr(__normalize_entry_list) n°0 #__normalize_entry_list(entry-list-0) == #repr(__normalize_entry_list) n°1 #__normalize_entry_list(entry-list-1) == #repr(__normalize_entry_list) n°2 #__normalize_entry_list(entry-list-2) ] #pagebreak() = User API == ref `@potato`: @potato `@potato:pl`: @potato:pl == #gls First: #gls("potato") Display: #gls("potato", display: "potato text") Force long: #gls("potato", long: true) 1st ref. when long is empty defaults to short: #gls("potato A") Force long when empty defaults to short: #gls("potato A", long: true) 2nd ref.: #gls("potato A") 1st ref.: #gls("potato B") == #glspl First: #glspl("potato C") Force long: #glspl("potato", long: true) Force long when empty defaults to plural: #glspl("potato A", long: true) 2nd ref.: #glspl("potato A") 1st ref. when long is empty defaults to plural: #glspl("potato B") 1st ref. when longplural is empty: #glspl("potato D") 2nd ref. when longplural is empty: #glspl("potato D") 1st ref. when plural is empty: #glspl("potato E") == #gls-description #gls-description("potato B") == #gls-key #gls-key("potato C") == #gls-short #gls-short("potato D") == #gls-plural #gls-plural("potato A") == #gls-longplural #gls-longplural("potato B") == `gls-longplural.with(link: true)` #gls-longplural.with(link: true)("potato B") == #gls-description #gls-description("potato C") == #gls-group #gls-group("potato D") == test `__attribute_is_empty` error // #gls-long("potato A") == test `__key_not_found` error // #gls("potato Z") #pagebreak() #columns(2)[ == `#print-glossary.with(show-all: true, disable-back-references: true)` #print-glossary( entry-list-0, show-all: true, disable-back-references: true, ) #print-glossary( entry-list-1, show-all: true, disable-back-references: true, ) #colbreak() == #repr(print-glossary) (show-all: false) #print-glossary( entry-list-2, show-all: false, disable-back-references: false, ) #print-glossary( entry-list-3, show-all: true, disable-back-references: false, user-group-break: colbreak, ) == Test `#print-glossary(none)` error // #print-glossary(none) == Test only short/long #print-glossary( entry-list-4, show-all: true, disable-back-references: true, ) #gls("potato I") #glspl("potato I") #agls("potato I") #gls("potato H") #agls("potato H") #glspl("potato H") == Test neither short nor long error // #register-glossary(entry-list-5) == `#default-print-reference.with(show-all: true)` Forcibly print nonreference entry. #default-print-reference.with(show-all: true)(entry-list-2.last()) ]
https://github.com/goshakowska/Typstdiff
https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_working_types/super_script/super_script_deleted.typ
typst
First Normal text Second#super[super text]
https://github.com/Student-Smart-Printing-Service-HCMUT/ssps-docs
https://raw.githubusercontent.com/Student-Smart-Printing-Service-HCMUT/ssps-docs/main/contents/categories/task4/4.3.typ
typst
Apache License 2.0
== Kiểm tra khả năng sử dụng (Usability testing) === Kế hoạc khảo sát Nhóm 3 lớp L02 với tư cách là người điều phối khảo sát tiến hành kiểm tra khả năng sử dụng của hệ thống hỗ trợ dịch vụ in ấn thông minh (SSPS) trong module quan trọng đầu tiên: upload tài liệu -> xác nhận -> thanh toán vào ngày 18/11/2003 #block(inset:(left:1cm))[ - Đánh giá trải nghiệm người dùng với chức năng đặt in, chỉnh sửa cấu hình tài liệu và thanh toán đơn đặt hàng in. - Khảo sát nhằm phát hiện vấn đề với phiên bản hiện tại, cơ hội để cải thiện về thiết kế/quy trình và hiểu biết về hành vi và sở thích. ] Các khía cạnh cần khai thác sau khi thực hiện Usability testing #block(inset:(left:1cm))[ - Thời gian trung bình người dùng cần bỏ ra để đặt một đơn hàng in ấn trong lần đầu sử dụng. - Các bước/thành phần khiến người dùng bối rối, hiểu sai về mục đích sử dụng được đặt ra ban đầu, thao tác sai. - Các bước/thành phần người dùng thao tác đúng và nắm rõ quy trình. - Ứng dụng, mục đích và trường hợp của những thành phần/phần tử thương được tương tác bởi người dùng. - Đề xuất, kỳ vọng của người dùng so với quy trình hiện tại của hệ thống. ] Các chỉ số đánh giá đạt được trong quá trình khảo sát: #block(inset:(left:1cm))[ - *Tỷ lệ thành công*: Số lượng nhiệm vụ được người dùng hoàn thành trên tổng số nhiệm vụ được đề ra. - *Thời gian thực hiện*: Thời lượng trung bình mà người dùng cần hoàn thành một nhiệm vụ trên tổng thời gian thực hiện tất cả nhiệm vụ. - *Tỷ lệ phát sinh lỗi*: Tổng số lượng lỗi xuất hiện khi người dùng thao tác với hệ thống trên tổng số cơ hội phát sinh lỗi của người dùng. - *Tỷ lệ chuyển đổi*: Số lượng người dùng cân nhắc sử dụng dịch vụ in ấn thông minh so với số lượng sử dụng phương pháp truyền thống trên tổng số người dùng tham gia trải nghiệm. - *Tỷ lệ hài lồng*: Đánh giá mức độ hài lòng của khách hàng thông qua 5 mức độ. ] Phương thức khảo sát nhóm đã sử dụng: #block(inset:(left:1cm))[ - *Thu thập dữ liệu*: Sử dụng bản prototype đơn giản để người dùng trải nghiệm sản phẩm ở giai đoạn đang phát triển hệ thống, thu thập dữ liệu theo 2 hướng: _định tính_ và _định lượng_. Phương pháp trong đợt Usability testing lần này được _thực hiện trực tiếp (in-person)_ (sẽ có minh chứng cụ thể trong mục người tham gia), người dùng thao tác trên desktop và mobile trải nghiệm sản phẩm, ghi lại kết quả, phản ứng, suy nghĩ của người dùng và nhóm sử dụng kết hợp heatmap - ứng dụng thu thập hành vi thao tác người dùng. - *Phân tích dữ liệu*: Phân tích dữ liệu thu thập được để tìm hiểu xu hướng, dấu hiệu và đánh giá trải nghiệm. Dữ liệu được tích hợp thành các insight sau khi được phân tích để cải thiện ứng dụng về thiết kế, cải tiến quy trình. ] === Đối tượng tham gia Như đã đề cập, nhóm sẽ sử dụng 3 người khác nhau để thực hiện khảo sát trực tiếp (in-person) để đánh giá kết quả, phản ứng, suy nghĩ của người dùng khi sử dụng dịch vụ của hệ thống. Các loại người dùng thực hiện khảo sát #block(inset:(left:1cm))[ - *Đối tượng chính*: 2 sinh viên đã từng, thường xuyên trải nghiệm dịch vụ in ấn tại tiệm của trường và các tiệm in khác bên ngoài khuôn viên trường. - *Đối tượng phụ*: 1 sinh viên sử dụng dịch vụ in khác bên ngoài trường. ] Người dùng khi tham gia khảo sát của nhóm sẽ được tặng bộ tài liệu hướng dẫn viết CV và Cover letter của Havard: #link("https://drive.google.com/drive/u/0/folders/1v5zA9agdMYDpGhbLd779cvVlbeuwS8zJ") Minh chứng về việc thực hiện khảo sát của người dùng nêu trên #figure( grid( columns: 3, gutter: 3mm, image("../../images/tester-1.jpg"), image("../../images/tester-2.jpg"), image("../../images/tester-3.jpg") ), caption: "3 tester tham giao vào quá trình trải nghiệm hệ thống" ) === Nhiệm vụ Khảo sát được thực hiện trên module quan trọng là _tải tài liệu (upload) -> xác nhận (confirm) -> thanh toán (payment)_ sẽ bao gồm các nhiệm vụ chính như sau: #block()[ - *Nhiệm vụ 1*: Bạn hãy thử tìm cách để có thể đặt in được một tài liệu học tập hoặc giấy tờ thông thường. #block(inset:(left:1cm))[ \u{2218} *_Follow up 1_*: Giả sử bạn vừa tải và cấu hình sai tài liệu, bạn sẽ làm như thế nào? #linebreak() \u{2218} *_Follow up 2_*: Bạn thường để ý đến giá tiền của đơn đặt hàng vào những thời điểm nào lúc đặt in tài liệu? ] - *Nhiệm vụ 2*: Theo dõi trạng thái về tài liệu đã đặt #block(inset:(left:1cm))[ \u{2218} *_Follow up_*: Bạn hiểu như thế nào về các trạng thái của đơn hàng này, tại sao bạn lại hiểu như vậy? ] - *Nhiệm vụ 3*: Giả sử bạn đã đến tiệm in, bạn làm sao để biết thông tin tài liệu đã đặt để nhận. #block(inset:(left:1cm))[ \u{2218} *_Follow up 1_*: Bạn nghĩ mình sẽ cần thông tin gì để nhận tài liệu? #linebreak() \u{2218} *_Follow up 2_*: Sau khi nhận tài liệu, bạn nghĩ mình cần thao tác gì trên ứng dụng nữa không? Bạn kỳ vọng đơn hàng đã nhận sẽ hiển thị như thế nào? ] ] === Thực hiện khảo sát ==== Danh sách chuẩn bị #block()[ - *Trang thiết bị khảo sát*: #block(inset:(left:1cm))[ \u{2218} Laptop và chuột, Điện thoại di động chế độ screen mirroring cho người dùng thao tác. #linebreak() \u{2218} Laptop chế độ screen mirroring để người điều phối theo dõi thao tác. ] - *Chuẩn bị tài liệu giấy*: Danh sách nhiệm vụ, giấy điều khoản khảo sát, giấy hướng dẫn người dùng thực hiện khảo sát. - *Chuẩn bị tài liệu điện tử*: Phiếu khảo sát lọc tìm đối tượng tham gia, phiếu khảo sát đánh giá trải nghiệm sản phẩm, Bản kế hoạch/hướng dẫn khảo sát cho điều phối viên và Bản ghi chú để nhân sự hỗ trợ ghi nhận lại hành vi, biểu cảm, cảm nhận, đánh giá của người dùng trong lúc trải nghiệm. - *Kịch bản khảo sát*: đã được chuẩn bị mô tả chi tiết ở mục *_4.3.3_* ] ==== Lưu ý cho người điều phối #block()[ - *Thành phần tham gia*: 1 người điều phối để tương tác trực tiếp với người tham gia, 1 người theo dõi và ghi chú lại hành vi và feedback của người tham gia. - *Trước buổi trải nghiệm*: #block(inset:(left:1cm))[ \u{2218} Kiểm tra danh sách, chuẩn bị các tài liệu và trang thiết bị cần thiết. #linebreak() \u{2218} Khi giới thiệu, đảm bảo: lời cảm ơn, giúp người tham gia thoải mái chia sẻ (gợi nhớ đây là buổi chia sẻ chứ không phải phỏng vấn, cho người tham gia đọc to các quy tắc về buổi phỏng vấn để warm-up), xác nhận các điều khoản sử dụng dữ liệu. ] - *Nguyên tắc điều phối*: Cách trao đổi trong buổi trải nghiệm #block(inset:(left:1cm))[ \u{2218} *_Echo_*: Khi người tham gia đặt câu hỏi/đánh giá, người điều phối có thể nói vọng lại lời người tham gia hoặc hỏi theo cách mở rộng, làm rõ thêm về câu hỏi của người dùng. Ví dụ: #block(inset:(left:1.1cm))[ \u{25AA} “Bước này lạ quá” → “Bạn thấy lạ như thế nào?” ] \u{2218} *_Boomerang_*: Khi người tham gia đặt thắc mắc, người điều phối có thể đặt ngược lại câu hỏi/gợi ý để người dùng có thể tự ra quyết định. Ví dụ: #block(inset:(left:1.1cm))[ \u{25AA} “Nút này bấm sẽ nhảy đi đâu vậy?” → “Bạn dự đoán ứng dụng sẽ dẫn bạn đi đâu?” #linebreak() \u{25AA} “Nếu qua bước này thì dữ liệu có mất không nhỉ?” → “Bạn giả sử mình đang phải thực hiện bước này một mình để ra quyết định thử xem.” ] \u{2218} *_Columbo_*: Không tỏ ra bí hiểm, thông minh hơn người dùng vì đã biết trước về đặc điểm ứng dụng. Người điều phối có thể dùng phương pháp “ngập ngừng” để người tham gia lặp lại câu hỏi/ý tưởng theo hướng khác. Ví dụ: #block(inset:(left:1.1cm))[ \u{25AA} “Bấm chỗ này thì có hoàn lại được không?” → “Bạn đang muốn … để … (ngập ngừng)” ] ] - *Cách ghi chú*: Sử dụng danh sách các nhiệm vụ cần thực hiện, theo dõi và ghi nhận lại: biểu cảm/hành vi/suy nghĩ của người dùng bên cạnh lời nói. - *Sau buổi trải nghiệm*: #block(inset:(left:1cm))[ \u{2218} Hỏi thêm người dùng: đánh giá về ứng dụng, quá trình trải nghiệm ứng dụng. #linebreak() \u{2218} Gửi lời cảm ơn, quà vì đã tham gia buổi trải nghiệm. #linebreak() \u{2218} Tổng hợp lại kết quả, dấu hiệu và thống kê các điểm cần lưu ý ] ] ==== Tài liệu buổi trải nghiệm #block()[ - Checklist vật dụng: Xem lại mục *_4.3.4.1_* - Danh sách các nhiệm vụ: Sử dụng danh sách nhiệm vụ ở mục *_4.3.3_* để in ra các thẻ giấy (flashcard) cho người sử dụng. - Hướng dẫn điều phối: Xem lại mục *_4.3.4.2_*. - Điều khoản tham gia: #link("https://docs.google.com/document/d/1_KpeN6X2FtPsHiNPX0rSPbsqtIg7S9p8-TYfctEDQ6Q/edit?usp=sharing")[tài liệu PDF cần in để người tham gia ký xác nhận]. - Ghi chú buổi trải nghiệm: #link("https://docs.google.com/spreadsheets/d/1Epc3z7tpa3Qgk_VL1n3LOSx6RjRsrNszd2zTkdcMO7o/edit?usp=sharing")[tài liệu buổi điện tử]. ] === Kết quả của cuộc khảo sát ==== Xu hướng Sau khi tiến hành khảo sát trên 3 người dùng, chúng tôi đã thu lại được kết quả đáng chú ý như sau #block()[ - *2 trên 3 người*: Không hiểu về tính năng nạp tiền vào ví và ý nghĩa của coin trong ứng dụng. Điều này gợi ý rằng khâu thanh toán cần tương minh hơn, cung cấp thêm gợi ý để người dùng thao tác. - *2 trên 3 người*: Kỳ vọng có thể đăng tải tài liệu nhưng sẽ được in trong giai đoạn sau → Hệ thống cần lưu lại các tài liệu đã đăng tải, được chọn từ các tài liệu đã đăng tải để in (tương tự checkbox của giỏ hàng) - *3 trên 3 người*: Không cân nhắc sử dụng phần “Order in progress” để tra cứu đơn hàng đã đặt/tìm mã đơn hàng khi lấy tài liệu → Chỉ target phần này thành các tài liệu sẵn sàng để nhận *READY*. - *3 trên 3 người*: Yêu cầu ứng dụng phải tự động hoàn tiền khi hủy đơn hàng chưa in và mất tiền/có penalty cho đơn hàng đã in xong. - *1 trên 3 người*: Hiểu sai tính năng vì rào cản ngôn ngữ → Cần bổ sung song ngữ đối với các tính năng trên ứng dụng. ] ==== Gợi ý cải thiện người dùng Bên cạnh đó, nhóm cũng đã nhận được một vài góp ý từ người dùng cho sự thay đổi của hệ thống như sau: #block()[ - *Chức năng thanh toán*: #block(inset:(left:1cm))[ \u{2218} Ứng dụng cần tường minh hơn về thông tin quy đổi giấy/tiền/coin. #linebreak() \u{2218} Cân nhắc bổ sung cơ chế thanh toán trong 1 lần, không cần qua bước nạp tiền vào ví. ] - *Chức năng danh sách tài liệu*: Các tài liệu đã tải/cấu hình nên được lưu trữ tương tự tính năng “giỏ hàng”, có thể lựa chọn in vào một thời điểm khác. - *Chức năng theo dõi đơn hàng*: các trạng thái cần được ghi chú hướng dẫn hoặc đổi từ ngữ để không hiểu nhầm về các trạng thái, đặc biệt nếu lúc sau mở rộng thêm cơ chế tự phục vụ. ]
https://github.com/pm3512/resume
https://raw.githubusercontent.com/pm3512/resume/main/README.md
markdown
A rewrite of my resume from LaTeX to [Typst](https://github.com/typst/typst) Based on https://github.com/skyzh/chicv
https://github.com/gdahia/typst-ams-fullpage-template
https://raw.githubusercontent.com/gdahia/typst-ams-fullpage-template/main/amsart.typ
typst
#import "@preview/lemmify:0.1.5": * #let script-size = 9.97224pt #let footnote-size = 10.00012pt #let small-size = 11.24994pt #let normal-size = 11.9pt #let large-size = 11.74988pt // This function gets your whole document as its `body` and formats // it as an article in the style of the American Mathematical Society. #let ams-article( // The article's title. title: "Paper title", // An array of authors. For each author you can specify a name, // department, organization, location, and email. Everything but // but the name is optional. authors: (), // Your article's abstract. Can be omitted if you don't have one. abstract: none, // The article's paper size. Also affects the margins. paper-size: "us-letter", // The path to a bibliography file if you want to cite some external // works. bibliography-file: none, // The document's content. body, ) = { // Formats the author's names in a list with commas and a // final "and". let names = authors.map(author => author.name) let author-string = names.join(", ") // Set document metadata. set document(title: title, author: names) // Set the body font. AMS uses the LaTeX font. set text(size: normal-size, font: "New Computer Modern") // Configure the page. set page( paper: paper-size, // The margins depend on the paper size. margin: if paper-size != "a4" { ( top: 1in, left: 1in, right: 1in, bottom: 1in, ) } else { ( top: 11in, left: 1in, right: 1in, bottom: 96pt, ) }, // The page header should show the page number and list of // authors, except on the first page. The page number is on // the left for even pages and on the right for odd pages. header-ascent: 20pt, // On the first page, the footer should contain the page number. footer-descent: 12pt, footer: locate(loc => { let i = counter(page).at(loc).first() align(center, text(size: script-size, [#i])) }) ) // Configure headings. set heading(numbering: "1.") show heading: it => { // Create the heading numbering. let number = if it.numbering != none { counter(heading).display(it.numbering) h(7pt, weak: true) } // Level 1 headings are centered and smallcaps. // The other ones are run-in. set text(size: normal-size, weight: 400) if it.level == 1 { set align(center) set text(size: normal-size) smallcaps[ #v(15pt, weak: true) #number #it.body #v(normal-size, weak: true) ] counter(figure.where(kind: "theorem")).update(0) } else { v(11pt, weak: true) number let styled = if it.level == 2 { strong } else { emph } styled(it.body + [. ]) h(7pt, weak: true) } } // Configure lists and links. set list(indent: 24pt, body-indent: 5pt) set enum(indent: 24pt, body-indent: 5pt) show link: set text(font: "New Computer Modern") // Configure equations. show math.equation: set block(below: 8pt, above: 9pt) show math.equation: set text(weight: 400) // Configure citation and bibliography styles. set cite(style: "ieee") set bibliography(style: "ieee", title: "References") show figure: it => { show: pad.with(x: 23pt) set align(center) v(12.5pt, weak: true) // Display the figure's body. it.body // Display the figure's caption. if it.has("caption") { // Gap defaults to 17pt. v(if it.has("gap") { it.gap } else { 17pt }, weak: true) smallcaps(it.supplement) if it.numbering != none { [ ] it.counter.display(it.numbering) } [. ] it.caption } v(15pt, weak: true) } // Display the title and authors. v(33pt, weak: false) align(center, upper({ text(size: large-size, weight: 700, title) v(25pt, weak: true) text(size: footnote-size, author-string) })) // Configure paragraph properties. set par(first-line-indent: 1.2em, justify: true, leading: 0.58em) show par: set block(spacing: 0.58em) // Display the abstract if abstract != none { v(20pt, weak: true) set text(script-size) show: pad.with(x: 35pt) smallcaps[Abstract. ] abstract } // Display the article's contents. v(38pt, weak: true) body // Display the bibliography, if any is given. if bibliography-file != none { show bibliography: set text(11.9pt) show bibliography: pad.with(x: 0.5pt) bibliography(bibliography-file) } // The thing ends with details about the authors. show: pad.with(x: 11.5pt) set par(first-line-indent: 0pt) set text(7.97224pt) for author in authors { let keys = ("department", "organization", "location") let dept-str = keys .filter(key => key in author) .map(key => author.at(key)) .join(", ") smallcaps(dept-str) linebreak() if "email" in author [ _Email address:_ #link("mailto:" + author.email) \ ] if "url" in author [ _URL:_ #link(author.url) ] v(12pt, weak: true) } } #let citeauthor = (citation) => { set cite(form: "author", style: "deutsche-gesellschaft-für-psychologie") citation } #let citet = (citation) => { set cite(form: "author", style: "deutsche-gesellschaft-für-psychologie") citation " " set cite(form: "normal", style: "ieee") citation } #let thm-style-ams( thm-type, name, number, body ) = block(width: 100%, breakable: true)[#{ strong(thm-type) + " " if number != none { strong(number) + " " } if name != none { emph[(#name)] + " " } " " + emph(body) }] + [$zws$ #v(-15pt)] #let ams-styling = ( thm-styling: thm-style-ams ) #let ( theorem, lemma, corollary, proposition, rules: ams-stmt-rules ) = default-theorems("thm-group", lang: "en", ..ams-styling) #let ams-style-proof( thm-type, name, number, body ) = block(width: 100%, breakable: true)[#{ strong(thm-type) + " " if number != none { strong(number) + " " } if name != none { emph[(#name)] + " " } " " + body + h(1fr) + $square$ }] + [$zws$ #v(-15pt)] #let ams-style-example( thm-type, name, number, body ) = block(width: 100%, breakable: true)[#{ strong(thm-type) + " " if number != none { strong(number) + " " } if name != none { emph[(#name)] + " " } " " + body }] + [$zws$ #v(-15pt)] #let ams-styling-second = ( proof-styling: ams-style-proof, thm-styling: ams-style-example ) #let ( remark, example, proof, rules: ams-general-rules ) = default-theorems("general-group", lang: "en", ..ams-styling-second)
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/visualize/gradient-math_01.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test on frac #show math.equation: set text(fill: gradient.linear(..color.map.rainbow)) #show math.equation: box $ nabla dot bold(E) = frac(rho, epsilon_0) $
https://github.com/antonWetzel/prettypst
https://raw.githubusercontent.com/antonWetzel/prettypst/master/test/default/headings.typ
typst
MIT License
= Top == Sub #lorem(1) == Sub 2 === Subsub 3 #lorem(1) == Sub 3 #lorem(1) == Sub 4 <label> === Subsub 4 <label_2> #lorem(1)
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/036%20-%20Guilds%20of%20Ravnica/012_The%20Gathering%20Storm%3A%20Chapter%206.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "The Gathering Storm: Chapter 6", set_name: "Guilds of Ravnica", story_date: datetime(day: 10, month: 07, year: 2019), author: "<NAME>", doc ) The skyship shuddered as its docking clamps released, lurched sideways in a gust of wind, and then rose gently in the mid-afternoon sky. Ral was old enough to think of casual skyship traffic as a novelty, though it had been a part of the Ravnican skyline for years now. When he’d arrived in the Tenth District, the only ships had belonged to the guild militaries. Now vessels like this one took people up just for the pleasure of seeing the city from the air, circling gently around landmarks like New Prahv and Orzhova. Other, more nimble fliers darted out of the way of the lumbering tourist ship—Boros soldiers on rocs, gargoyles and giant insects, and the now-ubiquitous camera thopters. The deck of the skyship was full of benches, but most of the passengers stood at the rails, leaning as far out as they dared and pointing out the sights to one another. The ship was packed, people eager to take advantage of another brief break in the rain and the endless, dreary clouds. Many of them were visitors from outlying districts, recognizable in the Tenth by their more formal, drab clothing. The Tenth was the hub of most important activity on Ravnica, and this was reflected in grander architecture, busier markets, and wilder traffic in the streets. In Tovrna, where Ral had grown up, he could have gone days without seeing anything but humans; here in the Tenth the crowds were full of elves, vedalken, viashino, minotaurs, loxodons, centaurs, and all the rest. Ral watched the out-district families, parents and children both dressed in their feast-day finest to gawk at the Tenth’s wonders, and thought about what might have been. A shadow fell over him, and he looked up to find Lavinia frowning at him from under her hood. "You’re not very attentive," she said. "And you’re late." "Had to wait until we got above the spy-thopters." She sat next to him, pulling her coat tighter. "Usually the clouds keep them blind to anything in the air. Inconvenient day for it to be clear." Ral shrugged. Sometimes he thought Lavinia was overly paranoid; other days, he wondered if he himself was nearly paranoid enough. "Tell me about Vraska," he said. "She’s a gorgon, obviously. There’s a few of them associated with the Golgari, though they’re anti-social and don’t band together much. Vraska was a bit of a loner in her early years, apparently, and wasn’t an official guild member. That didn’t stop the Azorius from scooping her up with all the rest in the Duskend Purges, about twenty years back." Ral winced. "She doesn’t have much love for your ex-guildmates, I take it." "It gets worse. You know who was the presiding official in her case?" "Isperia," Ral guessed. Lavinia nodded. "Vraska and a few thousand others, of course. Isperia wasn’t guildmaster yet, but she was still a high-ranking judge. I doubt she gave Vraska more than a minute’s thought, but . . ." "Yeah." Ral shook his head. "Well, she asked for the meeting, so maybe she’s not the grudge-holding type." From what he’d heard about her from Beleren, that was a faint hope. "How did she get out of the prison camp?" "Azorius record-keeping is scrupulous, as always. She didn’t escape by any known means, she didn’t die, and she wasn’t released. As far as anyone can tell, she just disappeared." Lavinia lowered her voice. "I dug a little bit in the archives, and one of the prison guards testified that she was undergoing administrative punishment for some infraction when she simply vanished into thin air." Lavinia paused. "Administrative punishment means—" "Getting a beating." Ral’s eyes widened. "That must have been when her Planeswalker spark ignited. It’s common for the first time to be in a stressful situation. Being beaten by prison camp guards would certainly qualify." "Interesting." Lavinia looked as though she were filing the information away for future use. "In any event, she turns up a few years later, now working directly for the Golgari as an assassin. She’s wanted by the Azorius for various crimes, but we never got close to catching her. It wasn’t our highest priority at the time." Lavinia paused. "Then, about six months ago, she vanished again. Even her associates don’t seem to know where she was." "Off-plane," Ral muttered. "Quite possibly. If so, she came back quite recently, and almost the first thing she did was organize a coup against Jarad, the old Golgari guildmaster. She has the support of the kraul, those insect-people, and some kind of undead legion." Lavinia shrugged. "Coups are pretty much business as usual in the Swarm, of course, but my contacts were surprised at how fast this one developed. Everyone thought the shadow elves had a pretty solid grip on power." "You sound suspicious." "I’m always suspicious." Lavinia gave a thin smile. "But she fits the profile for Bolas’s agents. Usually they’re ambitious people who suddenly move into leadership roles, with a little covert assistance." #emph[That sounds like the Bolas I know. I’m sure it would have been me, if I’d agreed when Tezzeret made his offer.] "You think Vraska is working for Bolas." "I think it’s a definite possibility," Lavinia said. "She hasn’t exchanged correspondence with any other known agents, so I can’t prove it. But . . ." She shrugged. "If Bolas’s goal is to sabotage the guild summit, having as many of the guildmasters be his own people as he can sounds like a good way to it." Ral nodded grimly. "Have you looked into what I sent you yesterday?" He’d written out a quick summary of what had happened at Selesnya, including Garo’s strange behavior, and had an attendant leave it in one of her dead drops. Lavinia gave a cautious nod. "It’s a good thing you were able to stop them, obviously," Lavinia said. "As for Garo . . ." "He spoke as though he were Bolas himself." Ral shook his head. "Bolas can disguise himself as human, but if that #emph[had] been him, we never would have gotten close. And Emmara has confirmed that the man who died there #emph[was] the same Glademaster Garo she’s known for decades, and not any kind of replacement or shapeshifter." "Mind magic, then?" Lavinia said. "If Bolas is working with Lazav, he certainly has access to the expertise. Maybe they twisted Garo." "Twisted him so that he thought he #emph[was] Bolas? That doesn’t make a lot of sense." Lavinia shrugged. "Maybe that was just a bluff to rattle you." "Maybe," Ral said. "See if you can find out more about what happened to Garo. That kind of mind magic isn’t easy. They would have needed to get pretty close to him." "I’m already on it," Lavinia said. "Bolas is getting his orders to his people on Ravnica #emph[somehow] . If we can find out how and put a stop to it, that might go a long way toward screwing up their plan." "Right." Ral looked sideways at her. "Thank you, by the way. For the warning, and for your help." "Oh." Lavinia looked slightly taken aback at the sentiment. "I’m still doing my job. Defending the Guildpact and Ravnica." "Still. Thank you." She ran a hand through her short brown hair, nervously. "You’re welcome." The skyship was descending, and Lavinia got to her feet. "I’d better go, before some thopter gets eyes on us. Good luck with Vraska." "Good luck yourself. And be careful." "Always." She gave him a brisk nod and strode toward the rear of the ship. Ral stared down at the streets of Ravnica, while children shouted to one another and hung on the rails. Eventually, the vessel settled back into its cradle, and the docking clamps engaged with a #emph[clunk] . He got to his feet as the tourists flooded toward the ramp. #emph[Well. Now let’s see what the queen of the Golgari has to say.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "You said I could observe!" Hekara said. "That means no running off without me, yeah? Otherwise you could be plotting an’ His Fireballhood wouldn’t like it." "Some things are too sensitive for observers," Ral said. "And some things are too personal. You’re here now, aren’t you?" "Suppose." Hekara looked irritably at the sky, which had gone cloudy again as the last rays of sunlight drained away. A few drops of rain were already spattering the cobbles. "It’d be keen if it had stayed clear." Ral waved a hand, and his rain-shield spell widened, bending the drops away from Hekara. She looked upward, then over at him, beaming. "Thanks!" she said, and unexpectedly punched him lightly on the shoulder. "We’re mates, us!" "I told you . . ." He sighed as she hurried forward toward the next corner. #emph[Oh, well] . Turning, he was confronted rather abruptly with the Dyflin Crevasse, a vast fissure in the earth that interrupted the Ravnican street plan. Houses on the edge of the abyss stretched out dangerously above empty space, cantilevering themselves farther and farther to take advantage of the free real estate. They reminded Ral of a wasp’s nest clinging to the side of a beam. This late, the crevasse itself was nothing but darkness, a gap in the web of streetlights and shop lanterns, the twinkle of which were just visible on the other side. In between, a slender thread barely distinguishable from the shadows around it, was the Madman’s Bridge. The Madman’s Bridge was a cautionary tale passed down by architects to their apprentices. After more than ten thousand years of building and rebuilding, most Ravnican structures were constructed not on solid ground but atop the crushed remnants of the previous layer, the ruined city stretching down underneath them through basements and sub-basements, ruins and covered yards, until it merged into the underground depths. Every so often, the rubble #emph[shifted] , like a giant shrugging in his sleep, and some house in the daylight world found one of walls had suddenly dropped two feet or was canted at sharp angle to the rest. That was what had happened to the Madman’s Bridge, on the very day it was supposed to open to the public. It was a long, thin structure, built as a public works project by the Senate in more relaxed days to facilitate traffic from one side of the Crevasse to the other and relieve crowding on some intervening streets. Some claimed the contractors had done substandard work to pad their profits, others that the bridge had been sabotaged as part of Azorius infighting; the resulting litigation had been tied up in the Senate for years afterward. However it happened, just before the ribbon-cutting ceremony, the ground under one end of a footing of the bridge had suddenly dropped, causing the span to #emph[twist] like a ribbon. Huge chunks of stone had broken away, crashing down into the depths of the crevasse. The whole thing had been expected to collapse at any moment, and a crowd had gathered to watch, ready to cheer on a good disaster. But, improbably, the bridge had held. When it became clear that it wasn’t going to fall, the crowd went home, and the Senate declared the whole thing unsafe and washed their hands of it. Decades later, the Madman’s Bridge still stood, canted about ten degrees to the right and missing big chunks from both sides, as though it had been nibbled by giants. The remaining roadway was too narrow to drive a cart across, and there was always the chance that any substantial load would be the straw that broke the dragon’s back, so sane people gave the place a wide berth. That made it an excellent place to meet without anyone watching. #emph[And I suppose it’s convenient for the Golgari.] It was well-known that the depths of the Crevasse connected to the Swarm’s underground kingdom. The local children tested their courage by "raining on the Golgari," which meant going out to the center of the bridge, where it was most tilted, and pissing over the edge. Ral paused at the foot of it, eyeing the long stretch of stone held together by little more than mortar and force of habit. #emph[Madman’s Bridge, indeed.] "Come on!" Hekara charged out onto the bridge. "Don’t want to be late, yeah?" Ral shrugged. #emph[It’s stood this long, it’ll stand a few hours longer.] He stepped onto the tilted stone, leaning to the left to compensate for the angle, feeling the odd tingle of a yawning gap in the soles of his feet. He did his best to ignore it. Even with the missing blocks, the remaining bridge was quite wide. #emph[It only ] feels#emph[ like you’re about to fall.] Hekara had slowed a hundred yards ahead, and as he got closer Ral could see two shapes waiting in the rain. One was humanoid, hunched under a heavy cloak. The other was a six-legged creature the size of a small pony, covered in chitinous armor plate. It was a stark, unhealthy-looking off-white, and in spite of its bulk it crouched slightly behind the humanoid, as though for protection. Ral caught up with Hekara, who had come to a halt and was staring, fascinated, at the insect. He waved his hand, extending his rain spell to the Golgari emissaries. The hooded figure straightened, then threw her hood back. She had narrow features, bright yellow eyes, and long, black tendrils where her hair should have been, wriggling of their own accord like snakes. She wore tight-fitting leather armor, and carried a saber on her hip. Hekara whistled. "Well. There’s a bit of all right." Ral glanced at her. "The gorgon?" "Yeah." The Rakdos emissary raised her eyebrows suggestively. "Those wriggly bits. Don’t you just want to grab ’em?" "Gorgons have a habit of petrifying their lovers when they tire of them, you know." "‘s all right. Keeps me inventive, yeah? Keen." "Just stay quiet, please," Ral said, as Vraska stepped forward. "<NAME>," she said, in a surprisingly pleasant voice. "I’m afraid I don’t know your companion." "<NAME>," Ral said. "This is Hekara of the Rakdos." "#emph[Very ] pleased to meet you," Hekara said, with a bow. "Vraska is fine," the gorgon said. "Queen is a bit of an affectation." She gestured to her insect companion. "This is Xeddick, my advisor." "I was surprised to get your . . . messenger," Ral said. "My understanding was that all our attempts to invite you to the summit had been rebuffed." Vraska smiled slightly, revealing sharp, pointed teeth. "I’m afraid I don’t respond well to entreaties from the Azorius." "I understand you have a history." "You understand nothing," Vraska snapped, then paused, visibly calming herself. "I am sorry. I have had certain revelations recently that have made me . . . less certain of myself." "Why did you want to meet here?" Ral said. "If you intend to come to the summit, a note would have sufficed." "Would you trust me, if I turned up to your meeting at the last minute?" "Probably not. My associate thinks you’re working for Bolas." "Your associate is very perceptive," Vraska says. Ral’s eyebrow went up. "Excuse me?" "I am . . . I was . . . doing the dragon’s bidding." "I see." Ral flexed his fingers, feeling the power crackle over them. His accumulator was on his back, fully charged, and his bracers were secure under the sleeves of his coat. "Then I have to ask about your intentions." Vraska smiled again, looking a little strained. "I’m afraid they have recently changed. It’s a complicated story." "I’m listening." "How well do you know Jace?" #emph[Beleren.] Ral ground his teeth. #emph[Even when he’s not here, he has to be at the center of everything.] He gave himself a moment before responding. "Reasonably well." "I met him on a plane called Ixalan. We became . . . friends, in a strange way. I was there doing the dragon’s business, but I had found more than that. I . . ." She shook her head. "I don’t expect you to understand." "What was Beleren doing there? He’s the Living Guildpact. He ought to be #emph[here] , helping us work this out." "I don’t know most of that story. But Jace and I discovered that <NAME>’s ultimate intention was to come here, to Ravnica, and he intends to conquer. He has an army of undead champions at his back." "That’s new," Ral muttered. "If you were working for him—" "He promised me leadership of the Golgari," Vraska said. "He didn’t tell me he intended to crush all of Ravnica beneath his claws. Jace helped me see that I had to stop him." "Then why reject our invitation?" "Because I had to meet Bolas before returning to Ravnica. If I had intended to betray him, he would have seen it in my mind. So I had Jace . . . alter me. Our original plan was for him to undo it himself, but my friend Xeddick here found the blocked memories." #emph[It is the truth] , a voice said, directly into Ral’s mind. #emph[I untangled Jace’s work. He is a master, far more skilled than myself, but he left those memories intending that they be returned to friend-Vraska.] "Ooh," Hekara said, scratching at her temple. "That tickles." "So you came back here ready to do Bolas’s bidding," Ral said. "Then the bug rummaged around in your head, and you had a change of heart?" "I’m aware it sounds unlikely," Vraska said. "Nothing is #emph[likely] when Beleren’s involved," Ral said. "But it’s very convenient. How can I trust you?" There was a long pause. "I do not know," Vraska said. "I have asked myself this, many times. It is why I have forced myself to be . . . honest with you. But I admit that in your position, I would not offer trust so easily." She shook her head. "All I can tell you is that I wish to defeat Bolas and protect my people." "Keen!" Hekara said. "We can be mates, then." "Mates?" Vraska said quizzically. "Hekara," Ral said. "#emph[Observe] ." "‘Kay," Hekara said, sulkily. To Vraska, Ral said, "I’ll have to consider this. If you’re willing to bring the Golgari to the summit, that’s certainly a start. But . . ." "I understand." Vraska let out a frustrated sigh. "If I can offer assistance in another way, please tell me. I would like a chance to . . . prove myself." Ral nodded. "I’ll be in touch." "As you wish." The gorgon gestured to Xeddick, and the pair of them turned away. "See you soon, I hope!" Hekara called after them. At Ral’s look, she shrugged. "What? I like her. An’ the bug is cute." Ral had to admit that Vraska’s poise was impressive. #emph[But that just makes her a better liar.] #emph[So now what?] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The question was answered almost as soon as they returned to the city streets. A red-coated messenger was waiting under the eaves of a nearby inn, and hurried over to Ral as soon as he stepped off Madman’s Bridge. "They said you’d gone out there, sir, and I thought I’d just wait here to see if you came back." The young man bowed and presented a single folded sheet of paper. "With my compliments, sir. The sender said it was urgent." Ral unfolded the page. There were no sorcerous protections or seals on this one, just a few lines scribbled in an achingly familiar hand.#linebreak #emph[Ral –] #emph[I need to talk to you, as soon as you can. Guild business. I’ll be at the apartment.] #emph[Tomik] He folded it again, tucked it in his pocket, and turned to Hekara. "Go back to the Nivix. I have something to take care of." "Aw." She cocked her hip. "I thought I was observing!" "This is personal business." "That’s what you said this morning!" "#emph[Go] , Hekara." She gave a sulky nod. "But you’d better not be getting up to any fun without me." "I promise." It was some distance from the crevasse back to the apartment, so Ral flagged down a rickshaw pulled by a burly centaur, and sat back in the seat as creature worked up to a canter, threading around the late-night traffic. His driver exchanged good-natured profanities with other vehicles and the occasional frantic pedestrian as they passed, but Ral ignored it, his mind elsewhere. #emph[Guild business. Does he mean that?] It could be a joke, but Tomik wasn’t much of one for that kind of humor. #emph[Is he worried about me? Angry I haven’t been back recently?] The summit had been taking up virtually all his time, it was true. #emph[Tomik understands, though. It’s not like ] he#emph[ hasn’t vanished for days.] The ride seemed to take forever. When they finally pulled up, Ral tossed the centaur a handful of coins and took the steps two at a time, taking a few moments to compose himself when he got to the top. He ran one hand through his hair, a small crackle of electricity giving it that static frizz. The door was unlocked. Ral pushed it open to find Tomik pacing in front of the sofa, taking his glasses off to clean them and then putting them back on, only to repeat the cycle a moment later. #emph[Something must really be wrong.] "Tomik?" Tomik froze, like a mouse sighting a cat. Ral kicked the door shut behind him and hurried over. "Tomik, what the Krokt is going on?" he said. He tried putting his hand on Tomik’s shoulder, but the younger man pulled away. "Are you all right?" "I’m fine." Tomik reached for his glasses again, thought better of it, and shoved his hands in his pockets instead. "Did something happen?" #emph[Guild business.] "I’ve been out, if there’s news." "Nothing’s happened yet. I . . ." He shook his head. "I’m afraid." "Why?" Ral tried to fix his lover’s gaze. "It’s—" Tomik took a deep breath, squared his shoulders, and finally met Ral’s eyes. "This. What we have here. Our relationship." #emph[Oh, damn.] Ral felt himself tense reflexively. "What about it?" "It’s . . . good." Tomik’s jaw trembled. "Very good. I think . . ." He shook his head again. "It’s very important to me, and I’m afraid I’m about to screw everything up." "You’re #emph[about] to screw it up?" Ral said. Tomik gave a tight nod. "Because you want to talk to me about guild business?" Another nod. #emph[Oh, Tomik.] Ral felt something in his chest unclench. He stepped closer, and this time Tomik consented to be pulled into a hug. Ral could feel the tension across his lover’s back, pulled as straight as a sword blade. "It’ll be all right," Ral said, quietly. "You won’t screw it up." "You don’t even know what I’m going to say," Tomik whispered. "Doesn’t matter. I know who you are." Ral pulled away from Tomik slightly and kissed him. "No guild business was a good rule at the start, but maybe we’ve grown past that. I #emph[trust] you, Tomik." "I . . ." Tomik swallowed hard, and kissed Ral again. For a moment they stood in silence, cheek to cheek. "Thank you." "Just tell me," Ral said. "I need your help," Tomik said. "Or Teysa does. They’re going to extinguish her, if nothing changes." "All right," Ral said. "What can I do?" "I need you to attack Orzhova." Ral raised an eyebrow. "Maybe you’d better start at the beginning." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "They’ve had Teysa in a cell for months now," Tomik said. He had calmed down somewhat, and they were sitting side by side on the sofa, drinking tea from matching mugs. "She’s been trying to push back against the Ghost Council, and they finally got tired of it." "And you think they’re going to kill her?" "Worse," Tomik said miserably. "They’ll extinguish her. Kill her inside a ward that will prevent her from rising as a ghost. For a member of the Karlov family, it’s the ultimate punishment." It was odd to think of a family where #emph[not] rising as a vengeful spirit was considered a punishment, but Ral just nodded. "And this mercenary?" "Kaya. Teysa got in touch with her through a friend. She apparently has the power to destroy ghosts. But the catacombs are too well guarded. We need something that will pull the tower guards away, without it being directly attributable to Teysa." Tomik looked sidelong at Ral. "I know you haven’t got the Orzhov onboard for your guild summit." "Why does #emph[everyone] seem to know everything about my private business?" Ral muttered. "Don’t answer that. You’re right, they’ve turned down every approach, whether it’s from me or Isperia or even Niv-Mizzet." "If Kaya succeeds, Teysa will inherit leadership of the Orzhov. She’s willing to guarantee that they get on board in exchange for your help with this." Tomik looked nervous. "It seemed like a good deal for both of you. I wouldn’t just come begging for your help if I didn’t think—" "Tomik, I know," Ral said. "It’s all right. Really." "Really?" "Really." All the tension had flowed out of Tomik, leaving him boneless. He sagged against the arm of the sofa. "That is . . . better than I expected this conversation to go." "That said," Ral went on, "it may not be that easy." "What’s the problem? You don’t think Niv-Mizzet would allow it?" "No, he wouldn’t object. But in order to cause chaos in the cathedral, we’d need a force of significant size." "I thought you had all the authority you needed." "I do." Ral made a face. "But keeping a secret from the Orzhov is nearly impossible when you’re talking about that many people. They’re sure to catch wind of it, and then they’ll be ready for us. Even if we succeeded, it would mean a guild war, and that’s the last thing we need right now." "Damn," Tomik said. "You’re right." "#emph[I] can help, though," Ral said, giving Tomik’s hand a squeeze. "Please don’t attack the cathedral by yourself," Tomik said. "I’m sure Hekara would come too," Ral said, with an absent grin. He was thinking hard. "Who’s Hekara?" "I’ll have to introduce you. You’ll like her. Possibly." #emph[The problem is the bureaucracy. ] It would be one thing if Ral only had to give the word to assemble a strike team. But Izzet, while not Azorius, was laden with hierarchies, meetings, and committees. Even with Niv-Mizzet’s own authority behind him, any order Ral gave would have to be disseminated through a hundred channels, and the chances of it leaking to the Orzhov spy network—said to be second only to the Dimir—were high. #emph[If there was another way to get the forces we need . . .] An audacious thought occurred to him. "Tomik," Ral said. "Can you set up a meeting with Kaya? I may have an idea." #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Vraska ran through the shadows. Surface-dwellers rarely paid much attention to what was going on over their heads. She’d used the roofs of the Tenth District as her private highway back in her days as an assassin, trusting to darkness and speed to keep her passage from the Boros skyknight patrols. Now the new Azorius thopters were an added threat, but they were mostly concentrated around New Prahv, and hampered by the endless rain. Vraska had always loved the autumn rains. They made it even easier to disappear. Her mind was still a tangle, days after Xeddick had unlocked her hidden memories. Being up here, in her drab, hooded black clothes, made her feel like she’d dropped seamlessly back into her former life. Stalking her prey across the city, awaiting the right moment to strike and claim another trophy for her wall. She’d killed without mercy or pangs of conscience—the Azorius, the enemies of the Golgari, and anyone else who got in her way. At the same time, she could now remember standing in the light, on the deck of the #emph[Belligerent] . Surrounded by her crew, a gang of monsters and misfits, with no need of hoods and darkness to hide what she was from the world. She’d won a place there by her own ability. And when Jace had joined her— Thinking of Jace almost made her miss a jump to the next building. Furious, Vraska pushed the thought away and forced herself to concentrate on the task at hand. She wasn’t the only one who used these secret roads. The thieves, spies, and assassins of the Tenth District all knew the routes, and she got glimpses of others from time to time, moving as swift and quiet as she. There was a freemasonry among roof-runners, and they generally kept to themselves, but not always. Tonight, something was definitely amiss. She’d already passed two bodies, both dressed in the blue robes of Dimir mind mages, sprawled in pools of blood where they’d easily be found in the morning. #emph[Someone wants to make a very clear statement.] Who and why, she didn’t know, but she kept well away. When she reached the building Ral had indicated, she found him standing on the roof by the stairwell, a lantern at his feet casting a wan glow. With him was the Rakdos emissary, Hekara, whom she’d met at the bridge. Vraska hadn’t yet decided if the girl was actually a fool or merely playing one; she’d believe either, given the legendary unpredictability of the fire demon. Vraska stepped from the shadows well away from the pair of them, so as not to alarm anyone, and gave a shallow bow. "Zarek," she said. "Hekara. I hope you understand the risk I run, coming here." Most of the city didn’t react well to gorgons. "I understand," Ral said. "Thank you." "So?" Vraska crossed her arms. "You said that you had an opportunity for me to earn your trust. In the name of defeating Bolas, I’m willing to do so. What do you need?" "Just a moment. We’re waiting for one more person." A purple glow suffused a section of rooftop beside Ral, and a young woman climbed up through it, as though it were only as solid as mist. She was dark-skinned, with dark, frizzy hair, wearing a thief’s leathers and a pair of long daggers on her wrists. Pulling her legs up, she sprang to her feet, looking over the other three with undisguised curiosity. "You must be Kaya," Ral said. "I’m <NAME>." "I gathered that," Kaya said. "Tomik described your hair perfectly." Ral ran a hand through his hair with a slight crackle of electricity and grinned. "This is Hekara, the Rakdos emissary." "Charmed, yeah?" Hekara bowed with a jingle of bells. "Nice trick with the roof." "And this," Ral went on, "is Vraska, queen of the Golgari." Kaya looked her up and down. "Not what queens usually look like, in my experience, but fair enough." Vraska tossed back her hood, exposing her agitated tendrils, and had the satisfaction of seeing Kaya’s eyes widen. "I am not a typical queen," she said. "Now we’re all here, Zarek. Why?" "I don’t know if you’re familiar with the situation in the Orzhov," Ral said. "Teysa, the heir, is imprisoned and under threat of execution. She’s willing to work with us, and the current leadership isn’t." "Sounds like it’s time for a change of leadership, then," Vraska said. "Indeed." Ral nodded at Kaya. "Orzhov is ruled by a council of ghosts." "And I am a ghost-assassin," Kaya said. "Very convenient." "I would have thought that a ghost assassin was the ghost #emph[of] an assassin," Hekara said. "Not an assassin who kills ghosts." "It could be both," Kaya said. "Or would that be a ghost assassin-ghost?" "Or a ghost ghost-assassin!" Hekara said excitedly. "Or—" "Please don’t encourage her," Ral said. "The point is, Kaya is ready to resolve the situation to everyone’s satisfaction." "So what’s the problem?" Vraska said. "The catacombs are too heavily guarded," Kaya said. "Even for someone who can walk through walls." "We need a distraction," Ral said. "An attack on the tower would serve nicely." "And you can’t use your Izzet people because the Orzhov would find out," Vraska said, her mind running ahead of the conversation. "So you want me to bring in some of mine." "Yes," Ral said, frowning. "You said you would do whatever was necessary." "I will," Vraska said. "And I can guarantee that Orzhov has no spies in #emph[my] ranks. Their gold doesn’t go as far in the undercity." Ral blinked. "Just like that?" "Of course." Vraska shrugged. "You’re right. It’s the correct move." "How long do you need?" "A day," Vraska said. "Tomorrow, then," Kaya said, raising her eyebrows at Vraska. "I look forward to working with you." "Likewise," Vraska said. "Mates!" Hekara bellowed, grinning hugely. Ral stepped forward. "Can I have a word?" They strode off a few paces, leaving the other two behind. Vraska looked up at him curiously. Most people had at least some hesitation about matching a gorgon’s gaze at close range, but if Ral was afraid he didn’t show it. "I have to ask," Ral said. "Really, just like that?" "I told you I was willing to do whatever it took." "Why?" "Because now that I’ve become queen, I don’t want to see Bolas crush the Golgari underfoot." #emph[And because Jace ] is#emph[ coming back] , a traitorous part of her thought. #emph[And I have to be able to face him when he gets here.] Ral didn’t look like he believed her, which was fair enough. If she had only met her former self, Vraska was fairly certain she wouldn’t have believed it either. #emph[People can change. Even gorgons.] Someday, even here on Ravnica, she was going to be able to hold her head up in daylight.
https://github.com/denkspuren/typst_programming
https://raw.githubusercontent.com/denkspuren/typst_programming/main/extractText/README.md
markdown
# `extractText` Diese Funktion ist mein erster Beitrag und löst ein Problem mit den standardmäßig ausgelieferten Typst-Templates, siehe https://github.com/typst/templates/issues/12#issuecomment-1793845765 Man kann auch überlegen (so ein [Vorschlag auf Discord](https://discord.com/channels/1054443721975922748/1088371867913572452/1170843910281637898)), etwas vergleichbares zu [`\texorpdfstring`](https://tex.stackexchange.com/questions/699195/how-to-use-texorpdfstring-correctly-and-properly) umzusetzen. Denn was natürlich eine berechtigte Kritik an `extractText` ist: Aus dem Markup lässt sich nicht immer eine automatisierte und zufriedenstellende Reintext-Form ableiten. Beispiel: Aus $x^2$ wird `x2` statt `x^2`.
https://github.com/Otto-AA/definitely-not-tuw-thesis
https://raw.githubusercontent.com/Otto-AA/definitely-not-tuw-thesis/main/tests/tests-setup/test.typ
typst
MIT No Attribution
#import "@preview/linguify:0.4.1": linguify, set-database Workaround for https://github.com/tingerrr/typst-test/issues/51
https://github.com/crd2333/crd2333.github.io
https://raw.githubusercontent.com/crd2333/crd2333.github.io/main/src/docs/Reading/跟李沐学AI(论文)/InstructGPT.typ
typst
// --- // order: 17 // --- #import "/src/components/TypstTemplate/lib.typ": * #show: project.with( title: "d2l_paper", lang: "zh", ) - 参考 #link("https://mp.weixin.qq.com/s/x0yRaNZkz7_LxllZIoWHxA") #hline() - [ ] Todo