![]() |
#1 |
Enthusiast
![]() 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. |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
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 |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() 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. |
![]() |
![]() |
![]() |
#4 |
Enthusiast
![]() 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 |
![]() |
![]() |
![]() |
#5 | ||
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
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> Code:
<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" /> Quote:
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 ![]() |
||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Enthusiast
![]() 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 |
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() 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. |
![]() |
![]() |
![]() |
#8 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
display: block; in there ![]() Not that ADE seems to ignore a selector if there is an error. w3c has a (free) CSS validation service ![]() |
|
![]() |
![]() |
![]() |
#9 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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> |
![]() |
![]() |
![]() |
#10 | |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Dec 2010
Device: iPad
|
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:
Many thanks. |
|
![]() |
![]() |
![]() |
#11 |
Enthusiast
![]() 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 |
![]() |
![]() |
![]() |
#12 |
Enthusiast
![]() 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! |
![]() |
![]() |
![]() |
#13 | ||
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
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:
![]() |
||
![]() |
![]() |
![]() |
#14 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
#15 |
Enquiring Mind
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |