Repository: typst/packages
Pull request #2349: may:0.0.1
Author: login: Carlos-Mero
Labels: name: new
description: A new package submission.
Created: 2025-05-11T07:52:04Z | Merged: 2025-05-15T08:03:16Z

<!--
Thanks for submitting a package! Please read and follow the submission guidelines detailed in the repository's README and check the boxes below. Please name your PR as `name:version` of the submitted package.

If you want to make a PR for something other than a package submission, just delete all this and make a plain PR.
-->

I am submitting
- [x] a new package
- [ ] an update for a package

<!--
Please add a brief description of your package below and explain why you think it is useful to others. If this is an update, please briefly say what changed.
-->

Description: This is a simple typst template designed that I have personally used for months in my daily work. Recently some of my friends asked me how to integrate this template into their own projects. I think others might be interested in this simple stylish dataset as well. So, to make this template more accessible, I decided to create a PR to make this an official package, and put in more efforts to maintain this package.

<!--
These things need to be checked for a new submission to be merged. If you're just submitting an update, you can delete the following section.
-->

I have read and followed the submission guidelines and, in particular, I
- [x] selected a name that isn't the most obvious or canonical name for what the package does
- [x] added a `typst.toml` file with all required keys
- [x] added a `README.md` with documentation for my package
- [x] have chosen a license and added a `LICENSE` file or linked one in my `README.md`
- [x] tested my package locally on my system and it worked
- [x] `exclude`d PDFs or README images, if any, but not the LICENSE

<!--
The following box only needs to be checked for **template** submissions. If you're submitting a package that isn't a template, you can delete the following section. See the guidelines section about licenses in the README for more details.
-->
- [x] ensured that my package is licensed such that users can use and distribute the contents of its template directory without restriction, after modifying them through normal use.



