From b8e7c8d3d186306caed5ab291f0fa51c425e8f83 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Mon, 19 Feb 2024 16:40:04 +0800 Subject: [PATCH] [69_11] Support hanzi for the number primitive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Support hanzi for the number primitive 2. 部分I 改为 第I部分 --- .../packages/customize/language/chinese.ts | 10 +- TeXmacs/tests/tm/69_11.tm | 106 ++++++++++++++++++ src/Typeset/Env/env_exec.cpp | 2 + 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 TeXmacs/tests/tm/69_11.tm diff --git a/TeXmacs/packages/customize/language/chinese.ts b/TeXmacs/packages/customize/language/chinese.ts index ee211dc6cc..a506716ca0 100644 --- a/TeXmacs/packages/customize/language/chinese.ts +++ b/TeXmacs/packages/customize/language/chinese.ts @@ -112,8 +112,14 @@ >|> > - - >>>> + \; + + + >>>> + + \; + + \<#7B2C\> >>> diff --git a/TeXmacs/tests/tm/69_11.tm b/TeXmacs/tests/tm/69_11.tm new file mode 100644 index 0000000000..cfdd6708c1 --- /dev/null +++ b/TeXmacs/tests/tm/69_11.tm @@ -0,0 +1,106 @@ + + +> + +<\body> + <\hide-preamble> + \; + + + <\table-of-contents|toc> + > + |.>>>>|> + + + \<#521D\>\<#7AA5\>\<#95E8\>\<#5F84\>> + |.>>>>|> + + + 1.1 |.>>>>|> + + + \<#5C0F\>\<#8BD5\>\<#725B\>\<#5200\>> + |.>>>>|> + + + \<#767B\>\<#5802\>\<#5165\>\<#5BA4\>> + |.>>>>|> + + + > + |.>>>>|> + + + > + |.>>>>|> + + + + + + \<#7AA5\>\<#95E8\>\<#5F84\>> + + + + \<#8BD5\>\<#725B\>\<#5200\>> + + \<#5802\>\<#5165\>\<#5BA4\>> + + \; + + + + + + +<\initial> + <\collection> + + + + + +<\references> + <\collection> + > + > + > + > + > + > + > + + + +<\auxiliary> + <\collection> + <\associate|toc> + |math-font-series||font-size||I> + |.>>>>|> + + + |math-font-series||1\<#521D\>\<#7AA5\>\<#95E8\>\<#5F84\>> + |.>>>>|> + + + 1.1 |.>>>>|> + + + |math-font-series||2\<#5C0F\>\<#8BD5\>\<#725B\>\<#5200\>> + |.>>>>|> + + + |math-font-series||3\<#767B\>\<#5802\>\<#5165\>\<#5BA4\>> + |.>>>>|> + + + |math-font-series||font-size||II> + |.>>>>|> + + + |math-font-series||font-size||III> + |.>>>>|> + + + + \ No newline at end of file diff --git a/src/Typeset/Env/env_exec.cpp b/src/Typeset/Env/env_exec.cpp index a8213745ca..6529933cd3 100644 --- a/src/Typeset/Env/env_exec.cpp +++ b/src/Typeset/Env/env_exec.cpp @@ -27,6 +27,7 @@ #include using lolly::data::from_hex; +using lolly::data::to_hanzi; using lolly::data::to_Hex; using lolly::data::to_roman; using lolly::data::to_Roman; @@ -1565,6 +1566,7 @@ edit_env_rep::exec_number (tree t) { if (s2 == "Roman") return to_Roman (nr); if (s2 == "alpha") return alpha_nr (nr); if (s2 == "Alpha") return Alpha_nr (nr); + if (s2 == "hanzi") return utf8_to_cork (to_hanzi (nr)); if (s2 == "fnsymbol") return tree (WITH, MODE, "math", tree (RIGID, fnsymbol_nr (nr))); return tree (ERROR, "bad number");