Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 01-30-2018, 12:06 AM   #1
birkmaggs
Connoisseur
birkmaggs began at the beginning.
 
birkmaggs's Avatar
 
Posts: 77
Karma: 10
Join Date: Apr 2014
Device: galaxy 2
Assigning custom style sheets to a particular book

Is there a way to create a style sheet for a book and permanently assign it to that book such that the custom styles load automatically when the book loads?
birkmaggs is offline   Reply With Quote
Old 01-30-2018, 12:39 AM   #2
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,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Open it in the editor and copy paste your stylesheet at the bottom of its existing stylesheet.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-30-2018, 05:22 AM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
How do you know your custom style sheet will actually work with that book? Are you sure all the class names your sheet is using will exist in the style sheet of this book?
JSWolf is offline   Reply With Quote
Old 01-30-2018, 09:55 AM   #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,785
Karma: 54830978
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 JSWolf View Post
How do you know your custom style sheet will actually work with that book? Are you sure all the class names your sheet is using will exist in the style sheet of this book?
+1
Why do people assume that a Their Generic stylesheet will line up?
The only case would be for / applied to bare tags: <p>,<div>,<h3>...

In addition to replacement as suggested by Kovid.
You can ADD a second (or more) stylesheet to the book and LINK them to selected files, using the editors right-click in the filelist, menu.
Remember that any sheet not linked at that time, will be UN-linked from those files.
theducks is offline   Reply With Quote
Old 01-30-2018, 03:29 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What you are best to do is to load the eBook into the editor and remove all unused CSS. The have a look at the CSS and make changes as you want.
JSWolf is offline   Reply With Quote
Advert
Old 01-30-2018, 08:45 PM   #6
birkmaggs
Connoisseur
birkmaggs began at the beginning.
 
birkmaggs's Avatar
 
Posts: 77
Karma: 10
Join Date: Apr 2014
Device: galaxy 2
Quote:
Originally Posted by kovidgoyal View Post
Open it in the editor and copy paste your stylesheet at the bottom of its existing stylesheet.
This worked well thank you. However, as someone mentioned above, you have to remember to LINK the style sheet to the all the html files by selecting them and right clicking.
birkmaggs is offline   Reply With Quote
Old 01-30-2018, 08:46 PM   #7
birkmaggs
Connoisseur
birkmaggs began at the beginning.
 
birkmaggs's Avatar
 
Posts: 77
Karma: 10
Join Date: Apr 2014
Device: galaxy 2
Quote:
Originally Posted by theducks View Post
+1


In addition to replacement as suggested by Kovid.
You can ADD a second (or more) stylesheet to the book and LINK them to selected files, using the editors right-click in the filelist, menu.
Remember that any sheet not linked at that time, will be UN-linked from those files.
Thank God you mentioned this because I would have spent HOURS trying to figure this out.
birkmaggs is offline   Reply With Quote
Old 01-30-2018, 09:24 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,785
Karma: 54830978
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 birkmaggs View Post
Thank God you mentioned this because I would have spent HOURS trying to figure this out.
No prob. When I joined the crowd here, I had only done the most basic of HTML (no stylesheet back then). Lots of reverse engineering done
theducks is offline   Reply With Quote
Old 02-01-2018, 06:48 PM   #9
birkmaggs
Connoisseur
birkmaggs began at the beginning.
 
birkmaggs's Avatar
 
Posts: 77
Karma: 10
Join Date: Apr 2014
Device: galaxy 2
I build websites so style sheets I have been familiar with for a while. It's a drag when you start out, but it gets fun when you realize how much you can do.
birkmaggs is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Q2: (Bug?) Import Style sheets phossler Editor 20 01-07-2014 05:00 PM
Style Sheets in Calibre jerrywat Conversion 1 09-07-2012 01:35 PM
SVG style sheets in EPUBs Chang ePub 11 02-24-2012 09:41 AM
style sheets bramwell1922 Sigil 11 11-16-2011 03:05 PM
Sigil Style Sheets crutledge Sigil 3 10-06-2010 08:48 AM


All times are GMT -4. The time now is 10:18 PM.


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