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 04-14-2020, 06:22 AM   #16
wff
Member
wff began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2020
Location: Nancy, France
Device: Kobo Aura H2O, Marvin iOS
Hi JSWolf,
Thank you for your help.
I tried it too before asking for help. I explained it in my first post:

Quote:
Originally Posted by wff View Post
I sent the original ePub to kobo, and there was no problem of display and spaces and other stuff. But I need Kepub, because I like to see the real page number even when I change font size or margins.
It is the way I read it for now, with ePub on my Kobo device. But I would really love to have it as KePub, to display the real number of pages when I change font size or margins.
wff is offline   Reply With Quote
Old 04-14-2020, 07:45 AM   #17
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by wff View Post
Hi DNSB and davidfor,
Thank you very much for your answers!
I tried a lot of things with justify, and it doesn't seem to work.
I noticed these thin spaces before and after some signs (like ! ? ; " ) and I was wondering if it was part of the issue, but as I am not used to epub code, I was not sure.
So I will try to search and replace, so hopefully I can get rid of the thin spaces. How could I proceed to manage leading spaces in paragraphs?
There has been a bit of discussion on how Kobo handles non-English punctuation like this. The conclusion is basically, "not very well". In this case, the extra spaces and line breaks in the book code is making it worse. But, they should be ignored. Or treated as a single space. And not justifying the text helps. Or probably just hides some of the errors. As @JSWolf pointed out, the RMSDK used for epubs appears to handle these better. But, I think it has other issues with this sort of thing. I don't remember what, I'm just sure it has come up in the past.
davidfor is offline   Reply With Quote
Advert
Old 04-14-2020, 09:12 AM   #18
wff
Member
wff began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2020
Location: Nancy, France
Device: Kobo Aura H2O, Marvin iOS
Quote:
Originally Posted by davidfor View Post
There has been a bit of discussion on how Kobo handles non-English punctuation like this. The conclusion is basically, "not very well". In this case, the extra spaces and line breaks in the book code is making it worse. But, they should be ignored. Or treated as a single space. And not justifying the text helps. Or probably just hides some of the errors. As @JSWolf pointed out, the RMSDK used for epubs appears to handle these better. But, I think it has other issues with this sort of thing. I don't remember what, I'm just sure it has come up in the past.
That's not good news :-(
But what remains strange to me is that it is the only book I have this issue with.
Would you like me to show you a sample of another French book?
wff is offline   Reply With Quote
Old 04-14-2020, 11:15 AM   #19
wff
Member
wff began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2020
Location: Nancy, France
Device: Kobo Aura H2O, Marvin iOS
Bingo, guys, fix may be on its way :-)
It seems that thin spaces were responsible for my problem.
I performed several "search and replace" after copying epub code in TextEdit:
- EN DASH replaced with –
- THIN SPACE replaced with   (for each punctuation sign, like ! ? ")
- Extra spaces replaced with single space
It looks great until now, but I have fixed just one chapter... Lot of work ahead :-)
I took SS to show you.
Thanks again everyone! I will tell you if everything is ok once it's done.
Attached Thumbnails
Click image for larger version

Name:	Original Kepub chap 2-1.jpg
Views:	170
Size:	504.9 KB
ID:	178381   Click image for larger version

Name:	Edited Kepub chap 2-1.jpg
Views:	166
Size:	387.4 KB
ID:	178382   Click image for larger version

Name:	Original Kepub chap 2-2.jpg
Views:	153
Size:	466.3 KB
ID:	178383   Click image for larger version

Name:	Edited KePub chap 2-2.jpg
Views:	166
Size:	397.4 KB
ID:	178384  
wff is offline   Reply With Quote
Old 04-14-2020, 05:22 PM   #20
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,757
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by wff View Post
Hi JSWolf,
Thank you for your help.
I tried it too before asking for help. I explained it in my first post:



It is the way I read it for now, with ePub on my Kobo device. But I would really love to have it as KePub, to display the real number of pages when I change font size or margins.
Sorry, but you are incorrect. KePub page numbers have changed in the 4.20.x firmware. So if you've been reading KePub because of the way the page number used to work, then you don't need KePub any longer. ADE uses a similar page numbering that doesn't change when you change settings such as the font, font size, margins, and line height. KePub is one page to one screen and any of those settings that you change will change the page numbers.

