Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-25-2017, 04:25 PM   #1
dougfetch2
Junior Member
dougfetch2 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: none
Forced line breaks and full justify

I've got this project that involves a poem with specific formatting. The lines need forced line breaks but also full justification. I searched a bunch on google and found various tricks that all fail to pan out when tried in the ePub.

Such as

https://stackoverflow.com/questions/...rows-in-a-poem
https://stackoverflow.com/questions/...text-using-css

The best solution did the breaks and the full justify (the second link) however when a long paragraph of text went from one page to the next the reader cut the lines off weird (top few pixels of a line at the and of the page and the rest of the pixels on the next page) -- I think due to the line-height confusing the reader (iBooks).

Any tricks for accomplishing forced line breaks and full justification?
- Doug
dougfetch2 is offline   Reply With Quote
Old 07-25-2017, 05:42 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I don't think you can do it.
JSWolf is offline   Reply With Quote
Advert
Old 07-25-2017, 10:44 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Welcome to MR dougfetch2!

Formatting poetry properly is one of the more difficult, if not impossible, challenges in a reflowable format such as ePub. There should be easy css properties to do what you want, but apparently the demand isn't high enough for the IDPF (the ePub standards people) to require them.

There are multiple threads on here that discuss formatting poetry, but the basic answer is for the author to accept that some of the more esoteric shapes/designs cannot be done in reflowable ePub. If it is essential to have a specific shape, then sometimes inserting an image of the poem is the easiest option. The other option (not for the novice or faint of heart) is to do a fixed format ePub.

For your specific question of line breaks and justified alignment: I can only recommend <br /> and text-align:justify and perhaps setting a <div> with a specific width (and perhaps a monospace/fixed-width font). The page-break-inside, orphans, and widows settings MIGHT help prevent breaking over a page, but it sounds like iBooks has a bug - what a shock...

Code:
CSS
div.poem   {width:410px; margin:2em; page-break-inside:avoid}
div.poem p {font-size:.8em; text-indent:0; text-align:justify; orphans:0; widows:0}

<div class="poem">
     <p>
     Bacon ipsum dolor amet andouille<br />
     meatloaf rump meatball, shank ribeye<br />
     jowl turkey swine. Drumstick tri-tip<br />
     brisket, cupim tongue andouille chuck<br />
     spare ribs. Bresaola cow drumstick,<br />
     tail boudin ground round sausage<br />
     kielbasa prosciutto turkey andouille<br />
     jowl spare ribs. Short ribs brisket.
     </p>
</div>
The div width could be set to a value that just covers the longest line???

Sorry I don't have more help for you - hopefully one of our poetry formatting gurus has some better advice!

Cheers
Turtle91 is offline   Reply With Quote
Old 07-29-2017, 05:21 PM   #4
dougfetch2
Junior Member
dougfetch2 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2017
Device: none
Thanks for the thoughts. I tried the suggestion and the iBook won't full justify it. Evil iBooks.
dougfetch2 is offline   Reply With Quote
Old 07-29-2017, 05:36 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
It can't be done.
JSWolf is offline   Reply With Quote
Advert
Old 07-30-2017, 06:54 AM   #6
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by dougfetch2 View Post
Thanks for the thoughts. I tried the suggestion and the iBook won't full justify it. Evil iBooks.
Actually, iBooks is pretty much the best ePub 3 renderer around. Blame the standard, not iBooks.

Poetry is one of the very few things I'd suggest investigating the possibility of using PDF for. A nice PDF with pages properly sized for eInk devices can be very good for this kind of thing.
HarryT is offline   Reply With Quote
Old 07-30-2017, 04:27 PM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by HarryT View Post
Actually, iBooks is pretty much the best ePub 3 renderer around. Blame the standard, not iBooks.

