2
$\begingroup$

If I evaluate the following cell:

Quantity["PlanckConstant"]

I get as an output a very concise format of this quantity:

enter image description here

Also, compare the legibility of these two cells:

enter image description here

I want to find a way to create this:

enter image description here

without first evaluating a cell.

I just assume that the notebook front-end allows the user to achieve such a thing: just as right clicking on Sqrt[2] and clicking on Convert To -> StandrdForm converts this expression to $\sqrt{2}$.

$\endgroup$
4
  • $\begingroup$ Style["h", Italic] ? $\endgroup$
    – eldo
    Commented Sep 21, 2023 at 7:44
  • $\begingroup$ Nope. Style["h", Italic] is not a Quantity. $\endgroup$
    – tush
    Commented Sep 21, 2023 at 7:46
  • $\begingroup$ if you mean you want to type that slanted h and have evaluate to Quantity["PlanckConstant"] without doing anything, then I do not know how to do that. May be someone else will have an idea. This seems to be builtin the notebook interface itself. Will delete my answer in this case. $\endgroup$
    – Nasser
    Commented Sep 21, 2023 at 8:13
  • $\begingroup$ If I understand correctly: Select your Quantity[...], then press Ctrl+Shift+Enter (or go to the menu Evaluation > Evaluate in place). This will evaluate just the selected expression and not the whole cell :) $\endgroup$
    – Domen
    Commented Sep 21, 2023 at 8:47

1 Answer 1

2
$\begingroup$

You can do evaluation in place, which can be achieved either by clicking Ctrl+Shift+Enter or in the menu Evaluation > Evaluate in Place.

enter image description here

$\endgroup$
2
  • $\begingroup$ By the way, are you using any shortcut to delete the parentheses? I know the CTRL with ^ shortcut to create parentheses around the selection. But not a shortcut to delete them. $\endgroup$
    – tush
    Commented Sep 21, 2023 at 8:59
  • $\begingroup$ Uhm, no, just the plain old Backspace and Delete :) $\endgroup$
    – Domen
    Commented Sep 21, 2023 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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