Copy link to clipboard
Copied
Hi,
Is there any solution to automatically apply No Break only on last word on page?
In the Hyphenation panel, you can uncheck (untick) Hyphenate Last Word and Hyphenate Across Column and make this part of your Paragraph style.
Across Column includes Across Page. Would this work for you?
Copy link to clipboard
Copied
No, you can't find the last word on a page...unless it is also the last word in a story each time. You might be able to script that, though...you might check the scripting forums.
Copy link to clipboard
Copied
Thank You Erica, and what a coincidence, just watching You on youtube (GREP)
Suad
Sarajevo, Bosnia
Copy link to clipboard
Copied
Sorry if you were trying to get away from me...I am everywhere...haha!
Copy link to clipboard
Copied
Hmm! …
Not really sure the problem is to know if "you can [or not] find the last word on a page… [blabla]"
… But can InDesign do it? … and I should add: "basically!".
Best,
Michel, for FRIdNGE
Copy link to clipboard
Copied
Thank You All, I'm already using Hyphenate Last Word (OFF) and Character style with No Break combination but I was wondering is there some other way (automated) to do this.
Copy link to clipboard
Copied
To avoid word cuts between pages (or columns), uncheck "Hyphenate Across Column".
Best,
Michel
Copy link to clipboard
Copied
Your might be able to hire a scripter who can do it in "one click", but it's not a feature built into InDesign. (There is a good one following this thread.) Remember, though, that everytime you get an edit, the last word on the page is subject to change and the No Break needs to be changed as well.
GREP can find the Pilcrow (paragraph marker), so it's easy to find the last word of a paragraph. But there is not a marker at the end of the page.
You could also put it in as a feature request at User Voice:
Copy link to clipboard
Copied
Sorry Jane! I don't understand what you mean now! …
The user just needs to correctly parameter the hyphenation settings of his para styles!
Uncheck "Hyphenate Across Column" avoids word cuts between pages!
Imho, when the ID developer indicated "Across Column", (s)he didn't simplistically think "columns inside a text frame"!
Knowing that a text frame apparently without columns (2, 3, 4 or more) has in fact by default "1" column, (s)he included, by using "Across Column", the meaning "Across 2 text frames" [= across 2 columns]! … So, 2 pages with 2 threaded text frames!
Best,
Michel
Copy link to clipboard
Copied
Applying "No Break" as character formatting with GREP for the last word on the page is what the OP asked for, Michel. That's the feature that isn't there.
What if (hypothetically), you have three columns and want the last word to break across columns 1-2 and 2-3 but not column 3 to the next page? Can that be done with a script? Only the last word on the page and not the first two columns?
Again, hypothetical.
Copy link to clipboard
Copied
Jane,
The question was:
"How to prevent last word on page from breaking?"
… that means:
How to prevent last word on page from breaking … "when this word runs across 2 pages"?
ID can avoid it as said!
… But [to answer to your second comment] ID does it "globally"! … For all the columns covered by the para!
Btw, this approach seems to me a reading "good" approach!
But [hypothecally and simplistically but precisely] to answer you if Javascript could skirt this setting, I'ld say yes of course with some code lines like these ones:
// From FRIdNGE [August 2018]
var myParas = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements(),
P = myParas.length, p;
for ( p = 0; p < P; p++ ) {
//if ( myParas
.insertionPoints[-1].textColumns[0] != myParas
.insertionPoints[0].textColumns[0] ) {
if ( myParas
.insertionPoints[-1].parentTextFrames[0] != myParas
.insertionPoints[0].parentTextFrames[0] ) {
myParas
.select();
alert( "Gotcha! … ;-)" )
}
}
Best,
Michel
Copy link to clipboard
Copied
Line 08, Michel?
Copy link to clipboard
Copied
The lines 07-08 are just to indicate what paras are found by the script!
What it does with each of them [avoid hyphenation] is relatively accessory (sample)!
Best,
Michel
Copy link to clipboard
Copied
In the Hyphenation panel, you can uncheck (untick) Hyphenate Last Word and Hyphenate Across Column and make this part of your Paragraph style.
Across Column includes Across Page. Would this work for you?
Copy link to clipboard
Copied
I think that may actually solve their problem...I was so focused on the "use GREP to find the last word on a page" part that I didn't step back and think about what was really needed.
Copy link to clipboard
Copied
… And Jane is totally right of course! …
Best,
Michel
Find more inspiration, events, and resources on the new Adobe Community
Explore Now