I am trying to ident my source code in a frame using the listing package. An example code is given below:
\documentclass[article]{llncs}
\usepackage[english]{babel}
\usepackage[english]{varioref}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{color}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{listings}
\lstset{basicstyle=\ttfamily\small\color{RoyalBlue}}
\usepackage{csquotes}
\usepackage{xcolor}
\begin{document}
\begin{lstlisting}[rulecolor=\color{black},frame=single,label={lst:dir},caption= example code that overflows the frame]
sssssssss sssss sssssssss ssssssssssss sssssssssssssssssssssssssss
\end{lstlisting}
\end{document}
The problem is some part of the code(letter "s") overflows the frame. I would really appreciate it if someone can suggest any solution for this problem. Please note that I don't want to use linebreaks or any thing similar. In fact I don't want to disturb my code at any cost! Thank you!


columns=flexibleor evencolumns=fullflexiblewith variable-width typewriter font (\usepackage[variablett]{lmodern}). Or decrease the font size. And the line lengths of the source file should be limited. – Heiko Oberdiek Aug 19 '13 at 20:32\tinywon't change the width as much as you'd like it to. Good code should also wrap to around 80 characters; there is never any reason it cannot. (Edit: almost never.) – Sean Allred Aug 19 '13 at 21:00