Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 修复 preview-ref 悬浮预览气泡中,图片/表格编号总是显示为 1、与正文实际编号不一致的问题;通过在生成预览内容时复用原文档已计算好的 label binding 来保证编号一致。
Changes:
- 在生成预览内容时将 label id 传入预览生成逻辑,并尝试对 figure/table 的编号宏进行局部覆盖以读取原文档 binding。
- 新增开发记录文档
devel/0800.md,描述问题背景、原因与测试步骤。
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| TeXmacs/progs/link/ref-edit.scm | 调整 preview-ref 的预览内容生成流程,新增对 figure/table 编号在 tooltip 临时排版环境下的修正逻辑。 |
| devel/0800.md | 新增问题说明与手工测试步骤文档。 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| `(,(tm-label t) ,@(map clean-preview (tm-children t)))) | ||
| (else t))) | ||
|
|
||
| (define (fix-fig_or_tb-number doc id) |
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.
[0800] 图片/表格 preview-ref 的编号不正确
如何测试
2026/5/11
What
preview-ref 预览气泡中图片/表格的编号总是显示 1,与文档中的实际编号不一致。
Why
preview-ref 会把引用目标片段取出来,在 tooltip 的临时文档中单独排版。
图片/表格宏在展开时会调用
next-figure/next-table,而临时文档中的figure-nr/table-nr从 0 开始,所以预览里的编号总是变成 1。How
label-preview。small/big-figure或small/big-table时,局部覆盖the-figure/the-table为(get-binding id)。这样保留原有图片/表格宏的渲染流程,只让 tooltip 中显示编号读取原文档已计算好的真实 binding。