View Full Version : stylesheet help


arethusa
06-30-2013, 03:05 PM
I am new to Sigil; attempting to learn it. I started with an epub from calibre, converted from an rtf file. I wanted to break it into chapters and add TOC - the calibre breaks were not at chapter breaks. This worked, but I find that the fonts differ from chapter to chapter, and occasionally within the chapter. I searched Fonts on the forum and came to realize that it is possibly stylesheets that do this, and where I need to make changes. My html knowledge is rudimentary; I hope working with Sigil will change this, but at the moment I don't really understand stylesheets at all.

Two questions - am I right that i need to fix the varied fonts in stylesheets?
Is there a good source explaining stylesheets to a novice?

Thanks

theducks
06-30-2013, 03:35 PM
I am new to Sigil; attempting to learn it. I started with an epub from calibre, converted from an rtf file. I wanted to break it into chapters and add TOC - the calibre breaks were not at chapter breaks. This worked, but I find that the fonts differ from chapter to chapter, and occasionally within the chapter. I searched Fonts on the forum and came to realize that it is possibly stylesheets that do this, and where I need to make changes. My html knowledge is rudimentary; I hope working with Sigil will change this, but at the moment I don't really understand stylesheets at all.

Two questions - am I right that i need to fix the varied fonts in stylesheets?
Is there a good source explaining stylesheets to a novice?

Thanks
This is really an EPUB question so I will move it there (in a bit :D ).

Sigil is just a tool to use. There is nothing different for the CSS or HTML (Except the use of H# tags (to markup) to allow auto TOC generation from the document)

I would suggest starting at http://www.w3schools.com/
We now switch to the EPUB forum :thumbsup:

Notjohn
06-30-2013, 06:01 PM
My style sheet is posted on my blog at notjohnkdp.blogspot.com

(Of course, one must also use the appropriate paragraph and heading tags. I second the motion to look at w3schools.com )

Toxaris
07-01-2013, 03:50 AM
I would advice to use start with the guide of Pablo found here (http://www.mobileread.com/forums/showthread.php?p=1503619#post1503619).

mrmikel
07-01-2013, 07:22 AM
It is also possible that the style information is specified at the start of each file making up the epub. That could account for the different fonts, too.

If it exists at the start of the file, either change it or eliminate it and put all font information in one stylesheet.

Notjohn
07-02-2013, 07:06 AM
It is also possible that the style information is specified at the start of each file making up the epub. That could account for the different fonts, too.

If it exists at the start of the file, either change it or eliminate it and put all font information in one stylesheet.

This regularly happened to me when I saved a Word doc as html, then opened the html in Sigil. (That is, I ended with a style sheet in every chapter and indeed in every image page etc.) Then I developed a file called epub.css that served all my purposes and linked to that instead (<link rel="stylesheet" type="text/css" href="epub.css">). The reduction in file size was noticable.

I love the way Sigil recognizes and "inhales" related files and images.

GMcG
07-02-2013, 01:03 PM
@arethusa
If you have different styles for some paragraphs, you must edit the html file.
First look at the paragraph the style of which you like. Then you look at it in code view. Perhaps this paragraph starts with <p class="calibre2">.
Then you look at a paragraph with a different style. In code view you may see that this parapraph starts with <p class="calibre7"> (or any other number). You simply have to change it into calibre2.
As the epub was created with Calibre, you've got the file 'stylesheet.css'. In Sigil you find it in the Stylesheet folder. If you dont need <p class="calibre7"> any more, you can delete this class. In stylesheet.css it is shown as
.calibre7 {
.
.
.
}

George