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 12-31-2010, 03:56 AM   #1
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
Formatting, code, simple help needed

I'm trying to produce a book in ePUB format in Sigil (0.3.2) on Mac. I've exported original hard-book file from InDesign CS5 as ePUB file, then opened that in Sigil to edit as it didn't pass the ePUB 1.0.5 validation (of course! It all seemed too good to be true to use IDCS5 in that way).

1. I seem to have trouble reformatting text to either centre or align left - it (usually) works ok and looks ok in Sigil but when I see it on the iPad the formatting is not changing or is changing only some paragraphs.

2. I've discovered some editing powers in the template but I don't understand how to expand the template (say, add text formatting styles) and to apply such expansions to the page code (eg, adding a format for text then where to put it in the code).

3. What do sgc-2, sgc-3, sgc-1, sgc-5 etc etc mean in code? They seem to appear everywhere in the code on every page on almost every line... so i figure they're important.

I'd really appreciate some basic pointers to edit my near-valide ePUBs into shape for iPad. Or can anyone pit me towards a forum or service that can help me? I'm a computer-savvy, willing and capable learner but need to start somewhere. I have almost zero knowledge or experience of code/coding but having spent a week struggling with it and have learned some things and put them into practice.

Btw, I also tried PDFtoEPUB program (on Windows) to produce file but it was even more problematic than the IDCS5 file when I opened and worked with it in Sigil.

Much appreciation in advance for any help offered. Thank you.
panda6855 is offline   Reply With Quote
Old 12-31-2010, 08:27 AM   #2
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,768
Karma: 54401244
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 panda6855 View Post
I'm trying to produce a book in ePUB format in Sigil (0.3.2) on Mac. I've exported original hard-book file from InDesign CS5 as ePUB file, then opened that in Sigil to edit as it didn't pass the ePUB 1.0.5 validation (of course! It all seemed too good to be true to use IDCS5 in that way).

1. I seem to have trouble reformatting text to either centre or align left - it (usually) works ok and looks ok in Sigil but when I see it on the iPad the formatting is not changing or is changing only some paragraphs.

2. I've discovered some editing powers in the template but I don't understand how to expand the template (say, add text formatting styles) and to apply such expansions to the page code (eg, adding a format for text then where to put it in the code).

3. What do sgc-2, sgc-3, sgc-1, sgc-5 etc etc mean in code? They seem to appear everywhere in the code on every page on almost every line... so i figure they're important.

I'd really appreciate some basic pointers to edit my near-valide ePUBs into shape for iPad. Or can anyone pit me towards a forum or service that can help me? I'm a computer-savvy, willing and capable learner but need to start somewhere. I have almost zero knowledge or experience of code/coding but having spent a week struggling with it and have learned some things and put them into practice.

Btw, I also tried PDFtoEPUB program (on Windows) to produce file but it was even more problematic than the IDCS5 file when I opened and worked with it in Sigil.

Much appreciation in advance for any help offered. Thank you.
SGC numbers are Local styling assignments that are made when you use the buttons to style text (excludes headings without additional style).
They appear to be assigned 'on the fly', PER PAGE.
Say on page 1, you FIRST made text bold. SGC-1 might get assigned.
on page 2, you FIRST Centered text. SGC-1 gets assigned

BTW SGC styles can become compounded: Bold, Italic and Centered
It all depends on how/order they were created.

In code view (CV) look at the top, below <Head> you pages SGC styles will show there.

Note: this is why you CAN NOT copy code (CV) that use SGC #'s from one sheet to another, reliably. The Use of the buttons creates the Style(if not exist) AND applies it to the text. Copy only applies a non-existent (or wrong, because it was in use for a different use) style to the TEXT.

(It would be nice if Sigil had a User option to control where Style (button) assignments got done: 1) Sigil default. 2) SGC code added to LAST(in browser list) stylesheet. 3) Buttons get user assigned selector names. (If does not exist, create in LAST Stylesheet) Methods 2 an 3 permit a common style across pages and remover the copy-paste code problem)

Last edited by theducks; 12-31-2010 at 08:28 AM. Reason: typo
theducks is offline   Reply With Quote
Old 12-31-2010, 05:45 PM   #3
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
Thank you, theducks! That explains a LOT of things that I've been experiencing, particularly as i've tried to copy code between books to solve problems. Won't try that again!

I've now read the Sigil How To doc which is great. But it doesn't explain how to add styles eg. if I want to have chapter headings and then subheadings within the chapter, some bold and some normal.
I dont mind using the same format for my 4 books but then I guess I'd have to start with a template in first place that included those 'extra' styles. Is there a base style sheet (is that the 'template'??) for Sigil that includes more styles? And if there is, then how do I apply those styles? Do I go into code mode or do those styles show up in the styles drop-down menu where I presently see heading1, heading 2 etc etc?