You have two choices. Read in ePub where the text looks as it should or read in KePub with all those lovely gaps due to bugs in the Access renders (that displays KePub).

But remember, the ePub page number is more real then the current KePub page numbering.
JSWolf is offline   Reply With Quote
Advert
Old 04-14-2020, 05:25 PM   #21
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,757
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by wff View Post
Bingo, guys, fix may be on its way :-)
It seems that thin spaces were responsible for my problem.
I performed several "search and replace" after copying epub code in TextEdit:
- EN DASH replaced with –
- THIN SPACE replaced with   (for each punctuation sign, like ! ? ")
- Extra spaces replaced with single space
It looks great until now, but I have fixed just one chapter... Lot of work ahead :-)
I took SS to show you.
Thanks again everyone! I will tell you if everything is ok once it's done.
Why are you doing this the hard way? Load the ePub into the Calibre editor. You can do a search/replace in every HTML and not have to do this over and over for every HTML.
JSWolf is offline   Reply With Quote
Old 04-14-2020, 10:27 PM   #22
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by wff View Post
That's not good news :-(
But what remains strange to me is that it is the only book I have this issue with.
Would you like me to show you a sample of another French book?
From my testing, the rendering problems are exasperated by the extra spaces and line feeds in the text. I think that if you look at the other books, you won't find these.

Quote:
Originally Posted by wff View Post
Bingo, guys, fix may be on its way :-)
It seems that thin spaces were responsible for my problem.
I performed several "search and replace" after copying epub code in TextEdit:
- EN DASH replaced with –
- THIN SPACE replaced with   (for each punctuation sign, like ! ? ")
- Extra spaces replaced with single space
It looks great until now, but I have fixed just one chapter... Lot of work ahead :-)
I took SS to show you.
Thanks again everyone! I will tell you if everything is ok once it's done.
I think those are some of the suggestions made before. But, the are some issues as where you are putting the non-breaking space, the thin space is more correct. I think wrapping the text to remove extra spaces and line breaks is the first thing to do. I use the following saved search in the calibre editor to do this:

