Take the 2-minute tour ×
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'd like to place a table on a new page with landscape orientation. To do so, I use

\usepackage{pdflscape}
...
\pagestyle{empty}
\begin{landscape}
\begin{table}[htbp]
\begin{center}
\begin{tabular}{llll}
...
\end{tabular}
\end{center}
\end{table} 
\end{landscape}
\pagestyle{plain}

However, this clears the current page, places the table on the next page with landscape orientation, and restarts typesetting in a new page with portrait orientation.

Question I'd like to place the table on a new page (as it is currently done) but to avoid to clear the current page. Is that possible?

Thanks!

share|improve this question
1  
Do not use center inside table but \centering instead. DO NOT USE FORMATTING environments AROUND floating environments like table or figure. EVERYTHING for it must be placed inside the floating environment. –  Martin Scharrer May 25 '11 at 13:06
1  
Related question: How to wrap text around landscape page. –  Martin Scharrer May 25 '11 at 13:09
    
#Martin Scharrer: Thank you! –  Marco May 25 '11 at 13:14
    
@Macro: I adapted my linked answer to this specific case. The my answer below. (Also note that you need to write @username not #username, but this might just be a typo.) –  Martin Scharrer May 25 '11 at 13:21
add comment

2 Answers

up vote 10 down vote accepted

Similar like my answer to How to wrap text around landscape page I would use \afterpage from the afterpage package to place the table at the next page of where it was declared. Here a non-floating replacement of table is used instead, e.g. the \captionof{table}{...} is used (capt-of or caption) package.

One issue are potential other tables which should be flushed beforehand. Otherwise the non-floating table replacement might appear earlier.

\documentclass{article}

\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}% or use the larger `caption` package

\usepackage{lipsum}% dummy text
\begin{document}
\lipsum % Text before
\afterpage{%
    \clearpage% Flush earlier floats (otherwise order might not be correct)
    \thispagestyle{empty}% empty page style (?)
    \begin{landscape}% Landscape page
        \centering % Center table
        \begin{tabular}{llll}
            A & B & C & D \\
        \end{tabular}
        \captionof{table}{Table caption}% Add 'table' caption
    \end{landscape}
    \clearpage% Flush page
}
\lipsum % Text after
\end{document}
share|improve this answer
    
your answer helped me to solve a long standing issue. Thanks a ton ! –  user6504 Jul 3 '11 at 11:15
    
Super!!! I am glad to see this answer!!! –  FEQ Aug 14 '12 at 17:51
add comment

You could use the sidewaystable environment from the rotating package; a little example:

\documentclass{article}
\usepackage{rotating}

\begin{document}
text text text text
\begin{sidewaystable}
  \centering
  \rule{3cm}{4cm}% to simulate a table
  \caption{A rotated table}
  \label{tab:test}
\end{sidewaystable}
text text text
\end{document}
share|improve this answer
    
I have tried it but it produces the same result as with pdflscape. However, afterpage makes it work, as suggested in the link provided by Martin Scharrer. Thank you very much for your answer! –  Marco May 25 '11 at 13:14
1  
@Marco: sidewaystable and sidewaysfigure let the text flow. I'd be really interested in seeing an example in which the text doesn't flow. Could you please provide such a minimal example? –  Gonzalo Medina May 25 '11 at 18:07
add comment

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.