
Page Layout ⇒ a way to move selected words to the new row
a way to move selected words to the new row
Hello, the question is included in the topic
Is it possible to use command for whole document, which will allow to move some words (for example i dont want to leave on the end of the row words as "and", "with", etc.) to the next line (row below)?

- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
a way to move selected words to the new row
With pdflatex or xelatex: No.
With lualatex it could be possible to detect such words and replace the space after it by a non-breakable space. But I do not know much about the callbacks for nodes etc. so I cannot write the lua code for this.
Alternatively you could pre-process the document code using awk, sed or perl to replace the space after such words by a
However: Doing so would make it much harder to break the paragraphs into lines. So TeX would more often report underfull oer overfull \hboxes. So I would not recommend to do this unless you are using something like
With lualatex it could be possible to detect such words and replace the space after it by a non-breakable space. But I do not know much about the callbacks for nodes etc. so I cannot write the lua code for this.
Alternatively you could pre-process the document code using awk, sed or perl to replace the space after such words by a
~
or to immediately add \nobreakspace
after such words.However: Doing so would make it much harder to break the paragraphs into lines. So TeX would more often report underfull oer overfull \hboxes. So I would not recommend to do this unless you are using something like
\RaggedLeft
(from ragged2e).Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. 
