[comp.text] LaTeX seems not to obey the rules.

herndon@mingus.SRC.Honeywell.COM (William Herndon) (06/22/89)

    In a document that I am creating using LaTeX, I need to place a
    pair of data structures on facing pages at the top of their
    respective pages.  There will also be text starting on the
    even-side page just below the first structure and continuing, if
    necessary, onto the odd-side page below the second structure.

    I have found that the easiest way to do this is to immediately
    place both structures into separate figures using the figure 
    environment.  I also restrict their placement to the top of
    the page only and set the counter 'totalnumber' ( the maximum
    number of figures that can appear on a page ) to one.

    This would seem a straight-forward way to solve the problem and 
    works fine when there is enough text to cause the even-side page
    to fill up, forcing some text to be placed on the odd-side page.
    However, when there is not enough text to spill over onto the 
    odd-side page the structure on that page comes out centered,
    regardless of the fact that I explicitly restricted it to the top.

    Now, I am by no means an expert on LaTeX, but I am guessing that,
    when figures are created, glue with a very high amount of stretch
    ( correct terminology? ) is added to both sides.  If there is no
    text to take up the rest of the page, the glue stretches and
    "snaps" the figure to the center.  

    Am I on the right track?  Can anybody suggest a way to get around 
    this problem?  Help, the book ( LaTeX by Lamport ) doesn't say 
    anything that explains this behavior!  In fact, the rules govern-
    ing figures seem to indicate that this should not be happening.
    Thanks in advance.


                                                         - Max


----------------------------------------------------------------------
William R. Herndon                      WHerndon@cim-vax.honeywell.com 
                                        herndon@src.honeywell.com
SCTC, Honeywell 	                
2855 Anthony Ln. So. #130               (612) 782-7108
St. Anthony, Mn. 55418

    The opinions expressed are solely those of the author.  Any resemblance 
       to other opinions, either living or dead, is purely coincidental.

 

leichter@CS.YALE.EDU (Jerry Leichter) (06/23/89)

In article <24349@srcsip.UUCP>, herndon@mingus.SRC.Honeywell.COM (William Herndon) writes...
> 
>    In a document that I am creating using LaTeX, I need to place a
>    pair of data structures on facing pages at the top of their
>    respective pages.  There will also be text starting on the
>    even-side page just below the first structure and continuing, if
>    necessary, onto the odd-side page below the second structure.
> 
>    I have found that the easiest way to do this is to immediately
>    place both structures into separate figures using the figure 
>    environment.  I also restrict their placement to the top of
>    the page only and set the counter 'totalnumber' ( the maximum
>    number of figures that can appear on a page ) to one.
> 
>    This would seem a straight-forward way to solve the problem and 
>    works fine when there is enough text to cause the even-side page
>    to fill up, forcing some text to be placed on the odd-side page.
>    However, when there is not enough text to spill over onto the 
>    odd-side page the structure on that page comes out centered,
>    regardless of the fact that I explicitly restricted it to the top.
> 
>    Now, I am by no means an expert on LaTeX, but I am guessing that,
>    when figures are created, glue with a very high amount of stretch
>    ( correct terminology? ) is added to both sides.  If there is no
>    text to take up the rest of the page, the glue stretches and
>    "snaps" the figure to the center.  
> 
>    Am I on the right track?  Can anybody suggest a way to get around 
>    this problem?  Help, the book ( LaTeX by Lamport ) doesn't say 
>    anything that explains this behavior!  In fact, the rules govern-
>    ing figures seem to indicate that this should not be happening.

If I understand the situation you are describing correctly, the "no text to
spill over" case can only be occuring at the end of the document, or perhaps
at the end of a chapter.  What you are seeing is the result of the way LaTeX
deals with floats, and the complex way it interacts with TeX's float handling
primitives.  Explaining the details would get very involved, but basically
the only way for something to get set as a top or bottom float is as part of
producing a page of output - which can only happen when something actually
gets contributed to the page.

In your problem situation, the final figure is waiting for something to appear
on the page so it can get inserted at the top.  But nothing ever gets inser-
ted, so it just waits.  When the chapter or document ends, LaTeX does an
implicit \clearpage, which forces all waiting floats to be output immediately.
However, they are output ONLY as page of floats objects - this is LaTeX's
"last chance" loop for these objects, and any restrictions you made on place-
ment are ignored.  This is actually described in the LaTeXbook, at the top
of page 91.

You are asking for more control over placement than the mechanisms you are
using can give you.  I can't think of any simple way to get the effect you
want automatically.  If you KNOW that the text on the next-to-last page is
too short, you can insert

	\newpage\mbox{}\newpage

after it, which should create an empty page onto which LaTeX can place the
top figure.
							-- Jerry