|
|
#1 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
Converting to EPUB without making a TOC
I can find lots of hints on how to generate a TOC, but I can't find out how NOT to generate one! I'm starting from LaTeX, and going via LaTeXML quite successfully: latexml --dest="$book.xml" "$book.tex" latexmlpost --nodefaultcss --dest="$book.html" "$book.xml" ebook-convert "$book.html" "$book.epub" --language en --no-default-epub-cover "$@" Is there some way to make ebook-convert not make a TOC? |
|
|
|
|
|
#2 | |
|
Taking a break; Fed up
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,438
Karma: 32635230
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
|
From http://manual.calibre-ebook.com/cli/...le-of-contents maybe
Quote:
__________________
Peter |
|
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
Thanks; I should have mentioned I already tried that. With --no-chapters-in-toc, an empty TOC is still generated.
|
|
|
|
|
|
#4 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 34,660
Karma: 14439052
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
|
An ePub has to have an NCX file even if it is empty.
__________________
|
|
|
|
|
|
#5 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
Sorry, I was imprecise. When I said that Calibre generates an empty TOC, I meant that it generates a TOC with just one entry, for the entire document. Here's a shell script to remove the offending TOC entry; however, it's a horrible hack, and what I'm really after is a way to avoid generating it in the first place:
#!/bin/sh # remove-epub-toc # Remove the TOC from an EPUB # (Designed to work with Calibre-generated EPUBs with a single section; see FIXMEs for generalization) # Reuben Thomas 27th November 2012 # Shell function from atool(1) aunpack () { TMP=`mktemp /tmp/aunpack.XXXXXXXXXX` atool -x --save-outdir=$TMP "$@" DIR="`cat $TMP`" [ "$DIR" != "" -a -d "$DIR" ] && cd "$DIR" rm $TMP } book=$1 shift # FIXME: edit the XML properly rather than grepping # FIXME: ensure identifiers are correct, computed if necessarily aunpack -F zip "$book" rm *_split_000.html sed -i -e 's/split_000/split_001/' toc.ncx grep -v html2 content.opf > content.opf.new mv content.opf.new content.opf apack -F zip "$book" . mv "$book" .. cd .. rm -rf "$DIR" |
|
|
|
|
|
#6 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 555
Karma: 422221
Join Date: Jul 2010
Location: UK
Device: Sony PRS-300 & Kindle PW
|
I think that perhaps the toc.ncx is a mandatory item in an ePub, and therefore calibre generates a default when you do not create one.
I checked a small ePub with the IDPF validator, (http://validator.idpf.org/), after removing the toc.ncx file and its reference in content.opf: it failed validation with a message that indicated the ncx was missing. Putting the toc back caused it to pass validation, comfirming that this file is required. |
|
|
|
|
|
#7 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
As you can see from my script (above), I do not remove toc.ncx. I simply want an empty TOC so that when I open the book in a reader I am taken straight to the title page. Calibre generates a TOC with a single entry, which is the title of the work, and it's ugly and pointless. (For similar reasons, my very short ebooks don't have a title page either.)
|
|
|
|
|
|
#8 |
|
Gadget Freak
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,035
Karma: 1025474
Join Date: Nov 2007
Location: US
Device: Sony 700; Entourage Edge, Kindle 3, Pocket Edge
|
Deleted incorrect advice...
__________________
User of both the 10" EE & 7" PE. Visit edge/pocket edge forum. calibre User Manual. Last edited by Gunnerp245; 11-29-2012 at 08:31 PM. |
|
|
|
|
|
#9 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
I'm sorry, I don't understand what you mean by a "parameter" in "look and feel", or what "\" means. I re-read the "Look and feel" section of http://manual.calibre-ebook.com/conversion.html and that didn't help. Could you please elaborate?
|
|
|
|
|
|
#10 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 555
Karma: 422221
Join Date: Jul 2010
Location: UK
Device: Sony PRS-300 & Kindle PW
|
[redundant posting: someone else took up the thread]
Last edited by Agama; 11-29-2012 at 08:10 AM. |
|
|
|
|
|
#11 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,660
Karma: 3473290
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
An empty NCX is not allowed by the EPUB spec. http://idpf.org/epub/20/spec/OPF_2.0...m#Section2.4.1 And http://www.daisy.org/z3986/2005/ncx-2005-1.dtd
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#12 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
I do not have an empty NCX. Here is my NCX:
<?xml version='1.0' encoding='utf-8'?> <ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en"> <head> <meta content="98160948-0367-400e-ad9b-07537e37a9ef" name="dtb:uid"/> <meta content="2" name="dtb:depth"/> <meta content="calibre (0.8.51)" name="dtb:generator"/> <meta content="0" name="dtb:totalPageCount"/> <meta content="0" name="dtb:maxPageNumber"/> </head> <docTitle> <text>Foo</text> </docTitle> <navMap> <navPoint id="deb7899f-3f43-42e1-aba4-be8924c74e48" playOrder="1"> <navLabel> <text>Start</text> </navLabel> <content src="foo_split_001.html"/> </navPoint> </navMap> </ncx> The complete ebook gives several validation errors for the actual content (apparently Calibre has some bugs), but it makes no complaint about the toc.ncx or any other part of the navigation apparatus. (To be clear: the EPUB as originally output by Calibre gives exactly the same validation errors as the EPUB I produce by editing the TOC.) |
|
|
|
|
|
#13 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,660
Karma: 3473290
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You are creating an NCX with an entry that leads nowhere. Which is a lot uglier than an entry that leads to the start of the book. And is utterly pointless.
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#14 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
I'm sorry, I don't understand. I haven't created (or removed) any entry in the NCX. I merely changed the link to "foo_split_001.html" (it previously said "foo_split_000.html"). Everything there was created by Calibre.
|
|
|
|
|
|
#15 |
|
Member
![]() Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
|
Maybe it would help if I restated my original question in a more user-oriented way:
I have some very short documents (short stories, poems) that I would like to make into EPUBs. When I try this, I open the EPUB and land on a contents page with a single entry, for the start of the poem/story. This seems redundant: if I published the poem/story on its own, it would not have a contents page. How can I tell Calibre not to generate this contents list? (Note, I am not trying to avoid having an NCX file, or in any way violate the EPUB spec, I just want to improve how the book looks to the reader.) |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ToC detected but not transferred when converting from epub to pdf | Eoannis | Conversion | 2 | 03-16-2012 04:41 AM |
| epub to epub converting: making chapters? | Joy736 | Conversion | 8 | 10-30-2011 04:47 PM |
| converting from HTM to ePUb - can't get TOC right | davidm99 | Conversion | 1 | 04-12-2011 10:47 PM |
| TOC disappears when converting from .prc to epub | baselworld | Calibre | 3 | 09-06-2010 02:10 AM |
| Converting a web page to epub with TOC | philosopherdog | Calibre | 5 | 07-23-2010 07:55 AM |