03-07-2011, 03:44 AM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
another no indent for 1st para question
this book code is achieving the "no indent in 1st para" effect but I cannot suss the mechanism. it has the same styling as other paras. (the added calibre2 style is simply "block")
is it something to do use of new line for 1st line text ( which confusingly seems to have added space at start of line in html) ?? Code:
.....>1. Sorpen</h1> <p class="western1"><br class="calibre2" /> The level was at his top lip now. Even with his head pressed hard back against the stones of the cell wall his nose was only just above the surface. He wasn't going to get his hands free in time; he was going to drown.</p> <p class="western1">In the darkness of the cell.... 1. Sorpen [no indent appears here]The level was at his top lip now. Even with his head pressed hard back against the stones of the cell wall his nose was only just above the surface. He wasn't going to get his hands free in time; he was going to drown. [1 em indent appears here ]In the darkness of the cell, in its stink and warmth... .calibre2 { display: block } .western1 { border-bottom: 0; border-top: 0; display: block; font-family: "Times New Roman", serif; font-size: 1em; line-height: 1.2; margin-bottom: 0.3em; margin-top: 0; orphans: 2; padding-bottom: 0; padding-top: 0; text-indent: 1em; widows: 2 } PS what do widows & orphans settings in style do, in an ebook - are they redundant ? google tells me they are (paper) pagination controls Last edited by cybmole; 03-07-2011 at 03:54 AM. |
03-07-2011, 04:06 AM | #2 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Widows and Orphans should prevent that single lines will be on one page or another. In ePub it usually means that that if one line of the paragraph is on the next page, more lines are moved to the next page. There was a thread about that not long ago.
Your problem could be the result of the <br /> inside the same paragraph. If you want a line to appear before the paragraph or after the header, why not solve it with margins? Add a margin-bottom to the <h1> style in CSS or a margin-top to the <p>, perhaps even creating a special class for it, like this: Code:
p.initial { margin-top: 1em; } |
Advert | |
|
03-07-2011, 04:34 AM | #3 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
my "problem " is simply that i don't understand how the no-indent is being achieved with this code. the 1st para style - western1 has 1em indent, yet the 1st line of text appears not indented. that is what I do no understand.
I do know how to do no-indent 1st para in other ways we had a very long thread on the topic recently.- this book seems to use a different solution - that's all. |
03-07-2011, 06:11 AM | #4 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
It's because of the <br> tag that's on the first paragraph, the line is breaking, so then the rest of the text has no indent.
Edit: As you would do for some poetry/list etc. Either remove <br> tag or add a few chars before it and you'll see that the indent is there, but the line as it stands is blank. Last edited by Perkin; 03-07-2011 at 06:14 AM. |
03-07-2011, 07:11 AM | #5 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
ok thanks- so 1 simple way to edit a book to remove indents from only 1st paragraphs is to just add <br> at start of each 1st line - that seems much easier than the methods discussed in the previous long thread ?
I tried it on a different, random, book & it works fine. Last edited by cybmole; 03-07-2011 at 07:27 AM. |
Advert | |
|
03-07-2011, 10:34 AM | #6 |
Guru
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Only trouble then is there's an extra line of blank space above each paragraph you do it to.
As it's usually first par, it shouldn't matter that much. As long as you're happy with results, go whichever way you like. |
03-07-2011, 11:25 AM | #7 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
I often tweak the amount of space around headers anyway, so that's no big deal.
what I like about this <br> solution is it's relative simplicity - no need to go to css & define a new noindent style. |
03-11-2011, 06:33 PM | #8 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
|
|
03-11-2011, 09:42 PM | #9 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
03-12-2011, 02:48 AM | #10 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
sure - but I added it here so that the thread had complete info, in case others followed my lead & then wondered why it did not convert into mobi OK.
I will have to revert to defining a separate non-indent style - that approach converts OK. luckily I'd only tweaked a couple of books using the <br> tag, before noticing the issue. I find your "mobi does not support CSS" statement misleading. I'm sure you are technically correct, but it is "supported" in the sense that books can be created/edited in sigil using css styles then converted to mobi in calibre & the styling will carry over into mobi equivalents. |
03-12-2011, 04:02 AM | #11 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
No, the statement is absolutely true. Mobi does not support CSS in any form whatsoever. What's happening is that some of the Mobi creation tools - including Calibre and Mobi Creator - will convert CSS into the equivalent Mobi tag attributes, but that doesn't mean that the resulting Mobi files has CSS: it categorically does not.
|
03-12-2011, 05:38 AM | #12 |
frumious Bandersnatch
Posts: 7,539
Karma: 19001081
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
... and I believe the "trick" should work in mobi fine. The following mobi code would give no visual indent, as far as I know:
Code:
<p><br>This paragraph has no indent.</p> Code:
<p width="0">This paragraph has no indent.</p> |
03-12-2011, 07:09 AM | #13 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
well it didn't seem to work for me - viewing the epub ( before) and the mobi ( after) versions with calibre viewer - the epub has no 1st indent but the mobi has. I tried it twice with 2 different books. I initially spotted it after sending book to kindle - I thought maybe I'd messed up conversion or copied an older version so I backtracked & double checked.
building & converting a short test file would prove for definite what is happening |
03-12-2011, 08:07 AM | #14 |
frumious Bandersnatch
Posts: 7,539
Karma: 19001081
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
It's possible that the mobi converter or reader does not like a <br> just at the beginning of a paragraph, try this:
Code:
<p> <br>This paragraph has no indent.</p> ...but going back to proper CSS formatting, doesn't the following work the same? Code:
<p style="text-indent: 0">This paragraph has no indent.</p> |
03-12-2011, 08:42 AM | #15 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
been there tried that - see older threads.
problem is you don't usually just have <p> text, you have <p class="calibreX" > text and you can't apparently have <p class="whatever" as well as "text-indent: 0" all in the same line. so you have do define a new class - calibreY with the no indent property..... which means opening & editing the .css file.... it's all doable, just more work than slotting in a quick <br> tag |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
remove indent from 1st line of chapter only | cybmole | Sigil | 15 | 02-21-2011 11:50 AM |
indent control | cybmole | Conversion | 18 | 02-18-2011 12:12 PM |
hanging indent | Oldpilot | Sigil | 2 | 11-13-2010 07:20 AM |
Too much left indent! | Barty | Amazon Kindle | 12 | 11-09-2010 03:43 PM |
Calibre nuking para indents from epub->mobi | Hitch | Calibre | 2 | 09-09-2010 10:11 PM |