From 58610a53bc2c742b9b9076ae1dc6449eb9b71e84 Mon Sep 17 00:00:00 2001 From: Shunichiro Nomura Date: Tue, 17 Sep 2024 09:36:31 +0900 Subject: [PATCH 1/2] Improve section reference show rule --- template.typ | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/template.typ b/template.typ index bf91177..00346e6 100644 --- a/template.typ +++ b/template.typ @@ -39,6 +39,31 @@ v(-0.8 * measure(2 * a).width) } + // Section reference settings + show ref: it => { + let el = it.element + if el != none and el.func() == heading { + context { + let heading_counts = counter(heading).at(it.element.location()) + if el.depth == 1 { + // 章 + [第#heading_counts.at(0)章] + // counts + } else if el.depth == 2 { + // 節 + [第#heading_counts.at(0).#heading_counts.at(1)節] + } else if el.depth == 3 { + // 項 + [第#heading_counts.at(0).#heading_counts.at(1).#heading_counts.at(2)項] + } else { + it + } + } + } else { + it + } + } + // Paragraph settings show par: set block(spacing: 0.65em) From 6249492a2bf351db954b8e3e1bd56a24c7fff677 Mon Sep 17 00:00:00 2001 From: Shunichiro Nomura Date: Tue, 17 Sep 2024 09:37:49 +0900 Subject: [PATCH 2/2] Update example.pdf --- example.pdf | Bin 304525 -> 304525 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/example.pdf b/example.pdf index 2c88f4c948bad2d8e0759bb8fb4b31a853a83477..fcf21311bf713057804c0a32fe6b42d120fda0ea 100644 GIT binary patch delta 212 zcmeA@E!2BjXhR1(OBxVN|8S8>Wb*=c_H_tu^Zu>v`?oS~-@lbfR|YJ+9jGcI3ZbGs zL5F#Jf(}byzM8p#fw8%XVU#A9f`Yzpeu_(CNveW|iX I{G}{%04a?`F#rGn delta 212 zcmeA@E!2BjXhR1(iyIJ3|8S8>Wb*=c_H_tu^Zu>v`?oS~-@lbfR|YJ+9jGcI3ZbGs zL5F#Jf(}byzM7$dsj0cCd6XuXf`Yzpeu_(CNveW|ic z2Bub~=0G%^eLjmeGT&xC%L}mxk8&sTg0ghqph`>gj7*E*fJC3H^zBv)Smar8NKVgR H$|45<897A5