Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-20-2014, 06:37 AM   #1
Alda
Zealot
Alda began at the beginning.
 
Posts: 104
Karma: 22
Join Date: Jun 2010
Device: none
Headings appearing huge with Indesign stylesheet

Hi,

I'm trying to tweak a book that was designed in InDesign and exported as ePub. I love the look of it when I upload to KDP, except for one problem - the headings (H1) appear HUGE. I've tried going into the Indesign-generated stylesheet to tinker with the code, but nothing happens, no matter what I do. I'm actually not sure if what the stylesheet defines as a heading is the same thing as Sigil's H1.

This is the code in the stylesheet, as far as I can ascertain:

Quote:
p.Fyrirs--1 {
color:#808285;
font-family:"Futura Light", sans-serif;
font-size:1em;
font-style:normal;
font-variant:normal;
font-weight:200;
line-height:1.083;
margin-bottom:0;
margin-left:0;
margin-right:0;
margin-top:0;
orphans:1;
page-break-after:auto;
page-break-before:auto;
text-align:left;
text-decoration:none;
text-indent:0;
widows:1;
}
Does anyone know if there is a way to change the heading size using the stylesheet, or even manually in Sigil? I don't see a font adjustment option there.

Many thanks.

EDIT: on closer inspection I see this in the page html

Quote:
<h1 class="Basic-Paragraph ParaOverride-3"><span class="CharOverride-10">1</span> <span class="CharOverride-11">Turf</span></h1>
All this "overriding" - could that be the issue?

Last edited by Alda; 06-20-2014 at 06:51 AM.
Alda is offline   Reply With Quote
Old 06-20-2014, 06:58 AM   #2
Alda
Zealot
Alda began at the beginning.
 
Posts: 104
Karma: 22
Join Date: Jun 2010
Device: none
Ok, answered my own question. When I tinkered with the "override" code I managed to get it the way I wanted.
Alda is offline   Reply With Quote
Advert
Old 06-20-2014, 08:37 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
You do realise I hope that you can probably reduce your stylesheet with 75% by removing the InDesign clutter? That would also speed up the book.
Toxaris is offline   Reply With Quote
Old 06-20-2014, 08:47 AM   #4
Alda
Zealot
Alda began at the beginning.
 
Posts: 104
Karma: 22
Join Date: Jun 2010
Device: none
Nope, I had no idea. This is my first time doing this.

Can you be more specific re. InDesign clutter?

Thanks.
Alda is offline   Reply With Quote
Old 06-20-2014, 02:34 PM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Stylesheets inherits. So, characteristics can be set in the body/html. As long as they do not change (as most do not), you don't need them in the other definitions. So, usually you can move margin settings, font settings etc into the body/html tags. That saves a lot of entries. Also, Indesign will often use micro values (in your example a line-height of 1.083). That is unnecessary. A setting of 1.0 or 1.1 would do.
Toxaris is offline   Reply With Quote
Advert
Old 06-20-2014, 03:00 PM   #6
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Alda View Post
Can you be more specific re. InDesign clutter?
Reminds me a lot like not using Styles functionality in Microsoft Word or LibreOffice, and then exporting to HTML.

While doing things that way might LOOK fine on the surface, or be perfectly fine for a print edition, if you try to do anything besides print, your code is going to be mangled/unmaintainable.

When you design a book in InDesign without thinking "ebook FIRST", you cause yourself A MASSIVE amount of headaches when trying to do anything outside of PDF/print.

Let us say when designing the InDesign file, you forgo using Styles, and implement things like manual kerning tweaks, manual font-sizing, instead of specifying logical markup of "heading1" + "heading2" you decide to just resize+bold the text+change the font, etc. etc. When you export the book to EPUB, InDesign creates a massive amount of spans that are just worthless/redundant/overlapping.

For example, here is a sample from one of the latest InDesign -> EPUB conversions I cleaned up.

Here is the first page from the PDF from Chapter 7:

