Skip to content

Commit

Permalink
[69_11] Support hanzi for the number primitive
Browse files Browse the repository at this point in the history
1. Support hanzi for the number primitive
2. 部分I 改为 第I部分
  • Loading branch information
da-liii authored Feb 19, 2024
1 parent 02fc48e commit b8e7c8d
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 2 deletions.
10 changes: 8 additions & 2 deletions TeXmacs/packages/customize/language/chinese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@
<render-enunciation|<theorem-name|<arg|which><theorem-sep>>|<arg|body>>
</macro>>

<assign|chapter-numbered-title|<macro|title|<style-with|src-compact|none|<chapter-title|\<#7B2C\>
<the-chapter> <chapter-text> <vspace|1fn><new-line><arg|title>>>>>
\;

<assign|chapter-numbered-title|<macro|title|<style-with|src-compact|none|<chapter-title|\<#7B2C\> <the-chapter> <chapter-text>
<vspace|1fn><new-line><arg|title>>>>>

\;

<assign|part-numbered-title|<macro|name|<part-title-sub|<htab|0fn>\<#7B2C\> <the-part> <part-text><htab|0fn><vspace|0.1pag><new-line><htab|0fn><arg|name><htab|0fn>>>>
</body>

<initial|<\collection>
Expand Down
106 changes: 106 additions & 0 deletions TeXmacs/tests/tm/69_11.tm
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<TeXmacs|2.1.2>

<style|<tuple|book|no-page-numbers|chinese>>

<\body>
<\hide-preamble>
\;
</hide-preamble>

<\table-of-contents|toc>
<vspace*|2fn><with|font-series|bold|math-font-series|bold|font-size|1.19|I<space|2spc>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1><vspace|1fn>

<vspace*|1fn><with|font-series|bold|math-font-series|bold|1<space|2spc>\<#521D\>\<#7AA5\>\<#95E8\>\<#5F84\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2><vspace|0.5fn>

1.1<space|2spc> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3>

<vspace*|1fn><with|font-series|bold|math-font-series|bold|2<space|2spc>\<#5C0F\>\<#8BD5\>\<#725B\>\<#5200\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-4><vspace|0.5fn>

<vspace*|1fn><with|font-series|bold|math-font-series|bold|3<space|2spc>\<#767B\>\<#5802\>\<#5165\>\<#5BA4\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-5><vspace|0.5fn>

<vspace*|2fn><with|font-series|bold|math-font-series|bold|font-size|1.19|II<space|2spc>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-6><vspace|1fn>

<vspace*|2fn><with|font-series|bold|math-font-series|bold|font-size|1.19|III<space|2spc>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-7><vspace|1fn>
</table-of-contents>

<part|>

<chapter|\<#521D\>\<#7AA5\>\<#95E8\>\<#5F84\>>

<section|>

<chapter|\<#5C0F\>\<#8BD5\>\<#725B\>\<#5200\>>

<chapter|\<#767B\>\<#5802\>\<#5165\>\<#5BA4\>>

\;

<part|>

<part|>
</body>

<\initial>
<\collection>
<associate|page-medium|paper>
<associate|page-screen-margin|false>
</collection>
</initial>

<\references>
<\collection>
<associate|auto-1|<tuple|I|3>>
<associate|auto-2|<tuple|1|7>>
<associate|auto-3|<tuple|1.1|7>>
<associate|auto-4|<tuple|2|9>>
<associate|auto-5|<tuple|3|11>>
<associate|auto-6|<tuple|II|13>>
<associate|auto-7|<tuple|III|17>>
</collection>
</references>

<\auxiliary>
<\collection>
<\associate|toc>
<vspace*|2fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|font-size|<quote|1.19>|I<space|2spc>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1><vspace|1fn>

<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|1<space|2spc>\<#521D\>\<#7AA5\>\<#95E8\>\<#5F84\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2><vspace|0.5fn>

1.1<space|2spc> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3>

<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|2<space|2spc>\<#5C0F\>\<#8BD5\>\<#725B\>\<#5200\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-4><vspace|0.5fn>

<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|3<space|2spc>\<#767B\>\<#5802\>\<#5165\>\<#5BA4\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-5><vspace|0.5fn>

<vspace*|2fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|font-size|<quote|1.19>|II<space|2spc>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-6><vspace|1fn>

<vspace*|2fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|font-size|<quote|1.19>|III<space|2spc>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-7><vspace|1fn>
</associate>
</collection>
</auxiliary>
2 changes: 2 additions & 0 deletions src/Typeset/Env/env_exec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <lolly/data/numeral.hpp>
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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit b8e7c8d

Please sign in to comment.