View Single Post
Old 01-26-2017, 03:02 AM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,825
Karma: 30277270
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Gary Friedman View Post
I am using Calibre to convert a .docx file with a complex layout (lots of figures, tables, etc.) into .epub and .mobi.
Somehow I glossed over that bit when I first read your post. It was Tex2002ans' post that gave me the hint.

Sigil has an Import DOCX plugin that you may want to consider using in the future. The plugin is a wrapper for the Mammoth DOCX to HTML converter.

It's not a silver bullet, to use it effectively you have to 'code' the mapping between your Word Template Styles and CSS styles. This will require considerable effort for complex templates (i.e. quite a few hours over a few days), but assuming you use a common template for your books the mapping is reusable.

Mammoth only works effectively if you do not use Word as if it were a typewriter. It is most effective if you do do all your formatting with styles from an attached template, rather than ad-hoc in-line styling. The same is true of calibre's DOCX conversion facility. Mammoth goes the extra step of providing the bookmaker with the wherewithal of crafting a mapping betwixt Word Template Styles and W3C CSS Styles.

Added: I convert between relatively straightforward 10-20 public domain DOCX's a day via calibre. Most of the DOCX's adhere to the above guidelines, so I don't get gadzillions of .calibre and .block styles in the epub's CSS. The only thing I've found 'better' than calibre, from an XHTML coding purist's perspective, is to reduce the documents to plain text or very simple markdown and redo the formatting in an epub editor manually. That requires more effort, and the end product would not be substantially different code wise, and no different from the readers perspective. These documents are rarely above 50 A4/letter pages

For really complex documents like yours I don't bother converting to EPUB, they're almost always PDF's which introduces a new set of problems. All the people who consume my 'stuff' have decent tablets, so PDF's are not such a big deal. And guess what, a good proportion of them print the documents, scribble their 'action items' in the margins, which then they give to their lackeys to deal with.

I sometimes rename the .calibre and .block CCS styles to the original Word style names - not for any particular reason, merely to give me a mindless task while my mind is elsewhere -- like listening to someone droning on about the former president-elect.

BR

Last edited by BetterRed; 01-26-2017 at 06:36 AM.
BetterRed is online now   Reply With Quote