I am trying to use the \listing package to include some .cpp files into my article.
I add:
\usepackage{listings}
And then I use \lstinputlisting[language=c++]{File.cpp}
The problem is that the width is not adjusted, so the code is cutted.
Which is the solution?
You’ll be looking for the setting
breaklinesset in\lstsetlike so:Now
listingswill try and break the lines neatly.For more information about what can be set with
\lstset, see the article on LaTeX Wikibook.