4

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}
  • please complete your code \documentclass....\end{document} – touhami Aug 9 '15 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. – barbara beeton Aug 9 '15 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} – ChristianFu Aug 15 '15 at 15:05
7

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}
  • 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?! :-) – ChristianFu Aug 9 '15 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. – David Carlisle Aug 9 '15 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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