I really enjoy structuring Mathematica Notebook with different part & sub-parts, however, I have not yet found the shortcuts to navigate it efficiently.

For example, how can I use keyboard shortcuts to:

  • Go from one paragraph to another?
  • From one cell to another?
  • "Open" or "Expend"?
  • What do you mean by parts? Groupings of input/output? – soandos May 26 '11 at 14:56
  • I guess I mean "Cell" and "Expand" them. – 500 May 26 '11 at 15:01
  • There's also the Mathematica mode for Emacs, which is completely customizable. – Simon Jul 12 '11 at 3:14

To open and close cell groups you want Shift+Ctrl+{ and Shift+Ctrl+} respectively.

There are heaps of shortcut keys listed in the documentation:
NotebookShortcuts and KeyboardShortcutListing

If you want anything extra, you need to combine the appropriate command or FrontEndToken and put it into the KeyEventTranslations.tr file. This file can be found in

FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", 
              "TextResources", "X", "KeyEventTranslations.tr"}]

where you replace "X" by the platform you have, either "X", "Windows" or "OSX".

For example, a shortcut for moving to the next cell can be implemented by adding

Item[KeyEvent["g", Modifiers -> {Control}], 
     FrontEndExecute[SelectionMove[InputNotebook[], Next, Cell]]]

to the KeyEventTranslations.tr.

For more info, here's a SO question on customizing mathematica shortcuts (with good links) and one on adding a key to (un)comment code in Mathematica 7.

  • @500: Not a problem. Did you manage to get all of the navigation shortcuts you wanted? – Simon Jun 12 '11 at 2:46
  • Not yet, I have to much work :( Actually, may I send you something ? I am having a problem since this morning going absolutely nuts, maybe I am missing something evident to your eyes. I would not know how to address the problem on the forum without posting a huge question. It is essentially about nested Function & Manipulate ! – 500 Jun 12 '11 at 3:03
  • @500: Sure, you can find my email address on my homepage. I'm meant to be typing up a thesis at the moment, so I can't promise a quick reply. – Simon Jun 12 '11 at 4:09

There are no ways to do this in Mathematica, other than the arrow keys (which I'm sure you already knew about). I don't know why, but they never seem to have developed a navigational like you can find in many different programs. Sorry.

  • Ah, Thank You Soandos. I will leave this unanswered yet in case somebody knows an Hack to that. – 500 May 26 '11 at 15:06
  • No problem. I don't think there can be though (unless they replace the whole GUI for mathematica, and use the .NET api to do the work behind the scenes, which would be a LOT of work for little gain). – soandos May 26 '11 at 15:10

One thing that you can do to skip past cells quickly is to hold Shift and press up/down to highlight the cell(s) you want to skip. Then let go of Shift and press the same direction to advance to the space just above/below the last highlighted cell.

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.