Skip to content

[222_80] 为 big-figure 和 big-table 添加 prefix by section number 选项#3271

Merged
JackYansongLi merged 1 commit intomainfrom
jl/add-figure-choice
May 7, 2026
Merged

[222_80] 为 big-figure 和 big-table 添加 prefix by section number 选项#3271
JackYansongLi merged 1 commit intomainfrom
jl/add-figure-choice

Conversation

@JackYansongLi
Copy link
Copy Markdown
Contributor

@JackYansongLi JackYansongLi commented May 6, 2026

[222_80] 为 big-figure 和 big-table 环境添加 "prefix by section number" 选项

如何测试

  1. 打开 Mogan,新建一个文档,选择 article 样式
  2. 插入几个 section 和 big-figure
  3. 选中 big-figure,查看焦点工具栏的 "Style options"
  4. 勾选 "Prefix by section number"
  5. 预期结果:big-figure 的编号会变成 section-nr.figure-nr 格式(如 1.1、1.2)
  6. 在新的 section 中插入 big-figure
  7. 预期结果:编号会重新开始,如 2.12.2
  8. 对 big-table 重复上述测试步骤,预期行为相同

2026/05/06 实现 big-figure 和 big-table 的 section number 前缀选项

What

为 big-figure 和 big-table 环境的焦点工具栏添加 "Prefix by section number" 选项。

Why

目前 theorem 环境在焦点工具栏中有 "Prefix by section number" 选项(通过 number-long-article 包实现),而 big-figure 和 big-table 环境没有。用户期望 figure 和 table 也能像 theorem 那样按 section number 前缀编号。

How

TeXmacs/progs/text/text-menu.scm 中:

  • 为 figure 的 standard-options 添加 "number-long-article"
  • 为 table 的 standard-options 添加 "number-long-article"

这样焦点工具栏会自动从 document-style.scm 中读取 number-long-article 的描述,显示为 "Prefix by section number" 复选框。

涉及文件

  • TeXmacs/progs/text/text-menu.scm
    • 修改 figure 的 standard-options,添加 "number-long-article"
    • 修改 table 的 standard-options,添加 "number-long-article"

实现说明

number-long-article 包定义了 display-std-env 宏,将 std-env 组中所有环境的编号前缀为 section number。由于 figure 和 table 的计数器已属于 std-env 组(通过 figure-env 组间接加入),启用 number-long-article 后它们的编号会自动带有 section number 前缀。

@JackYansongLi JackYansongLi force-pushed the jl/add-figure-choice branch from 31c43ef to 42f7f80 Compare May 6, 2026 12:00
@JackYansongLi JackYansongLi changed the title [202_115] 为 big-figure 和 big-table 添加 prefix by section number 选项 [222_80] 为 big-figure 和 big-table 添加 prefix by section number 选项 May 6, 2026
@JackYansongLi JackYansongLi force-pushed the jl/add-figure-choice branch from 42f7f80 to 1426921 Compare May 6, 2026 12:09
Copy link
Copy Markdown
Contributor

@Yuki-Nagori Yuki-Nagori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JackYansongLi JackYansongLi merged commit 3e7b965 into main May 7, 2026
@JackYansongLi JackYansongLi deleted the jl/add-figure-choice branch May 7, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants