06-12-2020, 01:48 PM | #1 |
Guru
Posts: 833
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
|
How do I add a chapter into some ebooks?
I'd like to insert a chapter of my own to some ebooks (ePub format for the most part) in my library.
What is the easiest (newbie-friendly) way to do so? I run Linux and have Calibre and Sigil. For some, the text will be from a MS Word 2016 docx. For others, the text is from some webpages. For others, just plain text. UPDATE: I don't mind if this newly inserted chapter has formatting that is vastly different from the original book's formatting. For example, different font size or font typeface. What matters the most is the content. Last edited by droopy; 06-13-2020 at 01:37 PM. |
06-12-2020, 04:09 PM | #2 |
Addict
Posts: 387
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
A pretty simple way I use is this: Load whatever text you want as your chapter into LO Writer. (I assume Writer since you're on Linux.) Style it so it is similar to your existing epub book. I say similar, because it will never be exact...you just want styles where you need them, like an h1 or h2 for the title, some sort of p for the paragraphs, maybe a no-indent, quotation, verse, center, whatever styles you need. Your goal here is to just get some unique style everywhere you need it.
[If you are starting with some horribly formatted old Word or web text, Ctrl-m (remove all ad-hoc formatting) is your friend in Writer.] Save it as either .odt or .docx. Add it to Calibre as a new book. Convert to epub. Don't worry about metadata or anything, just open it in the editor. Your new chapter text should be in a nice html file. (More than one if it is very, very long...unlikely.). Rename it to match the book you're adding to, say "mynewchapter.xhtml". Export it. Close the editor. Now open your target book in the editor. Import the file you just exported. Drag it to the location in the file stack where you want it.[*] Then open the new file, and change the class coding to match the rest of the book. Unless it is a very complicated work, you should only have a few changes to make, mostly using search and replace. For example, you might have to search the new file for <p class="p-p3> (some paragraph type) and replace it with <p class="indent"> (how that paragraph type is coded in the rest of the target book). When you are done, the styling will be identical to the rest of the book...that's why you only needed to be approximate in the Writer styling. If you have some unique style in your new chapter that does not exist in the target book, add it to the css. You can copy that from the temporary "book" you made. When you're happy with it, delete the temporary "book" you converted. It should work equally well in Calibre or Sigil--maybe just minor working details. Word can do the job as well as Writer, too, if you have it. Edit:[*] a step I missed here: link the stylesheet to the new file (right-click on the file in the file browser, link is down at the bottom). Last edited by retiredbiker; 06-12-2020 at 05:27 PM. |
Advert | |
|
06-12-2020, 05:23 PM | #3 |
Guru
Posts: 833
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
|
Yes, I have LO writer. I don't have Word. For this first text, I saved it as ODT and then added it to Calibre, then had Calibre convert to ePub. I then pressed "T" to edit this "chapter". I see that Calibre created index_split_000 to 005. What do we do now? It's not all in one html. Lol.
Also what do you mean "Rename it to match the book you're adding to."? In this case, the target book's title is "Just Mercy". |
06-12-2020, 09:54 PM | #4 | |
Addict
Posts: 387
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
Quote:
I suggested the renaming just to give the file a nice identity. I find it hard to keep track of dozens of "index-something-something" files if I have to move them around. The actual name isn't important, just make it something you can easily keep track of. Last edited by retiredbiker; 06-12-2020 at 10:03 PM. |
|
06-13-2020, 10:46 AM | #5 |
Addict
Posts: 387
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
That makes it very easy! Just do the chapter in Writer; style it as little or as much as needed, then convert it. In the editor, merge any files as necessary to get your chapter. Export both the chapter file and the css file. Import them both into the target book. (The only thing to watch is to make sure the two css files have different names.)
|
Advert | |
|
06-13-2020, 12:51 PM | #6 |
the rook, bossing Never.
Posts: 11,150
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Editing and saving is best done in ODT. But Calibre import and conversion works best with docx. So I save an extra copy in docx format from Writer for Calibre, unless odt import has been improved/fixed. Don't read-in a docx in Writer, only re-open the odt version as opening a docx in Writer does a conversion. You don't get back exactly what you saved except with odt files.
If I'm editing an ebook in a serious way, I export/convert/save as RTF in Calibre. Then import the RTF in Writer. Fix up styles if needed, save in odt each time. Then save an extra copy as docx when you do the last odt save. Import the docx into Calibre. You can delete ALL formats of a book in Calibre leaving only the Metadata, then Shift A imports the new docx. Convert to epub2 first (Tablet page format to leave images unchanged) and then any other formats from the epub2. Depending on your Calibre viewing settings it may add bookmarks IN the ebook. You can change the settings or export a copy to disk before opening the viewer. Doing this results in ebooks that look the same in epub (but not kepub) or azw/kf8 as the original view in Writer. I also use something like a 5.5" x 8" page size with all margins about 1/4" in Writer to get a better idea of how headings and heading spacings will work. You may also need sometimes to embed a font(s), or install whatever font(s) the original ebook used. Note that for KF8/azw, if you embed any font you need to embed them all. I also check what ebooks look like on old mobi, apps like Lithium etc, and even on different ereaders if I trying out new styles. Only do italic and bold inline, besides, these are usually words, not paragraph styles. Paragraph styles work best. The title has body text level. Main chapters are Level 1, which becomes h1 in the CSS. Avoid more than Level1 & level2. All other paragraph styles are then body level. Don't specify a page style for page break before, and only use it for heading styles. All pages should be the same style and have no headers, footers or page numbers. |
06-13-2020, 01:34 PM | #7 |
Guru
Posts: 833
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
|
I will have access to a computer next week and I hope to try this out
Last edited by droopy; 06-13-2020 at 01:39 PM. |
06-13-2020, 02:14 PM | #8 |
Grand Sorcerer
Posts: 12,165
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Could you not use the Epub merge plugin to merge the original book with your additional chapter?
|
06-13-2020, 03:42 PM | #9 |
Well trained by Cats
Posts: 29,794
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
06-13-2020, 04:08 PM | #10 |
Resident Curmudgeon
Posts: 73,952
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Some of the suggestions here are MUCH more difficult then they need to be. There is a fairly simple solution.
You can then edit this chapter as needed. One thing you can do is save as HTML from the word processor and copy just the lines from that chapter and paste then into the mostly empty file in the ePub. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to add a page break before each chapter | barryem | Editor | 13 | 10-03-2016 10:11 PM |
I need to add a chapter to a book on Calibre | Wanttobeanauthor | Calibre | 4 | 01-30-2015 07:41 PM |
Possible to add time left in chapter? | hag77 | Library Management | 12 | 07-17-2014 08:48 AM |
Can't add chapter markers to MOBI file | gers1978 | Conversion | 7 | 06-26-2012 08:27 AM |
Add to chapter marks to mobi file? | neonbible | Amazon Kindle | 7 | 04-12-2011 03:04 PM |