aboutsummaryrefslogtreecommitdiff
path: root/default.revealjs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-04-05 15:23:36 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-04-05 15:23:36 -0700
commit79806d4417d02646158dcbdcc3686255098c9e3f (patch)
treeadf533ec86d70b01bc93ad7d965f7ad417e8d29f /default.revealjs
parent44723bcc95a35d1e7958daab05921f3ac7e77ee2 (diff)
downloadpandoc-79806d4417d02646158dcbdcc3686255098c9e3f.tar.gz
reveal.js template: Fix PDF print function.
See pandoc issue #1220.
Diffstat (limited to 'default.revealjs')
-rw-r--r--default.revealjs17
1 files changed, 13 insertions, 4 deletions
diff --git a/default.revealjs b/default.revealjs
index 51962e30d..69bccac8d 100644
--- a/default.revealjs
+++ b/default.revealjs
@@ -27,10 +27,19 @@ $endfor$
$else$
<link rel="stylesheet" href="$revealjs-url$/css/theme/simple.css" id="theme">
$endif$
- <link rel="stylesheet" media="print" href="$revealjs-url$/css/print/pdf.css" />
- <!--[if lt IE 9]>
- <script src="$revealjs-url$/lib/js/html5shiv.js"></script>
- <![endif]-->
+ <!-- If the query includes 'print-pdf', include the PDF print sheet -->
+ <script>
+ if( window.location.search.match( /print-pdf/gi ) ) {
+ var link = document.createElement( 'link' );
+ link.rel = 'stylesheet';
+ link.type = 'text/css';
+ link.href = '$revealjs-url$/css/print/pdf.css';
+ document.getElementsByTagName( 'head' )[0].appendChild( link );
+ }
+ </script>
+ <!--[if lt IE 9]>
+ <script src="$revealjs-url$/lib/js/html5shiv.js"></script>
+ <![endif]-->
$if(math)$
$math$
$endif$