2
$\begingroup$

Is it possible to emulate powerpoint animation behavior during a presentation with Mathematica?

Considering a notebook with cell of numbered items or even several cells, is it possible to display a new cell or item with each click (or key press), probably in presentation mode?

$\endgroup$
4
  • 2
    $\begingroup$ Have you tried the slide show document style? Try File > New > Slide Show .... $\endgroup$ May 22, 2013 at 15:48
  • $\begingroup$ Do you want to convert every cell into a separate slide / display cells in a notebook sequentially /...? Then you should update your question and explain in more detail what you want to do. $\endgroup$
    – Yves Klett
    May 22, 2013 at 16:57
  • $\begingroup$ How about if you start off with only the first cell opened, then open the second, then the third, etc. You can do this directly by double clicking on the cell brackets at the right of the cells. $\endgroup$
    – bill s
    May 24, 2013 at 3:56
  • $\begingroup$ Wono, I did a rather drastic facelift of your question based on what I think you want to do (and what I would consider useful for others, too). Hopefully this concurs with your intentions. Not sure if there is a simple answer to this other than "No", but time will tell. $\endgroup$
    – Yves Klett
    May 24, 2013 at 6:56

1 Answer 1

6
$\begingroup$

Something like this?

disks=Table[Disk[{Sin[phi],Cos[phi]},0.1], {phi, 0,2 Pi(9/10), 2 Pi/10}];

DynamicModule[{clicks=1},
    EventHandler[
        Graphics[
            Dynamic@Take[disks, clicks], 
            PlotRange->1.2{{-1,1}, {-1,1}}],
        "MouseClicked":>(
            clicks=Mod[clicks+1, Length@disks,1])]
]

or simply

FlipView[Graphics[#, PlotRange -> 1.2 {{-1, 1}, {-1, 1}}] & /@ disks]

Ooor

Options[generateCellByCellNotebook]={"Replace"->False};

generateCellByCellNotebook[nbo_NotebookObject, op:OptionsPattern[]]:=
    generateCellByCellNotebook[NotebookGet@nbo, op];

generateCellByCellNotebook[Notebook[{cell1_, restCells___}, opts___], OptionsPattern[]]:=
    Module[{newNbo, newNb},
    newNb= Notebook[{cell1}, opts, 
        NotebookEventActions:>{"MouseClicked":>
            With[{snb=SelectedNotebook[]},
            With[{
                allCells=CurrentValue[snb, {TaggingRules, "Powerpointify", "RestCells"}],
                counter=CurrentValue[snb, {TaggingRules, "Powerpointify","NextCellCounter"}, 1]},
                    If[counter<=Length@allCells,
                        If[OptionValue["Replace"], NotebookDelete@Last@Cells@snb];
                        SelectionMove[snb, After, Notebook];
                        NotebookWrite[snb, allCells[[counter]]];
                        ++CurrentValue[snb, {TaggingRules, "Powerpointify","NextCellCounter"}];
                    ]   
            ]
            ]}
    ];
    newNbo=NotebookPut[newNb];
    CurrentValue[newNbo, {TaggingRules, "Powerpointify","RestCells"}]={restCells};
]

You would use it by doing generateCellByCellNotebook[someNotebookObject, Replace->True] if you want the cell replaced on each click or Replace->False (default) if you want to append them

Conclusion: I'm not exactly sure what you mean :P

$\endgroup$
2
  • $\begingroup$ Wow, big +1. One flipview broke down though when I called generateCellByCellNotebook[EvaluationNotebook[]]. $\endgroup$ May 24, 2013 at 19:29
  • $\begingroup$ +1 I didn't know about FlipView[]... amazing! $\endgroup$
    – Rod
    May 24, 2013 at 20:42

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.