Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-15-2022, 03:13 PM   #1
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 770
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
What is page_styles.css for?

I'm assuming the various forms of page_styles.css I'm seeing (page_styles.css, page_styles1.css and page_styles3.css) in my epubs are there from Calibre's conversion process since they're present in every file. Purely out of curiosity, I'm wondering why they're their at all. Invariably, all that's in those files is:

Code:
@page { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; }
and that same bit of styling is also right at the top of stylesheet.css (which is, in general, where all the actual styling information is).
enuddleyarbl is offline   Reply With Quote
Old 07-15-2022, 03:28 PM   #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: 30,919
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Sort of what it says overall PAGE

You are not limited to a single style sheet in a book.
Different sections may have different stylesheets

Pagestyles is the common bit. It may include @fonts
theducks is offline   Reply With Quote
Advert
Old 07-15-2022, 04:33 PM   #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: 79,289
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I do is combine the CSS. I cannot stand multiple CSS files. An omnibus can be really bad in that regard as each book can have it's own CSS. That means each book in the omnibus could be formatted differently instead of done correctly with the same formatting (where possible) for each book.
JSWolf is online now   Reply With Quote
Old 07-15-2022, 05:57 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: 30,919
Karma: 60358908
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
What I do is combine the CSS. I cannot stand multiple CSS files. An omnibus can be really bad in that regard as each book can have it's own CSS. That means each book in the omnibus could be formatted differently instead of done correctly with the same formatting (where possible) for each book.
That is not incorrectly, that is Quick-dirty & LAZY.

Rule #1: If it works... SHIP IT!
theducks is offline   Reply With Quote
Old 07-15-2022, 08:07 PM   #5
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by JSWolf View Post
What I do is combine the CSS. I cannot stand multiple CSS files. An omnibus can be really bad in that regard as each book can have it's own CSS. That means each book in the omnibus could be formatted differently instead of done correctly with the same formatting (where possible) for each book.
Yes, I do the same. I delete the multiple css files then replace the css code in the remainin file with my css code. Then I adjust the html tags in the book to use the new css code.
(Don't forget to relink the new stylesheet which also clears out the redundant entries)

I assume that multiple css files are for human readability, not machine readability.
Karellen is offline   Reply With Quote
Advert
Old 07-15-2022, 10:29 PM   #6
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: 45,227
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
page_styles.css contain @page and @font-face rules. These cannot be applied with selectors therefore they cannot be in a common stylesheet, since different html files might need different values for them. THerefore there is one page_styles.css for every individual HTML file that needs different values for page margins, embedded fonts, etc.
kovidgoyal is offline   Reply With Quote
Old 07-15-2022, 11:16 PM   #7
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
since different html files might need different values for them.
Can I read that as... if I have no need to apply different page_styles.css to different html files, is it acceptable to not use a page_styles.css and combine it into the general stylesheet.css?
Karellen is offline   Reply With Quote
Old 07-15-2022, 11:22 PM   #8
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: 45,227
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre conversion already only uses different page_styles.css files if they are actually needed.
kovidgoyal is offline   Reply With Quote
Old 07-16-2022, 08:33 AM   #9
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 770
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
The odd thing is that I've never seen anything in those page_styles.css files except an @page with all margins 0. Lately, I've been working on reformatting my copies of Rex Stout's "Nero Wolfe" series. Those books contained 2-3 page_styles[n].css files that were always the same (I assume I must have done multiple conversions on them over the years to cause that). Since each file also contained stylesheet.css with all the actual formatting, I just removed the links to the page_styles versions and deleted those files.

EDIT: I think I've figured out what's happened with these. One of the first things I do is use Modify ePub on my books and remove all embedded fonts. I'll bet those fonts were referenced in the page_styles.css file. Once the fonts were gone, the page_styles.css files were left with nothing but the zero-margin @page.

Last edited by enuddleyarbl; 07-16-2022 at 08:41 AM.
enuddleyarbl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Customize viewer css. pygments.css not found drglenn Viewer 2 12-18-2020 04:52 PM
ebook-convert problem with page_styles.css gogu1904 Conversion 4 08-30-2020 03:34 AM
pagestyle.css extra / integrated in stylesheet.css / or not at all? chaot Workshop 14 02-24-2017 11:10 PM
when does calibre add/not add page_styles css cybmole Calibre 5 07-14-2014 03:58 AM
css pseudo elements and adjacent combinators in extra css? ldolse Calibre 2 12-21-2010 05:09 PM


All times are GMT -4. The time now is 05:11 PM.


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