Reveal.js is an open source HTML presentation framework. It’s a tool that enables anyone with a web browser to create fully-featured and beautiful presentations for free.
You can either write the presentation with HTML, Markdown or using a plan in Slides, but there is an easier way.
Org-Reveal exports your Org documents to reveal.js presentations. With Org-reveal, you can create beautiful presentations with 3D effects from simple but powerful Org contents.
In Doom emacs just add the +present
flag in the :lang
section of the init.el
file. NOTE: It will install a fork called org-re-reveal
(org +roam2 +present) ; organize your plain life in plain text
Then run doom sync
and it will install all the required packages, including reveal.js
Installation is pretty straight-forward. For Doom emacs add these lines to your packages.el
:
(package! org-reveal)
(package! ox-reveal)
Then add the following to your config.el
.
(after! org
(load-library "ox-reveal"))
Then run doom sync
and it will install all the required packages, including reveal.js
In short, you are now set to go.
Write an org document as usual and then export with: SPC m e v b
(for the +present
flag) or SPC m e R B
(for the org-reveal package).
Some other configuration can be included in the header as:
#+OPTIONS: timestamp:nil toc:1 num:nil
#+REVEAL_ROOT: https://cdn.jsdelivr.net/npm/reveal.js
#+REVEAL_THEME: league
#+REVEAL_EXTRA_CSS: ./nord.css
#+REVEAL_PLUGINS: (highlight)
#+REVEAL_HIGHLIGHT_CSS: https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/nord.css
By placing the #+ATTR_REVEAL:
above the source code/paragraphs/list you can configure how it will be displayed.
For example, you can add code highlight with:
#+ATTR_REVEAL: :code_attribs data-line-numbers='1|2|3'
farewell = {' Thanks ', ' for ', ' reading. '}
for word in farewell:
print(f'{word:-^50}')
You can add animation to the code block. For this you need to place :PROPERTIES:
block below the header as:
** Auto animation
:PROPERTIES:
:REVEAL_EXTRA_ATTR: data-auto-animate
:END:
And then the #+ATTR_REVEAL:
above the source code:
#+ATTR_REVEAL: :code_attribs :data_id example
See the next example.
You can add animation to the code block.
farewell = {' Thanks ', ' for ', ' reading. '}
You can add animation to the code block.
farewell = {' Thanks ', ' for ', ' reading. '}
def goodbye(sentence):
You can add animation to the code block.
farewell = {' Thanks ', ' for ', ' reading. '}
def goodbye(sentence):
for word in sentence:
print(f'{word:-^50}')
You can add animation to the code block.
farewell = {' Thanks ', ' for ', ' reading. '}
def goodbye(sentence):
for word in sentence:
print(f'{word:-^50}')
goodbye(farewell)
And there are many styles for fragments that you can use for animation.
#+ATTR_REVEAL: :frag (grow shrink roll-in fade-out none highlight-blue) :frag_idx (4 3 2 1 5 6)
Paragraphs can also be…
Fragmented.
Also you can render LaTeX code directly, although it requires internet connection to mathjax or have it installed locally.
This:
${n! \over k!(n-k)!} = {n \choose k}$
will be displayed as:
\({n! \over k!(n-k)!} = {n \choose k}\)