Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/preview/bubble-sysu/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Langxi Yuan <yuanlx27@mail2.sysu.edu.cn>

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.
67 changes: 67 additions & 0 deletions packages/preview/bubble-sysu/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# bubble-sysu

A Typst template for reports at Sun Yat-sen University.

## Usage

Install required fonts from links below or from [release](https://github.com/yuanlx27/bubble-sysu/releases/tag/v0.1.0).

Create a new project from this template with the Typst CLI:

```sh
typst init @preview/bubble-sysu:0.1.0
```

Or import the template in an existing Typst document:

```typst
#import "@preview/bubble-sysu:0.1.0": *

#show: report.with(
title: "实验一:词法分析",
subtitle: "编译原理实验报告",
student: (name: "张三", id: "23330101"),
school: "计算机学院",
major: "计算机科学与技术",
class: "计八班",
)
```

## Template Parameters

The `report` template accepts the following parameters:

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `title` | `str` | `"标题"` | Main title shown on the cover page. |
| `subtitle` | `str` | `"副标题"` | Subtitle shown below the main title. |
| `student` | `dictionary` | `(name: "姓名", id: "学号")` | Student information displayed on the cover page. |
| `school` | `str` | `"学院"` | School name. |
| `major` | `str` | `"专业"` | Major name. |
| `class` | `str` | `"班级"` | Class name. |
| `date` | `datetime` | `datetime.today()` | Date shown on the cover page. |
| `logo` | `bool` | `true` | Whether to display the university logo. |
| `accent-color` | `color` | `rgb(0, 86, 32)` | Main decorative color used on the cover page. |
| `alpha` | `ratio` | `60%` | Opacity used when mixing the secondary decorative color. |
| `body` | `content` | — | Report body content. |

## Features

- Cover page tailored for Sun Yat-sen University reports
- Chinese heading numbering style for top-level headings
- Built-in styles for links, inline code, and code blocks
- Configurable accent color and optional university logo

## Fonts

This template uses the following fonts:

- [`ChillKai`](https://github.com/Warren2060/Chillkai)
- [`Maple Mono NFMono`](https://github.com/johnsmith0x3f/maple-mono-custom)
- [`Noto Serif CJK SC`](https://github.com/notofonts/noto-cjk)

Make sure they are installed on your system for the intended appearance.

## License

This project is licensed under the MIT License.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also true for the logo you ship? If not, can you specify under which terms it is distributed and can be used, please? And in case you are not allowed by the university to re-distribute it as part of a template, can you replace it with placeholder content and add instructions on how to manually import the logo (which would require a new parameter to allow the user to pass arbitrary content as a logo).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder, I'll check it now.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/preview/bubble-sysu/0.1.0/src/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import "report.typ": report
97 changes: 97 additions & 0 deletions packages/preview/bubble-sysu/0.1.0/src/report.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#let report(
title: "标题",
subtitle: "副标题",
student: (name: "姓名", id: "学号"),
school: "学院",
major: "专业",
class: "班级",
date: datetime.today(),
logo: true,
accent-color: rgb(0, 86, 32),
alpha: 60%,
body,
) = {
set document(
author: student.name,
title: title,
)

set heading(numbering: (..nums) => {
let nums = nums.pos()

if nums.len() == 1 {
numbering("一", ..nums)
} else {
numbering("1.1", ..nums)
}
})

set par(justify: true)

set text(
font: "Noto Serif CJK SC",
lang: "zh",
size: 12pt,
)

show link: set text(fill: blue)

show raw: set text(
font: "Maple Mono NFMono",
features: ("cv01", "cv02", "cv04"),
)
show raw.where(block: true): it => block(
fill: luma(90%),
inset: 1em,
radius: 0.2em,
width: 100%,
it,
)
show raw.where(block: false): it => box(
fill: luma(90%),
inset: (x: 0.2em),
outset: (y: 0.2em),
radius: 0.2em,
it,
)

let primary-color = accent-color
let secondary-color = color.mix(color.rgb(100%, 100%, 100%, alpha), primary-color, space:rgb)

page({
if logo == true {
place(top + right, image("../assets/images/logo.png", width: 40%))
}
place(top + left, dx: -35%, dy: -28%, circle(radius: 150pt, fill: primary-color))
place(top + left, dx: -10%, circle(radius: 75pt, fill: secondary-color))
place(bottom + right, dx: 40%, dy: 30%, circle(radius: 150pt, fill: secondary-color))

set align(center)

v(2fr)

text(size: 3em, weight: "bold", title)

v(0em)

text(size: 2em, weight: "bold", subtitle)

v(0em)

text(size: 1.2em, date.display())

v(2fr)

text(font: "ChillKai", size: 1.5em, weight: "bold", student.name + " " + student.id)

v(0em)

text(font: "ChillKai", size: 1.2em, school + " " + major)

v(0em)

text(font: "ChillKai", size: 1.2em, class)
})

body
}
10 changes: 10 additions & 0 deletions packages/preview/bubble-sysu/0.1.0/template/main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#import "@preview/bubble-sysu:0.1.0": *

#show: report.with(
title: "实验一:词法分析",
subtitle: "编译原理实验报告",
student: (name: "张三", id: "23330101"),
school: "计算机学院",
major: "计算机科学与技术",
class: "计八班",
)
Binary file added packages/preview/bubble-sysu/0.1.0/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions packages/preview/bubble-sysu/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "bubble-sysu"
version = "0.1.0"
entrypoint = "src/lib.typ"
authors = ["Langxi Yuan <yuanlx27@mail2.sysu.edu.cn>"]
license = "MIT"
description = "Reports at Sun Yat-Sen University."
keywords = ["sysu"]
categories = ["report"]

[template]
path = "template"
entrypoint = "main.typ"
thumbnail = "thumbnail.png"
Loading