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 08-10-2010, 10:51 PM   #1
billingd
Enthusiast
billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.billingd shines like a glazed doughnut.
 
Posts: 42
Karma: 8616
Join Date: May 2010
Location: Melbourne, Australia
Device: Kobo
Preserving <br /> on epub -> txt conversion

Does calibre have an option to preserve <br /> breaks when exporting from epub to txt? I have looked but can't find one.

I am trying to preserve the formatting of poetry, etc embedded in a book.

The current behavior is (roughly) a conversion from

Code:
<p>line 1,<br/>
line 2,<br/>
line 3,<br/>
line 4.</p>
to

Code:
line 1, line 2, line 3, line 4.
I want

Code:
line 1,
line 2,
line 3,
line 4.
I have attached a simple test case. epub is input and txt is output.

Last edited by billingd; 08-10-2010 at 11:19 PM. Reason: Attach simple test case
billingd is offline   Reply With Quote
Old 08-11-2010, 06:24 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,801
Karma: 12528001
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by billingd View Post
Does calibre have an option to preserve <br /> breaks when exporting from epub to txt? I have looked but can't find one.

I am trying to preserve the formatting of poetry, etc embedded in a book.
Most folks are trying to create a way to do flowable text that doesn't screw up poetry in ePubs. Kovid even gave us a nice demo.epub that we can view in Sigil to see how basic things can be encoded so they will look good in the ePub format. Why you would want to go backwards is beyond me.

I couldn't do it in just calibre and still have the space between verses.

The only way I found to do this reliably is to use calibre to convert to RTF and then use Wordpad to convert the RTF to text. I attached two formatted epubs (with the resultant RTF and Text files) that use different methods to get the space between verses. One uses Non-breaking spaces in a paragraph tag and the other uses all <br /> line breaks. The one with non-breaking spaces uses paragraph tags on all the lines.

Take a look.
DoctorOhh 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
Preserving format from ePub (Sigil) to Mobi jeff47 Calibre 9 10-22-2010 10:17 PM
Conversion: EPUB to TXT Starson17 Calibre 11 05-29-2010 12:31 PM
TXT conversion to ePub or LRF - paragraph formatting Zapped Calibre 6 10-23-2009 05:06 PM
Preserving Formatting through conversion? Ham88 PDF 16 08-31-2009 02:22 AM
Preserving TOC upon conversion from Lit to Mobi mobelby Calibre 0 07-31-2009 07:59 AM


All times are GMT -4. The time now is 07:59 AM.


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