Forum How do I...?

How to avoid repetition of words at the end of the line

ixgal
Hi,

Is there a way to automatically avoid this type of situations? (please see screenshot attached)

Thanks
  1. prince.png363.7 kB
howcome
You could use the Prince Boxtracking API to analyze the formatted text to detect such patterns. Here's a simple example:

https://css4.pub/2023/boxtracking/#end-of-the-line

When such patterns are detected, you could set CSS properties on the paragraph to change its formatting. E.g., you could constrain hyphenation to avoid subsequent hyphenated lines. Here's a guide:

https://css4.pub/2022/hyphenation/

Edited by howcome

ixgal
Thanks!
Would it work with previous versions of Prince?
howcome
In some versions, yes. You can quickly test if it works in your installation by running Prince on the first example, as described in the guide.

Edited by howcome