Skip to main content
Participant
January 29, 2024
Answered

Vertical aligment doesn't get exported to reflowable EPUB

  • January 29, 2024
  • 1 reply
  • 2210 views

Hello! First of all, sorry if anything is unclear; English is not my first language.

I have the following issue: I'm typesetting a poetry book in ID, where all text frames are vertically centered. I was able to configure this from the menu Object > Text Frame Options. However, when I export it to reflowable EPUB, it is not reflected in the layout. I know I could simply export it as fixed layout, but it's a requirement for it to be a reflowable EPUB. I can't use paragraph styles by adding space before or after because the verses are necessarily split with Enter, and I can't change that.

Is there a way to maintain vertical justification in reflowable EPUB? Thank you very much.

This topic has been closed for replies.
Correct answer James Gifford—NitroPress

The short answer is that reflowable e-books don't actually have "pages" — they have one long page from beginning to end, and it's the reader that imposes pagination based on font size, spacing, screen size, and all the reader and user settings. So most elements that are dependent on a fixed page with top and bottom margins just sort of disappear on export.

 

There are a number of ways to force new page starts and manage vertical spacing. An absolute centering top to bottom is difficult because of the 'flexibility' of the pages, but it can be approximated.

 

There's no short, simple or universal answer; this is formatting that needs to use several "tools" and each needs to be adapted to the material. Here's a very basic starting approach:

  • Create a variant body text style and name it something like PageTop or FirstLine. (It should be in a direct hierarchy from your main Body style, to make management easy  — that is, based on Body or whatever.)
  • Apply it to, obviously, the first line or paragraph on each page.
  • In the paragraph's style menu, under Export Tagging, check the Split EPUB box.
  • In the EPUB export menu, under General, check the Split Document box and select Based on Paragraph Style Export Tag.

 

Now, when you export, ID will create a new starting page each time it encounters a "split" paragraph style, and you will be able to force the text to a page top. (The technical reasons are complicated.)

 

You can now experiment with top spacing for that paragraph to approximate vertically centered spacing. Obviously, that's going to vary with the amount of text and all of the page-sizing settings of the reader. You may want to create 2 or 4 or 10 child variants with varying top spacing to get the result you want throughout the book. (There is a more advanced method that will let you do proportional spacing, but it requires adding CSS export styling to the project... which is not difficult but a whole additional step.)

 

Learning to do basic CSS styling is essential to getting the best results from EPUB (and through that to Kindle). But the restriction you're working under, reflowable instead of the (not!) simple, (not!) obvious fixed page, is the right one. Fixed page, FXL, is an obsolete and difficult format and not really appropriate for modern e-books.

 

Work with the above, and come on back if you have further questions. Happy to help. You might find this essay useful:

1 reply

James Gifford—NitroPress
Legend
January 29, 2024

The short answer is that reflowable e-books don't actually have "pages" — they have one long page from beginning to end, and it's the reader that imposes pagination based on font size, spacing, screen size, and all the reader and user settings. So most elements that are dependent on a fixed page with top and bottom margins just sort of disappear on export.

 

There are a number of ways to force new page starts and manage vertical spacing. An absolute centering top to bottom is difficult because of the 'flexibility' of the pages, but it can be approximated.

 

There's no short, simple or universal answer; this is formatting that needs to use several "tools" and each needs to be adapted to the material. Here's a very basic starting approach:

  • Create a variant body text style and name it something like PageTop or FirstLine. (It should be in a direct hierarchy from your main Body style, to make management easy  — that is, based on Body or whatever.)
  • Apply it to, obviously, the first line or paragraph on each page.
  • In the paragraph's style menu, under Export Tagging, check the Split EPUB box.
  • In the EPUB export menu, under General, check the Split Document box and select Based on Paragraph Style Export Tag.

 

Now, when you export, ID will create a new starting page each time it encounters a "split" paragraph style, and you will be able to force the text to a page top. (The technical reasons are complicated.)

 

You can now experiment with top spacing for that paragraph to approximate vertically centered spacing. Obviously, that's going to vary with the amount of text and all of the page-sizing settings of the reader. You may want to create 2 or 4 or 10 child variants with varying top spacing to get the result you want throughout the book. (There is a more advanced method that will let you do proportional spacing, but it requires adding CSS export styling to the project... which is not difficult but a whole additional step.)

 

Learning to do basic CSS styling is essential to getting the best results from EPUB (and through that to Kindle). But the restriction you're working under, reflowable instead of the (not!) simple, (not!) obvious fixed page, is the right one. Fixed page, FXL, is an obsolete and difficult format and not really appropriate for modern e-books.

 

Work with the above, and come on back if you have further questions. Happy to help. You might find this essay useful:

Inspiring
October 8, 2024

I have tried this approach but have met with failure; headings preceded by the special para style (which I have called 'Split') still appear at the top of the page in Kindle Previewer. Is there some setting I may have got wrong? I attach screenshots of the general tab in the export settings and the export tagging tab in the Split para style.

James Gifford—NitroPress
Legend
October 8, 2024

Your settings seem to be correct, but without seeing your actual layout structure I can only guess. Are you inserting a paragraph above the first line of a poem, with that paragraph being the 'split' marker? If these paragraphs are empty, the export process will delete them and you'll get no net result.

 

The solution is to make the first line/paragraph of each poem the 'split' marker and assign the desired amount of space-before to it.