Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle

Notices

Reply
 
Thread Tools Search this Thread
Old 12-13-2025, 11:44 AM   #1
Siavahda
Zealot
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 132
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kindle Paperwhite 2018
Em dashes display with space before them

It's not every ebook, but it happens often enough that I thought I'd try asking for help.

I'm reading on a Paperwhite (10th gen) running 5.15.1.1. I do not want to update at this time.

Example book is Recipes For an Unexpected Afterlife by Deston J. Munden. EPUB converted to AZW3. In the Calibre viewer, both the EPUB and AZW3 file display perfectly. If I open the files up in the editor, there are no spaces around the em dashes. So I'm confident it's not an issue with the file/s.

But on my Paperwhite, there is a space before each em dash. Photo at the link below.

https://everybookadoorway.com/wp-con...5640491405.jpg

I've tried changing fonts and text size and layouts and margins on the Paperwhite. I've tried altering the AZW3 file from justified text to left-align. None of it worked, and I'm pretty clueless about what else to try. I've spent hours looking for a solution online, but I suspect I don't know the right search terms because nothing's coming up.

If I convert the EPUB to MOBI, the em dashes display perfectly in the MOBI.

Does anyone know what causes this, and how to fix it in AZW3?

Last edited by Siavahda; 12-14-2025 at 04:48 AM. Reason: clarifying
Siavahda is offline   Reply With Quote
Old 12-13-2025, 03:42 PM   #2
jackm8
Addict
jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.
 
jackm8's Avatar
 
Posts: 386
Karma: 4500000
Join Date: Nov 2015
Device: none
There is definitely space before —, or possibly there's a missing space behind —. Fooling with font setting won't fix your problem. Calibre viewer is not good for previews, try the file in "Kindle for PC" or in Kindle Create. Preview windows there usually work the same as on the reader later.

You could try to convert the file to kfx if that fixes the problem, or you could try figuring what goes wrong during the conversion. I guess that Calibre part of the forums would be a way to go for that.
jackm8 is offline   Reply With Quote
Old 12-13-2025, 06:53 PM   #3
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,223
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
I covert every ebook to epub then edit the epub when I have it the way I like then convert the epub to AZW3.

Here is how I fix Em dashes :

First in the calibre editor create a function name it Em dashes
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return match.group().replace(' – ', '—').replace(' –', '—').replace('– ', '—').replace('--', '—').replace(' - ', '—').replace(' —', '—').replace(' — ', '—').replace('— ', '—')

This is the search that I use:
Code:
<body.*?>.*?</body>

https://manual.calibre-ebook.com/function_mode.html

be sure to save it.

https://manual.calibre-ebook.com/edi...saved-searches

This change a - a to a—a and will remove all spaces before and after em dashes.
bernie
Quote:
Originally Posted by Siavahda View Post
It's not every ebook, but it happens often enough that I thought I'd try asking for help.

I'm reading on a Paperwhite (10th gen) running 5.15.1.1. I do not want to update at this time.

Example book is Recipes For an Unexpected Afterlife by Deston J. Munden. EPUB converted to AZW3. In the Calibre viewer, both the EPUB and AZW3 file display perfectly. If I open the files up, there are no spaces around the em dashes. So I'm confident it's not an issue with the file/s.

But on my Paperwhite, there is a space before each em dash. Photo at the link below.

https://everybookadoorway.com/wp-con...5640491405.jpg

I've tried changing fonts and text size and layouts and margins on the Paperwhite. I've tried altering the AZW3 file from justified text to left-align. None of it worked, and I'm pretty clueless about what else to try. I've spent hours looking for a solution online, but I suspect I don't know the right search terms because nothing's coming up.

If I convert the EPUB to MOBI, the em dashes display perfectly in the MOBI.

Does anyone know what causes this, and how to fix it in AZW3?

Last edited by gbm; 12-13-2025 at 06:56 PM.
gbm is offline   Reply With Quote
Old 12-13-2025, 07:25 PM   #4
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: 81,217
Karma: 150263711
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 jackm8 View Post
There is definitely space before —, or possibly there's a missing space behind —. Fooling with font setting won't fix your problem. Calibre viewer is not good for previews, try the file in "Kindle for PC" or in Kindle Create. Preview windows there usually work the same as on the reader later.

