diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 1b5ec8b78e..0000000000 --- a/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md deleted file mode 100644 index 10650db30f..0000000000 --- a/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# Typst Packages -The package repository for Typst, where package authors submit their packages. -The packages submitted here are available on [Typst Universe][universe]. - -## Package format - -A package is a collection of Typst files and assets that can be imported as a -unit. A `typst.toml` manifest with metadata is required at the root of a -package. [Read more about the manifest format][manifest]. - -## Published packages - -This repository contains a collection of published packages. Due to its early -and experimental nature, all packages in this repository are scoped in a -`preview` namespace. A package that is stored in -`packages/preview/{name}/{version}` in this repository will become available in -Typst as `#import "@preview/{name}:{version}"`. You must always specify the full -package version. - -You can use template packages to create new Typst projects with the CLI with -the `typst init` command or the web application by clicking the _Start from -template_ button. - -If you want to submit your own package, you can follow [our documentation on -publishing packages][publishing] that will guide you through the process and -give you some tips. - -### Downloads - -The Typst compiler downloads packages from the `preview` namespace on-demand. -Once used, they are cached in `{cache-dir}/typst/packages/preview` where -`{cache-dir}` is - -- `$XDG_CACHE_HOME` or `~/.cache` on Linux -- `~/Library/Caches` on macOS -- `%LOCALAPPDATA%` on Windows - -Importing a cached package does not result in network access. - -## Local packages - -Want to install a package locally on your system without publishing it or -experiment with it before publishing? You can store packages in -`{data-dir}/typst/packages/{namespace}/{name}/{version}` to make them available -locally on your system. Here, `{data-dir}` is - -- `$XDG_DATA_HOME` or `~/.local/share` on Linux -- `~/Library/Application Support` on macOS -- `%APPDATA%` on Windows - -Packages in the data directory have precedence over ones in the cache directory. -While you can create arbitrary namespaces with folders, a good namespace for -system-local packages is `local`: - -- Store a package in `~/.local/share/typst/packages/local/mypkg/1.0.0` -- Import from it with `#import "@local/mypkg:1.0.0": *` - -Note that future iterations of Typst's package management may change/break this -local setup. - -## License - -The infrastructure around the package repository is licensed under the terms of -the Apache-2.0 license. Packages in `packages/` are licensed under their -respective license. - -[universe]: https://typst.app/universe/ -[manifest]: docs/manifest.md -[publishing]: docs/README.md \ No newline at end of file diff --git a/packages/preview/axiomst/0.1.0/LICENSE b/packages/preview/axiomst/0.1.0/LICENSE new file mode 100644 index 0000000000..a541a93cb5 --- /dev/null +++ b/packages/preview/axiomst/0.1.0/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Reza + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/preview/axiomst/0.1.0/README.md b/packages/preview/axiomst/0.1.0/README.md new file mode 100644 index 0000000000..b530742075 --- /dev/null +++ b/packages/preview/axiomst/0.1.0/README.md @@ -0,0 +1,83 @@ +# axiomst + +a clean, elegant template for academic problem sets and homework assignments in [typst](https://typst.app/). + +## Features +- Professional-looking problem set layout with title page +- Automatic problem numbering +- Customizable problem boxes with titles +- Support for collaborator attribution +- Page headers and footers with automatic page numbering +- Clean, academic aesthetic with customizable accent colors + +## Quick Start +The easiest way to get started is through the Typst web app, +``` +typst init @preview/axiomst:0.1.0 +``` + +Or click "Create from template" in the Typst web app and search for "axiomst". + +## Usage +Here's a basic example of how to use the template, + +```typst +#import "@preview/axiomst:0.1.0": * + +#show: homework.with( + title: "Problem Set 1", + author: "Your Name", + course: "MATH 101: Advanced Linear Algebra", + email: "name@uni.com", + date: datetime.today(), + due-date: "April 30, 2025", + collaborators: ["Alice Smith", "Bob Johnson"], +) + +#problem(title: "Vector Spaces")[ + Let $V$ be a vector space over a field $F$. Prove the following properties: + + 1. The zero vector $0_V$ is unique. + 2. For each $v in V$, the additive inverse $-v$ is unique. + 3. If $a in F$ and $a cdot v = 0_V$ for some $v in V$, then either $a = 0$ or $v = 0_V$. +] + +// Your solution here... +``` + +## Configuration Options +### Homework Template +The main `homework()` function accepts the following parameters: + +- `title`: The title of the assignment +- `author`: Your name +- `course`: Course code or name +- `email`: Your email address +- `date`: Date of submission (defaults to today) +- `due-date`: When the assignment is due (optional) +- `collaborators`: List of people you worked with (optional) + +### Problem Function +Individual problems can be created with the `problem()` function: + +- `title`: Title of the problem +- `color`: Color theme for this specific problem box +- `numbered`: Whether to include automatic problem numbering (default: true) + +## Customization +The template is designed to be easily customizable. Here are some common adjustments: + +```typst +// Change the enumeration style for lists +#set enum(numbering: "a)") + +// Use LaTeX-like font +#set text(font: "New Computer Modern") + +// Enable equation numbering +#set math.equation(numbering: "(1)") +``` + +## License + +This project is licensed under the MIT License - see the LICENSE file for details. diff --git a/packages/preview/axiomst/0.1.0/src/lib.typ b/packages/preview/axiomst/0.1.0/src/lib.typ new file mode 100644 index 0000000000..6656f9f78c --- /dev/null +++ b/packages/preview/axiomst/0.1.0/src/lib.typ @@ -0,0 +1,322 @@ +// axiomst: A clean, elegant template for academic problem sets and homework assignments +#import "@preview/showybox:2.0.4": showybox + +#let problemCounter = counter("problem") +#let theoremCounter = counter("theorem") +#let definitionCounter = counter("definition") +#let lemmaCounter = counter("lemma") +#let corollaryCounter = counter("corollary") +#let exampleCounter = counter("example") +#let algorithmCounter = counter("algorithm") + +#let columns( + count: 2, + gutter: 1em, + separator: none, + widths: none, + ..children, +) = { + let content = children.pos() + + let col-widths = () + if widths == none { + let available-width = 100% - gutter * (count - 1) + let column-width = available-width / count + col-widths = (column-width,) * count + } else { + col-widths = widths + } + + if separator == "line" { + grid( + columns: col-widths, + column-gutter: gutter, + ..content.enumerate().map(((i, c)) => { + if i < content.len() - 1 { + (c, line(angle: 90deg, length: 100%, stroke: (thickness: 0.5pt, dash: "solid"))) + } else { + c + } + }).flatten() + ) + } else if separator != none and type(separator) == "function" { + grid( + columns: col-widths, + column-gutter: gutter, + ..content.enumerate().map(((i, c)) => { + if i < content.len() - 1 { + (c, separator()) + } else { + c + } + }).flatten() + ) + } else { + grid( + columns: col-widths, + column-gutter: gutter, + ..content + ) + } +} + +#let theorem-base( + counter, + prefix, + title: none, + numbered: true, + color: blue.darken(20%), + fill: blue.lighten(95%), + body +) = { + let number = if numbered { counter.step(); context(counter.display()) } + + block( + width: 100%, + fill: fill, + radius: 4pt, + stroke: color.darken(10%), + inset: 0.6em, + )[ + #text(weight: "bold")[#prefix #if numbered {number}] + #if title != none [#text(style: "italic")[#title].] + #v(0.5em) + #body + ] +} + +#let theorem( + title: none, + numbered: true, + color: blue.darken(20%), + ..body +) = { + theorem-base( + theoremCounter, + "Theorem", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let lemma( + title: none, + numbered: true, + color: green.darken(20%), + ..body +) = { + theorem-base( + lemmaCounter, + "Lemma", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let definition( + title: none, + numbered: true, + color: purple.darken(20%), + ..body +) = { + theorem-base( + definitionCounter, + "Definition", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let corollary( + title: none, + numbered: true, + color: orange.darken(20%), + ..body +) = { + theorem-base( + corollaryCounter, + "Corollary", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let example( + title: none, + numbered: true, + color: aqua.darken(20%), + ..body +) = { + theorem-base( + exampleCounter, + "Example", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let proof(body, qed-symbol: "■") = { + block(body) + + let symbol = if qed-symbol == "■" { + text(fill: gray.darken(30%), size: 1.2em, weight: "bold")[■] + } else if qed-symbol == "□" { + text(fill: gray.darken(30%), size: 1.2em, weight: "bold")[□] + } else if qed-symbol == "∎" { + text(fill: gray.darken(30%), size: 1.2em)[∎] + } else if qed-symbol == "Q.E.D." { + text(fill: gray.darken(30%), style: "italic")[Q.E.D.] + } else { + text(fill: gray.darken(30%))[#qed-symbol] + } + + align(right, symbol) +} + +#let problem( + title: "", + color: blue.darken(20%), + numbered: true, + ..body +) = { + if numbered { + [== Problem #problemCounter.step() #context {problemCounter.display()}] + } + + showybox( + frame: ( + border-color: color.darken(10%), + title-color: color.lighten(85%), + body-color: color.lighten(95%) + ), + title-style: ( + color: black, + weight: "bold", + ), + title: title, + ..body + ) +} + +#let homework( + title: "Homework Assignment", + author: "Student Name", + course: "Course Code", + email: "student@school.uni", + date: datetime.today(), + due-date: none, + collaborators: [], + margin-size: 2.5cm, + body +) = { + set document(title: title, author: author) + + set page( + paper: "a4", + margin: (top: margin-size, bottom: margin-size, left: margin-size, right: margin-size), + + header: context { + if counter(page).get().first() > 1 [ + #set text(style: "italic") + #course #h(1fr) #author + #if collaborators != none and type(collaborators) == array and collaborators.len() > 0 { + [w/ #collaborators.join(", ")] + } + #block(line(length: 100%, stroke: 0.5pt), above: 0.6em) + ] + }, + + footer: [ + #align(center)[Page #context counter(page).display() of #context counter(page).final().first()] + ], + ) + + show raw.where(block: true): it => { + block( + width: 100% - 0.5em, + radius: 0.3em, + stroke: luma(50%), + inset: 1em, + fill: luma(98%) + )[ + #show raw.line: l => context { + box( + width: measure([#it.lines.last().count]).width, + align(right, text(fill: luma(50%))[#l.number]) + ) + h(0.5em) + l.body + } + #it + ] + } + + show ref: it => { + let element = it.element + let loc = it.location() + + if element == none { + return it + } + + if element.func() == heading and element.level == 2 { + [Problem #it.number] + } else if element.func() == theorem { + [Theorem #it.number] + } else if element.func() == lemma { + [Lemma #it.number] + } else if element.func() == definition { + [Definition #it.number] + } else if element.func() == corollary { + [Corollary #it.number] + } else if element.func() == example { + [Example #it.number] + } else { + it + } + } + + align( + center, + { + text(size: 1.6em, weight: "bold")[#course -- #title \ ] + + text(size: 1.2em, weight: "semibold")[#author \ ] + + raw(email); linebreak() + + emph[#date.display("[month repr:long] [day], [year]")] + + box(line(length: 100%, stroke: 1pt)) + }, + ) + + set heading( + numbering: (..nums) => { + nums = nums.pos() + if nums.len() == 1 { + [Problem #nums.at(0):] + } + else if nums.len() > 2 { + [Part (#numbering("a", nums.at(1))):] + } + }, + ) + + body +} diff --git a/packages/preview/axiomst/0.1.0/template/main.typ b/packages/preview/axiomst/0.1.0/template/main.typ new file mode 100644 index 0000000000..73681770d7 --- /dev/null +++ b/packages/preview/axiomst/0.1.0/template/main.typ @@ -0,0 +1,139 @@ +#import "../src/lib.typ": * + +#show: homework.with( + title: "Stochastic Differential Equations and (Deep) Generative Models", + author: "Reza Rezvan", + email: "rezvan@school.com", + course: "SDE 101", + date: datetime.today(), +) + +#set math.equation(numbering: "(1)") +#set enum(numbering: "1)") +#set text(font: "New Computer Modern") + +#definition(title: "Definition of SDEs")[ + A stochastic differential equation (SDE) is an equation that describes the evolution of a random process over time. + + The general form of an SDE can be written as, + + $ + d x(t) = underbrace((x(t), t), "drift") thin d t + underbrace(L(x(t), t), "diffusion") d beta(t), + $ + + where, + + - $x(t)$ is the random process, + - $f(x(t), t)$ is the drift term (deterministic part), + - $L(x(t), t)$ is the diffusion term (stochastic part), + - $d beta(t)$ is standard Brownian motion (Wiener process), +] + +#problem(title: "Vector Spaces and Subspaces")[ + Let $V$ be a vector space over a field $F$. Prove the following properties: + + 1. The zero vector $0_V$ is unique. + 2. For each $v in V$, the additive inverse $-v$ is unique. + 3. If $a in F$ and $a dot v = 0_V$ for some $v in V$, then either $a = 0$ or $v = 0_V$. +] + +*1. Uniqueness of the zero vector:* + +#theorem(title: "Uniqueness of Zero Vector")[ + In any vector space $V$, the zero vector $0_V$ is unique. +] + +#proof[ + Suppose there exist two zero vectors, $0_V$ and $0'_V$. By definition of a zero vector: + $0_V + 0'_V = 0'_V$ (since $0_V$ is a zero vector) + $0_V + 0'_V = 0_V$ (since $0'_V$ is a zero vector) + + Therefore, $0_V = 0'_V$, proving that the zero vector is unique. +] + +*2. Uniqueness of the additive inverse:* + +#lemma(title: "Uniqueness of Additive Inverse")[ + For each vector $v$ in a vector space $V$, the additive inverse $-v$ is unique. +] + +#proof[ + Suppose $v in V$ has two additive inverses, $w$ and $w'$. Then: + $v + w = 0_V$ and $v + w' = 0_V$ + + Adding $w$ to both sides of the second equation: + + $w + (v + w') = w + 0_V$ + $(w + v) + w' = w$ + $0_V + w' = w$ + $w' = w$ + + Therefore, the additive inverse is unique. +] + +#pagebreak() +#problem(title: "Comparison of Different Vector Space Properties")[ + Compare and contrast the following vector spaces. +] + +#columns(count: 2)[ + #definition(title: "Real Vector Spaces")[ + A vector space over the field of real numbers $RR$. + + *Properties:* + - Contains real-valued vectors + - Operations: addition and scalar multiplication by real numbers + - Examples: $RR^n$, continuous functions on an interval + ] +][ + #definition(title: "Complex Vector Spaces")[ + A vector space over the field of complex numbers $CC$. + + *Properties:* + - Contains complex-valued vectors + - Operations: addition and scalar multiplication by complex numbers + - Examples: $CC^n$, analytic functions + ] +] + +#pagebreak() +#problem(title: "Linear Transformations")[ + Explore the properties of linear transformations between vector spaces. +] + +#theorem(title: "Rank-Nullity Theorem")[ + Let $T: V -> W$ be a linear transformation between finite-dimensional vector spaces. Then: + + $"dim"("ker"(T)) + "di"("im"(T)) = "dim"(V)$ +] + +#proof[ + Let $K = "ker"(T)$ and let $\{v_1, v_2, ..., v_k\}$ be a basis for $K$. + + Extend this to a basis $\{v_1, ..., v_k, v_(k+1), ..., v_n\}$ for $V$. + + We claim that $\{T(v_(k+1)), ..., T(v_n)\}$ is a basis for $"im"(T)$. + + For linear independence, suppose $sum_(i=k+1)^n a_i T(v_i) = 0$. Then $T(sum_(i=k+1)^n a_i v_i) = 0$, which means $sum_(i=k+1)^n a_i v_i \in K$. + + This implies $sum_(i=k+1)^n a_i v_i = sum_(j=1)^k b_j v_j$ for some scalars $b_j$. + + By the linear independence of the basis of $V$, all coefficients must be zero. So $\{T(v_(k+1)), ..., T(v_n)\}$ is linearly independent. + + For spanning, any $w in "im"(T)$ can be written as $w = T(v)$ for some $v in V$. We can write $v = sum_(i=1)^n c_i v_i$. Since $T(v_1) = ... = T(v_k) = 0$, we have $w = sum_(i=k+1)^n c_i T(v_i)$. + + Thus, $"dim"("im"(T)) = n - k = "dim"(V) - "dim"("ker"(T))$. +] + +#columns(count: 2)[ + #corollary(title: "Injective Case")[ + If $T$ is injective, then $"ker"(T) = \{0\}$, so $"dim"("im"(T)) = "dim"(V)$. + + This means $T$ preserves dimension. + ] +][ + #corollary(title: "Surjective Case")[ + If $T$ is surjective, then $"im"(T) = W$, so $"dim"("ker"(T)) = "dim"(V) - "dim"(W)$. + If $"dim"(V) < "dim"(W)$, then $T$ cannot be surjective. + ] +] diff --git a/packages/preview/axiomst/0.1.0/typst.toml b/packages/preview/axiomst/0.1.0/typst.toml new file mode 100644 index 0000000000..b81168b585 --- /dev/null +++ b/packages/preview/axiomst/0.1.0/typst.toml @@ -0,0 +1,16 @@ +[package] +name = "axiomst" +version = "0.1.0" +entrypoint = "src/lib.typ" +authors = ["Reza Rezvan "] +license = "MIT" +description = "A clean, elegant template for academic problem sets and homework assignments." +repository = "https://github.com/rezaarezvan/axiomst" +keywords = ["homework", "problem set", "assignment", "academic", "template"] +categories = ["report"] +compiler = "0.10.0" + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnail.png" diff --git a/src/lib.typ b/src/lib.typ new file mode 100644 index 0000000000..6656f9f78c --- /dev/null +++ b/src/lib.typ @@ -0,0 +1,322 @@ +// axiomst: A clean, elegant template for academic problem sets and homework assignments +#import "@preview/showybox:2.0.4": showybox + +#let problemCounter = counter("problem") +#let theoremCounter = counter("theorem") +#let definitionCounter = counter("definition") +#let lemmaCounter = counter("lemma") +#let corollaryCounter = counter("corollary") +#let exampleCounter = counter("example") +#let algorithmCounter = counter("algorithm") + +#let columns( + count: 2, + gutter: 1em, + separator: none, + widths: none, + ..children, +) = { + let content = children.pos() + + let col-widths = () + if widths == none { + let available-width = 100% - gutter * (count - 1) + let column-width = available-width / count + col-widths = (column-width,) * count + } else { + col-widths = widths + } + + if separator == "line" { + grid( + columns: col-widths, + column-gutter: gutter, + ..content.enumerate().map(((i, c)) => { + if i < content.len() - 1 { + (c, line(angle: 90deg, length: 100%, stroke: (thickness: 0.5pt, dash: "solid"))) + } else { + c + } + }).flatten() + ) + } else if separator != none and type(separator) == "function" { + grid( + columns: col-widths, + column-gutter: gutter, + ..content.enumerate().map(((i, c)) => { + if i < content.len() - 1 { + (c, separator()) + } else { + c + } + }).flatten() + ) + } else { + grid( + columns: col-widths, + column-gutter: gutter, + ..content + ) + } +} + +#let theorem-base( + counter, + prefix, + title: none, + numbered: true, + color: blue.darken(20%), + fill: blue.lighten(95%), + body +) = { + let number = if numbered { counter.step(); context(counter.display()) } + + block( + width: 100%, + fill: fill, + radius: 4pt, + stroke: color.darken(10%), + inset: 0.6em, + )[ + #text(weight: "bold")[#prefix #if numbered {number}] + #if title != none [#text(style: "italic")[#title].] + #v(0.5em) + #body + ] +} + +#let theorem( + title: none, + numbered: true, + color: blue.darken(20%), + ..body +) = { + theorem-base( + theoremCounter, + "Theorem", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let lemma( + title: none, + numbered: true, + color: green.darken(20%), + ..body +) = { + theorem-base( + lemmaCounter, + "Lemma", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let definition( + title: none, + numbered: true, + color: purple.darken(20%), + ..body +) = { + theorem-base( + definitionCounter, + "Definition", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let corollary( + title: none, + numbered: true, + color: orange.darken(20%), + ..body +) = { + theorem-base( + corollaryCounter, + "Corollary", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let example( + title: none, + numbered: true, + color: aqua.darken(20%), + ..body +) = { + theorem-base( + exampleCounter, + "Example", + title: title, + numbered: numbered, + color: color, + fill: color.lighten(95%), + ..body + ) +} + +#let proof(body, qed-symbol: "■") = { + block(body) + + let symbol = if qed-symbol == "■" { + text(fill: gray.darken(30%), size: 1.2em, weight: "bold")[■] + } else if qed-symbol == "□" { + text(fill: gray.darken(30%), size: 1.2em, weight: "bold")[□] + } else if qed-symbol == "∎" { + text(fill: gray.darken(30%), size: 1.2em)[∎] + } else if qed-symbol == "Q.E.D." { + text(fill: gray.darken(30%), style: "italic")[Q.E.D.] + } else { + text(fill: gray.darken(30%))[#qed-symbol] + } + + align(right, symbol) +} + +#let problem( + title: "", + color: blue.darken(20%), + numbered: true, + ..body +) = { + if numbered { + [== Problem #problemCounter.step() #context {problemCounter.display()}] + } + + showybox( + frame: ( + border-color: color.darken(10%), + title-color: color.lighten(85%), + body-color: color.lighten(95%) + ), + title-style: ( + color: black, + weight: "bold", + ), + title: title, + ..body + ) +} + +#let homework( + title: "Homework Assignment", + author: "Student Name", + course: "Course Code", + email: "student@school.uni", + date: datetime.today(), + due-date: none, + collaborators: [], + margin-size: 2.5cm, + body +) = { + set document(title: title, author: author) + + set page( + paper: "a4", + margin: (top: margin-size, bottom: margin-size, left: margin-size, right: margin-size), + + header: context { + if counter(page).get().first() > 1 [ + #set text(style: "italic") + #course #h(1fr) #author + #if collaborators != none and type(collaborators) == array and collaborators.len() > 0 { + [w/ #collaborators.join(", ")] + } + #block(line(length: 100%, stroke: 0.5pt), above: 0.6em) + ] + }, + + footer: [ + #align(center)[Page #context counter(page).display() of #context counter(page).final().first()] + ], + ) + + show raw.where(block: true): it => { + block( + width: 100% - 0.5em, + radius: 0.3em, + stroke: luma(50%), + inset: 1em, + fill: luma(98%) + )[ + #show raw.line: l => context { + box( + width: measure([#it.lines.last().count]).width, + align(right, text(fill: luma(50%))[#l.number]) + ) + h(0.5em) + l.body + } + #it + ] + } + + show ref: it => { + let element = it.element + let loc = it.location() + + if element == none { + return it + } + + if element.func() == heading and element.level == 2 { + [Problem #it.number] + } else if element.func() == theorem { + [Theorem #it.number] + } else if element.func() == lemma { + [Lemma #it.number] + } else if element.func() == definition { + [Definition #it.number] + } else if element.func() == corollary { + [Corollary #it.number] + } else if element.func() == example { + [Example #it.number] + } else { + it + } + } + + align( + center, + { + text(size: 1.6em, weight: "bold")[#course -- #title \ ] + + text(size: 1.2em, weight: "semibold")[#author \ ] + + raw(email); linebreak() + + emph[#date.display("[month repr:long] [day], [year]")] + + box(line(length: 100%, stroke: 1pt)) + }, + ) + + set heading( + numbering: (..nums) => { + nums = nums.pos() + if nums.len() == 1 { + [Problem #nums.at(0):] + } + else if nums.len() > 2 { + [Part (#numbering("a", nums.at(1))):] + } + }, + ) + + body +} diff --git a/template/main.typ b/template/main.typ new file mode 100644 index 0000000000..73681770d7 --- /dev/null +++ b/template/main.typ @@ -0,0 +1,139 @@ +#import "../src/lib.typ": * + +#show: homework.with( + title: "Stochastic Differential Equations and (Deep) Generative Models", + author: "Reza Rezvan", + email: "rezvan@school.com", + course: "SDE 101", + date: datetime.today(), +) + +#set math.equation(numbering: "(1)") +#set enum(numbering: "1)") +#set text(font: "New Computer Modern") + +#definition(title: "Definition of SDEs")[ + A stochastic differential equation (SDE) is an equation that describes the evolution of a random process over time. + + The general form of an SDE can be written as, + + $ + d x(t) = underbrace((x(t), t), "drift") thin d t + underbrace(L(x(t), t), "diffusion") d beta(t), + $ + + where, + + - $x(t)$ is the random process, + - $f(x(t), t)$ is the drift term (deterministic part), + - $L(x(t), t)$ is the diffusion term (stochastic part), + - $d beta(t)$ is standard Brownian motion (Wiener process), +] + +#problem(title: "Vector Spaces and Subspaces")[ + Let $V$ be a vector space over a field $F$. Prove the following properties: + + 1. The zero vector $0_V$ is unique. + 2. For each $v in V$, the additive inverse $-v$ is unique. + 3. If $a in F$ and $a dot v = 0_V$ for some $v in V$, then either $a = 0$ or $v = 0_V$. +] + +*1. Uniqueness of the zero vector:* + +#theorem(title: "Uniqueness of Zero Vector")[ + In any vector space $V$, the zero vector $0_V$ is unique. +] + +#proof[ + Suppose there exist two zero vectors, $0_V$ and $0'_V$. By definition of a zero vector: + $0_V + 0'_V = 0'_V$ (since $0_V$ is a zero vector) + $0_V + 0'_V = 0_V$ (since $0'_V$ is a zero vector) + + Therefore, $0_V = 0'_V$, proving that the zero vector is unique. +] + +*2. Uniqueness of the additive inverse:* + +#lemma(title: "Uniqueness of Additive Inverse")[ + For each vector $v$ in a vector space $V$, the additive inverse $-v$ is unique. +] + +#proof[ + Suppose $v in V$ has two additive inverses, $w$ and $w'$. Then: + $v + w = 0_V$ and $v + w' = 0_V$ + + Adding $w$ to both sides of the second equation: + + $w + (v + w') = w + 0_V$ + $(w + v) + w' = w$ + $0_V + w' = w$ + $w' = w$ + + Therefore, the additive inverse is unique. +] + +#pagebreak() +#problem(title: "Comparison of Different Vector Space Properties")[ + Compare and contrast the following vector spaces. +] + +#columns(count: 2)[ + #definition(title: "Real Vector Spaces")[ + A vector space over the field of real numbers $RR$. + + *Properties:* + - Contains real-valued vectors + - Operations: addition and scalar multiplication by real numbers + - Examples: $RR^n$, continuous functions on an interval + ] +][ + #definition(title: "Complex Vector Spaces")[ + A vector space over the field of complex numbers $CC$. + + *Properties:* + - Contains complex-valued vectors + - Operations: addition and scalar multiplication by complex numbers + - Examples: $CC^n$, analytic functions + ] +] + +#pagebreak() +#problem(title: "Linear Transformations")[ + Explore the properties of linear transformations between vector spaces. +] + +#theorem(title: "Rank-Nullity Theorem")[ + Let $T: V -> W$ be a linear transformation between finite-dimensional vector spaces. Then: + + $"dim"("ker"(T)) + "di"("im"(T)) = "dim"(V)$ +] + +#proof[ + Let $K = "ker"(T)$ and let $\{v_1, v_2, ..., v_k\}$ be a basis for $K$. + + Extend this to a basis $\{v_1, ..., v_k, v_(k+1), ..., v_n\}$ for $V$. + + We claim that $\{T(v_(k+1)), ..., T(v_n)\}$ is a basis for $"im"(T)$. + + For linear independence, suppose $sum_(i=k+1)^n a_i T(v_i) = 0$. Then $T(sum_(i=k+1)^n a_i v_i) = 0$, which means $sum_(i=k+1)^n a_i v_i \in K$. + + This implies $sum_(i=k+1)^n a_i v_i = sum_(j=1)^k b_j v_j$ for some scalars $b_j$. + + By the linear independence of the basis of $V$, all coefficients must be zero. So $\{T(v_(k+1)), ..., T(v_n)\}$ is linearly independent. + + For spanning, any $w in "im"(T)$ can be written as $w = T(v)$ for some $v in V$. We can write $v = sum_(i=1)^n c_i v_i$. Since $T(v_1) = ... = T(v_k) = 0$, we have $w = sum_(i=k+1)^n c_i T(v_i)$. + + Thus, $"dim"("im"(T)) = n - k = "dim"(V) - "dim"("ker"(T))$. +] + +#columns(count: 2)[ + #corollary(title: "Injective Case")[ + If $T$ is injective, then $"ker"(T) = \{0\}$, so $"dim"("im"(T)) = "dim"(V)$. + + This means $T$ preserves dimension. + ] +][ + #corollary(title: "Surjective Case")[ + If $T$ is surjective, then $"im"(T) = W$, so $"dim"("ker"(T)) = "dim"(V) - "dim"(W)$. + If $"dim"(V) < "dim"(W)$, then $T$ cannot be surjective. + ] +]