My verbatim environment allows text to go way beyond margins and off the page, I am using the \begin{alltt} version though. Below is my entire preamble:
\documentclass{llncs}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{courier}
\usepackage{alltt}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\newcommand{\imp}[1]{\underline{\textbf{#1}}}
\newcommand{\bo}[1]{\textbf{#1}}
\newcommand{\colour}[2][Blue]{\textcolor{#1}{#2}}
\newcommand{\ita}[1]{\textit{#1}}
\newcommand{\pic}[2]{\centerline{\includegraphics[0.7\textwidth]{#2}}}
\newcommand{\wpic}[3][\dimexpr\textwidth-1em\relax]{%
\par\noindent\mbox{%
\begin{minipage}{0.4\textwidth}
\includegraphics[width=#1]{#2}
\end{minipage}%
\begin{minipage}{0.6\textwidth}
#3
\end{minipage}}
\par}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\tab}{\hspace{15pt}}
Can anyone help me to get the \begin{alltt} to fit my code within the text margins?
allttin conjunction withlistings? This post might help: tex.stackexchange.com/questions/48711/… – hpesoj626 Nov 30 '12 at 4:30verbatimis required to obey everything you write, so there's no surprise there. however,ttfonts in general don't allow hyphenation, so they are inevitably prone to overrunning margins, hence theallttproblem. – wasteofspace Nov 30 '12 at 8:02verbatimyou meanalltt, it's possible that localized\raggedrightmight help. – barbara beeton Dec 1 '12 at 19:30