@@ -35,6 +35,72 @@ or printed with the `--show-template` option.
3535If you wish to use another template, you can do so with the
3636` --use-template FILE ` option.
3737
38+ ## Vertical Slides
39+
40+ Slides default to a "horizontal" arrangement by default. This means that each
41+ slide follows the next in a linear progression. If you instead wish to add
42+ an additional dimension to your slides and have "vertical" groupings under a
43+ given "horizontal" slide, you may pass the keyword argument "direction" to the
44+ {meth}` next_slide<manim_slides.slide.Slide.next_slide> `
45+ method and give it the argument "vertical". The "horizontal" slides
46+ will be the main progression of your presentation accessible by tabbing left
47+ or right using those arrow keys. For "vertical" slides you move to the "horizontal"
48+ parent slide and use the up and down keys to navigate through the slides that are
49+ grouped under the initial slide. You may still use the left/right navigation to
50+ move from any slide in the vertical stack to the next "horizontal" slide.
51+
52+ In the following example we have only the linear "horizontal" slides.
53+ Note that no direction argument is passed to
54+ {meth}` self.next_slide()<manim_slides.slide.Slide.next_slide> ` .
55+
56+ ``` {eval-rst}
57+ .. manim-slides:: HorizontalSlides
58+ :config_options: slide_number=true
59+
60+ from manim import *
61+ from manim_slides import Slide
62+
63+ class HorizontalSlides(Slide):
64+ def construct(self):
65+ circle = Circle(radius=3, color=BLUE)
66+ dot = Dot()
67+
68+ self.play(GrowFromCenter(circle))
69+
70+ self.next_slide(loop=True)
71+ self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
72+ self.next_slide()
73+
74+ self.play(dot.animate.move_to(ORIGIN))
75+ ```
76+
77+ In this example the second slide is a "vertical" slide so the left right progression
78+ moves from slide 1 to slide 3, while to access slide 2 you must be on slide 1 and
79+ press the down key.
80+
81+ ``` {eval-rst}
82+ .. manim-slides:: VerticalAndHorizontalSlides
83+ :config_options: slide_number=true
84+
85+ from manim import *
86+ from manim_slides import Slide
87+
88+ class VerticalAndHorizontalSlides(Slide):
89+ def construct(self):
90+ circle = Circle(radius=3, color=BLUE)
91+ dot = Dot()
92+
93+ self.play(GrowFromCenter(circle))
94+
95+ self.next_slide(direction="vertical", loop=True)
96+ self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
97+ self.next_slide(direction="vertical")
98+
99+ self.play(dot.animate.move_to(ORIGIN))
100+ ```
101+
102+ For more information about vertical slides see < https://revealjs.com/vertical-slides/ > .
103+
38104## More about HTML Slides
39105
40106You can read more about HTML slides in the [ sharing] ( /reference/sharing ) section.
0 commit comments