I have a text like:
Lorem ipsum dolor sit amet, consetetur BRANDNAME sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
And LaTeX breaks the lines like
Lorem ipsum dolor sit amet, consetetur BRANDNAME
sadipscing elitr, sed diam nonumy eirmod tem-
por invidunt ut labore et dolore magna ali-
quyam erat, sed diam voluptua. At vero eos et
accusam et justo duo dolores et ea rebum.
Instead I would it expect to do something like:
Lorem ipsum dolor sit amet, consetetur
BRANDNAME sadipscing elitr, sed diam nonumy ei-
rmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos
et accusam et justo duo dolores et ea rebum.
I have no idea how to break latin syllables, but I hope the problem got obvious. The name has to be completely capitalized and not wrapped, but the layout should also not be destroyed. I'm using PdfLaTeX as compiler and the Harvard style. This problem only affects completely capitaized words at the end of a line. I'm a bit surprised that I didn't find anyone else encountering the same problem earlier…
Best Answer
The optimal way to handle this would be use a macro (for convenience and consistency) and adjust
\emergencystretch
to suit your needs:The above macro inserts letters around
\BRANDNAME
(set as an unbreakable\mbox
) to identify whether the break would flush it to the following line.\emergencystretch
is set to 10% more of the width of\BRANDNAME
to allow for the line-breaking algorithm to check a third time during paragraph setting whether adjustments should be made.You may have to reset
\emergencystretch
to0pt
when you don't need it.During paragraph assembly, TeX attempts (perhaps multiple times) to lay out the lines in an optimal way.
Read TeX by Topic, specifically section 19.2 The process of breaking (p 179). Here is an excerpt: