fix non-pdf printing (closes #881)

This commit is contained in:
Hakim El Hattab 2014-04-26 19:16:10 +02:00
parent b019604531
commit ae962d729b
3 changed files with 174 additions and 161 deletions

View File

@ -6,171 +6,186 @@
manipulate this file as you see fit. */ manipulate this file as you see fit. */
/* SECTION 1: Set default width, margin, float, and @media print {
background. This prevents elements from extending
beyond the edge of the printed page, and prevents /* SECTION 1: Set default width, margin, float, and
unnecessary background images from printing */ background. This prevents elements from extending
body { beyond the edge of the printed page, and prevents
background: #fff; unnecessary background images from printing */
font-size: 13pt; html {
width: auto; background: #fff;
height: auto; width: auto;
border: 0; height: auto;
margin: 0 5%; overflow: visible;
padding: 0; }
float: none !important; body {
overflow: visible; background: #fff;
} font-size: 28pt;
html { width: auto;
background: #fff; height: auto;
width: auto; border: 0;
height: auto; margin: 0 5%;
overflow: visible; padding: 0;
} overflow: visible;
float: none !important;
/* SECTION 2: Remove any elements not needed in print. }
This would include navigation, ads, sidebars, etc. */
.nestedarrow, /* SECTION 2: Remove any elements not needed in print.
.controls, This would include navigation, ads, sidebars, etc. */
.reveal .progress, .nestedarrow,
.reveal.overview, .controls,
.fork-reveal, .reveal .progress,
.share-reveal, .reveal.overview,
.state-background { .fork-reveal,
display: none !important; .share-reveal,
} .state-background {
display: none !important;
/* SECTION 3: Set body font face, size, and color. }
Consider using a serif font for readability. */
body, p, td, li, div, a { /* SECTION 3: Set body font face, size, and color.
font-size: 16pt!important; Consider using a serif font for readability. */
font-family: Georgia, "Times New Roman", Times, serif !important; body, p, td, li, div {
color: #000; font-size: 28pt!important;
} font-family: Georgia, "Times New Roman", Times, serif !important;
color: #000;
/* SECTION 4: Set heading font face, sizes, and color. }
Differentiate your headings from your body text.
Perhaps use a large sans-serif for distinction. */ /* SECTION 4: Set heading font face, sizes, and color.
h1,h2,h3,h4,h5,h6 { Differentiate your headings from your body text.
color: #000!important; Perhaps use a large sans-serif for distinction. */
height: auto; h1,h2,h3,h4,h5,h6 {
line-height: normal; color: #000!important;
font-family: Georgia, "Times New Roman", Times, serif !important; height: auto;
text-shadow: 0 0 0 #000 !important; line-height: normal;
text-align: left; font-family: Georgia, "Times New Roman", Times, serif !important;
letter-spacing: normal; text-shadow: 0 0 0 #000 !important;
} text-align: left;
/* Need to reduce the size of the fonts for printing */ letter-spacing: normal;
h1 { font-size: 26pt !important; } }
h2 { font-size: 22pt !important; } /* Need to reduce the size of the fonts for printing */
h3 { font-size: 20pt !important; } h1 { font-size: 36pt !important; }
h4 { font-size: 20pt !important; font-variant: small-caps; } h2 { font-size: 32pt !important; }
h5 { font-size: 19pt !important; } h3 { font-size: 30pt !important; }
h6 { font-size: 18pt !important; font-style: italic; } h4 { font-size: 30pt !important; font-variant: small-caps; }
h5 { font-size: 29pt !important; }
/* SECTION 5: Make hyperlinks more usable. h6 { font-size: 28pt !important; font-style: italic; }
Ensure links are underlined, and consider appending
the URL to the end of the link for usability. */ /* SECTION 5: Make hyperlinks more usable.
a:link, Ensure links are underlined, and consider appending
a:visited { the URL to the end of the link for usability. */
color: #000 !important; a:link,
font-weight: bold; a:visited {
text-decoration: underline; color: #000 !important;
} font-weight: bold;
/* text-decoration: underline;
.reveal a:link:after, }
.reveal a:visited:after { /*
content: " (" attr(href) ") "; .reveal a:link:after,
color: #222 !important; .reveal a:visited:after {
font-size: 90%; content: " (" attr(href) ") ";
} color: #222 !important;
*/ font-size: 90%;
}
*/
/* SECTION 6: more reveal.js specific additions by @skypanther */
ul, ol, div, p {
visibility: visible; /* SECTION 6: more reveal.js specific additions by @skypanther */
position: static; ul, ol, div, p {
width: auto; visibility: visible;
height: auto; position: static;
display: block; width: auto;
overflow: visible; height: auto;
margin: auto; display: block;
text-align: left !important; overflow: visible;
} margin: auto;
.reveal .slides { text-align: left !important;
position: static; }
width: auto; .reveal pre,
height: auto; .reveal table {
margin-left: 0;
left: auto; margin-right: 0;
top: auto; }
margin-left: auto; .reveal pre code {
margin-top: auto; padding: 20px;
padding: auto; border: 1px solid #ddd;
}
overflow: visible; .reveal .slides {
display: block; position: static;
width: auto;
text-align: center; height: auto;
-webkit-perspective: none;
-moz-perspective: none; left: 0;
-ms-perspective: none; top: 0;
perspective: none; margin-left: 0;
margin-top: 0;
-webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */ padding: 0;
-moz-perspective-origin: 50% 50%;
-ms-perspective-origin: 50% 50%; overflow: visible;
perspective-origin: 50% 50%; display: block;
}
.reveal .slides>section, text-align: center;
.reveal .slides>section>section { -webkit-perspective: none;
-moz-perspective: none;
visibility: visible !important; -ms-perspective: none;
position: static !important; perspective: none;
width: 90% !important;
height: auto !important; -webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */
display: block !important; -moz-perspective-origin: 50% 50%;
overflow: visible !important; -ms-perspective-origin: 50% 50%;
perspective-origin: 50% 50%;
left: 0% !important; }
top: 0% !important; .reveal .slides>section,
margin-left: 0px !important; .reveal .slides>section>section {
margin-top: 0px !important; visibility: visible !important;
padding: 20px 0px !important; position: static !important;
width: 90% !important;
opacity: 1 !important; height: auto !important;
display: block !important;
-webkit-transform-style: flat !important; overflow: visible !important;
-moz-transform-style: flat !important;
-ms-transform-style: flat !important; left: 0 !important;
transform-style: flat !important; top: 0 !important;
margin-left: 0 !important;
-webkit-transform: none !important; margin-top: 0 !important;
-moz-transform: none !important; padding: 20px 0px !important;
-ms-transform: none !important;
transform: none !important; opacity: 1 !important;
}
.reveal section { -webkit-transform-style: flat !important;
page-break-after: always !important; -moz-transform-style: flat !important;
display: block !important; -ms-transform-style: flat !important;
} transform-style: flat !important;
.reveal section .fragment {
opacity: 1 !important; -webkit-transform: none !important;
visibility: visible !important; -moz-transform: none !important;
-ms-transform: none !important;
-webkit-transform: none !important; transform: none !important;
-moz-transform: none !important; }
-ms-transform: none !important; .reveal section {
transform: none !important; page-break-after: always !important;
} }
.reveal section:last-of-type { .reveal section .fragment {
page-break-after: avoid !important; opacity: 1 !important;
} visibility: visible !important;
.reveal section img {
display: block; -webkit-transform: none !important;
margin: 15px 0px; -moz-transform: none !important;
background: rgba(255,255,255,1); -ms-transform: none !important;
border: 1px solid #666; transform: none !important;
box-shadow: none; }
.reveal section:last-of-type {
page-break-after: avoid !important;
}
.reveal section img {
display: block;
margin: 15px 0px;
background: rgba(255,255,255,1);
border: 1px solid #666;
box-shadow: none;
}
.reveal section small {
font-size: 0.8em;
}
} }

View File

@ -20,15 +20,13 @@
<!-- For syntax highlighting --> <!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css"> <link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet --> <!-- Include the appropriate print stylesheet -->
<script> <script>
if( window.location.search.match( /print-pdf/gi ) ) { var link = document.createElement( 'link' );
var link = document.createElement( 'link' ); link.rel = 'stylesheet';
link.rel = 'stylesheet'; link.type = 'text/css';
link.type = 'text/css'; link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
link.href = 'css/print/pdf.css'; document.getElementsByTagName( 'head' )[0].appendChild( link );
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script> </script>
<!--[if lt IE 9]> <!--[if lt IE 9]>

View File

@ -2014,7 +2014,7 @@ var Reveal = (function(){
// Show the horizontal slide if it's within the view distance // Show the horizontal slide if it's within the view distance
if( distanceX < viewDistance ) { if( distanceX < viewDistance ) {
horizontalSlide.style.display = 'block'; horizontalSlide.style.display = '';
loadSlide( horizontalSlide ); loadSlide( horizontalSlide );
} }
else { else {
@ -2031,7 +2031,7 @@ var Reveal = (function(){
distanceY = x === indexh ? Math.abs( indexv - y ) : Math.abs( y - oy ); distanceY = x === indexh ? Math.abs( indexv - y ) : Math.abs( y - oy );
if( distanceX + distanceY < viewDistance ) { if( distanceX + distanceY < viewDistance ) {
verticalSlide.style.display = 'block'; verticalSlide.style.display = '';
loadSlide( verticalSlide ); loadSlide( verticalSlide );
} }
else { else {