4
$\begingroup$

Is there a way to display Quantity[] in full form in the output? I know you could use Quantity[valuse, Unit]//InputForm, but what I want is something like Quantity[Placeholder["tip"], "Meters"], but with an actual named placeholder instead of the code.

(I am trying to use this in the user interface, so the the placeholder could also serve as a tooltip box. This is something I would hope it could looklike: enter image description here)

$\endgroup$
7
$\begingroup$
Defer[Quantity][Placeholder["tip"],"Meters"]

enter image description here

or

HoldForm[Quantity][Placeholder["tip"],"Meters"]

enter image description here

The second method requires ReleaseHold to evaluate.

$\endgroup$
4
$\begingroup$

You can also use Inactive in V10, of course the appearance will be slightly different.

Inactive[Quantity][Placeholder["Tooltip"], "Meters"]

Mathematica graphics

And use Activate to evaluate it:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.