diff --git a/example.pdf b/example.pdf index 2c88f4c..fcf2131 100644 Binary files a/example.pdf and b/example.pdf differ 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)