![]() |
#46 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
|
|
![]() |
![]() |
![]() |
#47 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,891
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Onto the HTML. Your ID's do nothing so you don't need them. You also don't need an <a> that does nothing but holds an id that does nothing. If in your ToC, you have these ID's, then get rid of them. If your ToC entries are going to the top of each HTML file then forget IDs. They will slow things down as the Reader has to load the HTML and then go find the ID instead of just loading the HTML and starting from the top. Also, that's code bloat when you have code that does nothing. I changed the second line in the chapter header to be a <p> because then it won't be used if you use calibre or Sigil to generate a ToC from your headers. The title= I put in will be the ToC entry if you do generate a ToC from calibre or Sigil. The thing is, once you export your book from InDesign as an ePub, you will need to hand edit the code. After you've done this you and you make changes to the text in InDesign you will want to make the changes to the ePub and not generate a new ePub as you will then have to once again hand edit the code. InDesign can make some rather messy code. I've edited a lot of eBooks that came from InDesign and they messy. When you hand edit, I suggest you change class names to make sense if any of the InDesign classes don't make sense. Do you need an embedded font for the chapter titles? If you do, change the font family names to the names of the font(s) being used. But you don't need two different fonts for the chapter title. That's ugly. [code] Code:
h1 { font-family: "Font1", sans-serif; font-size: 2em; font-weight: normal; margin-top: 0.5em; margin-bottom: 1em; text-align:center; text-indent: 0; } .chapter-no { font-family: "Font2", serif; margin-bottom: 0; margin-top: 1em; } Code:
<h1 class="chapter-no" title="1. Chapter Title">1.</h1> <p class="chapter-no">Chapter Title</p> Last edited by JSWolf; 02-01-2024 at 06:53 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#48 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,891
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Which devices create a ToC on the fly and ignore an existing ToC?
|
![]() |
![]() |
![]() |
#49 | |||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
Quote:
No, it is just in this case (main chapter titles, just a couple of them) where the TOC points to the top of the page, otherwise there are dozens of section titles which need the ID's for the TOC to work. I also need the text anchor IDs for the index references, which point to the physical version, so there have to be text anchors spread out for it to work. Quote:
Quote:
![]() Yes, it's the publisher’s request that on the devices that support publisher styles/font it should appear the same as the physical version, hence the fonts and the styling. It works very well on KBReader, Lithium, latest KOReader on my Kindle PW3, drop caps included on some of them. Whether that's beautiful or ugly is irrelevant for this thread. |
|||
![]() |
![]() |
![]() |
#50 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
I randomly checked an epub from Oxford University Press with the same academic subject as the one I'm working on and here’s how they do the chapter number/chapter title:
Code:
<h2 class="ch_title1" id="oso-666-chapter-1"><a id="page_1"/><a href="04_Contents1.xhtml#n0001">1</a></h2> <h2 class="ch_title2"><a href="04_Contents1.xhtml#n0001"><em>Movie Title</em> Something</a></h2> ------- h2.ch_title1 { font-size: 160%; font-weight: bold; text-align: center; text-indent: 0em; margin-left: 0em; margin-right: 0em; margin-top: 2em; margin-bottom: 0em; } h2.ch_title2 { font-size: 140%; font-weight: bold; text-align: center; text-indent: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; margin-bottom: 2.75em; } Last edited by paperwhite13; 02-02-2024 at 04:15 AM. Reason: code |
![]() |
![]() |
Advert | |
|
![]() |
#51 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,617
Karma: 103503445
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Some renderers will ignore margin-top on an item that's at the start of a file, which is thus a new page. Using padding-top for any first item in a file (like a chapter heading, next title in omnibus, section heading etc that are on new pages) seems to work on everything.
The Elephant in the room is really InDesign. It's really Corporate DTP for paper books, magazines etc later fudged by Adobe for ebooks, which is why it works a bit better for Fixed Layout (electronic but not really ebooks) epub. Almost no Kindle users will be jailbroken, which is needed for KOReader. Test azw3 as a minimum on a Kindle. |
![]() |
![]() |
![]() |
#52 | ||
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,891
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#53 | ||||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
Quote:
![]() I know about Kindle, I was using KOReader as just another epub reader for testing, this book probably won’t even end up in the Kindle ecosystem. Quote:
Quote:
Quote:
![]() |
||||
![]() |
![]() |
![]() |
#54 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,891
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Adobe Garamond Pro is a terrible font for an eInk screen. So using it as the body font does not work because of the poor contrast. That's what I mean when I say fonts may not work. They have to have the contrast needed for an eInk screen. The problem is that if you want to use a font that has enough contrast on eInk, it may be too heavy for the pBook. This is why you should not try to duplicate the pBook. An eBook is not a pBook. It doesn't always work. Last edited by JSWolf; 02-02-2024 at 08:16 AM. |
|
![]() |
![]() |
![]() |
#55 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 131
Karma: 9236
Join Date: Jun 2020
Device: Kindle PW3 [KOReader]
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#56 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I'm so sorry it took me longer than expected to get these examples...I couldn't find the images I had made, and my search-fu is not strong...
Attached are a few examples of how using a basic chapter header tag works. From testing accomplished by others it works very well on almost all devices...the one exception if you try and send your ePub through the kepubify service it requires a more precise descriptor (you need to add a class="..." to the <span>. Code:
CSS: h3 {yadda yadda} h3 span {display:block; yadda yadda} HTML: <h3>Chapter 1 <span>Chapter Title</span></h3> <p class="first">This is the first paragraph in the chapter.</p> <p>This is the second, and subsequent, paragraph(s) in the chapter.</p> Edit: And yes, Jon, we know you don't approve of anyone else's coding...but the great part is you can change it to whatever YOU want! ![]() Last edited by Turtle91; 02-02-2024 at 10:51 AM. |
![]() |
![]() |
![]() |
#57 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,891
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
In the first example, there is too much space between the chapter title and the first paragraph (IMHO). In the third example, I think the chapter header would look better if it was more centered vertically in the space there. Then it would look better. I also like that it does not have an excess of white space. I've seen some chapter headers that use 15% of wasted space. Last edited by JSWolf; 02-02-2024 at 11:13 AM. |
|
![]() |
![]() |
![]() |
#58 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
What the, actual, Frack, Jon!
Let’s try a learning experiment. You, actually READ someone’s post BEFORE you complain… You might actually learn something…. [ZOOM] Edit: And yes, Jon, we know you don't approve of anyone else's coding...but the great part is you can change it to whatever YOU want! [/ZOOM] |
![]() |
![]() |
![]() |
#59 | |||||
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 515
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Quote:
Quote:
Code:
.para-firstinchapter { text-align: justify; } .para-firstinchapter::first-line { font-variant: small-caps; font-size: 120%; line-height: 0.8; } .para-firstinchapter::first-letter { font-size: 200%; line-height: 0.5; } Quote:
You can see in the attached screenshot that the Kindle renders the same space between each line, despite the large first character, and overall larger font size that my code uses. Note that the "H" in "He" is 13 pixels high, while the "E" in "English" on the next line is only 11 pixels. The whole first line uses a larger font, but the line spacing is 25 pixels (baseline to baseline). This is actually 2 pixels less than the line spacing in the rest of the page, likely due to the exact way Kindle determines the value. Quote:
Quote:
|
|||||
![]() |
![]() |
![]() |
#60 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 515
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Quote:
I do this because h1 has semantic meaning, and so all headings at the same level should use that element. But, many books want "special" chapters (like "Acknowledgements" or "Epilogue") to look slightly different from "normal" chapters. For example, some books use a fairly large (3em to 4em) font for chapters that are just a bare number (i.e., 7), while the "Epilogue" is only 1.5 to 2em. Those "special" chapters are still at the same level as the "normal" ones...they aren't parents or children...so they need the same element. By directly styling the h1, you have to "undo" the base formatting for the "special" chapters. You would then use something like h1.normalchapter and h1.specialchapter. But, if you are going to do that, why bother restricting to h1? If you decide you need to change the level of headings down or up, then the stylesheet has to be changed to match. Without restricting to a single element and a class, instead only using a class, it's more flexible. |
|
![]() |
![]() |
![]() |
Tags |
indesign, sigil |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any Addons that aid in Library Cleanup and/or metadata repair/cleanup? | Meido | Calibre | 2 | 01-17-2018 03:49 AM |
Adobe InDesign and poor code | JSWolf | ePub | 15 | 01-18-2017 01:02 PM |
HTML cleanup on epub conversion | Lofwyr23 | Conversion | 4 | 06-06-2014 04:56 PM |
EPUB Expert Needed: Cant properly export epub from InDesign | crottmann | ePub | 17 | 08-27-2010 10:23 AM |
InDesign and epub | FredD | ePub | 2 | 04-13-2009 08:38 PM |