I am changing some Verbatim
blocks to BVerbatim
to avoid page breaks in the middle of some short source code examples:
\documentclass[a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage{fancyvrb}
\usepackage{listings}
\usepackage[scaled=.73]{beramono}
\fvset{baselinestretch=0.94}
\parindent=0pt
\parskip = 6pt
\lstset{
basicstyle=\linespread{0.94}\ttfamily,%
fancyvrb=true,%
}
\begin{document}
Before using Verbatim.
\begin{Verbatim}
foo
bar
\end{Verbatim}
After using Verbatim. \\ Before using BVerbatim.
\begin{BVerbatim}
foo
bar
\end{BVerbatim}
After using BVerbatim.
\end{document}
However, these two have different margin settings. BVerbatim
has less spacing before and after the code block:
How can I adjust BVerbatim
here so that it looks like Verbatim
?
\begin{Verbatim}[samepage=true]
, as described here, is an alternative which doesn't alter the spacing. I am still curious if one can configureBVerbatim
accordingly.