如何使 tabularray 的宽度更小,以适合文本

如何使 tabularray 的宽度更小,以适合文本

我想让这个表格适合文本宽度,但目前它超出了页面。我似乎无法让它工作。在此处输入图片描述

编辑:我正在使用以下代码:

\begin{table}
  \caption{Most used packages using Betweenness Centrality algorithm}
  \label{tab:betweenness}
  \centering
  \begin{tblr}{
      colspec={lllll},
      row{1}={font=\bfseries},
      column{1}={font=\itshape},
      row{even}={bg=gray!10},
    }
              & GroupID:ArtifactID:Version  & Score   \\
    \toprule
    1st & org.apache.maven.shared:maven-plugin-testing-harness:1.1 & 1260395 \\ 
    2nd & org.codehaus.groovy:groovy-all:2.4.9 & 592518 \\
    3rd & org.apache.maven:maven-core:3.5.2 & 567962 \\
    4th & org.apache.logging.log4j:log4j-core:2.9.1 & 518696 \\
    5th & ch.qos.logback:logback-classic:1.2.3 & 436116 \\
    \bottomrule
  \end{tblr}
\end{table} 

这是我使用的文档代码和包:

\documentclass{article}
\pdfpagewidth=8.5in
\pdfpageheight=11in
\usepackage{ijcai20}

% Use the postscript times font!
\usepackage{times}
\renewcommand*\ttdefault{txtt}
\usepackage{soul}
\usepackage{url}
\usepackage[hidelinks]{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[small]{caption}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{paralist}
\usepackage{array}
\usepackage{tabularray}
\captionsetup[table]{name=TABLE}
\renewcommand{\thetable}{\Roman{table}}
\UseTblrLibrary{booktabs}
\usepackage[breaklinks]{hyperref}
  \let\itemize\compactitem
  \let\enditemize\endcompactitem
  \let\enumerate\compactenum
  \let\endenumerate\endcompactenum
  \let\description\compactdesc
  \let\enddescription\endcompactdesc
  \pltopsep=1pt
  \plitemsep=1pt
  \plparsep=1pt
\usepackage[shortlabels]{enumitem}
\usepackage{listings}
\usepackage{xcolor}
\usepackage[T1]{fontenc}
\usepackage{sectsty}
\sectionfont{\normalfont\centering\scshape}
\subsectionfont{\normalfont\itshape}
\renewcommand\thesection{\Roman{section}}
\renewcommand\thesubsection{\Alph{subsection}}

\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{FFFFFF}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}

\lstdefinelanguage{json}{
    basicstyle=\normalfont\ttfamily,
    numbers=left,
    numberstyle=\scriptsize,
    stepnumber=1,
    numbersep=8pt,
    showstringspaces=false,
    breaklines=true,
    frame=lines,
    backgroundcolor=\color{background},
    literate=
     *{0}{{{\color{numb}0}}}{1}
      {1}{{{\color{numb}1}}}{1}
      {2}{{{\color{numb}2}}}{1}
      {3}{{{\color{numb}3}}}{1}
      {4}{{{\color{numb}4}}}{1}
      {5}{{{\color{numb}5}}}{1}
      {6}{{{\color{numb}6}}}{1}
      {7}{{{\color{numb}7}}}{1}
      {8}{{{\color{numb}8}}}{1}
      {9}{{{\color{numb}9}}}{1}
      {:}{{{\color{punct}{:}}}}{1}
      {,}{{{\color{punct}{,}}}}{1}
      {\{}{{{\color{delim}{\{}}}}{1}
      {\}}{{{\color{delim}{\}}}}}{1}
      {[}{{{\color{delim}{[}}}}{1}
      {]}{{{\color{delim}{]}}}}{1},
}

\urlstyle{same}

我采用双栏格式书写

相关内容