jaconf
https://typst.app/universe/package/jaconf/
日本語の学会論文に適したTypstテンプレート.
問題
そのままでも使いやすいが,文章中での数式の参照が「(1)」となっているところを「式 (1)」にしたい.
解決
- テンプレートをGitからクローン
- 編集中のTypstファイルと同じディレクトリにクローンしたtypst-jp-conf-template/を配置.
- typst-jp-conf-template / jaconf / lib.typを開く.
- #let jaconf 内部に数式の補足語を追加
// 補足語 Supplement supplement-image: [図], supplement-table: [表], supplement-equation: [式], //この行を追加 supplement-separator: [: ],
- #let jaconf の body 内部にある show ref 部分を以下のように書き直す
// Configure appearance of references show ref: it => { // Equation -> (n). // See https://typst.app/docs/reference/model/ref/ let eq = math.equation let el = it.element if el != none and el.func() == eq { let num = numbering(el.numbering, ..counter(eq).at(el.location())) link(el.location(), [#supplement-equation #num]) } // Sections -> n章m節l項. // Appendix -> 付録A. else if el != none and el.func() == heading { let sec-cnt = counter(heading).at(el.location()) if el.numbering != numbering-appendix { if el.depth == 1 { link(el.location(), [#sec-cnt.at(0)章]) } else if el.depth == 2{ link(el.location(), [#sec-cnt.at(0)章#sec-cnt.at(1)節]) } else if el.depth == 3{ link(el.location(), [#sec-cnt.at(0)章#sec-cnt.at(1)節#sec-cnt.at(2)項]) } } else { link(el.location(), [ 付録#numbering(el.numbering, ..sec-cnt) ]) } } else { it } }
- 編集中のTypstファイルのjaconfのインポートを以下に変更.
#import "./typst-jp-conf-template/jaconf/lib.typ": jaconf, definition, lemma, theorem, corollary, proof, appendix