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-23-2023, 02:45 AM   #1
Interrobang
Oracle Pig Keeper
Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!
 
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
Aligning Text Across Facing Pages

When producing a PDF or actual print book, it's easy to establish a baseline grid so that text on facing pages line up perfectly. How does one achieve this in HTML/CSS within an ePub?

I know that Apple Books and Kobo both require that text aligns this way on facing pages, but they provide no code examples on how to achieve this.

During my testing, when both pages are just simple text, they do align. But when one page contains a chapter header at the top in a different font or size, no amount of minor spacing tweaks will achieve the desired goal.

Is there an established way to do this easily? Are there any code samples out there on the subject you can point me to? Any help would be appreciated.

Thanks
Interrobang is offline   Reply With Quote
Old 07-23-2023, 06:04 AM   #2
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,601
Karma: 87456643
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Facing pages on epub?

You'd need a giant screen. Makes no sense on bulk of things used to read ebooks.
I can't remember even seeing facing pages in reflowable ebooks in twenty years.

Have you actually tried using facing pages on a 6″ to 8″ eink or on a 4″ to 6″ phone or an iPad mini?

Quote:
During my testing, when both pages are just simple text, they do align. But when one page contains a chapter header at the top in a different font or size, no amount of minor spacing tweaks will achieve the desired goal.
It's what I'd expect. But what on earth did you test on? Some 10″ or larger device in landscape? Hardly anything more than Manga or comics are read on more than 8″ and slightly more than half of ebooks are read on phones.

I'd think only fixed layout will let you do what you ask and that won't work for most user-reading people as it needs 10″ or larger in landscape.

Really real ebooks (not image based or PDFs) are single page and simulate two page up by using two columns.
Quoth is offline   Reply With Quote
Advert
Old 07-23-2023, 08:10 AM   #3
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,554
Karma: 84810789
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by Interrobang View Post
I know that Apple Books and Kobo both require that text aligns this way on facing pages, but they provide no code examples on how to achieve this.
This seems extremely unlikely to me, especially since the content contained on particular screens will change based on user selections.

Can you provides references to these requirements?
jhowell is offline   Reply With Quote
Old 07-23-2023, 09:41 AM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,601
Karma: 87456643
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by jhowell View Post
This seems extremely unlikely to me
I agree. It's desirable on paper (registration) so that text on either side of the same sheet/leaf lines up, which will result in body text on adjacent pages aligning. I never heard of it as a requirement for ebooks, which as I said earlier, don't normally have adjacent pages and rarely have two columns, because neither of those work well for most people. Also it only matters on a PDF when you print it duplex.
Quoth is offline   Reply With Quote
Old 07-23-2023, 01:44 PM   #5
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Interrobang View Post
When producing a PDF or actual print book, it's easy to establish a baseline grid so that text on facing pages line up perfectly.
This is called "Grid-Based" / "Grid System" / "Baseline Grid" Typography.

If you look that up in your favorite search engines, plus append CSS to it, you can find lots of examples:

Quote:
Originally Posted by Interrobang View Post
How does one achieve this in HTML/CSS within an ePub?
Within an EPUB? You don't.

A lot of this relies on:

Quote:
Originally Posted by jhowell View Post
This seems extremely unlikely to me, especially since the content contained on particular screens will change based on user selections.

Can you provides references to these requirements?
I agree completely.

Quote:
Originally Posted by Interrobang View Post
During my testing, when both pages are just simple text, they do align. But when one page contains a chapter header at the top in a different font or size, no amount of minor spacing tweaks will achieve the desired goal.
You'd try to keep all your vertical margins/padding/line-heights as multiples of X.

But, the second users begin changing their fonts/settings, all your manual calculations will be thrown off.

On the Print (and websites), where YOU control most of the stuff... most users just take what you force down their throats.

In ebooks though, USERS control most of these settings, and the settings vary wildly.

Also, like other MR users have explained, most ebooks are read on a single-screen device, NOT two-page spreads like physical books. So to enforce a lot of this grid-based layout in EPUB... I just don't see it making a lot of sense.