Many thanks.
panda6855 is offline   Reply With Quote
Old 12-31-2010, 05:57 PM   #4
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
Hi again, theducks. Another quandary - how do I change font size? Is there a command button I've missed? Or is that done by editing the template?
Many thanks
panda6855 is offline   Reply With Quote
Old 12-31-2010, 07:25 PM   #5
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,768
Karma: 54401244
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 panda6855 View Post
Hi again, theducks. Another quandary - how do I change font size? Is there a command button I've missed? Or is that done by editing the template?
Many thanks
No.
You need to jump into Stylesheets big time

stylesheet (assumes 1 sheet and each page has a reference)
Code:
 .slightlybigger { font-size: 150% }

I use percent (of default). 2em, 24pt are valid
CodeView add or insert after existing selector
Code:
 <h3 class="any_existing slightlybigger"> The heading</h3>
If your page does not have a linked stylesheet, you need a entry like this
Code:
 <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />
just below the <title> tag (the stylesheet names must agree exactly.)

Quote:
Originally Posted by panda6855 View Post
Thank you, theducks! That explains a LOT of things that I've been experiencing, particularly as i've tried to copy code between books to solve problems. Won't try that again!

I've now read the Sigil How To doc which is great. But it doesn't explain how to add styles eg. if I want to have chapter headings and then subheadings within the chapter, some bold and some normal.
I dont mind using the same format for my 4 books but then I guess I'd have to start with a template in first place that included those 'extra' styles. Is there a base style sheet (is that the 'template'??) for Sigil that includes more styles? And if there is, then how do I apply those styles? Do I go into code mode or do those styles show up in the styles drop-down menu where I presently see heading1, heading 2 etc etc?

