I have a question on the vertical spacing before and after a verbatim environment.
I prefer to have a blank line between paragraphs. So I have
\setlength{\parskip}{12pt}
in all my tex files.
The problem is I used the verbatim environment a lot (usually with frame=single and sometimes with numbers=left and commandchars).
The the verbatim environment (at least in the way I always use it) always look better if the parskip is 0pt. In other words I do not want to have too much blank vertical space before and after the verbatim environment. But if I do that I would have to do \\ for a blank line separating paragraphs and also \mbox{} if a verbatim is the last thing in a paragraph.
Is there a good solution for this problem? In other words is there a way so that I can set parskip to 12pt and create a new verbatim environment (with frame, numbers, and commandchars) that does not have the extra vertical space before and after the new verbatim environment?
I prefer not to insert negative vertical space because that will cause problems in certain cases and it make the tex file harder to maintain.
For instance instead of:
% ---- FIRST WAY
\setlength{\parskip}{0pt}
This is the first paragraph.
\\
This is the second paragraph.
\begin{Verbatim}[frame=single]
Some verbatim stuff
\end{Verbatim}
End of second paragraph.
\\
This is the third paragraph.
\\
I wish to do this:
% ---- SECOND WAY
\setlength{\parskip}{12pt}
This is the first paragraph.
This is the second paragraph.
\begin{newverbatim}[frame=single]
Some verbatim stuff
\end{newverbatim}
End of second paragraph.
This is the third paragraph.
Thanks.
Hi everyone,
I have a question on the vertical spacing before and after a verbatim environment.
I prefer to have a blank line between paragraphs. So I have
\setlength{\parskip}{12pt}
in all my tex files.
The problem is I used the verbatim environment a lot (usually with frame=single and sometimes with numbers=left and commandchars).
The the verbatim environment (at least in the way I always use it) always look better if the parskip is 0pt. In other words I do not want to have too much blank vertical space before and after the verbatim environment. But if I do that I would have to do \\ for a blank line separating paragraphs and also \mbox{} if a verbatim is the last thing in a paragraph.
Is there a good solution for this problem? In other words is there a way so that I can set parskip to 12pt and create a new verbatim environment (with frame, numbers, and commandchars) that does not have the extra vertical space before and after the new verbatim environment?
I prefer not to insert negative vertical space because that will cause problems in certain cases and it make the tex file harder to maintain.