[0600] 修复 smart-ref 对 corollary 和 assumption 无效的问题#3304
Merged
Conversation
- Add missing corollary-ref macro in smart-ref.ts - Add ass-ref and assumption-ref macros - Keep corrolary-ref for backward compatibility - Add test file TeXmacs/tests/tmu/0600.tmu - Add devel doc devel/0600.md
bc2e6cf to
2271ff9
Compare
- 在 smart-ref.ts 中补充缺失的 corollary-ref 宏 - 新增 ass-ref 和 assumption-ref 宏,支持 assumption 环境 - 保留 corrolary-ref 保持向后兼容 - 新增测试文件 TeXmacs/tests/tmu/0600.tmu - 新增开发文档 devel/0600.md
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.
[0600] 修复 smart-ref 对 corollary 和 assumption 无效的问题
如何测试
打开
TeXmacs/tests/tmu/0600.tmu,查看 smart-ref 和 typed ref 的渲染是否正确:<smart-ref|corollary:test1>应显示为 "Corollary 1"<smart-ref|cor:test2>应显示为 "Corollary 2"<corollary-ref|corollary:test1>应显示为 "Corollary 1"<smart-ref|assumption:test1>应显示为 "Assumption 1"<smart-ref|ass:test2>应显示为 "Assumption 2"<assumption-ref|assumption:test1>应显示为 "Assumption 1"2026/05/09
What
修复
smart-ref对corollary和assumption环境无效的问题。当 label 以
corollary:、assumption:等完整环境名作为前缀时,smart-ref无法识别对应的类型,导致引用只显示编号而不显示类型名称(如只显示 "1" 而不是 "Corollary 1")。Why
smart-ref系统通过检查当前样式中是否存在<prefix>-ref宏来推断引用类型。在smart-ref.ts中:co-ref、cor-ref、corr-ref和拼写错误的corrolary-ref,缺少正确的corollary-refass-ref、assumption-ref)因此当用户将 label 命名为
corollary:xxx或assumption:xxx时,smart-ref-type无法匹配到对应的宏,回退为unknown类型,导致只显示纯编号。How
在
TeXmacs/packages/utilities/smart-ref.ts中补充缺失的宏定义:<assign|corollary-ref|...><assign|ass-ref|...>和<assign|assumption-ref|...>同时保留已有的拼写错误
corrolary-ref以保持向后兼容。