Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-21-2020, 05:21 AM   #1
Mivexil
Junior Member
Mivexil began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2019
Device: Kindle Oasis (2nd gen)
Lossless ePub to AZW3 conversion (or, KindleUnpack but in reverse)

I have a few AZW3 files that I have already tweaked to my liking, but I want to do some batch tweaks and split some of them. Both seem to be much easier to achieve by having the books in the ePub format, so my plan is to convert the books to ePub using KindleUnpack, apply the tweaks to exploded books and use ePubSplit to cut them up, then reconvert them back to AZW3.

KindleUnpack seems to be able to convert AZW3 to ePub while preserving the formatting, HTML structure, CSS class names, etc. - but is there a plugin that does the reverse? Or a set of Calibre conversion options that won't mess with the book?
Mivexil is offline   Reply With Quote
Old 01-21-2020, 07:52 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 55,403
Karma: 51439620
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
When is an ePub lossy?

You have two choices. You can convert to KF8 using Calibre or you can use Kindlegen. Kindlegen will create a dual-format mobi and you can use Kindlegen to split into Mobi & KF8.

Last edited by JSWolf; 01-21-2020 at 07:54 AM.
JSWolf is offline   Reply With Quote
Advert
Old 01-21-2020, 08:16 AM   #3
Mivexil
Junior Member
Mivexil began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2019
Device: Kindle Oasis (2nd gen)
Quote:
When is an ePub lossy?
When Calibre gets its hands on it "Lossy" is probably the wrong word, but I'm not sure how else to say "I want to repackage the file without changing its contents or stylesheets".

Either way, it seems like a roundtrip through KindleUnpack -> KindleGen -> KindleUnpack does exactly what I need. Thanks!
Mivexil is offline   Reply With Quote
Old 01-21-2020, 08:56 AM   #4
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 137
Karma: 215930
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
When is an ePub lossy?
When Calibre gets its hands on it
Understood—altho you are right, "lossy" may not be the best word. I have a hard time visualizing what kind of tweaks are worth such a roundabout process. However, if you want to convert AZW3 to ePub while preserving the HTML structure, and CSS class names, this path may save work:

1) In Calibre, open your corrected AZW file and save the CSS rules in a convenient location.
2) Convert your AZW file to ePub and open the ePub for edit.
3) Open stylesheet, delete every style and paste saved rules into file.
4) Apply Calibre's "remove unused style rules" tool. Save.

The last step, if done with "remove unused class attributes" checked, will clean the structure so it is the same as your original AZW3.

Last edited by Brett Merkey; 01-21-2020 at 09:01 AM.
Brett Merkey is offline   Reply With Quote
Old 01-21-2020, 10:09 AM   #5
thiago.eec
Addict
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 281
Karma: 71602
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by Brett Merkey View Post
3) Open stylesheet, delete every style and paste saved rules into file.
4) Apply Calibre's "remove unused style rules" tool. Save.
I think there is a problem there. At least some classe's names won't match, and will be removed on the process, losing part of the formatting.
thiago.eec is offline   Reply With Quote
Advert
Old 01-21-2020, 11:09 AM   #6
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 137
Karma: 215930
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
I think there is a problem there.
You will need to test for your own environment and level of coding. This tests perfectly for me, for quite some time. However, I am using an older version of Calibre. Perhaps the 4.x versions have added a new layer of "lossiness" that might complicate things for you. Test and adapt...

Quote:
At least some class names won't match
That is precisely why the "clean CSS" Calibre tool will remove all the interesting structural code added in the conversion.

Last edited by Brett Merkey; 01-21-2020 at 11:25 AM.
Brett Merkey is offline   Reply With Quote
Old 01-21-2020, 02:39 PM   #7
thiago.eec
Addict
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 281
Karma: 71602
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by Brett Merkey View Post
That is precisely why the "clean CSS" Calibre tool will remove all the interesting structural code added in the conversion.
I just did a conversion here, from EPUB to AZW3.

This is the original style sheet:
Spoiler:

.tp {
margin-top: 1em;
text-align: center;
}