You could try to convert the file to kfx if that fixes the problem, or you could try figuring what goes wrong during the conversion. I guess that Calibre part of the forums would be a way to go for that.
Given that the eBook is in KF8 format, just load it into the editor and then it can easily be seen if the space(s) around the em dashes are in the eBook or not. If they are in the eBook, searing/replace will fix that.

So my solution is to use the editor to fix the problem because if it is in the eBook, converting to KFX won't help. And KFX is meh!
JSWolf is offline   Reply With Quote
Old 12-13-2025, 07:29 PM   #5
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: 81,217
Karma: 150263711
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 gbm View Post
I covert every ebook to epub then edit the epub when I have it the way I like then convert the epub to AZW3.

Here is how I fix Em dashes :

First in the calibre editor create a function name it Em dashes
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return match.group().replace(' – ', '—').replace(' –', '—').replace('– ', '—').replace('--', '—').replace(' - ', '—').replace(' —', '—').replace(' — ', '—').replace('— ', '—')
Dies this search take into account non-breaking spaces of differing sizes? I've seen the normal size, the smaller size, just at the front of the em dash with a regular space behind and the same non-breaking space at the font and the back of the em dash.

The replace after the --, is that an en dash or a regular dash?

The next thing for you to do is do a search for . . . or ... or whatever it is to a real ellipse character with no spaces.
JSWolf is offline   Reply With Quote
Old 12-13-2025, 09:32 PM   #6
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,223
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
?


bernie
Quote:
Originally Posted by JSWolf View Post
Dies this search take into account non-breaking spaces of differing sizes? I've seen the normal size, the smaller size, just at the front of the em dash with a regular space behind and the same non-breaking space at the font and the back of the em dash.

The replace after the --, is that an en dash or a regular dash?

The next thing for you to do is do a search for . . . or ... or whatever it is to a real ellipse character with no spaces.
gbm is offline   Reply With Quote
Old 12-14-2025, 04:42 AM   #7
Siavahda
Zealot
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 132
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by jackm8 View Post
There is definitely space before —, or possibly there's a missing space behind —. Fooling with font setting won't fix your problem. Calibre viewer is not good for previews, try the file in "Kindle for PC" or in Kindle Create. Preview windows there usually work the same as on the reader later.

You could try to convert the file to kfx if that fixes the problem, or you could try figuring what goes wrong during the conversion. I guess that Calibre part of the forums would be a way to go for that.
There is not a space before or after the em dashes when I open up the files in the editor. In Kindle For PC there are no spaces either. So I'm pretty sure it's not the conversion process.
Siavahda is offline   Reply With Quote
Old 12-14-2025, 04:42 AM   #8
Siavahda
Zealot
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 132
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by JSWolf View Post
Given that the eBook is in KF8 format, just load it into the editor and then it can easily be seen if the space(s) around the em dashes are in the eBook or not. If they are in the eBook, searing/replace will fix that.

So my solution is to use the editor to fix the problem because if it is in the eBook, converting to KFX won't help. And KFX is meh!
I should have been clearer, when I said there's no em dashes when I open up the file, I meant when I open the file in the editor.
Siavahda is offline   Reply With Quote
Old 12-14-2025, 04:47 AM   #9
Siavahda
Zealot
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 132
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by gbm View Post
I covert every ebook to epub then edit the epub when I have it the way I like then convert the epub to AZW3.

Here is how I fix Em dashes :

First in the calibre editor create a function name it Em dashes
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return match.group().replace(' – ', '—').replace(' –', '—').replace('– ', '—').replace('--', '—').replace(' - ', '—').replace(' —', '—').replace(' — ', '—').replace('— ', '—')

This is the search that I use:
Code:
<body.*?>.*?</body>

https://manual.calibre-ebook.com/function_mode.html

be sure to save it.

https://manual.calibre-ebook.com/edi...saved-searches

