This project contains a small collection of stylesheets suitable for styling eBooks conforming to the ePub 2.1 specification. I have tested the styles in the Sigil ePub editor, as well as on the Barnes and Noble Nook Simple Touch, and the Aldiko Reader application for Android (on both the ASUS Nexus 7 tablet, and HTC First smartphone).
The stylesheets are distributed under the terms of the MIT License. As such, you are free to use them as you wish; even in commercial or for-profit projects. The only required form of attribution is to preserve the license text at the beginning of the stylesheets, which is only visible when editing the file. The full text of the license is included at the bottom of this document.
- screenplay.css - Hollywood-style screenplays
- modern-report.css - for academic essays conforming to the MLA guidelines
- longform-report.css - for long-form academic essays conforming to the APA guidelines
Using the Stylesheets
The stylesheets can be used as they appear in the src directory. Each one is annotated to facilitate integrating it into the document. For this reason, it is recommended that you minify the stylesheets before publication, to remove extra whitespace and comments that are not necessary for the finished document. This step is optional.
In order to use the formatting, be sure to link to the stylesheet in the <head> element of each HTML section, and apply the necessary styles to each element in the document. Sigil users can right click on the desired HTML file in the Book Browser (normally to the left of the editor), and select ‘Link Stylesheets…’ to apply the formatting.
The Screenplay stylesheet provides the necessary rules for creating a Hollywood-style script.
While the industry standard format for screenplays is based on fixed measurements relative to US Letter sized pages, this stylesheet employs percentage-based sizing, in order to accomodate the varied display sizes of ePub compatible devices. When printing to 8.5"x11" pages, the standard size is preserved. Other devices approximate the standard format, using the available screen space.
This stylesheet was designed to be compatible with the HTML source generated by the Celtx screenwriting software. For best results, you can remove the extraneous line breaks that Celtx tends to add at the end of paragraphs.
This stylesheet specifies the following classes:
- .sceneheading - for sluglines (e.g. INT. COFFEE SHOP - DAY)
- .action - for descriptions and action
- .character - the name of the character who is speaking
- .continued - adds (CONT'D) at the end of the line
- .parenthetical - emotion or action added to dialog
- .dialog - the character's lines
- .transition - cuts, dissolves, fades, etc.
Additional classes are available for creating title pages.
The Modern Report stylesheet provides a skeleton for creating reports conforming to the MLA guidelines. Note, however, that these formatting rules are not a magic bullet, and will not account for all aspects of the format.
The stylesheet does provide correct spacing, paragraph indentation, frontmatter, a title class, and a class for bibliographic citations. Due to current limitations, we cannot provide the running header for each page, nor can we provide automatically numbered headings.
- All tagged paragraphs and headings in the document will be double spaced, set in Times New Roman, Georgia, or a serif typeface
- Use the .frontmatter class for the name, instructor's name, course, and date at the beginning of the paper
- These can be individual paragraphs with the .frontmatter class, or a single paragraph split with <br /> tags
- The .title class is used for the title of the paper, and to denote the end notes, and works cited sections
- Long quotes use the blockquote tag
- Bibliographic citations use the .citation class
This is also under construction.
Contributing to the Project
There are a number of areas in this project where contribution is more than welcome. I'm hoping to expand the scope of this project to include other types of documents, and alternative stylesheets (e.g. add a stylesheet for writing letters, or add a stage variation of the screenplay stylesheet). Any ideas or requests are welcome.
While I strive to write standards compliant CSS, I am aware that different devices produce different quirks when rendering documents. Any testing and feedback on additional devices is greatly appreciated, as I do not have access to every reading system that could come in contact with these stylesheets.
CSS style contributions are also welcome, under the following conditions:
- The contributor must hold the legal rights to distribute the style rules being submitted
- CSS that you write from scratch is fine
- CSS copied from a web page, or a project where you do not hold the copyright cannot be accepted
- The contributed CSS must be licensed under the same terms as this project (the MIT license)
- Contributors must list themselves as the copyright holder over the relevant CSS sections
Any code contributions that do not adhere to these guidelines will be removed from the source tree.
Copyright (C) 2013 by Kevin Carlson. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.