1

This question already has an answer here:

The text in my lstlisting is running out of screen on the right. I googled, but only found problems with the code box's position on the left side, and white lines. My problem is that it does not know when to move text to the next line. All below shows as a single line, where most is outside the frame on the right. Any help is much appreciated. I compile using pdflatex.

\documentclass{article}
\usepackage{listings} % Required for insertion of code
\begin{document}
\appendix
\section{Appendix}
\begin{lstlisting}
This random text is going of screen to the right. This random text is going of screen to the right. This random text is going of screen to the right. This random text is going of screen to the right. This random text is going of screen to the right. This random text is going of screen to the right. 
\end{lstlisting}
\end{document}

marked as duplicate by jubobs, user13907, Werner, cslstr, Svend Tveskæg Jan 20 '15 at 16:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.