Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 01-02-2009, 01:30 PM   #1
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Hanging indents?

Hi,

I'm trying to figure if it's possible & how to have hanging indents in Mobipocket books. The Mobipocket developer documentation suggests that negative paragraph indentation is possible, but nothing I've tried has actually rendered a hanging indent in Mobipocket Reader Desktop 6.2. Mobigen mangles a negative CSS 'text-indent' into a negative "width" attribute, but no combination of <blockquotes> and <p> tags with various "width" attributes has produced a hanging indent for me.

Any ideas?

-Marshall
llasram is offline   Reply With Quote
Old 01-02-2009, 01:35 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
A table with no cell borders?
kovidgoyal is offline   Reply With Quote
Advert
Old 01-02-2009, 01:45 PM   #3
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by kovidgoyal View Post
A table with no cell borders?
I'm not quite seeing it... The way I'm understanding that, it could work if the "hanging" vs. "indented" parts are already in separate block-level elements, but I can already handle that with separate <p> and <blockquote> tags (<blockquote> being Mobipocket speak for 'margin-left: 1em').
llasram is offline   Reply With Quote
Old 01-02-2009, 01:56 PM   #4
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
Does Hanging Indents at the Mobipocket Forums help? Note that mobi_cs1 indicates that "em" support is broken.
wallcraft is offline   Reply With Quote
Old 01-02-2009, 02:01 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by llasram View Post
I'm not quite seeing it... The way I'm understanding that, it could work if the "hanging" vs. "indented" parts are already in separate block-level elements, but I can already handle that with separate <p> and <blockquote> tags (<blockquote> being Mobipocket speak for 'margin-left: 1em').
You'd have to do the splitting manually, of course. So

Code:
<p>blah blah blah</p>
would become
Code:
<table><tr><td>blah></td><td>blah blah</td></tr></table>
kovidgoyal is offline   Reply With Quote
Advert
Old 01-02-2009, 03:03 PM   #6
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,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by llasram View Post
I'm trying to figure if it's possible & how to have hanging indents in Mobipocket books.
According to the documentation, <p width="-2em">Paragraph text</p> should do that, but I gather you've already tried that, and I seem to remember I tried it some time ago and it didn't work, at least in the Cybook and in my version of the desktop reader.
Jellby is offline   Reply With Quote
Old 01-02-2009, 03:06 PM   #7
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by wallcraft View Post
Does Hanging Indents at the Mobipocket Forums help? Note that mobi_cs1 indicates that "em" support is broken.
I had seen that, but I took another look and tried a few more things, and the results are just short of unbelievable:
  • <p width="-24pt"> creates a paragraph with a hanging indent.
  • <p width="-24px"> is ignored -- the author of the cited post must have meant width="-30pt" instead of width="-30px".
  • <p width="-1em"> creates a paragraph with a hanging indent at some font sizes, but not at others. As I zoom in and out, the "outdented" initial line moves back and forth seemingly at random.

What the hell, Mobipocket?
llasram is offline   Reply With Quote
Old 01-05-2009, 03:57 AM   #8
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
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
From an external CSS file:
.indented {
margin-left: 2.5em;
margin-right: 2.5em;
}

From the XHTML file:
<p class="indented">

I realise that this is not a hanging indent - it indents all the text in the paragraph - but it does work.

Regards, Alex
AlexBell is offline   Reply With Quote
Old 01-05-2009, 05:37 AM   #9
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,495
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
I done a few experiments using the latest Mobipocket Creator, and then examining the html actually in the created file.

Fractional em sizes don't seem to work at all for anything - you can have 0em, 1em, 2em, etc. But 0.5em doesn't work - it just rounds to 1em

Specifying as point sizes just gets converted to pixel sizes, assuming 96ppi pixels. e.g. 50pt gets converted to 67px (or just 67 - in the absence of units, pixels seem to be assumed.

Specifying negative em for the indent doesn't work. It indents second and subsequent lines correctly, but doesn't hang the first.

When I've specified using pt or px, it has worked.

It looks like the feature isn't fully debugged yet. A work in progress, seeing as it only appeared in Mobipocket Reader 6.

Fascinating how the HTML generated includes a blank div between paragraphs, to enable inter-paragraph spacing to be set, even when the spacing is set to 0.

Goodness - I hadn't realised Mobipocket's rendering engine was quite so non-standard. Mobipocket Creator does a lot of work converting from standard HTML+CSS to Mobipocket's HTML dialect.


Quote:
Originally Posted by llasram View Post
I had seen that, but I took another look and tried a few more things, and the results are just short of unbelievable:
  • <p width="-24pt"> creates a paragraph with a hanging indent.
  • <p width="-24px"> is ignored -- the author of the cited post must have meant width="-30pt" instead of width="-30px".
  • <p width="-1em"> creates a paragraph with a hanging indent at some font sizes, but not at others. As I zoom in and out, the "outdented" initial line moves back and forth seemingly at random.

What the hell, Mobipocket?

Last edited by pdurrant; 01-05-2009 at 07:15 AM.
pdurrant is offline   Reply With Quote
Old 01-05-2009, 06:00 AM   #10
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,635
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: PB360°
Quote:
Originally Posted by AlexBell View Post
From an external CSS file:
.indented {
margin-left: 2.5em;
margin-right: 2.5em;
}

From the XHTML file:
<p class="indented">

I realise that this is not a hanging indent - it indents all the text in the paragraph - but it does work.

Regards, Alex
No, it does not Alex. What happens is that you have a body that has larger margins than normal. For this to be working to some extent, you have to have those hanging indents all over the text without exception.

I wonder to what extent the hanging indents, if at all feasible, are portable to other formats (epub should be no prob, but LRF and IMP?) That is always very important for me. I prefer "my" books to have largely the same look and feel in all the formats.
mtravellerh is offline   Reply With Quote
Old 01-05-2009, 06:00 AM   #11
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,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by pdurrant View Post
Fascinating how the HTML generated includes a blank div between paragraphs, to enable inter-paragraph spacing to be set, even when the spacing is set to 0.
Huh? Why does it do that, if it could set the spacing with <p height=...>? Smart programs are so stupid...
Jellby is offline   Reply With Quote
Old 01-05-2009, 10:59 AM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by mtravellerh View Post
No, it does not Alex. What happens is that you have a body that has larger margins than normal. For this to be working to some extent, you have to have those hanging indents all over the text without exception.

I wonder to what extent the hanging indents, if at all feasible, are portable to other formats (epub should be no prob, but LRF and IMP?) That is always very important for me. I prefer "my" books to have largely the same look and feel in all the formats.
LRF supports hanging indents and even drop caps.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Margins and Indents sloecoach Calibre 2 09-26-2010 04:41 PM
Books you're hanging out for. mukoan Reading Recommendations 20 07-31-2010 06:06 PM
Display of Hanging Indents crutledge Workshop 1 09-25-2009 06:09 PM
Hanging indents in HTML2LRF or Book Designer? LaughingVulcan Sony Reader 10 08-22-2007 06:53 PM
hanging on pdf's deadite66 iRex 1 08-07-2007 08:21 AM


All times are GMT -4. The time now is 11:47 AM.


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