this has nothing to do with \emph
. the string that isn't broken has no spaces in it, and it's full of punctuation, so tex has no idea where to break it -- the hyphenation routine simply doesn't work in this situation.
the easiest way to get this to break is to use the url
package, and use the command \url{xxx.xxx.xxx}
to apply a different set of breaking rules. even if this isn't really a url, the same breaking mechanism should be applied.
edit: the OP doesn't want to break the "unbreakable" string. there are a few ways of avoiding such a break:
at the beginning of the paragraph that contains the string, add \begin{sloppypar}
, and add \end{sloppypar}
at the end of the paragraph. this will result in the offending string being moved to the next line, leaving the previous line with unpleasantly wide spaces, and the remainder of the paragraph probably with uneven spacing. this technique will limit the spacing effect to that one paragraph, unlike the suggestion proposed by david carlisle, which will affect the whole document.
just decide to leave the line before that string short, and insert \\
right before it. this will have no adverse spacing effects on the rest of the paragraph, and in the circumstances, will probably produce a more attractive result.
set the string on a line by itself, perhaps treating it as an "equation": \[\text{...}\]
. (\text
requires use of the amsmath
package.)
rephrase the paragraph.
all of these approaches ignore the possibility that the "unbreakable" string may be longer than the document's text width, a situation that is not unknown.
\documentclass{...}
and ending with\end{document}
.url
package to help with breaking of such identifiers\emph
(as you will see if you remove it). If it's just one case, either add manual hyphenation or put an\allowbreak
at suitable points in the package name.