You can show you the stream of your webcam alongside the slides.
Note: you need to give the slideshow webpage the permission to access the webcam to use this feature. Press:
Below there are some slides showcasing math typesetting within slides.
Note that you can have native reveal.js fragments inside math formulas (for both KaTeX- and MathJax-powered typeset) and even inside SVGs (for MathJax-powered math).
We have
If we fix a primitive root
Below come two examples of embedding SVG with math typeset on-the-fly with MathJax.
Native Reveal.js fragments are supported independently of MathJax
One side effect of using the custom Math plugin is the shorthands fragidx-<N>
that you can use instead of fragment
+data-fragment-index
Powered by Fabric.js
Try the following keys:
Available keys (contd.):
This is a slide with content saved from one of the previous presentations.
Note that you can still click the
Diagrams can be embedded using the actions mechanism of the content loader plugin.
A NetworkX graph visualized with nx_altair and displayed using Vega-Embed, pan/zoom with mouse.
An interactive line chart from Altair Gallery.
Another Altair example. Brush (click+drag) the left chart and/or click the legend on the right.
3D plots using Apache ECharts. Interact using mouse.
div
below we will try variations of content loading...
The external file contains the following:
<div style="color:red">example</div>
data-inner-text
:
data-outer-text
:
<div style="color:red">example</div>
data-inner-html
:
data-outer-html
:
Note that styles can be optionally inherited from the container when loaded using data-outer-html
.
Below are examples of actions
The content below is generated by a javascript function. The function may return a text, an HTML string, a DOM node, or an array of DOM nodes.
(Click on the digits above!)
This list items are assigned fragment
class automatically:
Powered by PDF.js
Python code execution powered by Pyodide. Highlighting powered by Ace Editor
This code is loaded with data-inner-text="..."
You can edit this code. Just click on it.
from pprint import pprint
if __name__ == '__main__':
x = int(input("Input a number"))
pprint(abs(x))
After editing press ESC to exit editing mode without saving or Ctrl+Enter to save.
The code below is run at the beginning of the slideshow and the result is displayed in a separate fragment (press Space to show the fragment). You can edit the code and press Ctrl+Enter to recompute the result.
a = {1, 2, 3}
b = {'a', 'b', 2}
a & b
PythonError: TypeError: eval_code() got an unexpected keyword argument 'stdout'
# We have an error here:
for i in range(5, -1, -1):
print(1.0 / i)
The error message is output onto the next slide. You can also edit and rerun this piece of code.
PythonError: TypeError: eval_code() got an unexpected keyword argument 'stdout'
You can reserve several lines of code for the in-class coding:
'We need some space reserved for in-class coding here.'
Mermaid.js is a widely used diagramming tool with simple text-based diagram description.
See the slide below. Available keywords: apply, to, execute, show, hide, macro, initially, next, then, during, delay, reset, rewind
initially /* What to do before animation starts */
apply color='red' to li[0,1] /* Apply any CSS property */
apply color='teal' to li.special /* Use CSS selectors */
next /* Use "next" to define what is to be done on the next fragment */
hide li[2] during 500ms /* Set duration of the animation */
then /* If need to do several things, use "then" */
show li[2] during 500ms delay 1000ms
then
apply 'font-size'='16pt' to li[2] during 1000ms
next
apply 'font-size'='16pt' to li[0]
next
execute """console.log("Done!")"""
next
reset
content-loader.js
— load the slide deck, images etc from different files, load PDFs, perform automated actions on the loaded content, highlight-ace.js
— programming language code highlighting and live editing,pyodide.js
— live python code execution on the slides, plays nicely with highlight-ace.js
,inking.js
— interactive whiteboard with free handwriting, SVG images, math formulas (best if used along math.js
), + mouse spotlight,math.js
— a drop-in replacement for the stock math plugin, supports LaTeX preamble, math in SVG, fragments,math-katex.js
— a math plugin powered by KaTeX, designed to be interchangeable with math.js
(only lacking typeset capabilities of math inside SVGs),mermaid.js
— integrate mermaid.js diagrams into your slides,webcam.js
— display the webcam of the presenter on top of the slides,cssanimation.js
— declarative animation of CSS properties linked to native reveal.js fragments.