9
$\begingroup$

Entering Ctrl+= on selected text results in the display of an interpreted Quantity, with the option to accept it, or choose other interpretations. The only way I know of to accept the interpretation is using the pointer to click the check-mark. Is there a way of accepting the interpretation using the keyboard?

Edit to add: I want to do this within a Text Cell. Also, I am using version "10.4.0 for Microsoft Windows (64-bit) (February 26, 2016)".

$\endgroup$
1
  • $\begingroup$ It's worth noting that you don't actually need to accept it to use it. $\endgroup$
    – b3m2a1
    Feb 6, 2018 at 21:02

2 Answers 2

3
$\begingroup$

I recommend accepting input using in-place evaluation. This is done with cmdenter in MacOS. On Windows it is probably done using ctrlenter. In order to use in-place evaluation you first need to select the input, which you can do using shiftleft, if the cursor is placed to the right of the input.

Example:

Example of in-place evaluation.

As a sidenote, I also recommend this approach for prettifying input with entities:

A second example of in-place evaluation.

Normally the entity would stay formatted as code (Entity["Country", "Sweden"]), but I can represent it with the more visually pleasing entity representation that we are used to seeing in output by using in-place evaluation.

$\endgroup$
1
  • 3
    $\begingroup$ In Windows, in-place evaluation is done with Ctrl + Shift + Enter $\endgroup$ Feb 7, 2018 at 14:05
1
$\begingroup$

For programmatic, non-interactive use, where you just want to take the first result, I recommend Interpreter over Ctrl-=,

Interpreter["Quantity"] /@ {"16 miles per hour", "22 gallons", 
  "twelve parsecs", "4 widgets"}

enter image description here

$\endgroup$

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.