Formatting Poetry in ePUB: Part 1 focused on basics of getting poetry indents right on multiple devices. In this post I wanted to give you a round up of other posts that have addressed poetry formatting issues in ePUBs. Most of these have been collected by Robert Nagle (@nagletx) on the MobileRead Wiki under “Formatting Verse for Epub, Kindle and Epub 3.”
Poems often appear with centered text. While you would think this would be easy (simply using
text-align:center; in the CSS), it can often go wrong depending on the reader, whether the
p element is in a
<div>, or other issues.
Liz Castro (@lizcastro) has a great post on her Pigs, Gourds, and Wikis site, “Centering in ebooks across ereaders,” that will tell you everything you need to know to understand how centering in CSS actually works and how to get your text to center on all readers.
Media Queries for Poetry
When designing poetry layout for print or ePUB, the size of the page plays a huge role. In ePUB, different devices have different screen sizes and widths, making poetry line breaks different on different devices. The solution? Media queries.
Liz Castro again has a great post to help you with this, “Media Queries for formatting Poetry on Kindle and EPUB.” This post will show you how to set up different CSS for each size screen so that your poetry renders exactly how you want it on tablets, eBook readers, and smartphones.
Small screens like smartphones can be difficult on poetry, especially if a poem’s lines are long. A post at epubBooks by Anton Bryl, “Formatting Poetry for EPUB and Small Devices,” helps you understand how to make poems render in a way that is pleasing to the eye and easy to read. Bryl covers the basic use of poetic indent for run-over lines, structuring the text so it renders well, and handling special cases like formal cæsuræ and Old English poems.
Mobi and KF8 Poetry
Joshua Tallent of eBook Architects does an excellent job covering formatting poetry for Kindle in his book Kindle Formatting. He has also posted a nice way to make poetry formatting for Kindle Fire 8 degrade nicely for Mobi (earlier versions of Kindle) in “Backwards Compatible Poetry for KF8/Mobi.” In the post, Tallent shows how to combine the negative
text-indent and non-breaking space hack for Kindle in combination with media queries.
Page Breaks after Poems
One of the decisions you will have to make if you are creating an entire poetry ePUB is whether you want each poem as a separate file of whether multiple poems will be included in a chapter or part. If you make each poem a separate HTML/XHTML file, you will create automatic page breaks after each poem. If you include multiple poems in one HTML/XHTML file, you may need to add page breaks after each poem within the file.
How do you do this? Mark Harmon has a good post on inserting page breaks within an HTML/XHTML file on his blog ePub and eBook Help, “ePub Formatting – How To Add a Page Break To an ePub Document Using HTML or CSS.” The post shows how to create a
<div> class using
style="page-break-before:always;" or use either
page-break-after:always; in your CSS.
What other resources have you found for formatting poetry in ePUBs? Do you have any additional tricks tor tips to share?