A Typst Template for PKU Modern Physics Laboratory Reports
Unofficial template. Ported from the revtex4-2-based PKUMpLtX (v2.1.6)
English | 中文
Overview
A Typst template for the Modern Physics Laboratory course at Peking University, ported from the LaTeX template PKUMpLtX. This project is an independent, unofficial Typst implementation.
Features
- Revtex-Faithful Layout — Matches
revtex4-2preprint style for body 12pt, line spacing, heading spacing, and numbering - Chinese Typography — Roman/Sans/Mono mapped to Songti/Heiti/Fangsong with correct italic fallbacks; five font presets (
macos,windows,noto,notofandol,fandol) - APS Bibliography —
apsrev4-2style approximated via a bundled CSL file; native.bibreading - Ruled Tables —
ruled-tablereproduces theruledtabulartop-and-bottom double-line style - Frontmatter — One
frontmatter(..)call renders title, author, affiliation, date, abstract, and keywords; the abstract followsmpltx.clswith 11pt text, 400pt width, a 2em first-line indent, and an approximately 16.9pt baseline distance - Colored Links — Cross-references, citations, and URLs colored per the LaTeX
hyperrefdefaults
Quick Start
Prerequisites: Typst installed.
From the package (once published to Typst Universe):
typst init @preview/unofficial-pku-mpl:0.1.0
From source, to preview the full demo:
git clone https://github.com/xjsongphy/pkumpl-typst && cd pkumpl-typst
typst compile demo.typ
For live preview, typst watch demo.typ. All source files must be UTF-8 encoded.
Typst Quick Start
New to Typst? Start with the official Typst tutorial, or read the Chinese Typst tutorial. For agent-assisted Typst work, see the Claude Typst skill.
Package structure
The two Typst files have the following roles:
mplts.typis the package entrypoint and contains the reusable layout, typography, numbering, figure/table, bibliography, and helper-function implementation.template/main.typis the initialized user document. It imports the published package and contains report content plus examples.template/bibli.bibandtemplate/american-physics-society.cslare copied into new projects.
Font Options
font={macos|windows|noto|notofandol|fandol} (default macos):
| Roman | Sans Serif | Monospace | |
|---|---|---|---|
| Upright | Songti | Heiti | Fangsong |
| Italic | Fangsong | Kaiti | Kaiti |
Latin text uses New Computer Modern. The package does not bundle fonts, as required by Typst Universe. Install the CJK fonts needed by the selected preset locally:
macos: Songti SC, PingFang SC, STFangsong, and Kaiti SC (macOS)windows: SimSun/STSong, Microsoft YaHei/DengXian, FangSong, and KaiTi (Windows)noto: Noto Serif CJK SC and Noto Sans CJK SCfandol: FandolSong, FandolHei, FandolFang, and FandolKainotofandol: Noto Serif/Sans CJK SC plus FandolFang/FandolKai
Use noto or fandol for a reproducible cross-platform setup. macos remains the default because it most closely matches the upstream LaTeX rendering on macOS. Run typst fonts to inspect the names visible to your Typst installation.
Feedback
Found a bug or have a suggestion? Please open an issue. Pull requests are welcome.
References
PKUMpLtX— Original LaTeX template (revtex4-2 based), by the Modern Physics Lab, Peking Universitypkuthss-typst— Peking University thesis Typst template, referenced for package structure and publishing practicerevtex4-2— APS revtex class- CSL styles — Source of the APS bibliography style
fandol— Fandol Chinese fonts
Copyright
- Copyright © 2013–2026. Modern Phys. Lab, School of Phys., Peking Univ.
- Copyright © 2013–2014. Sun Sibai niasw@pku.edu.cn
- Copyright © 2013. Cao Chuanwu
- Copyright © 2021–2026. Lin Xuchen linxc@pku.edu.cn
- Copyright © 2026. Song Xinjie xjsongphy@stu.pku.edu.cn
Third-party materials and licensing
This project is an independent Typst implementation derived from the layout and
example materials of PKUMpLtX,
the original LaTeX template for the Peking University Modern Physics Laboratory.
The adapted upstream material is distributed under the Creative Commons
Attribution-ShareAlike 4.0 International License; the upstream copyright notices
are preserved above and in [LICENSE].
The following files are derived from or copied from upstream materials:
fig/instruments.pngfig/figsample.pdffiggen.pyfig.mplstylebibli.bib(with additional entries for this Typst example)
The APS CSL file and its copy under template/ carry their own metadata and are
licensed under the Creative Commons Attribution-ShareAlike 3.0 License. They
remain subject to that upstream license and are not relicensed by this project’s
CC BY-SA 4.0 license.
This project does not bundle Peking University logos, seals, fonts, or other official university brand assets.
License
Released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).