7
$\begingroup$

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.

$\endgroup$

2 Answers 2

5
$\begingroup$

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"]}
          ]
       ]
  }
]
$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$
    – Szabolcs
    Mar 9, 2016 at 12:24
  • $\begingroup$ @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. $\endgroup$ Mar 9, 2016 at 12:27
  • $\begingroup$ 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. $\endgroup$
    – Szabolcs
    Mar 9, 2016 at 12:55
  • $\begingroup$ @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. $\endgroup$ Mar 9, 2016 at 14:03
0
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ 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? $\endgroup$
    – Szabolcs
    Mar 9, 2016 at 14:09

Your Answer

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

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