# why does my document fail with sideways from rotating package?

I want to test landscape tables, and started with the sideways environment. However the code does not compile, I get the error:

(./content/landscapetable.tex
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.6 \begin{center}


Here is a minimal example:

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{rotating}
\begin{document}
\begin{sideways}
\begin{center}
\centering
%  \captionsetup{type=table}
%  \caption{Sehr breite Tabelle.}
\begin{tabularx}{0.8\textheight}{XXX}
\hline
\hline
text which is considereably longer than
the width of the column &
text which is considereably longer than
the width of the column &
text which is considereably longer than
the width of the column \\
\hline
\end{tabularx}
\end{center}
\end{sideways}
\end{document}


Remove the sideways environment, and it compiles.

EDIT: when the center env is removed, and centering is left and the caption is introduced again another error with the caption occurs.

\begin{sideways}
\centering
\captionsetup{type=table}
\caption{Sehr breite Tabelle.}
\begin{tabularx}{1.0\textheight}{*{6}{X}}
\hline
...
\end{tabularx}
\end{sideways}


The error is then

! Missing \endgroup inserted.
<inserted text>
\endgroup
l.5 \caption{Sehr breite Tabelle.}


With sidewaystable it works, but that is not what I want.

-
For the record another solution is given [Question 96354][1] [1]: tex.stackexchange.com/questions/96354/sideways-figures/… –  c05772 Feb 2 '13 at 19:22

Why both \centering and the center environment? Remove the latter and the example compiles fine.

(New solution, based on comment.)

If you did not want to rotate the caption, why put the caption in the sideways environment? What you could do is to place the table in a normal table environment, and then put just the tabularx in sideways.

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{rotating}
\begin{document}
\begin{table}
\centering
\captionsetup{type=table}
\caption{Sehr breite Tabelle.}
\begin{sideways}
\begin{tabularx}{0.8\textheight}{XXX}
\hline
\hline
text which is considereably longer than
the width of the column &
text which is considereably longer than
the width of the column &
text which is considereably longer than
the width of the column \\
\hline
\end{tabularx}
\end{sideways}
\end{table}
\end{document}


On the other hand, I think it would be better to use sidewaystable, and have the caption rotated as well. Having to turn the page between reading the caption and reading the table would be awkward and inconvenient.

-
I know booktabs, but this was a minimal example. sidewaystable is something different (the caption is rotated too), which I do not want. I updated the question with a new error –  Matthias Pospiech Nov 16 '11 at 10:09
@MatthiasPospiech Ah, I see. You should add a line stating what you do want to your question as well, just to make it clear (tabular rotated, caption not rotated). –  Torbjørn T. Nov 16 '11 at 10:28