Click image for larger version

Name:	pg43PDF.png
Views:	261
Size:	38.3 KB
ID:	124399

As you can see, it looks perfectly fine on the surface... but, let us take a look at the EPUB code that was generated.

InDesign EPUB:

Click image for larger version

Name:	Chapter7InDesignEPUB.png
Views:	291
Size:	58.4 KB
ID:	124401

Quote:
<div class="generated-style">
<p class="chapter-number chapter-number-override" xml:lang="en-us"><span class="no-style-override">chapter</span> <span class="no-style-override-1">7</span></p>

<p class="chapter-heading" xml:lang="en-us">Market vs. State:</p>

<p class="chapter-heading" xml:lang="en-us">It Is the Overriding Distinction</p>

<p class="chapter-heading" xml:lang="en-us">in Economics and Politics<span class="no-style-override-2">*</span></p>
</div>
InDesign CSS:

Code:
p.chapter-number {
	font-family: "Poppl-Laudatio";
	font-weight: normal;
	font-style: normal;
	font-size: 0.83em;
	line-height: 1.20em;
	text-decoration: none;
	font-variant: small-caps;
	text-indent: 0em;
	text-align: center;
	color: #000000;
	margin: 0.90em 0em 2.25em 0em;
}
p.chapter-number-override {
	margin: 0.64em 0em 1.61em 0em;
}

span.no-style-override {
	font-size: 1.17em;
}
span.no-style-override-1 {
	font-size: 1em;
}

p.chapter-heading {
	font-family: "Poppl-Laudatio";
	font-weight: normal;
	font-style: normal;
	font-size: 1.83em;
	line-height: 1.27em;
	text-decoration: none;
	font-variant: normal;
	text-indent: 0em;
	text-align: center;
	color: #000000;
	margin: 0em;
}

span.no-style-override-2 {
	font-size: 1.33em;
	line-height: 1.88em;
}
Now, I went through, and stripped out a lot of the junk:

After:

Click image for larger version

Name:	pg43EPUB.png
Views:	279
Size:	59.2 KB
ID:	124400

Quote:
<h3 id="sigil_toc_id_4" title="7. Market vs. State: It Is the Overriding Distinction in Economics and Politics">Chapter 7</h3>

<h3 class="sigil_not_in_toc">Market vs. State: It Is the Overriding Distinction in Economics and Politics</h3>
Here is an example of the normal text.

InDesign EPUB:

Quote:
<p class="body-text" xml:lang="en-us"><span class="no-style-override-5">The point is, as we can readily see, the ability to</span> <span class="no-style-override-4">foresee</span> <span class="no-style-override-5">an event is not at all equivalent to</span> <span class="no-style-override-4">agreeing</span> <span class="no-style-override-5">to it. Yes, I can full well</span> <span class="no-style-override-4">predict</span> <span class="no-style-override-5">that if I move to the South Bronx, I’ll likely be victimized by street crime. But this is not at</span> <span class="no-style-override-4">all</span> <span class="no-style-override-5">the same thing as</span> <span class="no-style-override-4">acquiescing</span> <span class="no-style-override-5">in such nefarious activities. Yet, according to the “libertarian” argument we are considering, the two are indistinguishable.</span></p>
InDesign CSS:

Code:
p.body-text {
	font-family: "Minion Pro";
	font-weight: normal;
	font-style: normal;
	font-size: 0.92em;
	line-height: 1.20em;
	text-decoration: none;
	font-variant: normal;
	text-indent: 1.64em;
	text-align: justify;
	color: #000000;
	margin: 0.13em 0em 0em 0em;
}

span.no-style-override-4 {
	font-style: italic;
}

span.no-style-override-5 {
}
After:

