fix: compatibility with Typst 0.14.0#10
Merged
RizhongLin merged 2 commits intoTJ-CSCCG:mainfrom Dec 7, 2025
Merged
Conversation
4a33478 to
f5339ea
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Tongji University thesis template to be compatible with Typst 0.14.0 by migrating from deprecated APIs to modern equivalents. The changes address breaking changes in Typst 0.14.0 where locate() was deprecated in favor of context, and the counter API was updated.
Key changes:
- Replaces deprecated
locate()function withcontextkeyword throughout the codebase - Updates counter API calls from
counter().at(loc)tocounter().get()within context blocks - Updates package dependencies:
algofrom 0.3.3 to 0.3.5 andtablexfrom 0.0.6 to 0.0.9 - Modernizes paragraph spacing from
show par: set block(spacing: ...)toset par(spacing: ...) - Adds CI/CD workflow for automated testing
- Expands .gitignore file
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| paddling-tongji-thesis/tongjithesis.typ | Migrates heading show rules and footer functions from locate() to context, updates counter API usage, and modernizes paragraph spacing configuration |
| paddling-tongji-thesis/elements.typ | Updates package imports to newer versions and migrates outline generation function from locate() to context |
| .gitignore | Expands ignore patterns with many new entries (includes some unrelated to Typst projects) |
| .github/workflows/test.yml | Adds new CI workflow to compile thesis and verify build on push/PR events |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对该 PR 的总结
algo包从 0.3.3 到 0.3.5tablex包从 0.0.6 到 0.0.9locate()函数替换为context该 PR 的成功合入是否需要关闭一些 Issue?
Close #9
该 PR 的其他信息
本 PR 修复了模板与 Typst 0.14.0 的兼容性问题。之前用户在使用最新版本 Typst 编译时会遇到
type state has no method display和only element functions can be used as selectors的错误。修改后的代码已在 Typst 0.14.0 上成功编译测试。