- - -

Side Note: If you want to see some of this CSS3 Page-Based Media stuff, see the talk from:

I referenced it a few times on MobileRead:

describing some of the nuances of how you turn HTML/EPUB from an "infinite scroll" type thing into "pages".

Since then, the W3C absorbed a lot of that info into the:

but it's still a work-in-progress.

Last edited by Tex2002ans; 07-23-2023 at 02:42 PM.
Tex2002ans is offline   Reply With Quote
Advert
Old 07-23-2023, 04:04 PM   #6
Interrobang
Oracle Pig Keeper
Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!
 
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
Quote:
Originally Posted by jhowell View Post
This seems extremely unlikely to me, especially since the content contained on particular screens will change based on user selections.

Can you provides references to these requirements?
Apple Books Asset Guide states the following:
Quote:
Alignment

If specifying line-height, extra spacing between text blocks and any padding around images should be a multiple of the specified line-height to keep text aligned across the spine.
It goes on to state that iPads will show facing pages when turned to landscape mode. Kobo states the same behavior with their readers, and ADE will show two pages when the width of the reading window is extended.

I'm just trying to follow their guidelines, since failing to do so may be grounds for a book submission to be rejected. Personally speaking, I think the requirement is an error. It may be possible with a fixed layout book making use of their javascript libraries, but it's not really practical to implement for a flowing book.
Attached Thumbnails
Click image for larger version

Name:	line_height1.png
Views:	63
Size:	227.8 KB
ID:	202797  

Last edited by Interrobang; 07-23-2023 at 04:22 PM.
Interrobang is offline   Reply With Quote
Old 07-23-2023, 05:23 PM   #7
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,554
Karma: 84810789
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
If specifying line-height, extra spacing between text blocks and any padding around images should be a multiple of the specified line-height to keep text aligned across the spine.
That is a truly strange strange requirement. I have not seen anything like it for other e-book platforms.

You mention Kobo and ADE. Some Kindle apps and devices can also show side-by-side pages when in portrait orientation. I have read the Kindle Publishing Guidelines and there is nothing like this Apple page alignment requirement there. Perhaps someone more familiar with Kobo can comment about that platform's requirements.

The requirement itself is also odd and subject to different interpretations. If might be seen as applying only if the publisher wishes to to keep text aligned across the spine. Or only if a line-height is specified in the document. It uses "should" instead of "must" which usually indicates something is suggested but not required.

Finally doing what it says won't even work in many cases. For example the presence of images on the page will throw the placement of text that follows out of alignment unless images are also sized in multiples of the line height.

I find it hard to believe that books from commercial publishers are modified to follow this rule, but I could be wrong. It might be a good idea to ask for clarification in a forum specific to publishing for Apple.

Last edited by jhowell; 07-23-2023 at 06:03 PM.
jhowell is offline   Reply With Quote
Old 07-23-2023, 05:28 PM   #8
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,601
Karma: 87456643
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I've never had a book rejected for that. The only thing in about 7 years that Apple objected to was a line reading, "free updates with proof of purchase". But actually if people buy on Smashwords they can freely get any revision since their purchase.

Even the Kobo Elipsa doesn't do two up pages for an ebook (10.3″), nor Sage, Elipsa2, Elipsa, Nia, Touch C, or Aura HD H2O original.

Nor does the Elipsa do it with PDFs.

I've only ever seen it on PDFs (scans or not) that are actually formatted two pages side by side, or columns. Though I'm sure the Fixed layout epub can do it.

I have seen two columns (not pages) done in epub, azw3 and mobi using tables or CSS. It's often dreadful. I edited one ebook that had a short letter in one column and the recipient thinking about it and narration in the second column to be sequential. That was mimicking what was originally on a single page on print edition. J Rowling also had a badly done multicolumn ebook, but again it wasn't two page layout.

