- Reveal.js is a tool for creating good-looking HTML presentations.
See https://github.com/hakimel/reveal.js/.
For an example of reveal.js presentation, click here. - 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.
This repository is modified from Yujie Wen’s repo (thanks!)
Besides some minor code formating, the changes include:
- changed some variable settings. Some variables are removed from global customization.
- removed
reveal_postambleandreveal_preamble. It seems useless to me and reveal.js does not handle them very well. - added functionality to set attributes for the title slide.
- added functions to handle footnote export.
- added shorcut to insert speaker notes.
- changed original mathjax related code for utilizing the mathjax code in
ox-html.el. This has 2 advantages:- reduce code redundancy
- the same document can be exported both to html or reveal.js without changes
- other minor changes.
- Reveal.js.
- Latest org-mode.
- ox-reveal.el.
- And, of course, emacs.
- Download Reveal.js packages from here.
- Extract Reveal.js folders from the downloaded zip file.
- If you do not wish you download reveal.js and want to use a CDN version, see the section Set the location of Reveal.js
- Org-reveal relies on the Org-mode export frame work. Pre-packaged org-mode may be out-of-date has not been tested.
- If not sure, use the latest development codes from git repository.
You can install it in Emacs with
M-x package-installand then typeorg.Or get it from github:
git clone git://orgmode.org/org-mode.gitThen Follow the online instruction to build and install Org-mode.
- Download latest Org-reveal package from the Org-reveal GitHub page. Or clone the GitHub repository:
git clone https://github.com/yjwen/org-reveal.git - Copy
ox-reveal.elto the Org-mode installation directory. - Add the following statement to your
.emacsfile.(require 'ox-reveal)
You can export this file with C-c C-e R R to see the effects of following config. Before that, make sure the path settings at the head of the file is right for you.
- Press
sto show speaker notes - Press
ESCto enter the slide overview. - Hold down
Altand click on any element to zoom in on it using zoom.js.Alt+clickanywhere to zoom back out. - Press
bor.on your keyboard to enter the ‘paused’ mode. This mode is helpful when you want to take distracting slides off the screen during a presentation.
Org-reveal must know where Reveal.js is on your computer before exporting Org contents. The location of Reveal.js is the path to the top directory of Reveal.js packages, the one which contains file README.md, but not the one contains file reveal.js.
The default location is current directory of the org file.
Change the value of variable org-reveal-root will change the location
globally. For example, add the following statement to your .emacs
file:
(setq org-reveal-root "/Users/zech/Dropbox/git/reveal.js")By setting option REVEAL_ROOT, the location is only affected
within the Org file.
#+REVEAL_ROOT: /Users/zech/Dropbox/git/reveal.js
- To wake-up Org-reveal now, type
M-x load-library, then typeox-reveal. - Now you can export this manual into Reveal.js presentation by typing
C-c C-e R R. - Open the generated “Readme.html” in your browser and enjoy the cool slides.
Org-reveal maps each heading and its contents to one Reveal.js slides. Since Reveal.js arranges slides into a 2-dimentional matrix, Org-reveal use a HLevel value to decide map headings to hozirontal or vertical slides.
- Headings of level less or equal to HLevel are mapped to hozirontal slides.
- Headings of deeper levels are mapped to vertical slides.
HLevel’s default value is 1, means only level 1 headings are arranged horizontally, deeper headings are mapped to vertical slides below its parent level 1 heading.
Assume we have a simple Org file as below:
* H1
* H2
** H2.1
*** H2.1.1
* H3
If HLevel is 1, the default value, headings H2.1 and H2.1.1 will be mapping to vertical slides below the slides of heading H2.
If HLevel is changed to 2, slide of heading H2.1 will be changed to the main hozirontal queue, and slide of heading H2.1.1 will be a vertical slide below it.
- Setting Org files local HLevel using
#+OPTIONStagreveal_hlevel.#+OPTIONS: reveal_hlevel:2
If one headings has too many things to fit into one slide, you can split the contents into multiple vertical slides manually, by inserting
#+REVEAL_HTML: SPLIT
Now a new slide begins after #+REVEAL_HTML: SPLIT keyword.
Themes and transition styles are set globally throughout the whole
file by setting options REVEAL_THEME, REVEAL_TRANS, and REVEAL_SPEED
in your org-mode file.
For an example, please check the heading part of this document.
Please check reveal.js documentation for available themes and transition styles.
Reveal.js scales slides to best fit the display resolution. But in case
the auto-sizes are not satisfiable, you can specify the desired size by
#+OPTIONS tag reveal_width and reveal_height.
The scaling behavior can also be contrainted by setting following
#+OPTIONS tags:
reveal_margina float number, the factor of empty area surrounding slide contents.reveal_min_scalea float number, the minimun scaling down ratio.reveal_max_scalea float number, the maximum scaling up ratio.
Enabled by default. To deactivate slide numbers:
#+OPTIONS: reveal_slide_number:nil
The following setting only shows the outermost headline.
#+OPTIONS: toc:1
You can disable it with:
#+OPTIONS: toc:nil
To remove the section numbers on titles of slides (default):
#+OPTIONS: num:nil
If you set like following, all headlines lower than level 3 will be exported as list item instead of stand alone slides.
#+OPTIONS: H:3
Reveal.js provides other capabilities to configure slides.
They can be turned on/off by setting #+OPTIONS tags to nil or t:
reveal_control: Show/hide browsing control pad.reveal_progress: Show/hide progress bar.reveal_history: Enable/disable slide history track.reveal_center: Enable/disable vertical centering of slide.reveal_keyboard: Enable/disable keyboard navigation.reveal_overview: Enable/disable thumbnail overview.For an example, please refer to the heading part of this file.
Make contents fragmented (show up one-by-one) by setting option ATTR_REVEAL with
property “:frag frag-style”, as illustrated below.
Paragraphs can be fragmented.
Items can be fragmented, too.
Availabe fragment styles are:
- grow
- shrink
- roll-in
- fade-out
- highlight-red
- highlight-green
- highlight-blue
Slide background can be set to a color, an image or a repeating image array by setting heading properties.
Set property reveal_data_bg to either an RGB color value, or any
supported CSS color format.
*** Single Colored Background
:PROPERTIES:
:reveal_data_bg: #543210
:END:
Set property reveal_data_bg to an URL of background image.
Set property reveal_data_bg_trans to slide to make background image
sliding rather than fading.
*** Single Image Background
:PROPERTIES:
:reveal_data_bg: images/whale.jpg
:reveal_data_bg_trans: slide
:END:
Resize background image by setting property reveal_data_bg_size to a number.
Set property reveal_data_bg_repeat to repeat to repeat
image on the background.
*** Repeating Image Background
:PROPERTIES:
:reveal_data_bg: images/whale.jpg
:reveal_data_bg_size: 400px
:reveal_data_bg_repeat: repeat
:END:
Set property reveal_data_extra to headings to add any necessary attributes
to slides.
For example, you can use it to set the background color and the size of the text - such as this very slide.
Set property reveal_data_state to headings to change this slide’s
display style, as illustrated here:
** Data State
:PROPERTIES:
:reveal_data_state: custemevent
:END:
Availabe data states are: =alert=, =blackout=, =soothe=.
Footnote can be defined and exported to each slide. Inline footnote is recommended.
For example, org-mode is awesome project [fn:: http://orgmode.org/] and org-reveal is awesome [fn:: https://github.com/yjwen/org-reveal & https://github.com/RNAer/org-reveal] too.
This is great for listing citations on the slide.
Org-reveal use Org-Babel to highlight source codes.
>>> if x < 0:
... x = 0
... print 'Negative changed to zero'
... elif x == 0:
... print 'Zero'
... elif x == 1:
... print 'Single'
... else:
... print 'More'If you saw odd indentation, please set variable org-html-indent
to nil and export again.
Latex equation are renderred in native HTML5 contents.
IMPORTANT: Displaying equations requires internet connection to mathjax.org or local MathJax installation.
IMPORTANT: For local MathJax installation, set option HTML_MATHJAX to locate the URL
pointing to the local MathJax location. Search org-mode documentation for details.
You can set #+OPTIONS tag reveal_mathjax to nil to disable the mathjax rendering.
Besides the Org contents, you can embed raw HTML contents
into slides by placing a #+REVEAL_HTML keyword.
Now break time, watch two videos:
or embed a webpage inside a slide:
Reveal.js supports speaker notes, which are displayed in a seperate browser window. Press ‘s’ on slide windows will pop up an window displaying current slide, next slide and the speak notes on current slide.
Org-reveal recognize texts between #+BEGIN_NOTES and #+END_NOTES
as speaker notes. See the example below.
You can type <n and then TAB to insert empty note block.
* Heading 1
Some contents.
#+BEGIN_NOTES
Enter speaker notes here.
#+END_NOTES
Due to a bug in Reveal.js, sometimes the speaker notes window shows only blank screens. A workaround to this issue is to put the presentation HTML file into the Reveal.js root directory and reopen it in the brower.
It is recommended to download reveal.js and run grunt server locally for this. See reveal.js documentation for details.
Set REVEAL_EXTRA_CSS to a stylesheet file path in order to load extra custom
styles after loading a theme:
#+REVEAL_EXTRA_CSS: url-to-custom-stylesheet.css
Similarly, set REVEAL_EXTRA_JS to the url of extra reveal.js dependent
script if necessary:
#+REVEAL_EXTRA_JS: url-to-custom-script.js
You can create links pointings to a headline’s text, or its custom-id, as the examples below:
- jump to Speaker Notes: currently links to headline text does work properly.
- jump to MathJax: link to the headings with the specified
CUSTOM_IDproperty.
An example of how a table is exported in org-reveal:
| ID | OTU1 | OTU2 |
|---|---|---|
| 1 | 30 | 2 |
| 2 | 0 | 70 |
An example of how checkbox before org list exported:
- [X] book A
- [ ] book B
- aware of
:: - currently change fragment style between list items will break the whole list into smaller list and then break the consistent style.
Courtesy to:
- The powerful Org-mode,
- the impressive Reveal.js,
- and the precise MathJax

