🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #116

Empty lines arround a verbatim environment

#116
From: Jan Rekers
Date: Fri, 30 Oct 1992 10:24
71 lines
2497 bytes
Could some kind soul explain the following phenomena in latex:

I use the fpbox macro recently posted to surround a verbatim text
with a box. It turns out that this box always has an empty first
line and an empty last line, except in the case that the verbatim
group lies directly after a \section command. Then it only has an
empty last line.

What should I modify to the fpbox macro to get rid of these empty
lines? I should be able to do it, if a section command can do it!

Kind regards,					Jan Rekers

J. Rekers, Department of Computer Science, Leiden University
P.O. box 9512, 2300 RA Leiden, the Netherlands
email: rekers@rulwi.LeidenUniv.nl


The fpbox.sty file contains:

% Create a framed parbox using \begin{fpboxb} ... \end{fpbox}
\def\fpbox{\par 
  \setbox\@tempboxa\vbox\bgroup
    \advance\hsize-2\fboxrule \advance\hsize-2\fboxsep \textwidth\hsize 
}
\def\endfpbox{\egroup\fbox{\box\@tempboxa}\par}


A latex file which demonstrates the problem:

\documentstyle[fpbox]{article}
\begin{document}

\section{The first section}

This is the running text of the first section.
It appears in the tex file between the section command
and the fpbox command.

\begin{figure}
\begin{fpbox}
\begin{verbatim}
This is the verbatim text of the first fpbox.
Note that an empty first and an empty last
line are inserted.
\end{verbatim}
\end{fpbox}
\end{figure}

\section{The second section}

\begin{figure}
\begin{fpbox}
\begin{verbatim}
This is the verbatim text of the second fpbox.
An empty last line is inserted only.
\end{verbatim}
\end{fpbox}
\end{figure}

This is the running text of the second section.
It is preceeded by a fpbox command in the tex file.
Note that the first line of this text in indented,
while it should not.

\end{document}
-- 
J. Rekers, Department of Computer Science, Leiden University
P.O. box 9512, 2300 RA Leiden, the Netherlands
email: rekers@rulwi.LeidenUniv.nl
Technical Details
Message-ID: <1992Oct30.102452.6944@rulway.LeidenUniv.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!rulway.LeidenUniv.nl!elc2!rekers

Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!rulway.LeidenUniv.nl!elc2!rekers
From: rekers@elc2 (Jan Rekers)
Subject: Empty lines arround a verbatim environment
Message-ID: <1992Oct30.102452.6944@rulway.LeidenUniv.nl>
Keywords: latex, verbatim, figure, fpbox, empty lines
Sender: root@rulway.LeidenUniv.nl (System PRIVILEGED Account)
Nntp-Posting-Host: rulwielc2.leidenuniv.nl
Organization: Department of Mathematics and Computer Science, Leiden University
Date: Fri, 30 Oct 92 10:24:52 GMT
Lines: 71