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 05-30-2010, 02:45 AM   #1
Balorn
Junior Member
Balorn began at the beginning.
 
Balorn's Avatar
 
Posts: 1
Karma: 10
Join Date: May 2010
Device: PRS-300
Unhappy Problem with TXT Input

A lot of the things I read were originally formatted for 80-column monospace displays. I've been playing with the Extra CSS section and trying to tweak things to look right, but looking in the debug directories I discovered a major issue with the design of the TXT input plugin:

The TXT input plugin always removes whitespace from the start of the line, and has no option to leave it there.

For many things this doesn't matter, but preformatted TXT files often rely on space at the start of the line for things to look right.

I did a quick test, and starting with this source text file:
Code:
This                      test.
     is                 a
	    a            is
		  test. This
I got this in the html file in the debug\input folder:
Code:
<p>This                      test.</p>
<p>is                 a</p>
<p>a            is</p>
<p>test. This</p>
I discovered this when I found adding "white-space: pre;" in the Custom CSS section helped with mid-line spacing but still didn't indent properly.

There really needs to be an option for TXT input to not strip leading spaces, so we can have them be included in later steps of conversion.

Last edited by Balorn; 05-30-2010 at 07:11 AM.
Balorn is offline   Reply With Quote
Old 05-30-2010, 07:02 AM   #2
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
You might try converting to html and convert significant spaces to non breaking spaces and see if that helps. You can use sigil for editing if you are making epubs.
mrmikel is offline   Reply With Quote
Advert
Old 05-30-2010, 11:07 AM   #3
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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by Balorn View Post
The TXT input plugin always removes whitespace from the start of the line, and has no option to leave it there.

For many things this doesn't matter, but preformatted TXT files often rely on space at the start of the line for things to look right.

...~~~...

There really needs to be an option for TXT input to not strip leading spaces, so we can have them be included in later steps of conversion.
The best I can tell this is a limit of converting text to a reflowable ebook format. For an in depth discussion of the limits of converting text read this thread between nerys and Kovid (Calibre's creator).
DoctorOhh is offline   Reply With Quote
Old 05-30-2010, 11:38 AM   #4
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by Balorn
I got this in the html file in the debug\input folder:
Code:
<p>This                      test.</p>
<p>is                 a</p>
<p>a            is</p>
<p>test. This</p>
This is actually a bug. The proper output should be:

Code:
<p>This test.</p>
<p>is a</p>
<p>a is</p>
<p>test. This</p>
This is because it is converting to HTML internally and those extra white spaces will be condensed into one when rendering.

Adding an option to maintain white space exactly is possible but I don't see much point to it because it defeats the purpose of creating a reflowable document.
user_none is offline   Reply With Quote
Old 05-30-2010, 08:09 PM   #5
asjogren
Addict
asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.
 
Posts: 266
Karma: 1378
Join Date: Dec 2009
Location: Seattle / San Carlos, Sonora, Mexico
Device: Kindle & WiFi Nook & PocketBook IQ
On a related issue with TXT input, the Conversion Preference "treat each line as a paragraph" does not appear to work. The result was each chapter was a paragraph.

Circumvention: import into Word Processor (StarOffice Writer) and save as RFT. The Calibre conversion from RFT to MOBI was flawless.

Calibre 0.6.49
asjogren is offline   Reply With Quote
Advert
Old 05-30-2010, 09:20 PM   #6
FatDog
Witless protection Agent
FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.FatDog ought to be getting tired of karma fortunes by now.
 
Posts: 290
Karma: 1002898
Join Date: Nov 2009
Location: Los Angeles
Device: Kindle
I'm struggling with similar issues.

I took someones advice and I am trying to put simple HTML tags into my .txt file to create .htm/.html.

To preserve spacing when I need it I can add PRE and /PRE tags around things that should NOT be flowed.
FatDog is offline   Reply With Quote
Old 05-30-2010, 11:03 PM   #7
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: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by FatDog View Post
To preserve spacing when I need it I can add PRE and /PRE tags around things that should NOT be flowed.
Be aware that using PRE tags in your book can cause print to run right off the reader if you zoom/change font sizes.
DoctorOhh is offline   Reply With Quote
Old 05-31-2010, 08:45 AM   #8
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by asjogren
On a related issue with TXT input, the Conversion Preference "treat each line as a paragraph" does not appear to work. The result was each chapter was a paragraph.
Unless you use markdown processing (which has very specific requirements for formatting), TXT input has no idea what a chapter is. It works exclusively on lines.

Quote:
Originally Posted by FatDog View Post
I'm struggling with similar issues.

I took someones advice and I am trying to put simple HTML tags into my .txt file to create .htm/.html.

To preserve spacing when I need it I can add PRE and /PRE tags around things that should NOT be flowed.
Pre tags are almost always a bad idea. HTML supports other layout methods such as div and tables.
user_none is offline   Reply With Quote
Old 05-31-2010, 04:14 PM   #9
asjogren
Addict
asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.asjogren is no ebook tyro.
 
Posts: 266
Karma: 1378
Join Date: Dec 2009
Location: Seattle / San Carlos, Sonora, Mexico
Device: Kindle & WiFi Nook & PocketBook IQ
Quote:
Originally Posted by user_none View Post
Unless you use markdown processing (which has very specific requirements for formatting), TXT input has no idea what a chapter is. It works exclusively on lines.
At each Chapter break there were blank lines. And you are correct, the tool had no concept of chapters. The result was each logical chapter in the source TXT turned into a physical paragraph in the target.

This was just an FYI. I think in the future I will use a word processor to take TXT to RFT. And then use Calibre to convert RFT to MOBI or ePub
asjogren 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
Problem converting txt to mobi toby39 Calibre 10 09-05-2010 02:16 PM
DR1000 DR1000 Chinese Vertical Layout TXT plugin install Problem spuggy iRex 0 08-28-2010 02:30 PM
Bulk Convert problem - prefered format input captpete Calibre 4 08-24-2010 09:26 AM
Aluratek Libre Problem with TXT files indio192 Ectaco jetBook 2 06-17-2010 01:02 AM
Non-english characters input problem Celeblin Calibre 3 06-28-2009 02:05 PM


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


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