Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-27-2012, 10:05 AM   #1
rrt
Member
rrt began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2012
Device: none
Converting to EPUB without making a TOC

I would like to make short documents into EPUB files. They do not need a TOC: I am thinking about individual short stories, poems &c.

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?
rrt is offline   Reply With Quote
Old 11-27-2012, 10:20 AM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,143
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
From http://manual.calibre-ebook.com/cli/...le-of-contents maybe
Quote:
--no-chapters-in-toc¶
Don’t add auto-detected chapters to the Table of Contents.
PeterT is offline   Reply With Quote
Advert
Old 11-27-2012, 10:51 AM   #3
rrt
Member
rrt began at the beginning.
 
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.
rrt is offline   Reply With Quote
Old 11-28-2012, 12:21 AM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,845
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
An ePub has to have an NCX file even if it is empty.
JSWolf is offline   Reply With Quote
Old 11-28-2012, 03:51 AM   #5
rrt
Member
rrt began at the beginning.
 
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"
rrt is offline   Reply With Quote
Advert
Old 11-29-2012, 03:00 AM   #6
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
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.
Agama is offline   Reply With Quote
Old 11-29-2012, 07:10 AM   #7
rrt
Member
rrt began at the beginning.
 
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.)
rrt is offline   Reply With Quote
Old 11-29-2012, 08:01 AM   #8
Gunnerp245
Gadget Freak
Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.
 
Gunnerp245's Avatar
 
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
Deleted incorrect advice...

Last edited by Gunnerp245; 11-29-2012 at 08:31 PM.
Gunnerp245 is offline   Reply With Quote
Old 11-29-2012, 08:03 AM   #9
rrt
Member
rrt began at the beginning.
 
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?
rrt is offline   Reply With Quote
Old 11-29-2012, 08:08 AM   #10
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
[redundant posting: someone else took up the thread]

Last edited by Agama; 11-29-2012 at 08:10 AM.
Agama is offline   Reply With Quote
Old 11-29-2012, 08:11 AM   #11
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: 43,826
Karma: 22666666
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
kovidgoyal is offline   Reply With Quote
Old 11-29-2012, 08:23 AM   #12
rrt
Member
rrt began at the beginning.
 
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.)
rrt is offline   Reply With Quote
Old 11-29-2012, 08:36 AM   #13
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: 43,826
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Old 11-29-2012, 08:40 AM   #14
rrt
Member
rrt began at the beginning.
 
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.
rrt is offline   Reply With Quote
Old 11-29-2012, 08:47 AM   #15
rrt
Member
rrt began at the beginning.
 
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.)
rrt is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 03:50 PM.


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