[Tex/LaTex] Quote exceeding quote right margins

csquotesline-breaking

I have a quote that displays long chains of words, such as

hippopotamus/hippo

The quote environment does not break words, so I have text exceeding the right margin of the quote. How can I obtain word breaking?

Best Answer

The quote environment of LaTeX does hyphenation and the same is true for the display environments provided by the csquotes package. Your problem is that TeX turns hyphenation off the moment a word contains anything other than letters. So something like explicit hyphens turn this off or \accent commands (a real problem for many languages before TeX had fonts with accented characters), etc. Given your example, anyhting after / is not hyphenated (not that "hippo" is a great thing to hyphenate --- actually TeX would anyway refuse to do that :-) )

If you use \slash instead of / hyphenation at that point is allowed, but the following word is still not hyphenated (see example). So you need to do more to get hyphenation going there, I added a command \Slash below just to do that. The trick is to have the slash followed by some space (the width of this doesn't really matter) as this makes TeX restart its hyphenation for the next word.

\documentclass[draft]{article}

\newcommand\Slash{\slash\hspace{0pt}}  % a / that allows hyphenting next word

\begin{document}

\showhyphens{hippopotamus hippo}  % to see what hyphens we can expect

\parbox{2cm}{hippo/hippopotamus}              \vspace{5pt}  % no hyphenation

\parbox{2cm}{hippo\slash hippopotamus}      \vspace{5pt}  % no hyphenation after /

\parbox{2cm}{hippo\Slash hippopotamus}                          % full hyphenation

\end{document}

I have turned "hippopotamus/hippo" to get any hyphenation. We then get:

enter image description here