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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having a problem with latex environment. When I place r code using \begin{lstlisting} ... code..\end{lstlisting} other objects like tables are displayed only after the script subsections, despite it maintains the order in the content table page.

Anyone knows how can I control this issue? here is my preamble:

numbers=left, numberstyle=\tiny, 
columns=fullflexible }
\newcommand{\ra} [1] {\renewcommand{\arraystretch} {#1} }
share|improve this question

migrated from stackoverflow.com Jan 31 '13 at 22:56

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner Jan 31 '13 at 23:11

It's hard to tell given no example, but placing \clearpage before your listing will stop floating figures and tables going past it.

share|improve this answer
That works fine. Thanks – user792000 Feb 1 '13 at 0:53

Your Answer


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.