![使用 tblr 填充不足的 hbox](https://linux22.com/image/468239/%E4%BD%BF%E7%94%A8%20tblr%20%E5%A1%AB%E5%85%85%E4%B8%8D%E8%B6%B3%E7%9A%84%20hbox%20.png)
我不明白为什么这会产生Underfull \hbox (badness 10000)
警告:
\documentclass{article}
\usepackage{enumitem}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}
\usepackage{xcolor}
\NewDocumentEnvironment{mytblr}{+b}{
\noindent\begin{tblr}{hlines, vlines, colspec={X[1]X[2]}, measure=vbox, row{1} = {gray8,font=\bfseries}, stretch=-1, rowsep=4pt, row{2-Z} = {font=\footnotesize}}
#1
\end{tblr}
}{}
\begin{document}
\begin{mytblr}
Case & Description \\
A & B \\
C & D \\
\end{mytblr}
\end{document}
先感谢您!
答案1
%
l.11 末尾缺少一个。如果没有它,未受保护的行尾将充当空格,导致新环境太宽而无法容纳在一行中。
\documentclass{article}
\usepackage{enumitem}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}
\usepackage{xcolor}
\NewDocumentEnvironment{mytblr}{+b}{%
\noindent\begin{tblr}{hlines, vlines, colspec={X[1]X[2]}, measure=vbox, row{1} = {gray8,font=\bfseries}, stretch=-1, rowsep=4pt, row{2-Z} = {font=\footnotesize}}
#1
\end{tblr}%
}{}
\begin{document}
\begin{mytblr}
Case & Description \\
A & B \\
C & D \\
\end{mytblr}
\end{document}