Answers.Body: <p>Assuming that new chapters/sections begin on a new page:</p>
  
  <p>For a PDF files:</p>
  
  <pre><code>pdftk in.pdf cat 1 2 5-8 output out.pdf
  </code></pre>
  
  <p>gives you page 1,2,5,6,7,8.</p>
  
  <p>For a DjVu file, for each page with number N do:</p>
  
  <pre><code>djvused in.djvu -e "select N; save-page-with part-N.pdf"
  </code></pre>
  
  <p>and then combine with:</p>
  
  <pre><code>djvm part-*.djvu out.djvu
  </code></pre>
  
  <p>assuming you have padded N with leading zeros to the widht of the largest page number, otherwise the sorting of the <code>part-N.djvu</code> files will not be same order as in the original file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T11:44:19.830Z
Answers.Text: Maybe a little more content here on where you would run this command? Are you doing this on an ereader, Windows folder, Apple...?
Answers.UserDisplayName: James Jenkins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T12:15:24.977Z
Answers.Text: @JamesJenkins Why do you think that is necessary here, and not for the other answers?
Answers.UserDisplayName: Anthon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T12:22:17.660Z
Answers.Text: What other answers are you referring to?
Answers.UserDisplayName: James Jenkins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T12:51:14.417Z
Answers.Text: If you are referring to the other answers on this question. The Sekhemty answer says do something with a specific program (Calibre) and the user743 answer says  do something with a specific program (Calibre, & with windows implied by docx). The Anthon answer gives commands for two different file types, which are not native to any OS, no software nor OS is implied. Presumably the commands supplied are not effective as written across all potential ebook modifying tools.
Answers.UserDisplayName: James Jenkins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-07T06:41:37.663Z
Answers.LastActivityDate: 2014-03-07T06:41:37.663Z
Answers.UserDisplayName: Anthon
Answers.Body: <p>Besides using a real ebook editor like <a href="https://code.google.com/p/sigil/" rel="noreferrer">Sigil</a>, there is an easier way to do it.</p>
  
  <p>Calibre has a very useful additional plugin called <a href="http://www.mobileread.com/forums/showthread.php?t=178799" rel="noreferrer">EpubSplit</a>, that with a simple interface let's you select the single <code>.html</code> files inside the <code>.epub</code> and create a new ebook just from them; after the process is also possible to edit the metadata of the newly created ebook.</p>
  
  <p>These tools only work with <code>.epub</code> files, to perform this kind of editing on other formats a conversion with Calibre should be made.</p>
  
  <p><img src="https://i.sstatic.net/yWZMw.png" alt="enter image description here"></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-06T22:55:19.103Z