h1.otherbooks
{
text-align: center;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

div.otherbooks
{
margin-top: 4em;
font-size: small;
margin-left: 2em;
margin-right: 2em;
}

div.copyright
{
font-size: small;
text-align: center;
margin-top: 4em;
}

div.dedication
{
font-size: small;
margin-top: 8em;
}

div.epigraph
{
font-size: medium;
margin-left: 12em;
margin-right: 4em;
margin-bottom: 2em;
margin-top: 2em;
}

div.epigraphsource
{
font-size: x-small;
text-align: right;
font-style: italic;
margin-bottom: 12em;
margin-right: 2em;
}

h1.acknowledgments
{
font-size: medium;
margin-top: 4em;
text-align: center;
font-weight: bold;
}

div.acknowledgments
{
font-size: small;
text-align: justify;
margin-left: 2em;
margin-right: 2em;
}

h1.authorsnote
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.authorsnote
{
font-size: small;
text-align: justify;
}

h1.listoffigures
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.listoffigures
{
font-size: small;
text-align: left;
}

h1.chronology
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.geneology
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.foreword
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.preface
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.introduction
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.prologue
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.part
{
line-height: 2em;
margin-top: 4em;
margin-bottom: 1em;
font-size: large;
text-align: center;
font-weight: bold;
}

h1.chapter
{
font-size: 110%;
text-align: center;
font-weight: normal;
line-height: 1.5em;
margin-top: 4em;
margin-bottom: 6em;
}

h1.subchapter
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.epilogue
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.coda
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.conclusion
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.afterward
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.permission
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.glossary
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

span.glosaryterm
{
font-size: small;
text-align: left;
margin-right: 1em;
}

span.glosarydef
{
font-size: small;
text-align: left;
margin-right: 1em;
}

h1.appendix
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.resource
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.notes
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.note
{
font-size: x-small;
text-align: justify;
margin-left: 1em;
}

h1.source
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.bibliography
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.bibliography
{
font-size: x-small;
text-align: justify;
margin-left: 2em;
font-weight: bold;
}

h1.suggestedreading
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.abouttheauthor
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

p.smallheight
{
margin-top: 1em;
margin-bottom: 1em;
}

p.mediumheight
{
margin-top: 2em;
margin-bottom: 2em;
}

p.attribution
{
text-align: center;
}


p.largeheight
{
margin-top: 3em;
margin-bottom: 3em;
}

div.list
{
font-size: small;
margin-left: 1em;
}


h1.box
{
font-size: medium;
font-style: italic;
text-align: center;
}

div.box
{
font-size: small;
margin-left: 1em;
}

p.caption
{
font-size: x-small;
font-style: italic;
text-align: center;
margin-bottom: 1em;
}


/* ===================== Added Styles ===================== */

p.indent
{
text-indent: 1.00em;
text-align: justify;
}

p.right
{
text-align: right;
}

p.center
{
margin-top: 1em;
text-align: center;
margin-bottom: 1em;
}

a.hlink
{
text-decoration: none;
}

p.figure
{
margin-top: 2em;
text-align: center;
margin-bottom: 2em;
}

h1.subtitle
{
font-size: x-large;
text-align: center;
font-weight: bold;
margin-bottom: 4em;
}


h1.contents
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h2.title
{
font-size: medium;
text-align: center;
}

p.smallheight
{
margin-top: 1em;
}

p.mediumheight
{
margin-top: 2em;
}

p
{
margin-top: .3em;
margin-bottom: .3em;
}

div.cover
{
text-align: center;
height: 100%;
}

div.titlepage
{
text-align: center;
margin-top: 1.2em;
margin-left: -.4em;
}

a.pubhlink
{
text-decoration: none;
color: green;
}

p.extract
{
text-align: justify;
margin-top: 2em;
text-indent: 0;
}

p.extract1
{
text-align: justify;
margin-top: 2em;
text-indent: 0;
text-indent: 1.00em;
}

div.textbox
{
margin-top: 2em;
margin-bottom: 2em;
border-bottom: 2px solid;
border-top: 2px solid;
line-height: 1.7em;
text-align: center;
}

h1.caption
{
font-size: medium;
margin-bottom: 1em;
}

p.box
{
border-bottom: 1px double;
border-left: 1px double;
border-top: 1px double;
border-right: 1px double;
text-align: justify;
}

div.abstract
{
font-size: small;
text-align: justify;
margin-left: 2em;
margin-right: 2em;
}

div.appendix
{
font-size: small;
text-align: justify;
}

p.reference
{
text-align: justify;
text-indent: -1.00em;
margin-left: 1em;
}

div.biboliography
{
font-size: medium;
text-align: justify;
}

div.preface
{
font-size: small;
text-align: justify;
margin-left: 2em;
margin-right: 2em;
}

p.cop
{
margin-bottom: 1em;
}

p.nonindent
{
text-align: justify;
text-indent: 0;
}

span.small
{
font-size: x-small;
}

div.toc
{
font-size: medium;
text-align: center;
}

p.stanga
{
text-align: justify;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 2em;
}

body
{
font-size: medium;
line-height: 1.2em;
margin-top: 1em;
margin-left: 1em;
margin-right: 2em;
font-family: Charis, "Times New Roman", Verdana, Arial;
}

@font-face
{
font-family: "Charis";
font-style: normal;
font-weight: normal;
src:url(fonts/CharisSILR.ttf);
}

@font-face
{
font-family: "Charis";
font-style: normal;
font-weight: bold;
src:url(fonts/CharisSILB.ttf);
}

@font-face
{
font-family: "Charis";
font-style: italic;
font-weight: normal;
src:url(fonts/CharisSILI.ttf);
}

@font-face
{
font-family: "Charis";
font-style: italic;
font-weight: bold;
src:url(fonts/CharisSILBI.ttf);
}

h3.title
{
font-size: medium;
text-align: center;
margin-bottom: 3em;
}

span.dropcaps
{
float: left;
font-size: 50px;
line-height: 50px;
padding-top: 1px;
margin-top: -.09em;
margin-right: .09em;
}

span.dropcaps3lines
{
float: left;
font-size: 80px;
line-height: 70px;
padding-top: 1px;
margin-top: -.09em;
margin-right: .09em;
}

sup.small
{
font-size: small;
line-height: 0.0em;
}

div.footnote
{
font-size: small;
border-style: solid;
border-width: 1px 0 0 0;
margin-top: 2em;
}

p.footnote
{
text-align: justify;
margin-left: 2em;
}

p.question
{
text-align: justify;
margin-top: 1em;
}

div.small-page
{
margin-top: 2em;
font-size: medium;
margin-left: 12em;
margin-right: 6em;
}

h1.toc
{
text-align: center;
font-size: 110%;
margin-top: 3em;
margin-bottom: 2em;
font-weight: normal;
}

ol.upperalpha
{
text-align: justify;
list-style-type: upper-alpha;
}

ol.upperroman
{
text-align: justify;
list-style-type: upper-roman;
}

ol.lowerroman
{
text-align: justify;
list-style-type: lower-roman;
}

ol.loweralpha
{
text-align: justify;
list-style-type: lower-alpha;
}


ol.arabic
{
text-align: justify;
}
ul.bullet
{
list-style-type: disc;
}

ul.none
{
text-align: justify;
list-style-type: none;
}

p.hanging
{
text-indent: -1em;
font-size: medium;
margin-left: 2.5em;
margin-top: 0.5em;
}

h1.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h2.section
{
text-align: center;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h3.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h4.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h5.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

span.underline
{
text-decoration: underline;
}

span.big
{
font-size: large;
}

p.crt
{
margin-top: 1em;
text-align: center;
margin-bottom: 1em;
}

span.overline
{
text-decoration: overline;
}

p.textbox
{
text-align: justify;
margin-left: 1em;
margin-right: 1em;

}

p.textbox1
{
text-indent: 1.00em;
text-align: justify;
margin-left: 1em;
margin-right: 1em;
}

div.chapter
{
margin-top: 2em;
margin-left: 0.5em;
margin-right: 0.5em;
}

span.strike
{
text-decoration: line-through;
}

img
{
max-height: 100%;
max-width: 100%;
}


sup
{
vertical-align: 4px;
}

sup.frac, sub.frac
{
font-size: 0.7em;
}

p.pagebreak
{
page-break-before: always;
}

p.textboxextract
{
margin-top: 2em;
text-align: justify;
margin-left: 1em;
margin-right: 1em;
}

/* =============== New Style added =============== */

/* == For TOC == */

div.toc_fm
{
margin-top:1em;
margin-bottom:1em;
margin-left:1.5em;
font-size:.9em;
line-height:1em;
}

div.toc_bm
{
margin-top:1em;
margin-bottom:1em;
margin-left:1.5em;
font-size:.9em;
line-height:1em;
}

div.toc_chap
{
margin-left:1.5em;
font-size:1em;
line-height:1.4em;
}

div.toc_sub
{
margin-left:2em;
font-size:smaller;
line-height:1.4em;
}

div.toc_part
{
margin-left:1.5em;
line-height:1.5em;
font-size:1.2em;
}

.toc_part .toc_chap
{
font-size:medium;
margin-left:1.5em;
}

.toc_part .toc_chap .toc_sub
{
font-size:smaller;
margin-left:1.5em;
}


/* == For Block Quotes == */

div.block
{
margin-left: 0em;
margin-right: 0em;
text-align:justify;
margin-top: 1em;
margin-bottom: 1em;
font-size: small;
}

p.bl_nonindent
{
margin-left:2.5em;
margin-right:2.5em;
text-align:justify;
}

p.bl_indent
{
text-indent:1em;
margin-left:2.5em;
margin-right:2.5em;
text-align:justify;
}

p.bl_extract
{
margin-left:2.5em;
margin-right:2.5em;
text-align:justify;
margin-top: 2em;
}

p.bl_center
{
margin-left:2.5em;
margin-right:2.5em;
text-align: center;
}

p.bl_right
{
text-align: right;
margin-left:2.5em;
margin-right:2.5em;
}

p.bl_hanging
{
text-indent: -1em;
font-size: medium;
margin-left: 2.5em;
margin-top: 0.5em;
}


/* For Hanging Paragraphs */

div.hanging
{
margin-left: 1.0em;
}

/* For Dialogue Text */

div.dialogue
{
margin-left: 4.2em;
margin-bottom: 2em;
margin-top: 1.5em;
font-size: small;
}

p.d_hanging
{
text-indent: -4.2em;
font-size: small;
margin-top: 0.5em;
}

/* For bullet list */

ul.bullet
{
list-style-type: disc;
margin-top: 1em;
margin-bottom: 1em;
}
div.bullet
{
margin-left: .8em;
margin-top: 0;
margin-bottom: 0;
text-align: justify;
}

/* For Fractions */
.frac_num
{font-size:x-small; vertical-align:text-top;}
.frac_den
{font-size:x-small; vertical-align:text-bottom;}

div.floatleft
{
float: left;
}

div.floatright
{
float: right;
}

h1.chapter0
{
font-size: 110%;
text-align: center;
font-weight: normal;
line-height: 2em;
margin-top: 4em;
margin-bottom: 3em;
}

p.center0
{
margin-top: 1.5em;
text-align: center;
margin-bottom: 1.5em;
}

h1.chapter1
{
font-size: 100%;
text-align: center;
font-weight: normal;
line-height: 2em;
margin-top: 4em;
margin-bottom: 2em;
}

Now, this is the new style sheet after the conversion:
Spoiler:

.calibre {
display: block;
font-family: Charis, "Times New Roman", Verdana, Arial;
font-size: 1rem;
line-height: 1.2em;
padding-left: 0;
padding-right: 0;
margin: 0 5pt
}
.calibre1 {
font-style: italic
}
.calibre2 {
background-color: #FFF;
display: block;
font-family: Charis, "Times New Roman", Verdana, Arial;
font-size: 1rem;
line-height: 1.2em;
padding-left: 0;
padding-right: 0;
text-align: center;
margin: 0 5pt
}
.calibre3 {
height: auto;
max-height: 100%;
max-width: 100%;
width: auto
}
.calibre4 {
display: block
}
.calibre5 {
line-height: 1.2
}
.calibre6 {
font-style: italic;
line-height: 1.2
}
.calibre7 {
display: block;
line-height: 1.2
}
.center {
display: block;
text-align: center;
margin: 1em 0
}
.center1 {
display: block;
text-align: center;
margin: 1.5em 0
}
.chapter {
display: block;
font-size: 110%;
font-weight: normal;
line-height: 1.5em;
text-align: center;
margin: 4em 0 6em
}
.chapter1 {
display: block;
font-size: 110%;
font-weight: normal;
line-height: 2em;
text-align: center;
margin: 4em 0 3em
}
.chapter2 {
display: block;
font-size: 100%;
font-weight: normal;
line-height: 2em;
text-align: center;
margin: 4em 0 2em
}
.copyright {
display: block;
font-size: 0.8rem;
margin-top: 4em;
text-align: center
}
.dedication {
display: block;
font-size: 0.8rem;
margin-top: 8em
}
.extract {
display: block;
text-align: justify;
text-indent: 0;
margin: 2em 0 0.3em
}
.footnote {
border-bottom-style: solid;
border-bottom-width: 0;
border-left-style: solid;
border-left-width: 0;
border-right-style: solid;
border-right-width: 0;
border-top-style: solid;
border-top-width: 1px;
display: block;
font-size: 0.8rem;
margin-top: 2em
}
.footnote1 {
display: block;
text-align: justify;
margin: 0.3em 0 0.3em 2em
}
.frac {
font-size: 0.7em;
line-height: normal;
vertical-align: 4px
}
.hlink {
line-height: 1.2;
text-decoration: none
}
.hlink1 {
text-decoration: none
}
.indent {
display: block;
text-align: justify;
text-indent: 1em;
margin: 0.3em 0
}
.nonindent {
display: block;
line-height: 1.2;
text-align: justify;
text-indent: 0;
margin: 0.3em 0
}
.nonindent1 {
display: block;
text-align: justify;
text-indent: 0;
margin: 0.3em 0
}
.pubhlink {
color: green;
text-decoration: none
}
.small {
font-size: 0.6rem
}
.titlepage {
display: block;
margin-left: -0.4em;
margin-top: 1.2em;
text-align: center
}
.toc {
display: block;
font-size: 110%;
font-weight: normal;
line-height: 1.2;
text-align: center;
margin: 3em 0 2em
}
.toc_chap {
display: block;
font-size: 1em;
line-height: 1.4em;
margin-left: 1.5em
}
.toc_fm {
display: block;
font-size: 0.9em;
line-height: 1.2;
margin-bottom: 1em;
margin-left: 1.5em;
margin-top: 1em
}

The resulting css has a lot of classes called 'calibreXX', and some of the original names are lost. The XHTML files are now referring to this new names. So, if you just paste the old style sheet, and clean the unused rules/classes, all the rules mismatching the text will be deleted, and so will be the classes unused on the XHTML files. Information/formatting will be lost.
thiago.eec is offline   Reply With Quote
Old 01-21-2020, 02:44 PM   #8
hobnail
Groupie
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 161
Karma: 984696
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by thiago.eec View Post
I just did a conversion here, from EPUB to AZW3.

...

The resulting css has a lot of classes called 'calibreXX', and some of the original names are lost. The XHTML files are now referring to this new names. So, if you just paste the old style sheet, and clean the unused rules/classes, all the rules mismatching the text will be deleted, and so will be the classes unused on the XHTML files. Information/formatting will be lost.
And that makes sense; the calibre manual explains its process which is to convert the book to XML, which I think of as a somewhat generic and non-specific format, and then covert that to the specified format.
hobnail is offline   Reply With Quote
Old 01-21-2020, 03:01 PM   #9
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 137
Karma: 215930
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
Information/formatting will be lost.
In my experience, no formatting at all is lost. Perhaps the difference is in our standard conversion settings. (?)

One thing I observe which is important: When I make a conversion from one editable format to the other, Calibre adds classes and various other bits to the HTML but does not wipe previous classes in the structure. For instance, if I have a class "first-para" to distinguish each first paragraph in a chapter (for styling the usual pseudo-elements), Calibre leaves that class in place but adds (usually) two other classes in addition, partitioning the various CSS rules across these classes by some criteria unknown to me.

When I wipe out the new Calibre stylesheet, all that other stuff gets wiped from the HTML. We are back to my original clean HTML and original CSS from the format that was converted.

Last edited by Brett Merkey; 01-21-2020 at 03:10 PM.
Brett Merkey is offline   Reply With Quote
Old 01-21-2020, 03:11 PM   #10
thiago.eec
Addict
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 281
Karma: 71602
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by Brett Merkey View Post
In my experience, no formatting at all is lost. Perhaps the difference is in our standard conversion settings. (?)
I have no special settings for conversion. Just the default ones.

Quote:
Originally Posted by Brett Merkey View Post
Calibre adds classes and various other bits to the HTML but does not wipe previous classes in the structure.
Not the case here, as it can be seen on the example posted.
thiago.eec is offline   Reply With Quote
Old 01-21-2020, 03:23 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 55,403
Karma: 51439620
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
What I do is use KindleUnpack to shift from KF8 to ePub and then I have a look at the ePub in the editor if the ePub is OK enough, I'll run epubcheck to check for errors and then I'll fix the errors. If the KF8 is not good enough to shift, I'll do a conversion.

After that, I'll remove unused CSS and losslessly compress the images. I'll also rename the HTML files to something that makes sense. And from there, I'll do my usual cleaning up.
JSWolf is offline   Reply With Quote
Old 01-21-2020, 03:29 PM   #12
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 137
Karma: 215930
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
as it can be seen on the example posted.
The example you gave really shows nothing because it was just CSS that gets blown away. The critical code is in the HTML structure. Look at it. Does Calibre really delete classes that you had in the original format? I would shudder if it did...

Last edited by Brett Merkey; 01-21-2020 at 03:50 PM.
Brett Merkey is offline   Reply With Quote
Old 01-21-2020, 03:36 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 55,403
Karma: 51439620
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by thiago.eec View Post
I just did a conversion here, from EPUB to AZW3.

This is the original style sheet:
Spoiler:

.tp {
margin-top: 1em;
text-align: center;
}

h1.otherbooks
{
text-align: center;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

div.otherbooks
{
margin-top: 4em;
font-size: small;
margin-left: 2em;
margin-right: 2em;
}

div.copyright
{
font-size: small;
text-align: center;
margin-top: 4em;
}

div.dedication
{
font-size: small;
margin-top: 8em;
}

div.epigraph
{
font-size: medium;
margin-left: 12em;
margin-right: 4em;
margin-bottom: 2em;
margin-top: 2em;
}

div.epigraphsource
{
font-size: x-small;
text-align: right;
font-style: italic;
margin-bottom: 12em;
margin-right: 2em;
}

h1.acknowledgments
{
font-size: medium;
margin-top: 4em;
text-align: center;
font-weight: bold;
}

div.acknowledgments
{
font-size: small;
text-align: justify;
margin-left: 2em;
margin-right: 2em;
}

h1.authorsnote
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.authorsnote
{
font-size: small;
text-align: justify;
}

h1.listoffigures
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.listoffigures
{
font-size: small;
text-align: left;
}

h1.chronology
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.geneology
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.foreword
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.preface
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.introduction
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.prologue
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.part
{
line-height: 2em;
margin-top: 4em;
margin-bottom: 1em;
font-size: large;
text-align: center;
font-weight: bold;
}

h1.chapter
{
font-size: 110%;
text-align: center;
font-weight: normal;
line-height: 1.5em;
margin-top: 4em;
margin-bottom: 6em;
}

h1.subchapter
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.epilogue
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.coda
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.conclusion
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.afterward
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.permission
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.glossary
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

span.glosaryterm
{
font-size: small;
text-align: left;
margin-right: 1em;
}

span.glosarydef
{
font-size: small;
text-align: left;
margin-right: 1em;
}

h1.appendix
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.resource
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.notes
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.note
{
font-size: x-small;
text-align: justify;
margin-left: 1em;
}

h1.source
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.bibliography
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

div.bibliography
{
font-size: x-small;
text-align: justify;
margin-left: 2em;
font-weight: bold;
}

h1.suggestedreading
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h1.abouttheauthor
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

p.smallheight
{
margin-top: 1em;
margin-bottom: 1em;
}

p.mediumheight
{
margin-top: 2em;
margin-bottom: 2em;
}

p.attribution
{
text-align: center;
}


p.largeheight
{
margin-top: 3em;
margin-bottom: 3em;
}

div.list
{
font-size: small;
margin-left: 1em;
}


h1.box
{
font-size: medium;
font-style: italic;
text-align: center;
}

div.box
{
font-size: small;
margin-left: 1em;
}

p.caption
{
font-size: x-small;
font-style: italic;
text-align: center;
margin-bottom: 1em;
}


/* ===================== Added Styles ===================== */

p.indent
{
text-indent: 1.00em;
text-align: justify;
}

p.right
{
text-align: right;
}

p.center
{
margin-top: 1em;
text-align: center;
margin-bottom: 1em;
}

a.hlink
{
text-decoration: none;
}

p.figure
{
margin-top: 2em;
text-align: center;
margin-bottom: 2em;
}

h1.subtitle
{
font-size: x-large;
text-align: center;
font-weight: bold;
margin-bottom: 4em;
}


h1.contents
{
font-size: medium;
text-align: center;
font-style: italic;
font-weight: bold;
}

h2.title
{
font-size: medium;
text-align: center;
}

p.smallheight
{
margin-top: 1em;
}

p.mediumheight
{
margin-top: 2em;
}

p
{
margin-top: .3em;
margin-bottom: .3em;
}

div.cover
{
text-align: center;
height: 100%;
}

div.titlepage
{
text-align: center;
margin-top: 1.2em;
margin-left: -.4em;
}

a.pubhlink
{
text-decoration: none;
color: green;
}

p.extract
{
text-align: justify;
margin-top: 2em;
text-indent: 0;
}

p.extract1
{
text-align: justify;
margin-top: 2em;
text-indent: 0;
text-indent: 1.00em;
}

div.textbox
{
margin-top: 2em;
margin-bottom: 2em;
border-bottom: 2px solid;
border-top: 2px solid;
line-height: 1.7em;
text-align: center;
}

h1.caption
{
font-size: medium;
margin-bottom: 1em;
}

p.box
{
border-bottom: 1px double;
border-left: 1px double;
border-top: 1px double;
border-right: 1px double;
text-align: justify;
}

div.abstract
{
font-size: small;
text-align: justify;
margin-left: 2em;
margin-right: 2em;
}

div.appendix
{
font-size: small;
text-align: justify;
}

p.reference
{
text-align: justify;
text-indent: -1.00em;
margin-left: 1em;
}

div.biboliography
{
font-size: medium;
text-align: justify;
}

div.preface
{
font-size: small;
text-align: justify;
margin-left: 2em;
margin-right: 2em;
}

p.cop
{
margin-bottom: 1em;
}

p.nonindent
{
text-align: justify;
text-indent: 0;
}

span.small
{
font-size: x-small;
}

div.toc
{
font-size: medium;
text-align: center;
}

p.stanga
{
text-align: justify;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 2em;
}

body
{
font-size: medium;
line-height: 1.2em;
margin-top: 1em;
margin-left: 1em;
margin-right: 2em;
font-family: Charis, "Times New Roman", Verdana, Arial;
}

@font-face
{
font-family: "Charis";
font-style: normal;
font-weight: normal;
src:url(fonts/CharisSILR.ttf);
}

@font-face
{
font-family: "Charis";
font-style: normal;
font-weight: bold;
src:url(fonts/CharisSILB.ttf);
}

@font-face
{
font-family: "Charis";
font-style: italic;
font-weight: normal;
src:url(fonts/CharisSILI.ttf);
}

@font-face
{
font-family: "Charis";
font-style: italic;
font-weight: bold;
src:url(fonts/CharisSILBI.ttf);
}

h3.title
{
font-size: medium;
text-align: center;
margin-bottom: 3em;
}

span.dropcaps
{
float: left;
font-size: 50px;
line-height: 50px;
padding-top: 1px;
margin-top: -.09em;
margin-right: .09em;
}

span.dropcaps3lines
{
float: left;
font-size: 80px;
line-height: 70px;
padding-top: 1px;
margin-top: -.09em;
margin-right: .09em;
}

sup.small
{
font-size: small;
line-height: 0.0em;
}

div.footnote
{
font-size: small;
border-style: solid;
border-width: 1px 0 0 0;
margin-top: 2em;
}

p.footnote
{
text-align: justify;
margin-left: 2em;
}

p.question
{
text-align: justify;
margin-top: 1em;
}

div.small-page
{
margin-top: 2em;
font-size: medium;
margin-left: 12em;
margin-right: 6em;
}

h1.toc
{
text-align: center;
font-size: 110%;
margin-top: 3em;
margin-bottom: 2em;
font-weight: normal;
}

ol.upperalpha
{
text-align: justify;
list-style-type: upper-alpha;
}

ol.upperroman
{
text-align: justify;
list-style-type: upper-roman;
}

ol.lowerroman
{
text-align: justify;
list-style-type: lower-roman;
}

ol.loweralpha
{
text-align: justify;
list-style-type: lower-alpha;
}


ol.arabic
{
text-align: justify;
}
ul.bullet
{
list-style-type: disc;
}

ul.none
{
text-align: justify;
list-style-type: none;
}

p.hanging
{
text-indent: -1em;
font-size: medium;
margin-left: 2.5em;
margin-top: 0.5em;
}

h1.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h2.section
{
text-align: center;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h3.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h4.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

h5.section
{
text-align: left;
font-size: medium;
margin-bottom: 1em;
margin-top: 4em;
}

span.underline
{
text-decoration: underline;
}

span.big
{
font-size: large;
}

p.crt
{
margin-top: 1em;
text-align: center;
margin-bottom: 1em;
}

span.overline
{
text-decoration: overline;
}

p.textbox
{
text-align: justify;
margin-left: 1em;
margin-right: 1em;

}

p.textbox1
{
text-indent: 1.00em;
text-align: justify;
margin-left: 1em;
margin-right: 1em;
}

div.chapter
{
margin-top: 2em;
margin-left: 0.5em;
margin-right: 0.5em;
}

span.strike
{
text-decoration: line-through;
}

img
{
max-height: 100%;
max-width: 100%;
}


sup
{
vertical-align: 4px;
}

sup.frac, sub.frac
{
font-size: 0.7em;
}

p.pagebreak
{
page-break-before: always;
}

p.textboxextract
{
margin-top: 2em;
text-align: justify;
margin-left: 1em;
margin-right: 1em;
}

/* =============== New Style added =============== */

/* == For TOC == */

div.toc_fm
{
margin-top:1em;
margin-bottom:1em;
margin-left:1.5em;
font-size:.9em;
line-height:1em;
}

div.toc_bm
{
margin-top:1em;
margin-bottom:1em;
margin-left:1.5em;
font-size:.9em;
line-height:1em;
}

div.toc_chap
{
margin-left:1.5em;
font-size:1em;
line-height:1.4em;
}

div.toc_sub
{
margin-left:2em;
font-size:smaller;
line-height:1.4em;
}

div.toc_part
{
margin-left:1.5em;
line-height:1.5em;
font-size:1.2em;
}

.toc_part .toc_chap
{
font-size:medium;
margin-left:1.5em;
}

.toc_part .toc_chap .toc_sub
{
font-size:smaller;
margin-left:1.5em;
}


/* == For Block Quotes == */

div.block
{
margin-left: 0em;
margin-right: 0em;
text-align:justify;
margin-top: 1em;
margin-bottom: 1em;
font-size: small;
}

p.bl_nonindent
{
margin-left:2.5em;
margin-right:2.5em;
text-align:justify;
}

p.bl_indent
{
text-indent:1em;
margin-left:2.5em;
margin-right:2.5em;
text-align:justify;
}

p.bl_extract
{
margin-left:2.5em;
margin-right:2.5em;
text-align:justify;
margin-top: 2em;
}

p.bl_center
{
margin-left:2.5em;
margin-right:2.5em;
text-align: center;
}

p.bl_right
{
text-align: right;
margin-left:2.5em;
margin-right:2.5em;
}

p.bl_hanging
{
text-indent: -1em;
font-size: medium;
margin-left: 2.5em;
margin-top: 0.5em;
}


/* For Hanging Paragraphs */

div.hanging
{
margin-left: 1.0em;
}

/* For Dialogue Text */

div.dialogue
{
margin-left: 4.2em;
margin-bottom: 2em;
margin-top: 1.5em;
font-size: small;
}

p.d_hanging
{
text-indent: -4.2em;
font-size: small;
margin-top: 0.5em;
}

/* For bullet list */

ul.bullet
{
list-style-type: disc;
margin-top: 1em;
margin-bottom: 1em;
}
div.bullet
{
margin-left: .8em;
margin-top: 0;
margin-bottom: 0;
text-align: justify;
}

/* For Fractions */
.frac_num
{font-size:x-small; vertical-align:text-top;}
.frac_den
{font-size:x-small; vertical-align:text-bottom;}

div.floatleft
{
float: left;
}

div.floatright
{
float: right;
}

h1.chapter0
{
font-size: 110%;
text-align: center;
font-weight: normal;
line-height: 2em;
margin-top: 4em;
margin-bottom: 3em;
}

p.center0
{
margin-top: 1.5em;
text-align: center;
margin-bottom: 1.5em;
}

h1.chapter1
{
font-size: 100%;
text-align: center;
font-weight: normal;
line-height: 2em;
margin-top: 4em;
margin-bottom: 2em;
}

Now, this is the new style sheet after the conversion:
Spoiler:

.calibre {
display: block;
font-family: Charis, "Times New Roman", Verdana, Arial;
font-size: 1rem;
line-height: 1.2em;
padding-left: 0;
padding-right: 0;
margin: 0 5pt
}
.calibre1 {
font-style: italic
}
.calibre2 {
background-color: #FFF;
display: block;
font-family: Charis, "Times New Roman", Verdana, Arial;
font-size: 1rem;
line-height: 1.2em;
padding-left: 0;
padding-right: 0;
text-align: center;
margin: 0 5pt
}
.calibre3 {
height: auto;
max-height: 100%;
max-width: 100%;
width: auto
}
.calibre4 {
display: block
}
.calibre5 {
line-height: 1.2
}
.calibre6 {
font-style: italic;
line-height: 1.2
}
.calibre7 {
display: block;
line-height: 1.2
}
.center {
display: block;
text-align: center;
margin: 1em 0
}
.center1 {
display: block;
text-align: center;
margin: 1.5em 0
}
.chapter {
display: block;
font-size: 110%;
font-weight: normal;
line-height: 1.5em;
text-align: center;
margin: 4em 0 6em
}
.chapter1 {
display: block;
font-size: 110%;
font-weight: normal;
line-height: 2em;
text-align: center;
margin: 4em 0 3em
}
.chapter2 {
display: block;
font-size: 100%;
font-weight: normal;
line-height: 2em;
text-align: center;
margin: 4em 0 2em
}
.copyright {
display: block;
font-size: 0.8rem;
margin-top: 4em;
text-align: center
}
.dedication {
display: block;
font-size: 0.8rem;
margin-top: 8em
}
.extract {
display: block;
text-align: justify;
text-indent: 0;
margin: 2em 0 0.3em
}
.footnote {
border-bottom-style: solid;
border-bottom-width: 0;
border-left-style: solid;
border-left-width: 0;
border-right-style: solid;
border-right-width: 0;
border-top-style: solid;
border-top-width: 1px;
display: block;
font-size: 0.8rem;
margin-top: 2em
}
.footnote1 {
display: block;
text-align: justify;
margin: 0.3em 0 0.3em 2em
}
.frac {
font-size: 0.7em;
line-height: normal;
vertical-align: 4px
}
.hlink {
line-height: 1.2;
text-decoration: none
}
.hlink1 {
text-decoration: none
}
.indent {
display: block;
text-align: justify;
text-indent: 1em;
margin: 0.3em 0
}
.nonindent {
display: block;
line-height: 1.2;
text-align: justify;
text-indent: 0;
margin: 0.3em 0
}
.nonindent1 {
display: block;
text-align: justify;
text-indent: 0;
margin: 0.3em 0
}
.pubhlink {
color: green;
text-decoration: none
}
.small {
font-size: 0.6rem
}
.titlepage {
display: block;
margin-left: -0.4em;
margin-top: 1.2em;
text-align: center
}
.toc {
display: block;
font-size: 110%;
font-weight: normal;
line-height: 1.2;
text-align: center;
margin: 3em 0 2em
}
.toc_chap {
display: block;
font-size: 1em;
line-height: 1.4em;
margin-left: 1.5em
}
.toc_fm {
display: block;
font-size: 0.9em;
line-height: 1.2;
margin-bottom: 1em;
margin-left: 1.5em;
margin-top: 1em
}

The resulting css has a lot of classes called 'calibreXX', and some of the original names are lost. The XHTML files are now referring to this new names. So, if you just paste the old style sheet, and clean the unused rules/classes, all the rules mismatching the text will be deleted, and so will be the classes unused on the XHTML files. Information/formatting will be lost.
A lot of the classes in the CSS got blown away and for good reason. Most ePub are made with an asinine CSS that can hae many (more then 100) extra classes. So when Calibre converts, it blows away any classes not used. And that includes any in the HTML files (yes there can be unused classes in the HTML).

The suggestion to put back the original CSS and remove unused classes is going to screw with the eBook.
JSWolf is offline   Reply With Quote
Old 01-21-2020, 03:40 PM   #14
Section8
Addict
Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.
 
Section8's Avatar
 
Posts: 218
Karma: 1700000
Join Date: Oct 2011
Location: Arlington, TX
Device: Kindle PW2, Nook ST, Nook Color, Sony PRST1
I've sometimes wanted the same thing as the OP - kindleunpack can "repackage" an azw3 as epub, but I don't know of anything that does the reverse. I've also wished the calibre ebook editor - which can edit both azw3 and epub - had a "save as" function, so you could start out editing one, save it, then "save as" the other. (I currently read azw3 on a PW4, but make sure everything in calibre is also saved as the equivalent epub just in case I decide to switch to an epub reader).

Anyway, I haven't been motivated to try to tackle a calibre plugin for this, so I just convert.
Section8 is offline   Reply With Quote
Old 01-21-2020, 03:46 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 55,403
Karma: 51439620
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by Section8 View Post
I've sometimes wanted the same thing as the OP - kindleunpack can "repackage" an azw3 as epub, but I don't know of anything that does the reverse. I've also wished the calibre ebook editor - which can edit both azw3 and epub - had a "save as" function, so you could start out editing one, save it, then "save as" the other. (I currently read azw3 on a PW4, but make sure everything in calibre is also saved as the equivalent epub just in case I decide to switch to an epub reader).

Anyway, I haven't been motivated to try to tackle a calibre plugin for this, so I just convert.
The reverse can be done by KindleGen. But after the conversion, you may want to use KindleUnpack to split the dual-format mobi so your eBooks don't take up a lot of extra space.
JSWolf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AZW3 to EPUB conversion 2 columns ctemple Conversion 1 01-27-2019 09:56 PM
Failed Conversion from AZW3 to EPUB marie44 Conversion 10 03-24-2015 11:59 PM
Problem with conversion from AZW3 to ePub Kaetrin Conversion 3 05-30-2013 05:57 AM
Conversion from epub to azw3 Joy736 Conversion 12 01-01-2013 12:00 PM
Conversion Lossy or Lossless? KrowNB Conversion 6 03-11-2011 09:31 AM


All times are GMT -4. The time now is 05:47 AM.


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