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 is 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.
Line boxesThe command \text creates a line box that creates a line box and is used to typeset the argument without breaking lines and is taken as a single character. This makes the argument extend into the margin. For example, the command \text{speaker} treats the seven characters of the word as one.
The \makebox command creates a box to contain the text specified. The width of the box is specified by the optional width argument. The position of the text within the box is determined by the optional position argument. The \mbox command creates a box just wide enough to hold the text created by its argument.
The verbatim environment is used to display LaTeX commands instead of having them executed. To display a single command in-line, the \verb|| command can be used. To display a whole block, we can use \begin{verbatim} to open the environment and \end{verbatim} to close it.
Easier: use the fancyvrb
package.
\begin{Verbatim}[frame=single]
stuff
\end{Verbatim}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With