Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem with floats and listings. Sometimes it happens that a listing is split over two pages and when a figure is near the listing it happens that the listing starts on the first page, on the next page the figure is on top of the second page and below the figure the listing continues. Is it possible to let the remainder of the listing be on the top of the second page and the figure start below the listing or on top of the third page?

share|improve this question

1 Answer

Without a supplied example, this is untested but you can place

\global\csname @topnum\endcsname 0

after the listings environment to prevent top floats on that page (or more exactly prevent top floats on a page near there, without a forced page break the timing is a bit delicate).

share|improve this answer
well... i dont know what that command means but it solved two of my issues. :) Some others i solved by rearranging the figures and lstinputlisting. I will try to put a MWE. Thanks so far :) – Joysn Nov 12 '12 at 22:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.