Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 03-27-2019, 03:16 PM   #1
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
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?
lumpynose is offline   Reply With Quote
Old 03-27-2019, 03:47 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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>
If this book is as messed. Ask for your money back. There are just to many folk calling themselves e-book formatters that have no clue to the basics
theducks is offline   Reply With Quote
Advert
Old 03-27-2019, 05:13 PM   #3
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by theducks View Post
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>
If this book is as messed. Ask for your money back. There are just to many folk calling themselves e-book formatters that have no clue to the basics
Yes, I tried different unwrap factors; 0.4, 0.01, 0.99, 0.0, and 1.0 but no cigar.

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
lumpynose is offline   Reply With Quote
Old 03-27-2019, 05:26 PM   #4
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by theducks View Post
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>
If this book is as messed. Ask for your money back. There are just to many folk calling themselves e-book formatters that have no clue to the basics
So after looking at the AZW3 file and the EPUB file and where it's putting the "lgl" p tags, I'm guessing that it's adding those "lgl" p tags around short lines. Seems like there should be a calibre parameter to turn that off. Or maybe some option I'm using is turning it on, indirectly.
lumpynose is offline   Reply With Quote
Old 03-27-2019, 06:04 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by lumpynose View Post
So after looking at the AZW3 file and the EPUB file and where it's putting the "lgl" p tags, I'm guessing that it's adding those "lgl" p tags around short lines. Seems like there should be a calibre parameter to turn that off. Or maybe some option I'm using is turning it on, indirectly.
What format did you start with? I downloaded the EPUB and while the text was on many lines within the <p> block, it rendered as a contiguous paragraph in the Sigil preview and the Calibre viewer.
(you can 'Pretty' this code in the Calibre editor: Click the flower icon on the main toolbar. it will not change the books view)
theducks is offline   Reply With Quote
Advert
Old 03-27-2019, 07:27 PM   #6
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by theducks View Post
What format did you start with? I downloaded the EPUB and while the text was on many lines within the <p> block, it rendered as a contiguous paragraph in the Sigil preview and the Calibre viewer.
(you can 'Pretty' this code in the Calibre editor: Click the flower icon on the main toolbar. it will not change the books view)
I downloaded EPUB. It only happens with chapter 4. You'll probably need to maximize the reader's window and then you'll see random lines that have inappropriate line breaks.
lumpynose is offline   Reply With Quote
Old 03-27-2019, 07:57 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by lumpynose View Post
I downloaded EPUB. It only happens with chapter 4. You'll probably need to maximize the reader's window and then you'll see random lines that have inappropriate line breaks.
The missing piece: Where
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
theducks is offline   Reply With Quote
Old 03-27-2019, 08:24 PM   #8
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by theducks View Post
The missing piece: Where
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
Are you sure? It's not always obvious when it does it when you look at it in the reader and better seen in the calibre editor. In the second sentence of chapter 4, "He had now reached the age of forty years," in the calibre editor with the azw3 file mine has a /p after the first word "He" and a p class="lgl" before the word "had".

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.
lumpynose is offline   Reply With Quote
Old 03-27-2019, 08:33 PM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by lumpynose View Post
Are you sure? It's not always obvious when it does it when you look at it in the reader and better seen in the calibre editor. In the second sentence of chapter 4, "He had now reached the age of forty years," in the calibre editor with the azw3 file mine has a /p after the first word "He" and a p class="lgl" before the word "had".

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.
I did not convert to AZW3
Using the Calibre editoe, the status line shows a normal space between He had ( I was looking for something else, invisible, that might have confused the conversion)
theducks is offline   Reply With Quote
Old 03-27-2019, 08:35 PM   #10
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by theducks View Post
I did not convert to AZW3
Using the Calibre editoe, the status line shows a normal space between He had ( I was looking for something else, invisible, that might have confused the conversion)
Could you convert it to azw3 and then look? I only send azw3 files to my kindle.
lumpynose is offline   Reply With Quote
Old 03-27-2019, 08:42 PM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by lumpynose View Post
Could you convert it to azw3 and then look? I only send azw3 files to my kindle.
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>
theducks is offline   Reply With Quote
Old 03-27-2019, 09:54 PM   #12
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
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!
lumpynose is offline   Reply With Quote
Old 03-27-2019, 10:08 PM   #13
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
theducks is offline   Reply With Quote
Old 03-27-2019, 11:28 PM   #14
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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
BetterRed is offline   Reply With Quote
Old 03-27-2019, 11:56 PM   #15
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,190
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by lumpynose View Post
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.
Given that a reflowable epub simply shows what is between the opening and closing tags, using heuristics in an attempt to unwrap lines is going to be somewhat futile. The LFs embedded in the epub from FadedPages show as a space in all the renderers I tested (and that includes a couple of really dumb, disregard the book's CSS renderers).

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.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


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


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