Typst:参照の出力を日本語の習慣に合わせて調整する
全項目importの形でパッケージを読み込む。
| -- This is file 'scspeddy.lua'. | |
| local module_name = 'scspeedy' | |
| local version = '2024-12-08' | |
| -- the module | |
| scspeedy = {} | |
| ---------------------------------------- | |
| -- logging | |
| local function make_message(...) | |
| return module_name..": "..table.concat({...}, ": ") |
| %% This is file 'tcmathbold.sty'. | |
| %% Copyright (c) 024 Takayuki YATO (aka. "ZR") | |
| %% This package is distributed under the MIT License. | |
| \NeedsTeXFormat{LaTeX2e} | |
| \ProvidesPackage{tcmathbold}[2024/10/10 v0.1] | |
| % とりあえず, "極太"ウェイトの書体として | |
| % "Crimson Pro Black"のフォントを借りることにする. | |
| % Crimson Pro Black (立体) = OT1/CrimsonPro-TLF/ub/n | |
| % Crimson Pro Black (斜体) = OT1/CrimsonPro-TLF/ub/it |
| %% | |
| %% This is file 'tcnicenumber.sty'. | |
| %% | |
| %% Copyright (c) 2024 Takayuki YATO (aka. "ZR") | |
| %% GitHub: https://github.com/zr-tex8r | |
| %% Twitter: @zr_tex8r | |
| %% | |
| %% This package is distributed under the MIT License. | |
| %% |
| # ZRJCode.pm | |
| # | |
| #### start package | |
| package ZRJCode; | |
| use strict qw( refs vars subs ); | |
| our $VERSION = 0.002_03; | |
| our $mod_date = "2024/07/20"; | |
| require Exporter; | |
| our @ISA = qw( Exporter ); |
| #let use-examples(body) = { | |
| show figure.where(kind: "example"): it => { | |
| assert(it.body.func() == metadata) | |
| // here implicit context is given by show rule | |
| let number = numbering(it.numbering, ..it.counter.get()) | |
| grid( | |
| columns: (auto, 1fr), | |
| rows: (auto, auto), | |
| column-gutter: 1em, | |
| row-gutter: 1em, |
Typst:日本語用にnumberingを拡張したやつ
Typstのnumbering関数の拡張版にあたるja-numbering関数を提供する。この関数は、標準のnumberingがサポートするカウンタスタイルに加えて、日本でよく使われる他のカウンタスタイル(例えば丸数字“①、②、③……”など)をサポートする。
同様の機能をもつ既存パッケージとして[numberingx][]があるが、numberingxが独自の書式文字列の文法を採用しているのに対して、本パッケージはnumbering関数の書式文字列の文法をそのまま踏襲している。すなわち、書式文字列内ではカウンタスタイルの部分は特定のUnicode文字1つ(例えば“①”)で表される。
| \catcode`\{=1 \catcode`\}=2 \catcode`\$=3 \catcode`\^=7 | |
| \mathcode`\+="202B \mathcode`\-="2200 \mathcode`\=="303D | |
| \hsize=77mm \vsize=22mm \scriptspace=0.5pt | |
| \parfillskip=0pt plus 1fil \nulldelimiterspace=1.2pt | |
| \delimiterfactor=901 \delimitershortfall=5pt | |
| \thinmuskip=3mu \medmuskip=4mu \thickmuskip=5mu | |
| \font\tt=cmr10 \font\st=cmr7 \tt\fam0 | |
| \font\tm=cmmi10 \font\ts=cmsy10 \font\tx=cmex10 | |
| \textfont0=\tt \scriptfont0=\st \scriptscriptfont0=\st | |
| \textfont1=\tm \scriptfont1=\tm \scriptscriptfont1=\tm |
This is a version of texmas.tex where TCX conversion is decoded.
It is just an ordinary (yes🙃) plain TeX code, so you can compile it with pdftex.
pdftex texmasd.tex