Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 02-10-2014, 05:23 PM   #1
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Splitting a book

I've recently bought a book which contains a single source file, 1.6MB in size. Is there any facility in the editor to automatically split it (eg by chapters) into more manageable pieces?

Thanks!
HarryT is offline   Reply With Quote
Old 02-10-2014, 05:29 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,942
Karma: 60358908
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 HarryT View Post
I've recently bought a book which contains a single source file, 1.6MB in size. Is there any facility in the editor to automatically split it (eg by chapters) into more manageable pieces?

Thanks!
Tweak (AKA the editor)
In the Preview pane (one of the few places it is used for other than viewing): click the folded paper icon, then drag the green line to the split spot: Click

There is a Bulk split, but I have not learned to use that (I am still stuck on Sigil-think where I just use the REGEX to insert a Sigil_Split marker. the execute the Split with a <F6>)
theducks is offline   Reply With Quote
Old 02-10-2014, 06:25 PM   #3
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
The Editor uses Xpath (right-click in code view) in the same way as on the convert Look&Feel page. If the existing code doesn't easily lend itself to the Xpath approach, I guess you could also use a kind-of-Sigil-split-marker-type approach by using regex to insert some <h2></h2> or <h3></h3> dummy headers (if they don't already exist), then remove them after the split.
jackie_w is offline   Reply With Quote
Old 02-10-2014, 06:48 PM   #4
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
Assuming there is some sort of specific headline style at the beginning of each chapter which doesn't appear later on in the chapter -- and this is often the case -- then in the css stylesheet under that style you could add:

page-break-before: always;


Then do a Calibre conversion and make sure under "EPUB Output" that "Do not split on page breaks" is unchecked.

--Pat
PatNY is offline   Reply With Quote
Old 02-10-2014, 06:52 PM   #5
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,942
Karma: 60358908
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 PatNY View Post
Assuming there is some sort of specific headline style at the beginning of each chapter which doesn't appear later on in the chapter, then in the css stylesheet under that style you could add:

page-break-before: always;


Then do a Calibre conversion and make sure under "EPUB Output" that "Do not split on page breaks" is unchecked.

--Pat
That only appears to split the file: (start a new chapter at the top of a screen)
260K max is the MRSDK rule if you want a reliable book on older devices.
theducks is offline   Reply With Quote
Old 02-10-2014, 07:24 PM   #6
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
Quote:
Originally Posted by theducks View Post
That only appears to split the file: (start a new chapter at the top of a screen)
260K max is the MRSDK rule if you want a reliable book on older devices.
ducks, Calibre will actually split the file whenever that line appears in the stylesheet, as long as you uncheck "Do not split on page breaks" in the "EPUB Output" tab.

This should work to produce a single file for each chapter, so long as the style element you give that line to doesn't appear multiple times within the chapter. Then you would have too many separate files.

--Pat
PatNY is offline   Reply With Quote
Old 02-10-2014, 07:31 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,942
Karma: 60358908
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 PatNY View Post
ducks, Calibre will actually split the file whenever that line appears in the stylesheet, as long as you uncheck "Do not split on page breaks" in the "EPUB Output" tab.

This should work to produce a single file for each chapter, so long as the style element you give that line to doesn't appear multiple times within the chapter. Then you would have too many separate files.

--Pat
Wow!
I thought that was just a CSS attribute
theducks is offline   Reply With Quote
Old 02-10-2014, 09:08 PM   #8
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
Originally Posted by jackie_w View Post
The Editor uses Xpath (right-click in code view) in the same way as on the convert Look&Feel page. If the existing code doesn't easily lend itself to the Xpath approach, I guess you could also use a kind-of-Sigil-split-marker-type approach by using regex to insert some <h2></h2> or <h3></h3> dummy headers (if they don't already exist), then remove them after the split.
I recently had a mess of a book, multiple chapters in a single file, some chapters spread between 2 or 3 separate files.

Some one really had to work hard to mess it up that bad.

Merged all into single file, and then split on the <h1> into separate files. Multi-file rename to 'chap_001, etc.' and done.

VERY simple, mostly because at least most of the chapters were started with <h1> tags.
phossler is offline   Reply With Quote
Old 02-10-2014, 09:13 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
See last paragraph of http://manual.calibre-ebook.com/edit...ing-html-files
kovidgoyal is offline   Reply With Quote
Old 02-11-2014, 02:16 AM   #10
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Thanks for all the helpful advice. Much appreciated!
HarryT is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with splitting tags Illyrie Library Management 3 11-11-2012 06:12 PM
Splitting Library Giuseppe Chillem Calibre 0 11-02-2010 02:00 PM
Book formats splitting up Stingo Calibre 3 08-11-2010 11:42 PM
Splitting an ebook in 2 Spectralist Workshop 5 06-07-2009 08:01 AM
Splitting a Book into 2 Volumes? TedPark Workshop 14 06-13-2008 12:11 PM


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


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