Skip to content

Instantly share code, notes, and snippets.

@JayPanoz
Last active October 9, 2016 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayPanoz/05c5f495273225209b9d to your computer and use it in GitHub Desktop.
Save JayPanoz/05c5f495273225209b9d to your computer and use it in GitHub Desktop.
Example of iBooks Author ePub3 CSS export
/* Spoiler: undocumented -iBooks- prefixed props in there! */
/* For tab-stops and tab-interval, please refer to https://www.w3.org/People/howcome/t/970224HTMLERB-CSS/WD-tabs-970117.html */
@font-face{
font-family: "Adelle-Bold";
font-weight: bold;
font-style: normal;
font-stretch: normal;
src: url("../Fonts/2001.otf");
}
sup{
font-size: 0.67em;
vertical-align: 33%;
}
a.anchor{
-ibooks-layout-hint: anchor;
display: none;
}
a.pageShape{
-ibooks-layout-hint: anchor page shape;
display: none;
}
.pagebreak{
break-after: page;
}
div.multichoice{
list-style-type: upper-alpha;
}
.columnbreak{
break-after: column;
}
p, ul, ol{
margin: 0px;
}
a.shape{
-ibooks-layout-hint: shape;
display: none;
}
body{
white-space: pre-wrap;
}
.hide{
display: none;
}
img{
max-height: 100%;
max-width: 100%;
}
figure{
margin: 1em 0 1em 0;
page-break-inside: avoid;
text-align: center;
}
sub{
font-size: 0.67em;
vertical-align: -10%;
}
a.attachment{
-ibooks-layout-hint: inline;
display: none;
}
table{
border-collapse: collapse;
white-space: pre-wrap;
}
.inlineblock{
display: inline;
}
a.page{
-ibooks-layout-hint: anchor page;
display: none;
}
.s1{
-ibooks-list-text-indent: 0.00pt;
-ibooks-strikethru-type: none;
-ibooks-strikethru-width: 1.00px;
-ibooks-underline-type: none;
-ibooks-underline-width: 1.00px;
border-bottom-style: none;
border-bottom-width: 0;
border-left-style: none;
border-left-width: 0;
border-right-style: none;
border-right-width: 0;
border-top-style: none;
border-top-width: 0;
color: #6B7892;
font-family: "AvenirNext-Medium";
font-size: 1.33em;
font-style: normal;
font-variant: normal;
font-weight: normal;
hyphens: auto;
letter-spacing: 0;
line-height: 0.80em;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
page-break-before: auto;
tab-interval: 36.00pt;
tab-stops: none;
text-align: center;
text-indent: 0;
text-shadow: none;
text-transform: uppercase;
vertical-align: 0;
text-decoration: none;
}
.s2{
-ibooks-stroke: none;
background: none;
box-shadow: none;
opacity: 1.000;
stroke: #CBCBCB;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4.0;
stroke-width: 1.0pt;
}
.s3{
stroke: none;
}
.s4{
-ibooks-list-text-indent: 0.00pt;
-ibooks-strikethru-type: none;
-ibooks-strikethru-width: 1.00px;
-ibooks-underline-type: none;
-ibooks-underline-width: 1.00px;
border-bottom-style: none;
border-bottom-width: 0;
border-left-style: none;
border-left-width: 0;
border-right-style: none;
border-right-width: 0;
border-top-style: none;
border-top-width: 0;
color: #7A7A7A;
font-family: "Iowan Old Style";
font-size: 4.00em;
font-style: normal;
font-variant: normal;
font-weight: normal;
hyphens: auto;
letter-spacing: 0;
margin-bottom: 40.00pt;
margin-left: 0;
margin-right: 0;
margin-top: 0;
page-break-before: auto;
tab-interval: 36.00pt;
tab-stops: none;
text-align: center;
text-indent: 0;
text-shadow: none;
text-transform: capitalize;
vertical-align: 0;
text-decoration: none;
}
.s5{
-ibooks-list-text-indent: 0.00pt;
-ibooks-strikethru-type: none;
-ibooks-strikethru-width: 1.00px;
-ibooks-underline-type: none;
-ibooks-underline-width: 1.00px;
border-bottom-style: none;
border-bottom-width: 0;
border-left-style: none;
border-left-width: 0;
border-right-style: none;
border-right-width: 0;
border-top-style: none;
border-top-width: 0;
color: #000000;
font-family: "Iowan Old Style";
font-size: 1.50em;
font-style: normal;
font-variant: normal;
font-weight: normal;
hyphens: auto;
letter-spacing: 0;
line-height: 1.20em;
margin-bottom: 10.00pt;
margin-left: 0;
margin-right: 0;
margin-top: 0;
page-break-before: auto;
tab-interval: 36.00pt;
tab-stops: none;
text-align: left;
text-indent: 0;
text-shadow: none;
text-transform: none;
vertical-align: 0;
text-decoration: none;
}
.s6{
-ibooks-list-text-indent: 0.00pt;
-ibooks-strikethru-type: none;
-ibooks-strikethru-width: 1.00px;
-ibooks-underline-type: none;
-ibooks-underline-width: 1.00px;
border-bottom-style: none;
border-bottom-width: 0;
border-left-style: none;
border-left-width: 0;
border-right-style: none;
border-right-width: 0;
border-top-style: none;
border-top-width: 0;
color: #000000;
font-family: "Iowan Old Style";
font-size: 1.50em;
font-style: normal;
font-variant: normal;
font-weight: normal;
hyphens: auto;
letter-spacing: 0;
line-height: 1.20em;
margin-bottom: 10.00pt;
margin-left: 0;
margin-right: 0;
margin-top: 0;
page-break-before: auto;
tab-interval: 36.00pt;
tab-stops: none;
text-align: left;
text-indent: 35.00pt;
text-shadow: none;
text-transform: none;
vertical-align: 0;
text-decoration: none;
}
.s7{
-ibooks-list-text-indent: 0.00pt;
-ibooks-strikethru-type: none;
-ibooks-strikethru-width: 1.00px;
-ibooks-underline-type: none;
-ibooks-underline-width: 1.00px;
border-bottom-style: none;
border-bottom-width: 0;
border-left-style: none;
border-left-width: 0;
border-right-style: none;
border-right-width: 0;
border-top-style: none;
border-top-width: 0;
color: #797979;
font-family: "Iowan Old Style";
font-size: 3.17em;
font-style: normal;
font-variant: normal;
font-weight: normal;
hyphens: auto;
letter-spacing: 0;
line-height: 0.90em;
margin-bottom: 20.00pt;
margin-left: 0;
margin-right: 0;
margin-top: 0;
page-break-before: auto;
tab-interval: 36.00pt;
tab-stops: none;
text-align: center;
text-indent: 0;
text-shadow: none;
text-transform: capitalize;
vertical-align: 0;
text-decoration: none;
}
.s8{
-ibooks-strikethru-type: none;
-ibooks-strikethru-width: 1.00px;
-ibooks-underline-type: none;
-ibooks-underline-width: 1.00px;
border-bottom-style: none;
border-bottom-width: 0;
border-left-style: none;
border-left-width: 0;
border-right-style: none;
border-right-width: 0;
border-top-style: none;
border-top-width: 0;
color: #000000;
font-family: "Iowan Old Style";
font-size: 1.50em;
font-style: normal;
font-variant: normal;
font-weight: normal;
hyphens: auto;
letter-spacing: 0;
line-height: 1.20em;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
page-break-before: auto;
tab-interval: 36.00pt;
tab-stops: none;
text-align: justify;
text-indent: 0;
text-shadow: none;
text-transform: none;
vertical-align: 0;
text-decoration: none;
}
.s9{
-ibooks-list-text-indent: 0.00pt;
font-family: "Adelle-Bold";
font-size: 4.00em;
font-weight: bold;
text-align: center;
}
.c1{
background: transparent;
}
.c2{
background: transparent;
color: #FF260A;
font-weight: bold;
}
.c3{
background: transparent;
font-style: italic;
}
.c4{
background: transparent;
font-weight: bold;
}
#image-5{
height: 14.018pt;
width: 250.000pt;
}
@Nausica79
Copy link

I got an ibook authored made ibook and I changed a few extensions to make compatible to upload to Amazon. However I lost the page margins/decorative blocks from the original. How do I recover them?

@JayPanoz
Copy link
Author

JayPanoz commented Oct 9, 2016

You don’t.

At the moment, their only self-imposed obligation is to make it work with iBooks.

And it’s actually some kind of snowflake format in disguise. If you check metadata, you’ll see some hint at a RMT format (sorry, don’t know what RMT means) so basically, it’s a package with a lot of extra stuff to help iBooks manage widgets, glossaries and even search, with an epub3 extension.

The file can be open in other Reading Systems though because they designed this RMT format on top of EPUB 3. In other words there is a common foundation other RS can understand. But all the extra stuff obviously doesn't work anywhere else because other Reading Systems have no clue what to make of this RMT format.

As a matter of fact, when I tried to remove this “RMT format” meta and all the extra stuff, iBooks couldn't even open the file as vanilla EPUB3, it displayed an error.

TL;DR: you're out of luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment