Graphics, Figures & Tableslandscape / sidewaystable

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
omkardpd
Posts: 86
Joined: Sun Feb 24, 2008 7:23 am

landscape / sidewaystable

Post by omkardpd »

Hello,

I am using the rotating package for creating a landscape table. The sample code I am using is as follows:

Code: Select all

\begin{sidewaystable}{htbp}
\centering
\begin{tabular}{|c|c|}
\hline
col 1 & col 2 \\
\hline
end{tabular}
\caption{Table XYZ}
\label{tablexyz}
\end{sidewaystable}
By this code I get the "undefined control sequence" error message.

When I remove the command "\caption{Table XYZ}" from the above code, LaTex does generate the table. However, half the table is outside the page. Even by changing margins I could not bring the table on top of the page in the landscape mode.

However, I have been able to print landscape pictures and portrait pictures/tables in the same document. The problem seems to be with the landscape table.

For the reference, I am attaching a copy of the table. May I get some inputs in resolving this problem?

Thank you,

Omkar
Attachments
table.jpg
table.jpg (43.19 KiB) Viewed 6544 times

Recommended reading 2024:

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

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

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

landscape / sidewaystable

Post by localghost »

Get used to always providing a minimal example that clearly reproduces the error and is compilable for everybody as provided. You are not new to the forum so you should know that by now.


Thorsten
omkardpd
Posts: 86
Joined: Sun Feb 24, 2008 7:23 am

Re: landscape / sidewaystable

Post by omkardpd »

Dear Thorsten,

Thank you for the reply.

I understand about the ease the reader will have if I produce a minimal example. Unfortunately, the minimal example in my case does produce a table the way I want. However, in my main document, the table is wrongly printed as shown in my earlier message in this thread. I am producing the minimal example based on my main code.

\documentclass{article}
\usepackage{rotating}
\usepackage{hyperref}

\begin{document}
report data
\begin{sidewaystable}
\centering
\begin{tabular}{|c|c|}
\hline
col 1 & col 2 \\
\hline
\end{tabular}
\caption{Table XYZ}
\label{tablexyz}
\end{sidewaystable}

\end{document}

If you can help me with this, I will sincerely appreciate your support. Regards,

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

landscape / sidewaystable

Post by localghost »

You can only get help if you show us what goes wrong with your code. Therefore you have to narrow down the problem to a document with minimal content as described on the page behind the link in my first reply. Start with copying the table as it is in your document to a new file with minimal code and compile. If you can't manage to cut the problem down, help will be nearly impossible. The compiler is quite clear in its error messages. It gives you the line where the error occurs.

And by the way, the forum software offers a »Code« environment for tagging code as such. You can find the corresponding button in the button list right above the input window while composing a post. It would be very kind if you would use it for posting code [1]. It just improves the legibility of your posts, thus makes it easier to help.

[1] View topic: Avoidable mistakes
Post Reply