![]() |
#1 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Split on Every Incidence of the Word Chapter
When I convert a book, I can go to Structure detection (see image) and insert the following expression in the "Detect chapters at (XPath expression
![]() //*[re:test(., "Chapter", "i")] then go to Chapter mark: and choose pagebreak and the conversion will split the HTML at every instant of the word chapter. Making the creation of a TOC easy. My question is when I'm in the book editor and I choose to split at multiple locations (see image). Which expression can I insert here to have the same result? Currently, after merging the files, if I see the need I will save the book and back out then convert the book to accomplish my desired results. I would much prefer to be able to insert an expression here and do the same thing. Edit: when I cut and paste the expression above into the edit book split area I get an error. Here are the 2 most common errors. ERROR: Unhandled exception: <b>AbortError</b>:Cannot split on the <body> tag ERROR: Unhandled exception: <b>AbortError</b>:The expression //*[re:test(., "Chapter", "i")] did not match any nodes Last edited by DoctorOhh; 12-05-2024 at 09:47 PM. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,023
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Did you try the wizard (part of split at multiple locations)?
Usually I just split as is (the way I got the book) and then go back and check those filenames that do not have the extras from a split., those I merge or delete if empty of content |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,708
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
![]() |
#4 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
I can use the wizard for underlying html code: p, h1, h2, b, etc... but haven't figured how to use the wizard to split on actual text content.
Six of one half a dozen of the other. I've done it both ways, but I usually merge the content files first then split. |
![]() |
![]() |
![]() |
#5 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
I haven't been able to use the wizard to split on actual book content. Split on html such as h1, h2, p, b, i, etc... easy, but not on words in the content.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,318
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
They are both xpath expressions you should be able to use the same in both places.
|
![]() |
![]() |
![]() |
#7 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,708
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
![]() |
#8 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,023
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#9 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
here is an example error. Spoiler:
Last edited by DoctorOhh; 12-05-2024 at 11:02 PM. |
|
![]() |
![]() |
![]() |
#10 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
#11 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,318
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah that's because splitting is a different algorithm. In the conversion what happens is the immediate tag is marked and the splitting happens on marked tags later on. Splitting directly is more complex. Instead use the transform html tool to makr the tags with a class or other attribute and then you use splitting wizard in the next step.
|
![]() |
![]() |
![]() |
#13 | |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
I had decided simply saving the epub after I merge the files I desire to split, then switching to conversion is easier for me, than marking as you suggested. I'll give it a second look, maybe, once learned, marking will be best. Thanks again. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word -> EPUB Chapter titles blank for Headings using Word's {TC...} codes | GranitStateColin | Conversion | 2 | 12-21-2021 09:29 PM |
How to reformat an epub so I can split it at each chapter? | MarjaE | Editor | 6 | 05-18-2020 11:50 AM |
What is the Xpath for "Split html at the word 'chapter" | lealla | Editor | 5 | 06-26-2015 03:32 AM |
Aura HD Last paragraph in chapter gets split | Nick Payne | Kobo Reader | 9 | 02-16-2014 02:49 AM |
Find, replace, split chapter? | laelaps | Sigil | 8 | 01-20-2011 04:01 PM |