# Listings without a border?

I'm using listings to format blocks of code in my LaTeX, and I like it. But, except for large blocks of code, the border around the code block is bulky and breaks up the flow of how I read the document. I've tried searching around for a way to disable this code, but thus far I haven't found anything. Is it just impossible? Seems strange if this is the case.

Use the available options for the selected lstlisting environments; a litle example in which the style selected uses numbers to the left and a frame on the four sides of the listing; using frame=<valid values> and numbers=<valid values> one can change the behaviour for selected environments (for a list of all the keys and their <valid values> refer to the package documentation):

\documentclass{article}
\usepackage{listings}
\lstset{
basicstyle=\small\ttfamily,
frame=lrtb,
numbers=left
}

\begin{document}

\begin{lstlisting}
test
\end{lstlisting}

\begin{lstlisting}[frame=none]
test
\end{lstlisting}

\begin{lstlisting}[frame=bt,numbers=none]
test
\end{lstlisting}

\end{document}


• Awesome! Then as a follow-up question, is it possible to selectively enable borders, or otherwise specify options specific to a particular block? For example, if I normally didn't want to display line numbers, but I want to use them on some. Oct 10 '12 at 1:53
• @limp_chimp of course, see my updated answer. Oct 10 '12 at 2:02