我不明白为什么这会产生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}