02-15-2011, 09:59 AM | #31 | |
Resident Curmudgeon
Posts: 74,648
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
But anyway, I've created a new poll. We'll see what happens with this one. https://www.mobileread.com/forums/sho...d.php?t=121540 |
|
02-15-2011, 10:55 AM | #32 | |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
Quote:
|
|
Advert | |
|
02-15-2011, 12:23 PM | #33 | ||
frumious Bandersnatch
Posts: 7,516
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Code:
<p height="2">This paragraph has a 2 pixel space above it.</p> Code:
<p style="margin-top: 2px">This paragraph has a 2 pixel space above it.</p> Quote:
Why don't you try? Create a test document with dummy paragraphs and various spacings and indents, and see how it looks in the Kindle. If you want to see the code, you can "unpack" the resulting Mobi with something like MobiPerl (I don't know if Calibre allows keeping the raw pseudo-HTML in Mobi, or if it will always convert it to proper HTML+CSS) |
||
02-15-2011, 07:20 PM | #34 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
I will do more testing with fractional ems. if I stick to how does it look in kindle for PC then it is quick to run through permutations and not have to learn how to unpack mobi code.
meanwhile back at the indent or not debate... where I don't care to see indents is with lots of short dialogue line passages "oh yes he did" "oh no he didn't" "followd by the odd statement that runs into 2nd line ,like zzzzzzzzz zzzzzzz zzzzzzzz zzzzzzzzzz zzzz zzzzz zzzzzzzzz zzzzzzzzzzz zzzzzzz this" as the LH margin then looks ragged. so I wonder how a book would look if paragraphs were indented EXCEPT where they began with an opening speech quote, and what regex would alter a book to that style, as a test. if the book does not have quotes within quotes or multiples speech groups on 1 line then the regex could be fairly simple - look for >" in the html & squeeze in a no-indent style setting OR if starting from no indents, look for > followed by NOT" and add some spaces or an indent style. maybe it would look truly awful but I'd like to do it / see it done as you get a raggedly LH margin. Last edited by cybmole; 02-15-2011 at 07:23 PM. |
02-15-2011, 08:52 PM | #35 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
As long as the first quotemark is the first character in the paragraph, it should be something like... (not tested)
Search <p>" Replace <p class="noindent">" or if there's classes in your <p> tags Search <p class="(.+?)">" Replace <p class="\1 noindent">" |
Advert | |
|
02-15-2011, 09:53 PM | #36 | |
Resident Curmudgeon
Posts: 74,648
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
So if you take both of these results into account, you'll see, going with no space between paragraphs and indents etc.. is the way more people will like the look of an eBook. So give it up. Forget the line space. Forget the no indents on short lines. Just make it look like a pBook and look good. |
|
02-16-2011, 02:44 AM | #37 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
so, moving on,
calibre will convert a book to indents + remove blank lines - that's a built in option. it does not, however have a built in option for converting back to no indents + a blank line, but that can be done with a 1 line override in extra css ? |
02-16-2011, 05:16 AM | #38 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
so how would you go about imposing that onto a book without lots of manual edits |
|
02-16-2011, 09:43 AM | #39 | |
Resident Curmudgeon
Posts: 74,648
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
A lot of commercial eBooks use <p class="tx1">text</p> for no indent and <p class='tx"text</p> for an indent. But you will have to go in and make the manual edits. Unless of course, your source is alread set that way. |
|
02-16-2011, 10:28 AM | #40 | ||
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
Quote:
Quote:
It'll depend on how your book is structured, and on the existing HTML code, cybmole. If the structure is fairly simple, and most of the paragraphs you'd want to set to have no indent follow immediately after a specific heading level, you might be able to do a search and replace along the following lines: Search for: </h2> <p> Replace with: </h2> <p class="noindent"> You'll need to include the appropriate characters for the [newline] characters included in the search and replace text, if there are any. What I've given above is just a rough concept, but hopefully might point you towards something you could use to add the "noindent" class to most if not all of the required paragraphs, and at least leave you with just a small amount of manual tidying up to do. |
||
02-16-2011, 08:45 PM | #41 | |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Quote:
Actually using Calibre's extra css during the initial conversion makes it even easier than that (assuming the book uses heading tags): h1+p,h2+p, h3+p,blockquote+p{text-indent:0;} If heuristics and scene break detection/formatting is enabled you can also use: p.softbreak+p,p.scenebreak+p,h1+p,h2+p, h3+p,blockquote+p{text-indent:0;} |
|
02-17-2011, 04:51 AM | #42 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
h1+p,h2+p, h3+p,blockquote+p{text-indent:0;}
can I combine that with also having p {text-indent: 1em} in the extra css so that a book with no indents becomes a book with indents except at chapter start. PS Idolise - do you have a view on why p {text-indent: 1em} fails if there are text-indent 0 entires in the stylesheet as per earlier post. and can you reproduce this bug/feature ? meatime - testing this new suggestion - using mobi to mobi as the mobi source already has intents (previously added via extra css )... didn't work in this case but my test book may have extra styling, as the chapter start words are in bold: the epub looks like this. typically there is a lot of hard to remove crap in chapter headings Code:
<body class="calibre6"> <h2 class="calibreclass2" id="heading_id_11"><span class="calibreclass1"><strong class="calibre7">CHAPTER</strong> 10<br class="calibre8" /></span></h2> <p class="calibre2"><strong class="calibre5">Robert Langdon</strong> had entered the Capitol Rotunda many times in his life, I'll have to test with epubs where I can see what is going on. Last edited by cybmole; 02-17-2011 at 04:59 AM. |
02-17-2011, 11:44 AM | #43 | |
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 |
|
02-17-2011, 12:01 PM | #44 |
frumious Bandersnatch
Posts: 7,516
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
It's properly done with the "width" attribute (<p width="1em">). But the reading system could have indents as default. <p width="0"> would force no indent, whatever the default; similarly <p height="0"> would force no space above.
But that's Mobi, and Sigil has nothing to do with Mobi... |
02-17-2011, 02:32 PM | #45 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
I will now test with an epub to epub conversion 1. I take an epub which has had indents removed by an added text-indent: 0 within the calibre2 style 2. i convert epub to epub using p { text-indent: 1em} in extra CSS 3 I view the output and see no indents. so, as I thought, this is nothing to do with epub to mobi, there's a bug/feature which means the extra css line is not being applied when it is contradicted explicitly in the stylesheet. so - bug or feature ??? |
|
|
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 |