02-18-2011, 09:24 AM | #61 |
Well trained by Cats
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Gah! What a messy convert. (I say this, just from looking at the Calibre numbers assigned.)
<body class="calibre5"> <div class="calibre6"> <h1 class="calibre11" id="calibre_pb_21"><span class="calibre12">ten</span></h1> <div class="calibre13"></div> <p class="calibre10"></p> You did not show The baisic body CSS (calibre5) Then there is the Div (calibre6) Then there is the Heading (calibre11 calibre12) that appear to do the same things differently then there is the div (calibre13) which may have been a HR ar some time (it has a small height value consistent with line thickness) You have Line heights (I rarely use them except in mixed font size cases), margins, empty (no text/image) div's and p's |
02-18-2011, 09:56 AM | #62 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
yes- well blame Amazon & callibre for that, they are the culprits -
I could search for a rael short, simple failed book if you like, but the core issue is that none of the dozens of books I tested will accept overrides of margin after being converted with remove blank lines in calibre. so nitpicking specific examples is not helping any. pls try what I said - pick any book you have and do the 2 step outlined above - tell me if you replicate the issue her is the entire css for the previous example - purists look away now .calibre { display: block; font-size: 1em; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 5pt; margin-top: 0; padding-left: 0; padding-right: 0; page-break-before: always } .calibre1 { display: table-row; vertical-align: middle } .calibre10 { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; text-align: justify; text-indent: 1em } .calibre11 { display: block; font-size: 1.25em; font-weight: bold; line-height: 1.2; margin-bottom: 0.67em; margin-left: 0; margin-right: 0; margin-top: 0; page-break-before: always; text-align: center } .calibre12 { color: windowtext; font-size: 0.9em; font-weight: bold; line-height: 1.2 } .calibre13 { border-bottom: 0; border-top: 0; display: block; height: 4px; margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; text-indent: 1em } .calibre14 { color: black; font-size: 1em; line-height: 1.2 } .calibre15 { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0; margin-left: 24px; margin-right: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; text-align: justify; text-indent: 1em } .calibre16 { color: black; font-size: 1em; font-style: italic; line-height: 1.2 } .calibre17 { font-size: 0.75em; line-height: 1.2; vertical-align: sub } .calibre18 { color: windowtext; font-size: 1em; font-style: italic; line-height: 1.2 } .calibre2 { display: block } .calibre3 { color: white } .calibre4 { display: block; margin-bottom: 0.3em; margin-left: 0; margin-right: 0; margin-top: 0.3em } .calibre5 { display: block; font-size: 1em; line-height: 1.2; margin-bottom: 0; margin-left: 0; margin-right: 5pt; margin-top: 0; padding-left: 0; padding-right: 0; page-break-before: always; tab-interval: 0.2in } .calibre6 { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; text-indent: 1em } .calibre7 { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; text-align: center; text-indent: 1em } .calibre8 { color: windowtext; font-size: 1em; font-weight: bold; line-height: 1.2 } .calibre9 { color: windowtext; font-size: 1em; line-height: 1.2 } .cbjauthor { display: table-cell; font-size: 1em; line-height: 1.2; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: center; vertical-align: inherit } .cbjbanner { -webkit-border-radius: 8px; background: #eee; border: thin solid black; display: block; margin-bottom: 1em; margin-left: 1em; margin-right: 1em; margin-top: 1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; padding-top: 1em } .cbjcomments { display: block; font-family: sans-serif } .cbjcontent { display: table-cell; font-family: sans-serif; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: left; vertical-align: inherit; width: 67% } .cbjfooter { display: block; font-family: sans-serif; font-size: 0.75em; margin-top: 8px; text-align: center } .cbjheader { border-collapse: separate; border-spacing: 2px; display: table; margin-bottom: 0; margin-top: 0; text-indent: 0; width: 100% } .cbjkindlebannerhr { border: 1px inset; border-bottom: 2px solid black; border-left: 0 solid white; border-right: 0 solid white; border-top: 0 solid white; color: gray; display: block; height: 2px; margin-bottom: 0.5em; margin-left: 10%; margin-right: auto; margin-top: 0.5em; width: 80% } .cbjlabel { display: table-cell; font-family: sans-serif; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: right; vertical-align: inherit; width: 33% } .cbjpubdata { display: table-cell; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: center; vertical-align: inherit } .cbjtitle { display: table-cell; font-size: 1.25em; font-style: italic; line-height: 1.2; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; text-align: center; vertical-align: inherit } .italic { font-style: italic } .mbppagebreak { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; page-break-after: always; text-indent: 1em } .metadatadivider { border: 1px inset; border-bottom: solid black 1px; border-left: solid white 0; border-right: solid white 0; border-top: solid white 0; color: gray; display: block; height: 2px; margin-bottom: 0.5em; margin-left: 5%; margin-right: auto; margin-top: 0.5em; width: 90% } .softbreak { border-bottom: 0; border-top: 0; display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; page-break-before: avoid; text-align: center; text-indent: 1em } .title { line-height: 1.2 } |
Advert | |
|
02-18-2011, 03:01 PM | #63 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
It could be me, but in the xhtml code snippet you posted there is no reference to the external stylesheet. It doesn't matter what you put in it then, it will not be used if there is no reference to it.
It should be in the <head> tags. |
02-18-2011, 03:20 PM | #64 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
you lost me there.
afaik I don't have any special external style sheet. just the standard stylesheet.css file i add a book to calibre, convert it to epub with remove blank lines set. then I try to use the extra css function in calibre its just fill in the box & click OK according to the calibre user manual, it's supposed to take what you put in that box & use it as override. sigil is being used here only to view the xhtml & stylesheet in order to understand what is going on. here is a start of xhtml file extract - same book as before Code:
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Soul Identity</title> <link href="../Styles/stylesheet1.css" rel="stylesheet" type="text/css" /> <style type="text/css"> @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } </style> </head> <body class="calibre5"> <div class="calibre6"> <h1 class="calibre11" id="calibre_pb_21"><span class="calibre12">ten</span></h1> <div class="calibre13"></div> <p class="calibre10"></p> <p class="calibre10"><span class="calibre14"><span>It took me a</span> few seconds when I woke up to remember I was in the Soul Identity guesthouse. Val and I had climbed down the hill and returned to the office, where she wasted a few hours giving me demonstrations of her new online applications.</span></p> |
02-18-2011, 03:57 PM | #65 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
What you want is some space above and below the paragraph? If you create a style in the stylesheet like p { margin-top: 0.3em; margin-bottom: 0.3em;} it will not work.
The reason is simple. The paragraph get the style from p and from calibre10. Unfortunately, calibre10 will overrule your desired setting, because there it is specified margin-top: 0 (among others). Your solution could be removing the margin from the calibre settings, or setting the margin correctly in all the calibre settings. Stylesheets are cascading, that's why your setting is overruled. |
Advert | |
|
02-18-2011, 05:12 PM | #66 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
yep - diagnosis is correct but the calibre user guide claims
(extra css)...This option allows you to specify arbitrary CSS that will be applied to all HTML files in the input. This CSS is applied with very high priority and so should override most CSS present in the input document itself. ... bottom line is - it does not work as described i.e. it cannot overrule settings which calibre itself has previously added to style sheet. it was calibre itself which added those specific margin 0 lines e,g, into calibre 10 it does that when you run convert with remove blank lines option enabled. that is easily proved. what we've now established is that calibre gives you a eon way ticket to no-blank-lines-land - the only way back is manual editing of style sheet either by exploding epub or with a program like sigil - most disappointing. Last edited by cybmole; 02-18-2011 at 05:15 PM. |
02-18-2011, 05:49 PM | #67 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Frankly I don't care what the user guide of Calibre claims. Like I said before, I don't like the code from Calibre. For conversion it is ok, but I always cleanup afterwards. All the additional margins in every styles is annoying. It will override almost al settings you made due to the cascading.
I see where the problem arise and you could try to issue a bug to Kovid. For your problem at hand, you can try the following. In sigil open the stylesheet and do a replace of the lines below with nothing. It is not a perfect solution, that would be a total cleanup of code. Remove the following lines in the stylesheet of all classes: Code:
border-bottom: 0; border-top: 0; display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; padding-bottom: 0; padding-top: 0; |
02-19-2011, 02:00 AM | #68 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
interesting - I reckon that is the code which calibre adds when you tick remove blank lines.
pity there's no automated removal method |
02-20-2011, 09:22 PM | #69 | |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
02-20-2011, 09:26 PM | #70 | |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
.calibre10 { display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: justify; text-indent: 1.2em } Now make calibre10a as follows and put in the CSS... .calibre10a { display: block; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; text-align: justify; text-indent: 0 } In the XML, replace calibre10 with calibre10a where you want no indent and you are good for no indents. |
|
02-21-2011, 02:33 AM | #71 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
thanks - I have been doing something similar.
browsing around, I found a java program called epub-tweaker - designed for quick css edits - it's a tad quicker than going via sigil if all you need to do is adjust an indent, or a margin |
02-21-2011, 10:08 AM | #72 |
Well trained by Cats
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Way too much code
in the css Code:
.firstpara { text-indent: 0 } just ADD firstpara AFTER the calibre10 Code:
<p class="calibre10 firstpara">Ipsum ...</p>
B], use it or lose it All yo did was change a single attribute. and tack that OVER the base style Last edited by theducks; 02-21-2011 at 10:10 AM. |
02-21-2011, 10:46 AM | #73 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
I now just use an in-line style statement, as it's easy to add with sigil's find / replace engine ( which retains recent code)
so I find a <p which follows a </h2> and replace e.g. find h2>\s*<p class="calibre2" replace all </h2> <p style "text-indent:0;margin-bottom:0.3em " - ( my preferred line space needs to be in there also ) less neat - but quick to do. the number after calibre varies from book to book. |
02-21-2011, 11:15 AM | #74 | |
Well trained by Cats
Posts: 29,804
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:
It takes a few moments to read the code and 'tune-up' your REGEX. I keep a 'REGEX Notes' (txt) file and paste sample as well as both the terms along with my notes on what it does. Copy and Paste into the S+R boxes, adjust the tags. Fire in the Hole |
|
02-21-2011, 11:58 AM | #75 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
your cascade solution is elegant but it's not clear to dummies like me, from your post exacly how to do it. is cascade part of the solution, or a commentary ? seems that to do it your way I have to add 1 lines or more to my .css ( which I could paste in from one I made earlier ) and then also run a regex I am confused because I read somewhere that you can only have one class per tag, yet you seem to have found a way of having 2 - the calibre class + the firstpara class. how come that works, but adding (in-line) style text:indent 0 where you added firstpara does not work - I am pretty sure I tried doing it in line & it failed , even with all brackets in the correct places. Last edited by cybmole; 02-21-2011 at 12:01 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Indents! Please Help! | Ephraim | Sigil | 8 | 11-23-2010 03:43 PM |
Margins and Indents | sloecoach | Calibre | 2 | 09-26-2010 04:41 PM |
Display of Hanging Indents | crutledge | Workshop | 1 | 09-25-2009 06:09 PM |
RFE: Remove remove tags in bulk edit | magphil | Calibre | 0 | 08-11-2009 10:37 AM |
Hanging indents? | llasram | Kindle Formats | 11 | 01-05-2009 10:59 AM |