I am currently using the code
\newsavebox{\FVerbB}
\newenvironment{code}
{\VerbatimEnvironment
\hspace{-0.25cm}
\begin{lrbox}{\FVerbB}
\hspace{-0.29cm}
\begin{BVerbatim}}
{\end{BVerbatim}
\hspace{-0.29cm}
\end{lrbox}
\fcolorbox{blue!0}{gray!30}{\usebox{\FVerbB}}
}
I have decreased the horizontal size of the box by adding hspace{-0.29cm}
. I would like to do something similar for the vertical size of the box...i.e. I would like to include a vspace{-0.1cm}
somewhere in this code, but I can't figure out where to put it. Any suggestions? Thanks so much in advance!
Update: the suggestions for the vertical resizing have worked brilliantly. But I have run into an issue with the box extending too far out in front of the enclosed text. Below is an example.
I don't like that there is no space before the word "is". Any thoughts on how to fix this? Thanks so much!
\fcolorbox{blue!0}{gray!30}{\raisebox{0.1cm}{\usebox{\FVerbB}}}
. If you want to actually resize a box, the\addvbuffer
macro of theverbatimbox
package can do that (under certain constraints), but it is not clear, as egreg notes, what exactly you are trying to accomplish.