Thread: [MiKTeX] Change skip size between Verbatim environments
MiKTeX source code moved to GitHub
Brought to you by:
csc
From: Duncan M. <mu...@st...> - 2007-01-25 17:50:56
|
Using fancyvrb, if I do something like this \documentclass{article} \usepackage{fancyvrb} \begin{document} \begin{Verbatim} line 1 line 2 \end{Verbatim} \begin{Verbatim} line 3 line 4 \end{Verbatim} \end{document} then I get a bigger space between lines 2 and 3 than between the other pairs. (I get the same effect with the standard verbatim environment, of course.) What length controls this spacing? I'd like to define my own Verbatim environments that would show the two blocks in different colours (they are input and output from a program), but I don't want extra space between them. Duncan Murdoch |
From: Duncan M. <mu...@st...> - 2007-01-27 16:57:02
|
On 1/25/2007 12:50 PM, Duncan Murdoch wrote: > Using fancyvrb, if I do something like this > > \documentclass{article} > \usepackage{fancyvrb} > \begin{document} > > \begin{Verbatim} > line 1 > line 2 > \end{Verbatim} > \begin{Verbatim} > line 3 > line 4 > \end{Verbatim} > \end{document} > > then I get a bigger space between lines 2 and 3 than between the other > pairs. (I get the same effect with the standard verbatim environment, > of course.) > > What length controls this spacing? I'd like to define my own Verbatim > environments that would show the two blocks in different colours (they > are input and output from a program), but I don't want extra space > between them. I found the answer by Googling: it's the \topsep length that adds the extra space. To set it to zero for all fancyvrb Verbatim environments, use \fvset{listparameters={\setlength{\topsep}{0pt}}} To set it for just one, use \DefineVerbatimEnvironment% {verbcode}{Verbatim}{xleftmargin=2.5mm,listparameters={\setlength{\topsep}{2ex}}} Duncan Murdoch |