5

I have a wide table, so I put it into the landscape environment. Unfortunately, the float does not work any more. The new page in landscape begins exactly where I included it.

\documentclass[11pt,titlepage,listof=totoc,bibliography=totoc]{scrartcl}

\usepackage[english]{babel}                 % English language
\usepackage[T1]{fontenc}                    % German characters etc.
\usepackage[utf8]{inputenc}                 % German characters etc.
\usepackage{apacite}                        % For the bibliographystyle
\usepackage{bibgerm}                        % Stylepackage
\usepackage{enumerate}                      % For enumerations
\usepackage{graphicx}                       % For figures
\usepackage{caption}                        % For graphicx-cations
\usepackage{subcaption}                     % For graphicx-subcations
\usepackage{setspace}                       % For line spacing
\usepackage[paper=a4paper,left=35mm,right=35mm,top=30mm,bottom=30mm]{geometry} 
\usepackage{pdflscape}                      % For horizontal format
\usepackage{tabularx}                       % For tables
\usepackage{multirow}                       % For multiple rows in table
\usepackage{float}                          % Prevents moving images with [H] 
\usepackage{acronym}                        % For abbreviations 
\usepackage{url}
\usepackage{color}                          % For coloured texts 

\begin{document}

Text, text ...

\begin{landscape}
\begin{table}[ht]
\centering
    \caption{Example}
\begin{tabular}{l||ccccc|c|c}
    \hline
      & Text & Text & Text & Text & Text & Text & Text \\
    \hline
    Text & 5 & 4 & 2 & 3 & 4 & 3 & \\
    Text & 1 & 0 & 3 & - & 2 & 5 & 5 \\
    \hline
\end{tabular}
\end{table}
\end{landscape}

Text, text ...

\newpage
\bibliographystyle{apacite}
\bibliography{bib}

\end{document}
3
  • please complete your code \documentclass....\end{document}
    – touhami
    Aug 9, 2015 at 15:36
  • a float will go where latex wants to put it; it is independent of the landscape'd page. what would work better is to put the contents of the table, within the float, into a minipage and use \rotate from the graphicx package to turn it sideways. alternatively, get rid of the table float and simply set the tabular within the landxcape environment; for this, you will have to set the caption with \captionof from the capt-of package. Aug 9, 2015 at 15:43
  • Thanks. I chose the suggestion by Harish Kumar. It seems smoother and easyer just to use: \begin{sidewaystable}[ht] \begin{tabular}{...} Text \end{tabular} \end{sidewaystable} Aug 15, 2015 at 15:05

1 Answer 1

8

You can use sidewaystable from rotating package. Just change table to sidewaystable and get rid of landscape environment.

\documentclass{article}
\usepackage{lipsum}
\usepackage{rotating}
\begin{document}
  \lipsum[1]
\begin{sidewaystable}[ht]
\centering
    \caption{Example}
\begin{tabular}{l||ccccc|c|c}
    \hline
      & Text & Text & Text & Text & Text & Text & Text \\
    \hline
    Text & 5 & 4 & 2 & 3 & 4 & 3 & \\
    Text & 1 & 0 & 3 & - & 2 & 5 & 5 \\
    \hline
\end{tabular}
\end{sidewaystable}
  \lipsum
\end{document}
2
  • That seems smooth. The table is sideways, yes. But from that table on, all of them were moved to the very end. Furthermore, 2 pages of Latin text were included... WTF?! :-) Aug 9, 2015 at 16:06
  • @ChristianFu include p in the optional argument (or probably better do not use the [ht] option at all), it's main effect is to make going to end of document more likely. Aug 9, 2015 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .