Skip to main content
saxtonstudio
Inspiring
October 10, 2024
Answered

en dash with nonbreaking space for the first space and a regular space for the second

  • October 10, 2024
  • 1 reply
  • 1458 views

I'm replacing em dashes with en dashes, which would normally be a simple find/change, but I'm not sure how to make it specifically a nonbreaking space for the first space and regular space for the second.  

 

word – word

 

The en dash can't break after the first space; it has to remain with the preceding word in case of a return.

How to achieve?

Correct answer Joel Cherney

Thanks Dave. I understand what you're saying, but this book is using UK standards (For em dashes, the UK English prefers the shorter en dash – with a space either side – for the same purpose.)

 

Many languages have their own rules for whether or not a given type of dash is surrounded by spaces. Heck, there are style guides in North American English that require spaces around some dashes - AP style guide is one example. Not all style guides specify hair spaces, either. Given that I work with lots of languages that have a single central authority in charge of matters of style, or of typography, I can't help but notice that there isn't any one authority in charge of such matters in the States, or in the English language at all. Maybe here, in this particular community the central authority for English Langage typography is Bringhurst? 

 

Anyhow, Dave's suggestion was just to set your type without worrying about exactly what's going to break, then to make a GREP style to apply the No Break property to the glyphs you needed to stick together.  This is a good strategy, in my opinion. But it requires that you already have all the right glyphs in your story, which you currently don't. His regex is set to find the hair-space-followed-by-endash. But if you really want to do a Find/Change operation where you change all em dashes to a sequence of:

  • nonbreaking space
  • en dash
  • normal space

I'd use a GREP query like this:

 

 

 

 

 

 

1 reply

Dave Creamer of IDEAS
Community Expert
Community Expert
October 10, 2024

Typographically, dashes should not have spaces, but use a hair space on each side if your company style requires it. (Typographic standards are one thing; keeping your job is another!)

  

To solve your problem, create a No-Break character style, then in the base paragraph style, create a GREP style settings for your space followed by a dash. 

This shows the code for a hair space and an em dash:

David Creamer: Community Expert (ACI and ACE 1995-2023)
saxtonstudio
Inspiring
October 10, 2024

Thanks Dave. I understand what you're saying, but this book is using UK standards (For em dashes, the UK English prefers the shorter en dash – with a space either side – for the same purpose.)

 

So I do need regular spaces on either side of the en dash and am not quite figuring out how to do that while making only the first space non-breaking. I tried! ... Created a No Break character, then went to GREP in the base paragraph style and got lost on To Text step and beyond.

 

Also I will still need to do a find/change all the em dashes to these en dashes once that is set up properly, yes? And what will that look like?

Joel Cherney
Community Expert
Joel CherneyCommunity ExpertCorrect answer
Community Expert
October 10, 2024

Thanks Dave. I understand what you're saying, but this book is using UK standards (For em dashes, the UK English prefers the shorter en dash – with a space either side – for the same purpose.)

 

Many languages have their own rules for whether or not a given type of dash is surrounded by spaces. Heck, there are style guides in North American English that require spaces around some dashes - AP style guide is one example. Not all style guides specify hair spaces, either. Given that I work with lots of languages that have a single central authority in charge of matters of style, or of typography, I can't help but notice that there isn't any one authority in charge of such matters in the States, or in the English language at all. Maybe here, in this particular community the central authority for English Langage typography is Bringhurst? 

 

Anyhow, Dave's suggestion was just to set your type without worrying about exactly what's going to break, then to make a GREP style to apply the No Break property to the glyphs you needed to stick together.  This is a good strategy, in my opinion. But it requires that you already have all the right glyphs in your story, which you currently don't. His regex is set to find the hair-space-followed-by-endash. But if you really want to do a Find/Change operation where you change all em dashes to a sequence of:

  • nonbreaking space
  • en dash
  • normal space

I'd use a GREP query like this: