表格第二列上方的文字

表格第二列上方的文字

我有一个两列模板从这里。我想在其中放置一个表格,\textwidth但表格的后半部分出现在第二列的文本之上,如下所示:

在此处输入图片描述

脚本在这里:

\documentclass[sigconf]{acmart}
\usepackage[T1]{fontenc} %to solve the font error
\usepackage{lmodern}  %to solve the font error
\usepackage{underscore} %underscores
%-------------------------for the table-----------------------------        
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand*\rot{\rotatebox{90}}
\usepackage{tabularx}
\usepackage{threeparttable, tablefootnote}
%-------------------------end table-----------------------------
\usepackage{lipsum}

% Copyright
%\setcopyright{none}
%\setcopyright{acmcopyright}
%\setcopyright{acmlicensed}
\setcopyright{rightsretained}
%\setcopyright{usgov}
%\setcopyright{usgovmixed}
%\setcopyright{cagov}
%\setcopyright{cagovmixed}


\begin{document}
\title{Title}

\subtitle{Test}

\author{Author}
\affiliation{%
  \institution{XYZ}}
\email{abc@xyz}

\begin{abstract}
Abstract goes here. 
\end{abstract}

\maketitle
\section{Introduction}
\lipsum

\noindent \begin{tabularx}{\textwidth}{llX}
\toprule
A & B \\ \midrule

AA and BBBB & aaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj \\
\hline
AA and BBBB &  aaaaabbbbccccddddeeeeffffggggh000000000000000000000000000000000000000000000000000000000000000000000 \\
\bottomrule

\end{tabularx}

\lipsum
\lipsum
\end{document}

答案1

双列文本中的宽实体必须是浮动的:它不是流的一部分。 tabularx不是浮动环境,table*是。由于它不是浮动环境,因此如果您想要标题,则必须使用命令\captionof

这有效:

\begin{table*}
  \caption{caption}
\noindent \begin{tabularx}{\textwidth}{llX}
\toprule
A & B \\ \midrule

AA and BBBB & aaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj \\
\hline
AA and BBBB &  aaaaabbbbccccddddeeeeffffggggh000000000000000000000000000000000000000000000000000000000000000000000 \\
\bottomrule
\end{tabularx}
\end{table*}

还: 绝不与 acmart 一起使用lmodern!如果软件包显示字体错误,请安装字体。否则您的稿件不符合 ACM 要求。

答案2

如果您希望将表置于插入点,则可以使用strip来自  cuted包(sttoolsbundle)的环境:

\documentclass[sigconf]{acmart}
\usepackage[T1]{fontenc} %to solve the font error
\usepackage{lmodern} %to solve the font error
\usepackage{underscore} %underscores
%-------------------------for the table-----------------------------
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand*\rot{\rotatebox{90}}
\usepackage{tabularx}
\usepackage{threeparttable, tablefootnote}
%-------------------------end table-----------------------------
\usepackage{lipsum}
\usepackage{cuted}
% Copyright
%\setcopyright{none}
%\setcopyright{acmcopyright}
%\setcopyright{acmlicensed}
\setcopyright{rightsretained}
%\setcopyright{usgov}
%\setcopyright{usgovmixed}
%\setcopyright{cagov}
%\setcopyright{cagovmixed}
%\begin{strip}

\begin{document}
\title{Title}

\subtitle{Test}

\author{Author}
\affiliation{%
  \institution{XYZ}}
\email{abc@xyz}

\begin{abstract}
Abstract goes here.
\end{abstract}

\maketitle
\section{Introduction}
\lipsum[1-4]
\begin{strip}
 \centering \begin{tabularx}{\textwidth}{l >{\arraybackslash}X}
\toprule
A & B \\ \midrule

AA and BBBB & aaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj \\
\hline
AA and BBBB & aaaaabbbbccccddddeeeeffffggggh000000000000000000000000000000000000000000000000000000000 000000 000000 \\
\bottomrule
\end{tabularx}
\end{strip}
\lipsum
\lipsum
\end{document} 

在此处输入图片描述

相关内容