![当我在 \begin{array} 中使用顶部对齐时,分隔符大小会增加,需要将其删除。请提供解决方案](https://linux22.com/image/372008/%E5%BD%93%E6%88%91%E5%9C%A8%20%5Cbegin%7Barray%7D%20%E4%B8%AD%E4%BD%BF%E7%94%A8%E9%A1%B6%E9%83%A8%E5%AF%B9%E9%BD%90%E6%97%B6%EF%BC%8C%E5%88%86%E9%9A%94%E7%AC%A6%E5%A4%A7%E5%B0%8F%E4%BC%9A%E5%A2%9E%E5%8A%A0%EF%BC%8C%E9%9C%80%E8%A6%81%E5%B0%86%E5%85%B6%E5%88%A0%E9%99%A4%E3%80%82%E8%AF%B7%E6%8F%90%E4%BE%9B%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88.png)
梅威瑟:
\documentclass{book}
\usepackage{amsmath,amssymb,amsfonts}
\begin{document}
\begin{tabular}{llll}
\textbf{3} & Write this information in a matrix. Remember to use square brackets. & \textbf{3} & $\left\{\begin{array}[t]{r@{\hskip0.25em}c@{\hskip0.25em}l}
140 & 58 & 85\cr
200 & 125 & 150\end{array}\right\}$
\end{tabular}
\end{document}
答案1
该delarray
软件包提供了解决方案:
\documentclass{book}
\usepackage{amsmath,amssymb,amsfonts,delarray}
\begin{document}
\noindent
\begin{tabular}{lp{.6\textwidth}l}
\textbf{3} &
Write this information in a matrix. Remember to use square brackets. &
\setlength{\arraycolsep}{0.25em}%
$\begin{array}[t]\lbrack{@{}rcl@{}}\rbrack
140 & 58 & 85\\\
200 & 125 & 150
\end{array}$
\\[6ex]
\textbf{4} &
Write this information in a matrix. Remember to use braces. &
\setlength{\arraycolsep}{0.25em}%
$\begin{array}[t]\lbrace{@{}rcl@{}}\rbrace
140 & 58 & 85\\\
200 & 125 & 150
\end{array}$
\end{tabular}
\end{document}
答案2
两种可能,取决于您想要的垂直对齐方式。请确保使用最新版本的tabstackengine 2018/03/05 (V2.10)
。
经过修改的答案与rcl
对齐
\documentclass{book}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{tabstackengine}
\begin{document}
\begin{tabular}{llll} \textbf{3} & Write this information in a matrix.
Remember to use square brackets. & \textbf{3} &
$\left[\tabularCenterstack{rcl}{ 140 & 58 & 85\\ 200 & 125 & 150}\right]$ \end{tabular}
\bigskip
\begin{tabular}{llll} \textbf{3} & Write this information in a matrix.
Remember to use square brackets. & \textbf{3} & \belowbaseline[-\ht\strutbox]{%
$\left[\tabularCenterstack{rcl}{ 140 & 58 & 85\\ 200 & 125 & 150}\right]$} \end{tabular}
\end{document}
列间间隙可以用 重置\setstacktabulargap{<length>}
,默认为\tabcolsep
。
原始答案左对齐
\documentclass{book}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{tabstackengine}
\setstacktabbedgap{1ex}
\renewcommand\stackalignment{l}
\begin{document}
\begin{tabular}{llll} \textbf{3} & Write this information in a matrix.
Remember to use square brackets. & \textbf{3} &
$\bracketMatrixstack{ 140 & 58 & 85\\ 200 & 125 & 150}$ \end{tabular}
\bigskip
\begin{tabular}{llll} \textbf{3} & Write this information in a matrix.
Remember to use square brackets. & \textbf{3} & \belowbaseline[-\ht\strutbox]{%
$\bracketMatrixstack{ 140 & 58 & 85\\ 200 & 125 & 150}$} \end{tabular}
\end{document}
如果您想要矩阵左/右端的额外空间,只需在两端添加一个额外的空白列:$\bracketMatrixstack{&140 & 58 & 85&\\&200 & 125 & 150&}$
同样,如果使用堆栈上的可选参数\renewcommand\stackalignment{l}
,则可以消除声明[l]
\bracketMatrixstack[l]{ 140 & 58 & 85\\ 200 & 125 & 150}
答案3
您必须创建\vtop
第一行支撑的位置,然后是负跳过\baselineskip
,然后\hbox
在数学模式下打印矩阵的位置。
{\bf 3}\quad\vtop{\hbox{\strut}\vskip-\baselineskip\nointerlineskip\hbox{%
$\left\{\matrix{140 & 58 & 85\cr 200 & 125 & 150}\right\}$}}
\bye