Tabularray - “包 tabularray 警告:表格宽度太小,需要 5.6181pt!”&单元格中缺少文本

Tabularray - “包 tabularray 警告:表格宽度太小,需要 5.6181pt!”&单元格中缺少文本

我收到错误“Package tabularray 警告:表格宽度太小,需要 5.6181pt 以上!”,搜索后没有找到任何结果。我之前使用过这个包,没有问题。

此外,我的表格中没有显示“已修复”字样。这可能与错误有关,还是其他原因?

请参阅下表的代码和屏幕截图:

\documentclass{article}
\usepackage{tabularray}
\usepackage{float}

\begin{document}

    \begin{table}[H]
    \centering
    \begin{talltblr}[
        caption = {The three different terminal models currently avaliable}
    ]{
      colspec={cccc},
      row{1}={font=\bfseries},
      hlines,
      vlines
    }
        & Standard & {High \\ Performance} & {Flat High \\ Performance} \\
        Antenna & \SetCell[c=3]{c} Electronic Phased Array \\
        Antenna size & 513x303mm & \SetCell[c=2]{c} 575x511mm \\
        Orientation & \SetCell[c=2]{c} {Motorized Self Orienting} & Fixed \\
        Environmental rating & IP54 & \SetCell[c=2]{c} IP56 \\
        Snow Melt Capability & {Up to 40mm / hour} & \SetCell[c=2]{c} {Up to 75mm / hour} \\
        Operating temperature & \SetCell[c=3]{c} {$-30^\circ C$ to $50^\circ C$} \\
        Field of View & $100^\circ$ & \SetCell[c=2]{c} $140^\circ$ \\
        Average Power Usage & 50-75W & \SetCell[c=2]{c} 110-150W \\
        Other & & & {Wind rating: \\ Survivable: 280 kph+} \\

    \end{talltblr}
  \end{table}

\end{document}

表格截图

答案1

您在表格中只使用c列。这种类型的列从内容中获取宽度。最终,您的内容比可用的文本宽度更宽,因此您会收到此警告。为了避免这种情况,您可以至少使用一列,X以便 tabularray 可以调整表格大小以适应可用的文本宽度。

您的表格中看不到“固定”,因为您将其放置在多列单元格之后的单元格中,而该单元格将与它之前的单元格合并。您需要&在多列单元格之后再添加一个,以便将其Fixed放置在两个合并单元格之后的单元格中。

\documentclass{article}

\usepackage{tabularray} 

\begin{document}
       \begin{table}[htbp]
       \centering
       \begin{talltblr}[
           caption = {The three different terminal models currently avaliable}
       ]{
         colspec={XXXX},
         columns={halign=c},
         row{1}={font=\bfseries},
         hlines,
         vlines
       }
           & Standard & {High \\ Performance} & {Flat High \\ Performance} \\
           Antenna & \SetCell[c=3]{c} Electronic Phased Array \\
           Antenna size & 513x303mm & \SetCell[c=2]{c} 575x511mm \\
           Orientation & \SetCell[c=2]{c} {Motorized Self Orienting} & &Fixed \\
           Environmental rating & IP54 & \SetCell[c=2]{c} IP56 \\
           Snow Melt Capability & {Up to 40mm / hour} & \SetCell[c=2]{c} {Up to 75mm / hour} \\
           Operating temperature & \SetCell[c=3]{c} {$-30^\circ C$ to $50^\circ C$} \\
           Field of View & $100^\circ$ & \SetCell[c=2]{c} $140^\circ$ \\
           Average Power Usage & 50-75W & \SetCell[c=2]{c} 110-150W \\
           Other & & & {Wind rating: \\ Survivable: 280 kph+} \\
   
       \end{talltblr}
     \end{table}
   
\end{document}

在此处输入图片描述

答案2

  • 为什么要使用talltblr表格?后面会添加一些表格注释吗(\TblrNote{...})?如果不添加,最好使用tblr表格并将标题移到表格之前(之后\begin{table}
  • 最简单的方法,即表格适合文本区域,表格应该至少有一个X类型的列。
  • 对于默认的article页面布局,表格的列宽应该大于。将表格中的字体大小缩小到并使列的宽度不同\textwidth是合理的。\small
  • 在 MWE 中用于siunitx包装的数量
\documentclass{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\begin{document}
    \begin{table}[ht]
    \caption{The three different terminal models currently available}
    \small
\begin{tblr}{colspec={ X[0.8, l, m] *{2}{X[c, m]} X[1.2, c, m] },
             colsep=3pt,
             row{1}={font=\bfseries},
            hlines, vlines
            }
    &   Standard
            &   High Performance
                    &   Flat High Performance       \\
Antenna
    &   \SetCell[c=3]{c}    Electronic Phased Array
            &       &                               \\
Antenna size
    &   \qtyproduct{513x303}{mm}
            &   \SetCell[c=2]{c} \qtyproduct{575x511}{mm}
                    &                               \\
Orientation
    &   \SetCell[c=2]{c}    Motorized Self Orienting
            &   Fixed
                    &                               \\
Environmental rating
    &   IP54
            &   \SetCell[c=2]{c}    IP56
                    &                               \\
Snow Melt Capability
    &   Up to \qty{40}{\milli\metre\per\hour}
            &   \SetCell[c=2]{c}  \qty{75}{\milli\metre\per\hour} Up
                    &                               \\
Operating temperature
    &   \SetCell[c=3]{c}  \qtyrange{-30}{50}{\degreeCelsius}
            &       &                               \\
Field of View
    &   \qty{100}{\degreeCelsius}
            &   \SetCell[c=2]{c}    \qty{140}{\degreeCelsius}
                    &                               \\
Average Power Usage
    &   \qtyrange{50}{75}{\watt}
            & \SetCell[c=2]{c}  \qtyrange{110}{150}{\watt}
                    &                               \\
Other
    &       &       &   Wind rating: Survivable: \qty{280}{kph+}
                                                    \\
\end{tblr}
    \end{table}
\end{document}

在此处输入图片描述

(红线表示页面布局)

相关内容