Graphics, Figures & Tableshow to set up float for text surrounding landscape table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
devo
Posts: 3
Joined: Mon Jul 19, 2010 8:30 pm

how to set up float for text surrounding landscape table

Post by devo »

Hi. If I insert a landscape table in the middle of text, it cuts the text off at that point and starts the text after the table on a new page, i.e., it doesn't carry over the text before and after the table so that they're on the same page (as normally occurs with a non-landscape table).

Code: Select all

text
\begin{landscape}
\begin{table}[!htp]\small
\refstepcounter{table}\label{tabl}
\begin{tabular}
%... table information

\end{tabular}
\end{table}
\end{landscape}
more text
Any advice would be greatly appreciated! Cheers!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how to set up float for text surrounding landscape table

Post by localghost »

In most cases there actually is much room for improvement on the table itself in order to avoid rotation. So you might look first where you can modify it to make it match the text width. But for the present you can try the example below.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{rotating}
\usepackage{blindtext}

\begin{document}
  \blindtext

  \begin{table}[!ht]
    \centering
    \begin{minipage}[c]{2\baselineskip}
      \captionsetup{width=6.4cm,singlelinecheck=off}
      \rotcaption{The quick brown fox jumps over the lazy dog}\label{tab:dummy}
    \end{minipage}
    \hspace{6pt}
    \begin{minipage}{4cm}
      \rotatebox{90}{%
        \rule{6.4cm}{3.6cm}
      }
    \end{minipage}
  \end{table}

  \blindtext
\end{document}
For more information refer to the epslatex document (Section 24.3 - The rotcaption command, p. 94).


Thorsten
Post Reply