Convert Derivative[1][f] to f'
You can use TemplateBox
to control how derivatives are copy/pasted:
MakeBoxes[Derivative[n_Integer?(Between[{1,4}])][f_], StandardForm] := With[
{p=StringRepeat["\[Prime]",n], q=StringRepeat["'",n]},
TemplateBox[
{MakeBoxes[f]},
"Derivative1",
DisplayFunction->(SuperscriptBox[#1, p, MultilineFunction->None]&),
InterpretationFunction->(RowBox[{#1, q}]&)
]
]
MakeBoxes[Derivative[n__Integer][f_], StandardForm] := TemplateBox[
{MakeBoxes[f], RowBox[BoxForm`MakeInfixForm[{n}, ",", StandardForm]]},
"Derivative2",
DisplayFunction->(SuperscriptBox[#1, RowBox[{"(",#2,")"}],MultilineFunction->None]&),
InterpretationFunction->(RowBox[{RowBox[{"Derivative", "[", #2,"]"}],"[",#1,"]"}]&)
]
One approach is to override Derivative
box formatting and use Copy As -> Plain Text
MakeBoxes[Derivative[n_Integer][f_], form_] := RowBox[{ToBoxes@f, StringRepeat["'", n]}]