Hello.
I would like to make a Module, the returns a value and additionally it should also show a Button, with some more functionality. My try:
test[zahl_] := Module[
{zahlM, zahlL},
zahlM = ToBoxes[zahl];
zahlL = StringJoin["$", ToString[TeXForm[zahl]], "$"];
Print[Button[DisplayForm[zahlM], CopyToClipboard[zahlL]]];
Return[zahl]
];
a = test[7/3];
The Problem is, that the the button doesn't work in the planned way. If I push the printed Button, the thing in the clipboard is (instead of the String saved in "zahlL"):
zahlL$18424
If I use only the Print-command and delete the Return[zahl], it works fine.
Is there a possibility, how to make work both, the Return and the Print in combination?