Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-05-2010, 09: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, 11:33 AM   #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,850
Karma: 22666666
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, 01: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,552
Karma: 950151
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, 09: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: 404
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, 10:25 PM   #5
jackie_w
Grand Sorcerer
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: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
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, 12: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: 404
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, 12:56 PM   #7
jackie_w
Grand Sorcerer
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: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
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-06-2010, 11:18 PM   #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: 404
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


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
rtf conversion martingUSA Calibre 11 11-29-2008 10:38 AM
[Help!] pdf -> rtf problems.. kurt_roy Sony Reader 1 04-24-2007 08:55 AM
RTF formatting problems Chai_kovsky Sony Reader 1 02-02-2007 11:41 PM
RTF files and other problems :) gandalfbp Sony Reader 2 12-02-2006 04:57 AM
RTF conversion. Riocaz iRex 15 08-08-2006 11:55 AM


All times are GMT -4. The time now is 08:48 AM.


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