Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Mathematica can create and play slide shows (for presentations). How can I go to the next or previous slide with a simple keyboard shortcut?

Using the mouse-clickable buttons at the top seem to be too slow to be effective. Page up and Page down work, but these keys are missing on many laptops. I am using a Mac laptop where Page Down is Fn+Down, a two-handed gesture.

share|improve this question
up vote 5 down vote accepted

Here is one programmatic way: the combinations will be Option (Alt) + up / down arrows. Here is the code:

SetOptions[your-notebook, 
  NotebookEventActions -> {
    "DownArrowKeyDown" :> 
       If[MemberQ[CurrentValue["ModifierKeys"], "Option"],
          FrontEndExecute[
             {FrontEndToken[EvaluationNotebook[], "ScrollPageNext"]}
          ]
       ],
    "UpArrowKeyDown" :> 
       If[MemberQ[CurrentValue["ModifierKeys"], "Option"], 
          FrontEndExecute[
             {FrontEndToken[EvaluationNotebook[],"ScrollPagePrevious"]}
          ]
       ]
  }
]
share|improve this answer
    
The implication of your answer is then that there is no builtin way to do this. Maybe the problem is with how I planned to do the presentation. Mathematica is not PowerPoint, the slides are scrollable, the cells are evaluatable (and will be evaluated), so maybe there is no need for a quick-shortcut. If I didn't want to evaluate cells and show the result right there, I could just use PowerPoint. – Szabolcs Mar 9 at 12:24
    
@Szabolcs First, the only implication of my answer is that I don't know a built-in way, not that there isn't one. Second, I don't quite see why you need it to be a built-in. For my suggestion, one only has to do it once per notebook, and save it - and it should work just as you requested. – Leonid Shifrin Mar 9 at 12:27
    
Sorry, that first sentence was meant to be a question :-) I have never used this functionality and I assumed that it would be something people need all the time with presentations, so I really expected it to be built-in. – Szabolcs Mar 9 at 12:55
    
@Szabolcs Yeah well, may be you are right, this particular use case should be pretty common. My point was that I'd prefer clean programmatic ways to change or add things as the users see fit, and then the built-in things built on top of that transparently - since the set of things users may want / need, is always much larger than what the system can provide out of the box. In this context, I consider my suggestion above to be somewhere in between, since that still feels like a bit of a hack. – Leonid Shifrin Mar 9 at 14:03

On a Mac, try going to System Preferences>Keyboard>Shortcuts>AppShortcuts then click on the + button (at the bottom) to add a keyboard shortcut. Name your shortcut "SlideAdvance", select Mathematica from the list of applications, then choose the single (one-handed) keystroke you wish. Continue answering queries in the dialog boxes.

share|improve this answer
    
The problem is that I need to enter the exact name of the menu command that the shortcut should trigger. I cannot find a menu command for going to the next slide. Entering "SlideAdvance" does not work (i.e. the short cut won't have an effect when I try it). I am on OS X 10.11.3. dropbox.com/s/f4mqnojl1jz6v8j/… Did you manage to get this working? – Szabolcs Mar 9 at 14:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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