Bug introduced in 9.0, persisting through 12.2.
I use the pdconv
function below, in order to show partial derivatives in a much more intuitive way:
pdConv[expr_] :=
Module[{fns},
fns = DeleteDuplicates[
Cases[expr, Derivative[__][g__][__] :> g, Infinity]];
TraditionalForm[
expr /. {Derivative[inds__][g_][vars__] :>
Apply[Defer[D[g, ##]] &,
Transpose[{{vars}, {inds}}] /. {{var_, 0} :>
Sequence[], {var_, 1} :> {var}}],
a_[__] :> a /; MemberQ[fns, a]}]]
$PrePrint = pdConv;
For example:
However, if I try to copy this as LaTeX, and paste it into LyX (a WYSIWYG LaTeX compiler), I get
This is a trivial example, but the equations I am using for my work are much more complicated than this (e.g. a PDE boundary condition with over 100 terms!) However, if I convert into StandardForm
and then do the same, the "Null" doesn't appear. The number of instances of "Nulls" that appear in LyX seems to be higher for expressions that have more brackets.
My questions:
- How can I copy and paste successfully without the Nulls appearing?
- Is there a way to avoid converting the result into
StandardForm
before copying as LaTeX and pasting?