Sizing issue when using large dv or pdv
Hello, I have stumbled over a small annoyance when using large (partial) differential operators. I think you can see the problem in the attached image, I won't try to explain it using words:
Here is some code to reproduce the behavior:
#import "@preview/physica:0.9.5": *
$
&dv(f(x), x, s: "large") \
&dv((1-x)x, x, s: "large") \
&pdv(f(x,y), x, s: "large")
$
More obscure cases but always the last bracket:
$
&dv(v[(t)], t, s, s: "large") \
&dv(v\]t\[, t, s: "large") \
&dv(t dot bra(a(t)), t, s: "large") \
&dv(a expval(x), x, s: "large") \
$
I can only produce this behavior by adding text next to the brackets. I am not an expert but I guess that somehow messes with some lr's? I hope this can be fixed somehow and I am happy to provide more information if needed.
Awesome project btw - I use it for lecture notes on Quantum Mechanics and didn't run into any issues yet (except this one here).
Edit: I pinpointed the issue to the size calculation in __display_derivative. Changing max to min "solves" the problem but is probably undesirable because it will not resize matching brackets, e.g. dv((1-x),x) will not have big parentheses...
For now I removed the size calculation and am now only using the bestsize = size_func in my local copy as I don't need big parentheses that bad.
The thing is that you actually (most likely) don't want large parentheses?
The idea of large is that for very low but long formulas, the parentheses around the expression to be derived can be matched to the size of the d/dx expression.
See #26 and #46.
If you don't want this, you'll need to use it as before this was merged: dv(,x)f(x).
Am I correct in my assessment?
The documentation says this:
(2) large, so that “d/dx” operator is put in front of the (potentially very large) function expression, and the size of the parentheses are adapted to match the highest of the operator and the function expression.
Do you have suggestions for improvement?