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 11-13-2011, 06:51 AM   #1
kamanza
Zealot
kamanza began at the beginning.
 
Posts: 115
Karma: 10
Join Date: Jan 2011
Device: none
assigning styles to headings

Being a newbie, i ask many silly questions. Here is one:
Is it possible in Sigil to assign particular styles from the stylesheet to each heading instead of doing it manually in the code view? I could not find it in the user manual.
Thanks for the help.
kamanza is offline   Reply With Quote
Old 11-13-2011, 07:21 AM   #2
mncowboy
Wanderer
mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.mncowboy ought to be getting tired of karma fortunes by now.
 
mncowboy's Avatar
 
Posts: 106
Karma: 472218
Join Date: Jan 2011
Device: Kindle 3, PaperWhite 2
In book view you can assign headings to the text (h1, h2, etc.)
This will assign any formatting you have in the stylesheet for the headings.
You will have to open the stylesheet (.css) file in code view to change the styles for the headings.
mncowboy is offline   Reply With Quote
Advert
Old 11-13-2011, 09:35 AM   #3
kamanza
Zealot
kamanza began at the beginning.
 
Posts: 115
Karma: 10
Join Date: Jan 2011
Device: none
What i don't know is how to write code for headings in .css. When i open .css there are only styles for the text (calibre; calibre1; calibre2; etc.). No mention of the headings.
kamanza is offline   Reply With Quote
Old 11-13-2011, 10:34 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by kamanza View Post
What i don't know is how to write code for headings in .css. When i open .css there are only styles for the text (calibre; calibre1; calibre2; etc.). No mention of the headings.
Those are existing selectors. (Note these selectors start with a DOT in the CSS and will be used with class="selectors_name" in the book)
Example (from experience ) .calibre (or .calibre3) is typically used in the body tag within the book
Code:
<body class="calibre" >
Note: a specific calibre# only applies to THIS book (and maybe only to THIS section with a really crappy source. if you see calibre# greater than 30 you have a garbage source that will need TLC to really clean.)


OK back to your problem.
If a selector exists (look at your books headings in CV ) in the CSS, you can just use it in the book, elsewhere.
if it does not exist, roll your own.

ADE on my PEz does not automatically center headings(as expected HTML should), so I create a selector:
Code:
.chapterno {
     text-align: center;
     text-indent: 0;
    /* any other chapter header styling here */
     }
--- 
and I use it:
<h3 class="chapterno">Chapter 42: <br />Life, the Universe and Me</h3>
theducks is offline   Reply With Quote
Old 11-13-2011, 11:35 AM   #5
kamanza
Zealot
kamanza began at the beginning.
 
Posts: 115
Karma: 10
Join Date: Jan 2011
Device: none
Evidently, i did not formulate my question clearly enough; what i would like to be able to do is to assign specific & distinct styles to each one of the tags (h1, h2, etc.), using existing styles (calibre1, 2, etc.), so that when i use the heading selector, Sigil would automatically use the proper style and not the style from the source.
kamanza is offline   Reply With Quote
Advert
Old 11-13-2011, 01:53 PM   #6
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
I understood what you wanted and no, not at this moment. You can only select a subset of standard styles.
Toxaris is offline   Reply With Quote
Old 11-13-2011, 02:22 PM   #7
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
Posts: 5,883
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
Cool assigning styles to headings

Quote:
Originally Posted by Toxaris View Post
I understood what you wanted and no, not at this moment. You can only select a subset of standard styles.
i've been wanting that ability too. so where can you select from these subsets and do they have a center parameter included in any of them, and if so can you save that change as a default

Last edited by alansplace; 11-13-2011 at 02:25 PM. Reason: reword
alansplace is offline   Reply With Quote
Old 11-13-2011, 02:26 PM   #8
kamanza
Zealot
kamanza began at the beginning.
 
Posts: 115
Karma: 10
Join Date: Jan 2011
Device: none
Thanks for all the help, it looks like i'll have to continue doing it manually.
kamanza is offline   Reply With Quote
Old 11-13-2011, 05:36 PM   #9
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,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by kamanza View Post
Thanks for all the help, it looks like i'll have to continue doing it manually.
@kamanza:

I think you didn't understand the answer. You simply assign the style to the h1, h2, etc. tags IN YOUR STYLESHEET, and it happens auto-magically--see the reply that Ducky gave you. You don't have to go through manually; that's what stylesheets (embedded or external) are for.

Edited to add:
P.S.: you might try Jutoh, which is a word-processing-like ePUB-maker, more in line with what you want, I think.

It occurs to me that once these questions stop being about Sigil and start being about coding we need a way to move them to the appropriate forum, where folks could get more help on these types of basic items, like the ePUB forum. JS, whatcha think?

Hitch

Last edited by Hitch; 11-13-2011 at 05:47 PM. Reason: Added info about Jutoh
Hitch is offline   Reply With Quote
Old 11-14-2011, 04:41 AM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Basic CSS+HTML.

Say your CSS has a style that says:

Code:
.calibre1 { color: red }
and now you want that style to apply to all <h1> elements too, i.e., you want all your <h1> to be red. You can either manually add the "calibre1" class to all your <h1>:

Code:
<h1 class="calibre1">Chapter 1</h1>
or add the h1 selector to the style:

Code:
.calibre1, h1 { color: red }
(the latter means that "color: red" applies to anything with class="calibre1", and to every <h1>.)

Of course, if you don't have anything with class="calibre1", you can just remove it and leave the style for h1 only:

Code:
h1 { color: red }
Jellby 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
Chapter Headings Paxman53 Conversion 3 10-12-2011 12:31 PM
Why H1 and H2 Chapter Headings? Ransom Calibre 11 08-10-2011 04:29 PM
Shortcut for Headings? elmago79 Sigil 1 07-04-2011 07:48 PM
Nested headings? crich70 Sigil 20 04-11-2011 10:44 AM
Different font for headings bremler ePub 4 03-11-2010 06:03 AM


All times are GMT -4. The time now is 07:10 AM.


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