3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Typst】jaconfで数式の文中参照を「式(i)」にしたい

Posted at

jaconf

https://typst.app/universe/package/jaconf/
日本語の学会論文に適したTypstテンプレート.

問題

そのままでも使いやすいが,文章中での数式の参照が「(1)」となっているところを「式 (1)」にしたい.

解決

  1. テンプレートをGitからクローン
  2. 編集中のTypstファイルと同じディレクトリにクローンしたtypst-jp-conf-template/を配置.
  3. typst-jp-conf-template / jaconf / lib.typを開く.
  4. #let jaconf 内部に数式の補足語を追加
    // 補足語 Supplement
    supplement-image: [図],
    supplement-table: [表],
    supplement-equation: [式], //この行を追加
    supplement-separator: [: ],
    
  5. #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
      }
    }
    
  6. 編集中のTypstファイルのjaconfのインポートを以下に変更.
    #import "./typst-jp-conf-template/jaconf/lib.typ": jaconf, definition, lemma, theorem, corollary, proof, appendix
    
3
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?