Diff:
diff --git a/packages/preview/may/0.0.1/LICENSE b/packages/preview/may/0.0.1/LICENSE
new file mode 100644
index 0000000000..81de65b50a
--- /dev/null
+++ b/packages/preview/may/0.0.1/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 Carlos-Mero
+
+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/may/0.0.1/README.md b/packages/preview/may/0.0.1/README.md
new file mode 100644
index 0000000000..f748e9d241
--- /dev/null
+++ b/packages/preview/may/0.0.1/README.md
@@ -0,0 +1,42 @@
+# May
+
+A simple and elegant document template for multiple daily tasks.
+
+## Usage
+
+This is my personal typst template designedfor homework, report or some other documents. You can obtain the same styles of this template by simply adding the follows two lines at the top of your document:
+
+```typst
+#import "@preview/may:0.0.1": *
+#show: may-sans
+// ...
+// Your typst documents here
+```
+
+Alternatively you can also initialize a project with _may_ by running the following command:
+
+```sh
+typst init @preview/may
+```
+
+This will create a new folder named `may` in the current path, along with a sample file `main.typ` as the start point.
+
+## Tips
+
+It is recommanded to use this template along with to following fonts.
+
+* [Libertinus](https://github.com/alerque/libertinus) for latin main body.
+* [Maple Mono](https://github.com/subframe7536/maple-font) for codeblocks.
+* [霞鹜文楷](https://github.com/lxgw/LxgwWenKai) for Chinese characters.
+
+These are all open-sourced fonts of high quality. You can also use other fonts you prefer, by simply adding this line after the `show` command:
+
+```typst
+#set text(font: "FontName")
+```
+
+You are welcomed to create new PRs to this repository and help improve this template.
+
+## Show Case
+
+![thumbnail of may_sans template](./thumbnail.png)
diff --git a/packages/preview/may/0.0.1/may.typ b/packages/preview/may/0.0.1/may.typ
new file mode 100644
index 0000000000..0943a040e4
--- /dev/null
+++ b/packages/preview/may/0.0.1/may.typ
@@ -0,0 +1,203 @@
+// package dependancies and show rules
+#import "@preview/physica:0.9.5": *
+#import "@preview/wrap-it:0.1.1": wrap-content
+
+#show: super-T-as-transpose
+
+#let _may(doc) = [
+
+  // Page Configuration
+  #let sea = rgb("#3b60a0")
+  #let sky = rgb("#bdd0f1")
+  #let skyl = rgb("#eff3ff")
+  #let skyll = rgb("#f4f9ff")
+  #let paper = rgb("#f5f6f8")
+  #set page(
+    paper: "a5",
+    columns: 1,
+    margin: (x: 1cm, y: 1cm),
+    numbering: "- 1/1 -"
+  )
+  #show raw: it => {
+    set text(font: "Maple Mono", size: 2.96mm)
+    block(
+      width: 100%,
+      height: auto,
+      fill: skyll,
+      inset: 2.1mm,
+      radius: 1.7mm,
+      it
+    )
+  }
+  #set par(
+    justify: true,
+  )
+
+  // Links
+  #show link: underline
+  #show link: it => {
+    set text(fill: sea)
+    it
+  }
+
+  // Quote / Terms
+  #show ">|": it => [
+    #box(baseline: 1.34mm, rect(width: 0.9mm, height: 4.9mm, fill: sea))
+    #h(2.3mm)
+  ]
+
+  // Headings
+  #let subline() = {v(-4.53mm); line(length: 100%, stroke: sea); v(-0.7mm)}
+  #show heading.where(
+    level: 1
+  ): it => [
+    #set align(center)
+    #set text(
+      fill: sea,
+      size: 6.3mm,
+      weight: "bold",
+      style: "normal",
+    )
+    #it.body
+    #subline()
+  ]
+  #show heading.where(
+    level: 2
+  ): it => [
+    #set text(
+      fill: sea,
+      size: 5.5mm,
+      weight: "bold",
+      style: "normal",
+    )
+    #it.body
+    #subline()
+  ]
+  #show heading.where(
+    level: 3
+  ): it => [
+    #set text(
+      fill: sea,
+      size: 4.8mm,
+      weight: "bold",
+      style: "normal",
+    )
+    #it.body
+    #subline()
+  ]
+  #show heading.where(
+    level: 4
+  ): it => text(
+    fill: sea,
+    size: 4.45mm,
+    weight: "bold",
+    style: "normal",
+    it.body
+  )
+  #show heading.where(
+    level: 5
+  ): it => text(
+    fill: sea,
+    size: 4.01mm,
+    weight: "bold",
+    style: "normal",
+    it.body
+  )
+  #show heading.where(
+    level: 6
+  ): it => text(
+    fill: sea,
+    size: 3.7mm,
+    weight: "bold",
+    style: "normal",
+    it.body
+  )
+
+  // Detail Decoration
+  #show "->": it => [
+    #math.limits(it)
+  ]
+  #show "-->": it => [
+    #math.limits(it)
+  ]
+  #show "<--": it => [
+    #math.limits(it)
+  ]
+  #show "<-": it => [
+    #math.limits(it)
+  ]
+  #show "=>": it => [
+    #math.limits(it)
+  ]
+  #show "==>": it => [
+    #math.limits(it)
+  ]
+  #show "<=": it => [
+    #math.limits(it)
+  ]
+  #show "<==": it => [
+    #math.limits(it)
+  ]
+  #show "<=>": it => [
+    #math.limits(it)
+  ]
+  #show "<==>": it => [
+    #math.limits(it)
+  ]
+
+  #set table(
+    stroke: none,
+    gutter: 0.2em,
+    align: center,
+    fill: (x, y) => if y == 0 {sea},
+    // inset: (right: 1.5em)
+  )
+  #show table.cell: it => {
+    if it.y == 0 {
+    set text(white)
+    strong(it)
+  } else {it}
+  }
+
+  #doc
+]
+
+#let may(doc) = [
+  #set text(
+    font: ("PingFang SC"),
+    lang: "zh",
+    size: 3.56mm,
+    weight: "regular",
+    style: "normal",
+  )
+  #_may(doc)
+]
+
+#let may-serif(doc) = [
+  #set text(
+    font: ("Libertinus Serif", "LXGW Neo ZhiSong"),
+    lang: "zh",
+    size: 3.56mm,
+    weight: "regular",
+    style: "normal",
+  )
+  // #show math.equation: set text(font: "Libertinus Math")
+  #_may(doc)
+]
+
+#let may-sans(doc) = [
+  #set text(
+    font: ("Libertinus Sans", "LXGW Wenkai"),
+    lang: "zh",
+    size: 3.56mm,
+    weight: "regular",
+    style: "normal",
+  )
+  // #show math.equation: set text(font: "Libertinus Math")
+  #_may(doc)
+]
+
+// information item
+#let info(something, description) = [
+  *#something* #h(1fr) *#description*\
+]
diff --git a/packages/preview/may/0.0.1/template/main.typ b/packages/preview/may/0.0.1/template/main.typ
new file mode 100644
index 0000000000..72d5f3a13b
--- /dev/null
+++ b/packages/preview/may/0.0.1/template/main.typ
@@ -0,0 +1,50 @@
+#import "@preview/may:0.0.1": *
+#show: may-sans
+// Some other variants
+// #show: may
+// #show: may-serif
+
+= May
+
+>| A simple and elegant template for multiple daily tasks
+
+#lorem(24)
+
+== Tables and Wraps
+
+#wrap-content(
+  figure(table(
+    columns: 3,
+    "Benchmark", "A/%", "B/%",
+    table.hline(),
+    "jo", "13.3", "33.2",
+    "jojo", "11.1", "28.3",
+    "ours", "100.0", "100.0",
+    table.hline()
+  ), caption: [A sample table, ours is the best.]),
+  lorem(60),
+  align: right
+)
+
+== Codeblocks and Formulas
+
+$
+vb(x)_(t+1) &= sqrt(macron(alpha)_t) vb(x)_0 + sqrt(1 - macron(alpha)_t) vb(epsilon) quad &"Forward"\
+vb(x)_(t-1) &= 1/sqrt(1 - beta_t) (vb(x)_t - (beta_t)/sqrt(1 - macron(alpha)_t) vb(epsilon)_theta (vb(x)_t, t)) + sqrt(beta_t) vb(epsilon) quad &"Backward"
+$
+
+```python
+# DDPM step
+def p_sample_ddpm(self, model: nn.Module, x_t: torch.Tensor, t: torch.Tensor):
+    eps = model(x_t, t)
+    beta_t = self.betas[t][:, None, None, None]
+    alpha_t = self.alphas[t][:, None, None, None]
+    alpha_bar_t = self.alpha_bars[t][:, None, None, None]
+    sqrt_one_minus_alpha_bar_t = self.sqrt_one_minus_alpha_bars[t][:, None, None, None]
+    mean = 1 / torch.sqrt(alpha_t) * (x_t - beta_t / sqrt_one_minus_alpha_bar_t * eps)
+    if (t == 0).all():
+        return mean
+    noise = torch.randn_like(x_t)
+    sigma = torch.sqrt(beta_t)
+    return mean + sigma * noise
+```
diff --git a/packages/preview/may/0.0.1/thumbnail.png b/packages/preview/may/0.0.1/thumbnail.png
new file mode 100644
index 0000000000..c4ea371c61
Binary files /dev/null and b/packages/preview/may/0.0.1/thumbnail.png differ
diff --git a/packages/preview/may/0.0.1/typst.toml b/packages/preview/may/0.0.1/typst.toml
new file mode 100644
index 0000000000..e243ecc81d
--- /dev/null
+++ b/packages/preview/may/0.0.1/typst.toml
@@ -0,0 +1,14 @@
+[package]
+name = "may"
+version = "0.0.1"
+entrypoint = "may.typ"
+authors = ["Carlos-Mero <https://github.com/Carlos-Mero>"]
+license = "MIT"
+repository = "https://github.com/Carlos-Mero/may"
+description = "A simple and elegant document template for multiple daily tasks."
+categories = ["office", "report"]
+
+[template]
+path = "template"
+entrypoint = "main.typ"
+thumbnail = "thumbnail.png"