Quote:
<p>The point is, as we can readily see, the ability to <i>foresee</i> an event is not at all equivalent to <i>agreeing</i> to it. Yes, I can full well <i>predict</i> that if I move to the South Bronx, I’ll likely be victimized by street crime. But this is not at <i>all</i> the same thing as <i>acquiescing</i> in such nefarious activities. Yet, according to the “libertarian” argument we are considering, the two are indistinguishable.</p>
You really just have to go through on a case-by-case basis and figure out exactly what classes are doing what (and if they are even relevant in an EPUB).

For example, color: #000000; is telling the text to be black. While this works perfectly fine on paper (or in a physical book), in an ebook, this sort of code is only going to cause problems (let us say a user wanted to change the color of their fonts).

InDesign introduces all of these overlapping font-sizes + font-heights + line-heights + other madness... who knows how certain devices would interpret that code. You would HOPE it would show up correctly, but your safest bet is to just strip that all out, and start from the basics, never even giving the chance for the code to be displayed wrong.

Side Note: If you right click on a class in Sigil, and press "Go To Link or Style", it should jump you directly to the class in the CSS file:

Click image for larger version

Name:	GoToStyle.png
Views:	259
Size:	48.8 KB
ID:	124397 Click image for larger version

Name:	GoToStyleCSS.png
Views:	251
Size:	37.5 KB
ID:	124398

This is extremely helpful in determining what classes do what. Although again, there is most likely going to be A TON of overlapping classes.

Other Side Note: If you don't think this code is that bad, there are WAY greater horrors that I have seen.

Last edited by Tex2002ans; 06-20-2014 at 03:08 PM.
Tex2002ans is offline   Reply With Quote
Old 06-22-2014, 07:46 PM   #7
Alda
Zealot
Alda began at the beginning.
 
Posts: 104
Karma: 22
Join Date: Jun 2010
Device: none
Thanks for the explanation. I've been immersed in tweaking the last few hours and totally get what you mean. However, I'm too much of a novice to be able to strip it the way you describe above, so I'm doing what I can, then crossing my fingers and hoping for the best.

If all else fails, I'll go back to a very basic html and build the book from scratch.
Alda is offline   Reply With Quote
Old 06-23-2014, 07:53 AM   #8
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
There is always Word and Toxaris' add in or Atlantis Word Processor. They produce much simpler and manageable code.
mrmikel is offline   Reply With Quote
Old 06-27-2014, 05:47 AM   #9
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,518
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by mrmikel View Post
There is always Word and Toxaris' add in or Atlantis Word Processor. They produce much simpler and manageable code.
My iteration of Word is too old for the add-in, and I don't do Python, so I just run my Word docs through word2cleanhtml dot com online. Works fine for me.

I'm interested in what you say about Atlantis. I've heard good things about Jutoh, but nobody to my knowledge has mentioned Atlantis before. It creates epubs or mobis or just simply clean code? It's easy to use?

Thanks!
Notjohn is offline   Reply With Quote
Old 06-27-2014, 06:51 AM   #10
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Atlantis is mentioned on the board for years now. It is basically a word processor than can read Word documents. It can output ePUB and now also mobi I believe. The quality of the output is acceptable the last time I checked. It has some drawbacks. It doesn't do tables IIRC.
Toxaris is offline   Reply With Quote
Old 06-27-2014, 07:16 AM   #11
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Very easy to use. Allows to just drag pictures into it, copy and paste, things you can't do in the calibre editor or Sigil.

For me it provides a good basis which can be tuned in either editor. Tables can be added in by hand afterwards in one of the editors, when desired. Most word processors want to make over complicated tables, as far as I am concerned.

One note is that AWP publishes the mobi or epub, it can not edit them. That you have to do in one of the editors. But you can correct seen mistakes and publish once again.
mrmikel is offline   Reply With Quote
Old 06-27-2014, 11:08 AM   #12
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by mrmikel View Post
Very easy to use. Allows to just drag pictures into it, copy and paste, things you can't do in the calibre editor or Sigil.