Code:
([\w-.,’”"'–;:\!…\?])\s*\n+\s*([\w"'’‘“]|<i)
With the replace text:

Code:
\1 \2
That matches most of what I have found when trying to wrap the text in paragraphs and replacing the line break with a single space. It isn't perfect, and have added things over time. It could probably be simplified, but, it works for me.
davidfor is offline   Reply With Quote
Old 04-15-2020, 07:29 PM   #23
wff
Member
wff began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2020
Location: Nancy, France
Device: Kobo Aura H2O, Marvin iOS
Quote:
Originally Posted by JSWolf View Post
Sorry, but you are incorrect. KePub page numbers have changed in the 4.20.x firmware. So if you've been reading KePub because of the way the page number used to work, then you don't need KePub any longer. ADE uses a similar page numbering that doesn't change when you change settings such as the font, font size, margins, and line height. KePub is one page to one screen and any of those settings that you change will change the page numbers.

You have two choices. Read in ePub where the text looks as it should or read in KePub with all those lovely gaps due to bugs in the Access renders (that displays KePub).

But remember, the ePub page number is more real then the current KePub page numbering.
Sorry, I may have been unclear. What I want is one page to one screen. As you guess, I would rather read without those gaps, and that's what I would do if I don't succeed to converse the ePub file.

Quote:
Originally Posted by JSWolf View Post
Why are you doing this the hard way? Load the ePub into the Calibre editor. You can do a search/replace in every HTML and not have to do this over and over for every HTML.
I may have done something wrong, but when I tried to search for thin spaces, I found nothing, so I gave up and did it in TextEdit. I would be glad to know where I was wrong!


Quote:
Originally Posted by davidfor View Post
From my testing, the rendering problems are exasperated by the extra spaces and line feeds in the text. I think that if you look at the other books, you won't find these.
Indeed, I didn't find that, nor did I find thin spaces (but I just checked 3 books).

Quote:
Originally Posted by davidfor View Post
I think those are some of the suggestions made before. But, the are some issues as where you are putting the non-breaking space, the thin space is more correct. I think wrapping the text to remove extra spaces and line breaks is the first thing to do. I use the following saved search in the calibre editor to do this:

Code:
([\w-.,’”"'–;:\!…\?])\s*\n+\s*([\w"'’‘“]|<i)
With the replace text:

Code:
\1 \2
That matches most of what I have found when trying to wrap the text in paragraphs and replacing the line break with a single space. It isn't perfect, and have added things over time. It could probably be simplified, but, it works for me.
Thank you very much, I will try that and I will let you know if it fixes my problem

I performed the hard "search and replace" thing on all the full epub. Results are satisfying to me. To be honest, it doesn't bother me to replace thin spaces with non breaking spaces. All the books I have read so far are formatted this way, and it doesn't catch my eyes while reading.

I would like to thank you all for your help. It was very useful to me to listen to your advices. I have learned a lot. I will keep you posted with the method I am happier with. Thanks again, guys.
wff is offline   Reply With Quote
Old 04-16-2020, 02:44 AM   #24
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by wff View Post
Sorry, I may have been unclear. What I want is one page to one screen. As you guess, I would rather read without those gaps, and that's what I would do if I don't succeed to converse the ePub file.
The problem was that you used the term "real page numbers" and Jon saw it. As far as he is concerned, the "One True Page Numbering System" is the Adobe system. He probably stopped buying paper books because they don't use it

There is a lot of discussion about page numbering in ebooks here. In fact, there is so much, that I wonder if some people bring it up when they are bored. Luckily, it is usually polite. Overall, it comes down to a personal preference for either page-per-screen as used for kepubs, or some other equally arbitrary method.

Quote:
I performed the hard "search and replace" thing on all the full epub. Results are satisfying to me. To be honest, it doesn't bother me to replace thin spaces with non breaking spaces. All the books I have read so far are formatted this way, and it doesn't catch my eyes while reading.
If this is for books you are reading, the only important thing is that you can read them. And maybe that you don't spend to much time fiddling with them. The reading is the important thing. I think a lot of us here forget that.
davidfor is offline   Reply With Quote
Old 04-16-2020, 06:25 AM   #25
wff
Member
wff began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2020
Location: Nancy, France
Device: Kobo Aura H2O, Marvin iOS
Quote:
Originally Posted by davidfor View Post
The problem was that you used the term "real page numbers" and Jon saw it. As far as he is concerned, the "One True Page Numbering System" is the Adobe system. He probably stopped buying paper books because they don't use it
LOL. OK, copy that. I will keep this rule in mind in the future


Quote:
Originally Posted by davidfor View Post
If this is for books you are reading, the only important thing is that you can read them. And maybe that you don't spend to much time fiddling with them. The reading is the important thing. I think a lot of us here forget that.
Yes, I totally agree. Luckily, it is the only book to behave this way after conversion. I guess if every single book looked like that, I would have used the ePub file or changed my reader :-)

I tried the code you gave me yesterday (thanks again). It wrapped very well the text in paragraphs and replaced all the line break, but it didn't fix my "gap problem". I do really think the thin spaces are responsible for that. Replacing them with normal spaces fixed the issue.

I found that yesterday. I think it may explain the problem with thin spaces in a French kepub file.

Thank you very much once again !!
wff is offline   Reply With Quote
Old 04-18-2020, 05:16 PM   #26
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
Quote:
Originally Posted by davidfor View Post
I use the following saved search in the calibre editor to do this:

Code:
([\w-.,’”"'–;:\!…\?])\s*\n+\s*([\w"'’‘“]|<i)
With the replace text:

Code:
\1 \2
That matches most of what I have found when trying to wrap the text in paragraphs and replacing the line break with a single space. It isn't perfect, and have added things over time. It could probably be simplified, but, it works for me.
Well, if you want simple, I use this: Make sure there are no parsing errors, then search for \s+ and replace with a space. Then do the "beautify all files" thing. It is sort of a dynamite solution, but I've not had any trouble with it.
retiredbiker is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange conversion from epub to kepub Sam Sahara Kobo Reader 1 09-11-2017 08:30 AM
EPUB to KEPUB conversion settings in Calibre Buhaj47 Kobo Reader 7 01-24-2016 11:49 AM
Kepub -> epub conversion? bartveld Kobo Reader 9 05-18-2014 05:37 AM
Glo Footnote encoding problem in kepub.epub fxp33 Kobo Reader 5 11-29-2013 04:02 AM
Aura HD Conversion of EPUB to KEPUB using Calibre kmack9 Kobo Reader 15 09-08-2013 01:00 PM


All times are GMT -4. The time now is 11:20 AM.


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