我想创建一个可以放在任何我指定位置的表。因此我遵循此链接
但是,我最后几列的内容是重叠的。我猜想这与线有关 \begin{tabularx}{\linewidth}{|l|c|*{4}{>{\RaggedRight\arraybackslash}X|}}
,但我不太明白它的作用,如果有人可以向我解释一下的话。
编辑:
这是名为 acl.sty 的文件
% This is the LaTex style file for *ACL.
% The official sources can be found at
%
% https://github.com/acl-org/ACLPUB/
%
% This package is activated by adding
%
% \usepackage{acl}
%
% to your LaTeX file. When submitting your paper for review, add the "review" option:
%
% \usepackage[review]{acl}
\newif\ifacl@finalcopy
\DeclareOption{final}{\acl@finalcopytrue}
\DeclareOption{review}{\acl@finalcopyfalse}
\ExecuteOptions{final} % final copy is the default
% include hyperref, unless user specifies nohyperref option like this:
% \usepackage[nohyperref]{acl}
\newif\ifacl@hyperref
\DeclareOption{hyperref}{\acl@hyperreftrue}
\DeclareOption{nohyperref}{\acl@hyperreffalse}
\ExecuteOptions{hyperref} % default is to use hyperref
\ProcessOptions\relax
\typeout{Conference Style for ACL 2020}
\usepackage{float}
\usepackage{xcolor}
\usepackage{tabularx}
\ifacl@hyperref
\PassOptionsToPackage{breaklinks}{hyperref}
\RequirePackage{hyperref}
% make links dark blue
\definecolor{darkblue}{rgb}{0, 0, 0.5}
\hypersetup{colorlinks=true, citecolor=darkblue, linkcolor=darkblue, urlcolor=darkblue}
\else
% This definition is used if the hyperref package is not loaded.
% It provides a backup, no-op definiton of \href.
% This is necessary because \href command is used in the acl_natbib.bst file.
\def\href#1#2{{#2}}
\usepackage{url}
\fi
\ifacl@finalcopy
% Hack to ignore these commands, which review mode puts into the .aux file.
\newcommand{\@LN@col}[1]{}
\newcommand{\@LN}[2]{}
\else
% Add draft line numbering via the lineno package
% https://texblog.org/2012/02/08/adding-line-numbers-to-documents/
\usepackage[switch,mathlines]{lineno}
\usepackage[
separate-uncertainty = true,
multi-part-units = repeat
]{siunitx}
% Line numbers in gray Helvetica 8pt
\font\aclhv = phvb at 8pt
\renewcommand\linenumberfont{\aclhv\color{lightgray}}
% Zero-fill line numbers
% NUMBER with left flushed zeros \fillzeros[<WIDTH>]<NUMBER>
\newcount\cv@tmpc@ \newcount\cv@tmpc
\def\fillzeros[#1]#2{\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi
\cv@tmpc=1 %
\loop\ifnum\cv@tmpc@<10 \else \divide\cv@tmpc@ by 10 \advance\cv@tmpc by 1 \fi
\ifnum\cv@tmpc@=10\relax\cv@tmpc@=11\relax\fi \ifnum\cv@tmpc@>10 \repeat
\ifnum#2<0\advance\cv@tmpc1\relax-\fi
\loop\ifnum\cv@tmpc<#1\relax0\advance\cv@tmpc1\relax\fi \ifnum\cv@tmpc<#1 \repeat
\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi \relax\the\cv@tmpc@}%
\renewcommand\thelinenumber{\fillzeros[3]{\arabic{linenumber}}}
\linenumbers
\setlength{\linenumbersep}{1.6cm}
% Bug: An equation with $$ ... $$ isn't numbered, nor is the previous line.
% Patch amsmath commands so that the previous line and the equation itself
% are numbered. Bug: multline has an extra line number.
% https://tex.stackexchange.com/questions/461186/how-to-use-lineno-with-amsmath-align
\usepackage{etoolbox} %% <- for \pretocmd, \apptocmd and \patchcmd
\newcommand*\linenomathpatch[1]{%
\expandafter\pretocmd\csname #1\endcsname {\linenomath}{}{}%
\expandafter\pretocmd\csname #1*\endcsname {\linenomath}{}{}%
\expandafter\apptocmd\csname end#1\endcsname {\endlinenomath}{}{}%
\expandafter\apptocmd\csname end#1*\endcsname {\endlinenomath}{}{}%
}
\newcommand*\linenomathpatchAMS[1]{%
\expandafter\pretocmd\csname #1\endcsname {\linenomathAMS}{}{}%
\expandafter\pretocmd\csname #1*\endcsname {\linenomathAMS}{}{}%
\expandafter\apptocmd\csname end#1\endcsname {\endlinenomath}{}{}%
\expandafter\apptocmd\csname end#1*\endcsname {\endlinenomath}{}{}%
}
%% Definition of \linenomathAMS depends on whether the mathlines option is provided
\expandafter\ifx\linenomath\linenomathWithnumbers
\let\linenomathAMS\linenomathWithnumbers
%% The following line gets rid of an extra line numbers at the bottom:
\patchcmd\linenomathAMS{\advance\postdisplaypenalty\linenopenalty}{}{}{}
\else
\let\linenomathAMS\linenomathNonumbers
\fi
\AtBeginDocument{%
\linenomathpatch{equation}%
\linenomathpatchAMS{gather}%
\linenomathpatchAMS{multline}%
\linenomathpatchAMS{align}%
\linenomathpatchAMS{alignat}%
\linenomathpatchAMS{flalign}%
}
\fi
\iffalse
\PassOptionsToPackage{
a4paper,
top=2.21573cm,left=2.54cm,
textheight=24.7cm,textwidth=16.0cm,
headheight=0.17573cm,headsep=0cm
}{geometry}
\fi
\PassOptionsToPackage{a4paper,margin=2.5cm}{geometry}
\RequirePackage{geometry}
\setlength\columnsep{0.6cm}
\newlength\titlebox
\setlength\titlebox{5cm}
\flushbottom \twocolumn \sloppy
% We're never going to need a table of contents, so just flush it to
% save space --- suggested by drstrip@sandia-2
\def\addcontentsline#1#2#3{}
\ifacl@finalcopy
\thispagestyle{empty}
\pagestyle{empty}
\else
\pagenumbering{arabic}
\fi
%% Title and Authors %%
\newcommand{\Thanks}[1]{\thanks{\ #1}}
\newcommand\outauthor{
\begin{tabular}[t]{c}
\ifacl@finalcopy
\bf\@author
\else
% Avoiding common accidental de-anonymization issue. --MM
\bf Anonymous ACL submission
\fi
\end{tabular}}
% Mostly taken from deproc.
\def\maketitle{\par
\begingroup
\def\thefootnote{\fnsymbol{footnote}}
\def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}
\twocolumn[\@maketitle] \@thanks
\endgroup
\setcounter{footnote}{0}
\let\maketitle\relax \let\@maketitle\relax
\gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}
\def\@maketitle{\vbox to \titlebox{\hsize\textwidth
\linewidth\hsize \vskip 0.125in minus 0.125in \centering
{\Large\bf \@title \par} \vskip 0.2in plus 1fil minus 0.1in
{\def\and{\unskip\enspace{\rm and}\enspace}%
\def\And{\end{tabular}\hss \egroup \hskip 1in plus 2fil
\hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\bf}%
\def\AND{\end{tabular}\hss\egroup \hfil\hfil\egroup
\vskip 0.25in plus 1fil minus 0.125in
\hbox to \linewidth\bgroup\large \hfil\hfil
\hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\bf}
\hbox to \linewidth\bgroup\large \hfil\hfil
\hbox to 0pt\bgroup\hss
\outauthor
\hss\egroup
\hfil\hfil\egroup}
\vskip 0.3in plus 2fil minus 0.1in
}}
% margins and font size for abstract
\renewenvironment{abstract}%
{\centerline{\large\bf Abstract}%
\begin{list}{}%
{\setlength{\rightmargin}{0.6cm}%
\setlength{\leftmargin}{0.6cm}}%
\item[]\ignorespaces%
\@setsize\normalsize{12pt}\xpt\@xpt
}%
{\unskip\end{list}}
%\renewenvironment{abstract}{\centerline{\large\bf
% Abstract}\vspace{0.5ex}\begin{quote}}{\par\end{quote}\vskip 1ex}
% Resizing figure and table captions - SL
% Support for interacting with the caption, subfigure, and subcaption packages - SL
\RequirePackage{caption}
\DeclareCaptionFont{10pt}{\fontsize{10pt}{12pt}\selectfont}
\captionsetup{font=10pt}
\RequirePackage{natbib}
% for citation commands in the .tex, authors can use:
% \citep, \citet, and \citeyearpar for compatibility with natbib, or
% \cite, \newcite, and \shortcite for compatibility with older ACL .sty files
\renewcommand\cite{\citep} % to get "(Author Year)" with natbib
\newcommand\shortcite{\citeyearpar}% to get "(Year)" with natbib
\newcommand\newcite{\citet} % to get "Author (Year)" with natbib
% Bibliography
% Don't put a label in the bibliography at all. Just use the unlabeled format
% instead.
\def\thebibliography#1{\vskip\parskip%
\vskip\baselineskip%
\def\baselinestretch{1}%
\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%
\vskip-\parskip%
\vskip-\baselineskip%
\section*{References\@mkboth
{References}{References}}\list
{}{\setlength{\labelwidth}{0pt}\setlength{\leftmargin}{\parindent}
\setlength{\itemindent}{-\parindent}}
\def\newblock{\hskip .11em plus .33em minus -.07em}
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode`\.=1000\relax}
\let\endthebibliography=\endlist
% Allow for a bibliography of sources of attested examples
\def\thesourcebibliography#1{\vskip\parskip%
\vskip\baselineskip%
\def\baselinestretch{1}%
\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%
\vskip-\parskip%
\vskip-\baselineskip%
\section*{Sources of Attested Examples\@mkboth
{Sources of Attested Examples}{Sources of Attested Examples}}\list
{}{\setlength{\labelwidth}{0pt}\setlength{\leftmargin}{\parindent}
\setlength{\itemindent}{-\parindent}}
\def\newblock{\hskip .11em plus .33em minus -.07em}
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode`\.=1000\relax}
\let\endthesourcebibliography=\endlist
% sections with less space
\def\section{\@startsection {section}{1}{\z@}{-2.0ex plus
-0.5ex minus -.2ex}{1.5ex plus 0.3ex minus .2ex}{\large\bf\raggedright}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-1.8ex plus
-0.5ex minus -.2ex}{0.8ex plus .2ex}{\normalsize\bf\raggedright}}
%% changed by KO to - values to get the initial parindent right
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-1.5ex plus
-0.5ex minus -.2ex}{0.5ex plus .2ex}{\normalsize\bf\raggedright}}
\def\paragraph{\@startsection{paragraph}{4}{\z@}{1.5ex plus
0.5ex minus .2ex}{-1em}{\normalsize\bf}}
\def\subparagraph{\@startsection{subparagraph}{5}{\parindent}{1.5ex plus
0.5ex minus .2ex}{-1em}{\normalsize\bf}}
% Footnotes
\footnotesep 6.65pt %
\skip\footins 9pt plus 4pt minus 2pt
\def\footnoterule{\kern-3pt \hrule width 5pc \kern 2.6pt }
\setcounter{footnote}{0}
% Lists and paragraphs
\parindent 1em
\topsep 4pt plus 1pt minus 2pt
\partopsep 1pt plus 0.5pt minus 0.5pt
\itemsep 2pt plus 1pt minus 0.5pt
\parsep 2pt plus 1pt minus 0.5pt
\leftmargin 2em \leftmargini\leftmargin \leftmarginii 2em
\leftmarginiii 1.5em \leftmarginiv 1.0em \leftmarginv .5em \leftmarginvi .5em
\labelwidth\leftmargini\advance\labelwidth-\labelsep \labelsep 5pt
\def\@listi{\leftmargin\leftmargini}
\def\@listii{\leftmargin\leftmarginii
\labelwidth\leftmarginii\advance\labelwidth-\labelsep
\topsep 2pt plus 1pt minus 0.5pt
\parsep 1pt plus 0.5pt minus 0.5pt
\itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii\advance\labelwidth-\labelsep
\topsep 1pt plus 0.5pt minus 0.5pt
\parsep \z@ \partopsep 0.5pt plus 0pt minus 0.5pt
\itemsep \topsep}
\def\@listiv{\leftmargin\leftmarginiv
\labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
\def\@listv{\leftmargin\leftmarginv
\labelwidth\leftmarginv\advance\labelwidth-\labelsep}
\def\@listvi{\leftmargin\leftmarginvi
\labelwidth\leftmarginvi\advance\labelwidth-\labelsep}
\abovedisplayskip 7pt plus2pt minus5pt%
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip 0pt plus3pt%
\belowdisplayshortskip 4pt plus3pt minus3pt%
% Less leading in most fonts (due to the narrow columns)
% The choices were between 1-pt and 1.5-pt leading
\def\@normalsize{\@setsize\normalsize{11pt}\xpt\@xpt}
\def\small{\@setsize\small{10pt}\ixpt\@ixpt}
\def\footnotesize{\@setsize\footnotesize{10pt}\ixpt\@ixpt}
\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{16pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{20pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{23pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{28pt}\xxvpt\@xxvpt}
这是我的 .tex 文件
% This must be in the first 5 lines to tell arXiv to use pdfLaTeX, which is strongly recommended.
\pdfoutput=1
% In particular, the hyperref package requires pdfLaTeX in order to break URLs across lines.
\documentclass[11pt]{article}
\usepackage{arabtex,lipsum}
\usepackage{utf8}
\setcode{utf8}
\usepackage{tabularx, lipsum}
\usepackage[review]{acl}
\usepackage{ragged2e}
\begin{document}
\section{Introduction}
\noindent\setlength\tabcolsep{4pt}%
\begin{tabularx}{\linewidth}{|l|*{4}{>{\RaggedRight\arraybackslash}X|}}
\hline
System & Warm up steps& Initial warm up learning rate &BLEU $(\mu \pm 0.95 \%)$ & CHRF2++ $(\mu \pm 0.95 \%)$ \\ [0.4ex]
\hline
Baseline & 4000 & 1e-7 & 31.8 $(31.8 \pm 0.9)$ & 54.1 $(54.1 \pm 0.7)$\\
\hline
System 1& 2000 & 1e-7 & 32.0 $(31.9 \pm 0.9)$(p=0.1858) & 55.2 $(55.2 \pm 0.7)$p(0.0010)*\\
\hline
System 2 & 1500 & 1e-7 & 31.9 $(31.8 \pm 0.9)$(p=0.3407) & 55.2 $(55.1 \pm 0.7)$p(0.0010)*\\
\hline
System 3 & 2000 & 1e-5 & 32.0 $(31.9 \pm 0.9)$(p=0.2048) & 55.2 $(55.2 \pm 0.7)$p(0.0010)*\\
\hline
System 4 & 1500 & 1e-5 & 31.8 $(31.8 \pm 0.9)$(p=0.4086) & 55.2 $(55.2 \pm 0.7)$p(0.0010)*\\
\hline
System 5 & 500 & 1e-5 & 31.6 $(31.6 \pm 0.9)$(p=0.1898) & 55.0 $(54.9 \pm 0.7)$p(0.0010)*\\
\hline
\end{tabularx}
\end{document}
上述结果如下;
当我删除 \usepackage[review]{acl}
表格时,它看起来很好,如下图所示:
答案1
您的表格有两个版本。两个表格都跨越两个文本列。
\documentclass[11pt]{article}
\usepackage[review]{acl}
\usepackage{tabularx}
\usepackage{ragged2e}
%%% Just used for the second example table:
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{makecell}
\begin{document}
\section{Introduction}
\begin{table*}
\setlength\tabcolsep{4pt}%
\begin{tabularx}{\linewidth}{|l|l|*{3}{>{\RaggedRight\arraybackslash}X|}}
\hline
System & Warm up steps& Initial warm up learning rate &BLEU $(\mu \pm 0.95 \%)$ & CHRF2++ $(\mu \pm 0.95 \%)$ \\ [0.4ex]
\hline
Baseline & 4000 & 1e-7 & 31.8 $(31.8 \pm 0.9)$ & 54.1 $(54.1 \pm 0.7)$\\
\hline
System 1& 2000 & 1e-7 & 32.0 $(31.9 \pm 0.9)$(p=0.1858) & 55.2 $(55.2 \pm 0.7)$p(0.0010)*\\
\hline
System 2 & 1500 & 1e-7 & 31.9 $(31.8 \pm 0.9)$(p=0.3407) & 55.2 $(55.1 \pm 0.7)$p(0.0010)*\\
\hline
System 3 & 2000 & 1e-5 & 32.0 $(31.9 \pm 0.9)$(p=0.2048) & 55.2 $(55.2 \pm 0.7)$p(0.0010)*\\
\hline
System 4 & 1500 & 1e-5 & 31.8 $(31.8 \pm 0.9)$(p=0.4086) & 55.2 $(55.2 \pm 0.7)$p(0.0010)*\\
\hline
System 5 & 500 & 1e-5 & 31.6 $(31.6 \pm 0.9)$(p=0.1898) & 55.0 $(54.9 \pm 0.7)$p(0.0010)*\\
\hline
\end{tabularx}
\end{table*}
\begin{table*}
\centering
\caption{Experiment 3 significance test with different hyperparameter tuning. P-values < 0.05 are marked with "*"}
\label{table:ft_scores}
\begin{tabular}{@{}lS[table-format=4]S[table-format=e1] *{2}{S[table-format=2.1]@{\;(}S[table-format=2.1(2)]@{)\;}l} @{}}
\toprule
\thead[l]{System} & {\thead{Warm up\\ steps}}& {\thead{Initial\\ warm up\\ learning rate}} & \multicolumn{3}{l}{\thead[l]{BLEU $(\mu \pm 0.95 \%)$}} & \multicolumn{3}{l}{\thead[l]{CHRF2++ $(\mu \pm 0.95 \%)$}} \\
\midrule
Baseline & 4000 & 1e-7 & 31.8 & 31.8(9) & & 54.1 & 54.1(7) \\
System 1 & 2000 & 1e-7 & 32.0 & 31.9(9) & (p=0.1858) & 55.2 & 55.2(7) & p(0.0010)* \\
System 2 & 1500 & 1e-7 & 31.9 & 31.8(9) & (p=0.3407) & 55.2 & 55.1(7) & p(0.0010)*\\
System 3 & 2000 & 1e-5 & 32.0 & 31.9(9) & (p=0.2048) & 55.2 & 55.2(7) & p(0.0010)*\\
System 4 & 1500 & 1e-5 & 31.8 & 31.8(9) & (p=0.4086) & 55.2 & 55.2(7) & p(0.0010)*\\
System 5 & 500 & 1e-5 & 31.6 & 31.6(9) & (p=0.1898) & 55.0 & 54.9(7) & p(0.0010)*\\
\bottomrule
\end{tabular}
\end{table*}
\end{document}