05-08-2015, 09:11 AM | #1 |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
EPUB to AZW3 problem
When converting EPUBs that have <h1> and <h2> on the same page, the AZW3 output moves the <h2> to a separate page (the <h1> and <h2> are in the same HTML file before conversion, but in two separate files after).
I have set the "Insert page break before" option (Preferences > Conversion > Common Options > Structure Detection) to "/" but it makes no difference. The EPUB has the following style settings: Code:
h1 { font-size: 1.5em; text-align: center; page-break-before: always; margin: 5em 2em 1em 2em; } h2 { font-size: 1.2em; text-align: center; margin: 2em; } |
05-08-2015, 11:51 AM | #2 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Why are you using multiple headers on a single page? I mean, I get that you can use all kinds of weird settings to force through nonstandard results, but why not just build the book properly to begin with?
Whyever you are doing it, I am sure there must be a better way. |
Advert | |
|
05-08-2015, 12:05 PM | #3 | |
just an egg
Posts: 1,588
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
|
Quote:
That works for me to limit page breaks to only <h1> and keeps any <h2> subheads on the same page. @eschwartz: I have a few books that use <h1> for chapter heads and <h2> for subheads. With the above "insert page break before" option it works fine. Why is this improper? Last edited by odamizu; 05-08-2015 at 12:11 PM. |
|
05-08-2015, 12:19 PM | #4 | |
Well trained by Cats
Posts: 29,872
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
You are using HTML2 methods to style Style a 'p.subhead' style if you want that appearance font-size: 1.5em; font-weight: bold; text-align: center; |
|
05-08-2015, 12:42 PM | #5 | |
just an egg
Posts: 1,588
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
|
Quote:
Seriously, I only have a couple books that use <h1> <h2> for chapter and subhead, so I was looking for a quick fix to block pagebreaks and still have the subheads included in the TOC. But in the interest of bringing me into the current century, if I changed <h2> to <p class="subhead"> would the appropriate TOC expressions be: Level 1 //h:h1 and Level 2 //h: p[@subhead] ? (with no space between h: and p, but I had to do that otherwise it gave me this emoticon: ) |
|
Advert | |
|
05-08-2015, 01:57 PM | #6 | |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
I agree with you about heads & subheads. Structurally, the H2s are headings, not just paras with a special appearance. They should be denoted as such in the HTML. However, I then want to use CSS to control the appearance of that structure, and not have the appearance undermined by the conversion tool. Eschwartz's position seems to be that I should destroy the structure to give the correct appearance... in which case I could use nothing but <div> or <span> with CSS to give the appearance of headings, quotations and other structural elements. |
|
05-08-2015, 02:08 PM | #7 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
The appropriate way is I believe to use a
Code:
<h1>Header<br/><span class="subhead">Subhead</span></h1> The CSS for .subhead can be used to modify the subhead relative to the original header class. @odamizu -- use the [NOPARSE][/NOPARSE] tags. Cleverly, I have used them recursively, in order to stop the [NOPARSE][/NOPARSE] tags from being parsed and disappearing (like this: ). Last edited by eschwartz; 05-08-2015 at 04:31 PM. Reason: typo |
05-08-2015, 04:25 PM | #8 |
Well trained by Cats
Posts: 29,872
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
use the eschwartz method.
I play also with Lineheight for the Span |
05-08-2015, 07:48 PM | #9 |
just an egg
Posts: 1,588
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
|
Ummm ... okay ... aside from the fact that the <br/> and <span> within an <h1> makes for some pretty ugly code I think we're talking about different kinds of subheads.
This is my HTML/CSS: Spoiler:
Then I run it through Calibre with the following settings:
With the above, Calibre inserts a pagebreak before each chapter but not before subheads and it creates a TOC structured like so: Chapter 1
Chapter 2
I think it will take a lot more (ugly ) code to make the eschwartz method accomplish the same |
05-08-2015, 07:58 PM | #10 |
just an egg
Posts: 1,588
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
|
Yeah, okay, you totally lost me here Where do I use NOPARSE and what will it do for me?
|
05-08-2015, 08:05 PM | #11 |
Grand Sorcerer
Posts: 12,216
Karma: 73758904
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
The NOPARSE tags are used HERE in the forums. By wrapping stuff in [NOPARSE]stuff goes here[/NOPARSE] tags you prevent the forum from interpreting stuff goes here as valid BBCode tags.
See https://www.mobileread.com/forums/misc.php?do=bbcode for all valid BBCode tags. |
05-08-2015, 09:03 PM | #12 | |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
|
|
05-08-2015, 10:43 PM | #13 |
just an egg
Posts: 1,588
Karma: 4300000
Join Date: Mar 2015
Device: Kindle, iOS
|
@PeterT: Ohhhhhhhh. COOL! Thanks!
@eschwartz: But the real question is, did we help the OP? |
05-08-2015, 11:25 PM | #14 |
Well trained by Cats
Posts: 29,872
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Preferences :common options: delete the H2 reference
(or the similar section in the individual Book conversion form) OR Use H2 and H3 as h3 does not get a forced pagebreak |
05-09-2015, 08:03 AM | #15 |
Wizard
Posts: 1,176
Karma: 5061953
Join Date: Jun 2011
Location: Ontario, Canada
Device: Kobo Aura HD
|
Since most of my e-book conversions are e-book to e-book format, I disable the "insert page break" entirely by default. Since most properly formatted books will already have the page breaks, (or file splits) at the right places, automatically adding more can only be bad.
In your conversion options, under "Structure Detection". Change "Chapter Mark" to None, and change "Insert Page Breaks Before" to '/' (No quotes, just the slash.) Edit: Since you've already changed the "inert Page Breaks', the only option that would be adding unwanted page breaks is the Chapter mark at automatic Chapter detection. Changing that to none should correct the problem. Last edited by rashkae; 05-09-2015 at 08:08 AM. |
Tags |
page breaks |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Image Conversion problem from Epub to AZW3 | rosshalde | Conversion | 0 | 12-01-2014 10:48 AM |
table of contents problem in epub to azw3 | quizzz | Conversion | 0 | 02-22-2014 02:10 AM |
EPUB to AZW3 Duplicate first image problem | loopshot | Conversion | 1 | 10-30-2013 10:46 PM |
Problem with conversion from AZW3 to ePub | Kaetrin | Conversion | 3 | 05-30-2013 04:57 AM |
azw3 problem | theluckyfox | Conversion | 3 | 10-20-2012 03:38 PM |