LaTeX 中的表格:使用两列模板将表格放在单列中

问题描述

我正在处理 LaTeX 背页。我正在使用两列的 IEEE 访问模板。我必须将我的表固定在一个列中。你能告诉我我该怎么做吗?

代码

\begin{table}[h]
\centering
\caption{Comparison table}
\label{tab2}
\begin{tabular}{@{}p{3cm}lllll@{}}
\toprule
\multicolumn{1}{}{}Metric
&\cite{dagher2018ancile} &\cite{tripathi2020sms} &\cite{zheng2018blockchain} &\cite{gordon2018blockchain}
&Our architecture\\ \midrule

User Centric         & Y & N & Y & Y & Y\\
User Authentication  & N & N & N & N & Y \\
Privacy of data owner  & Y & Y & Y & Y & Y\\
Store personal data into blockchain & N & N & N & N & Y\\
Transparent policy & N & N & N & N & Y\\
Use of cryptographic functions & N & Y & Y & N & Y\\
Blockchain based &  Y & Y & Y & Y & Y\\
\bottomrule
\end{tabular}
\end{table}

解决方法

IEEEtran.cls 文档类提供环境 table*,排列在一列而不是默认的两列:

\documentclass{IEEEtran}
\usepackage{lipsum,booktabs}

\begin{document}
\lipsum[1]

\begin{table*}[h]
  \centering
  \caption{Comparison table}
  \label{tab2}
  \begin{tabular}{@{}p{3cm}lllll@{}}
    \toprule
    \multicolumn{1}{}{}Metric & \cite{dagher2018ancile} & \cite{tripathi2020sms} & %
      \cite{zheng2018blockchain} & \cite{gordon2018blockchain} & Our architecture\\
    \midrule
    User Centric                        & Y & N & Y & Y & Y\\
    User Authentication                 & N & N & N & N & Y \\
    Privacy of data owner               & Y & Y & Y & Y & Y\\
    Store personal data into blockchain & N & N & N & N & Y\\
    Transparent policy                  & N & N & N & N & Y\\
    Use of cryptographic functions      & N & Y & Y & N & Y\\
    Blockchain based                    & Y & Y & Y & Y & Y\\
    \bottomrule
  \end{tabular}
\end{table*}

\lipsum[2-16]

\end{document}

我使用包 lipsum 只生成我需要的盲文。输出:

screenshot of output pdf

另见this very related thread

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...