diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/LICENSE b/packages/preview/unofficial-whu-lab-report/0.1.1/LICENSE new file mode 100644 index 0000000000..bf4ce50584 --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Shouzhuo Yi & Mingyu Zhang + +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/unofficial-whu-lab-report/0.1.1/README.md b/packages/preview/unofficial-whu-lab-report/0.1.1/README.md new file mode 100644 index 0000000000..55c6e54ce4 --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/README.md @@ -0,0 +1,185 @@ +# Unofficial WHU Lab Report + +An **unofficial** Typst template for undergraduate course lab reports at Wuhan University (WHU), School of Computer Science. It provides a cover page, declaration page, table of contents, styled code blocks (inline + block), appendix support, and a teacher comment section — ready to use out of the box. + +基于 Typst 的武汉大学计算机学院本科生课程设计报告模板(**非官方**),提供封面页、原创性声明页、目录、代码块样式(行内 + 块级)、附录、教师评语等开箱即用的功能。 + +## Usage + +```typst +#import "@preview/unofficial-whu-lab-report:0.1.1": * + +#show: whu-report.with( + title: "操作系统课程设计", + major: "Computer Science", + course-name: "Operating System", + instructor: "Professor Cai", + student-id: "2024302114514", + student-name: "QianQiuXingChen", + semester: "2025-2026-3", + deadline: "2026年7月18日", + grade: true, + date: "二○二六年七月", + show-declaration: true, + signature: image("signature.png"), +) + += 概述 + +content... / 内容... +``` + +## Parameters / 模板参数 + +### Cover & Meta / 封面与元信息 + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `school` | str | `"武汉大学计算机学院"` | College/department name / 学院名称 | +| `category` | str | `"本科生课程设计报告"` | Report category title / 报告类别 | +| `title` | str | none | Specific report title / 报告名称 | +| `major` | str | none | Major name / 专业名称 | +| `course-name` | str | none | Course name / 课程名称 | +| `instructor` | str | none | Instructor name / 指导教师 | +| `student-id` | str | none | Student ID / 学号 | +| `student-name` | str | none | Student name / 学生姓名 | +| `semester` | str | none | Academic semester / 学年学期 | +| `deadline` | str | none | Report deadline / 报告日期(详细) | +| `grade` | bool | `false` | Show grade field on cover / 是否在封面显示成绩栏 | +| `date` | str | none | Report date (e.g. `"二○二六年七月"`) / 报告日期 | + +### Declaration / 原创性声明 + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `show-declaration` | bool | `false` | Include declaration/originality page / 是否显示声明页 | +| `declaration-text` | content | none | Custom declaration text / 自定义声明文本 | +| `signature` | image | none | Signature image for declaration page / 声明页签名图片 | + +### Typography & Styling / 排版与样式 + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `font-size` | length | `12pt` | Base text size / 正文字号 | +| `cn-serif` | str,array | `("Times New Roman", "SimSun", "Latin Modern Roman", "Songti SC")` | Serif font for body text / 衬线字体(正文) | +| `cn-sans` | str,array | `("Times New Roman", "SimHei", "Latin Modern Sans", "Heiti SC")` | Sans-serif font for headings / 无衬线字体(标题) | +| `mono-font` | str,array | `("Jetbrains Mono", "Fira Code", "Consolas", "Ubuntu Mono", "Microsoft YaHei")` | Monospace font for code / 等宽字体 | +| `math-color` | color | `purple` | Math equation color / 公式颜色 | +| `code-theme` | str | `"../assets/code.tmTheme"` | Syntax highlighting theme path / 代码高亮主题路径 | + +### Table of Contents / 目录 + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `show-toc` | bool | `true` | Include table of contents / 是否显示目录 | +| `toc-title` | str,content | `"目 录"` | TOC title / 目录标题 | +| `toc-depth` | int | `3` | TOC depth / 目录深度 | + +## Standalone Functions / 独立函数 + +### `cover()` — Cover Page / 封面页 + +Renders the cover page independently. Accepts the same parameters as the cover section of `whu-report`: `school`, `category`, `title`, `major`, `course-name`, `instructor`, `student-id`, `student-name`, `semester`, `deadline`, `grade`, `date`. + +封面将会独立渲染,接受调用者传递的参数:标题、课程名称等。 + +```typst +#import "@preview/unofficial-whu-lab-report:0.1.1": cover + +#cover( + title: "操作系统课程设计", + major: "Computer Science", + course-name: "Operating System", + instructor: "Professor Cai", + student-id: "2024302114514", + student-name: "QianQiuXingChen", + semester: "2025-2026-3", + date: "二○二六年七月", +) +``` + +### `declaration-page()` — Declaration Page / 原创性声明页 + +Renders the declaration/originality page independently. + +独立渲染原创性声明页, + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `decl-body` | content | none | Custom declaration text / 自定义声明文本 | +| `signature` | image | none | Signature image / 签名图片 | +| `date` | str | none | Signature date / 签名日期 | + +```typst +#import "@preview/unofficial-whu-lab-report:0.1.1": declaration-page + +#declaration-page( + signature: image("signature.png"), + date: "2026年7月18日", +) +``` + +### `teacher-comment()` — Teacher Comment / 教师评语评分 + +Renders a teacher comment & grading section at the end of the report. + +渲染位于报告末尾的教师评语评分部分。 + +```typst +#import "@preview/unofficial-whu-lab-report:0.1.1": teacher-comment + +#teacher-comment() +``` + +## Appendix Style / 附录编号 + +Use `appendix-style` to switch to appendix numbering (A.1, A.2, …): + +使用 `appendix-style` 来切换附录编号。 + +```typst +#pagebreak() +#show: appendix-style += 附录 +== 代码段 +``` + +## Code Block Styling / 代码块样式 + +Both inline code and block code are styled automatically when using `whu-report`: + +- **Inline code**: monospace font with a red-brown text color and light gray rounded background. +- **Block code**: monospace font with a light card background, subtle border, and rounded corners. The language label is displayed above the block. + +Set `code-theme` to a `.tmTheme` file path for syntax highlighting (defaults to `../assets/code.tmTheme`). + +使用 `whu-report` 时,行内代码和代码块会自动应用样式: + +- **行内代码**:等宽字体,红棕色文字,浅灰色圆角背景。 +- **代码块**:等宽字体,浅色卡片背景,细边框,圆角。语言标签显示在代码块上方。 + +通过设置 `code-theme` 为 `.tmTheme` 文件路径来启用语法高亮(默认为 `../assets/code.tmTheme`)。 + +## Font Dependencies / 字体依赖 + +For the best rendering, install the following fonts: + +为了最佳渲染效果,请安装以下字体: + +| Font | Used For | +|------|----------| +| **SimSun** (宋体) | Body text, cover info / 正文、封面信息 | +| **SimHei** (黑体) | Cover title, headings / 封面标题、章节标题 | +| **Times New Roman** | Latin fallback in serif & sans / 拉丁字符回退 | +| **Jetbrains Mono** | Code blocks / 代码块 | +| **Fira Code** | Code fallback / 代码回退 | +| **Latin Modern Roman** | Serif fallback / 衬线回退 | +| **Latin Modern Sans** | Sans-serif fallback / 无衬线回退 | + +macOS users can rely on the built-in **Songti SC** / **Heiti SC** as fallbacks. On other platforms, ensure SimSun and SimHei are installed. + +macOS 用户可以依赖内置的 `Songti SC` 与 `Heiti SC` 作为回退;其他平台的用户需保证 `SimSun` 和 `SimHei` 均已安装。 + +## License + +MIT diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/assets/code.tmTheme b/packages/preview/unofficial-whu-lab-report/0.1.1/assets/code.tmTheme new file mode 100644 index 0000000000..8db1214209 --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/assets/code.tmTheme @@ -0,0 +1,179 @@ + + + + + name + Custom Preview + settings + + + + + settings + + background + #f8f8f0 + foreground + #1a1a1a + caret + #000000 + selection + #c9d0d9 + + + + + + name + Comment Single + scope + comment.line + settings + + foreground + #377E22 + fontStyle + italic + + + + + + name + Comment Block / Docstring + scope + comment.block, string.doc, comment.block.documentation, string.quoted.double.block, string.quoted.single.block + settings + + foreground + #9E3832 + + + + + + + name + Keyword + scope + keyword, keyword.control, keyword.other, storage, storage.type, storage.modifier + settings + + foreground + #00008b + fontStyle + bold + + + + + + name + Built-in Functions + scope + support.function.builtin, support.function, entity.name.function.magic, support.type.python + settings + + foreground + #3478C6 + + + + + + name + Function Call + scope + meta.function-call.generic, variable.function + settings + + foreground + #4A5567 + fontStyle + underline + + + + + + name + String + scope + string, string.quoted.single, string.quoted.double + settings + + foreground + #2980b9 + + + + + + name + String Escape + scope + constant.character.escape + settings + + foreground + #1a6fa3 + + + + + + name + Number + scope + constant.numeric + settings + + foreground + #377E22 + + + + + + name + Operator + scope + keyword.operator + settings + + foreground + #1a1a1a + + + + + + name + Function Definition Name + scope + entity.name.function + settings + + foreground + #1a1a1a + + + + + + name + Variable Parameter + scope + variable.parameter + settings + + foreground + #1a1a1a + + + + + uuid + a1b2c3d4-e5f6-7890-abcd-ef1234567890 + + diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/lib.typ b/packages/preview/unofficial-whu-lab-report/0.1.1/lib.typ new file mode 100644 index 0000000000..42ff288543 --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/lib.typ @@ -0,0 +1,9 @@ +// Unofficial WHU Lab Report — 武汉大学计算机学院课程设计报告模板(非官方社区版) +// Usage / 用法: +// #import "@preview/unofficial-whu-lab-report:0.1.1": * +// #show: whu-report.with(title: "...", instructor: "...", ...) +// = Section +// Content... +// #show: teacher-comment() + +#import "src/template.typ": whu-report, appendix-style, teacher-comment diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/src/code.typ b/packages/preview/unofficial-whu-lab-report/0.1.1/src/code.typ new file mode 100644 index 0000000000..a7682e1bd7 --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/src/code.typ @@ -0,0 +1,51 @@ +/// Code block styling for WHU reports. +/// Provides show rules for inline and block code with Chinese-friendly fonts. + +/// Apply code styling show rules. +/// Call this inside your template function. +/// +/// - mono-font (str,array): Monospace font family +/// - cn-font (str,array): Chinese font family +/// - inline-color (color): Inline code text color +/// - inline-bg (color): Inline code background +/// - block-bg (color): Block code background +/// - block-stroke (stroke): Block code border +#let apply-code-styling( + mono-font: ("Jetbrains Mono", "Fira Code", "Consolas", "Songti SC"), + cn-font: ("Microsoft YaHei", "SimSun", "Songti SC"), + inline-color: rgb("#95261F"), + inline-bg: rgb("#E5E5E4"), + block-bg: rgb("#FAFAF9"), + block-stroke: 0.5pt + rgb("#CCD1D9"), +) = { + // Inline code + show raw.where(block: false): it => { + set text(size: 10pt, font: mono-font, inline-color) + box( + fill: inline-bg, + inset: (x: 2pt, y: 0pt), + outset: (y: 3pt), + radius: 4pt, + it, + ) + set text(size: 9pt, font: mono-font, inline-color) + } + + // Block code + show raw.where(block: true): it => { + set text(size: 9pt, font: mono-font) + block( + fill: block-bg, + stroke: block-stroke, + radius: 3pt, + width: 100%, + inset: 0pt, + clip: true, + block( + width: 100%, + inset: 12pt, + it, + ), + ) + } +} diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/src/cover.typ b/packages/preview/unofficial-whu-lab-report/0.1.1/src/cover.typ new file mode 100644 index 0000000000..f779a938ac --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/src/cover.typ @@ -0,0 +1,136 @@ +/// Cover page for WHU course design report. 武汉大学课程设计报告封面页。 +/// +/// - school (str): College/department name / 学校学院 +/// - category (str): Report category title / 报告类别 +/// - title (str): Specific report title / 报告名称 +/// - major (str): Major name / 专业名称 +/// - course-name (str): Course name / 课程名称 +/// - instructor (str): Instructor name / 指导教师 +/// - student-id (str): Student ID / 学号 +/// - student-name (str): Student name / 学生姓名 +/// - semester (str): Academic semester / 学期 +/// - deadline (str): Report deadline / 报告截止日期 +/// - grade (bool): Report grade / 报告成绩 +/// - date (str): Report date (e.g., "二○二六年五月") / 报告日期 +/// -> content + +#let SimHei = ("SimHei", "Source Han Sans", "Heiti SC") +#let SimSun = ("SimSun", "Noto Serif CJK SC", "Songti SC") + +/// reset the height of the signature image to 2em, +/// so that it fits the declaration page nicely. +#let zipper(img) = { + block({ + show image: set image(height: 2.2em) + img + }) +} + +#let cover( + school: "武汉大学计算机学院", + category: "本科生课程设计报告", + title: none, + major: none, + course-name: none, + instructor: none, + student-id: none, + student-name: none, + semester: none, + deadline: none, + grade: false, + date: none, +) = { + align(center)[ + #v(2em) + #block[ + #set align(center) + #set text(top-edge: "ascender", bottom-edge: "descender") + + #set par(leading: 0.7em) + #text(font: SimSun, size: 26pt, weight: "bold")[#school\ #category] + ] + #v(5em) + + #if title != none { + block({ + set par(leading: 32pt-1em) + text(top-edge: 0.7em, bottom-edge: -0.3em, size: 22pt, weight: "bold", font: SimHei)[#title] + }) + v(32pt) + } + + #v(5em) + + #let info = (:) + #if major != none { info.insert("专 业 名 称", major) } + #if course-name != none { info.insert("课 程 名 称", course-name) } + #if instructor != none { info.insert("指 导 教 师", instructor) } + #if student-id != none { info.insert("学 生 学 号", student-id) } + #if student-name != none { info.insert("学 生 姓 名", student-name) } + #if semester != none { info.insert("学 年 学 期", semester) } + #if deadline != none { info.insert("完 成 时 间", deadline) } + #if grade == true { info.insert("成 绩 ", "_____________") } + #grid( + columns: (auto, auto), + row-gutter: 1.5em, + column-gutter: 1em, + align: (right + horizon, left + horizon), + ..info.pairs().map(((label, value)) => ( + text(size: 15pt, font: SimSun)[#label :], + text(size: 15pt, font: SimSun)[#value], + )).flatten() + ) + + #v(1fr) + #if date != none { + text(size: 18pt, font: SimSun)[#date] + } + #v(2em) + ] +} + +/// Declaration of originality page. 原创性声明页。 +/// +/// - signature (image): Signature image / 签名图片 +/// - date (str): Signature date / 签名日期 +/// - decl-body (content): Custom declaration text / 自定义声明文本 +/// -> content +#let declaration-page( + date: none, + decl-body: none, + signature: none, +) = { + align(center)[ + #v(2em) + #text(size: 22pt, weight: "bold", font: SimSun)[郑 重 声 明] + #v(2em) + ] + + if decl-body != none { + par(sjustify: true, first-line-indent: 2em, text(size: 14pt, font: SimSun)[#decl-body]) + } else { + par(justify: true, first-line-indent: 2em, leading: 23pt-1em)[ + #text(top-edge: 0.7em, bottom-edge: -0.3em, size: 14pt, font: SimSun)[本人呈交的设计报告,是在指导老师的指导下,独立进行实验工作所取得的成果,所有数据、图片资料真实可靠。尽我所知,除文中已经注明引用的内容外,本设计报告不包含他人享有著作权的内容。对本设计报告做出贡献的其他个人和集体,均已在文中以明确的方式标明。本设计报告的知识产权归属于培养单位。 + ] + ] + } + + v(4em) + align(right)[ + #if signature != none { + text(size: 14pt, font: SimSun)[本人签名:#underline(box( + baseline: 20%, + zipper(signature), + ))] + } else { + text(size: 14pt, font: SimSun)[本人签名:\_\_\_\_\_\_\_\_\_\_\_\_] + } + #h(4em) + #if date != none { + text(size: 14pt, font: SimSun)[日期:#date] + } else { + text(size: 14pt, font: SimSun)[日期:\_\_\_\_年\_\_\_\_月\_\_\_\_日] + } + #h(4em) + ] +} diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/src/template.typ b/packages/preview/unofficial-whu-lab-report/0.1.1/src/template.typ new file mode 100644 index 0000000000..f8db40dee3 --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/src/template.typ @@ -0,0 +1,233 @@ +#import "cover.typ": cover, declaration-page +#import "code.typ": apply-code-styling +#import "@preview/cuti:0.4.0": show-cn-fakebold + + +/// Unofficial WHU (Wuhan University) lab report template. +/// 武汉大学计算机学院课程设计报告模板(非官方社区版)。 +/// +// #show: whu-report.with( +// title: "the title of the report", +// major: "Computer Science", +// course-name: "Operating System", +// instructor: "Professor Cai", +// student-id: "2024302114514", +// student-name: "QianQiuXingChen", +// semester: "2025-2026-3", +// deadline: "2026年7月18日", +// grade: true, +// date: "二○二六年七月", +// show-declaration: true, +// signature: image("signature.png"), +// ) +/// +/// +/// - school (str): College/department name / 学校学院 +/// - category (str): Report category title / 报告类别 +/// - title (str): Specific report title / 报告名称 +/// - major (str): Major name / 专业名称 +/// - course-name (str): Course name / 课程名称 +/// - instructor (str): Instructor name / 指导教师 +/// - student-id (str): Student ID / 学号 +/// - student-name (str): Student name / 学生姓名 +/// - semester (str): Academic semester / 学期 +/// - deadline (str): Report deadline / 报告截止日期 +/// - grade (bool): Report grade / 报告成绩 +/// - date (str): Report date (e.g., "二○二六年五月") / 报告日期 +/// +/// - font-size (length): Base text size / 正文字号 +/// - math-color (color): Math equation color / 公式颜色 +/// - show-declaration (bool): Include declaration/originality page / 是否显示声明页 +/// - declaration-text (content): Custom declaration text / 自定义声明文本 +/// - show-toc (bool): Include table of contents / 是否显示目录 +/// - toc-title (str,content): TOC title / 目录标题 +/// - toc-depth (int): TOC depth / 目录深度 +/// - code-theme (str): Syntax highlighting theme file path / 代码高亮主题路径 +/// - mono-font (str,array): Monospace font / 等宽字体 +/// - body (content): Document body / 文档正文 +/// -> content +#let whu-report( + // Cover page + school: "武汉大学计算机学院", + category: "本科生课程设计报告", + title: none, + major: none, + course-name: none, + instructor: none, + student-id: none, + student-name: none, + semester: none, + deadline: none, + grade: false, + date: none, + signature: none, + + // Options + font-size: 12pt, + math-color: purple, + show-declaration: false, + declaration-text: none, + show-toc: true, + toc-title: "目 录", + toc-depth: 3, + code-theme: "../assets/code.tmTheme", + mono-font: ("Jetbrains Mono", "Fira Code", "Consolas", "Ubuntu Mono", "Microsoft YaHei"), + cn-serif: ("Times New Roman", "SimSun", "Latin Modern Roman", "Songti SC"), + cn-sans: ("Times New Roman", "SimHei", "Latin Modern Sans", "Heiti SC"), + + body, +) = { + // Page setup + set page(paper: "a4", margin: (x: 2.5cm, y: 2.5cm)) + set text(font: cn-serif, size: font-size) + + // Chinese fake bold + show: show-cn-fakebold + + // Math styling + show math.equation: set text(purple, size: 1em) + + // Code block styling + apply-code-styling(mono-font: mono-font) + if code-theme != none { + set raw(theme: code-theme) + } + + // Paragraph styling + set par(justify: true, first-line-indent: 2em) + show heading: it => it + h(0pt) + + // Cover page + cover( + school: school, + category: category, + title: title, + major: major, + course-name: course-name, + instructor: instructor, + student-id: student-id, + student-name: student-name, + semester: semester, + deadline: deadline, + grade: grade, + date: date, + ) + pagebreak() + + // Declaration (optional) + if show-declaration { + declaration-page( + date: deadline, + decl-body: declaration-text, + signature: signature, + ) + pagebreak() + } + + // Table of Contents + if show-toc { + outline( + title: align(center)[#text(font: cn-sans, size: 18pt)[#toc-title]], + indent: auto, + depth: toc-depth, + ) + pagebreak() + } + set par(justify: true, first-line-indent: 2em, leading: 23pt-1em) + set text(top-edge: 0.6em, bottom-edge: -0.2em) + set text(size: 12pt, font: cn-serif) + set raw(theme: "../assets/code.tmTheme") + + show raw.where(block: true): it => { + let lang = if it.has("lang") { it.lang } else { "TEXT" } + block( + fill: rgb("#FAFAF9"), + stroke: 0.5pt + rgb("#CCD1D9"), + radius: 3pt, + width: 100%, + inset: 0pt, + clip: true, + + block( + width: 100%, + inset: 12pt, + [ + #set par(justify: false, first-line-indent: 0pt,leading: 0.8em) + #set text(font: mono-font, size: 9pt) + #it + ] + ), + + ) + } + show raw.where(block: false): it => { + set text(size: 9pt,font: mono-font,rgb("#A9504A"),) + box( + fill: rgb("#E5E5E4"), + inset: (x: 2pt, y: 0pt), + outset: (y: 3pt), + radius: 4pt, + it, + ) +} + + // Main content + set page(numbering: "1") + set heading(numbering: "1.1") + counter(page).update(1) + + body +} + +/// Switch to appendix numbering (A.1, A.2, ...). 切换附录编号格式。 +/// Call after the main content and before the appendix. 在正文之后、附录之前调用。 +/// +/// #pagebreak() +/// #show: appendix-style +/// = 附录 +/// == 代码段 +#let appendix-style(it) = { + counter(heading).update((0, 0)) + show heading.where(level: 1): it => { + set align(center) + set text(size: 1.5em) + v(1em) + it + v(0.8em) + } + set heading(numbering: "A.1") + it +} + +// the following is a teacher comment template, +// which can be used in the report to provide feedback and grading. +// It includes a section for comments and a space +// for the teacher to provide a score and signature. +#let teacher-comment( +) = { + [ + #align(center)[ + #v(2em) + #text(size: 18pt, weight: "bold", font: "SimHei")[教师评语评分] + #v(2em) + ] + + #text[ + #set par(justify: true, first-line-indent: 2em) + 评语: + #for value in range(1,2) { + " _______________________________________________________________\n" + } + #for value in range(1,8) { + "_________________________________________________________________________\n" + } + ] + + #v(4em) + #align(right)[ + 评分:\_\_\_\_\_\_\_\_\_\_\_\_ #h(4em) 评阅人:\_\_\_\_\_\_\_\_\_\_\_ + #h(3em) + ] + #align(center)[(备注:对该实验报告给予优点和不足的评价,并给出百分之评分。)] + ] +} \ No newline at end of file diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/template/main.typ b/packages/preview/unofficial-whu-lab-report/0.1.1/template/main.typ new file mode 100644 index 0000000000..592768aade --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/template/main.typ @@ -0,0 +1,76 @@ +#import "@preview/unofficial-whu-lab-report:0.1.1": * + +#show: whu-report.with( + school: "武汉大学计算机学院", + category: "本科生课程设计报告", + title: "实验报告标题", + major: "你的专业", + course-name: "课程名称", + instructor: "教师姓名", + student-id: "你的学号", + student-name: "你的姓名", + semester: "2025-2026-3", + deadline: "2026年7月18日", + grade: false, + date: "二○二六年七月", + show-declaration: true, + signature: image("signature.png"), +) + += 概述 + +kiwiizzz 苦于 ML 实验报告,利用空余时间完成了这个模板的设计;而 zoomy14112 在此基础上进行了优化和改进,使之尽可能贴近武汉大学计算机学院本科生课程设计报告的排版规范,并添加了新功能。 + +段落空两格需要在*标题后*换行后进行。 + +== 公式 + +公式呈现紫色。例如,$lambda = 36 + 6 sqrt(114)$。以及, + +$ +f(x) f(x + lambda y) f(x + 3/2 f(2y)) = x (x + lambda y) f(x + 2y) + f(x) f(y) f(x + lambda y). +$ + +== 代码段 + +内联代码用红色字体,为了拟合 `Markdown Preview` 的效果。 + +代码块内容如下: + +```py +def train_target(): + acc += 0.1 + print("sota") +``` + +== 表格 + +#figure( + table( + columns: 3, + [*方法*], [*准确率*], [*F1*], + [BERT], [92.3%], [0.89], + [RoBERTa], [94.1%], [0.91], + [Ours], [95.6%], [0.93], + ), + caption: [实验结果对比], +) + +#pagebreak() +#show: appendix-style += 附录 + +附录的调用需要如下实现: + +```typ +#pagebreak() +#show: appendix-style += 附录 +== 代码段 +``` + +附录编号会自动切换为 A.1, A.2, … 的格式。 + +#pagebreak() + +#teacher-comment() diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/template/signature.png b/packages/preview/unofficial-whu-lab-report/0.1.1/template/signature.png new file mode 100644 index 0000000000..7cb3b2f21b Binary files /dev/null and b/packages/preview/unofficial-whu-lab-report/0.1.1/template/signature.png differ diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/thumbnail.png b/packages/preview/unofficial-whu-lab-report/0.1.1/thumbnail.png new file mode 100644 index 0000000000..83e78e84b7 Binary files /dev/null and b/packages/preview/unofficial-whu-lab-report/0.1.1/thumbnail.png differ diff --git a/packages/preview/unofficial-whu-lab-report/0.1.1/typst.toml b/packages/preview/unofficial-whu-lab-report/0.1.1/typst.toml new file mode 100644 index 0000000000..1e66a54fae --- /dev/null +++ b/packages/preview/unofficial-whu-lab-report/0.1.1/typst.toml @@ -0,0 +1,16 @@ +[package] +name = "unofficial-whu-lab-report" +version = "0.1.1" +entrypoint = "lib.typ" +authors = ["Shouzhuo Yi <@whoisKIWIIZZZ>", "Mingyu Zhang <@zoomy14112>"] +license = "MIT" +description = "An unofficial course lab report template for Wuhan University (WHU). 武汉大学计算机学院本科生课程设计报告模板(非官方)" +repository = "https://github.com/zoomy14112/report-theme-whu" +keywords = ["report", "whu", "course", "chinese"] +categories = ["report", "thesis"] +compiler = "0.14.0" + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnail.png"