View Single Post
Old 10-20-2009, 10:51 AM   #1
Zapped
Enthusiast
Zapped began at the beginning.
 
Zapped's Avatar
 
Posts: 47
Karma: 30
Join Date: May 2009
Location: Austin, TX
Device: Kindle Paperwhite 2
TXT conversion to ePub or LRF - paragraph formatting

I used search to look for "indent", "paragraph", and "txt conversion" here, but didn't find exactly what I was looking for.

I'm seeing differences in the output when I txt files to ePub or LRF, and as a naive user of the conversion utilities in calibre, I don't see how to control what's happening easily. I don't really want to venture into pre-formatting the text as html if I'm missing some simple ways to control the conversion in calibre directly.

I have a simple test file - the first three chapters of Pride & Prejudice in a text-file. There is no indent at the begining of each paragraph, but there is a blank line between paragraphs. There are extra blank lines before the new-chapter heading.

Here's an example of the last three paragraphs in Chapter 1 leading to the first three paragraphs of Chapter 2:
Code:
"It will be no use to us, if twenty such should come, since you will not
visit them."

"Depend upon it, my dear, that when there are twenty, I will visit them
all."

Mr. Bennet was so odd a mixture of quick parts, sarcastic humour,
reserve, and caprice, that the experience of three-and-twenty years had
been insufficient to make his wife understand his character. _Her_ mind
was less difficult to develop. She was a woman of mean understanding,
little information, and uncertain temper. When she was discontented,
she fancied herself nervous. The business of her life was to get her
daughters married; its solace was visiting and news.



Chapter 2


Mr. Bennet was among the earliest of those who waited on Mr. Bingley. He
had always intended to visit him, though to the last always assuring
his wife that he should not go; and till the evening after the visit was
paid she had no knowledge of it. It was then disclosed in the following
manner. Observing his second daughter employed in trimming a hat, he
suddenly addressed her with:

"I hope Mr. Bingley will like it, Lizzy."

"We are not <etc.>
In a default conversion to ePub, paragraphs remain separated by a blank line. No indent is added. Extra blank lines are converted to single blank line. It looks similar to the raw txt example above.

In a default conversion to LRF, paragraphs and chapters no longer have any blank lines between them, but an indent is added. The indent makes it somewhat readable, but the missing blank lines make it feel claustrophobic.

I've got several questions about this simple example.

(1) How do I get Chapter detection to work (so that a page break is added before the "Chapter <N>" line?

(2) How do I control the addition of indentation to the ePub format if that's what I want?

(3) How to I prevent the disappearance of the blank lines between paragraphs in LRF conversion it that's what I want?

Thanks in advance for your patience with a newbie to conversion.
Zapped is offline   Reply With Quote