Skip to content

Instantly share code, notes, and snippets.

@mchogan
Created July 2, 2013 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchogan/5908910 to your computer and use it in GitHub Desktop.
Save mchogan/5908910 to your computer and use it in GitHub Desktop.
Manually control line breaks inside of PressBooks headings when exporting to PDF.
/*
The following CSS works with PressBooks
PDF Export
http://www.pressbooks.com
Let's say that the Chapter 1 heading is
"The Need for Creative Solutions That Work"
By default, PressBooks outputs this to PDF as...
"The Need for Creative Solutions"
"That Work"
Here is how to manually control the line breaks
so that it becomes...
"The Need for"
"Creative Solutions That Work"
*/
div#chapter-1 h2.chapter-title {
display:block;
prince-text-replace: " Creative Solutions that Work" "";
}
div#chapter-1 h2.chapter-title:after {
display:block;
content: 'Creative Solutions That Work';
white-space: pre;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment