Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
head & head & head \\
\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
head & head & head & head & head & head \\
...
\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.

share|improve this question
    
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
add comment

1 Answer

up vote 3 down vote accepted

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
    head & head & head \\
    \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}

enter image description here

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.