Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-01-2020, 09:39 AM   #1
jppeltier
Junior Member
jppeltier began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2020
Device: iPhone, iPad, Kobo
Question Non-breaking spaces in ePUB

Hello, I am giving a first shot at creating an ePUB, and am struggling with non-breaking spaces.

I am on macOS (Catalina), primarily using Pages to generate my ePUB. All is fine except the non-breaking spaces (present in my Pages document) but disappearing from my ePUB. After browsing the Internet, I tried different ways:
- I tried generating ePUB from Pages and from Vellum*.
- I tried checking the generated XHML, and can't find any non-breaking space tag where they should be.
- I tried updating the XHTML with non-breaking space tags (& nbsp, & #160 ...) and re-zipping the ePUB.
- I tried opening the ePUB in macOS Library and in Adobe Digital Editions.

Inevitably, the non-breaking spaces appear as normal spaces when I eventually display the ePUB. Am I doing something wrong here?

Thanks in advance for your help.

(*) fun fact: the left part of Vellum shows non-breaking spaces (View -> Invisible Characters) but at the same time the right part of the application (ePUB preview) shows normal spaces.
jppeltier is offline   Reply With Quote
Old 03-02-2020, 05:34 AM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,730
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
And how should the non-breaking spaces show? The non-breaking spaces are displayed as normal spaces, with the difference that words separated by them, they are maintained joint.
RbnJrg is online now   Reply With Quote
Advert
Old 03-02-2020, 02:14 PM   #3
jppeltier
Junior Member
jppeltier began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2020
Device: iPhone, iPad, Kobo
Quote:
Originally Posted by RbnJrg View Post
And how should the non-breaking spaces show? The non-breaking spaces are displayed as normal spaces, with the difference that words separated by them, they are maintained joint.
Very good point indeed, thanks.

Aren't they supposed to be also fixed-length? Doesn't it look bad to have something like such trailing question mark (example in French, my apologies)?

Code:
N'est-ce             pas              ?
Anticonstitutionnellement,         oui.
jppeltier is offline   Reply With Quote
Old 03-02-2020, 02:37 PM   #4
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: 45,830
Karma: 168959602
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by jppeltier View Post
Very good point indeed, thanks.

Aren't they supposed to be also fixed-length? Doesn't it look bad to have something like such trailing question mark (example in French, my apologies)?

Code:
N'est-ce             pas              ?
Anticonstitutionnellement,         oui.
AFAIK, a non-breaking space does not have a fixed length so it will not have any effect on justification. All the nbsp does is to keep the line from breaking at the non-breaking space so in your first sample, the s and the ? will always be on the same line.
DNSB is offline   Reply With Quote
Old 03-02-2020, 03:57 PM   #5
stumped
Wizard
stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.
 
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
Dunno about french grammar rules, but in English grammar there should not be any kind of space between end of word and question mark
So the problem goes away if you remove the spaces before ?
N'est ce pas?
Not n'est CE Pas ?
stumped is offline   Reply With Quote
Advert
Old 03-02-2020, 04:38 PM   #6
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,584
Karma: 14328510
Join Date: Nov 2019
Device: none
If you're trying to use non-breaking spaces in order to line things up with the line above or below, that's not what they're designed for.
hobnail is offline   Reply With Quote
Old 03-02-2020, 04:39 PM   #7
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: 45,830
Karma: 168959602
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
@stumped: In French, you do place a space between any "high punctuation" mark and the preceding word (i.e. exclamation points, question marks, colons, and semi-colons). I've also seen people using a space before "low punctuation" marks such as periods and commas though that is not standard.

I seem to remember that a thin non-breaking space (& # 8201; ) is recommended but too many fonts don't have that character so you get s�? for instance--depends on the .notdef glyph in the font.
DNSB is offline   Reply With Quote
Old 03-02-2020, 05:57 PM   #8
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,696
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
French in particular has Blackletter laws (almost) regarding spacing around punctuation. A misplaced thin-space will have the Alliance Française enforcers banging on your door in no time (figuratively) German's not far behind.

On the other hand, according to some, English doesn't need any punctuation, especially if you're Irish and you're writing in English

BR
BetterRed is offline   Reply With Quote
Old 03-03-2020, 12:12 PM   #9
jppeltier
Junior Member
jppeltier began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2020
Device: iPhone, iPad, Kobo
Lightbulb Non-breaking spaces in ePUB vs. Fixed-length

Quote:
Originally Posted by DNSB View Post
I seem to remember that a thin non-breaking space (& # 8201; ) is recommended but too many fonts don't have that character so you get s�? for instance--depends on the .notdef glyph in the font.
Thanks to all of you for underlining my confusion between non-breaking spaces and fixed-length spaces. Thanks to DNSB above for pointing me in the right direction of “fine non-breaking spaces” before some French (European) punctuation.

For the sake of completeness and further reference to French rules, I found the following resources (albeit in French only) of particular interest:
https://crowdagger.github.io/textes/...uristique.html
https://www.druide.com/fr/enquetes/p...es-impeccables
https://roberge.mus.ulaval.ca/gdrm/08-princ.htm
jppeltier is offline   Reply With Quote
Old 03-04-2020, 07:38 PM   #10
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by jppeltier View Post
For the sake of completeness and further reference to French rules, I found the following resources (albeit in French only) of particular interest:
https://crowdagger.github.io/textes/...uristique.html
https://www.druide.com/fr/enquetes/p...es-impeccables
https://roberge.mus.ulaval.ca/gdrm/08-princ.htm
Thanks for these resources. I'll toss them on my reading lists.

Here's another one to add to yours:

LibreOffice's article: "Non Breaking Spaces Before Punctuation In French (espaces insécables)"

Side Note: For all the different thin/normal spacing around punctuation... you have to know the specific language's conventions. Even within French, there are differences between French + Canadian French punctuation.

* * *

Over the years, I've written extensively on non-breaking spaces in ebooks. Here are some of the threads that go into extreme detail on non-breaking spaces (and other types of spaces):

2019 "ellipses, with or without spaces?"
2017 "break/no-break and other spaces"
2014 "Non-breaking space"
2013 "[old thread] non breaking spaces (* and &#x00A0 automatically removed"

* * *

Questions: You seem to be an actual French speaker... how would French handle odd punctuation like question marks within brackets:

(?) or [?]

Do similar spacing rules apply for more obscure punctuation like {} + &?

Or what about Maths (+, −, =)? Do they follow normal conventions? Or apply some sort of insane French version of spacing? :P

Quote:
Originally Posted by jppeltier View Post
Hello, I am giving a first shot at creating an ePUB, and am struggling with non-breaking spaces.
Long story short, in French punctuation:

For maximum compatibility, use  ... NO-BREAK SPACE (U+00A0).

This is the solution you should use for ebooks. Other spaces are less supported and may lead to missing character symbol � showing up.

* * *

Side Note: If creating French documents for Print:

For proper French typography, stick with these two:
  •   or   = NO-BREAK SPACE (U+00A0)
  •   or   = THIN SPACE (U+2009).
    • Many programs don't break on the THIN SPACE, so will keep punctuation attached. (Unsure on ereaders though, I haven't done extensive testing.)

To be super extra technically correct, the thin space would be a NARROW NO-BREAK SPACE (U+202F). But this character isn't in many fonts according to my tests.

For more details/tests of different fonts/applications, see my Post #48 in "Problem with inline image".

Quote:
Originally Posted by RbnJrg View Post
And how should the non-breaking spaces show? [...]
Well, in LibreOffice all the other spaces show as gray highlight, and in Calibre, it shows yellow highlight. :P

Quote:
Originally Posted by DNSB View Post
AFAIK, a non-breaking space does not have a fixed length so it will not have any effect on justification.
Correct...

But there are bugs, and some major programs that don't follow this logic... See all the juicy details in LibreOffice's bug:

Bug 41652 - "NO-BREAK SPACE" (U+00A0) interpreted as fixed-width space

In Word 2013, Microsoft finally stopped treating it as a fixed-width space:

https://answers.microsoft.com/en-us/...f06c7cb?auth=1

but... I believe they since reverted that (correct) decision in Word 2016+.

Last edited by Tex2002ans; 03-04-2020 at 07:53 PM.
Tex2002ans is offline   Reply With Quote
Old 03-05-2020, 08:33 AM   #11
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,730
Karma: 8700123
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Tex2002ans View Post
Quote:
Originally Posted by RbnJrg
And how should the non-breaking spaces show? [...]
Well, in LibreOffice all the other spaces show as gray highlight, and in Calibre, it shows yellow highlight. :P
I see you didn't read the OP's original post carefully He wrote the following:

Quote:
- I tried opening the ePUB in macOS Library and in Adobe Digital Editions.

Inevitably, the non-breaking spaces appear as normal spaces when I eventually display the ePUB. Am I doing something wrong here?
The OP was not asking about the &nbsp in LibreOffice or Calibre, the OP was asking about &nbsp in reading apps. My answer was precise.
RbnJrg is online now   Reply With Quote
Old 03-05-2020, 09:36 AM   #12
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,911
Karma: 103895653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by BetterRed View Post
On the other hand, according to some, English doesn't need any punctuation, especially if you're Irish and you're writing in English
Be worried if large black birds start following you.
Ireland almost invented modern writing. Before that there was only ROMAN CAPITALS for Latin. Various people invented bits of punctuation. The ancient Romans did none really, the Greeks sometimes marked sentence or paragraphs.
Quoth is offline   Reply With Quote
Old 03-05-2020, 03:51 PM   #13
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by RbnJrg View Post
I see you didn't read the OP's original post carefully
Sure I read it carefully: "The programs I'm using are buggy."
Tex2002ans is offline   Reply With Quote
Old 03-05-2020, 05:19 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,696
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Quoth View Post
Be worried if large black birds start following you.
Ireland almost invented modern writing. Before that there was only ROMAN CAPITALS for Latin. Various people invented bits of punctuation. The ancient Romans did none really, the Greeks sometimes marked sentence or paragraphs.
Large black birds follow me every day - they're called magpies, they invented birdsong and they're ultra-protective of their young.

Can't these black birds of yours see a backhanded crumb when it's thrown their way. If you're not careful I'll send my pet cassowary over to see you

BR
BetterRed is offline   Reply With Quote
Old 03-06-2020, 05:25 AM   #15
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,911
Karma: 103895653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
It's not funny.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AZW3 to DOCX - Non-breaking Spaces retiredbiker Conversion 4 09-25-2019 10:53 PM
Non-breaking spaces exaltedwombat Sigil 15 09-16-2019 08:19 AM
Viewing non-breaking and narrow spaces as code? veezh Editor 2 05-06-2015 04:53 AM
0.8.63 strips non-breaking spaces when converting from epub to mobi veezh Calibre 7 08-04-2012 08:39 AM
Non breaking spaces? troymc Sigil 6 05-22-2010 07:47 AM


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


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