I've been playing with inline evaluation and I've came to the conclusion that it's most convenient to put the Dynamic@ inside the inline cell, so I've started to search for a way to omit typing it altogether. I've tried using CellEvaluationFunction and CellProlog, but with no luck. How can I achieve this?

Also, it would be best if the wrapping with Dynamic[] occurred only in inline cell evaluations (which happen in ordinary text cells)

  • $\begingroup$ Well, that seems like a good enough solution. I mean I could do an input alias with a placeholder and set the focus to the placeholder. Why is Dynamic such a bad thing? I mean, beside the irritating information when I open the document it seems to work fine... Different, but related problem is how to evaluate an inline cell without having to select it first (even though I can do it with keyboard) $\endgroup$
    – Ranza
    Commented May 8, 2014 at 18:21
  • $\begingroup$ Not a big problem but each Dynamic cell uses part of processor. Is my answer ok? $\endgroup$
    – Kuba
    Commented May 8, 2014 at 19:46
  • $\begingroup$ It's perfect, thanks :) You're also right about the CPU, drains the battery waaay faster. $\endgroup$
    – Ranza
    Commented May 8, 2014 at 21:25

1 Answer 1


You need to add this piece of code and use it instead of Ctrl+9 for you own inline cell:

Item[KeyEvent["t", Modifiers -> {Control}],
            Cell[ BoxData[ RowBox[{"Dynamic", "[", "\[Placeholder]", "]"}] ], 
                 CellEventActions -> {{"MenuCommand", "HandleShiftReturn"} :> {
                      SelectionMove[EvaluationCell[], All, CellContents];   
        FrontEnd`SelectionMove[FrontEnd`InputNotebook[], Previous, Character, 2];
        FrontEnd`SelectionMove[FrontEnd`InputNotebook[], All, Character]
  • Now with Ctrl+f, or whatever you want that is free, you will create a cell with Dynamic already written.

  • Also Shift+Enter results in evaluation in place without selecting it.


If you want numeric keypad Enter to do this Evaluation In Place you can use {"MenuCommand", "EvaluateCells"} event instead of "HandleShiftReturn". For me it would be great since I hardly ever use Shift+Enter


Here is a tutorial how to add a new shortcut: Automating Esc [[ Esc formatting?

Here is a reference link about how to catch Shift+Enter

  • $\begingroup$ Works great, thanks! The only thing is that the focus doesn't move to the placeholder after insertion, but I can live with that. $\endgroup$
    – Ranza
    Commented May 8, 2014 at 20:25
  • $\begingroup$ I'm not sure why you've removed the closing bracket - it works the same way with it. It's much better but I still need to make a some keystrokes (move selection to the left and then Tab). Thanks, for helping me out so much! $\endgroup$
    – Ranza
    Commented May 8, 2014 at 20:32
  • $\begingroup$ Works flawlessly now! You sir are awesome! $\endgroup$
    – Ranza
    Commented May 8, 2014 at 22:09
  • $\begingroup$ @Ranza Great, good luck :) $\endgroup$
    – Kuba
    Commented May 8, 2014 at 22:11
  • $\begingroup$ Of course I'm interested! $\endgroup$
    – Ranza
    Commented May 9, 2014 at 16:23

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.