开发者

Latex: how to draw box around text that contains a verbatim block

开发者 https://www.devze.com 2023-01-28 09:48 出处:网络
Typically, to box in some text, I use the following: \\fbox { \\parbox{\\linewidth}{ This is some text! Blah blah blah...

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? Like this for example...

\fbox {
    \parbox{\linewidth}{
        \begin{verbatim}
        This i开发者_如何学Pythons some text!
        \end{verbatim}
    }
}

I should not that I re-posted this in tex.stackexchange after CPF pointed out that there was such a thing. Let me know if people are opposed to doubled posting. If not, I'll keep it up here as well.


Easier: use the fancyvrb package.

\begin{Verbatim}[frame=single]
stuff
\end{Verbatim}
0

精彩评论

暂无评论...
验证码 换一张
取 消