Poetry is one of the very few things I'd suggest investigating the possibility of using PDF for. A nice PDF with pages properly sized for eInk devices can be very good for this kind of thing.
So how do you size a PDF that works well for a 5", 6", 6.8", 7.8", 8", 9.7", & 13" screens?
JSWolf is offline   Reply With Quote
Old 07-30-2017, 05:22 PM   #8
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by JSWolf View Post
So how do you size a PDF that works well for a 5", 6", 6.8", 7.8", 8", 9.7", & 13" screens?
Since the lines are fixed length, they either will be readable on a 5" screen, or they won't.

Once a minimum readable size is found, size the PDF page for that. On larger devices, zoom to fit if it's not automatic. For smaller devices, try portrait.
j.p.s is offline   Reply With Quote
Old 07-31-2017, 06:30 AM   #9
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
For my sins, I was once sent the PDF of a book I need for a book review. It was laid out two pages of book on a PDF page. To have the type large enough to read on my 7-inch Fire tablet, I had to do a lot of moving the pages around. It wasn't fun, but it was doable, and I got the job done.

I don't think a single book-sized page would pose much of a problem. At worst, I could read in landscape mode, which would require such one thumb-sweep to read a page.
Notjohn is offline   Reply With Quote
Old 07-31-2017, 10:59 AM   #10
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by j.p.s View Post
Since the lines are fixed length, they either will be readable on a 5" screen, or they won't.

Once a minimum readable size is found, size the PDF page for that. On larger devices, zoom to fit if it's not automatic. For smaller devices, try portrait.
I think you mean try landscape.

Dale
DaleDe is offline   Reply With Quote
Old 07-31-2017, 11:09 AM   #11
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by JSWolf View Post
So how do you size a PDF that works well for a 5", 6", 6.8", 7.8", 8", 9.7", & 13" screens?
You could cover the bases pretty well by producing two versions: one optimized for a 6" screen and the other for a 9.7" screen. Larger devices would simply display the page a little bigger.

I'm not claiming that it's a perfect solution, but it may perhaps be the best available. ePub just isn't up to the job of formatting poetry. If you have any better ideas, please do put them forward.

Last edited by HarryT; 07-31-2017 at 11:13 AM.
HarryT is offline   Reply With Quote
Old 07-31-2017, 12:12 PM   #12
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by DaleDe View Post
I think you mean try landscape.

Dale
Yep. Sorry.
j.p.s is offline   Reply With Quote
Old 07-31-2017, 12:16 PM   #13
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by HarryT View Post
ePub just isn't up to the job of formatting poetry.
Just curious. Does epub ignore the PRE tag?
j.p.s is offline   Reply With Quote
Old 07-31-2017, 12:42 PM   #14
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by j.p.s View Post
Just curious. Does epub ignore the PRE tag?
No, it should work, but isn't it really only useful with a monospaced font? The place I've seen it used most often is with monospaced code samples in books.
HarryT is offline   Reply With Quote
Old 07-31-2017, 12:58 PM   #15
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by HarryT View Post
No, it should work, but isn't it really only useful with a monospaced font? The place I've seen it used most often is with monospaced code samples in books.
I forgot that aspect of it. I guess all the solutions to the epub poetry problem are a compromise.

I live in a 7 bit ASCII monospace font world, so I would see that as the least compromise.

Maybe some embedded font trickery combined with use of PRE would do the job.
j.p.s is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Line breaks on Kindle, no line breaks on 4 PC Siavahda Kindle Formats 0 10-20-2012 05:50 AM
Line breaks with no style therealjoeblow Conversion 5 11-01-2011 11:51 PM
Spurious Line Breaks Halk Workshop 1 05-15-2010 01:22 PM
No line breaks ecpepper Amazon Kindle 3 08-09-2009 06:42 PM
Getting rid of line breaks with Bookdesigner Ned Workshop 16 11-01-2008 05:37 PM


All times are GMT -4. The time now is 01:16 PM.


MobileRead.com is a privately owned, operated and funded community.