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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-18-2010, 12:29 PM   #1
View[+]Finder
Junior Member
View[+]Finder began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2010
Device: iPad
Sigil styles and CSS

What is the relationship between styles in the CSS files associated with an ePbub being edited with Sigil and the sgc-# inline styles that are created by Sigil? I'm authoring/publishing eBooks for the iPad (and other devices) and need to have some control over the "style" as incorporated in the ePub. It seems that Sigil treats each xhtml file differently and the styles it creates have no common name between them. This makes editing more difficult for me.

In particular, I need to have an indented first line for normal <p> with block indented italicized quotations in some places. I did RTFM first and tried using the WYSIWYG tools, but the resulting ePub, while viewable on my iPad, failed the epubcheck 1.0.5 due to numerous "text not allowed" errors.

Great program and thanks for your work!
View[+]Finder is offline   Reply With Quote
Old 05-18-2010, 01:32 PM   #2
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
The style rules in the sgc-# classes are actually in your document already as contents of the style attribute on the XHTML elements, the so-called "inline styles". Since these are deprecated in the specs and also difficult to maintain due to duplication, Sigil (actually embedded HTML Tidy) pulls them out into separate CSS classes with these sgc-# names. The document renders the same.

Sigil basically doesn't touch separate CSS files at all. It's just these inline styles in the XHTML itself that are pulled into a <style> tag (again, it renders the same, this is just easier to maintain and also conforms to the spec).

For the epubcheck errors you'll have to post the epub file. Can't help you blind.
Valloric is offline   Reply With Quote
Old 05-20-2010, 12:10 PM   #3
View[+]Finder
Junior Member
View[+]Finder began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2010
Device: iPad
CSS external sheets

Thanks for your help. I have incorporated my "quote indent italic" style into the external CSS and the inline styles are no longer generated. The ebubcheck problem was solved as well.
View[+]Finder is offline   Reply With Quote
Old 05-27-2010, 03:52 PM   #4
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 519
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
Quote:
Originally Posted by Valloric View Post
The style rules in the sgc-# classes are actually in your document already as contents of the style attribute on the XHTML elements, the so-called "inline styles". Since these are deprecated in the specs and also difficult to maintain due to duplication, Sigil (actually embedded HTML Tidy) pulls them out into separate CSS classes with these sgc-# names.
That's strange. I was editing an epub file with Sigil 0.2.0 and I centered some lines and Sigil did put inline styles in the XHTML file. Like:

Quote:
<style type="text/css">
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; }
h1.sgc-1 {font-weight: bold}
p.sgc-2 {text-align: center;}
</style>
(The p.sgc-2 part was added as result of the editing, the others where there already before my editing.)

This happens in any XHTML file where I do this. I would prefer if Sigil would put these styles in a separate css file, common to all XHTML files, so that global editing of the style becomes easier.
pietvo is offline   Reply With Quote
Old 05-27-2010, 05:39 PM   #5
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by pietvo View Post
That's strange. I was editing an epub file with Sigil 0.2.0 and I centered some lines and Sigil did put inline styles in the XHTML file.
Inline styles means styles applied directly on an element through the "style" attribute.

Styles applied through a "style" element (like what you posted) are not inline styles.

Quote:
Originally Posted by pietvo View Post
This happens in any XHTML file where I do this. I would prefer if Sigil would put these styles in a separate css file, common to all XHTML files, so that global editing of the style becomes easier.
That would be too invasive and also just wouldn't work right. The global CSS stylesheet would grow like crazy and would have to be automatically rewritten as styles are reused/modified in other files. That would mean that any changes you made by hand to that CSS would not necessarily stay that way. it would also involve making massive changes to HTML Tidy.
Valloric is offline   Reply With Quote
Reply

Tags
css, epubcheck, italic, sigil, style

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu Styles shinken Sigil 1 08-27-2010 06:07 AM
Copying Styles Johnmuzy Sigil 2 06-17-2010 12:32 PM
<hr /> styles trstill Introduce Yourself 1 05-30-2010 01:57 PM
Sigil and CSS files crutledge Sigil 6 05-20-2010 09:02 AM
So many styles! roger64 Calibre 3 03-21-2010 08:05 AM


All times are GMT -4. The time now is 07:22 PM.


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