I cannot get listings package to break lines with any of the methods described in previous questions: Listings package does not break, https://stackoverflow.com/questions/981020/how-to-force-line-wrapping-in-listings-package
This problem appears only when using mwrep document class. In report or article line-breaks work just fine.
Here is my MWE:
\documentclass{mwrep}
\usepackage{listings}
\begin{document}
\begin{lstlisting}[ breaklines=true ]
Some text with a long line that needs to be broken but is not with mwrep documentclass. What should I do about it?
\end{lstlisting}
\end{document}
etoolboxto set\exhyphenpenaltyat the beginning of each environment. – Marco Daniel Aug 10 '12 at 11:50\AtEndEnvironmentis dropped. – lockstep Aug 10 '12 at 15:07\AfterEndEnvironmentthen. – stanwise Aug 10 '12 at 15:22