03-11-2011, 06:01 PM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
no indent for 1st para - lost in conversion
there are a coupl eo fways to format an epub so that all paragraphs are indented except for the 1st on each chapter. I had learned how to do it with additional css styling, then I found what seemed a quick n easy route - jsut add a <br> tag to openign line - like so :
Code:
<h2 class="calibre6" id="calibre_pb_10">Chapter Two</h2> <p class="calibre7"><br /> <span class="bold">M</span>USIC pounded through Luc’s ears. like this: Chapter Two MUSIC pounded through Luc’s ears. ( discussed this in sigil forum & we agreed there that the above html code was working as it should) but when I convert to mobi (default settings), and view the mobi in calibre viewer, or on Kindle, then the indent IS present ??? how come is this because of how calibre converts or is it due to differences in epub & mobi specs ? |
03-11-2011, 10:02 PM | #2 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Mobi spec is proprietary and only 'loosely' based on html 3.2, which is a very old html specification. Not sure if it's due to html 3.2, or Amazon/Mobi's extremely loose interpretation of the spec.
|
Advert | |
|
03-11-2011, 11:00 PM | #3 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
I would either run the conversion with the debug flag to see if you can detect the <br> being removed. Also, Mobiperl will allow you to extract the HTML from within the MOBI file to see if it's there and just being ignored or if it's not coming though during conversion.
|
03-12-2011, 02:43 AM | #4 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
thanks, I think I'll just accept that it is not a good construct for multi-platform & revert to defining a non-indent style for 1st paragraphs.
|
03-12-2011, 03:40 AM | #5 | |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Quote:
I use something like blockquote+p { text-indent: 0; } /* No indent for 1st para after a quote */ and similarly for headings and horizontal rules, but I have not been able to work out anything that will work on all first paragraphs. Regards, Alex |
|
Advert | |
|
03-12-2011, 04:52 AM | #6 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
there are huge threads on sigil forum - go read - but basically you use regex to find a <p which follows a </h2> , then manipulate the class inside that opening <p para.
each book has to be done individually. |
03-12-2011, 05:43 AM | #7 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
h1+p, h2+p, h3+p {text-indent:0;} always works for me using extra css during conversion. No need for regex unless there is a conflicting style, and I haven't run into that yet personally.
It does require that the book using heading tags for chapter titles though, obviously. If your chapter headings are using some specific style you can trigger off that as well: div.chaptertitlestyle+p {text-indent:0;} You just need to look in the html ahead of time and make it match whatever tags/styles are being used. |
03-12-2011, 06:59 AM | #8 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
so e.g. h1+p means a <p> tag which follows a </h1> tag etc.
I like having a master version in epub which has had all changes applied, rather than fixing only at the epub to mobi stage so I guess I'd need to do an epub to epub conversion with your extra CSS - I will try that & see how it goes. sometimes there's other junk between the header & the 1st para that has to be cleaned out with regex first though e.g. superfluous <div > stuff, so book has to be edited in sigil anyway. Last edited by cybmole; 03-12-2011 at 07:04 AM. |
03-12-2011, 08:22 AM | #9 |
Fanatic
Posts: 541
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Samsung Galaxy Tab 4 Nook & Samsung Galaxy Tab S 10.5
|
It sounds like everyone is trying to come up with some way to autodetect whether or not a certain paragraph is the first paragraph and have the formatting adjusted appropriately. I guess that makes sense since this is the Calibre-Converting forum but as awesome a tool as Calibre is, I've never had a conversion take care of everything to my satisfaction without some cleanup work beforehand.
Why wouldn't you just create a new class for any paragraphs that youu want formatted differently? Maybe I'm just missing something. Whether creating an ebook from scratch or converting from some other format, I always use Sigil for editing and creation. If converting from some format other than epub, my first step is to always convert to epub and look under the hood. Once I get everything looking the way I want, it's very simple to convert to whatever final format you want, mobi in my case. I use a general class called para for normal paragraphs. I use another called chapteropenertext for first paragraphs. another called paraspaceIndent or paraspaceNoIndent for first chapters after a scene break depending on whether or not it's supposed to be indented or not. I know everyone comes up with their own techniques but this seems to be the easiest way to me. If I've said it once, I've said it a thousand, er, well, at least three times... ...it's impossible to beat the one-two punch offered by the combination of Sigil and Calibre. They are an ebook creator/editor/converter's best friends. - Byron |
03-12-2011, 08:37 AM | #10 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
what you describe is exactly how I had been doing it, before I encountered the <br> option - which seemed to be a faster/simpler edit route.
to be honest, I am now inclined to just accept indented 1st paragraphs & not feel compelled to tweak them out of existence; after some googling of typesetting indents I find that the whole world is not united on the case for a non indented opening para anyway. Last edited by cybmole; 03-12-2011 at 08:48 AM. |
03-13-2011, 04:55 AM | #11 | |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
It patched up only 1 of the 2 stories. On inspection in sigil the one that did not patch had a text indent value set in inches? - something like 0.15in - in its default style |
|
03-14-2011, 04:13 AM | #12 | |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Quote:
Regards, Alex |
|
03-14-2011, 04:53 AM | #13 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
sigil IS a HTML editor - if you think of Epub as a variant of HTML - anyway it's the best tool for the job, so read the threads anyway if you want to know more. you can probably make the same changes via your existing editor. it will be a lot harder without a regular expressions find / replace function
|
03-14-2011, 11:14 AM | #14 | |
Well trained by Cats
Posts: 30,490
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Sigil is a WYSIWYG e-book editor with a simple code view editor It is missing many coding tools that my ancient (W95 era) copy of HTML Assistant Pro (code view only) had. That does not make Sigil bad. In fact, on the WYSIWYG side, it is pretty near impossible to generate invalid EPUB code that way |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
another no indent for 1st para question | cybmole | Sigil | 18 | 03-12-2011 05:24 PM |
remove indent from 1st line of chapter only | cybmole | Sigil | 15 | 02-21-2011 11:50 AM |
First Line indent for Mobi conversion | tbergman | Calibre | 7 | 09-06-2009 10:09 AM |
Science Fiction Burroughs, Edgar Rice: The Lost Continent. v1, 1st July 2009 | HarryT | Kindle Books | 0 | 07-01-2009 06:18 AM |
Science Fiction Burroughs, Edgar Rice: The Lost Continent. v1, 1st July 2009 | HarryT | BBeB/LRF Books | 0 | 07-01-2009 06:16 AM |