04-21-2012, 08:07 AM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2012
Device: kindle 3
|
hanging indents alignment on Kindle
I am trying to align the left margin of a hanging indent with the continuation paragraph which has no indent. This works in the epub, but the converted file in mobi format on the kindle 3 gives a different indentation when the hanging indent is absent.
For example Code:
p.lm1 { margin-left: 50px; } p.hlm1 { margin-left: 50px; text-indent: -50px; } ADDITIONAL: I see that calibre renders the paragraphs without the hanging indent as blockquotes, measured in pixels (seemingly arbitrary numbers of pixels too), whereas the hanging indent paragraphs are rendered with text-indent and margin-left, measured in points. Unsurprisingly, the two rarely give the same value. Surely a bug? Last edited by backwoodsman; 04-21-2012 at 09:58 AM. Reason: new information |
04-21-2012, 09:59 AM | #2 |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
I think the problem is the mobi format and it's lack of support for CSS styles.
If I remember correctly indents are handled by converting them to block quotes, so you have no level of precision over their size. |
Advert | |
|
04-21-2012, 10:12 AM | #3 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2012
Device: kindle 3
|
Quote:
- turn off the blockquote approximate translation for the evenly indented paragraphs too. - Or alternatively to use the same units for both so that the distance indented matches. |
|
04-21-2012, 11:34 AM | #4 | |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Quote:
Mobi's way of doing indents is to use the "width" attribute of a "<p>" or "<div>" tag. Eg, Code:
<p width="1em"> Code:
<p width="-1em"> If you want fine control over the appearance of the Mobi, you'd be better off using these Mobi attributes directly in your HTML source, rather than relying on CSS being "converted" the way that you assume it will be. |
|
04-21-2012, 12:54 PM | #5 | |||
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2012
Device: kindle 3
|
Quote:
Quote:
Quote:
|
|||
Advert | |
|
04-21-2012, 02:27 PM | #6 |
creator of calibre
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There is no unit of width that can control a blockquote. A blockquote in MOBI is always rendered with a fixed margin. The amount of that margin depends on the MOBI renderer in question and cannot be controlled in the MOBI file. You are not going to be able to get hanging indents to work in mobi in a reliable way.
|
04-21-2012, 02:42 PM | #7 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2012
Device: kindle 3
|
Quote:
How are the paragraphs with hanging indents rendered in the MOBI? Presumably not via a blockquote. The "inspect" function in the calibre viewer shows them as simple p elements. If that is so, why can the indented ones not be rendered the same way, so that each level of indent can be the same with and without the indent? It would matter much less what the actual indent was as long as a continuation paragraph matched the one above it. It is frustrating not being able to see what is going on inside. Calibre says you can inspect the elements in a browser after clicking "explode epub", but that seems to only show the source formatting, not the formatting embedded in the mobi. Is there any way to see the mobi contents? |
|
04-21-2012, 02:47 PM | #8 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
There's a tool called "Mobiunpack" which will decompile a Mobi file and show you what's inside it. A search should find it.
|
04-21-2012, 02:49 PM | #9 |
creator of calibre
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want to see the insides of a MOBI file there are many tools that can unpack MOBI. calibre-debug --inspect-mobi is one. MOBI is based on a 20 year old dialect of HTML with proprietary extensions, have fun.
|
04-22-2012, 03:36 AM | #10 |
Junior Member
Posts: 5
Karma: 10
Join Date: Apr 2012
Device: kindle 3
|
hanging indents alignment on Kindle [SOLVED]
Thanks to both Harry and Kovid. Since it was already installed (even though undocumented), I used calibre-debug to unpack one of my mobi files. I now understand:
My application is for play scripts. There is no practical alternative but to redesign the typography for the Kindle, and to manually deal with each case where a character begins a speech in song or in verse (therefore needing indenting after the character name and any stage directions). I have marked the title "SOLVED", even though it is a poor solution... It is the best available. Thanks again for the help. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Indents and hanging indents in epub poetry | Derek R | ePub | 14 | 02-19-2012 04:43 AM |
Hanging Indents | John123 | Sigil | 5 | 12-04-2011 02:33 AM |
Display of Hanging Indents | crutledge | Workshop | 1 | 09-25-2009 06:09 PM |
Hanging indents? | llasram | Kindle Formats | 11 | 01-05-2009 10:59 AM |
Hanging indents in HTML2LRF or Book Designer? | LaughingVulcan | Sony Reader | 10 | 08-22-2007 06:53 PM |