Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 04-29-2017, 12:39 PM   #1
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Talking My first EPUB! Need advice on best practices

Hi. I'm new here.

I'm in the process of creating my first EPUB using Sigil, and I have to say that I am thoroughly enjoying the process!

I used to construct XHTML 1.0 Strict and CSS2 websites, so constructing an EPUB is coming quite naturally to me.

I just conducted a Web search for a CSS template to use in my EPUB. I found one that recommends this statement:

Code:
@page {margin: 10px;}
Apparently, this statement adds margins around every page to stop Adobe Digital Editions' line numbers from being superimposed over the content.

In other words, this is a fix for a known problem with Adobe Digital Editions.

Questions
  1. Is this statement still necessary?
  2. Are there any other "fixes" or best practices that I should be following to ensure maximal compatibility?
fluoresce is offline   Reply With Quote
Old 04-30-2017, 04:44 AM   #2
Sunlite
Addict
Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.Sunlite ought to be getting tired of karma fortunes by now.
 
Sunlite's Avatar
 
Posts: 206
Karma: 547516
Join Date: Mar 2008
Location: Berlin, Germany
Device: KObo Clara, Kobo Aura, PRS-T1, PB602, CyBook Gen3
There is a quite comprehensive article about ePub in the wiki.

https://wiki.mobileread.com/wiki/EPUB

The article also contains tips of the special needs for all of the big name reading systems including ADE.
Sunlite is offline   Reply With Quote
Advert
Old 04-30-2017, 06:23 AM   #3
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,957
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Most Readers that use ADE don't have the page numbers in the right margin or there is an option to turn them off.

Best practice is to allow the default values where possible such as margins, line-height, & font size. Current Readers allow for margin changes, line-height, and font size. So you really don't need to add in your own values. Plus, @page causes issues with ADE and the right hand page number in that it move the page number from the right side based on your @page. Oh and don't left justify. It looks awful. One more thing, don't use margin shorthands. Use the long form of margins. It helps with comparability.

To ensure maximum comparability, keep your code as simple and clean as possible. Also, make sure it validates in the latest version of epubcheck.

Do you want advice on formatting as well?
JSWolf is offline   Reply With Quote
Old 04-30-2017, 06:40 AM   #4
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Quote:
Originally Posted by JSWolf View Post
Most Readers that use ADE don't have the page numbers in the right margin or there is an option to turn them off.

Best practice is to allow the default values where possible such as margins, line-height, & font size. Current Readers allow for margin changes, line-height, and font size. So you really don't need to add in your own values. Plus, @page causes issues with ADE and the right hand page number in that it move the page number from the right side based on your @page. Oh and don't left justify. It looks awful. One more thing, don't use margin shorthands. Use the long form of margins. It helps with comparability.

To ensure maximum comparability, keep your code as simple and clean as possible. Also, make sure it validates in the latest version of epubcheck.

Do you want advice on formatting as well?
Brilliant response!

Please tell me if I understand you correctly . . .
  • I should avoid setting my own margins, line-height, and font sizes.
  • I should avoid @page because ADE can't handle it.
  • I should not use text-align:left.
  • If I do use my own margins, I should use longhand, thus:

Code:
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
margin-left: 10px;
Questions
  1. If I don't apply my own margins, wouldn't the margins be 0px by default?
  2. In what way does "text-align:left" look terrible? Should I use "text-align:justify" instead, then?

Yes, please, formatting advice would be very much appreciated.
fluoresce is offline   Reply With Quote
Old 04-30-2017, 06:41 AM   #5
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Quote:
Originally Posted by Sunlite View Post
There is a quite comprehensive article about ePub in the wiki.

https://wiki.mobileread.com/wiki/EPUB

The article also contains tips of the special needs for all of the big name reading systems including ADE.
Excellent resource!
fluoresce is offline   Reply With Quote
Advert
Old 04-30-2017, 10:16 AM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
Most Readers that use ADE don't have the page numbers in the right margin or there is an option to turn them off.

Best practice is to allow the default values where possible such as margins, line-height, & font size. Current Readers allow for margin changes, line-height, and font size. So you really don't need to add in your own values. Plus, @page causes issues with ADE and the right hand page number in that it move the page number from the right side based on your @page. Oh and don't left justify. It looks awful. One more thing, don't use margin shorthands. Use the long form of margins. It helps with comparability.

To ensure maximum comparability, keep your code as simple and clean as possible. Also, make sure it validates in the latest version of epubcheck.

Do you want advice on formatting as well?
Stop talking nonsense Jon about @page. The @page is perfectly supported by ADE for many, many years. Even my very old PRS-300 supported it.
Also, some readers like left justify, others not. It is a personal opinion. Some want a small margin on each page, others don't. It is also a personal opinion.

Now, shorthand in CSS is better to be avoided because indeed some readers cannot handle it correctly. I also recommend to keep formatting as simple as possible.

Think about using relative instead of fixed values for certain styling such as font-size. It gives the reader much more flexibility.
Toxaris is offline   Reply With Quote
Old 04-30-2017, 10:18 AM   #7
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by fluoresce View Post

Questions
  1. If I don't apply my own margins, wouldn't the margins be 0px by default?
  2. In what way does "text-align:left" look terrible? Should I use "text-align:justify" instead, then?

Yes, please, formatting advice would be very much appreciated.
No, the margins will depend on the reader/reading application. I personally would set them, but keep them small. Some will prefer 0px.

Use what you would like. Some like left justified, some like full justified.
Toxaris is offline   Reply With Quote
Old 04-30-2017, 11:13 AM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,799
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
px (in, cm) is an absolute size. [Readers do not come in Absolute sizes, like paper ]

Avoid (when possible) Absolutes as they prevent scaling
use em or %, as they will scale
I have an older ADE device that ALWAYS shows those numbers in the right margin. I set the Body margin-right: 16px to give them space for 3 digits
theducks is offline   Reply With Quote
Old 04-30-2017, 12:14 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: 73,957
Karma: 128903250
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 Toxaris View Post
Stop talking nonsense Jon about @page. The @page is perfectly supported by ADE for many, many years. Even my very old PRS-300 supported it.
I never said @page didn't work with ADE. I remember on the Sony Readers, when @page was used, it moved the page number in the right side over by the amount of the right margin in @page. So that just caused blank space between the page number and the right side. Without the right side page number, @page works perfectly well in ADE. But, older Readers such as the aforementioned 300 or 505 did have the page number and @page did effect the placement of that page number. Overall, I think it's best not to use @page if the purpose is for avoiding the right side page number on Readers that still have them.

Quote:
Also, some readers like left justify, others not. It is a personal opinion. Some want a small margin on each page, others don't. It is also a personal opinion.
If the justification is not specified, ADE defaults to left. The problem is that some older Readers do not have a way of changing the justification and you get what's in the CSS.

Quote:
Think about using relative instead of fixed values for certain styling such as font-size. It gives the reader much more flexibility.
ADE defaults to a 1em font size. So plan other font sizes (such as chapter titles) around that. That works best and it doesn't cause an issue such as not being able to change the font size.
JSWolf is offline   Reply With Quote
Old 04-30-2017, 12:16 PM   #10
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,957
Karma: 128903250
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 theducks View Post
I have an older ADE device that ALWAYS shows those numbers in the right margin. I set the Body margin-right: 16px to give them space for 3 digits
For Readers with an older ADE (like the one you have), margins are best used instead of @page.
JSWolf is offline   Reply With Quote
Old 04-30-2017, 03:48 PM   #11
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Thanks for the help, guys.

I have a large EPUB, with lots of internal links. I need to clean up some tags using regex (delete lots of redundant classes). I merged all of the HTML files so that I can run regex for each fix just once instead of having to repeat it on each page individually. The problem is that when I split the files back up, many of the internal links stopped working! Why do the internal links not automatically update?

As I was splitting the files back up, I got a warning like this:

Quote:
The href ../Text/whatever.html#TOC_54345345 found in chapter3.html does not exist. Splitting or merging under these cuircumstances can result in broken links. Do you still wish to continue?
fluoresce is offline   Reply With Quote
Old 04-30-2017, 04:11 PM   #12
fluoresce
Enthusiast
fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.fluoresce ought to be getting tired of karma fortunes by now.
 
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
Is there a way of checking internal links?
fluoresce is offline   Reply With Quote
Old 04-30-2017, 06:05 PM   #13
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,094
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
Quote:
Originally Posted by fluoresce View Post
Thanks for the help, guys.

I have a large EPUB, with lots of internal links. I need to clean up some tags using regex (delete lots of redundant classes). I merged all of the HTML files so that I can run regex for each fix just once instead of having to repeat it on each page individually. The problem is that when I split the files back up, many of the internal links stopped working! Why do the internal links not automatically update?

As I was splitting the files back up, I got a warning like this:
Hi flouresce, welcome to MR!

There is no need to merge your html pages to run regex on all of them. All you need to do is select "All HTML Files" instead of "Current File" in the regex mode selector at the bottom.

Cheers!
Turtle91 is offline   Reply With Quote
Old 04-30-2017, 06:07 PM   #14
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,094
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
Quote:
Originally Posted by fluoresce View Post
Is there a way of checking internal links?
Going to "tools/reports" and then selecting "links" should give you a bunch of info. I also think hitting F7 (tools/Well Formed Check EPUB) might show up any broken links...but I'm not positive about that one.


...these tools would be in Sigil, of course.

Last edited by Turtle91; 04-30-2017 at 06:10 PM.
Turtle91 is offline   Reply With Quote
Old 04-30-2017, 07:03 PM   #15
dwig
Wizard
dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.dwig ought to be getting tired of karma fortunes by now.
 
dwig's Avatar
 
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
All of the advice so far about margins should be taken to refer to page/screen level tags (e.g. <body>, ...), other that the good advise to not use the shorthand notation.

Margins applied to Heading tags (e.g. <h1>, ...) and containers such as <div> and <p> are another matter. With these, margin-top and margin-bottom are excellent way to insert vertical space, if you use em units, though added space is best (IMO) left to special cases with <p> and <div> tags (eg. <p class="section" where the section class has a margin-top of perhaps 1em).
dwig is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Margin Best Practices epub->mobi BKh Conversion 0 08-09-2012 12:11 PM
TOC best practices (InDesign to ePUb) virtual_ink ePub 3 07-03-2011 01:50 PM
Free book (nook/Kindle) - The Truth About Branding Practices [Business Advice] ATDrake Deals and Resources (No Self-Promotion or Affiliate Links) 1 05-09-2011 03:22 AM
EPUB Math: Best Practices for Mathematics in Ebooks Adjust News 0 08-23-2010 10:17 PM
EPUB best practices guide Bob Russell ePub 25 04-01-2008 08:36 AM


All times are GMT -4. The time now is 01:11 AM.


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