Reviews:
user: login: elegaanz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-14T15:34:10Z

Review comments:
diff_hunk: @@ -0,0 +1,15 @@
+[package]
+name = "may"
+version = "0.0.1"
+entrypoint = "may.typ"
+authors = ["Carlos-Mero <https://github.com/Carlos-Mero>"]
+license = "MIT"
+repository = "https://github.com/Carlos-Mero/may"
+description = "A simple and elegant document template for multiple daily tasks."
+categories = ["office", "report"]
+exclude = ["thumbnail.png"]
path: packages/preview/may/0.0.1/typst.toml
user: login: elegaanz
body: For info the thumbnail is automatically excluded.
created_at: 2025-05-14T15:33:31Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,42 @@
+# May
+
+A simple and elegant document template for multiple daily tasks.
+
+## Usage
+
+This is my personal typst template designedfor homework, report or some other documents. You can obtain the same styles of this template by simply adding the follows two lines at the top of your document:
+
+```typst
+#import "@preview/may:0.0.1": *
+#show: may_sans
+// ...
+// Your typst documents here
+```
+
+Alternatively you can also initialize a project with _may_ by running the following command:
+
+```sh
+typst init @preview/may
+```
+
+This will create a new folder named `may` in the current path, along with a sample file `main.typ` as the start point.
+
+## Tips
+
+It is recommanded to use this template along with to following fonts.
+
+* [Libertinus](https://github.com/alerque/libertinus) for latin main body.
+* [Maple Mono](https://github.com/subframe7536/maple-font) for codeblocks.
+* [霞鹜文楷](https://github.com/lxgw/LxgwWenKai) for Chinese characters.
+
+These are all open-sourced fonts of high quality. You can also use other fonts you prefer, by simply adding this line after the `show` command:
+
+```typst
+#set text(font: "FontName")
+```
+
+You are welcomed to create new PRs to this repository and help improve this template.
+
+## Show Case
+
+![](./thumbnail.png)
path: packages/preview/may/0.0.1/README.md
user: login: elegaanz
body: Adding a brief alternative text here would be nice for accessibility and SEO reasons.
created_at: 2025-05-14T15:34:00Z
author_association: MEMBER

PR comments:
user: login: elegaanz
created_at: 2025-05-14T15:33:07Z
body: It would be nice if you could fix the three warnings that have reported by CI. Other than that I think your template looks good and is ready to be merged!
author_association: MEMBER
user: login: Carlos-Mero
created_at: 2025-05-15T05:49:47Z
body: > It would be nice if you could fix the three warnings that have reported by CI. Other than that I think your template looks good and is ready to be merged!

Thank you for your review! I have already resolved the warnings reported by CI and other flaws.
author_association: CONTRIBUTOR
user: login: elegaanz
created_at: 2025-05-15T08:03:13Z
body: Great, thank you!
author_association: MEMBER