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 06-15-2010, 08:35 PM   #1
december
Nameless Being
 
Weird formatting issues - Sigil .epub in Calibre viewer

All right, I've been beating my head against this for most of the day with no success, so I'm calling in the cavalry - maybe someone here can help! I'm not really sure whether this best classifies as a Sigil or a Calibre problem, but I'll try here first.

Here's my problem: I hand-created an .epub file in Sigil, nothing too fancy - just some chapters and a single stylesheet. Everything looks great in Sigil... but when I try to open the .epub in the Calibre viewer (and subsequently try to convert it to .mobi), it seems to be stripping off all my formatting from my "special" paragraph tags -- any italicized, center-aligned, etc. classes are all made plain and indented on the left, just like my normal paragraphs.

Changing these classes to h1, h2, etc. settings (in other words, replacing a <p class="title"> with an <h2 class="title"> designation) will make the font larger, but doesn't fix the 'stripping' problem (i.e., I just have large text that is still left-aligned and non-italicized).

I've attached the .epub file here in case anyone wants to see the original code. Thanks for any help you can provide!
Attached Files
File Type: epub The Log of a Cowboy_ v3.epub (229.9 KB, 426 views)
  Reply With Quote
Old 06-16-2010, 03:22 AM   #2
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
You put the style code in the CDATA section, which means it gets ignored.

I fixed it for you and also fixed the text-indent problem and a filename issue, but you need to add another selector with text-indent: 0 and use it for the opening paragraphs. (I still use the old version of Sigil so the organisation of the files will be a bit different).
Attached Files
File Type: epub The Log of a Cowboy_ v4.epub (229.2 KB, 407 views)
charleski is offline   Reply With Quote
Advert
Old 06-16-2010, 11:47 AM   #3
december
Nameless Being
 
So that's what 'CDATA' means! It kept auto-inserting itself into any copy/pasted style code so insistently that I just gave up and left it alone, assuming it was something Sigil found important for some reason. (Can you tell it's my first time working with .epub? )

Thank you so much for the help! I will work on the borked selectors and hopefully get this thing working this time.
  Reply With Quote
Old 06-16-2010, 12:00 PM   #4
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 december View Post
So that's what 'CDATA' means! It kept auto-inserting itself into any copy/pasted style code so insistently that I just gave up and left it alone, assuming it was something Sigil found important for some reason.
CSS code in style tags should be within CDATA sections, but regular HTML code should not be. You put your <link> tag within a CDATA section and thus told any conforming XML processor to ignore everything within it.
Valloric is offline   Reply With Quote
Old 06-17-2010, 10:10 AM   #5
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
The weird thing is, the CDATA is not visible in Code view.
pietvo is offline   Reply With Quote
Advert
Old 06-17-2010, 11:35 AM   #6
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
The weird thing is, the CDATA is not visible in Code view.
Tidy probably removed it on load, and for good reason since it contained HTML code.
Valloric is offline   Reply With Quote
Old 06-18-2010, 12:00 AM   #7
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
Tidy probably removed it on load, and for good reason since it contained HTML code.
But it will still be in the ePub file on disk.
The following code:
Code:
  <style type="text/css">
/*<![CDATA[*/
  <link rel="stylesheet" type="text/css" href="../Styles/StyleNovel.css"/>
  /*]]>*/
  </style>
according to the XML definition should be equivalent to:
Code:
  <style type="text/css">
/**/
  &lt;link rel="stylesheet" type="text/css" href="../Styles/StyleNovel.css"/&gt;
  /**/
  </style>
which is quite different from what Sigil shows and apparently interprets. Of course the code above is nonsense.
pietvo is offline   Reply With Quote
Old 06-18-2010, 05:31 AM   #8
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
You mean the CDATA is there before loading, is not there in Sigil, and then reappears when you save the book?
Valloric is offline   Reply With Quote
Old 06-18-2010, 03:33 PM   #9
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
Yes, that's exactly what happens.
pietvo is offline   Reply With Quote
Old 06-18-2010, 04:04 PM   #10
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
I'll have to take a better look at it then.
Valloric 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
Calibre ePub TOC and Sigil salasnet Calibre 3 09-26-2010 05:34 PM
Image AR in Calibre EPUB Viewer Starson17 Calibre 2 08-15-2010 05:58 PM
ePub-Sigil-Calibre-Sony PRS505 dicknskip Calibre 20 06-10-2010 03:58 PM
Book Error In Sigil After Calibre Conversion (from lit to epub) Guns4Hire Sigil 13 03-05-2010 05:02 PM
Formatting issues when converting PDF to EPUB raptir Calibre 2 10-21-2009 10:32 PM


All times are GMT -4. The time now is 03:43 AM.


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