5
$\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$

2 Answers 2

8
$\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$
5
$\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$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.