Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-12-2010, 04:17 AM   #1
Ticallion
Connoisseur
Ticallion began at the beginning.
 
Posts: 61
Karma: 12
Join Date: Jan 2010
Device: Kindle PW
Best way to go about this?

I have around 85 customized LRF ebooks I made through BookDesigner, with TOCs and such I'd like kept intact. I noticed that doing a straight LRF to EPUB through Calibre always produced problems, like chapter links going to wrong pages and such (any way to fix this?). The only way I've been able to keep the links working perfectly was to do LRF to MOBI to EPUB. Problem with that is paragraph spacing - either you get spaces between all or none at all when you convert from LRF.

I also have the books in HTML which were output with Bookdesigner, so they could be used as a source too. But the problem with that is I seem to have to run them through Word to set all the chapter headers to a style so Calibre recognizes page breaks. Then to make that worse, the chapter links can't jump back to the TOC like the LRFs do, unless I were to manually create hyperlinks which is incredibly tedious.

So I'm wondering what the best option would be to get all of these custom made books into EPUB while keeping the original formatting and chapter links working properly? I'm doing so because sooner or later I'll be getting a new reader, and LRF will be useless then. What would be really nice would be if BookDesigner simply had an EPUB output. I find Sigil a bit of a pain to use having to always mess around with stylesheet codes and all.
Ticallion is offline   Reply With Quote
Old 08-12-2010, 05:27 AM   #2
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
The back-links for the chapters are probably being messed-up by Word (MS Word is probably the worst choice when it comes to editing html). Post an example of the actual html code used for the chapter headers and it should be possible to work out the right XPath expression you need for Calibre to recognise them without any other processing.
charleski is offline   Reply With Quote
Advert
Old 08-12-2010, 05:46 AM   #3
Ticallion
Connoisseur
Ticallion began at the beginning.
 
Posts: 61
Karma: 12
Join Date: Jan 2010
Device: Kindle PW
Even when when the HTML files are opened in a browser though, they seem to not have working back-links. Maybe when BookDesigner does the output, back-links aren't saved for HTML files. I really don't know much about the coding side of things, so you'll have to excuse my ignorance on all of this.

This is how a header appears in Sigil in code view, for a book that has chapters simply titled as "Part 1, Part 2, etc.". Hope this is what you meant:

<p class="MsoNormal sgc-4"><a class="sgc-13" id="BdToc_1"><span class="sgc-5" id="title">Part 1</span></a></p>
Ticallion is offline   Reply With Quote
Old 08-12-2010, 06:45 AM   #4
Ticallion
Connoisseur
Ticallion began at the beginning.
 
Posts: 61
Karma: 12
Join Date: Jan 2010
Device: Kindle PW
Okay, just messed around with xpath for a while. If I set attribute to "id" and value to "title" then Calibre creates the proper page breaks for each chapter. Problem is there's still no back-linking so I'm guessing BookDesigner simply does not output them when saving to HTML.

I also noticed that the only way to make the TOC show up on a new page, instead of being displayed on the same page as I have the book title and author, is to go into Word and create a section break before it.

EDIT: Ah, no wonder. The reason why back-links aren't being saved is because I always used BookDesigners "insert TOC" option, which works fine for LRFs. I think the only way for back-links to be saved for other formats is to manually create "Notes and Links", which would be essentially the same as doing hyperlinks in Word. Not fun since I have some books with well over 100 chapters. Ugh, what a pain this is. Why can't other formats be as easy to create as LRFs?

Last edited by Ticallion; 08-12-2010 at 06:57 AM.
Ticallion is offline   Reply With Quote
Old 08-12-2010, 07:04 AM   #5
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Well, there's certainly no back-link in the code you posted, though it looks as if it's been through MSWord at some point. The way to add them would be to open the html in a plain text editor like Notepad++ and change
<a class="sgc-13" id="BdToc_1">
to
<a class="sgc-13" id="BdToc_1" href="[location of the ToC]">

Sorry, can't think of a way of doing it without knowing some basic html+css.
charleski is offline   Reply With Quote
Advert
Old 08-12-2010, 07:45 AM   #6
Ticallion
Connoisseur
Ticallion began at the beginning.
 
Posts: 61
Karma: 12
Join Date: Jan 2010
Device: Kindle PW
It's okay, thanks for the help.

I guess I'm stuck either with having poorly spaced EPUBs or going through the HTML files and making hyperlinks. Doing notes and links in BookDesigner is actually slower I believe. I just wish Calibre would simply convert LRF to EPUB properly.

EDIT: I've figured out why the Calibre conversions are messing up the links, finally after all this time. I opened a converted EPUB in Sigil to check the code and noticed something weird. Calibre is adding an extra number to each link for some reason which was making them jump all over. Here is an example.

<a class="calibre5" href="../Text/53.xhtml#74">Part 1</a>

Notice the "#74" after xhtml? That shouldn't be there. Simply removing that and leaving just "53.xhtml" makes the link function correctly once it's saved as EPUB. Probably should report this to the Calibre creator, might be interested.

Last edited by Ticallion; 08-12-2010 at 08:02 AM.
Ticallion is offline   Reply With Quote
Reply


Forum Jump


All times are GMT -4. The time now is 04:06 PM.


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