# How to make LaTeX treating words with parentheses like a normal word?

In my text, I use (un)conditional (s. here if you wonder why), which causes the text to exceed the right margin - the text is no longer justified.

In minimal working example below, I used (UGLY) which will not cause a line break - in contrast to (PROBLEMATIC), what get's broken after (PROB.

So, in some sense it is the opposite of this question, where the aim was to prevent a line break via \mbox{(UGLY)tempor}. Here I could solve the problem by adding \linebreak in front of (UGLY)tempor, which is not a satisfying solution because some words before the \linebreak might change in future, leading to a misplaced linebreak. To wrap it up: How do I make LaTeX treating (UGLY)tempor as a normal word?

\documentclass[12pt]{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod (UGLY)tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat.
\end{document}


Adding \nobreak\hspace{0pt} prevents a word break, but re-enables hyphenation for what follows.

Alternately, you can make () and [] not break hyphenability, using \lccode (first revealed to me in David's answer to this question, hyphenation next to a parenthesis)

\documentclass{article}
\usepackage{lipsum}
\begin{document}
blah blah blah blah blah blah blah blah blah blah blah blah blah
(un)conditional
blah blah blah blah blah blah blah

blah blah blah blah blah blah blah blah blah blah blah blah blah
(un)\nobreak\hspace{0pt}conditional
blah blah blah blah blah blah blah

blah blah blah blah blah blah blah blah blah blah blah blah bl
(un)\nobreak\hspace{0pt}conditional
blah blah blah blah blah blah blah

\lipsum[1]

\lccode$$\( \lccode$$\)
\lccode$\[ \lccode$\]
blah blah blah blah blah blah blah blah blah blah blah blah blah
(un)conditional
blah blah blah blah blah blah blah
\end{document}


• (un)\nobreak\hspace{0pt}conditional did the job. For lccode my sense of LaTeX is too bad. If you want, you can try to explain it, but you don't need to. Apr 3 '18 at 16:59
• @Qaswed It is a technicality, which causes the hyphenation algorithm to think of () as letters and, therefore, not to branch to the "I came across a non-letter" part of the algorithm. Apr 3 '18 at 17:07
• @Qaswed I would add that the hyphenation algorithm (Appendix H in the TeXbook) does not seek actual words, but rather, starting at the beginning of the word, for hyphenation patterns, groups of common adjacent letters that occur at syllable boundaries. So, using the \lccode for () means that (un)conditional is now considered a 15-letter word to the hyphenation algorithm, and the presence of ( and ) do not prevent the algorithm from looking for patterns in what follows the ). Apr 3 '18 at 17:15