Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 04-01-2011, 03:17 PM   #1
James_Wilde
Guru
James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.
 
James_Wilde's Avatar
 
Posts: 793
Karma: 4727110
Join Date: Aug 2010
Location: Sweden
Device: Iriver Story
Indents again

I have a LibreOffice (odt) document which has been recreated from a nuked file (placed in a text-only program to remove ALL formatting) after which I have done the following:

1. formatted all text as 12pt Linux Libertine, with no space between paragraphs, a first line indent of 0,5 cm, and single line spacing
2. formatted all chapter titles as 16pt Linux Libertine, with a page break before, 2 cm before, and 1,5 line spacing
3. formatted certain words and phrases in italics
4. inserted 6 jpgs at various points

I have unzipped this odt and examined the contents file and styles file, and see no abnormalities (on a previous occasion, with OpenOffice, I found a number of non-breaking spaces added haphazardly).

I have run this file through Calibre to generate a mobi file, with no space between paragraphs and a 0.5 em indent (I've also tested with 1.5 and 0)

Out comes a file which in both Calibre and Kindle for Mac shows a very ragged line of indented paragraphs. Here is what it looks like after I mark it in Calibre and do a copy and paste. I have marked spaces with the # symbol, since the MR editor removes space at the beginning of a line. It's not an exact match, but it indicates the problem:

##This novel is set in Sweden and China. As a consequence the names of persons and places will be unfamiliar to most of you. I hope you have fun with them.
For those of you who are interested, the Swedish letter ┼ or ň is pronounced like the 'au' in 'autumn' or the 'a' in 'water'; ─ or ń is pronounced like the 'e' in 'bed' although it can be long, like the 'a' in 'spare'; and Í or ÷ sounds like 'ir' in 'bird', although you should purse your lips as you say it.
###I have also included some simple Mandarin words or phrases, and these are presented using pinyin, which is a method of using western letters with some more or less familiar-looking accents to indicate how they should be pronounced. The meaning of these words is hopefully clear from the context. I leave it to you how you cope with internally voicing them. Purists, though, will disapprove of the fact that, in the mobi version, I have shown them without tonal accents. The problem was that not all ebook readers can display the accented letters properly. Kindles cannot, for example, so the mobi version does not include them.
#My thanks to Nancy Yip, who first gave me the idea for this story, and subsequently was an unfailing source of information on China, including pointing me to a superb book on a province near GuangXi. Yes, Nancy really exists, although perhaps not

end of sample.

I'd love to know what it is that is screwing up my 0.5 cm indents and even more, how to stop it.
James_Wilde is offline   Reply With Quote
Old 04-01-2011, 03:57 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by James_Wilde View Post
the MR editor removes space at the beginning of a line.
Code:
   Paste into code tags
 like
   I'm doing here :)
Starson17 is offline   Reply With Quote
 
Advertisement
Old 04-01-2011, 04:25 PM   #3
James_Wilde
Guru
James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.
 
James_Wilde's Avatar
 
Posts: 793
Karma: 4727110
Join Date: Aug 2010
Location: Sweden
Device: Iriver Story
Code:
   This novel is set in Sweden and China. As a consequence the names of persons and places will be unfamiliar to most of you. I hope you have fun with them.
For those of you who are interested, the Swedish letter ┼ or ň is pronounced like the 'au' in 'autumn' or the 'a' in 'water'; ─ or ń is pronounced like the 'e' in 'bed' although it can be long, like the 'a' in 'spare'; and Í or ÷ sounds like 'ir' in 'bird', although you should purse your lips as you say it.
      I have also included some simple Mandarin words or phrases, and these are presented using pinyin, which is a method of using western letters with some more or less familiar-looking accents to indicate how they should be pronounced. The meaning of these words is hopefully clear from the context. I leave it to you how you cope with internally voicing them. Purists, though, will disapprove of the fact that, in the mobi version, I have shown them without tonal accents. The problem was that not all ebook readers can display the accented letters properly. Kindles cannot, for example, so the mobi version does not include them.
 My thanks to Nancy Yip, who first gave me the idea for this story, and subsequently was an unfailin
The lines didn't wrap, but you see how shitty the paragraph indents look.
James_Wilde is offline   Reply With Quote
Old 04-01-2011, 04:29 PM   #4
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: 26,314
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre does not spontaneously invent indents. If they're present in your output file they must be present in your input file. They may be present in a form that calibre is misinterpreting, but there has to be *something* there.

As to what that something could be, it's impossible to say without looking at the input file.
kovidgoyal is offline   Reply With Quote
Old 04-01-2011, 05:04 PM   #5
James_Wilde
Guru
James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.
 
James_Wilde's Avatar
 
Posts: 793
Karma: 4727110
Join Date: Aug 2010
Location: Sweden
Device: Iriver Story
Quote:
Originally Posted by kovidgoyal View Post
calibre does not spontaneously invent indents. If they're present in your output file they must be present in your input file. They may be present in a form that calibre is misinterpreting, but there has to be *something* there.

As to what that something could be, it's impossible to say without looking at the input file.
Pretty much what I thought, Kovid. Is there anyone in here with a bit more technical knowhow than I have who would be willing to take a look at my odt file and see if they can see anything?
James_Wilde is offline   Reply With Quote
Old 04-01-2011, 08:10 PM   #6
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
What you could do is paste a few lines of the actual html code instead of rendered text, that would give us a better idea without looking at the html code.

I'd recommend enabling heuristics and the 'replace entity indents' option and see if that takes care of the problem.
ldolse is offline   Reply With Quote
Old 04-03-2011, 09:56 AM   #7
James_Wilde
Guru
James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.
 
James_Wilde's Avatar
 
Posts: 793
Karma: 4727110
Join Date: Aug 2010
Location: Sweden
Device: Iriver Story
Quote:
Originally Posted by ldolse View Post
What you could do is paste a few lines of the actual html code instead of rendered text, that would give us a better idea without looking at the html code.

I'd recommend enabling heuristics and the 'replace entity indents' option and see if that takes care of the problem.
Thanks, Idolse:

Here's the text above in the format it comes in the content.xml file from the unzipped odt file. The css file is below.

Code:
<text:p text:style-name="Production_20_header">Foreword</text:p><text:p text:style-name="Production_20_default">This novel is set in Sweden and China. <text:s/>As a consequence the names of persons and places <text:s/>will be unfamiliar to most of you. <text:s/>I hope you have fun with them.</text:p><text:p text:style-name="Production_20_default">For those of you who are interested, the Swedish letter ├ů or ├ą is pronounced like the &apos;au&apos; in &apos;autumn&apos; or the &apos;a&apos; in &apos;water&apos;; ├ä or ├Ą is pronounced like the &apos;e&apos; in &apos;bed&apos; although it can be long, like the &apos;a&apos; in &apos;spare&apos;; and ├ľ or ├ sounds like &apos;ir&apos; in &apos;bird&apos;, although you should purse your lips as you say it.</text:p><text:p text:style-name="Production_20_default">I have also included some simple Mandarin words or phrases, and these are presented using pinyin, which is a method of using western letters with some more or less familiar-looking accents <text:s/>to indicate how they should be pronounced. <text:s/>The meaning of these words is hopefully clear from the context. <text:s/>I leave it to you how you cope with internally voicing them. <text:s/>Purists, though, will disapprove of the fact that, in the mobi version, I have shown them without tonal accents. <text:s/>The problem was that not all ebook readers can display the accented letters properly. <text:s/>Kindles cannot, for example, so the mobi version does not include them.</text:p><text:p text:style-name="Production_20_default">My thanks to Nancy Yip, who first gave me the idea for this story, and subsequently was an unfailing source of information on China, including pointing me to a superb book on a province near GuangXi. <text:s/>Yes, Nancy really exists,
And here's what I believe are the relevant bits of the css file.

Code:
<style:style style:name="Production_20_default" style:display-name="Production default" style:family="paragraph" style:parent-style-name="Standard" style:class="text" style:master-page-name=""><style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:orphans="2" fo:widows="2" fo:text-indent="0.499cm" style:auto-text-indent="false" style:page-number="auto"><style:tab-stops/></style:paragraph-properties><style:text-properties style:font-name="Linux Libertine" fo:language="en" fo:country="GB" style:font-name-asian="AR PL UKai CN" style:language-asian="zh" style:country-asian="CN"/></style:style><style:style style:name="Production_20_header" style:display-name="Production header" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Production_20_default" style:class="text" style:master-page-name=""><style:paragraph-properties fo:margin-top="2cm" fo:margin-bottom="0cm" fo:line-height="150%" fo:text-align="center" style:justify-single-word="false" style:page-number="auto" fo:break-before="page"/><style:text-properties style:font-name="Linux Libertine" fo:font-size="16pt" fo:language="en" fo:country="GB" style:font-name-asian="AR PL UKai CN" style:language-asian="zh" style:country-asian="CN"/></style:style>
I'll have to check what I did with the heuristics and replace entity indents options. I know I didn't change them from the default, and the implications of Kovid's comment are that it's not Calibre that has made this change.
James_Wilde is offline   Reply With Quote
Old 04-03-2011, 10:40 AM   #8
James_Wilde
Guru
James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.
 
James_Wilde's Avatar
 
Posts: 793
Karma: 4727110
Join Date: Aug 2010
Location: Sweden
Device: Iriver Story
Quote:
Originally Posted by ldolse View Post
I'd recommend enabling heuristics and the 'replace entity indents' option and see if that takes care of the problem.
Thanks, Idolse. That did it.

Now I'd just like to know why. If my odt file has straight indents, and Calibre doesn't add anything, how come I get squiffy indents unless Calibre replaces the ones my file has?

Do I have to run both production methods with debug invoked to find the answer?
James_Wilde is offline   Reply With Quote
Old 04-03-2011, 11:06 AM   #9
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
Glad heuristics worked for you. I'm not versed in odt sourcecode, I had meant for you to paste in Calibre's html output (which you could get from the debug output now that I see you're outputting to Mobi).

Anway, I don't know ODT formatting well enough to understand how indents are defined, but during conversion from ODT to HTML calibre must be using Non-Breaking-Spaces to represent indents. Why it's using a variable number of them is unclear to me, but that must be what it's doing.

The heuristics option takes any number of non-breaking-spaces >= 2 being used to represent indents and converts them to a css indent. At this time any number of non-breaking spaces gets converted to the same indent level, essentially normalizing it for you.

Last edited by ldolse; 04-03-2011 at 11:12 AM.
ldolse is offline   Reply With Quote
Old 04-03-2011, 11:42 AM   #10
James_Wilde
Guru
James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.James_Wilde ought to be getting tired of karma fortunes by now.
 
James_Wilde's Avatar
 
Posts: 793
Karma: 4727110
Join Date: Aug 2010
Location: Sweden
Device: Iriver Story
I'll run this conversion twice more, once with and once without heuristics and both times with debug configured, and see if I can see what is happening and where, and more important, why. But at least I have a mobi I can use now.

Thanks again, Idolse.
James_Wilde is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to remove indents? neonbible Sigil 115 08-11-2011 09:50 PM
text indents ignored by Stanza spaze ePub 2 03-10-2011 08:10 AM
Indents! Please Help! Ephraim Sigil 8 11-23-2010 04:43 PM
Margins and Indents sloecoach Calibre 2 09-26-2010 05:41 PM
Hanging indents? llasram Kindle Formats 11 01-05-2009 11:59 AM


All times are GMT -4. The time now is 12:16 PM.


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