Skip to content

Commit

Permalink
page-break control using HTML classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Jul 20, 2017
1 parent c9bb47e commit 473b893
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion content/02.equations.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Equations {.newpage}
### Equations {.page_break_before}

Numbered equations can be included by using `$$` delimiters with embedded LaTeX math.
Equations can be labeled with tags like this `{#eq:label}` and referenced in text using `@eq:label`.
Expand Down
33 changes: 29 additions & 4 deletions output/github-pandoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,37 @@ body {
margin: 0;
}

/**
* Page breaks when printing

/*
* Page Breaks
* https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2982#issuecomment-308714479
*/

@media print {
.newpage {page-break-before: always;}
@media screen, print {
/***Always insert a page break before the element***/
.page_break_before {
page-break-before: always !important;
}

/***Always insert a page break after the element***/
.page_break_after {
page-break-after: always !important;
}

/***Avoid page break before the element (if possible)***/
.page_break_before_avoid {
page-break-before: avoid !important;
}

/***Avoid page break after the element (if possible)***/
.page_break_after_avoid {
page-break-after: avoid !important;
}

/* Avoid page break inside the element (if possible) */
.page_break_inside_avoid {
page-break-inside: avoid !important;
}
}

/* ==========================================================================
Expand Down

0 comments on commit 473b893

Please sign in to comment.