Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-27-2011, 08:05 PM   #1
Themus
Zealot
Themus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-books
 
Posts: 133
Karma: 998
Join Date: Apr 2010
Device: Nook
Change Calibre Sytlesheet

Is it possible to change the style sheet that Calibre generates for a single ePub?

I know you can change the base font, but what I would like to fix is the chapter headings I am getting in one ePub. They are huge by comparison to the rest of the text.

In this light, so is the spacing before them.

I see in Sigil after conversion that the HTML is loaded with Calibre tags like: <h5 class="calibre2">

Is there a way I can edit the style "Calibre2" for example? Is there a way to edit the style of a heading after conversion or set it before conversion.

The was a public domain book in AZW format.

I hope I am being clear. Sigil allows me many options, and it seemed I could edit the style sheet - once. After wards it would not let me edit it again.

Any thoughts would be appreciated as always.
Themus is offline   Reply With Quote
Old 11-27-2011, 08:41 PM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Calibre does not use or add it's own style sheet. What it does is normalize the existing styles from the input. In this case editing with Sigil is the easiest way to fix the issues you're having this this particular book.
user_none is offline   Reply With Quote
Old 11-28-2011, 07:54 PM   #3
Themus
Zealot
Themus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-books
 
Posts: 133
Karma: 998
Join Date: Apr 2010
Device: Nook
Thanks for your assistance

With Sigil open to my ePub, I see the stylesheet.css to edit, but how do I cross-reference the heading1, heading2 in Sigil's left, upper window, with the Calibre1, Calibre2 as displayed in the stylesheet opened in Sigil.

I see where I can change the top margin, but knowing which heading ties in with heading1 is where I am at a loss.
Themus is offline   Reply With Quote
Old 11-28-2011, 08:02 PM   #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 Themus View Post
Thanks for your assistance

With Sigil open to my ePub, I see the stylesheet.css to edit, but how do I cross-reference the heading1, heading2 in Sigil's left, upper window, with the Calibre1, Calibre2 as displayed in the stylesheet opened in Sigil.

I see where I can change the top margin, but knowing which heading ties in with heading1 is where I am at a loss.
everything in the stylesheet that starts with a dot (.) will be tied to a class= statement in code View (Sigil)

ex.
<h3 class="calibre72">A weird chapter</h3>

adjusting the style: .calibre72 will affect ALL places that have class="calibre72"

You can make new classes (both places) if not all places used are to be changed.

(there are more tricks of the trade once you get comfortable
theducks is offline   Reply With Quote
Old 11-29-2011, 01:09 AM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Themus View Post
With Sigil open to my ePub, I see the stylesheet.css to edit, but how do I cross-reference the heading1, heading2 in Sigil's left, upper window, with the Calibre1, Calibre2 as displayed in the stylesheet opened in Sigil.

I see where I can change the top margin, but knowing which heading ties in with heading1 is where I am at a loss.
Change to code view and you can easily see what classes are used for h1, h2 etc...

FYI there is a Sigil forum where more experienced users of Sigil exist to answer these questions.
DoctorOhh is offline   Reply With Quote
Old 11-30-2011, 09:19 AM   #6
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
Themus, have you tried Calibre's built-in epub editor? I find it the simplest, most convenient way to make tweaks to epubs and CSS sheets. It's what I use to delete embedded Charis fonts as well as xml files which can screw up formatting on my Sony reader, fix metadata TOC errors, and adjust margins and font sizes in the css file.

I used to use Sigil more, but ever since Calibre added the "Tweak Epub" feature, I only use Sigil if there needs to be extensive editing to the book's text itself. I think the tweak epub feature is one of Calibre's best assets.

Once Calibre "explodes" the epub for editing, you can use the excellent and free Notepad++ utility to do the actual edits to the epub's exotic file types (css, opf, toc, etc).

Last edited by PatNY; 11-30-2011 at 09:26 AM.
PatNY is offline   Reply With Quote
Old 12-01-2011, 04:35 PM   #7
BeccaPrice
Wizard
BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.
 
BeccaPrice's Avatar
 
Posts: 2,145
Karma: 11174187
Join Date: Jan 2011
Device: Sony 350, K3-3G, K4SO, KPW
I am so new at this - how do you access the Tweak Epub feature in Calibre?

I'm afraid to play too much with it, for fear I'll break something.
BeccaPrice is offline   Reply With Quote
Old 12-01-2011, 05:15 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,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 BeccaPrice View Post
I am so new at this - how do you access the Tweak Epub feature in Calibre?

I'm afraid to play too much with it, for fear I'll break something.
Preferences:
It is near the bottom:


Backup your Calibre settings folder before you start.
A quick restore (just replace the damaged contents.
Calibre must be shut down.

Last edited by theducks; 12-02-2011 at 11:00 AM. Reason: My bad. wrong tweak
theducks is offline   Reply With Quote
Old 12-01-2011, 09:44 PM   #9
BeccaPrice
Wizard
BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.
 
BeccaPrice's Avatar
 
Posts: 2,145
Karma: 11174187
Join Date: Jan 2011
Device: Sony 350, K3-3G, K4SO, KPW
Under the Advanced heading, I see one called Tweaks - is that the one you mean? I didn't see anything called Tweak Epub. (I'm using Windows 7 and the most current release of Calibre - 8.28, I think it is)
BeccaPrice is offline   Reply With Quote
Old 12-01-2011, 09:54 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Right click on the book you want to Tweak and select Tweak EPUB. Or just select the book and press the T key.
kovidgoyal is offline   Reply With Quote
Old 12-01-2011, 09:59 PM   #11
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by BeccaPrice View Post
Under the Advanced heading, I see one called Tweaks - is that the one you mean? I didn't see anything called Tweak Epub. (I'm using Windows 7 and the most current release of Calibre - 8.28, I think it is)
Right click on any book and "Tweak ePub" will be an option in the context menu.
DoctorOhh is offline   Reply With Quote
Old 12-02-2011, 10:57 AM   #12
BeccaPrice
Wizard
BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.
 
