Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-15-2011, 09:59 AM   #31
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,974
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by cybmole View Post
1.any chance of a link to poll questions & results?

2. if the book is well written then it takes more than a blank line to "take me away from the book"

Real old-fashioned (hardback) books are mostly larger than e-reader devices, so what looks best on a hardback book page does not necessarily translate well to a 5 inch or 6 inch e-ink screen..

paperbacks seem to be produced with no regard for readability - just shrink n squeeze it onto cheap paper & hope the customer does not complain when the whole thing falls apart after a couple of reads.

anyway it's just a couple of clicks in calibre look n feel preferences or a simple tweak to sigil css to flip between the 2 options
If I recall correctly, there is one on MR. No, I cannot find it easily as it's old and you'd need to search for it.

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
JSWolf is online now   Reply With Quote
Old 02-15-2011, 10:55 AM   #32
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by cybmole View Post
is the mobi spec easy to find and understand ?
a quick google found this book for sale - maybe there are other free sources ?
http://kindleformatting.com/book/
That book by Joshua Tallent is the best single resource on formatting MOBI ebooks that I've found so far, cybmole. As far as I know, there isn't really a single definitive MOBI spec - I've used Joshua Tallent's book, Amazon's Kindle Publishing Guidelines (PDF), bits of info on the Mobipocket website, bits of info picked up in the Community Forums on Amazon's KDP website and in the forums here, plus good old "try it and see what happens" (in conjunction with the python script mobiunpack.py to unpack a resulting MOBI file and see what HTML has actually been used) to put together my own mental map of how the MOBI format works with regard to formatting.
DMSmillie is offline   Reply With Quote
Advert
Old 02-15-2011, 12:23 PM   #33
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by cybmole View Post
if what you say above is correct, then there's no way to add a 2 pixel line gap anyway ?
Yes, in Mobi parlance you'd have:

Code:
<p height="2">This paragraph has a 2 pixel space above it.</p>
(see here). But in ePUB you need something like:

Code:
<p style="margin-top: 2px">This paragraph has a 2 pixel space above it.</p>
I guess Calibre would do the proper conversion (and if it doesn't, you can ask the developers to fix it), but I wouldn't bet about other programs.

Quote:
lets say my epub css says to leave .5 em above and .5 em below each <p tag. how is that converted to mobi ?.
That depends on the converter. I guess some will round up, some will round down, some will ignore, some will try to keep the fraction (and the Mobi reader will either round up, round down or ignore), and some will crash.

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)
Jellby is offline   Reply With Quote
Old 02-15-2011, 07:20 PM   #34
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
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.
cybmole is offline   Reply With Quote
Old 02-15-2011, 08:52 PM   #35
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
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">"
Perkin is offline   Reply With Quote
Advert
Old 02-15-2011, 09:53 PM   #36
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,974
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by cybmole View Post
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 you take a look at the poll I recently created (link in a message here above), you will see that most people prefer indents with no extra line spaces. They prefer the first paragraph of the chapter to have no indent, the rest of the paragraphs to have indents up to the section break and the first paragraph of a new section to have no indent. Now the next largest selection is the same with a 2 or 3 pixel space between paragraphs.

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.
JSWolf is online now   Reply With Quote
Old 02-16-2011, 02:44 AM   #37
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
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 ?
cybmole is offline   Reply With Quote
Old 02-16-2011, 05:16 AM   #38
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by JSWolf View Post
..They prefer the first paragraph of the chapter to have no indent, the rest of the paragraphs to have indents ....
now that looks tricky to force into a conversion. I looked at a few sources & often there is no special CSS class in use for 1st paragraph only.

so how would you go about imposing that onto a book without lots of manual edits
cybmole is offline   Reply With Quote
Old 02-16-2011, 09:43 AM   #39
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,974
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by cybmole View Post
now that looks tricky to force into a conversion. I looked at a few sources & often there is no special CSS class in use for 1st paragraph only.

so how would you go about imposing that onto a book without lots of manual edits
That's easy. Something line this.. <p class="noindent">text</p> and in css, you have noindent set to have a text-indent of 0. That would give the paragraph no indent. Thn you have the CSS set to giver an indent for the paragraphs where you want an indent.

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.
JSWolf is online now   Reply With Quote
Old 02-16-2011, 10:28 AM   #40
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by cybmole View Post
so how would you go about imposing that onto a book without lots of manual edits
Quote:
Originally Posted by JSWolf View Post
That's easy. [How to set a CSS class for no indent] But you will have to go in and make the manual edits.
Ummm... a tad contradictory, JSWolf!

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.
DMSmillie is offline   Reply With Quote
Old 02-16-2011, 08:45 PM   #41
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by DMSmillie View Post
Ummm... a tad contradictory, JSWolf!

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.

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;}
ldolse is offline   Reply With Quote
Old 02-17-2011, 04:51 AM   #42
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
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 try a different book ( mobi to mobi again) no joy chapter start is still indented.

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.
cybmole is offline   Reply With Quote
Old 02-17-2011, 11:44 AM   #43
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
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:
Originally Posted by cybmole View Post
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.

i try a different book ( mobi to mobi again) no joy chapter start is still indented.

I'll have to test with epubs where I can see what is going on.
It is likely that the CSS is not honored in the conversion. I believe indenting in mobi is done with non-breaking spaces.

Dale
DaleDe is offline   Reply With Quote
Old 02-17-2011, 12:01 PM   #44
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by DaleDe View Post
I believe indenting in mobi is done with non-breaking spaces.
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...
Jellby is offline   Reply With Quote
Old 02-17-2011, 02:32 PM   #45
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by DaleDe View Post
It is likely that the CSS is not honored in the conversion. I believe indenting in mobi is done with non-breaking spaces.

Dale
but I have already observed and posted that extra css is honored expect for where it's contradicted within a style sheet ???

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 ???
cybmole is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 06:50 AM.


MobileRead.com is a privately owned, operated and funded community.