Quote:
Originally Posted by kovidgoyal
|
Thank you very much for this suggestion. We gave it a try, and you are quite correct that this error magically disappears when converting our doc files to docx and then to epub. However, for us this adds a number of other difficulties. If I force auto-generation of a TOC, then the reverse links from each chapter back to the TOC do not work. If I change the reverse links to the top of the document, then we need to recreate these each time new info is added to the top of the manuscript template.
Therefore we have always used the following string in a manually created TOC:
Code:
//*[((name()='h1' or name()='h2' or name()='h3' or name()='h4' or name()='h5' or name()='h6' or name()='h7') and re:test(., '\s*((chapter|book|section|volume|part)\s+)|((A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|Ą|Ć|Ę|Ł|Ń|Ó|Ś|Ź|Ż|ą|ć|ę|ł|ń|ó|ś|ź|ż)(\s+|$))', 'i')) or @class = 'chapter']
This works great when we convert from HTML to epub, but from DOCX it only detects the first three levels of headers.
Is there a way to get Calibre to detect up to 6 or 7 levels of contents when converting to docx? If we could solve this, we would stop using the html format even though it gives us greater control in managing the output through various custom bat files and powershell scripts we run.
Thanks for your time.