Many thanks.
See above.
A Style sheet can be a standard way of doing things for a given look.
Why not hop over to Baen Free Library (or any other EPUB site, inc MR) that has a Simple styled EPUB that you like some things about.
Open in Sigil
Now switch to CV. Any time you see class="somename"
Now goto the stylesheet and locate that name
Reverse engineering at it's finest
theducks is offline   Reply With Quote
Old 12-31-2010, 09:37 PM   #6
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
Hi yet again. I'm having problems with alignment. The text I'm wanting to align center uses this in Template:
p.normalcentreblock {
font-family: "Times";
font-weight: normal;
font-style: normal;
font-size: 1em;
line-height: 1.25em;
text-decoration: none;
font-variant: normal;
text-indent: 0em;
text-align: center;
color: #000000;
margin: 0em;

yet it all aligns left instead of centered. And it seems to refuse to change. There seems to be some overriding influence that stops my style working.
Is there a way I can force this template/style onto the paragraph I'm trying to format?

Many thanks
panda6855 is offline   Reply With Quote
Old 12-31-2010, 10:16 PM   #7
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
That's all terrific, thanks. It's going to take me some time to digest it all - I do understand most of what you've said, just need to see it in action now so it sinks in. My main concern is the method of applying the style to the text once I'm in code view - there are so many possibilities as to where exactly to enter the style reference (eg, where would I put class="somename" in my book's code view - before or after the paragraph/s, or both or what?

Many thanks for all this help. Much appreciated.
panda6855 is offline   Reply With Quote
Old 12-31-2010, 11:28 PM   #8
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,768
Karma: 54401244
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 panda6855 View Post
Hi yet again. I'm having problems with alignment. The text I'm wanting to align center uses this in Template:
p.normalcentreblock {
font-family: "Times";
font-weight: normal;
font-style: normal;
font-size: 1em;
line-height: 1.25em;
text-decoration: none;
font-variant: normal;
text-indent: 0em;
text-align: center;
color: #000000;
margin: 0em;

yet it all aligns left instead of centered. And it seems to refuse to change. There seems to be some overriding influence that stops my style working.
Is there a way I can force this template/style onto the paragraph I'm trying to format?

Many thanks
Try sticking a
display: block;
in there

Not that ADE seems to ignore a selector if there is an error.
w3c has a (free) CSS validation service
theducks is offline   Reply With Quote
Old 12-31-2010, 11:44 PM   #9
Danger
Evangelist
Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.
 
Danger's Avatar
 
Posts: 490
Karma: 1665031
Join Date: Nov 2010
Location: Vancouver Island, Nanaimo
Device: K2 (retired), Kobo Touch (passed to the wife), KGlo, Galaxy TabPro
Not sure what you are exactly doing with that but you could probably simplify it to:
p.normalcentreblock {
font-family: "Times"; <-- unless you are embedding fonts, it's not really needed, or use serif
font-weight: normal;
font-style: normal;
font-size: 1em; <-- 1 em is normal font size, not really needed normally
line-height: 1.25em; <-- is this really needed?
text-indent: 0em; <-- only needed if you already indented the p tag
text-align: center;
margin: 0em; <-- not needed unless you set the margin bigger in the p tag
} <-- closing MUST have this, did you just forget to copy/paste or is it missing?

normally I do this:
p {
font-family: serif;
font-weight: normal;
font-style: normal;
font-size: 1em;
text-indent: 1em;
text-align: justify;
padding: 0;
margin: .2em 0 0 0; /*gives a margin of 20% of line height at the top of the paragraph and nothing for right/bottom/left margin */
}

.centertext {
text-indent: 0;
text-align: center;
padding: 0;
margin: 0;
}

then you would have for code:
<p class="centertext">Center this text...blah blah blah</p>

<p>this text is just a normal paragraph and not centered</p>
Danger is offline   Reply With Quote
Old 01-01-2011, 12:27 AM   #10
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
Quote:
Originally Posted by theducks View Post
Try sticking a
display: block;
in there
Where? How? Do you mean EXACTLY that: "display: block;" in total should be pasted into the code somewhere in the stylesheet? At what point? Cna it be added to all the styles in the style sheet?- if makes the document follow the styles then that's what I'd like to do.

Quote:
Originally Posted by theducks View Post
Not that ADE seems to ignore a selector if there is an error.
w3c has a (free) CSS validation service
Sorry but I don't understand... what is ADE? what is w3c?

Many thanks.
panda6855 is offline   Reply With Quote
Old 01-01-2011, 12:28 AM   #11
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
Thanks Danger. I think i understand. But where do I use that code? Where does it get added? Or does it replace other code in the stylesheet?

Many thanks
panda6855 is offline   Reply With Quote
Old 01-01-2011, 01:55 AM   #12
panda6855
Enthusiast
panda6855 began at the beginning.
 
panda6855's Avatar
 
Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
Well I've run out of steam here - tried all I can think of including importing various other formats of the manuscript into Sigil. Have tried applying some of the code adjustments offered, even once totally re-wrote the template code using Danger's simplifications. Even found that importing plain text file of the manuscript rendered inside Sigil with most of the punctuation replaced by black diamonds with white question marks inside.

Nothing working... that is to say, same result consistently - the best I can achieve is most of the internal pages rendering correctly in iPad but still the leading 4 pages - title page, publisher page, dedication etc - all are being forced to left alignment.

I find it amazing that such total changes (as a new template) can be totally ineffectual.

I eagerly await any help offered.

Many thanks.
Happy New Year!
panda6855 is offline   Reply With Quote
Old 01-01-2011, 02:28 AM   #13
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,768
Karma: 54401244
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 panda6855 View Post
Where? How? Do you mean EXACTLY that: "display: block;" in total should be pasted into the code somewhere in the stylesheet? At what point? Cna it be added to all the styles in the style sheet?- if makes the document follow the styles then that's what I'd like to do.
It is a line that should be in your normalcentreblock attributes
What it means is this style id unto itself, rather than a Modification of a master style.

Suppose you had a style "regularpara"
Now I want everything as it was in regularpara EXCEPT I want it Italic

<p class="regularpara makeitalic"> Words </p>

.makeitalic {font-style:italic }
simple, I only modified one attribute and inherited the rest.
Quote:

Sorry but I don't understand... what is ADE? what is w3c?

Many thanks.

is your friend
theducks is offline   Reply With Quote
Old 01-01-2011, 06:23 AM   #14
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
ADE= Adobe Digital Editions

w3c= http://www.w3schools.com/html/default.asp.

At the latter place you can learn about HTML and CSS. They have extensive tutorials about both. The stylesheet is a statement at the top of the HTML page or referred to there which governs how things should be displayed. The W3C pages are very good at explaining these.

How these statements interact with ADE and your reader, even when they are perfectly correct, may expand your mind to the cracking point. Good Luck!
mrmikel is offline   Reply With Quote
Old 01-01-2011, 08:40 AM   #15
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Ummm... W3C is actually the World Wide Web Consortium (="WWWC"="W3C"), the international consortium which oversees the standards and specifications for HTML, CSS, etc. However W3Schools does have good tutorials on these things.
DMSmillie 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
erm, simple question , hope for simple answer! al zymers Amazon Kindle 5 09-25-2010 01:01 PM
Code needed so OI will mark chapters? PKFFW Sigil 4 07-05-2010 06:34 PM
Let's create a source code repository for DR 800 related code? jraf iRex 3 03-11-2010 12:26 PM
Simple question for a simple mind :) PKFFW OpenInkpot 6 08-27-2009 09:00 PM
would someone kindly explain this formatting code Book IMP 2 07-03-2009 10:53 PM


All times are GMT -4. The time now is 09:48 PM.


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