General ⇒ Rotating tables
Rotating tables
I am trying to rotate my tables and their captions.
I have tried to use the package rotating, so that I can use \rotatebox{90}{}. However, this does not rotate my caption, as it has to be within the table environment.
I then tried the sidewaystable environment, but this rotates the table by 270 degrees if the pages are even and by 90 degrees for odd pages. I require the table on the even page to be rotated by 90, as two tables are on consecutive (first even then odd) pages. Then the reader would only need turn the document once to be able to read both tables simultaneously, making comparisons easier.
Any ideas?
I have tried to use the package rotating, so that I can use \rotatebox{90}{}. However, this does not rotate my caption, as it has to be within the table environment.
I then tried the sidewaystable environment, but this rotates the table by 270 degrees if the pages are even and by 90 degrees for odd pages. I require the table on the even page to be rotated by 90, as two tables are on consecutive (first even then odd) pages. Then the reader would only need turn the document once to be able to read both tables simultaneously, making comparisons easier.
Any ideas?
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: Rotating tables
what about the lscape package? Use the "landscape" environment. I don't know if the caption willl rotate with the table, but I belive so.
Rotating tables
Thanks Ledurt
That worked well. The only problem now is that the table is left-aligned, not centered in the page. I have tried
but this did not work. I then tried
with no success. I then figured that since the table would be on a page on its own anyway, the table location assignment [htb] could be changed to [p], then it would be centered in the page.
This is not an ideal set-up (even though it fulfills my formatting needs), as I may want to rotate the table and its caption by 270 degrees, instead of the 90 that lscape rotates it by. Also, if the table were not to fill an entire page, using the location assignment [p] would waste valuable space in order to center the table.
I found that using the package pdflscape conveniently turns the page on which the tables are found into landscape mode when compiling to PDF. This makes the tables easier to read in Adobe Reader.
That worked well. The only problem now is that the table is left-aligned, not centered in the page. I have tried
Code: Select all
\begin{center}
\begin{landscape}
\begin{table}[htb]
\end{table}
\end{landscape}
\end{center}
Code: Select all
\begin{landscape}
\centering
\begin{table}[htb]
\end{table}
\end{landscape}
This is not an ideal set-up (even though it fulfills my formatting needs), as I may want to rotate the table and its caption by 270 degrees, instead of the 90 that lscape rotates it by. Also, if the table were not to fill an entire page, using the location assignment [p] would waste valuable space in order to center the table.
I found that using the package pdflscape conveniently turns the page on which the tables are found into landscape mode when compiling to PDF. This makes the tables easier to read in Adobe Reader.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rotating tables
The rotating package provides two options turn and rotate, which could do the right alignment for your tables. Search for "rotating.dvi" on your system. I found it in the texmf tree.
Then the normal usage of the sidewaystable environment will do the trick.
Code: Select all
%TEXMF%\doc\latex\rotating
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Rotating tables
Hello. When using the "rotating" package, try
\begin{sidewaystable}[!htbp]
\begin{tabular}...
...
\end{tabular}
\caption{...}
\end{sidewaystable}
That code works when compiling LaTeX => PDF (i.e., using PDFTeX directly) or LaTeX => PS => PDF (using PDFTeX through PostScript). I don't know if it works compiling LaTeX => DVI.
\begin{sidewaystable}[!htbp]
\begin{tabular}...
...
\end{tabular}
\caption{...}
\end{sidewaystable}
That code works when compiling LaTeX => PDF (i.e., using PDFTeX directly) or LaTeX => PS => PDF (using PDFTeX through PostScript). I don't know if it works compiling LaTeX => DVI.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rotating tables
Here is a supplement to my preceded post. As i recently read in epslatex, the rotating package accepts the options figuresright and figuresleft. That should solve the problem with the sidewaysfigure and sidewaystable environment.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 1
- Joined: Wed Oct 22, 2008 10:31 pm
Re: Rotating tables
help!!!
I need to use:
begin{longtable}
lot of rows and columns
end{longtable}
but i want to rotate this table due that occupies many pages, what can i do?
I need to use:
begin{longtable}
lot of rows and columns
end{longtable}
but i want to rotate this table due that occupies many pages, what can i do?
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Rotating tables
Hi,
you could use the lscape package or pdflscape in the case of pdflatex, put the longtable into a landscape environment.
Stefan
you could use the lscape package or pdflscape in the case of pdflatex, put the longtable into a landscape environment.
Stefan
LaTeX.org admin
Rotating tables
I answer to Frank. With this code the table was rotated and centered in the page:
Code: Select all
\begin{landscape}
\begin{table}[!ht]
\begin{center}
\begin{tabular}{}
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table}
\end{landscape}