I have words in my text that contains underscores and that exceeds the boundaries of the page
the word is typed in the text as
FOS\_SOCIAL\_SCIENCE
I want the word to be able to hyphenate at the underscore boundaries.
I have tried:
\hyphenation{FOS-\_-NA-TU-RAL-\_-SCIEN-CE}
but pdfLatex return the following error
Improper \hyphenation will be flushed. \hyphenation{FOS-_
I don't want to use the underscore
package due to incompatibilities
I also tried
\renewcommand{\_}{%
\textunderscore\nobreak\hspace{0pt}%
}
which doesn't work: compile without errors but the word is not hyphenated
I also tried:
\def\_{\_\allowbreak\hspace{0pt}}
which does not compile. The error message is:
TeX capacity exceeded, sorry [input stack size=5000]. \item[FOS_NATURAL_SCIENCE]