BeccaPrice's Avatar
 
Posts: 2,145
Karma: 11174187
Join Date: Jan 2011
Device: Sony 350, K3-3G, K4SO, KPW
oh! thank you - I was looking on the Preferences menu. I've got a sample text file I've created that I use to play with new features - I think I'll play with it some more now.
BeccaPrice is offline   Reply With Quote
Old 12-02-2011, 03:09 PM   #13
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
Becca, yes the Tweak ePub feature is available right from the main Calibre window under the right-click context menu when you select a book. It's so handy to have.

I notice you have a PRS-350 also. If you ever have issues with a cover not showing up on the Sony reader (and it shows up fine everywhere else), it could be an xml file in the epub. Simply delete it and the cover shows up fine (though you'll have to do another epub-to-epub conversion in Calibre first after deleting it). The file will be called something like roadmap.xml or cover.xml. I always delete it now using Tweak ePub before I do any conversions.

Another file which plays havoc with the Sony reader is the xpgt file. It will set spacing and margins on the reader that you can't fix by simply tweaking the css file. Delete the xpgt file and problem solved.

I also routinely delete all embedded charis fonts in my epubs as I have the Boroda custom firmware installed on my reader which lets me use a set custom font.

So far I have not seen any detrimental effects to my epubs by deleting these files. And it appears many readers (Stanza, Calibre's own reader) routinely ignore xml and xpgt files anyway since the issues they cause on my Sony reader do not appear in those other places.

Oh, and to be safe, back up your epub before using the Tweak ePub feature for the first time.
PatNY is offline   Reply With Quote
Old 12-03-2011, 12:31 PM   #14
BeccaPrice
Wizard
BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.BeccaPrice ought to be getting tired of karma fortunes by now.
 
BeccaPrice's Avatar
 
Posts: 2,145
Karma: 11174187
Join Date: Jan 2011
Device: Sony 350, K3-3G, K4SO, KPW
Quote:
Originally Posted by PatNY View Post
Oh, and to be safe, back up your epub before using the Tweak ePub feature for the first time.

oh, yeah! I so very much don't know what I'm doing (yet) that I back up everything. sometimes twice.

Next term, I'm taking a beginning class on CSS and HTML - with luck what looks like gibberish to me now will make sense shortly.
BeccaPrice is offline   Reply With Quote
Old 12-05-2011, 09:03 PM   #15
Themus
Zealot
Themus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-books
 
Posts: 133
Karma: 998
Join Date: Apr 2010
Device: Nook
Thank you everyone for responding. I have used the Tweak ePub on the text portions and with Notepad++. Tonight I did examine the styles sheet.

There of course is a learning curve in all this and digesting what syntax does what and where.

Calibre is top-notch and really the best ePub application I know of. Sigil is up there too in it's own right.
Themus 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 language change? mago55 Calibre 8 11-16-2020 01:49 AM
Change Margins With Calibre Jafo Conversion 19 04-19-2011 08:39 PM
Which format does Calibre change to ePub best? ksmith100056 Barnes & Noble NOOK 20 01-02-2011 01:31 PM
Calibre Look Change? Rand Brittain Calibre 11 11-15-2010 06:41 PM
Calibre-How do I change my device? LateMommy General Discussions 2 06-28-2010 10:05 AM


All times are GMT -4. The time now is 01:40 PM.


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