Copy link to clipboard
Copied
Copy link to clipboard
Copied
I don't think so, but that's because a single letter (usually a or I, in English) at the end of a line is not considered a wrapping fault. There's no demand for a rule to prevent it.
It's not a seamless fix, but I'd just use a hard space after that e and any like it (GREP or search/replace for all instances).
Copy link to clipboard
Copied
Yes, it's possible, as part of a paragraph style. If you search for terms like runts or orphans you should find some other threads on this topic which discuss the pros and cons of doing this.
The short answer is you would need to add a GREP style to add a character style that consists of nothing but No Break to your chosen minimum number of characters. One expression that should work is .{N}$ where N is your desired number.
Copy link to clipboard
Copied
@Peter Spier if you look at the OP screenshot, the single letter (a e in its exemple) is not located at the end of a paragraph but at the end of a line, and AFAIK there is now way to choose “end of a line” using GREP. If it exists, I would love to know how!
Copy link to clipboard
Copied
You could apply no break to any single letter and space.
Below you can see I applied the style “No break” to the term. I added an underline to see where it is applied.
(?<=\s)[\l\u]\s
Copy link to clipboard
Copied
If I had such a requirement, I would probably apply a grep style in paragraph style with character style No Break or something similar.
\h\K\w\h\w(?=\w+)
Copy link to clipboard
Copied
Thank you.
I tried to add your grep style to paragraph style:
but I don't see any change in text
what am I doing wrong?
I don't know anything about grep.
.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
No.
Copy link to clipboard
Copied
Here are some more explanatory screenshots:
without grep style
with grep style
paragraph style with grep style and character style No Break (colored for better illustration)
Copy link to clipboard
Copied
Ah, much better. I misread the post and was looking at it as end of paragraph rather than end of line.
For what it's worth I agree that a single character at the end of any line other than the last is not a compositional problem, though I would probably not want to see a single character followed by a hyphen, but that is controllable in the hyphenation settings.
The biggest problem I see with this kind of requirement is a major performance hit as the grep style must constantly look at the entire paragraph, or maybe even story, as text is entered or edited and the paragraph composer re-flows the exisitng text.
Copy link to clipboard
Copied
That is one possible mistake.
Another one:
Did you applied the paragraph style?
Copy link to clipboard
Copied
Yes.
Is the grep correct in this way?
Copy link to clipboard
Copied
Did you write that grep? Or did you copy it from one of my recent posts?
If the latter, please highlight the entire grep code in the Grep Style tab. Perhaps you accidentally copied a space at the beginning or at the end.
Maybe you can also upload a test document without confidential data as Indd with specification of the exact InDesign version and link it here (e.g. Dropbox or similar). A filled text frame and your paragraph format + character format is sufficient.
Copy link to clipboard
Copied
I copied it from your post here above.
This is the test file:
https://drive.google.com/file/d/1qbNEd1tUX9tY2SywEUS-8QheHmZ2N60p/view?usp=sharing
ID CS6
this is the .idml file:
https://drive.google.com/file/d/1bMm35R3OezKaovg1I4ze5NVXnJY8Fyod/view?usp=sharing
thanks a lot
Copy link to clipboard
Copied
I think the problem is CS6. I don't think that version recognizes the \h or \K parameters.
Copy link to clipboard
Copied
Hi Peter,
pixxxelschubser's GREP Style is also working with InDesign CS6 version 8.1.0.420 on Windows 10.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
So it is.
Copy link to clipboard
Copied
I copied it from your post here above.
This is the test file:
https://drive.google.com/file/d/1qbNEd1tUX9tY2SywEUS-8QheHmZ2N60p/view?usp=sharingID CS6
this is the .idml file:
https://drive.google.com/file/d/1bMm35R3OezKaovg1I4ze5NVXnJY8Fyod/view?usp=sharingthanks a lot
By @AntonioTheAnt
Unfortunately, you need an access authorization.
See:
Copy link to clipboard
Copied
Just For \Grep Comment! …
As we talk about “no-break” (enough greedy, catching the following char), here, this Grep code will be simplistically enough:
\b\w\h
(^/) The Jedi
Copy link to clipboard
Copied
Thanks all.
Copy link to clipboard
Copied
I'm sorry, I thought I solved it but I can't get the result I'm looking for. I have tried to assign all the grep styles you have suggested but in no case can I avoid that single letters remain at the end of the lines. If anyone would kindly upload an example file (.idml because I use InDesign CS6 8.0.2 on Mac) to dropbox or drive, I would be very grateful.
Copy link to clipboard
Copied
The tendency of solutions to use GREP and scripts sometimes seems (to me) a bit like using a sledgehammer to drive a tack.
Do you have any single letters besides 'e' in your project? Is a simple search and replace for 'e ' (e space) to 'e^S' (e nonbreaking space) not sufficient, even if you occasionally have to repeat it? The nonbreaking space will disappear into whole lines, and prevent the e from being left at the end of any line.
If you have other letters, a wildcard in the search would get all of them. (' ^$ ' to ' ^$^S')
Not seamless, automated and elegant, but sometimes a simple solution is all you really need. I guess you could write a script to do it. though. 🙂
Copy link to clipboard
Copied
Of course, if you do ignore what is a "no-break"! In French here! …
(^/)