diff --git a/physica-manual.pdf b/physica-manual.pdf index 152cdae..127a66b 100644 Binary files a/physica-manual.pdf and b/physica-manual.pdf differ diff --git a/physica-manual.typ b/physica-manual.typ index 240443e..d0659d1 100644 --- a/physica-manual.typ +++ b/physica-manual.typ @@ -165,7 +165,7 @@ All symbols need to be used in *math mode* `$...$`. [`TT`], [], [`v^TT, A^TT` #sym.arrow $v^TT, A^TT$], - [transpose], + [transpose, also see\ @matrix-tranpose], [`vectorbold(`_content_`)`], [`vb`], @@ -234,7 +234,7 @@ All symbols need to be used in *math mode* `$...$`. [`TT`], [], [`v^TT, A^TT` #sym.arrow $v^TT, A^TT$], - [transpose], + [transpose, also see\ @matrix-tranpose], [#builtin([`mat(`...`)`])], [], @@ -785,6 +785,39 @@ In the default font, the Typst built-in symbol `planck.reduce` $planck.reduce$ l [$ i hbar pdv(,t) psi = -frac(hbar^2, 2m) laplacian psi $], ) +=== Matrix transpose + +#v(1em) + +Matrix transposition can be simply written as `..^T`, where the `T` will be +formatted properly to represent transposition instead of a normal letter $T$. +This conversion is disabled if the base is integral symbol. + +To enable this feature, users need to first import this and call +```typ +#import "...(this physica package)...": super-T-as-transpose +#show: super-T-as-transpose +``` + +#align(center, [*Examples*]) + +#show: super-T-as-transpose // Necessary! + +#grid( + columns: (50%, 50%), + row-gutter: 1em, + column-gutter: 2em, + + [ + *(1)* #hl(`(A_n B_n)^T = B_n^T A_n^T`) \ + $ (A_n B_n)^T = B_n^T A_n^T $ + ], + [ + *(2)* #hl(`integral_0^T A^T f(x) dif x`) \ + $ integral_0^T A^T f(x) dif x $ + ], +) + === Tensors #v(1em) diff --git a/physica.typ b/physica.typ index 534cdb0..1fb3777 100644 --- a/physica.typ +++ b/physica.typ @@ -151,6 +151,7 @@ #let vecrow(..content) = $lr(( #content.pos().join(",") ))$ +// Prefer using super-T-as-transpose() #let TT = $sans(upright(T))$ #let __vector(a, accent, be_bold) = { @@ -634,6 +635,18 @@ // Credit: Enivex in https://github.com/typst/typst/issues/355 was very helpful. #let hbar = (sym.wj, move(dy: -0.08em, strike(offset: -0.55em, extent: -0.05em, sym.planck)), sym.wj).join() +#let super-T-as-transpose(document) = { + show math.attach: elem => { + if elem.base != [∫] and elem.at("t", default: none) == [T] { + $attach(elem.base, t: TT, b: elem.at("b", default: #none))$ + } else { + elem + } + } + + document +} + #let tensor(T, ..sink) = { let args = sink.pos()