Clear@pdConv;
pdConv[f_, pat_List] := pdConv[f, Alternatives @@ pat]
defaultpat = _Subscript | _Symbol?(Context[#] === Context[] &);
pdConv[f_, pat_ : defaultpat] :=
f /. {Derivative[inds__][g : pat][vars__] :>
Apply[Defer@
D[g, ##] &, {{vars}, {inds}}\[Transpose] /. {{var_, 0} :>
Sequence[], {var_, 1} :> {var}}], (g : pat)[__] :> g} // TraditionalForm
Please read the document carefully to understand why the code is modified in this manner.
The function can be used in 2 ways. The one-argument syntax should handle most of the usual cases:
D[Subscript[f, 1][x, y], x, x] + D[g[x, y], y] +
Subscript[f, 1][x, y] + g[x, y] == 0 // pdConv

For edge cases, set a second argument to specify functions whose independent variables should be omitted:
pdConv[D[\[FormalA][x, y], x] + D[OverTilde[v][x, y], y] +
f[\[FormalA][x, y], OverTilde[v][x, y]] == 0, {\[FormalA], OverTilde[v]}]

g[vars]- >g– xzczd Jan 30 '24 at 08:12