Replacing line 172 in
does the trick.
More detailed answer
mwbk.cls class, which is loaded internally by the class you use (
mgraph), sets, at lines 171-172,
Contrast these values to those used by Plain TeX (and by the LaTeX kernel):
What are those macros used for? Here is a relevant passage from the TeXbook (bottom of page 96, chapter 14):
Each potential breakpoint has an associated “penalty,” which represents the “aesthetic cost” of breaking at that place. [...] Plain TeX sets
Explain how you could instruct TeX not to make any breaks after explicit hyphens and dashes. (This is useful in lengthy bibliographies.)
and its solution...
\exhyphenpenalty=10000 prohibits all such breaks, according to the rules found later in this chapter. Similarly,
\hyphenpenalty=10000 prevents breaks after implicit (discretionary) hyphens.
... are also relevant.
Apparently, the author of those classes (
mgraph) wanted, by setting
\exhyphenpenalty to such a high value (10000 is considered by TeX as infinitely bad), to prevent any breaks after explicit hyphens and dashes.
However, this also seems to prevent line breaking in listings. In fact, simply decrementing the
\exhyphenpenalty value by one on line 172 in
seems to solve the problem.
public void createVoiceComment(File recodedFile) throws CommentNotAddedException;