Copy link to clipboard
Copied
Hello,
how can I hyphenate numbers?
I have the following problem:
In my catalog are many tables with Article-Numbers, which consists of numbers and letters, f.e. ABC123XYZ. I need to hyphen this Article- Numbers in the corresponding column, so the content fits (and line-breaks if needed) and causes no overset errors. Unfortunately indesign doesnt hyphenate numbers, even when I add the Article-Number with hyphens to the user-dictionary through Edit>Spelling>UserDictionary...
Because of many entries, I need this to happen automatically and not manually by adding Type>InsertSpecialCharacter>HypensAndDashes>DiscretionaryHyphens.
How can I solve this?
Thanks...
Copy link to clipboard
Copied
This is a job for GREP find/change - (edited for discretionary hypen instead of a dash)
This expression will work even if your number of letters and numbers is not always the same.
It finds a full "word" consisting of any number of upper case letters followed by any number of digits, and replaces it with the letters, a discretionary hyphen, then the numbers
Copy link to clipboard
Copied
Thanks, it works, but theres a small drawback, the search applies to the complete document. Is it possible to specify the search and apply only on tables in the document?
Copy link to clipboard
Copied
If the text in your tables has a different paragraph- or character style formatting (or different formatting), you could use that (in the Find Format box of the GREP dialog) to isolate the change to the tables.
Copy link to clipboard
Copied
One more option, if the formatting idea does not work:
If the table cells each contain only the number, and in other cases the number is part of a paragraph, you could change to expression to
^(\u+)(\d+)$
--changing the beginning and ending codes makes the search target only the Article-Numbers that are an entire paragraph by themselves.
Copy link to clipboard
Copied
Hi Susan!
7 years ago, limited but just enough here:
https://www.rolanddreger.net/de/249/highlight-grep-in-indesign/
Other thing that has nothing to see with Roland Dreger's Script*! …
Soon, you could use this new Grep syntax:
Find: \<(\u+)(\d+)\>(?#Tables)
Replace by: $1~-$2
(^/) The Jedi
[* "Tables" and "Live" very clever features imagined in this so cool Script.]
Copy link to clipboard
Copied
Unfortunately there is no difference in the results between
\<(\u+)(\d+)\>(?#Tables)
and
\<(\u+)(\d+)\>
But thanks for the mentioned script, it helps.
Copy link to clipboard
Copied
I've written "Soon" not "now! =D
… and sure, this new syntax has no more effect comparised to Susan's grep code/
Use Roland's script for now!
(^/)
Copy link to clipboard
Copied
Hm, this option doesnt show the complete number of hits. It shows a very small amount of results. Nevertheless, the approach is very helpful and I will continue testing till the correct result. Thanks for your help...