I would like the landscape tables to appear rotated in the pdf using pdflscape package. However I would still like the text AND figures to float around the table.
As you can see in the portrait view (with afterpage and landscape environments turned off). The 'figure' is correctly placed at the top of page 3. When the afterpage and landscape are turned on the 'table' is correct but the 'figure' is placed BEFORE the table on a separate page.
Is it possible to get the 'figure' on top of page 3 with a rotated-page 'table' on page 2?
Additionally, If the first section of text was smaller I would like the 'figure' float to then be placed at the bottom of page 1.
Portrait with correct placement of 'figure'.
Landscape with rotated 'table' but incorrect placement of 'figure' on p2 instead of top of p3.
MWE:
\documentclass[a4paper,twoside,12pt]{report}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{lipsum} %for dummy text
\begin{document}
\lipsum[1-4]
\begin{figure}[htb]
Testfigure \\
Testfigure \\
Testfigure \\
Testfigure \\
\caption{Figure caption}
\end{figure}
%\afterpage{ %turned off to demonstrate portrait pages
%\begin{landscape} %turned off to demonstrate portrait pages
\begin{table}
\caption{Table Caption}
\begin{tabular}{|p{5cm}|p{9cm}|c}
4&5&6 \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F \\
D&E&F
\end{tabular}
\end{table}
%\end{landscape} %turned off to demonstrate portrait pages
%} %turned off to demonstrate portrait pages
\lipsum[5-10]
\end{document}