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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-05-2010, 10:17 AM   #1
gondwild
Member
gondwild began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2010
Device: Sony PRS-300
conversion from .rtf problems

I have a document that has line breaks well before the end of each page. Consequently, in .rtf its readable but when converting to .epbub or .mobi the lines get jumbled so the line runs to the end of the screen, finishes with 4 or 5 words on the next line, and then begins a new line.

some sample text from the document:

"decades and began traveling in Europe, a continent he’d never
seen. In the past year he had visited France, Holland, and most
recently Italy. They were package tours, traveling in the company
of strangers, riding by bus through the countryside, each
meal and museum and hotel prearranged. He was gone for
two, three, sometimes four weeks at a time. When he was away
Ruma did not hear from him. Each time, she kept the printout
of his flight information behind a magnet on the door of the
refrigerator, and on the days he was scheduled to fly she
watched the news, to make sure there hadn’t been a plane crash"

The obvious way to remedy this is to simply remove the line break from the end of each line, but thats some seriously time consuming work. Is there a way for calibre to do this?
gondwild is offline   Reply With Quote
Old 02-05-2010, 12:33 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: 26,433
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
you could do it if it was a txt file, but not rtf. calibre has various option for txt input that do this sort of thing. You can try converting it to txt first, but that will remove any formatting.
kovidgoyal is offline   Reply With Quote
Old 02-05-2010, 02:43 PM   #3
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,102
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by gondwild View Post
The obvious way to remedy this is to simply remove the line break from the end of each line, but thats some seriously time consuming work. Is there a way for calibre to do this?
The normal technique is to use a global edit to:
- replace every double line break with some unusual character (or character sequence) not used in the document. The assumption is that the double line feeds are almost certainly paragraph breaks.
- Replace every single line feed with space. This allows text flow to happen.
- replace the character you used in the first step with whatever you want to use for paragraph breaks.
itimpi is offline   Reply With Quote
Old 02-05-2010, 10:34 PM   #4
greenapple
Evangelist
greenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enough
 
Posts: 400
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
Quote:
Originally Posted by kovidgoyal View Post
you could do it if it was a txt file, but not rtf. calibre has various option for txt input that do this sort of thing. You can try converting it to txt first, but that will remove any formatting.
Hi Kovid,

I've often wondered how you could do that, even if the text was in .txt format. The conversion options for plain text are:

- Treat each line as a paragraph
- Assume print formatting
- Process using markdown
- Do not insert table of contents

I can't figure out which option would remove unneeded line breaks automatically from the text file?
greenapple is offline   Reply With Quote
Old 02-05-2010, 11:25 PM   #5
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,903
Karma: 4329385
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by greenapple View Post
Hi Kovid,
- Treat each line as a paragraph
- Assume print formatting
- Process using markdown
- Do not insert table of contents

I can't figure out which option would remove unneeded line breaks automatically from the text file?
Probably the second one as long as new paragraphs start with an indent, e.g.

Code:
    This is the start of the first paragraph which wraps
to multiple lines.
    This is a second paragraph.
jackie_w is offline   Reply With Quote
Old 02-06-2010, 01:27 AM   #6
greenapple
Evangelist
greenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enough
 
Posts: 400
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
Thanks, jackie.

I wish Calibre could an an option to be able to detect a blank line as a paragraph break.
greenapple is offline   Reply With Quote
Old 02-06-2010, 01:56 PM   #7
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,903
Karma: 4329385
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by greenapple View Post
I wish Calibre could an an option to be able to detect a blank line as a paragraph break.
I think this is Calibre's default, greenapple.

If your txt's paragraphs contain hard line-breaks but are separated by a blank line then I don't think you need to check either of the options "Treat each line as a paragraph" or "Assume print formatting".

i.e. when the txt looks like

Code:
This is the first paragraph which
is too long to fit on one line and
has hard line-breaks.

This is the second paragraph
which also needs to wrap.

Third paragraph.
Pick a book from Project Gutenberg and try it.
jackie_w is offline   Reply With Quote
Old 02-07-2010, 12:18 AM   #8
greenapple
Evangelist
greenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enoughgreenapple will become famous soon enough
 
Posts: 400
Karma: 664
Join Date: Dec 2009
Device: Kindle Paperwhite, Kindle DX, Kobo Aura HD
Got it. Thanks, jackie!
greenapple 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
rtf conversion martingUSA Calibre 11 11-29-2008 11:38 AM
[Help!] pdf -> rtf problems.. kurt_roy Sony Reader 1 04-24-2007 09:55 AM
RTF formatting problems Chai_kovsky Sony Reader 1 02-03-2007 12:41 AM
RTF files and other problems :) gandalfbp Sony Reader 2 12-02-2006 05:57 AM
RTF conversion. Riocaz iRex 15 08-08-2006 12:55 PM


All times are GMT -4. The time now is 10:46 AM.


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