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 06-19-2018, 02:42 PM   #1
Gary Friedman
Member
Gary Friedman began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Oct 2014
Device: none
.docx --> epub - Heading styles not translating to <h1> <h2>

Help! I'm converting a docx file to epub. Usually I specify

• Level 1 ToC (Xpath expression): //h:h1
• Level 2 ToC (Xpath expression): //h:div[@id]

and it works great. Suddenly it's not doing that - <h1> and <h2> are no longer marking chapter headings and subheadings. Lulu requires all chapters and subheadings to be in <h2> <h3> format. Did anything change recently?

Source file: http://friedmanarchives.com/~downloa..._for_epub.docx

Output file: http://friedmanarchives.com/~downloa...III_v1.05.epub

Thanks! GF
Gary Friedman is offline   Reply With Quote
Old 06-19-2018, 09:31 PM   #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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You dont need to use structure detection, calibre will automatically create a ToC based on the ToC in the docx file. As for the headings, it's likely because they are formatted using tables in the docx file. Format them as normal paragrpahs and it should work.
kovidgoyal is offline   Reply With Quote
Old 06-20-2018, 01:30 AM   #3
Gary Friedman
Member
Gary Friedman began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Oct 2014
Device: none
Thanks, Kovid. But as you'll note in the source file the headings are not inside tables. So I'm not sure what I should do next (other than "no need to use structure detection" next time. :-) ).

As mentioned earlier, I've done six other similarly-formatted books this way, all successfully. GF
Gary Friedman is offline   Reply With Quote
Old 06-20-2018, 01:43 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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sorry, typo, I meant to say list, not table. The headings are formatted as lists.
kovidgoyal is offline   Reply With Quote
Old 06-20-2018, 02:44 AM   #5
Gary Friedman
Member
Gary Friedman began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Oct 2014
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Sorry, typo, I meant to say list, not table. The headings are formatted as lists.
True, they are numbered lists. They are section numbers which are referred to throughout. All previous ebooks were done this way. Why does this suddenly not work now? GF
Gary Friedman is offline   Reply With Quote
Old 06-20-2018, 03:44 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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because the list you are using in this book uses index formatting that cannot be represented except as a table in HTML, which means your headings cannot be represented using <h> tags
kovidgoyal is offline   Reply With Quote
Old 06-20-2018, 07:27 PM   #7
Gary Friedman
Member
Gary Friedman began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Oct 2014
Device: none
I found the problem. Normally I go into VBA immediate mode and type

ActiveDocument.Range.ListFormat.ConvertNumbersToTe xt

which converts the numbered list with just numbers. For some reason it didn't take. Just did it again and all is well.

Thank you for taking the time to respond! GF
Gary Friedman is offline   Reply With Quote
Reply

Tags
conversion .docx .epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using heading styles for title page Notjohn Sigil 7 07-25-2014 10:46 AM
Docx to mobi (Extra space over the heading/title) zonoiko Conversion 0 12-04-2013 08:04 PM
Modifying H1-H6 Heading Styles townsend Sigil 13 05-05-2013 05:17 PM
Converting txt to epub, chapter heading contains number NMinker Conversion 2 11-01-2011 11:30 AM
Keyboard shortcuts for heading styles? Tryphan Sigil 4 09-26-2011 06:54 AM


All times are GMT -4. The time now is 07:20 PM.


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