This change a - a to a—a and will remove all spaces before and after em dashes.
bernie
I didn't know we could make functions, so thank you! But this didn't accomplish anything, unfortunately, because the spaces are not in the file. (I think I wasn't clear enough about this in the original post, sorry for the confusion! I really appreciate learning about the functions, though!)
Siavahda is offline   Reply With Quote
Old 12-14-2025, 08:37 PM   #10
jackm8
Addict
jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.
 
jackm8's Avatar
 
Posts: 386
Karma: 4500000
Join Date: Nov 2015
Device: none
Quote:
Originally Posted by Siavahda View Post
There is not a space before or after the em dashes when I open up the files in the editor. In Kindle For PC there are no spaces either. So I'm pretty sure it's not the conversion process.
Have you tried kfx?
jackm8 is offline   Reply With Quote
Old 12-15-2025, 04:41 AM   #11
Siavahda
Zealot
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 132
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by jackm8 View Post
Have you tried kfx?
I have not. Not sure how to convert to KFX, Calibre doesn't seem to have that as an output option, and that's the only conversion tool I have. Would it tell you anything if they displayed properly in KFX, or didn't? If not, I'm not sure it's relevant.
Siavahda is offline   Reply With Quote
Old 12-15-2025, 06:15 AM   #12
jackm8
Addict
jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.jackm8 ought to be getting tired of karma fortunes by now.
 
jackm8's Avatar
 
Posts: 386
Karma: 4500000
Join Date: Nov 2015
Device: none
Using a different format for comparison, should eliminate conversion as source of your problem.

You need to manually install a plugin in Calibre, then you can export as KFX.
Preferences -> Plugins -> Get new Plugins -> Filter by name (enter kfx) — install both, then you should have an option to select KFX as output format while converting your books.

Kindle Previewer 3 must also be installed.
Detailed instructions: https://www.mobileread.com/forums/sh...ght=kfx+output
jackm8 is offline   Reply With Quote
Old 12-15-2025, 10:10 AM   #13
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: 81,217
Karma: 150263711
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I have never seen spaces added to em dashes in KF8.

Can you do us a favor? Find an ePub eBook from the library here on MR thathas em dashes and try that. That way we can try the same eBook.
JSWolf is offline   Reply With Quote
Old 12-15-2025, 02:18 PM   #14
Siavahda
Zealot
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 132
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by jackm8 View Post
Using a different format for comparison, should eliminate conversion as source of your problem.

You need to manually install a plugin in Calibre, then you can export as KFX.
Preferences -> Plugins -> Get new Plugins -> Filter by name (enter kfx) — install both, then you should have an option to select KFX as output format while converting your books.

Kindle Previewer 3 must also be installed.
Detailed instructions: https://www.mobileread.com/forums/sh...ght=kfx+output
Thank you for the instructions! Managed it, in KFX there are no spaces before the em dashes.
Siavahda is offline   Reply With Quote
Old 12-15-2025, 02:20 PM   #15
Siavahda
Zealot
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 132
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by JSWolf View Post
I have never seen spaces added to em dashes in KF8.

Can you do us a favor? Find an ePub eBook from the library here on MR thathas em dashes and try that. That way we can try the same eBook.
I'm willing to try, but this is not something that happens with most books. The VAST majority of the time, books I convert display properly; the only time there are spaces by the em dashes are if they are there in the editor. It's just occasionally, with (seemingly) random books, that I run into this issue.

So I don't think a random book for the MR library is likely to have this problem. If you still want me to try, I will, I just don't see how it'll help.
Siavahda is offline   Reply With Quote
Reply

Tags
display problems, paperwhite


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display of narrow no-break space (Linux build) roger64 Sigil 16 02-17-2018 11:35 AM
Free (Kindle) Space Trap by Juanita Coulson [Vintage SF Alien Contact Space Opera] ATDrake Deals and Resources (No Self-Promotion or Affiliate Links) 13 09-21-2017 01:44 PM
BUG: Calibre 2.0 E-Book Viewer ePub extra space display problem trying Calibre 3 08-28-2014 08:56 AM
Narrow No-Break Space display roger64 Sigil 6 12-20-2012 03:43 PM
Dashed Dashes -- Befuddled by EN and EM Dashes (Apple Pages to EPUB) planewryter Conversion 1 07-22-2012 10:52 PM


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


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