diff --git a/inst/NEWS b/inst/NEWS
index f8f4250..8ec4b80 100644
--- a/inst/NEWS
+++ b/inst/NEWS
@@ -1,6 +1,8 @@
 Version 0.9 (Unreleased)
 -----------------------------------------------------------------------
 
+- Add support for the menu plugin
+
 - Correct handling of pdf css for self_contained document
 
 - Remove html5shiv.js from template
diff --git a/inst/reveal.js-3.3.0/plugin/menu/lib/bowser.min.js b/inst/reveal.js-3.3.0/plugin/menu/lib/bowser.min.js
new file mode 100755
index 0000000..eb87d46
--- /dev/null
+++ b/inst/reveal.js-3.3.0/plugin/menu/lib/bowser.min.js
@@ -0,0 +1,6 @@
+/*!
+  * Bowser - a browser detector
+  * https://github.com/ded/bowser
+  * MIT License | (c) Dustin Diaz 2014
+  */
+!function(e,t){typeof module!="undefined"&&module.exports?module.exports.browser=t():typeof define=="function"&&define.amd?define(t):this[e]=t()}("bowser",function(){function t(t){function n(e){var n=t.match(e);return n&&n.length>1&&n[1]||""}function r(e){var n=t.match(e);return n&&n.length>1&&n[2]||""}var i=n(/(ipod|iphone|ipad)/i).toLowerCase(),s=/like android/i.test(t),o=!s&&/android/i.test(t),u=n(/edge\/(\d+(\.\d+)?)/i),a=n(/version\/(\d+(\.\d+)?)/i),f=/tablet/i.test(t),l=!f&&/[^-]mobi/i.test(t),c;/opera|opr/i.test(t)?c={name:"Opera",opera:e,version:a||n(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(t)?c={name:"Yandex Browser",yandexbrowser:e,version:a||n(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/windows phone/i.test(t)?(c={name:"Windows Phone",windowsphone:e},u?(c.msedge=e,c.version=u):(c.msie=e,c.version=n(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?c={name:"Internet Explorer",msie:e,version:n(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:/chrome.+? edge/i.test(t)?c={name:"Microsoft Edge",msedge:e,version:u}:/chrome|crios|crmo/i.test(t)?c={name:"Chrome",chrome:e,version:n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:i?(c={name:i=="iphone"?"iPhone":i=="ipad"?"iPad":"iPod"},a&&(c.version=a)):/sailfish/i.test(t)?c={name:"Sailfish",sailfish:e,version:n(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(t)?c={name:"SeaMonkey",seamonkey:e,version:n(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(t)?(c={name:"Firefox",firefox:e,version:n(/(?:firefox|iceweasel)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t)&&(c.firefoxos=e)):/silk/i.test(t)?c={name:"Amazon Silk",silk:e,version:n(/silk\/(\d+(\.\d+)?)/i)}:o?c={name:"Android",version:a}:/phantom/i.test(t)?c={name:"PhantomJS",phantom:e,version:n(/phantomjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?c={name:"BlackBerry",blackberry:e,version:a||n(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:/(web|hpw)os/i.test(t)?(c={name:"WebOS",webos:e,version:a||n(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(c.touchpad=e)):/bada/i.test(t)?c={name:"Bada",bada:e,version:n(/dolfin\/(\d+(\.\d+)?)/i)}:/tizen/i.test(t)?c={name:"Tizen",tizen:e,version:n(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||a}:/safari/i.test(t)?c={name:"Safari",safari:e,version:a}:c={name:n(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!c.msedge&&/(apple)?webkit/i.test(t)?(c.name=c.name||"Webkit",c.webkit=e,!c.version&&a&&(c.version=a)):!c.opera&&/gecko\//i.test(t)&&(c.name=c.name||"Gecko",c.gecko=e,c.version=c.version||n(/gecko\/(\d+(\.\d+)?)/i)),!c.msedge&&(o||c.silk)?c.android=e:i&&(c[i]=e,c.ios=e);var h="";c.windowsphone?h=n(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i?(h=n(/os (\d+([_\s]\d+)*) like mac os x/i),h=h.replace(/[_\s]/g,".")):o?h=n(/android[ \/-](\d+(\.\d+)*)/i):c.webos?h=n(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):c.blackberry?h=n(/rim\stablet\sos\s(\d+(\.\d+)*)/i):c.bada?h=n(/bada\/(\d+(\.\d+)*)/i):c.tizen&&(h=n(/tizen[\/\s](\d+(\.\d+)*)/i)),h&&(c.osversion=h);var p=h.split(".")[0];if(f||i=="ipad"||o&&(p==3||p==4&&!l)||c.silk)c.tablet=e;else if(l||i=="iphone"||i=="ipod"||o||c.blackberry||c.webos||c.bada)c.mobile=e;return c.msedge||c.msie&&c.version>=10||c.yandexbrowser&&c.version>=15||c.chrome&&c.version>=20||c.firefox&&c.version>=20||c.safari&&c.version>=6||c.opera&&c.version>=10||c.ios&&c.osversion&&c.osversion.split(".")[0]>=6||c.blackberry&&c.version>=10.1?c.a=e:c.msie&&c.version<10||c.chrome&&c.version<20||c.firefox&&c.version<20||c.safari&&c.version<6||c.opera&&c.version<10||c.ios&&c.osversion&&c.osversion.split(".")[0]<6?c.c=e:c.x=e,c}var e=!0,n=t(typeof navigator!="undefined"?navigator.userAgent:"");return n.test=function(e){for(var t=0;t<e.length;++t){var r=e[t];if(typeof r=="string"&&r in n)return!0}return!1},n._detect=t,n})
\ No newline at end of file
diff --git a/inst/reveal.js-3.3.0/plugin/menu/lib/jeesh.min.js b/inst/reveal.js-3.3.0/plugin/menu/lib/jeesh.min.js
new file mode 100755
index 0000000..fb49bed
--- /dev/null
+++ b/inst/reveal.js-3.3.0/plugin/menu/lib/jeesh.min.js
@@ -0,0 +1,42 @@
+/*!
+  * =============================================================
+  * Ender: open module JavaScript framework (https://ender.no.de)
+  * Build: ender build jeesh --output jeesh
+  * =============================================================
+  */
+
+
+/*!
+  * Ender: open module JavaScript framework (client-lib)
+  * copyright Dustin Diaz & Jacob Thornton 2011 (@ded @fat)
+  * http://ender.no.de
+  * License MIT
+  */
+!function(a){function d(a){var c=b[a]||window[a];if(!c)throw new Error("Requested module '"+a+"' has not been defined.");return c}function e(a,c){return b[a]=c}function f(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}function g(a,b,c){return typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window?(c=h._select(a,b),c.selector=a):c=isFinite(a.length)?a:[a],f(c,g)}function h(a,b){return g(a,b)}a.global=a;var b={},c=a.$;a.provide=e,a.require=d,f(h,{_VERSION:"0.3.6",fn:g,ender:function(a,b){f(b?g:h,a)},_select:function(a,b){return(b||document).querySelectorAll(a)}}),f(g,{forEach:function(a,b,c){for(c=0,l=this.length;c<l;++c)c in this&&a.call(b||this[c],this[c],c,this);return this},$:h}),h.noConflict=function(){return a.$=c,this},typeof module!="undefined"&&module.exports&&(module.exports=h),a.ender=a.$=a.ender||h}(this),!function(){var a={exports:{}},b=a.exports;
+/*!
+    * bean.js - copyright Jacob Thornton 2011
+    * https://github.com/fat/bean
+    * MIT License
+    * special thanks to:
+    * dean edwards: http://dean.edwards.name/
+    * dperini: https://github.com/dperini/nwevents
+    * the entire mootools team: github.com/mootools/mootools-core
+    */
+!function(b,c,d){typeof a!="undefined"?a.exports=d(b,c):typeof define=="function"&&typeof define.amd=="object"?define(d):c[b]=d(b,c)}("bean",this,function(a,b){var c=window,d=b[a],e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=Array.prototype.slice,q=/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,r=/mouse.*(wheel|scroll)/i,s=/^text/i,t=/^touch|^gesture/i,u={one:1},v=function(a,b,c){for(c=0;c<b.length;c++)a[b[c]]=1;return a}({},("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange error abort scroll "+(n?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend message readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":"")).split(" ")),w=function(){function c(a){var c=a.relatedTarget;return c?c!==this&&c.prefix!=="xul"&&!/document/.test(this.toString())&&!b(c,this):c===null}var a="compareDocumentPosition",b=a in m?function(b,c){return c[a]&&(c[a](b)&16)===16}:"contains"in m?function(a,b){return b=b.nodeType===9||b===window?m:b,b!==a&&b.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0};return{mouseenter:{base:"mouseover",condition:c},mouseleave:{base:"mouseout",condition:c},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),x=function(){var a="altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which".split(" "),b=a.concat("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" ")),c=b.concat("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis".split(" ")),d=a.concat("char charCode key keyCode keyIdentifier keyLocation".split(" ")),f=a.concat(["data"]),g=a.concat("touches targetTouches changedTouches scale rotation".split(" ")),h="preventDefault",i=function(a){return function(){a[h]?a[h]():a.returnValue=!1}},j="stopPropagation",k=function(a){return function(){a[j]?a[j]():a.cancelBubble=!0}},n=function(a){return function(){a[h](),a[j](),a.stopped=!0}},o=function(a,b,c){var d,e;for(d=c.length;d--;)e=c[d],!(e in b)&&e in a&&(b[e]=a[e])};return function(p,u){var v={originalEvent:p,isNative:u};if(!p)return v;var w,x=p.type,y=p.target||p.srcElement;v[h]=i(p),v[j]=k(p),v.stop=n(v),v.target=y&&y.nodeType===3?y.parentNode:y;if(u){if(x.indexOf("key")!==-1)w=d,v.keyCode=p.which||p.keyCode;else if(q.test(x)){w=b,v.rightClick=p.which===3||p.button===2,v.pos={x:0,y:0};if(p.pageX||p.pageY)v.clientX=p.pageX,v.clientY=p.pageY;else if(p.clientX||p.clientY)v.clientX=p.clientX+l.body.scrollLeft+m.scrollLeft,v.clientY=p.clientY+l.body.scrollTop+m.scrollTop;e.test(x)&&(v.relatedTarget=p.relatedTarget||p[(x==="mouseover"?"from":"to")+"Element"])}else t.test(x)?w=g:r.test(x)?w=c:s.test(x)&&(w=f);o(p,v,w||a)}return v}}(),y=function(a,b){return!n&&!b&&(a===l||a===c)?m:a},z=function(){function a(a,b,c,d,e){this.element=a,this.type=b,this.handler=c,this.original=d,this.namespaces=e,this.custom=w[b],this.isNative=v[b]&&a[o],this.eventType=n||this.isNative?b:"propertychange",this.customType=!n&&!this.isNative&&b,this.target=y(a,this.isNative),this.eventSupport=this.target[o]}return a.prototype={inNamespaces:function(a){var b,c;if(!a)return!0;if(!this.namespaces)return!1;for(b=a.length;b--;)for(c=this.namespaces.length;c--;)if(a[b]===this.namespaces[c])return!0;return!1},matches:function(a,b,c){return this.element===a&&(!b||this.original===b)&&(!c||this.handler===c)}},a}(),A=function(){var a={},b=function(c,d,e,f,g){if(!d||d==="*")for(var h in a)h.charAt(0)==="$"&&b(c,h.substr(1),e,f,g);else{var i=0,j,k=a["$"+d],l=c==="*";if(!k)return;for(j=k.length;i<j;i++)if(l||k[i].matches(c,e,f))if(!g(k[i],k,i,d))return}},c=function(b,c,d){var e,f=a["$"+c];if(f)for(e=f.length;e--;)if(f[e].matches(b,d,null))return!0;return!1},d=function(a,c,d){var e=[];return b(a,c,d,null,function(a){return e.push(a)}),e},e=function(b){return(a["$"+b.type]||(a["$"+b.type]=[])).push(b),b},f=function(c){b(c.element,c.type,null,c.handler,function(b,c,d){return c.splice(d,1),c.length===0&&delete a["$"+b.type],!1})},g=function(){var b,c=[];for(b in a)b.charAt(0)==="$"&&(c=c.concat(a[b]));return c};return{has:c,get:d,put:e,del:f,entries:g}}(),B=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},C=function(a,b,d){var e=b.__beanDel,f=function(f){return f=x(f||((this.ownerDocument||this.document||this).parentWindow||c).event,!0),e&&(f.currentTarget=e.ft(f.target,a)),b.apply(a,[f].concat(d))};return f.__beanDel=e,f},D=function(a,b,d,e,f,g){var h=b.__beanDel,i=function(i){var j=h?h.ft(i.target,a):this;if(e?e.apply(j,arguments):n?!0:i&&i.propertyName==="_on"+d||!i)i&&(i=x(i||((this.ownerDocument||this.document||this).parentWindow||c).event,g),i.currentTarget=j),b.apply(a,i&&(!f||f.length===0)?arguments:p.call(arguments,i?0:1).concat(f))};return i.__beanDel=h,i},E=function(a,b,c,d,e){return function(){a(b,c,e),d.apply(this,arguments)}},F=function(a,b,c,d){var e,f,h,i=b&&b.replace(g,""),j=A.get(a,i,c);for(e=0,f=j.length;e<f;e++)j[e].inNamespaces(d)&&((h=j[e]).eventSupport&&B(h.target,h.eventType,h.handler,!1,h.type),A.del(h))},G=function(a,b,c,d,e){var h,i=b.replace(g,""),j=b.replace(f,"").split(".");if(A.has(a,i,c))return a;i==="unload"&&(c=E(F,a,i,c,d)),w[i]&&(w[i].condition&&(c=D(a,c,i,w[i].condition,e,!0)),i=w[i].base||i),h=A.put(new z(a,i,c,d,j[0]&&j)),h.handler=h.isNative?C(a,h.handler,e):D(a,h.handler,i,!1,e,!1),h.eventSupport&&B(h.target,h.eventType,h.handler,!0,h.customType)},H=function(a,b,c){var d=function(b,d){var e,f=typeof a=="string"?c(a,d):a;for(;b&&b!==d;b=b.parentNode)for(e=f.length;e--;)if(f[e]===b)return b},e=function(a){var c=d(a.target,this);c&&b.apply(c,arguments)};return e.__beanDel={ft:d,selector:a,$:c},e},I=function(a,b,c){var d,e,h,i,j,k=F,l=b&&typeof b=="string";if(l&&b.indexOf(" ")>0){b=b.split(" ");for(j=b.length;j--;)I(a,b[j],c);return a}h=l&&b.replace(g,""),h&&w[h]&&(h=w[h].type);if(!b||l){if(i=l&&b.replace(f,""))i=i.split(".");k(a,h,c,i)}else if(typeof b=="function")k(a,null,b);else for(d in b)b.hasOwnProperty(d)&&I(a,d,b[d]);return a},J=function(a,b,c,d,e){var f,g,h,i,j=c,k=c&&typeof c=="string";if(b&&!c&&typeof b=="object")for(f in b)b.hasOwnProperty(f)&&J.apply(this,[a,f,b[f]]);else{i=arguments.length>3?p.call(arguments,3):[],g=(k?c:b).split(" "),k&&(c=H(b,j=d,e))&&(i=p.call(i,1)),this===u&&(c=E(I,a,b,c,j));for(h=g.length;h--;)G(a,g[h],c,j,i)}return a},K=function(){return J.apply(u,arguments)},L=n?function(a,b,d){var e=l.createEvent(a?"HTMLEvents":"UIEvents");e[a?"initEvent":"initUIEvent"](b,!0,!0,c,1),d.dispatchEvent(e)}:function(a,b,c){c=y(c,a),a?c.fireEvent("on"+b,l.createEventObject()):c["_on"+b]++},M=function(a,b,c){var d,e,h,i,j,k=b.split(" ");for(d=k.length;d--;){b=k[d].replace(g,"");if(i=k[d].replace(f,""))i=i.split(".");if(!i&&!c&&a[o])L(v[b],b,a);else{j=A.get(a,b),c=[!1].concat(c);for(e=0,h=j.length;e<h;e++)j[e].inNamespaces(i)&&j[e].handler.apply(a,c)}}return a},N=function(a,b,c){var d=0,e=A.get(b,c),f=e.length,g,h;for(;d<f;d++)e[d].original&&(h=e[d].handler.__beanDel,h?g=[a,h.selector,e[d].type,e[d].original,h.$]:g=[a,e[d].type,e[d].original],J.apply(null,g));return a},O={add:J,one:K,remove:I,clone:N,fire:M,noConflict:function(){return b[a]=d,this}};if(c[i]){var P=function(){var a,b=A.entries();for(a in b)b[a].type&&b[a].type!=="unload"&&I(b[a].element,b[a].type);c[k]("onunload",P),c.CollectGarbage&&c.CollectGarbage()};c[i]("onunload",P)}return O}),provide("bean",a.exports),!function(a){var b=require("bean"),c=function(c,d,e){var f=d?[d]:[];return function(){for(var e,g=0,h=this.length;g<h;g++)e=[this[g]].concat(f,Array.prototype.slice.call(arguments,0)),e.length==4&&e.push(a),!arguments.length&&c=="add"&&d&&(c="fire"),b[c].apply(this,e);return this}},d=c("add"),e=c("remove"),f=c("fire"),g={on:d,addListener:d,bind:d,listen:d,delegate:d,one:c("one"),off:e,unbind:e,unlisten:e,removeListener:e,undelegate:e,emit:f,trigger:f,cloneEvents:c("clone"),hover:function(a,c,d){for(d=this.length;d--;)b.add.call(this,this[d],"mouseenter",a),b.add.call(this,this[d],"mouseleave",c);return this}},h=["blur","change","click","dblclick","error","focus","focusin","focusout","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mouseout","mouseover","mouseup","mousemove","resize","scroll","select","submit","unload"];for(var i=h.length;i--;)g[h[i]]=c("add",h[i]);a.ender(g,!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;
+/*!
+    * Bonzo: DOM Utility (c) Dustin Diaz 2012
+    * https://github.com/ded/bonzo
+    * License MIT
+    */
+!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&define.amd?define(b,c):this[b]=c()}("bonzo",function(){function G(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function H(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function I(a,b,c){for(var d=0,e=a.length;d<e;d++)O(a[d])&&(I(a[d].childNodes,b,c),b.call(c||a[d],a[d],d,a));return a}function J(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function K(a){return a?a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase():a}function L(a){return a[y]("data-node-uid")||a[x]("data-node-uid",++t),uid=a[y]("data-node-uid"),s[uid]||(s[uid]={})}function M(a){uid=a[y]("data-node-uid"),uid&&delete s[uid]}function N(a,b){try{return a===null||a===undefined?undefined:a==="true"?!0:a==="false"?!1:a==="null"?null:(b=parseFloat(a))==a?b:a}catch(c){}return undefined}function O(a){return a&&a.nodeName&&a.nodeType==1}function P(a,b,c,d,e){for(d=0,e=a.length;d<e;++d)if(b.call(c,a[d],d,a))return!0;return!1}function Q(a){return a=="transform"&&(a=A.transform)||/^transform-?[Oo]rigin$/.test(a)&&(a=A.transform+"Origin")||a=="float"&&(a=A.cssFloat),a?J(a):null}function S(a,b,c){var d=0,g=b||this,h=[],i=f&&typeof a=="string"&&a.charAt(0)!="<"?f(a):a;return H(W(i),function(a){H(g,function(b){var f=!b[e]||b[e]&&!b[e][e]?function(){var a=b.cloneNode(!0);return g.$&&g.cloneEvents&&g.$(a).cloneEvents(b),a}():b;c(a,f),h[d]=f,d++})},this),H(h,function(a,b){g[b]=a}),g.length=d,g}function T(a,b,c){var d=$(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+w),c!=null&&(a.style.top=c-f.top+i[1]+w)}function U(a,b){return typeof b=="function"?b(a):b}function V(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function W(a){return typeof a=="string"?$.create(a):O(a)?[a]:a}function X(a,c,d){var e=this[0];return e?a==null&&c==null?(Y(e)?Z():{x:e.scrollLeft,y:e.scrollTop})[d]:(Y(e)?b.scrollTo(a,c):(a!=null&&(e.scrollLeft=a),c!=null&&(e.scrollTop=c)),this):this}function Y(a){return a===b||/^(?:body|html)$/i.test(a.tagName)}function Z(){return{x:b.pageXOffset||d.scrollLeft,y:b.pageYOffset||d.scrollTop}}function $(a,b){return new V(a,b)}var a=this,b=window,c=b.document,d=c.documentElement,e="parentNode",f=null,g=/^(checked|value|selected)$/i,h=/^(select|fieldset|table|tbody|tfoot|td|tr|colgroup)$/i,i=["<table>","</table>",1],j=["<table><tbody><tr>","</tr></tbody></table>",3],k=["<select>","</select>",1],l=["_","",0,1],m={thead:i,tbody:i,tfoot:i,colgroup:i,caption:i,tr:["<table><tbody>","</tbody></table>",2],th:j,td:j,col:["<table><colgroup>","</colgroup></table>",2],fieldset:["<form>","</form>",1],legend:["<form><fieldset>","</fieldset></form>",2],option:k,optgroup:k,script:l,style:l,link:l,param:l,base:l},n=/^(checked|selected)$/,o=/msie/i.test(navigator.userAgent),p,q,r,s={},t=0,u=/^-?[\d\.]+$/,v=/^data-(.+)$/,w="px",x="setAttribute",y="getAttribute",z="getElementsByTagName",A=function(){var a=c.createElement("p");return a.innerHTML='<a href="#x">x</a><table style="float:left;"></table>',{hrefExtended:a[z]("a")[0][y]("href")!="#x",autoTbody:a[z]("tbody").length!==0,computedStyle:c.defaultView&&c.defaultView.getComputedStyle,cssFloat:a[z]("table")[0].style.styleFloat?"styleFloat":"cssFloat",transform:function(){var b=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],c;for(c=0;c<b.length;c++)if(b[c]in a.style)return b[c]}(),classList:"classList"in a}}(),B=/(^\s*|\s*$)/g,C=/\s+/,D=String.prototype.toString,E={lineHeight:1,zoom:1,zIndex:1,opacity:1},F=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(B,"")},R=A.computedStyle?function(a,b){var d=null,e=c.defaultView.getComputedStyle(a,"");return e&&(d=e[b]),a.style[b]||d}:o&&d.currentStyle?function(a,b){if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[b]};return A.classList?(p=function(a,b){return a.classList.contains(b)},q=function(a,b){a.classList.add(b)},r=function(a,b){a.classList.remove(b)}):(p=function(a,b){return G(b).test(a.className)},q=function(a,b){a.className=F(a.className+" "+b)},r=function(a,b){a.className=F(a.className.replace(G(b)," "))}),V.prototype={get:function(a){return this[a]||null},each:function(a,b){return H(this,a,b)},deepEach:function(a,b){return I(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},html:function(a,b){function e(b){H(W(a),function(a){b.appendChild(a)})}var c=b?d.textContent===undefined?"innerText":"textContent":"innerHTML";return typeof a!="undefined"?this.empty().each(function(d){!b&&h.test(d.tagName)?e(d):!function(){try{d[c]=a}catch(b){e(d)}}()}):this[0]?this[0][c]:""},text:function(a){return this.html(a,1)},append:function(a){return this.each(function(b){H(W(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;H(W(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return S.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return S.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},before:function(a){return this.each(function(b){H($.create(a),function(a){b[e].insertBefore(a,b)})})},after:function(a){return this.each(function(b){H($.create(a),function(a){b[e].insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return S.call(this,a,b,function(a,b){a[e].insertBefore(b,a)})},insertAfter:function(a,b){return S.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[e].insertBefore(b,c):a[e].appendChild(b)})},replaceWith:function(a){return this.deepEach(M),this.each(function(b){b.parentNode.replaceChild($.create(a)[0],b)})},addClass:function(a){return a=D.call(a).split(C),this.each(function(b){H(a,function(a){a&&!p(b,U(b,a))&&q(b,U(b,a))})})},removeClass:function(a){return a=D.call(a).split(C),this.each(function(b){H(a,function(a){a&&p(b,U(b,a))&&r(b,U(b,a))})})},hasClass:function(a){return a=D.call(a).split(C),P(this,function(b){return P(a,function(a){return a&&p(b,a)})})},toggleClass:function(a,b){return a=D.call(a).split(C),this.each(function(c){H(a,function(a){a&&(typeof b!="undefined"?b?q(c,a):r(c,a):p(c,a)?r(c,a):q(c,a))})})},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(){return this.each(function(a){a.style.display="none"})},toggle:function(a,b){return this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":b||""}),a&&a(),this},first:function(){return $(this.length?this[0]:[])},last:function(){return $(this.length?this[this.length-1]:[])},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},parent:function(){return this.related(e)},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},focus:function(){return this.length&&this[0].focus(),this},blur:function(){return this.each(function(a){a.blur()})},css:function(a,d,e){function g(a,b,c){for(var d in f)f.hasOwnProperty(d)&&(c=f[d],(b=Q(d))&&u.test(c)&&!(b in E)&&(c+=w),a.style[b]=U(a,c))}if(d===undefined&&typeof a=="string")return d=this[0],d?d===c||d===b?(e=d===c?$.doc():$.viewport(),a=="width"?e.width:a=="height"?e.height:""):(a=Q(a))?R(d,a):null:null;var f=a;return typeof a=="string"&&(f={},f[a]=d),o&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity),this.each(g)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){T(c,a,b)});if(!this[0])return{top:0,left:0,height:0,width:0};var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetTop,g+=c.offsetLeft;return{top:f,left:g,height:e,width:d}},dim:function(){if(!this.length)return{height:0,width:0};var a=this[0],b=!a.offsetWidth&&!a.offsetHeight?function(b,c){return c={position:a.style.position||"",visibility:a.style.visibility||"",display:a.style.display||""},b.first().css({position:"absolute",visibility:"hidden",display:"block"}),c}(this):null,c=a.offsetWidth,d=a.offsetHeight;return b&&this.first().css(b),{height:d,width:c}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?c?g.test(a)?n.test(a)&&typeof c[a]=="string"?!0:c[a]:a!="href"&&a!="src"||!A.hrefExtended?c[y](a):c[y](a,2):null:this.each(function(c){g.test(a)?c[a]=U(c,b):c[x](a,U(c,b))});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},removeAttr:function(a){return this.each(function(b){n.test(a)?b[a]=!1:b.removeAttribute(a)})},val:function(a){return typeof a=="string"?this.attr("value",a):this.length?this[0].value:null},data:function(a,b){var c=this[0],d,e,f;return typeof b=="undefined"?c?(e=L(c),typeof a=="undefined"?(H(c.attributes,function(a){(f=(""+a.name).match(v))&&(e[J(f[1])]=N(a.value))}),e):(typeof e[a]=="undefined"&&(e[a]=N(this.attr("data-"+K(a)))),e[a])):null:this.each(function(c){L(c)[a]=b})},remove:function(){return this.deepEach(M),this.each(function(a){a[e]&&a[e].removeChild(a)})},empty:function(){return this.each(function(a){I(a.childNodes,M);while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a[e].removeChild(a)})},scrollTop:function(a){return X.call(this,null,a,"y")},scrollLeft:function(a){return X.call(this,a,null,"x")}},$.setQueryEngine=function(a){f=a,delete $.setQueryEngine},$.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||V.prototype)[c]=a[c])},$.create=function(a){return typeof a=="string"&&a!==""?function(){var b=/^\s*<([^\s>]+)/.exec(a),d=c.createElement("div"),f=[],g=b?m[b[1].toLowerCase()]:null,h=g?g[2]+1:1,i=g&&g[3],j=e,k=A.autoTbody&&g&&g[0]=="<table>"&&!/<tbody/i.test(a);d.innerHTML=g?g[0]+a+g[1]:a;while(h--)d=d.firstChild;i&&d&&d.nodeType!==1&&(d=d.nextSibling);do(!b||d.nodeType==1)&&(!k||d.tagName.toLowerCase()!="tbody")&&f.push(d);while(d=d.nextSibling);return H(f,function(a){a[j]&&a[j].removeChild(a)}),f}():O(a)?[a.cloneNode(!0)]:[]},$.doc=function(){var a=$.viewport();return{width:Math.max(c.body.scrollWidth,d.scrollWidth,a.width),height:Math.max(c.body.scrollHeight,d.scrollHeight,a.height)}},$.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},$.viewport=function(){return{width:o?d.clientWidth:self.innerWidth,height:o?d.clientHeight:self.innerHeight}},$.isAncestor="compareDocumentPosition"in d?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in d?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[e])if(b===a)return!0;return!1},$}),provide("bonzo",a.exports),!function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c=0,d=0,e,f,g;for(;f=a[c];++c){g=!1;for(e=0;e<b.length;++e)if(b[e]===f){g=!0;break}g||(b[d++]=f)}return b}function e(a,c){return typeof c=="undefined"?b(this).dim()[a]:this.css(a,c)}var b=require("bonzo");b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){if(!this.length)return this;var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},parent:function(){return a(d(b(this).parent()))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this.length?this[0]:this)},last:function(){return a(this.length?this[this.length-1]:[])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f=[];for(c=0,l=this.length;c<l;c++){if(!(e=b.firstChild(this[c])))continue;f.push(e);while(e=e.nextSibling)e.nodeType==1&&f.push(e)}return a(d(f))},height:function(a){return e.call(this,"height",a)},width:function(a){return e.call(this,"width",a)}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;
+/*!
+    * domready (c) Dustin Diaz 2012 - License MIT
+    */
+!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&typeof define.amd=="object"?define(c):this[b]=c()}("domready",function(a){function m(a){l=1;while(a=b.shift())a()}var b=[],c,d=!1,e=document,f=e.documentElement,g=f.doScroll,h="DOMContentLoaded",i="addEventListener",j="onreadystatechange",k="readyState",l=/^loade|c/.test(e[k]);return e[i]&&e[i](h,c=function(){e.removeEventListener(h,c,d),m()},d),g&&e.attachEvent(j,c=function(){/^c/.test(e[k])&&(e.detachEvent(j,c),m())}),a=g?function(c){self!=top?l?c():b.push(c):function(){try{f.doScroll("left")}catch(b){return setTimeout(function(){a(c)},50)}c()}()}:function(a){l?a():b.push(a)}}),provide("domready",a.exports),!function(a){var b=require("domready");a.ender({domReady:b}),a.ender({ready:function(a){return b(a),this}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;
+/*!
+    * Qwery - A Blazing Fast query selector engine
+    * https://github.com/ded/qwery
+    * copyright Dustin Diaz & Jacob Thornton 2011
+    * MIT License
+    */
+!function(b,c){typeof a!="undefined"?a.exports=c():typeof define=="function"&&typeof define.amd=="object"?define(c):this[b]=c()}("qwery",function(){function C(){this.c={}}function H(a){return D.g(a)||D.s(a,"(^|\\s+)"+a+"(\\s+|$)",1)}function I(a,b){var c=0,d=a.length;for(;c<d;c++)b(a[c])}function J(a){for(var b=[],c=0,d=a.length;c<d;++c)V(a[c])?b=b.concat(a[c]):b[b.length]=a[c];return b}function K(a){var b=0,c=a.length,d=[];for(;b<c;b++)d[b]=a[b];return d}function L(a){while(a=a.previousSibling)if(a[h]==1)break;return a}function M(a){return a.match(A)}function N(a,b,c,d,e,f,i,l,m,n,o){var p,q,r,s,t;if(this[h]!==1)return!1;if(b&&b!=="*"&&this[g]&&this[g].toLowerCase()!==b)return!1;if(c&&(q=c.match(j))&&q[1]!==this.id)return!1;if(c&&(t=c.match(k)))for(p=t.length;p--;)if(!H(t[p].slice(1)).test(this.className))return!1;if(m&&Y.pseudos[m]&&!Y.pseudos[m](this,o))return!1;if(d&&!i){s=this.attributes;for(r in s)if(Object.prototype.hasOwnProperty.call(s,r)&&(s[r].name||r)==e)return this}return d&&!P(f,_(this,e)||"",i)?!1:this}function O(a){return E.g(a)||E.s(a,a.replace(t,"\\$1"))}function P(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(F.g("^="+c)||F.s("^="+c,"^"+O(c),1));case"$=":return b.match(F.g("$="+c)||F.s("$="+c,O(c)+"$",1));case"*=":return b.match(F.g(c)||F.s(c,O(c),1));case"~=":return b.match(F.g("~="+c)||F.s("~="+c,"(?:^|\\s+)"+O(c)+"(?:\\s+|$)",1));case"|=":return b.match(F.g("|="+c)||F.s("|="+c,"^"+O(c)+"(-|$)",1))}return 0}function Q(a,b){var c=[],e=[],f,i,j,k,m,n,o,p,q=b,r=G.g(a)||G.s(a,a.split(z)),s=a.match(y);if(!r.length)return c;k=(r=r.slice(0)).pop(),r.length&&(j=r[r.length-1].match(l))&&(q=X(b,j[1]));if(!q)return c;o=M(k),n=q!==b&&q[h]!==9&&s&&/^[+~]$/.test(s[s.length-1])?function(a){while(q=q.nextSibling)q[h]==1&&(o[1]?o[1]==q[g].toLowerCase():1)&&(a[a.length]=q);return a}([]):q[d](o[1]||"*");for(f=0,i=n.length;f<i;f++)if(p=N.apply(n[f],o))c[c.length]=p;return r.length?(I(c,function(a){S(a,r,s)&&(e[e.length]=a)}),e):c}function R(a,b,c){if(T(b))return a==b;if(V(b))return!!~J(b).indexOf(a);var d=b.split(","),e,f;while(b=d.pop()){e=G.g(b)||G.s(b,b.split(z)),f=b.match(y),e=e.slice(0);if(N.apply(a,M(e.pop()))&&(!e.length||S(a,e,f,c)))return!0}return!1}function S(a,b,c,d){function f(a,d,g){while(g=B[c[d]](g,a))if(T(g)&&N.apply(g,M(b[d]))){if(!d)return g;if(e=f(g,d-1,g))return e}}var e;return(e=f(a,b.length-1,a))&&(!d||$(e,d))}function T(a,b){return a&&typeof a=="object"&&(b=a[h])&&(b==1||b==9)}function U(a){var b=[],c,d;a:for(c=0;c<a.length;++c){for(d=0;d<b.length;++d)if(b[d]==a[c])continue a;b[b.length]=a[c]}return b}function V(a){return typeof a=="object"&&isFinite(a.length)}function W(b){return b?typeof b=="string"?Y(b)[0]:!b[h]&&V(b)?b[0]:b:a}function X(a,b,c){return a[h]===9?a.getElementById(b):a.ownerDocument&&((c=a.ownerDocument.getElementById(b))&&$(c,a)&&c||!$(a,a.ownerDocument)&&i('[id="'+b+'"]',a)[0])}function Y(a,b){var e,f,g=W(b);if(!g||!a)return[];if(a===window||T(a))return!b||a!==window&&T(g)&&$(a,g)?[a]:[];if(a&&V(a))return J(a);if(e=a.match(x)){if(e[1])return(f=X(g,e[1]))?[f]:[];if(e[2])return K(g[d](e[2]));if(ba&&e[3])return K(g[c](e[3]))}return i(a,g)}function Z(a,b){return function(c){var d,e;if(p.test(c)){a[h]!==9&&((e=d=a.getAttribute("id"))||a.setAttribute("id",e="__qwerymeupscotty"),c='[id="'+e+'"]'+c,b(a.parentNode||a,c,!0),d||a.removeAttribute("id"));return}c.length&&b(a,c,!1)}}var a=document,b=a.documentElement,c="getElementsByClassName",d="getElementsByTagName",e="querySelectorAll",f="useNativeQSA",g="tagName",h="nodeType",i,j=/#([\w\-]+)/,k=/\.[\w\-]+/g,l=/^#([\w\-]+)$/,m=/^\.([\w\-]+)$/,n=/^([\w\-]+)$/,o=/^([\w]+)?\.([\w\-]+)$/,p=/(^|,)\s*[>~+]/,q=/^\s+|\s*([,\s\+\~>]|$)\s*/g,r=/[\s\>\+\~]/,s=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,t=/([.*+?\^=!:${}()|\[\]\/\\])/g,u=/^(\*|[a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,v=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,w=/:([\w\-]+)(\(['"]?([^()]+)['"]?\))?/,x=new RegExp(l.source+"|"+n.source+"|"+m.source),y=new RegExp("("+r.source+")"+s.source,"g"),z=new RegExp(r.source+s.source),A=new RegExp(u.source+"("+v.source+")?"+"("+w.source+")?"),B={" ":function(a){return a&&a!==b&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,b,c,d){return a?(c=L(a))&&(d=L(b))&&c==d&&c:!1}};C.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b,c){return b=c?new RegExp(b):b,this.c[a]=b}};var D=new C,E=new C,F=new C,G=new C,$="compareDocumentPosition"in b?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in b?function(a,c){return c=c[h]===9||c==window?b:c,c!==a&&c.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},_=function(){var b=a.createElement("p");return(b.innerHTML='<a href="#x">x</a>')&&b.firstChild.getAttribute("href")!="#x"?function(a,b){return b==="class"?a.className:b==="href"||b==="src"?a.getAttribute(b,2):a.getAttribute(b)}:function(a,b){return a.getAttribute(b)}}(),ba=!!a[c],bb=a.querySelector&&a[e],bc=function(a,b){var c=[],d,f;try{return b[h]===9||!p.test(a)?K(b[e](a)):(I(d=a.split(","),Z(b,function(a,b){f=a[e](b),f.length==1?c[c.length]=f.item(0):f.length&&(c=c.concat(K(f)))})),d.length>1&&c.length>1?U(c):c)}catch(g){}return bd(a,b)},bd=function(a,b){var c=[],e,f,g,i,j,k;a=a.replace(q,"$1");if(f=a.match(o)){j=H(f[2]),e=b[d](f[1]||"*");for(g=0,i=e.length;g<i;g++)j.test(e[g].className)&&(c[c.length]=e[g]);return c}return I(k=a.split(","),Z(b,function(a,d,e){j=Q(d,a);for(g=0,i=j.length;g<i;g++)if(a[h]===9||e||$(j[g],b))c[c.length]=j[g]})),k.length>1&&c.length>1?U(c):c},be=function(a){typeof a[f]!="undefined"&&(i=a[f]?bb?bc:bd:bd)};return be({useNativeQSA:!0}),Y.configure=be,Y.uniq=U,Y.is=R,Y.pseudos={},Y}),provide("qwery",a.exports),!function(a,b){var c=require("qwery");b.pseudos=c.pseudos,b._select=function(a,d){return(b._select=function(a){try{return a=require("bonzo"),function(b,d){return/^\s*</.test(b)?a.create(b,d):c(b,d)}}catch(b){}return c}())(a,d)},b.ender({find:function(a){var d=[],e,f,g,h,i;for(e=0,f=this.length;e<f;e++){i=c(a,this[e]);for(g=0,h=i.length;g<h;g++)d.push(i[g])}return b(c.uniq(d))},and:function(a){var c=b(a);for(var d=this.length,e=0,f=this.length+c.length;d<f;d++,e++)this[d]=c[e];return this},is:function(a,b){var d,e;for(d=0,e=this.length;d<e;d++)if(c.is(this[d],a,b))return!0;return!1}},!0)}(document,ender)}()
\ No newline at end of file
diff --git a/inst/reveal.js-3.3.0/plugin/menu/menu.css b/inst/reveal.js-3.3.0/plugin/menu/menu.css
new file mode 100755
index 0000000..274b55c
--- /dev/null
+++ b/inst/reveal.js-3.3.0/plugin/menu/menu.css
@@ -0,0 +1,269 @@
+.reveal .slide-menu {
+	background-color: #333;
+	z-index: 200;
+	position: fixed;
+	top: 0;
+	width: 300px;
+	height: 100%;
+	/*overflow-y: scroll;*/
+	transition: transform 0.3s;
+  	font-size: 16px;
+  	font-weight: normal;
+}
+
+/*
+ * Slides menu
+ */
+
+.reveal .slide-menu-items {
+	margin: 0;
+	padding: 0;
+	width: 100%;
+	border-bottom: solid 1px #555;
+}
+
+.reveal .slide-menu-item, 
+.reveal .slide-menu-item-vertical {
+	display: block;
+	text-align: left;
+	padding: 10px 18px;
+	color: #aaa;
+	cursor: pointer;
+}
+
+.reveal .slide-menu-item-vertical {
+	padding-left: 30px;
+}
+
+.reveal .slide-menu-item {
+  border-top: solid 1px #555;
+}
+
+.reveal .active-menu-panel li.selected {
+	background-color: #222;
+	color: white;
+}
+
+.reveal .active-menu-panel li.active {
+	color: #eee;
+}
+
+.reveal .slide-menu-item.no-title .slide-menu-item-title, 
+.reveal .slide-menu-item-vertical.no-title .slide-menu-item-title {
+	font-style: italic;
+}
+
+.reveal .slide-menu-item-number {
+	color: #999;
+	padding-right:6px;
+}
+
+.reveal .slide-menu-item i.fa,
+.reveal .slide-menu-item-vertical i.fa {
+	padding-right: 12px;
+	display: none;
+}
+
+.reveal .slide-menu-item.past i.fa.past,
+.reveal .slide-menu-item-vertical.past i.fa.past,
+.reveal .slide-menu-item.active i.fa.active,
+.reveal .slide-menu-item-vertical.active i.fa.active,
+.reveal .slide-menu-item.future i.fa.future,
+.reveal .slide-menu-item-vertical.future i.fa.future {
+	display: inline-block;
+}
+
+.reveal .slide-menu-item i.fa,
+.reveal .slide-menu-item-vertical i.fa {
+	opacity: 0.4;
+}
+
+.reveal .slide-menu--left {
+  left: 0;
+  -webkit-transform: translateX(-300px);
+  -ms-transform: translateX(-300px);
+  transform: translateX(-300px);
+}
+
+.reveal .slide-menu--left.active {
+  -webkit-transform: translateX(0);
+  -ms-transform: translateX(0);
+  transform: translateX(0);
+}
+
+.reveal .slide-menu--right {
+  right: 0;
+  -webkit-transform: translateX(300px);
+  -ms-transform: translateX(300px);
+  transform: translateX(300px);
+}
+
+.reveal .slide-menu--right.active {
+  -webkit-transform: translateX(0);
+  -ms-transform: translateX(0);
+  transform: translateX(0);
+}
+
+.reveal {
+	transition: transform 0.3s;
+}
+
+
+/*
+ * Toolbar
+ */
+.reveal .slide-menu-toolbar {
+ 	height: 60px;
+ 	width: 100%;
+ 	font-size: 12px;
+    display: table;
+    table-layout: fixed; /* ensures equal width */
+    margin: 0;
+    padding: 0;
+	border-bottom: solid 2px #666;
+}
+
+.reveal .slide-menu-toolbar > li {
+    display: table-cell;
+ 	line-height: 150%;
+    text-align: center;
+    vertical-align: middle;
+    cursor: pointer;
+	color: #aaa;
+	border-radius: 3px;
+}
+
+.reveal .slide-menu-toolbar > li.active-toolbar-button {
+ 	color: white;
+ 	text-shadow: 0 1px black;	
+}
+
+.slide-menu-toolbar > li:hover {
+	color: white;
+}
+
+/*
+ * Panels
+ */
+.reveal .slide-menu-panel {
+	position: absolute;
+	width: 100%;
+	visibility: hidden;
+	height: calc(100% - 60px);
+	overflow-x: hidden;
+	overflow-y: auto;
+	color: #AAA;
+}
+
+.reveal .slide-menu-panel.active-menu-panel {
+	visibility: visible;
+}
+
+.reveal .slide-menu-panel h1,
+.reveal .slide-menu-panel h2,
+.reveal .slide-menu-panel h3,
+.reveal .slide-menu-panel h4,
+.reveal .slide-menu-panel h5,
+.reveal .slide-menu-panel h6 {
+	margin: 20px 0 10px 0;
+	color: #FFF;
+	line-height: 1.2;
+	letter-spacing: normal;
+	text-shadow: none;
+}
+
+.reveal .slide-menu-panel h1 {
+	font-size: 1.6em;
+}
+.reveal .slide-menu-panel h2 {
+	font-size: 1.4em;
+}
+.reveal .slide-menu-panel h3 {
+	font-size: 1.3em;
+}
+.reveal .slide-menu-panel h4 {
+	font-size: 1.1em;
+}
+.reveal .slide-menu-panel h5 {
+	font-size: 1em;
+}
+.reveal .slide-menu-panel h6 {
+	font-size: 0.9em;
+}
+
+.reveal .slide-menu-panel p {
+	margin: 10px 0 5px 0;
+}
+
+.reveal .slide-menu-panel a {
+	color: #CCC;
+	text-decoration: underline;
+}
+
+.reveal .slide-menu-panel a:hover {
+	color: white;
+}
+
+.reveal .slide-menu-item a {
+	text-decoration: none;
+}
+
+.reveal .slide-menu-custom-panel {
+	width: calc(100% - 20px);
+	padding-left: 10px;
+	padding-right: 10px;
+}
+
+.reveal .slide-menu-custom-panel .slide-menu-items {
+	width: calc(100% + 20px);
+	margin-left: -10px;
+	margin-right: 10px;
+}
+
+ 
+/*
+ * Theme and Transitions buttons
+ */
+
+.reveal div[data-panel="Themes"] li,
+.reveal div[data-panel="Transitions"] li {
+	display: block;
+	text-align: left;
+	cursor: pointer;
+	color: #848484;
+}
+
+/*
+ * Menu controls
+ */
+.reveal .slide-menu-button {
+	position: fixed;
+	left: 30px;
+	bottom: 30px;
+	z-index: 30;
+	font-size: 24px;
+}
+
+/*
+ * Menu overlay
+ */
+
+.reveal .slide-menu-overlay {
+  position: fixed;
+  z-index: 199;
+  top: 0;
+  left: 0;
+  overflow: hidden;
+  width: 0;
+  height: 0;
+  background-color: #000;
+  opacity: 0;
+  transition: opacity 0.3s, width 0s 0.3s, height 0s 0.3s;
+}
+
+.reveal .slide-menu-overlay.active {
+  width: 100%;
+  height: 100%;
+  opacity: 0.7;
+  transition: opacity 0.3s;
+}
diff --git a/inst/reveal.js-3.3.0/plugin/menu/menu.js b/inst/reveal.js-3.3.0/plugin/menu/menu.js
new file mode 100755
index 0000000..65f05ee
--- /dev/null
+++ b/inst/reveal.js-3.3.0/plugin/menu/menu.js
@@ -0,0 +1,715 @@
+/*
+ * Reveal.js menu plugin
+ * MIT licensed
+ * (c) Greg Denehy 2015
+ */
+
+var RevealMenu = window.RevealMenu || (function(){
+	var config = Reveal.getConfig();
+	var options = config.menu || {};
+	options.path = options.path || scriptPath() || 'plugin/menu';
+
+	var module = {};
+
+	loadResource(options.path + '/lib/jeesh.min.js', 'script', function() {
+	loadResource(options.path + '/lib/bowser.min.js', 'script', function() {
+	loadResource(options.path + '/menu.css', 'stylesheet', function() {
+		// does not support IE8 or below
+		if (!bowser.msie || bowser.version >= 9) {
+			//
+			// Set option defaults
+			//
+			var side = options.side || 'left';	// 'left' or 'right'
+			var numbers = options.numbers || false;
+			var titleSelector = 'h1, h2, h3, h4, h5';
+			if (typeof options.titleSelector === 'string') titleSelector = options.titleSelector;
+			var hideMissingTitles = options.hideMissingTitles || false;
+			var markers = options.markers || false;
+			var custom = options.custom;
+			var themes = options.themes;
+			if (typeof themes === "undefined") {
+				themes = [
+					{ name: 'Black', theme: 'css/theme/black.css' },
+					{ name: 'White', theme: 'css/theme/white.css' },
+					{ name: 'League', theme: 'css/theme/league.css' },
+					{ name: 'Sky', theme: 'css/theme/sky.css' },
+					{ name: 'Beige', theme: 'css/theme/beige.css' },
+					{ name: 'Simple', theme: 'css/theme/simple.css' },
+					{ name: 'Serif', theme: 'css/theme/serif.css' },
+					{ name: 'Blood', theme: 'css/theme/blood.css' },
+					{ name: 'Night', theme: 'css/theme/night.css' },
+					{ name: 'Moon', theme: 'css/theme/moon.css' },
+					{ name: 'Solarized', theme: 'css/theme/solarized.css' }
+				];
+			}
+			var transitions = options.transitions;
+			if (typeof transitions === "undefined") transitions = true;
+			if (bowser.msie && bowser.version <= 9) {
+				// transitions aren't support in IE9 anyway, so no point in showing them
+				transitions = false;
+			}
+			var openButton = options.openButton;
+			if (typeof openButton === "undefined") openButton = true;
+			var openSlideNumber = options.openSlideNumber;
+			if (typeof openSlideNumber === "undefined") openSlideNumber = false;
+			var keyboard = options.keyboard;
+			if (typeof keyboard === "undefined") keyboard = true;
+
+			function disableMouseSelection() {
+				mouseSelectionEnabled = false;
+			}
+
+			function reenableMouseSelection() {
+				// wait until the mouse has moved before re-enabling mouse selection
+				// to avoid selections on scroll
+				$('nav.slide-menu').one('mousemove', function(event) {
+					//XXX this should select the item under the mouse
+					mouseSelectionEnabled = true;
+				});
+			}
+
+			//
+			// Keyboard handling
+			//
+			function getOffset(el) {
+				var _x = 0;
+				var _y = 0;
+				while(el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) {
+					_x += el.offsetLeft - el.scrollLeft;
+					_y += el.offsetTop - el.scrollTop;
+					el = el.offsetParent;
+				}
+				return { top: _y, left: _x };
+			}
+
+			function visibleOffset(el) {
+				var offsetFromTop = getOffset(el).top - el.offsetParent.offsetTop;
+				if (offsetFromTop < 0) return -offsetFromTop
+				var offsetFromBottom = el.offsetParent.offsetHeight - (el.offsetTop - el.offsetParent.scrollTop + el.offsetHeight);
+				if (offsetFromBottom < 0) return offsetFromBottom; 
+				return 0;
+			}
+
+			function keepVisible(el) {
+				var offset = visibleOffset(el);
+				if (offset) {
+					disableMouseSelection();
+					el.scrollIntoView(offset > 0);
+					reenableMouseSelection();	
+				}
+			}
+
+			function scrollItemToTop(el) {
+				disableMouseSelection();
+				el.offsetParent.scrollTop = el.offsetTop;
+				reenableMouseSelection();	
+			}
+
+			function scrollItemToBottom(el) {
+				disableMouseSelection();
+				el.offsetParent.scrollTop = el.offsetTop - el.offsetParent.offsetHeight + el.offsetHeight
+				reenableMouseSelection();	
+			}
+
+			function selectItem(el) {
+				$(el).addClass('selected');
+				keepVisible(el);
+			}
+
+			function onDocumentKeyDown(event) {
+				if (event.keyCode === 77) {
+					toggleMenu();
+				} else if (isOpen()) {
+					event.stopImmediatePropagation();
+					switch( event.keyCode ) {
+						// h, left - change panel
+						case 72: case 37:
+							prevPanel();
+							break;
+						// l, right - change panel
+						case 76: case 39:
+							nextPanel();
+							break;
+						// k, up
+						case 75: case 38:
+							var currItem = $('.active-menu-panel .slide-menu-items li.selected').get(0) || $('.active-menu-panel .slide-menu-items li.active').get(0);
+							if (currItem) {
+								$('.active-menu-panel .slide-menu-items li').removeClass('selected');
+								var nextItem = $('.active-menu-panel .slide-menu-items li[data-item="' + ($(currItem).data('item') - 1) + '"]').get(0) || currItem;
+								selectItem(nextItem);
+							} else {
+								var items = $('.active-menu-panel .slide-menu-items li.slide-menu-item');
+								if (items.length > 0) {
+									selectItem(items.get(0));
+								}
+							}
+							break;
+						// j, down
+						case 74: case 40:
+							var currItem = $('.active-menu-panel .slide-menu-items li.selected').get(0) || $('.active-menu-panel .slide-menu-items li.active').get(0);
+							if (currItem) {
+								$('.active-menu-panel .slide-menu-items li').removeClass('selected');
+								var nextItem = $('.active-menu-panel .slide-menu-items li[data-item="' + ($(currItem).data('item') + 1) + '"]').get(0) || currItem;
+								selectItem(nextItem);
+							} else {
+								var items = $('.active-menu-panel .slide-menu-items li.slide-menu-item');
+								if (items.length > 0) {
+									selectItem(items.get(0));
+								}
+							}
+							break;
+						// pageup, u
+						case 33: case 85:
+							var itemsAbove = $('.active-menu-panel .slide-menu-items li').filter(function(item) { return visibleOffset(item) > 0; });
+							var visibleItems = $('.active-menu-panel .slide-menu-items li').filter(function(item) { return visibleOffset(item) == 0; });
+
+							var firstVisible = (itemsAbove.length > 0 && Math.abs(visibleOffset(itemsAbove[itemsAbove.length-1])) < itemsAbove[itemsAbove.length-1].clientHeight ? itemsAbove[itemsAbove.length-1] : visibleItems[0]);
+							if (firstVisible) {
+								if ($(firstVisible).hasClass('selected') && itemsAbove.length > 0) {
+									// at top of viewport already, page scroll (if not at start)
+									// ...move selected item to bottom, and change selection to last fully visible item at top
+									scrollItemToBottom(firstVisible);
+									visibleItems = $('.active-menu-panel .slide-menu-items li').filter(function(item) { return visibleOffset(item) == 0; });
+									if (visibleItems[0] == firstVisible) {
+										// prev item is still beyond the viewport (for custom panels)
+										firstVisible = itemsAbove[itemsAbove.length-1];
+									} else {
+										firstVisible = visibleItems[0];
+									}
+								}
+								$('.active-menu-panel .slide-menu-items li').removeClass('selected');
+								selectItem(firstVisible);
+								// ensure selected item is positioned at the top of the viewport
+								scrollItemToTop(firstVisible);
+							}
+							break;
+						// pagedown, d
+						case 34: case 68:
+							var visibleItems = $('.active-menu-panel .slide-menu-items li').filter(function(item) { return visibleOffset(item) == 0; });
+							var itemsBelow = $('.active-menu-panel .slide-menu-items li').filter(function(item) { return visibleOffset(item) < 0; });
+
+							var lastVisible = (itemsBelow.length > 0 && Math.abs(visibleOffset(itemsBelow[0])) < itemsBelow[0].clientHeight ? itemsBelow[0] : visibleItems[visibleItems.length-1]);
+							if (lastVisible) {
+								if ($(lastVisible).hasClass('selected') && itemsBelow.length > 0) {
+									// at bottom of viewport already, page scroll (if not at end)
+									// ...move selected item to top, and change selection to last fully visible item at bottom
+									scrollItemToTop(lastVisible);
+									visibleItems = $('.active-menu-panel .slide-menu-items li').filter(function(item) { return visibleOffset(item) == 0; });
+									if (visibleItems[visibleItems.length-1] == lastVisible) {
+										// next item is still beyond the viewport (for custom panels)
+										lastVisible = itemsBelow[0];
+									} else {
+										lastVisible = visibleItems[visibleItems.length-1];
+									}
+								}
+								$('.active-menu-panel .slide-menu-items li').removeClass('selected');
+								selectItem(lastVisible);
+								// ensure selected item is positioned at the bottom of the viewport
+								scrollItemToBottom(lastVisible);
+							}
+							break;
+						// home
+						case 36:
+							$('.active-menu-panel .slide-menu-items li').removeClass('selected');
+							var sel = $('.active-menu-panel .slide-menu-items li:first-of-type');
+							if (sel.length > 0) {
+								keepVisible(sel.addClass('selected').get(0));
+							}
+							break;
+						// end
+						case 35:
+							$('.active-menu-panel .slide-menu-items li').removeClass('selected');
+							var sel = $('.active-menu-panel .slide-menu-items li:last-of-type');
+							if (sel.length > 0) {
+								keepVisible(sel.addClass('selected').get(0));
+							}
+							break;
+						// space, return
+						case 32: case 13:
+							var currItem = $('.active-menu-panel .slide-menu-items li.selected').get(0);
+							if (currItem) {
+								openItem(currItem);
+							}
+							break;
+						// esc
+						case 27: closeMenu(); break;
+					}
+				}
+			}
+
+			if (keyboard) {
+				//XXX add keyboard option for custom key codes, etc.
+
+				document.addEventListener('keydown', onDocumentKeyDown, false);
+
+				// handle key presses within speaker notes
+				window.addEventListener( 'message', function( event ) {
+					var data = JSON.parse( event.data );
+					if (data.method === 'triggerKey') {
+						onDocumentKeyDown( { keyCode: data.args[0], stopImmediatePropagation: function() {} } );
+					}
+				});
+
+				// Prevent reveal from processing keyboard events when the menu is open
+				if (config.keyboardCondition && typeof config.keyboardCondition === 'function') {
+					// combine user defined keyboard condition with the menu's own condition
+					var userCondition = config.keyboardCondition;
+					config.keyboardCondition = function() {
+						return userCondition() && !isOpen();
+					};
+				} else {
+					config.keyboardCondition = function() { return !isOpen(); }
+				}
+			}
+
+
+			//
+			// Utilty functions
+			//
+
+			function openMenu(event) {
+				if (event) event.preventDefault();
+				if (!isOpen()) {
+				    $('body').addClass('slide-menu-active');
+				    $('.reveal').addClass('has-' + options.effect + '-' + side);
+				    $('.slide-menu').addClass('active');
+				    $('.slide-menu-overlay').addClass('active');
+
+				    // identify active theme
+				    $('div[data-panel="Themes"] li').removeClass('active');
+				    $('li[data-theme="' + $('#theme').attr('href') + '"]').addClass('active');
+
+				    // identify active transition
+				    $('div[data-panel="Transitions"] li').removeClass('active');
+				    $('li[data-transition="' + Reveal.getConfig().transition + '"]').addClass('active');
+
+				    // set item selections to match active items
+				    $('.slide-menu-panel li.active')
+				    	.addClass('selected')
+				    	.each(function(item) { keepVisible(item) });
+				}
+			}
+
+			function closeMenu(event) {
+				if (event) event.preventDefault();
+			    $('body').removeClass('slide-menu-active');
+			    $('.reveal').removeClass('has-' + options.effect + '-' + side);
+			    $('.slide-menu').removeClass('active');
+			    $('.slide-menu-overlay').removeClass('active');
+			    $('.slide-menu-panel li.selected').removeClass('selected');
+			}
+
+			function toggleMenu(event) {
+				if (isOpen()) {
+					closeMenu(event);
+				} else {
+					openMenu(event);
+				}
+			}
+
+			function isOpen() {
+				return $('body').hasClass('slide-menu-active');
+			}
+
+			function openPanel(e) {
+				openMenu();
+				var panel = e;
+				if (typeof e !== "string") {
+					panel = $(e.currentTarget).data('panel');
+				}
+				$('.slide-menu-toolbar > li').removeClass('active-toolbar-button');
+				$('li[data-panel="' + panel + '"]').addClass('active-toolbar-button');
+				$('.slide-menu-panel').removeClass('active-menu-panel');
+				$('div[data-panel="' + panel + '"]').addClass('active-menu-panel');
+			}
+
+			function nextPanel() {
+				var next = ($('.active-toolbar-button').data('button') + 1) % buttons;
+				openPanel($('.toolbar-panel-button[data-button="' + next + '"]').data('panel'));
+			}
+
+			function prevPanel() {
+				var next = $('.active-toolbar-button').data('button') - 1;
+				if (next < 0) {
+					next = buttons - 1;
+				}
+				openPanel($('.toolbar-panel-button[data-button="' + next + '"]').data('panel'));
+			}
+
+			$('<nav class="slide-menu slide-menu--' + side + '"></nav>')
+				.appendTo($('.reveal'));
+			$('<div class="slide-menu-overlay"></div>')
+				.appendTo($('.reveal'))
+				.click(closeMenu);
+
+			var toolbar = $('<ol class="slide-menu-toolbar"></ol>').prependTo($('.slide-menu'));
+			var buttons = 0;
+			$('<li data-panel="Slides" data-button="' + (buttons++) + '" class="toolbar-panel-button"><span class="slide-menu-toolbar-label">Slides</span><br/><i class="fa fa-list"></i></li>')
+				.appendTo(toolbar)
+				.addClass('active-toolbar-button')
+				.click(openPanel);
+
+			if (custom) {
+				custom.forEach(function(element, index, array) {
+					$('<li data-panel="Custom' + index + '" data-button="' + (buttons++) + '" class="toolbar-panel-button"><span class="slide-menu-toolbar-label">' + element.title + '</span><br/>' + element.icon + '</i></li>')
+						.appendTo(toolbar)
+						.click(openPanel);
+				})
+			}
+
+			if (themes) {
+				$('<li data-panel="Themes" data-button="' + (buttons++) + '" class="toolbar-panel-button"><span class="slide-menu-toolbar-label">Themes</span><br/><i class="fa fa-desktop"></i></li>')
+					.appendTo(toolbar)
+					.click(openPanel);
+			}
+			if (transitions) {
+				$('<li data-panel="Transitions" data-button="' + (buttons++) + '" class="toolbar-panel-button"><span class="slide-menu-toolbar-label">Transitions</span><br/><i class="fa fa-arrows-h"></i></li>')
+					.appendTo(toolbar)
+					.click(openPanel);
+			}
+			$('<li id="close"><span class="slide-menu-toolbar-label">Close</span><br/><i class="fa fa-times"></i></li>')
+				.appendTo(toolbar)
+				.click(closeMenu);
+
+			var panels = $('.slide-menu');
+
+			//
+			// Slide links
+			//
+			function generateItem(type, section, i, h, v) {
+				var link = '/#/' + h;
+				if (typeof v === 'number' && !isNaN( v )) link += '/' + v;
+
+				var title = $(section).data('menu-title') ||
+					$('.menu-title', section).text() ||
+					$(titleSelector, section).text();
+				if (!title) {
+					if (hideMissingTitles) return '';
+					title = "Slide " + i;
+					type += ' no-title';
+				}
+
+				title = '<span class="slide-menu-item-title">' + title + '</span>';
+				if (numbers) {
+					// Number formatting taken from reveal.js
+					var value = [];
+					var format = 'h.v';
+
+					// Check if a custom number format is available
+					if( typeof numbers === 'string' ) {
+						format = numbers;
+					}
+					else if (typeof config.slideNumber === 'string') {
+						// Take user defined number format for slides
+						format = config.slideNumber;
+					}
+
+					switch( format ) {
+						case 'c':
+							value.push( i );
+							break;
+						case 'c/t':
+							value.push( i, '/', Reveal.getTotalSlides() );
+							break;
+						case 'h/v':
+							value.push( h + 1 );
+							if( typeof v === 'number' && !isNaN( v ) ) value.push( '/', v + 1 );
+							break;
+						default:
+							value.push( h + 1 );
+							if( typeof v === 'number' && !isNaN( v ) ) value.push( '.', v + 1 );
+					}
+
+					title = '<span class="slide-menu-item-number">' + value.join('') + '. </span>' + title;
+				}
+
+				var m = '';
+				if (markers) {
+					m = '<i class="fa fa-check-circle past"></i>' +
+								'<i class="fa fa-dot-circle-o active"></i>' + 
+								'<i class="fa fa-circle-thin future"></i>';
+				}
+
+				return '<li class="' + type + '" data-item="' + i + '" data-slide-h="' + h + '" data-slide-v="' + (v === undefined ? 0 : v) + '">' + m + title + '</li>';
+			}
+
+			function openItem(item) {
+				var h = $(item).data('slide-h');
+				var v = $(item).data('slide-v');
+				var theme = $(item).data('theme');
+				var transition = $(item).data('transition');
+				if (typeof h !== "undefined" && typeof v !== "undefined") {
+					Reveal.slide(h, v);
+					closeMenu();
+				} else if (theme) {
+					$('#theme').attr('href', theme);
+					closeMenu();
+				} else if (transition) {
+					Reveal.configure({ transition: transition });
+					closeMenu();
+				} else {
+					var links = $(item).find('a');
+					if (links.length > 0) {
+						links.get(0).click();
+					}
+					closeMenu();
+				}
+			}
+
+			function clicked(event) {
+				if (event.target.nodeName !== "A") {
+					event.preventDefault();
+				}
+				openItem(event.currentTarget);
+			}
+
+			function highlightCurrentSlide() {
+				var state = Reveal.getState();
+				$('li.slide-menu-item, li.slide-menu-item-vertical')
+					.removeClass('past')
+					.removeClass('active')
+					.removeClass('future');
+
+				$('li.slide-menu-item, li.slide-menu-item-vertical').each(function(e) {
+					var h = $(e).data('slide-h');
+					var v = $(e).data('slide-v');
+					if (h < state.indexh || (h === state.indexh && v < state.indexv)) {
+						$(e).addClass('past');
+					}
+					else if (h === state.indexh && v === state.indexv) {
+						$(e).addClass('active');
+					}
+					else {
+						$(e).addClass('future');
+					}
+				});
+			}
+
+			function createSlideMenu() {
+				if ( !document.querySelector('section[data-markdown]:not([data-markdown-parsed])') ) {
+					$('<div data-panel="Slides" class="slide-menu-panel"><ul class="slide-menu-items"></ul></div>')
+						.appendTo(panels)
+						.addClass('active-menu-panel');
+					var items = $('.slide-menu-panel[data-panel="Slides"] > .slide-menu-items');
+					var slideCount = 0;
+					$('.slides > section').each(function(section, h) {
+						var subsections = $('section', section);
+						if (subsections.length > 0) {
+							subsections.each(function(subsection, v) {
+								var type = (v === 0 ? 'slide-menu-item' : 'slide-menu-item-vertical');
+								var item = generateItem(type, subsection, slideCount, h, v);
+								if (item) {
+									slideCount++;
+									items.append(item);
+								}
+							});
+						} else {
+							var item = generateItem('slide-menu-item', section, slideCount, h);
+							if (item) {
+								slideCount++;
+								items.append(item);
+							}
+						}
+					});
+					$('.slide-menu-item, .slide-menu-item-vertical').click(clicked);
+					highlightCurrentSlide();
+				}
+				else {
+				// wait for markdown to be loaded and parsed
+					setTimeout( createSlideMenu, 100 );
+				}
+			}
+
+			createSlideMenu();
+			Reveal.addEventListener('slidechanged', highlightCurrentSlide);
+
+			//
+			// Custom menu panels
+			//
+			if (custom) {
+				function xhrSuccess () {
+					if (this.status >= 200 && this.status < 300) {
+						$(this.responseText).appendTo(this.panel);
+						enableCustomLinks(this.panel);
+					}
+					else {
+						showErrorMsg(this)
+					}
+				}
+				function xhrError () {
+					showErrorMsg(this)
+				}
+				function loadCustomPanelContent (panel, sURL) {
+					var oReq = new XMLHttpRequest();
+					oReq.panel = panel;
+					oReq.arguments = Array.prototype.slice.call(arguments, 2);
+					oReq.onload = xhrSuccess;
+					oReq.onerror = xhrError;
+					oReq.open("get", sURL, true);
+					oReq.send(null);
+				}
+				function enableCustomLinks(panel) {
+					$(panel).find('ul.slide-menu-items li.slide-menu-item').each(function(item, i) {
+						$(item).attr('data-item', i+1);
+						$(item).click(clicked);
+					});
+				}
+				function showErrorMsg(response) {
+					var msg = '<p>ERROR: The attempt to fetch ' + response.responseURL + ' failed with HTTP status ' + 
+						response.status + ' (' + response.statusText + ').</p>' +
+						'<p>Remember that you need to serve the presentation HTML from a HTTP server.</p>';
+						$(msg).appendTo(response.panel)
+				}
+
+				custom.forEach(function(element, index, array) {
+					var panel = $('<div data-panel="Custom' + index + '" class="slide-menu-panel slide-menu-custom-panel"></div>');
+					if (element.content) {
+						$(element.content).appendTo(panel);
+						enableCustomLinks(panel);
+					}
+					else if (element.src) {
+						loadCustomPanelContent(panel, element.src);
+					}
+					panel.appendTo(panels);
+				})
+			}
+
+			//
+			// Themes
+			//
+			if (themes) {
+				var panel = $('<div data-panel="Themes" class="slide-menu-panel"></div>').appendTo(panels);
+				var menu = $('<ul class="slide-menu-items"></ul>').appendTo(panel);
+				themes.forEach(function(t, i) {
+					$('<li class="slide-menu-item" data-theme="' + t.theme + '" data-item="' + (i+1) + '">' + t.name + '</li>').appendTo(menu).click(clicked);
+				})
+			}
+
+			//
+			// Transitions
+			//
+			if (transitions) {
+				var panel = $('<div data-panel="Transitions" class="slide-menu-panel"></div>').appendTo(panels);
+				var menu = $('<ul class="slide-menu-items"></ul>').appendTo(panel);
+				  ['None', 'Fade', 'Slide', 'Convex', 'Concave', 'Zoom', 'Cube', 'Page'].forEach(function(name, i) {
+					$('<li class="slide-menu-item" data-transition="' + name.toLowerCase() + '" data-item="' + (i+1) + '">' + name + '</li>').appendTo(menu).click(clicked);
+				})
+			}
+
+			//
+			// Open menu options
+			//
+			if (openButton) {
+				// add menu button
+				$('<div class="slide-menu-button"><a href="#"><i class="fa fa-bars"></i></a></div>')
+					.appendTo($('.reveal'))
+					.click(openMenu);
+			}
+
+			if (openSlideNumber) {
+				// wrap slide number in link
+				$('<div class="slide-number-wrapper"><a href="#"></a></div>').insertAfter($('div.slide-number'));
+				$('.slide-number').appendTo($('.slide-number-wrapper a'));
+				$('.slide-number-wrapper a').click(openMenu);
+			}
+
+			//
+			// Handle mouse overs
+			//
+			var mouseSelectionEnabled = true;
+			$('.slide-menu-panel .slide-menu-items li').mouseenter(function(event) {
+				if (mouseSelectionEnabled) {
+					$('.active-menu-panel .slide-menu-items li').removeClass('selected');
+					$(event.currentTarget).addClass('selected');
+				}
+			});
+
+			module.toggle = toggleMenu;
+			module.isOpen = isOpen;
+
+			/**
+			 * Extend object a with the properties of object b.
+			 * If there's a conflict, object b takes precedence.
+			 */
+			function extend( a, b ) {
+				for( var i in b ) {
+					a[ i ] = b[ i ];
+				}
+			}
+
+			/**
+			 * Dispatches an event of the specified type from the
+			 * reveal DOM element.
+			 */
+			function dispatchEvent( type, args ) {
+				var event = document.createEvent( 'HTMLEvents', 1, 2 );
+				event.initEvent( type, true, true );
+				extend( event, args );
+				document.querySelector('.reveal').dispatchEvent( event );
+
+				// If we're in an iframe, post each reveal.js event to the
+				// parent window. Used by the notes plugin
+				if( config.postMessageEvents && window.parent !== window.self ) {
+					window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, state: getState() }), '*' );
+				}
+			}
+
+			dispatchEvent('menu-ready');
+		}
+	})
+	})
+	});
+
+	// modified from math plugin
+	function loadResource( url, type, callback ) {
+		var head = document.querySelector( 'head' );
+		var resource;
+
+		if ( type === 'script' ) {
+			resource = document.createElement( 'script' );
+			resource.type = 'text/javascript';
+			resource.src = url;
+		}
+		else if ( type === 'stylesheet' ) {
+			resource = document.createElement( 'link' );
+			resource.rel = 'stylesheet';
+			resource.href = url;
+		}
+
+		// Wrapper for callback to make sure it only fires once
+		var finish = function() {
+			if( typeof callback === 'function' ) {
+				callback.call();
+				callback = null;
+			}
+		}
+
+		resource.onload = finish;
+
+		// IE
+		resource.onreadystatechange = function() {
+			if ( this.readyState === 'loaded' ) {
+				finish();
+			}
+		}
+
+		// Normal browsers
+		head.appendChild( resource );
+	}
+
+	function scriptPath() {
+		// obtain plugin path from the script element
+		var path;
+		if (document.currentScript) {
+			path = document.currentScript.src.slice(0, -7);
+		} else {
+			var sel = document.querySelector('script[src$="/menu.js"]')
+			if (sel) {
+				path = sel.src.slice(0, -7);
+			}
+		}
+		return path;
+	}
+
+	return module;
+})();
diff --git a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
index 34f4c3d..5fd2a7f 100644
--- a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
+++ b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
@@ -90,6 +90,14 @@
       border-color: gray;
     }
 
+$if(plugin-menu)$
+$if(plugin-chalkboard)$
+    .reveal .slide-menu-button {
+      left: 105px !important;
+    }
+$endif$
+$endif$
+
   </style>
 
     <style type="text/css">code{white-space: pre;}</style>
@@ -654,6 +662,39 @@
         maxScale: $maxScale$,
 $endif$
 
+$if(plugin-menu)$
+        menu: {
+$if(menu-side)$
+          side: $menu-side$,
+$endif$   
+$if(menu-numbers)$
+          numbers: $menu-numbers$,
+$endif$    
+$if(menu-titleSelector)$
+          titleSelector: $menu-titleSelector$,
+$endif$    
+$if(menu-hideMissingTitles)$
+          hideMissingTitles: $menu-hideMissingTitles$,
+$endif$    
+$if(menu-markers)$
+          markers: $menu-markers$,
+$endif$    
+$if(menu-openButton)$
+          openButton: $menu-openButton$,
+$endif$    
+$if(menu-openSlideNumber)$
+          openSlideNumber: $menu-openSlideNumber$,
+$endif$    
+$if(menu-keyboard)$
+          keyboard: $menu-keyboard$,
+$endif$ 
+          custom: false,
+          themes: false,
+          transitions: false
+        },
+
+$endif$
+
 $if(plugin-chalkboard)$
 
         chalkboard: {
@@ -709,6 +750,9 @@
 $if(plugin-chalkboard)$
           { src: '$revealjs-url$/plugin/chalkboard/chalkboard.js', async: true },
 $endif$
+$if(plugin-menu)$
+          { src: '$revealjs-url$/plugin/menu/menu.js', async: true },
+$endif$
         ]
       });
     </script>
