-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.js
47 lines (42 loc) · 1.19 KB
/
setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import Reveal from './dist/reveal.esm.js';
import Math from './plugin/math/math.esm.js';
let pdfExport = window.location.search.match( /print-pdf/gi )
Reveal.initialize({
controls: true,
// bounces the down arrow when they first encounter a vertical slide
controlsTutorial: false,
// show progress bar
progress: false,
slideNumber: 'c/t',
center: false,
history: true,
transition: 'none',
width: 1120, // default 960
height: 700,
margin: pdfExport ? 0.00 : 0.04,
math: {
// mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
config: 'TeX-AMS_HTML-full',
TeX: {
Macros: {
R: '\\mathbb{R}',
set: [ '\\left\\{#1 \\; ; \\; #2\\right\\}', 2 ]
}
}
},
plugins: [ Math ]
});
// make footer visible in normal mode and in print mode
var footer = document.querySelector('#background-template');
if (pdfExport) {
Reveal.addEventListener('ready', function(event) {
// add footer to every slide
for (let slide of document.querySelectorAll('.slide-background')) {
if (slide.classList.contains('stack')) {
continue;
}
let clone = footer.cloneNode(true);
slide.appendChild(clone)
}
});
}