Quote:
Originally Posted by acidzebra
I had to softlink /usr/bin/xmlstarlet to a /usr/bin/xml which the script seems to think is the name of the xmlstartlet program? (I'm on stock FC10, xmlstarlet from standard package repos). No big headache though.
|
In Mandriva it's called xml, I guess I could add a check to use xmlstartlet if xml does not exist.
Quote:
If I use the -S option it won't load my specified stylesheet, instead trying to load default.css - if that doesn't exist it throws an error (circumvented by renaming my style sheet default.css)
|
The script will always try to load "default.css" as a default stylesheet, unless you use the -s option. I recommend placing the file in ~/.epub2pdf/default.css and forgetting about it. You can make it an empty file, if you don't want any rules applied by default.
Quote:
the generated bookmarks seem odd at times.For some Calibre-generated epubs I got a multilevel TOC like
- <book name>
---<author>
------produced by calibre (version)
|
I see... That's due to the way Prince generates the bookmarks. It can be changed with CSS (
see Prince docs), but I don't think there is a universal solution. If the book includes a prince-style, that's where it should do whatever needed to have the right bookmarks. If you have a lot of these Calibre files, it should be possible to add some rules to your default stylesheet disabling the bookmarks for those title items, something like:
[code].calibretitle, .calibreauthor, .calibreversion {
prince-bookmark-level: none;
}[/quote]
... using the correct class names, of course. If you show me a sample file, I'll tell you
Quote:
I had some issues with it ignoring my css and defaulting to the book CSS, but forcing lots of !importants everywhere seems to solve it. Still, I would expect -S to override everything as per your previous post, but that doesn't seem to happen always.
|
I probably wasn't clear enough. Prince considers
three kinds of stylesheet, but we are only concerned about "User" and "Author". "Author" is whatever stylesheets specified in the XHTML+CSS source of the ePUB, which are supposed to be applied by ePUB readers. "User" is what you give in the Prince command-line, that includes stylesheets passed with -s and -S options,
and the prince-style included in the book, if any (because epub2pdf passes this stylesheet as a command-line argument to Prince).
Normally, "Author" styles override "User" styles, but rules with !important change this ("User" rules with !important are stronger than "Author" rules, with or without !important). So if you want to override "Author" styles, you can just have !important in the stylesheet given with -s (or ~/.epub2pdf/default.css).
When the priority of conflicting rules is the same, the last one to be declared takes precedence. So, if your default.css and the book's prince-style are in conflict, the latter wins, because it is passed to the Prince command-line last. Usually you could override it with !important in your default.css, but if it already has !important in the prince-style, it won't do anything. This is the role of the -S option, it passes the stylesheet to the command-line
after the prince-style, so it can override !important rules there. In fact, it's only needed in this case, since in all other cases you can override rules with the -s option.
Another problem is, as Frabjous commented above, that if you specify a font-family (or any other property) for the body element, but the book's stylesheets have another font-family for lower elements (p, div...), the latter take precedende, no matter how !important your rules are. If you want to change it you have to define the font family for these p or div elements (and maybe with the correct class names) in your default.css.