Anyway, the guidelines are maybe written by someone that's not used regular ebooks and less than a 10" screen. Maybe even a viewer on a desktop.
The only way I can sensibly even see two pages PDF is on a 22" QHD or ideally 4k/UHD approximately 23" screen. I'd like a 4K 19" or 20" but can't find one.
Quoth is offline   Reply With Quote
Old 07-23-2023, 05:34 PM   #9
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: 74,582
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
There is no way I could read such a book on my iPhone or Libra 2 (7" screen).

Last edited by JSWolf; 07-23-2023 at 05:36 PM.
JSWolf is offline   Reply With Quote
Old 07-23-2023, 05:34 PM   #10
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,601
Karma: 87456643
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
There are apps that will do two pages up in Landscape, but you need a 10″ or bigger screen.
Only printed on paper books have a spine!
Only paper needs body text registration.
Quoth is offline   Reply With Quote
Old 07-23-2023, 05:35 PM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,601
Karma: 87456643
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by JSWolf View Post
There is no way I could read such a book on my iPhone.
You don't have an iPhone Mega-Max with the pull-out 14" colour screen like on Earth: Final Conflict?
Quoth is offline   Reply With Quote
Old 07-23-2023, 06:18 PM   #12
colinsky
Addict
colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.colinsky ought to be getting tired of karma fortunes by now.
 
colinsky's Avatar
 
Posts: 233
Karma: 3232318
Join Date: Sep 2009
Device: Sony PRS-300, PRS-T1, PRS-T3
Even without a side-by-side display, I can see an aesthetic benefit in a strict alignment where, (regardless of chapter, search headers and dividers), the displayed lines of text remain in the same vertical positions as you turn each page instead of moving slightly up and down the screen. I wouldn't think to require it, but it would be certainly nice to be able to consistently apply within a book.
colinsky is offline   Reply With Quote
Old 07-23-2023, 06:49 PM   #13
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,554
Karma: 84810789
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
I took a look at a sample of a popular book in the Books app on my iPad and alignment across the spine for a two page spread was not maintained.
Attached Thumbnails
Click image for larger version

Name:	screenshot.jpg
Views:	69
Size:	55.3 KB
ID:	202799  
jhowell is offline   Reply With Quote
Old 07-23-2023, 10:04 PM   #14
Interrobang
Oracle Pig Keeper
Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!
 
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
Quote:
Originally Posted by jhowell View Post
I took a look at a sample of a popular book in the Books app on my iPad and alignment across the spine for a two page spread was not maintained.
Thanks for the information. I won't worry about this issue now. I couldn't find a way to do it, but thought there must be a way if Apple is asking for it to be done. I guess they'll have to wait for CSS4.

Thanks again everyone for your input.
Interrobang is offline   Reply With Quote
Old 07-24-2023, 12:59 AM   #15
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Interrobang View Post
Thanks for the information. I won't worry about this issue now. I couldn't find a way to do it, but thought there must be a way if Apple is asking for it to be done.
Sounds like one of those things tossed into the guide by someone who doesn't know much about the reality in ebooks.

Similar junk exists in the Amazon publishing guidelines as well. (Like one of the lies saying they "support MathML" or they tell you things that aren't possible in KDP.)

You'd "align to the grid"—which may not divide evenly into that screen's text area—then you toss in a few Widows/Orphans, and people would be complaining about these "enormous gaps" at the bottom of their screens.

Better to just focus on very clean HTML/CSS + follow best practices as close as you can.

Last edited by Tex2002ans; 07-24-2023 at 01:37 AM.
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two-pages image (facing pages) / How to? 42piratas ePub 24 11-10-2022 02:01 PM
optional (double pages, facing pages) kelly33 Kindle Formats 0 11-08-2012 01:02 AM
Right Aligning Wrapped Text Only ghostyjack ePub 7 11-04-2010 08:54 AM
Correctly Aligning Text Within a Table ghostyjack ePub 3 07-28-2010 07:18 AM
Turning Scanned PDFs with facing pages into single pages jimteacher Workshop 5 11-09-2009 02:59 PM


All times are GMT -4. The time now is 10:13 AM.


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