Jump to content
You must now use your email address to sign in [click for more info] ×

Restrict hyphenation to lowercase words


Recommended Posts

Could you please add a checkbox to the hyphenation options that would allow hyphenation to be restricted to lowercase words? My book has thousands of proper names in it and Publisher is hyphenating them which I would prefer to avoid.

I'm new to Affinity Publisher but I believe the program didn't use to do this because earlier in this forum there's a 2018 feature request to hyphenate capitalized words. Adobe InDesign and apps back to the nineties have either restricted hyphenation to lowercase words or allowed the user to choose whether to include capitalized words.

Thanks!

Link to comment
Share on other sites

Some ideas for workarounds that may help you:

  • If you type a soft-hyphen at the start of the word, it will be invisible in the exported text and will prevent automatic hyphenation of that word. Text > Insert > Dashes and Hyphens > Soft Hyphen. Default keyboard shortcut on Windows is Ctrl+Shift+- (probably Cmd+Shift+- on Mac).
  • Alternatively, you could define a Character Text Style with a hyphenation language of None and apply it to those words.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

On 3/19/2021 at 7:50 PM, MikeTO said:

My book has thousands of proper names in it and Publisher is hyphenating them which I would prefer to avoid.

On 3/19/2021 at 9:17 PM, walt.farrell said:

Text > Insert > Dashes and Hyphens > Soft Hyphen

To batch apply to the vast majority of possible matches, use a regular expression:

  1. View > Studio > Find And Replace
  2. Find > cog button > select Match Case and Regular Expression
  3. Find: insert "\b(\s?[^\.]?\s\b)([A-Z]\w+)\b" (without the quotes)
  4. Replace with: "$1" (without the quotes) & popup menu > Special Characters > Soft Hyphen (inserts a special symbol) & "$2" (without any whitespace and without any quotes)
  5. Find – check the list of search results
  6. Replace all

 

As for this  \b(\s?[^\.]?\s\b)([A-Z]\w+)\b and $1 $2 gibberish search/replace strings:

  • \b = word boundary
  • ( ) = parentheses create a search group
  • \s = white space or line break
  • ? = optional
  • [^\.]? = excludes a result that contains a period if present but optionally allows characters like comma, semicolon or dash, i.e. excludes any words at the beginning of a sentence
  • \b[A-Z] = looks for caps at the word beginning (Match Case must be enabled)
  • \w+ = the first word character must be followed by one or more characters
  • $1 = the result in the 1st search group (parentheses 1) remains unchanged
  • inbetween we're inserting the soft hyphen
  • $2 = the result in the 2nd search group (parentheses 2) remains unchanged

Regex is fun. I'm still learning, and stuff like this is a great exercise. :)
More info:
regular-expressions.info/quickstart.html

Edited by loukash
replaced *.mov with *.mp4

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

Apropos Soft in soft hyphen

I really dislike that term, I much prefer the term Discretionary Hyphen. 

Mac Pro (Late 2013) Mac OS 12.7.6 
Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

Thank you, I appreciate the tips on options to work around the automatic hyphenation of capitalized names.

19 hours ago, walt.farrell said:
  • If you type a soft-hyphen at the start of the word, it will be invisible in the exported text and will prevent automatic hyphenation of that word. Text > Insert > Dashes and Hyphens > Soft Hyphen. Default keyboard shortcut on Windows is Ctrl+Shift+- (probably Cmd+Shift+- on Mac).
  • Alternatively, you could define a Character Text Style with a hyphenation language of None and apply it to those words.

The soft or discretionary hyphen trick wouldn't have occurred to me but makes complete sense. Applying it or a character style (using the No Break attribute) thousands of times would be too tedious.

14 hours ago, loukash said:

To batch apply to the vast majority of possible matches, use a regular expression: 

But I hadn't thought of using grep so I'll give that a try, thank you. I'd rather apply a character style with No Break in it than insert a soft or discretionary hyphen so I'll try that approach.

Link to comment
Share on other sites

26 minutes ago, MikeTO said:

I'd rather apply a character style with No Break in it than insert a soft or discretionary hyphen so I'll try that approach.

You can also apply character text styles via Find and Replace, though that is harder if any of the words have existing formatting via character text styles or local formatting (bold, italic, underline).

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

1 hour ago, walt.farrell said:

if any of the words have existing formatting via character text styles or local formatting (bold, italic, underline

Exactly. That's why a soft hyphen is a more flexible solution.

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

15 minutes ago, Seneca said:

Capital Zone in particular?

That's for ALL CAPS.

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

28 minutes ago, loukash said:

That's for ALL CAPS.

That's right. Didn't read the post correctly.

2017 27” iMac 4.2 GHz Quad-Core Intel Core i7 • Radeon Pr 580 8GB • 64GB • Ventura 13.6.4.

iPad Pro (10.5-inch) • 256GB • Version 16.4

Link to comment
Share on other sites

  • 5 months later...

It's funny, there are other features I'd like such as cross references, multiple indices, and span columns, but a checkbox to turn off hyphenation for capitalized words is my #1 feature request. I'd pay for an upgrade just for this one feature.

The workarounds suggested are great and I'm using them but they're easy to forget.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.