[texhax] Putting a border around verbatim text

Herbert Voss LaTeX at zedat.fu-berlin.de
Fri Aug 4 10:55:54 CEST 2006


James Smith wrote:

> I've previously been shown how to treat my verbatim environments as
> floating by enclosing them in table environments, thus:
> 
> \renewcommand\tablename{Listing}
> 
> ...
> 
> \begin{table}[h]
> \begin{verbatim}
> .
> .
> .
> \end{verbatim}
> \caption{...}
> \label{...}
> \end{table}
> 
> This works fine but now I'd like to put a hairline border around the
> contents of the verbatim environment, not including the caption and also
> leave some padding between the border and content. Is this possible?

use the listings package here.

Herbert




More information about the texhax mailing list