Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-11-2024, 11:27 AM   #1
perkin5
Member
perkin5 began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Sep 2014
Device: Kindle
Sigil automatic splitting of document

In the past, when I have loaded an epub into Sigil, all the chapters or sections have been automatically split into separate files. I have just loaded an epub generated in Indesign and the whole book is in one file despite the fact that Kindle Previewer shows separate pages. I can see instances of:
Code:
<div id="page2" role="doc-pagebreak" aria-label="2" epub:type="pagebreak" />
but they have not split the file. I know I can do this manually by splitting at the cursor Ctrl+Enter but I want to do it automatically. There are several promising looking tools in the menu but I don't want to accidentally wreck the document. Can anyone advise?
perkin5 is offline   Reply With Quote
Old 10-11-2024, 12:16 PM   #2
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: 30,451
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Search&Replace those with the Sigil split marker: (it is on the tools menu)

<hr class="sigil_split_marker" />

Once done: F6 (executes the split)
theducks is offline   Reply With Quote
Old 10-11-2024, 12:52 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
You probably do not want to split on every page break. Especially if this is not a fixed layout epub. Try looking for heading tags.
KevinH is offline   Reply With Quote
Old 10-11-2024, 01:59 PM   #4
perkin5
Member
perkin5 began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Sep 2014
Device: Kindle
Many thanks!

Quote:
Originally Posted by theducks View Post
Search&Replace those with the Sigil split marker: (it is on the tools menu)

<hr class="sigil_split_marker" />

Once done: F6 (executes the split)
The split marker is not on the tools menu in 2.0.0 but on the Insert menu, which foxed me for a bit! OK that works and many thanks. May I ask a supplementary - can I select text and then comment it out? There appears to be no toolbar button to do this in 2.0.0
perkin5 is offline   Reply With Quote
Old 10-11-2024, 02:03 PM   #5
perkin5
Member
perkin5 began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Sep 2014
Device: Kindle
Yes, maybe you are right - I do want some page breaks in the front matter of my book but the manual job is then much less.
perkin5 is offline   Reply With Quote
Old 10-11-2024, 04:12 PM   #6
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,225
Karma: 19000635
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
To comment in HTML, place a <!-- tag before the comment text and a --> tag after the comment text. In Sigil you can create a clip like this:
Quote:
<!--\1-->
So all you need to do is highlight the section you want commented out and click on the clip.
Turtle91 is offline   Reply With Quote
Old 10-11-2024, 04:15 PM   #7
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: 30,451
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by perkin5 View Post
The split marker is not on the tools menu in 2.0.0 but on the Insert menu, which foxed me for a bit! OK that works and many thanks. May I ask a supplementary - can I select text and then comment it out? There appears to be no toolbar button to do this in 2.0.0
My bad. I slipped menus.

You can just paste that string into the Replace.
You are not limited to that original pattern. Any Search can me used. Just be careful when using Replace All. I sometime use Replace-Next and skip (click find) if needed.
theducks is offline   Reply With Quote
Old 10-18-2024, 06:10 AM   #8
perkin5
Member
perkin5 began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Sep 2014
Device: Kindle
Many thanks for the excellent advice!
perkin5 is offline   Reply With Quote
Old 10-29-2024, 02:51 AM   #9
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by perkin5 View Post
In the past, when I have loaded an epub into Sigil, all the chapters or sections have been automatically split into separate files. I have just loaded an epub generated in Indesign and the whole book is in one file despite the fact that Kindle Previewer shows separate pages. I can see instances of:
Code:
<div id="page2" role="doc-pagebreak" aria-label="2" epub:type="pagebreak" />
but they have not split the file. I
"type="pagebreak" " doesn't produce a pagebreak. These indicate the pagebreaks in the print book, and maybe used by e.g. indexes as anchors. But you (usually) don't want to put breaks in the ebook there, as they are often in the middle of a sentence.

The displayed pagebreaks will be set in the CSS of a tag, probably the headings. Look in the stylesheet and you will find something like:

h2 {page-break-before: always;
....


You can use those to split the file into more manageable chunks. If not too many, just manually search for <h2 and split, or do S&R to replace

<h2 (or whatever the heading was)
with
<hr class="sigil_split_marker" /><h2

then "Edit/Split at markers"
Then remove the "pagebreak" from the CSS as redundant.
And also check if any blank pages were created by the split. Just delete those.

You will need to check if the TOC is correct (it may be if it linked to anchors), or regenerate it if not.

Last edited by AlanHK; 10-29-2024 at 02:53 AM.
AlanHK is offline   Reply With Quote
Old 11-01-2024, 06:30 AM   #10
perkin5
Member
perkin5 began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Sep 2014
Device: Kindle
Thanks AlanHK

Good advice, gratefully received!
perkin5 is offline   Reply With Quote
Reply

Tags
epub 3.0, indesign cc, sigil


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding multiple pages to a Sigil document Arran Sigil 9 09-04-2015 06:02 AM
Does having two different fonts in original document screw up Sigil/ebook? Gregg Bell Sigil 5 07-29-2015 01:48 AM
cleaning up a word document in Sigil BeccaPrice Sigil 9 10-08-2011 04:06 PM
Stop Automatic Code cleaning in Sigil ericp20 Sigil 11 05-27-2011 09:52 AM
Automatic cleaning by Sigil roger64 Sigil 7 03-18-2011 03:52 AM


All times are GMT -4. The time now is 06:58 AM.


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