如何在一页中设置两张表格

如何在一页中设置两张表格

我正在使用 Overleaf

我的论文审阅者说我应该将两个表格水平放在同一页上。

我试过了,但我做的每一件事仍然在两页上

我知道这两个表格的宽度很大,它们无法水平容纳一页,但它们应该垂直容纳。

这是我的文本

\documentclass[sn-mathphys,Numbered]{sn-jnl}% Math and Physical Sciences Reference Style

\usepackage{graphicx}%
\usepackage{multirow}%
\usepackage{amsmath,amssymb,amsfonts}%
\usepackage{amsthm}%
\usepackage{mathrsfs}%
\usepackage[title]{appendix}%
\usepackage{xcolor}%
\usepackage{textcomp}%
\usepackage{manyfoot}%
\usepackage{booktabs}%
\usepackage{algorithm}%
\usepackage{algorithmicx}%
\usepackage{algpseudocode}%
\usepackage{listings}%
\usepackage{makecell}%


\theoremstyle{thmstyleone}%
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}% 

\theoremstyle{thmstyletwo}%
\newtheorem{example}{Example}%
\newtheorem{remark}{Remark}%

\theoremstyle{thmstylethree}%
\newtheorem{definition}{Definition}%

\raggedbottom


\begin{document}

\title[Article Title]{my paper}


\author*[1]{\fnm{A} \sur{M} \orcid{00}}\email{a}

\author[1]{\fnm{n} \sur{si} \orcid{0000}}\email{dau}
%\equalcont{These authors contributed equally to this work.}


\affil*[1]{\orgdiv{cccc}, \orgname{ University}, \orgaddress{\city{Townsville}, \postcode{4811}, \state{Queensland}, \country{Australia}}}


\abstract{bla bla s.}

\keywords{ Coding}

\maketitle

\section{Introduction}
intro

\section{Background}
\subsection{a}
bla 



\begin{sidewaystable}
\caption{Dataset a.}
\label{table_FinalDataset}
\begin{tabular*}{\textwidth}{@{\extracolsep\fill}ccccccccccc}
\toprule%
& \multicolumn{5}{@{}c@{}}{Features} & \multicolumn{5}{@{}c@{}}{ICDs} \\
\cmidrule{2-6}\cmidrule{7-11}%
\textbf{\makecell{Report\\ID}} & \textbf{K0004482}  & \textbf{K0224473} & \textbf{G0719349}
& \textbf{U0230431} & \textbf{W0420607} & \textbf{295}
& \textbf{300}  & \textbf{303}  & \textbf{540}
& \textbf{560}\\
\midrule
            1012    &6  &0  &0  &4  &2  &0  &1  &1  &0  &0\\            
            1013    &0  &2  &2  &8  &0  &1  &1  &0  &0  &1  \\          
            1014    &0  &0  &4  &4  &9  &1  &0  &1  &0  &0  \\ 
            \botrule
\end{tabular*}
\end{sidewaystable}

\begin{sidewaystable}
\caption{Data b.}
\label{table_BinaryArray}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} cccccccccc}
\toprule

%\multirow{2}{*}{\textbf{Report ID}}
%& \multicolumn{5}{c}{\textbf{Features}}
 \textbf{Diagnosis}
& \textbf{Rep 1}    & \textbf{Rep 2}    & \textbf{Rep 3}
& \textbf{Rep 4}    & \textbf{Rep 5}    & \textbf{Rep 6}
&  \textbf{Rep 7}   & \textbf{Rep 8}
& \textbf{Rep 9}\\

\midrule
            295 &1  &1  &0  &0  &0  &0  &1  &1  &0\\            
            303 &0  &1  &0  &0  &0  &1  &0  &1  &0\\            
            560 &0  &0  &1  &1  &0  &1  &0  &1  &1\\
\bottomrule
\end{tabular*}
\end{sidewaystable}



\end{document}

答案1

好消息:你所要做的就是更换

\end{sidewaystable}

\begin{sidewaystable}

\vspace{2cm}

如果你愿意做额外的工作,我还建议你去掉不必要的大胆的表格标题中的单元格。

在此处输入图片描述

\documentclass[sn-mathphys,Numbered]{sn-jnl}

\providecommand\orcid[1]{#1} % ??

\usepackage{graphicx}
\usepackage{multirow}
\usepackage{amsmath,amssymb} % amssymb loads amsfonts automatically
\usepackage{amsthm}
\usepackage{mathrsfs}
\usepackage[title]{appendix}
\usepackage{xcolor}
%\usepackage{textcomp} % not necessary
\usepackage{manyfoot} % really?
\usepackage{booktabs}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\usepackage{listings}
\usepackage{makecell}

\theoremstyle{thmstyleone}%
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}% 

\theoremstyle{thmstyletwo}%
\newtheorem{example}{Example}%
\newtheorem{remark}{Remark}%

\theoremstyle{thmstylethree}%
\newtheorem{definition}{Definition}%

\raggedbottom

\begin{document}

\title[Article Title]{my paper}

\author*[1]{\fnm{A} \sur{M} \orcid{00}}\email{a}

\author[1]{\fnm{n} \sur{si} \orcid{0000}}\email{dau}

%\equalcont{These authors contributed equally to this work.}

\affil*[1]{\orgdiv{cccc}, \orgname{ University}, \orgaddress{\city{Townsville}, \postcode{4811}, \state{Queensland}, \country{Australia}}}

\abstract{bla bla s.}

\keywords{ Coding}

\maketitle

\section{Introduction}
intro

\section{Background}
\subsection{a}
bla 



\begin{sidewaystable}
\setlength\tabcolsep{0pt} % <-- new

\caption{Dataset a.}
\label{table_FinalDataset}
\begin{tabular*}{\textwidth}{@{\extracolsep\fill} l *{10}{c} }
\toprule
Report ID & \multicolumn{5}{c}{Features} & \multicolumn{5}{c}{ICDs} \\
\cmidrule{2-6} \cmidrule{7-11}
& K0004482 & K0224473 & G0719349 & U0230431 & W0420607 & 
295 & 300 & 303 & 540 & 560\\
\midrule
            1012    &6  &0  &0  &4  &2  &0  &1  &1  &0  &0\\            
            1013    &0  &2  &2  &8  &0  &1  &1  &0  &0  &1  \\          
            1014    &0  &0  &4  &4  &9  &1  &0  &1  &0  &0  \\ 
\bottomrule
\end{tabular*}

%\end{sidewaystable}
%
%\begin{sidewaystable}

\vspace{2cm} % <-- new

\caption{Dataset b.}
\label{table_BinaryArray}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l *{9}{c} }
\toprule

Diagnosis & Rep 1 & Rep 2 & Rep 3 & Rep 4 & Rep 5 & Rep 6 & Rep 7 & Rep 8 & Rep 9 \\

\midrule
            295 &1  &1  &0  &0  &0  &0  &1  &1  &0\\            
            303 &0  &1  &0  &0  &0  &1  &0  &1  &0\\            
            560 &0  &0  &1  &1  &0  &1  &0  &1  &1\\
\bottomrule
\end{tabular*}

\end{sidewaystable}

\end{document}

相关内容