Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cianlm/reveal-animated-latex

Animated LaTeX in a reveal.js Presentation
https://github.com/cianlm/reveal-animated-latex

Last synced: about 2 months ago
JSON representation

Animated LaTeX in a reveal.js Presentation

Awesome Lists containing this project

README

        



reveal.js


Reveal.js with Animated LaTeX


## Setup

Assuming you have reveal.js setup, clone this repository and place the `latex-animation` directory at the root of the project.

Then place the following scripts **after** reveal has initialized (`Reveal.initialize()`) in your HTML file
```js

```

**Note**. Do not import MathJax before these scripts as it will process your equations before they can be animated.

## Usage

To add animated LaTeX, use the `` tag and place LaTeX inside it. For example,
```HTML

\mathcal{L}=F_{\mu\nu}F^{\mu\nu}+\gamma\sqrt{(F_{\mu \nu}F^{\mu \nu})^2+(F_{\mu\nu}\tilde{F}^{\mu\nu})^2}

```

https://github.com/CianLM/reveal-animated-latex/assets/67507781/f14af133-958b-436e-97a0-9eb38feebb8a

or for more advanced usage (and using fragments),
```HTML

\mathcal{L}=F_{\mu\nu}F^{\mu\nu}+\gamma\sqrt{(F_{\mu \nu}F^{\mu \nu})^2+(F_{\mu\nu}\tilde{F}^{\mu\nu})^2}

```

https://github.com/CianLM/reveal-animated-latex/assets/67507781/7fda5e2e-8297-4b31-92e8-6f764e0a2124

`align` environments are also supported. For example,
```HTML

\begin{align*}
\nabla \cdot \mathbf{E} &= 0 \\
\nabla \cdot \mathbf{B} &= 0
\end{align*}

```

## Options
If you want to customize the animation, there are a number of parameters in the form of `data-` attributes.

### Animation Speed (data-speed)
The increment of time (in seconds) between each stroke.
```HTML

...

```

### Color/Color Gradient (data-gradient)

Any number of colors $n \geq 1$ is accepted (as well as rgb/hex values).
```HTML

...

```

https://github.com/CianLM/reveal-animated-latex/assets/67507781/7fda5e2e-8297-4b31-92e8-6f764e0a2124

### Color Precession (Experimental)
The gradient precesses in a loop.
```HTML

...

```

https://github.com/CianLM/reveal-animated-latex/assets/67507781/f76f6509-2c8d-422b-b83a-fc86ca48d15d

### Animation Delay
Add a delay (in seconds) to the start of the animation.
```HTML

...

```