30 tblr环境提示表格宽度太小.

发布于 2025-03-30 20:04:07

总是提示:
Package tabularray: Table width is too small, need 5.58028pt more!

表格宽度太小,怎么加大表格宽度

\documentclass{standalone}
\usepackage{tabularray}
\usepackage{ctex}
\usepackage{graphicx}
\begin{document}
\begin{tblr}{
    hlines,
    vlines,
    colspec={Q[c,5cm]Q[c,3cm]Q[c,3cm]},
    }
     表示&图示 &符号\\
    法1: &c &\(\angle AOB\)\\
    
\end{tblr}
\end{document}   

查看更多

关注者
0
被浏览
201
Sagittarius Rover
我要成为Typst糕手/(ㄒoㄒ)/~~

原始回复

你的MWE在我这里(TeXLive2025+windows11)没有任何警告出现。

猜测你的\documentclass\usepackage{tabularray}之间有其他对\geometry的设置(?)。

image.png

表格宽度太小,怎么加大表格宽度

你的代码里的Q[c,5cm]正是使用Q列格式控制宽度的方法

更新TL2024的情况

在TeXPage里使用TL2024+xelatex确实可以复现你的警告(我猜是TL2025 tblr更新了什么....):

image.png

image.png

3 个回答
远方不远
远方不远 1天前
Hello, LuaLaTeX!

以下内容是我胡邹的:

tabularray从这一段看来:似乎是将总表宽与某一刚性长度进行比较,然后决定是否给出该警告:

\cs_new_protected:Npn \__tblr_compute_extendable_column_width:
{
\__tblr_collect_extendable_column_width:
\dim_compare:nNnTF { \l__column_target_dim } < { 0pt }
{
\msg_warning:nnx { tabularray } { table-width-too-small }
{ \dim_abs:n { \l__column_target_dim } }
}
{
\prop_if_empty:NF \l__column_coefficient_prop
{ \__tblr_adjust_extendable_column_width: }
}
}

standalone的页面尺寸,似乎不是一开始就决定了的:

\newbox\sa@box
\pagestyle{empty}
\hoffset=-72.27pt
\voffset=-72.27pt
\topmargin=0pt
\headheight=0pt
\headsep=0pt
\marginparsep=0pt
\marginparwidth=0pt
\footskip=0pt
\marginparpush=0pt
\oddsidemargin=0pt
\evensidemargin=0pt
\topskip=0pt
\textheight=\maxdimen
\def\sa@boxit{%
    \setbox\sa@box\hbox\bgroup\color@setgroup\sa@varwidth
}%
\def\endsa@boxit{%
    \sa@endvarwidth\color@endgroup\egroup
}%

所以standalone不断地在计算页面尺寸,直到tabularray已经将表格拼装完成后,standalone计算页面尺寸的工作还未结束,以致tabularray只好将当前standalone计算出的最终页面尺寸进行比较,所以tabularray等不及了就抛出了该警告。

时珍
时珍 1天前
面对困难的勇气!

它提示我太小,我就加宽,结果还是报错。原来我误会了,提示我太小,我应该将列宽和继续减小

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览