Skip to content

Commit

Permalink
Replace diff with partial (#42)
Browse files Browse the repository at this point in the history
The diff symbol has been deprecated since Typst 0.11.0. Though it's still available in 0.12, it will be removed in 0.13 (typst/typst#5388).
  • Loading branch information
Jacobgarm authored Dec 9, 2024
1 parent 4ade7cd commit ef5e84f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion demo.typ
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Set((x, y), pdv(f,x,y,[2,1]) + pdv(f,x,y,[1,2]) < epsilon) \
quad
ket(n^((1))) = sum_(k in.not D) mel(k^((0)), V, n^((0))) / (E_n^((0)) - E_k^((0))) ket(k^((0))),
quad
integral_V dd(V) (pdv(cal(L), phi) - diff_mu (pdv(cal(L), (diff_mu phi)))) = 0 \
integral_V dd(V) (pdv(cal(L), phi) - partial_mu (pdv(cal(L), (partial_mu phi)))) = 0 \
dd(s,2) = -(1-(2G M)/r) dd(t,2) + (1-(2G M)/r)^(-1) dd(r,2) + r^2 dd(Omega,2)
$
Expand Down
Binary file modified physica-manual.pdf
Binary file not shown.
12 changes: 6 additions & 6 deletions physica-manual.typ
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ xmat(2, 2, #g)`)
[`matrixelement(`..`)`],
[`mel`],
[
`mel(n, diff_nu H, m)` \ #sym.arrow $mel(n, diff_nu H, m)$
`mel(n, partial_nu H, m)` \ #sym.arrow $mel(n, partial_nu H, m)$
],
[matrix element, same as `braket(n,M,n)`],
)
Expand Down Expand Up @@ -753,7 +753,7 @@ Function: `partialderivative(`_f_, \*_args_, \*\*_kwargs_`)`, abbreviated as `pd
- _f_: the function, which can be `#none` or omitted,
- positional _args_: the variable names, *optionally* followed by an order number e.g. `2`, or an order array e.g. `[2,3]`, `[k]`, `[m n, lambda+1]`.
- named _kwargs_:
- `d`: the differential symbol [default: `diff`].
- `d`: the differential symbol [default: `partial`].
- `s`: the "slash" separating the numerator and denominator [default: `none`], by default it produces the normal fraction form $pdv(f,x)$. The most common non-default is `slash` or simply `\/`, so as to create a flat form $pdv(f,x,s:\/)$ that fits inline.
- `total`: the user-specified total order.
- If it is absent, then (1) if the orders assigned to all variables are numeric, the total order number will be *automatically computed*; (2) if non-number symbols are present, computation will be attempted with minimum effort, and a user override with argument `total` may be necessary.
Expand Down Expand Up @@ -821,8 +821,8 @@ Function: `partialderivative(`_f_, \*_args_, \*\*_kwargs_`)`, abbreviated as `pd
]
)

*(13)* #hl(`integral_V dd(V) (pdv(cal(L), phi) - diff_mu (pdv(cal(L), (diff_mu phi)))) = 0`) \
$ integral_V dd(V) (pdv(cal(L), phi) - diff_mu (pdv(cal(L), (diff_mu phi)))) = 0 $
*(13)* #hl(`integral_V dd(V) (pdv(cal(L), phi) - partial_mu (pdv(cal(L), (partial_mu phi)))) = 0`) \
$ integral_V dd(V) (pdv(cal(L), phi) - partial_mu (pdv(cal(L), (partial_mu phi)))) = 0 $

== Special show rules

Expand Down Expand Up @@ -1057,8 +1057,8 @@ Function: `tensor(`_symbol_, \*_args_`)`.
],
)

*(9)* `grad_mu A^nu = diff_mu A^nu + tensor(Gamma,+nu,-mu,-lambda) A^lambda`
$ grad_mu A^nu = diff_mu A^nu + tensor(Gamma,+nu,-mu,-lambda) A^lambda $
*(9)* `grad_mu A^nu = partial_mu A^nu + tensor(Gamma,+nu,-mu,-lambda) A^lambda`
$ grad_mu A^nu = partial_mu A^nu + tensor(Gamma,+nu,-mu,-lambda) A^lambda $

=== Isotopes

Expand Down
8 changes: 4 additions & 4 deletions physica.typ
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
assert(type(xs) == array, message: "expecting an array of variable names")
let arrays = () // array of arrays
for f in fs {
arrays.push(xs.map((x) => __mate(math.frac($diff#f$, $diff#x$), big)))
arrays.push(xs.map((x) => __mate(math.frac($partial#f$, $partial#x$), big)))
}
math.mat(delim: delim, ..arrays)
}
Expand All @@ -364,8 +364,8 @@
for c in range(order) {
let xc = xs.at(c)
row_array.push(__mate(math.frac(
$diff^2 #f$,
if xr == xc { $diff #xr^2$ } else { $diff #xr diff #xc$ }
$partial^2 #f$,
if xr == xc { $partial #xr^2$ } else { $partial #xr partial #xc$ }
), big))
}
row_arrays.push(row_array)
Expand Down Expand Up @@ -693,7 +693,7 @@
__bare_minimum_effort_symbolic_add(orders)
}

let d = kwargs.at("d", default: $diff$)
let d = kwargs.at("d", default: $partial$)

let lowers = ()
for i in range(var_num) {
Expand Down

0 comments on commit ef5e84f

Please sign in to comment.