![删除数组单元格之间的特定逗号](https://linux22.com/image/296651/%E5%88%A0%E9%99%A4%E6%95%B0%E7%BB%84%E5%8D%95%E5%85%83%E6%A0%BC%E4%B9%8B%E9%97%B4%E7%9A%84%E7%89%B9%E5%AE%9A%E9%80%97%E5%8F%B7.png)
考虑以下代码:
\documentclass{article}
\usepackage{colortbl}
\usepackage{cancel}
\newcommand*\nonly[1]{\cancel{\textcolor{red}{#1}}}
\begin{document}
\begin{equation}
\left\{
\begin{array}{c @{\,,\,} c @{\,,\,} c @{\,,\,} c @{\,,\phantom{,}}}
& & & \frac{1983}{4} \\[1ex]
\frac{1984}{4} & \frac{1985}{4} & \frac{1986}{4} & \frac{1987}{4} \\[1ex]
\frac{1988}{4} & \frac{1989}{4} & \frac{1990}{4} & \frac{1991}{4} \\[1ex]
\frac{1992}{4} & \frac{1993}{4} & \frac{1994}{4} & \frac{1996}{5} \\[1ex]
\frac{1996}{4} & \frac{1997}{4} & \frac{1998}{4} & \frac{1999}{4}
\end{array}
\right\}
=
\left\{
\begin{array}{c @{\ ,\ } c @{\ ,\ } c @{\ ,\ } c @{\ ,\phantom{,}}}
& & & \nonly{495.75} \\[1ex]
496 & \nonly{496.25} & \nonly{496.5} & \nonly{496.75} \\[1ex]
497 & \nonly{497.25} & \nonly{497.5} & \nonly{497.75} \\[1ex]
498 & \nonly{498.25} & \nonly{498.5} & \nonly{498.75} \\[1ex]
499 & \nonly{499.25} & \nonly{499.5} & \nonly{499.75}
\end{array}
\right\}
\end{equation}
\end{document}
问题
如何删除两个列表中的前三个逗号和最后一个逗号?
答案1
\multicolumn
内部也有效array
。最后一列可以通过添加与第一列类似的细间距,
来移除。\phantom
\documentclass{article}
\usepackage{colortbl}
\usepackage{cancel}
\newcommand*\nonly[1]{\cancel{\textcolor{red}{#1}}}
\begin{document}
\begin{equation}
\left\{
\begin{array}{c @{\,,\,} c @{\,,\,} c @{\,,\,} c @{\,,\,}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \frac{1983}{4} \\[1ex]
\frac{1984}{4} & \frac{1985}{4} & \frac{1986}{4} & \frac{1987}{4} \\[1ex]
\frac{1988}{4} & \frac{1989}{4} & \frac{1990}{4} & \frac{1991}{4} \\[1ex]
\frac{1992}{4} & \frac{1993}{4} & \frac{1994}{4} & \frac{1996}{5} \\[1ex]
\frac{1996}{4} & \frac{1997}{4} & \frac{1998}{4} &
\multicolumn{1}{@{\!}c}{\frac{1999}{4}}
\end{array}
\right\}
=
\left\{
\begin{array}{c @{\ ,\ } c @{\ ,\ } c @{\ ,\ } c @{\ ,\phantom{,}}}
\multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \nonly{495.75} \\[1ex]
496 & \nonly{496.25} & \nonly{496.5} & \nonly{496.75} \\[1ex]
497 & \nonly{497.25} & \nonly{497.5} & \nonly{497.75} \\[1ex]
498 & \nonly{498.25} & \nonly{498.5} & \nonly{498.75} \\[1ex]
499 & \nonly{499.25} & \nonly{499.5} & \multicolumn{1}{@{\!\!\!}c}{\nonly{499.75}}
\end{array}
\right\}
\end{equation}
\end{document}