GeneralTables explicitly placed in a new page whose mode landscape

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
JoKo
Posts: 19
Joined: Tue Aug 12, 2008 11:28 am

Tables explicitly placed in a new page whose mode landscape

Post by JoKo »

It seems writing my thesis in LaTeX is harder than what I expected, doh!

I have several tables now created, that are looking good thanks to people from these forums. There is only a slight problem, all the tables appear at the end of chapter, instead of e.g. the end of each section (yes, they are quite big), but that's OK.

My last table has more columns than regular and I was thinking putting it in landscape mode in a separate page. So, I've tried

Code: Select all

{
\newpage
\special{landscape}
\begin{table}[h!]
   ...
\end{table}
}
My tex compiled ok, but the table appears in the end of the chapter along with the other tables and one page with plain text just got in landscape!

Could you help me telling me what's wrong and how to fix it?


Thanks in advance,

JoKo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Tables explicitly placed in a new page whose mode landscape

Post by localghost »

JoKo wrote:It seems writing my thesis in LaTeX is harder than what I expected, doh! [...]
It cannot be harder then writing it with a word processor.
JoKo wrote:[...] I have several tables now created, that are looking good thanks to people from these forums. There is only a slight problem, all the tables appear at the end of chapter, instead of e.g. the end of each section (yes, they are quite big), but that's OK. [...]
Float placement is a very sensible matter. It depends on the rigtht placement parameters for the float environments. From my experience the following works best.

Code: Select all

\begin{table}[!ht]
  ...
\end{table}
If the parameters alone don't help, you can insert a \clearpage (or \cleardoublepage) command right after the float environment. If you want to prevent floating of your tables completely, you can try the \captionof command from the caption package.
JoKo wrote:My last table has more columns than regular and I was thinking putting it in landscape mode in a separate page. [...]
Perhaps the sidewaystable environment that comes with the rotating package is better in this case.

Code: Select all

\begin{sidewaystable}
   ...
\end{sidewaystable}
Note that a table typeset in this environment will open a new page and occupy it completely with any text. Moreover it will be printed where declared in the source.


Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
JoKo
Posts: 19
Joined: Tue Aug 12, 2008 11:28 am

Re: Tables explicitly placed in a new page whose mode landscape

Post by JoKo »

Sidewaystable table was what I was looking for, thanks.

The problem with the order of the table persists, though. Now it's even worse, since referring to my last 2 tables creates ?? instead of proper numbers and links. As I said before, my very first table is very big and goes at the end of the chapter (no matter what I do, caption/captionof/clearpage/cleardoublepage) and the other tables follow it.

(If you think I should create a new topic describing this problem with more explanations, please tell me so).
brlnd
Posts: 15
Joined: Wed Sep 17, 2008 6:50 pm

Re: Tables explicitly placed in a new page whose mode landscape

Post by brlnd »

Your initial table is probably too large to ever get placed with running text above or below it, thus it has to go to a separate page, and its first opportunity for this is at the end of each chapter. Also, the order of tables is kept, so that all other tables are pushed as well.

What you should do, is to enforce that this separate page with your table occurs as soon as possible. Include \usepackage{afterpage} in your preamble, and write \afterpage{\clearpage} right after your table. Then there will be a separate page for your table as soon as the current page has been filled.
JoKo
Posts: 19
Joined: Tue Aug 12, 2008 11:28 am

Re: Tables explicitly placed in a new page whose mode landscape

Post by JoKo »

Cool tip, brlnd! Thanks for your help, I feel I'm getting wiser :D

As for the ??, I was putting the labels of the tables before the caption and somehow this was the problem.

If I want to split the table to two pages, would you recommend using a special package, e.g. longtable?
brlnd
Posts: 15
Joined: Wed Sep 17, 2008 6:50 pm

Re: Tables explicitly placed in a new page whose mode landscape

Post by brlnd »

Yes, you should use a specific package for splitting tables over multiple pages. I have never used it myself, but would have tried longtable.
Post Reply