[Tex/LaTex] How to draw box around text that contains a verbatim block

framedverbatim

Typically, to box in some text, I use the following:

\fbox {
    \parbox{\linewidth}{
    This is some text! Blah blah blah...
    }
}

However, say I have a verbatim block within that. It will never compile. Anyone know how I could draw a box around text which contains a verbatim block?
I should note that I want to be able to draw a box around not just a verbatim block. For example, I would want to draw a box around something like:

This is text.
\begin{verbatim}
This is some more text.
\end{verbatim}
And this is even more text.

Best Answer

If you just want to frame a verbatim block, you may consider using the fancyvrb package.

\documentclass[10pt]{article}
\usepackage{fancyvrb}
\begin{document}
\begin{Verbatim}[frame=single]
abc
def
\end{Verbatim}
\end{document}
Related Question