[comp.text.tex] lines between floats and text in LaTeX

S.P.Q.Rahtz@ecs.soton.ac.uk (Sebastian Rahtz) (09/29/90)

A colleague asks me the question given below. I can see that it is not
going to be obvious to find out whether there is some following text
on the page when you are in a float, so before I start hacking, has
anyone already done this? or knows that it is impossible?

Sebastian Rahtz

------- Start of forwarded message -------
>From: Stephen Adams <S.R.Adams>
Date: Tue, 25 Sep 90 20:23:53 BST

Is there a style to draw lines between floats and running
text on a page where both occur?

I have seen some latex documents with this but they could
have been produced by the punter putting a line in manually
at the end of every float.

------- End of forwarded message -------

dhosek@sif.claremont.edu (Hosek, Donald A.) (10/01/90)

In article <28404.9009291614@cameron.ecs.soton.ac.uk>, S.P.Q.Rahtz@ecs.soton.ac.uk (Sebastian Rahtz) writes...
>A colleague asks me the question given below. I can see that it is not
>going to be obvious to find out whether there is some following text
>on the page when you are in a float, so before I start hacking, has
>anyone already done this? or knows that it is impossible?

>>From: Stephen Adams <S.R.Adams>
>Date: Tue, 25 Sep 90 20:23:53 BST

>Is there a style to draw lines between floats and running
>text on a page where both occur?

>I have seen some latex documents with this but they could
>have been produced by the punter putting a line in manually
>at the end of every float.

It's possible but has to be done at the output level if you want
something like:

float

---

float


text


or

float

---

float

---

text

---

float


It's largely a matter of adjusting the page-building routines to
insert the rules. (Not all that difficult... maybe an afternoon's
work for someone with a passing knowledge of the LaTeX OTR...
hmm, maybe it is all that difficult after all)

-dh


---
Don Hosek                       TeX, LaTeX, and Metafont support, consulting 
dhosek@ymir.claremont.edu       installation and production work. 
dhosek@ymir.bitnet              Free Estimates.
uunet!jarthur!ymir              Phone: 714-625-0147
                                finger dhosek@ymir.claremont.edu for more info

tgl@g.gp.cs.cmu.edu (Tom Lane) (10/01/90)

In article <28404.9009291614@cameron.ecs.soton.ac.uk>, S.P.Q.Rahtz@ecs.soton.ac.uk (Sebastian Rahtz) writes:
> Is there a style to draw lines between floats and running
> text on a page where both occur?

A few seconds' searching through the LaTeX source (latex.tex)
reveals the following:

%  PAGE STYLE PARAMETERS:
%
%   \textfloatsep   : Space between last top float or first bottom float
%                     and the text.
%   \topfigrule     : Command to place rule (or whatever) between floats
%                     at top of page and text.  Executed in inner vertical
%                     mode right before the \textfloatsep skip separating
%                     the floats from the text.  Must occupy zero vertical
%                     space.  (See \footnoterule.)
%   \botfigrule     : Same as \topfigrule, but put after the \textfloatsep
%                     skip separating text from the floats at bottom of page.
%   \dblfigrule     : Similar to \topfigrule, but for double-column floats.

So something like

\def\topfigrule{\vskip 5pt \hrule height 0.4pt \vskip -5.4pt\relax}
\def\botfigrule{\vskip -5pt \hrule height 0.4pt \vskip 4.6pt\relax}

should do it, assuming you want 5pt between the floats and the rule.
You'd probably also need to change \textfloatsep to make the space
on the other side of the rule be what you want.

In general, looking through the LaTeX source is a wonderful problem solver.
There are a lot of style parameters in there that are not documented in
the manual (why not, Lamport?), and if you don't find one that does what
you want, you'll at least find the TeX code that you need to modify.

-- 
				tom lane
Internet: tgl@cs.cmu.edu
UUCP: <your favorite internet/arpanet gateway>!cs.cmu.edu!tgl
BITNET: tgl%cs.cmu.edu@cmuccvma
CompuServe: >internet:tgl@cs.cmu.edu