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 03-12-2018, 11:39 AM   #1
futurecycle
Junior Member
futurecycle began at the beginning.
 
futurecycle's Avatar
 
Posts: 3
Karma: 10
Join Date: Mar 2018
Device: Kindle
Exporting actual style names to HTMLZ even possible?

Poetry for the Kindle is very tricky, and the only way to handle it well is to style everything. We convert all our for-print books (in ODT format) to HTMLZ via Calibre's DEBUG, then from there revise the structure index.html prior to uploading to KDP. Everything we do is style-based, for example (in Libre Office):

h1 style = Poem Title

NewStanza style = Start new stanza with extra space above the line, hanging indentation if the line runs over, and keep with next text flow control

NewLine style = Regular lines with no extra spacing, hanging indentation if the line runs over

All of these styles (and more) are in our stylesheet that we include with our Kindle editions. Because poetry for the Kindle requires control-freakness, we do NOT want to export to Kindle format from Calibre.

We've tried to put our CSS style coding into Calibre, hoping that DEBUG would read the style names appropriately. But what we wind up with always is weird style naming that has to be globally search/replaced. Even using RegExes and BBEdit to revise more than one file at a time, we still spend too much time.

Is it even possible on EXPORT to wind up with code that looks, e.g., like this:

<p class="NewLine">A line of the poem</p>

instead of this:

<p class="P-P1">A line of the poem</p>?

What am I missing? I've tried both, e.g., p.NewLine and (in desperation) NewLine in the Calibre Styling CSS, but it doesn't transfer to the exported file. I still have to spend hours revising these files.

My suspicion is that it's not even possible, which is what I'm asking. If it IS possible, can somebody point me in the right direction?
futurecycle is offline   Reply With Quote
Old 03-12-2018, 11:52 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,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, it isn't. Conversion always flattens CSS. I'm not sure why you are using the workflow you describe. A better one would be to save as docx in libreoffice, then use the calibre editor to import the DOCX which will generate an EPUB that you can edit to your hearts content (the style names will be better than with a conversion, but still not identical to the input document). After perfecting the EPUB, upload that to KDP
kovidgoyal is online now   Reply With Quote
Advert
Old 03-12-2018, 12:11 PM   #3
futurecycle
Junior Member
futurecycle began at the beginning.
 
futurecycle's Avatar
 
Posts: 3
Karma: 10
Join Date: Mar 2018
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
No, it isn't. Conversion always flattens CSS. I'm not sure why you are using the workflow you describe. A better one would be to save as docx in libreoffice, then use the calibre editor to import the DOCX which will generate an EPUB that you can edit to your hearts content (the style names will be better than with a conversion, but still not identical to the input document). After perfecting the EPUB, upload that to KDP
Ah, well at least I now know why my head-bangings have not been fruitful! Thank you so much for answering so quickly. I have been crazy....

We started working directly in HTML years ago, so that's the approach we've always taken. I will try what you suggest and see if it's not an improvement. But I so distrust Microsoft Word after trying to work with it for decades that the first thing I do with a DOC or DOCX file is to get it into something else!

Thank you so much for your guidance. Any chance you might add the ODT format to the Import options?

Now I'm off to another learning curve...great program!
futurecycle is offline   Reply With Quote
Old 03-12-2018, 06:20 PM   #4
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,611
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@futurecycle - you might alaso want to have a look at the Mammoth DOCX converter, it provides user defined mapping of the styles embedded in a DOCX document into CSS. There's a DOCX Input plugin for the Sigil Editor that uses the Mammoth converter to create an EPUB directly.

BR
BetterRed is offline   Reply With Quote
Old 03-12-2018, 06:32 PM   #5
futurecycle
Junior Member
futurecycle began at the beginning.
 
futurecycle's Avatar
 
Posts: 3
Karma: 10
Join Date: Mar 2018
Device: Kindle
Quote:
Originally Posted by BetterRed View Post
@futurecycle - you might alaso want to have a look at the Mammoth DOCX converter, it provides user defined mapping of the styles embedded in a DOCX document into CSS. There's a DOCX Input plugin for the Sigil Editor that uses the Mammoth converter to create an EPUB directly.

BR
Thank you! I will check this out now.
futurecycle is offline   Reply With Quote
Advert
Reply

Tags
export css, styling


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
automatic changing christian names and family names sjefclaassen Calibre 3 09-29-2017 06:59 AM
Style Sheet entry for a 'hanging' style AThirstyMind Kindle Formats 6 12-10-2016 12:28 AM
Custom style names in CSS flipsake Conversion 0 11-30-2013 09:09 AM
Paragraph Style Not Exporting / ePub soulartist Workshop 5 12-11-2010 12:02 AM
Mobi TOC style vs ePub style? phearlez Kindle Formats 3 04-11-2010 06:35 AM


All times are GMT -4. The time now is 03:11 AM.


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