For me it provides a good basis which can be tuned in either editor. Tables can be added in by hand afterwards in one of the editors, when desired. Most word processors want to make over complicated tables, as far as I am concerned.

One note is that AWP publishes the mobi or epub, it can not edit them. That you have to do in one of the editors. But you can correct seen mistakes and publish once again.
If there are any edit changes you can easily do that in AWP itself. It is a full word processor, not just a conversion tool although it is a great conversion tool. You can maintain all your sources in AWP and convert to final output easily. I put a review on our wiki for AWP Review. There is also a description page in the wiki. There is also a forum thread on AWP.

Dale
DaleDe is offline   Reply With Quote
Old 06-28-2014, 06:08 PM   #13
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by DaleDe View Post
If there are any edit changes you can easily do that in AWP itself. It is a full word processor, not just a conversion tool although it is a great conversion tool. You can maintain all your sources in AWP and convert to final output easily. I put a review on our wiki for AWP Review. There is also a description page in the wiki. There is also a forum thread on AWP.

Dale
FWIW:

When the announcement about Sigil no longer being supported came out, I tried Atlantis. I have to say, trying to sort out those CSS styles would make me personally insane, but...to each their own. The fact that named styles can't be mapped from Word-->ATL-->CSS is a bit frustrating. Yes, it can be fixed with regex, but I'd feel seriously sorry for anyone who didn't regex them into some type of order, who had to go back 6 or 12 months later and try to figure out WTH was what.

OTOH, it does make a perfectly nice ePUB, in terms of how it appears on the surface. I'll give it its due. But at least, in terms of WYSIWYG, Jutoh maps styles (and, yes: THAT stylesheet makes me nutty, too.)

Hitch
Hitch is offline   Reply With Quote
Old 06-30-2014, 12:01 PM   #14
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
I would agree that it would be nice to map the style names directly to a traceable name which would aid fixing or modifying the epub after it is built. But this is not the idea of Atlantis. It is designed to always go back to the source file and fix things. What I do like is that if you override the styles by making a change to an individual paragraph without changing the styles the compiler will pick that up and make a CSS style for it. If you do the same kind of change to several paragraphs it will group them and make a single CSS entry thus it is cleaner for sloppy writers. I chased some of this down but currently try and avoid worrying much about the CSS and just add things if required.

Dale
DaleDe is offline   Reply With Quote
Old 06-30-2014, 02:26 PM   #15
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by DaleDe View Post
I would agree that it would be nice to map the style names directly to a traceable name which would aid fixing or modifying the epub after it is built. But this is not the idea of Atlantis. It is designed to always go back to the source file and fix things. What I do like is that if you override the styles by making a change to an individual paragraph without changing the styles the compiler will pick that up and make a CSS style for it. If you do the same kind of change to several paragraphs it will group them and make a single CSS entry thus it is cleaner for sloppy writers. I chased some of this down but currently try and avoid worrying much about the CSS and just add things if required.

Dale

I just couldn't deal with it. I stared at it once (having used a pre-cleaned Word file, that had Word-styles applied), and was appalled. If you could predict the styles that Atlantis was going to apply--I mean, the names--you could create clips for it, but as you can't...oish.

And, yes, I understand it's not meant to work like Sigil, (i.e., editing in ePUB view) but surely, they have SOME idea that people might want to do that? I guess not, having said it. Too bad, because other than that, which I consider unmanageable (it's like having to map Calibre styles, really), it's not bad at ALL.

Hitch
Hitch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
stylesheet help arethusa ePub 6 07-02-2013 12:03 PM
Link Stylesheet Does Not Appear smallstate Sigil 2 09-20-2012 07:43 AM
How NOT to use a stylesheet? karyan Sigil 12 03-07-2012 12:43 PM
Stylesheet examples? Skitzman69 Sigil 15 09-24-2010 08:24 PM
Where is the stylesheet.css? roger64 Sigil 4 03-23-2010 02:12 PM


All times are GMT -4. The time now is 12:36 PM.


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