![]() |
#1 |
Member
![]() Posts: 15
Karma: 10
Join Date: Jul 2012
Device: kobo
|
Stylesheets
Yet another newbie question re, stylesheets. What I'm not understanding is how to create and make use of a stylesheet. Although very experienced in other aspects of computing, this is my first attempt at html / stylesheets, etc. What I'm not getting is the logic behind it all. I've tried working through w3schools tutorials but they are geared to making web pages, not ebooks.
What I have done so far is create a document in Libre Office using as little formatting as possible. Then save that as an .html file. Then open that in Sigil. This story contains some short poems that I want single spaced. Seems everything in Sigil is doublespaced. The only way I've manged to accomplish this is to go into code view and change the tags 'by hand'. Sigil shows a folder called 'Styles' on the left panel. It is empty. An option to 'add blank stylesheet. Logically, it seems I would do that and type in the html code that would make the poems single spaced. Then somehow, make that code show up only where I want the lines single spaced. So, is it normal that when you create a doc and open it in Sigil that there is no stylesheet? Do I create that stylesheet in something like notepad and import it? Or using Sigil's option to create a blank stylesheet? Please feel free to correct me where I'm using the wrong wording or logic. You can refer to my post on single space here: http://tinyurl.com/p8jkd6v but please don't offer any more tags. That's not the problem. My problem is how to create and execute a stylesheet. |
![]() |
![]() |
![]() |
#2 |
Imperfect Perfectionist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 645
Karma: 863576
Join Date: Dec 2011
Location: Ølstykke, Denmark
Device: none
|
You really should study the Sigil user guide here
Sigil guide You'll also find something about stylesheets and linking them in Sigil there. Regarding your question elsewhere on this forum ("No space ...") - if nothing but <br /> works, it's probably because you're not linking the stylesheets correctly. Hitch's code actually works! ![]() Regards, Kim Last edited by elibrarian; 10-26-2014 at 12:43 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 972
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-T2, Kindle Paperwhite 11th gen
|
Have a look at my ePub tutorial (see my signature). You may find it useful, although it's quite basic and a little outdated as regards as Sigil.
|
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,020
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Stylesheets (CSS) are just another file in plain text.
1) You can, as you discovered, create an empty one in Sigil and enter the Style code. ![]() ![]() ![]() 1b)You can move the (CONTENTS of the <styles> section to the stylesheet (remember to link the stylesheet back to that document file) 2)You can import (Add Existing) if you are working with (x)HTML export. (DOC does not use a CSS) or have a standard coding Note stylesheets must contain the styles used in the document (there can be extras, those can be cleaned out in the end. (Tools: Delete unused styles) |
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 697
Karma: 150000
Join Date: Feb 2010
Device: none
|
Let me add my sincere recommendation that you read Pablo's tutorial! Not only will it give you a basic grounding in how to put together an epub, it will also be useful as a basis when you go through the WCC tutorials. Not to mention, helping you understand WHY you might want to do some of the things covered in the Sigil manual.
And since I see you are using Libre Office, I advise you to check out the "writer to latex" and "writer to epub" plugins. Don't install them as-is. They won't work on modern versions of LibreOffice or OpenOffice. But the package contains a stand-alone java program that can convert a LibreOffice .odt file to an epub (not for the faint-hearted, I admit). But if you are in any sense a coder, you will find adequate documentation in the zip file to set yourself up to convert your .odt document to an epub that has very clean code, and is easy to polish in Sigil. Edited to add: If you take that route (writer2latex.jar), you should make sure that EVERY paragraph in your .odt file has an assigned "Paragraph Style," and every string of characters that is not ordinary (e.g. italic, or bold, or both) within a paragraph has an assigned "character style." Then make sure that every such style has an associated CSS style in the <custom>.xml configuration file. (Do not fear. The documentation should make this clear, how it works.) Good luck! Albert Last edited by st_albert; 10-26-2014 at 09:56 PM. Reason: afterthought |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Maybe this kind of newbie-thread (in so far as css is concerned) is the right one for my problem:
I have a text with notes (adjoint to the relative chapters). I added a ".notes"-paragraph style to make the notes look a bit different from the "normal" text (it is from Project Gutenberg). O.k., this worked. There are some notes with citations from other books, esp. poems, and I wanted to emphasize them a bit within the notes. So I added a ".cite" class with larger margin-left and smaller margin-top and margin-bottom. Code:
p { display: block; font-size: 1em; line-height: normal; margin-bottom: 0.3em; margin-top: 0.3em; text-indent: 1em; text-align: justify } .noindent { display: block; font-size: 1em; line-height: normal; margin-bottom: 0.3em; margin-top: 0.3em; text-indent: 0; text-align: justify } .notes { display: block; font-size: 1em; font-style: italic; line-height: normal; margin-bottom: 0.3em; margin-top: 0.3em; margin-left: 2em; text-indent: 0; text-align: justify } .cite { display: block; font-size: 1em; font-style: italic; line-height: normal; margin-bottom: 0.1em; margin-top: 0.1em; margin-left: 4em; text-indent: 0; text-align: left } - the text was not italic, - left margin took no effect, - instead of smaller margins, they became larger (top and bottom), not only in relation to the preceeding ".notes"-class, but also in relation to a preceeding ".cite"-class. Any trial to change the settings of the ".cite"-class had no effect at all. Okay, I could apply the normal ".notes"-class and work with <br />, but I would really like to know what was going wrong. Anybody who could explain it to me? I s this perhaps a Sigil problem? |
![]() |
![]() |
![]() |
#7 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,020
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Right-click the sheets name in the list and validate. line-height: normal; is what caught my eyeball I use line-height: 1.2; (no units) when NEEDED at the P/H level (usually because of mixed sizes in the block) Another thing that caught my eye (not an error): Justified Poetry?? |
|
![]() |
![]() |
![]() |
#8 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Quote:
![]() Quote:
Quote:
Thank you for your hints, anyway! ![]() |
|||
![]() |
![]() |
![]() |
#9 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,020
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
P or H# type tags
<h3 class="foo" <<< Click anywhere on the line Click the P button (near all the H# buttons on the toolbar) the tags change from h3 to p the class remains |
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,054
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
This sounds interesting; I didn't know about that yet.
What did I learn? Put some superfluous question in this (really great) forum, and you'll receive totally new informations anyway. Thank you! |
![]() |
![]() |
![]() |
#11 |
Member
![]() Posts: 15
Karma: 10
Join Date: Jul 2012
Device: kobo
|
Thanks to all of you for what looks like some very useful replies. It'll take me awhile to work through all this, but I'm watching the post daily.
elibrarian, I've read the excellent Sigil guide and I've found it very well written for other aspects, the stylesheet section is way too general for a beginner. Pablo: have downloaded your tutorial. Looks like what I need. Thxs. st_albert: I tried 'writer to epub' plugin a couple of years ago when I really didn't have a clue. Thxs to your post, I will try it again. Just thought with Sigil, I wouldn't need something like that. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom CSS Stylesheets for Calibre's Viewer | Ralob | Viewer | 389 | 11-24-2024 11:10 AM |
error in linking stylesheets | eschwartz | Editor | 3 | 01-09-2014 02:25 AM |
Validate Stylesheets opens with ADE | Moonraker | Sigil | 3 | 11-05-2012 09:56 AM |
Alternate stylesheets | Jellby | ePub | 1 | 08-19-2011 06:44 PM |
User stylesheets for ePub files | salty-horse | Sony Reader Dev Corner | 12 | 02-23-2010 07:44 AM |