如何在景观环境中浮动表格

如何在景观环境中浮动表格

我有一个宽表,所以我把它放入环境中landscape。不幸的是,浮动不再起作用。新页面的landscape开始位置正是我将其包含的位置。

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

答案1

您可以sidewaystablerotating包中使用。只需更改tablesidewaystable并删除landscape环境即可。

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

相关内容