From 52f3ebd8d9a6598d3380e5032bd17c2406b3bde8 Mon Sep 17 00:00:00 2001 From: kokomi1234 Date: Mon, 24 Nov 2025 14:11:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[201=5F18]=20generic=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E6=8F=92=E5=85=A5chapter=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TeXmacs/progs/text/text-menu.scm | 2 +- devel/201_18.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/TeXmacs/progs/text/text-menu.scm b/TeXmacs/progs/text/text-menu.scm index 296c1096d..d7f1bc160 100644 --- a/TeXmacs/progs/text/text-menu.scm +++ b/TeXmacs/progs/text/text-menu.scm @@ -524,7 +524,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (menu-bind text-block-icons - (if (style-has? "book-style") + (if (or (style-has? "book-style") (style-has? "generic-style")) (=> (balloon (icon "tm_chapter.xpm") "Start a new chapter") (link chapter-menu))) (if (and (style-has? "section-base-dtd") diff --git a/devel/201_18.md b/devel/201_18.md index 057f4c117..bd0943bdc 100644 --- a/devel/201_18.md +++ b/devel/201_18.md @@ -1,5 +1,17 @@ # 201_18 模式工具栏增加Appendix的选项和快捷键 +## 2025/11/24 generic 样式缺少 Chapter 图标 +### 如何测试 +点击第三行工具栏的样式,切换到 generic 样式,看第二行工具栏是否出现书本图标的按钮 + +### Why +`text-block-icons` 只在检测到 `book-style` 时才展示章按钮,导致generic样式无法通过工具栏快速插入 Chapter。 + +### How +`TeXmacs/progs/text/text-menu.scm`: + +1. 扩展 `text-block-icons` 的条件,允许 `generic-style` 也显示 `tm_chapter.xpm` 按钮。 + ## 2025/11/18 generic样式无法通过菜单插入 chapter ### Why -- Gitee From 556ac328c232595345c106b89440899b47e0fb31 Mon Sep 17 00:00:00 2001 From: kokomi1234 Date: Mon, 24 Nov 2025 15:14:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Chapter=20=E8=8F=9C=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E4=BB=85=E5=AF=B9generic/article/book=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TeXmacs/progs/text/text-menu.scm | 14 +++++++++++++- devel/201_18.md | 12 +++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/TeXmacs/progs/text/text-menu.scm b/TeXmacs/progs/text/text-menu.scm index d7f1bc160..3d8da42e0 100644 --- a/TeXmacs/progs/text/text-menu.scm +++ b/TeXmacs/progs/text/text-menu.scm @@ -462,6 +462,7 @@ ;; Text menus for inserting block content ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (menu-bind text-block-menu (if (and (style-has? "header-title-dtd") (not (style-has? "header-letter-dtd")) @@ -523,8 +524,19 @@ ;; Icons for inserting block markup ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(define (chapter-style?) + (and (or (style-has? "book-style") + (style-has? "generic-style") + (style-has? "article-style")) + (not (style-has? "beamer-style")) + (not (style-has? "poster-style")) + (not (style-has? "letter-style")) + (not (style-has? "seminar-style")) + (not (style-has? "browser-style")))) + + (menu-bind text-block-icons - (if (or (style-has? "book-style") (style-has? "generic-style")) + (if (chapter-style?) (=> (balloon (icon "tm_chapter.xpm") "Start a new chapter") (link chapter-menu))) (if (and (style-has? "section-base-dtd") diff --git a/devel/201_18.md b/devel/201_18.md index bd0943bdc..38bbe0a1f 100644 --- a/devel/201_18.md +++ b/devel/201_18.md @@ -1,16 +1,18 @@ # 201_18 模式工具栏增加Appendix的选项和快捷键 +## 如何测试 +点击焦点工具栏的样式,分别切换到 `book` 、`generic` 、 `aritcle` 样式,看模式工具栏是否出现“章” 这个菜单项,然后切换到别的样式不出现该菜单项 -## 2025/11/24 generic 样式缺少 Chapter 图标 -### 如何测试 -点击第三行工具栏的样式,切换到 generic 样式,看第二行工具栏是否出现书本图标的按钮 +## 2025/11/24 Chapter 入口仅对generic/article/book样式可见 ### Why -`text-block-icons` 只在检测到 `book-style` 时才展示章按钮,导致generic样式无法通过工具栏快速插入 Chapter。 +除了 generic、article、book 以外(例如 beamer、poster、letter、seminar),不应该插入章菜单项。 ### How `TeXmacs/progs/text/text-menu.scm`: -1. 扩展 `text-block-icons` 的条件,允许 `generic-style` 也显示 `tm_chapter.xpm` 按钮。 +1. 定义 `chapter-style?`,只在 `book-style`、`generic-style` 与 ` article-style` 下返回#t + + ## 2025/11/18 generic样式无法通过菜单插入 chapter -- Gitee