![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
new lines / line feeds in file?
I downloaded a book in EPUB format that has newlines or line feeds in it. When I convert it to AZW3 format they aren't removed and both Calibre's ebook reader and my Kindle start a new line where they are, messing up the page layout.
When I converted it to AZW3 in the Heuristic processing I turned on the option to unwrap lines but that didn't help. I changed the Line un-wrap value to 1 and then 0 but neither of those helped. When I look at the EPUB book with Calibre's reader the lines are as long as the window is wide. But when I look at the AZW3 they are short, presumably ending where the hard line feeds are. Argh, how can I fix this? |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
First of all: There are no Line feeds in EPUBS (XHTML). The ones in code are just to make it easy on the coders eyes
I will assume you have 'broken lines' (The sentence is in multiple pieces) Unwrap factor should get smaller .4 is a good starting point If there are MARGINS between whole paragraphs, then the style needs to be adjusted And the horrible 'empty Paragraph' (because someone did not know about top/bottom margins. Code:
<p> </p> |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
I should have done this before I posted my query; I looked at the AZW3 file in the calibre editor. Lines have p tags around them, so it's turning each line into a paragraph. I downloaded the file again and now it's randomly adding p tags after words (i.e., random chunks of text are p wrapped), not every line. And it's only doing it for CHAPTER IV HEPWORTH. If I look at the EPUB files, chapter 4 is the one whose name ends with e_split_009.html. Even stranger is that the previous chapter's (_008.html) initial html looks the same as this one's; it includes the same css files and uses the same css classes, pindent, etc. in the EPUB file that is. In the AZW3 file there are p class="lgl" tags. So apparently something is triggering these other p tags. The book was downloaded from here: https://www.fadedpage.com/showbook.php?pid=20160411 If I download and use the one from here, it converts nicely: https://en.wikisource.org/wiki/Where_Highways_Cross |
|
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
(you can 'Pretty' this code in the Calibre editor: Click the flower icon on the main toolbar. it will not change the books view) |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() OK I looked at chapter 4 and there is nothing wrong. What happens is the book is formatted LEFT JUSTIFIED (aka ragged right). The next word does not fit on the line and your device does not do auto-hyphenation. There is a plugin that may help https://www.mobileread.com/forums/sh....php?p=2456848 |
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
If yours doesn't have that then there must be something I'm doing that's causing these "lgl" paragraphs. And if you look at that part in the epub .html file you can see that it's a short line. |
|
![]() |
![]() |
![]() |
#9 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Using the Calibre editoe, the status line shows a normal space between He had ( ![]() |
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Could you convert it to azw3 and then look? I only send azw3 files to my kindle.
|
![]() |
![]() |
![]() |
#11 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Code:
<p class="pindent">In the eyes of most people thereabouts Hepworth was a man of some peculiarity. He had now reached the age of forty years, and was known to be well-to-do even to the verge of affluence, and yet he had never shown any desire to marry and settle down after the accustomed fashion of country folk. While his mother lived there had been excuses found for him. It was said that he was such a good son that he would not share his devotion between her and a wife. Certainly he devoted himself to her with a constancy and affection that was rare. She was an invalid for many years before her death, and in Hepworth she found a tender nurse. In him, so far as she was concerned, were united feminine gentleness and masculine pity. The country folk made his devotion a proverb, and thought well of him for the manifesting of qualities which are always esteemed by people who are chiefly influenced by their natural environment, and who accordingly esteem the domestic virtues at a high standard. When the old mother died, however, it was usually supposed that Hepworth would soon give a new mistress to the Home Farm. Certainly he had never shown any partiality for any particular person of the opposite sex, and there was therefore no one’s name that could be coupled with his own. Young women there were plenty, a Jane here, and a Susan there, who would make excellent wives for a farmer, and it was thought that upon one or other of these he would shortly look with favour. He was at that time but thirty years old—an age which country folk deem a suitable one for marriage—and it seemed unnatural that so prosperous and healthy a man should not take a wife to himself. As the years passed by and he made no sign and showed no liking for female society, it was said that he was taking a long time to pick and choose; now that ten years had gone and he still remained single, some of his neighbours began to think that there was to be neither choosing nor picking, and logically enough they considered his behaviour peculiar. It was not according to tradition, which is the main rule of life amongst a conservative people.</p>
|
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Ok, thanks. That means (or would seem to) that some setting I'm using is causing it to add those "lgl" p tags.
I had everything checked under Heuristic Processing. Unchecking "Ensure scene breaks ..." and all of the boxes above it makes it look good/correct. Checking "Renumber sequences ..." with the rest as above unchecked works. I'm not sure I tried all possible permutations but with Heuristic Processing on the only check boxes I can have on are Renumber sequences, Remove unnecessary, Italicize common, and Replace entity. If you want to see what I was getting try checking some of those "forbidden for lumpy" boxes. And make sure you're using the epub from Canada, not wikisource. I wonder if Kovid has a torture test epub file, e.g., with very short lines, to test conversions, with all the possible permutations for Heuristic Processing. And thanks for your help! |
![]() |
![]() |
![]() |
#13 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I used the file you linked faded pages.
I did NOT use heuristics. there was no need I do prefer Justified, but that is personal taste. I also do my touch ups manually, so heuristics is not ticked |
![]() |
![]() |
![]() |
#14 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@lumpynose - Did you try Prettifying the EPUB HTML with an editor (calibre or Sigil), and then converting to AZW using the calibre default settings - that's usually the best place to start.
BR |
![]() |
![]() |
![]() |
#15 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,190
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Both calibre's editor and Sigil will happily remove those unneeded LFs when you prettify the file. Sigil and calibre's editor do have some differences which makes it handy to have choices. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
noindent first line, indent all other lines, same paragraph, possible? | patrik | ePub | 3 | 02-15-2016 11:36 AM |
Add blank line between two lines | coolpixel | Sigil | 1 | 11-08-2014 02:13 PM |
Random Blank Line Feeds on iPhone 4 | DrDoug | Sigil | 3 | 05-30-2014 10:17 AM |
Text file formatting - line feeds and spaces | Fallingwater | Workshop | 6 | 07-04-2011 02:42 PM |
html->lrf line spacing between wrong lines? | flowoeB | Calibre | 6 | 08-21-2009 12:43 PM |