I'm getting a few "overfull \hbox" error with compounded words of the "longword1-longword2" kind, with "longword1-" exceeding the margin. This can be solved by defining custom hyphenation ("\long-word1-longword2").
Issue #1: I have many different occurences with different words and I'd like to avoid to manually fix all of them.
Issue #2: I noticed that
\hyphenation{long-word1-longword2}
does not work, maybe because of the hyphen between the two words.
Issue #3: most of these words are defined using glossary package:
\RequirePackage[toc,acronym]{glossaries}
For example, one of the acronyms is defined as
\newacronym{cbm}{CBM}{Condition-based Maintenance}
and when I call it with
...a component (\textit{``\acrlong{cbm}''}) and detect...
the "on-" is exceeding the margin.
I tried the following solutions:
\newacronym{cbm}{CBM}{Condi\-ti\-on-based Maintenance}
\hyphenation{Condi-ti-on-based Condi-ti-on}
and none of them works, while replacing the \acrlong command with the full text Condi-ti-on-based Maintenance does work.
So my questions are:
is there any way to do an automatic hyphenation for these "longword1-" when I am NOT using \acrlong?
is there any way to use custom hyphenation within the \acrlong command?
how do I use \hyphenation{} with words containing a dash?
PS: If it could matter, I'm using book class.
Thank you!
https://tex.stackexchange.com/questions/69275/acronym-does-not-hyphenate-in-text
– Taekwondavide Mar 30 '18 at 17:08xxx\hyph yyy, defining\hyphas\slashis defined by latex; see https://tex.stackexchange.com/q/121955/579 for uses of that command and a pointer to its definition. (\hyphis defined for tugboat for exactly this reason.) – barbara beeton Mar 30 '18 at 21:10