2

This is the code I used:

\lstinputlisting[language=Python,breaklines=true]{seminar_ED.py}

It works fine with displaying the code over multiple pages when I don't add other figures in the text. But when I do, this code is broken into multiple pieces and separated with those figures.

My question is, is there a way to display the code entirely without being separated with figures ? This is how I enter the code for displaying figures:

\begin{figure}[ht,SSDD3]
\makebox[\textwidth][c]{\includegraphics[width=1.17\textwidth]{SSDD3}}%
\label{fig:SSDD3}
\end{figure}

How can I arrange my figures to display before the code, one after another, and then the code to follow the figures in its fullness ? The problem is that the figures are big in size so only one can appear on each page. Optimally, I would like to have top part of a page filled with one figure, and the lower part just blank, without being filled with the Python code.

jub0bs
  • 58,916
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Mensch Jun 29 '14 at 13:00
  • 1
    related: http://tex.stackexchange.com/questions/14522/how-to-avoid-that-listings-are-interrupted-by-floats – jub0bs Jun 29 '14 at 13:12
  • Welcome to the site! I'd say that @Jubobs's link resolves this - let us know if your question is a follow-up, otherwise we might vote to close this as a duplicate :) – cmhughes Jun 29 '14 at 17:35

1 Answers1

2

Place \clearpage before the listing, and all pending floats will be flushed before the listing starts.

David Carlisle
  • 757,742