diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2014-04-05 15:23:36 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2014-04-05 15:23:36 -0700 |
commit | 79806d4417d02646158dcbdcc3686255098c9e3f (patch) | |
tree | adf533ec86d70b01bc93ad7d965f7ad417e8d29f /default.revealjs | |
parent | 44723bcc95a35d1e7958daab05921f3ac7e77ee2 (diff) | |
download | pandoc-79806d4417d02646158dcbdcc3686255098c9e3f.tar.gz |
reveal.js template: Fix PDF print function.
See pandoc issue #1220.
Diffstat (limited to 'default.revealjs')
-rw-r--r-- | default.revealjs | 17 |
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$ |