Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-08-2024, 07:50 AM   #1
jindroush
Connoisseur
jindroush doesn't litterjindroush doesn't litter
 
Posts: 94
Karma: 104
Join Date: Nov 2014
Device: Kindle
DOCX -> EPUB NCX generation?

Hi,
how is NCX generation supposed to work?

I have defined several heading styles NOT based on Heading styles. But with correct depth settings. In docx file I see the correct levels 1-3 in Navigation pane. I have included Word TOC in text, it's correctly generated for levels 1 and 2 only.

When I convert DOCX to EPUB, everything is fine, EXCEPT for the fact that NCX is flat. Ie. it contains both levels 1 and 2, but in 'root' level only, not nested.

I've checked all the TOC settings in conversions, but I can't find anything regarding NCX and all the settings are most probably only for inclusion of HTML TOC, which I don't need. I'm pretty sure I docx->epub converted files in the past and they had multi-level NCX files.

To sum up: Everything is okay, works okay, except that NCX is flat.
jindroush is offline   Reply With Quote
Old 11-08-2024, 09:03 AM   #2
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: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Create a ToC in the word document and it will be automatically used. See the sample at https://manual.calibre-ebook.com/con...word-documents
kovidgoyal is offline   Reply With Quote
Advert
Old 11-08-2024, 09:15 AM   #3
jindroush
Connoisseur
jindroush doesn't litterjindroush doesn't litter
 
Posts: 94
Karma: 104
Join Date: Nov 2014
Device: Kindle
Sorry, I don't understand. That's what I think I did.

There is TOC in the text of the document - { TOC \o "1-2" \h \z \u }.
It's displayed correctly in the text of DOCX and in the text of calibre-converted EPUB.

But generated NCX file - ie. the TOC displayed on the side of the Calibre Viewer (or in ebook reader) is flattened. That means that Calibre has correctly found all TOC items, but works with them as with 'level 1' items (incorrectly, as they use level 1 and level 2).
jindroush is offline   Reply With Quote
Old 11-08-2024, 10:53 AM   #4
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: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://www.mobileread.com/forums/sh...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 11-08-2024, 11:15 AM   #5
jindroush
Connoisseur
jindroush doesn't litterjindroush doesn't litter
 
Posts: 94
Karma: 104
Join Date: Nov 2014
Device: Kindle
Attached is minimal example DOCX, which, when converted by Calibre 7.21.0, does create NCX with 4 items, but all on level 1. Word TOC contains two items on level 1, and two on level 2.

DOCX was created on latest Office365 version. (2410, 18129.20116)
Attached Files
File Type: docx Testing conversion - Testing author.docx (24.1 KB, 60 views)
jindroush is offline   Reply With Quote
Advert
Old 11-08-2024, 11:31 AM   #6
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: 45,146
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...31a0622ec1a7a1
kovidgoyal is offline   Reply With Quote
Old 11-08-2024, 11:42 AM   #7
jindroush
Connoisseur
jindroush doesn't litterjindroush doesn't litter
 
Posts: 94
Karma: 104
Join Date: Nov 2014
Device: Kindle
That was quite unexpected.
I tried to workaround it temporarily by changing TOC2 style 'left' to integer in centimeters, but, alas, it has to be integer in points. That is quite confusing in word.

Thanks for the fix anyway!
jindroush is offline   Reply With Quote
Old 11-09-2024, 03:46 AM   #8
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,643
Karma: 103503445
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Centimetres & Inches are ONLY for PDF and direct print. Use em, pt, % or px in ebooks according to context.
A px can mean a pixel, but it's not really.

Mostly for text 12 pt = 1 em. Occasionally some ereaders might get indents in pt wrong, so converting pt of margins to em is recommended.
Quoth is offline   Reply With Quote
Reply

Tags
docx to epub, ncx toc levels


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NCX file being ignored when converting from MOBI to EPUB sweth Conversion 1 05-08-2018 02:40 AM
Converting RTF to ePub with NCX Sablerose ePub 6 12-10-2013 09:47 PM
epub 3.0 with ncx, example please? xmlgirl ePub 2 10-12-2012 08:13 PM
OPF, NCX in Epub chadpeppers Sigil 3 01-12-2011 11:11 AM
Android Epub maker 1.0 (.doc and .docx --> .epub) devseev enTourage Archive 2 08-30-2010 12:35 PM


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


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