Answers.Text: I think manually doing it would be the best.  The method you posted will be troublesome when Calibre splits a file, for no reason, the creator usually doesn't understand already what is going on, so in the middle of a chapter you have to sift through what chapter goes where instead of creating the title from scratch in the first place.  You should also note that just because it says `title_split_###` doesn't necessarily mean that is a chapter.
Answers.UserDisplayName: DᴀʀᴛʜVᴀᴅᴇʀ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-06T22:36:11.300Z
Answers.LastActivityDate: 2014-03-06T22:36:11.300Z
Answers.UserDisplayName: Sekhemty
Body: <p>How can I easily extract some sections from an ebook and create a new one that will contain just those parts? It would be especially useful with omnibus ebooks when I want to read just some of the included novels.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-06T22:38:14.637Z
Comments.Text: Related: http://ebooks.stackexchange.com/q/1067/136
Comments.UserDisplayName: Sekhemty
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-07T13:24:01.140Z
Comments.Text: Are you only interested in EPUB? Your text does not seem to exclude other formats. And I guessed that the tag would not restrict, because that would imply only answers that do not include sigil and calibre would be inappropriate, which seems kind of restrictive.
Comments.UserDisplayName: Anthon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-09T09:36:15.210Z
Comments.Text: Some of these tags were related to my answer, not to the question.
Comments.UserDisplayName: Sekhemty
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-09T09:47:08.227Z
Comments.Text: I think you should restrict the tags to the question itself and not to possible answers (see first line in the [help on using tags](http://ebooks.stackexchange.com/help/tagging))
Comments.UserDisplayName: Anthon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-10T00:13:44.270Z
Comments.Text: Adding tags related to answers seems to be a viable option on other network sites meta.superuser.com/questions/4088/retagging-questions-with-the-answer
Comments.UserDisplayName: Sekhemty
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-10T04:22:56.343Z
Comments.Text: I was not aware of that. I am used (on [unix.se]) to questions not having the Linux distribution the OP uses in the text, but just as a tag e.g. [Ubuntu], and that is always a limiting factor on answers. I had originally overlooked the [tag:epub]. Which is good, otherwise I would probably not have answered, thinking of it as restricting the ebook formats you were interested in.
Comments.UserDisplayName: Anthon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-11T14:35:11.517Z
Comments.Text: I have posted a [question](http://meta.ebooks.stackexchange.com/q/209/60) about using tags like [tag:epub] in a non-restrictive way. If you haven't seen it yet could you please take the time to leave a comment on your view of things, or even leave an answer?
Comments.UserDisplayName: Anthon
Tags: <epub><calibre><editing><sigil>
Title: How can I extract some chapters or sections from an ebook into a new one?
UserDisplayName: Sekhemty
ThreadText: # How can I extract some chapters or sections from an ebook into a new one?
  
  (Asked by: username_0 on 2014-03-06)
  
  How can I easily extract some sections from an ebook and create a new one that will contain just those parts? It would be especially useful with omnibus ebooks when I want to read just some of the included novels.
  
  **Tags:** epub, calibre, editing, sigil
  
  > **Comments:**
  > **username_0**: Related: http://ebooks.stackexchange.com/q/1067/136  
  > **username_1**: Are you only interested in EPUB? Your text does not seem to exclude other formats. And I guessed that the tag would not restrict, because that would imply only answers that do not include sigil and calibre would be inappropriate, which seems kind of restrictive.  
  > **username_0**: Some of these tags were related to my answer, not to the question.  
  > **username_1**: I think you should restrict the tags to the question itself and not to possible answers (see first line in the [help on using tags](http://ebooks.stackexchange.com/help/tagging))  
  > **username_0**: Adding tags related to answers seems to be a viable option on other network sites meta.superuser.com/questions/4088/retagging-questions-with-the-answer  
  > **username_1**: I was not aware of that. I am used (on [unix.se]) to questions not having the Linux distribution the OP uses in the text, but just as a tag e.g. [Ubuntu], and that is always a limiting factor on answers. I had originally overlooked the [tag:epub]. Which is good, otherwise I would probably not have answered, thinking of it as restricting the ebook formats you were interested in.  
  > **username_1**: I have posted a [question](http://meta.ebooks.stackexchange.com/q/209/60) about using tags like [tag:epub] in a non-restrictive way. If you haven't seen it yet could you please take the time to leave a comment on your view of things, or even leave an answer?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2014-03-06. Score: 11 | Accepted answer
  
  Besides using a real ebook editor like [Sigil](https://code.google.com/p/sigil/), there is an easier way to do it.
  
  Calibre has a very useful additional plugin called [EpubSplit](http://www.mobileread.com/forums/showthread.php?t=178799), that with a simple interface let's you select the single `.html` files inside the `.epub` and create a new ebook just from them; after the process is also possible to edit the metadata of the newly created ebook.
  
  These tools only work with `.epub` files, to perform this kind of editing on other formats a conversion with Calibre should be made.
  
  ![enter image description here](https://i.sstatic.net/yWZMw.png)
  
  > **Comments:**
  > **username_3**: I think manually doing it would be the best.  The method you posted will be troublesome when Calibre splits a file, for no reason, the creator usually doesn't understand already what is going on, so in the middle of a chapter you have to sift through what chapter goes where instead of creating the title from scratch in the first place.  You should also note that just because it says `title_split_###` doesn't necessarily mean that is a chapter.  
  
  ---
  
  ### Answer by username_1 on 2014-03-07. Score: 2
  
  Assuming that new chapters/sections begin on a new page:
  
  For a PDF files:
  
  ```
  pdftk in.pdf cat 1 2 5-8 output out.pdf
  
  ```
  
  gives you page 1,2,5,6,7,8.
  
  For a DjVu file, for each page with number N do:
  
  ```
  djvused in.djvu -e "select N; save-page-with part-N.pdf"
  
  ```
  
  and then combine with:
  
  ```
  djvm part-*.djvu out.djvu
  
  ```
  
  assuming you have padded N with leading zeros to the widht of the largest page number, otherwise the sorting of the `part-N.djvu` files will not be same order as in the original file.
  
  > **Comments:**
  > **username_2**: Maybe a little more content here on where you would run this command? Are you doing this on an ereader, Windows folder, Apple...?  
  > **username_1**: @username_2 Why do you think that is necessary here, and not for the other answers?  
  > **username_2**: What other answers are you referring to?  
  > **username_2**: If you are referring to the other answers on this question. The username_0 answer says do something with a specific program (Calibre) and the user743 answer says  do something with a specific program (Calibre, & with windows implied by docx). The username_1 answer gives commands for two different file types, which are not native to any OS, no software nor OS is implied. Presumably the commands supplied are not effective as written across all potential ebook modifying tools.  
  
  ---
  
  