答案1
为此任务定义新环境是有意义的:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\newmatrix}[3]{% #1 = prefix, #2/#3 = left/right delimiters
\newenvironment{#1matrix}{\left#2\env@matrix}{\endmatrix\right#3}%
}
\makeatother
\newmatrix{cf}{\lceil}{\rfloor}
\newmatrix{fc}{\lfloor}{\rceil}
\begin{document}
\[
\begin{cfmatrix}
a_1 & a_2 & \dots & a_n \\
b_1 & b_2 & \dots & b_n
\end{cfmatrix}
\ne
\begin{fcmatrix}
a_1 & a_2 & \dots & a_n \\
b_1 & b_2 & \dots & b_n
\end{fcmatrix}
\]
\end{document}
“前缀”可以是任何尚未使用的字符串。
再多做一些工作,它就可以支持*
在mathtools
样式中定义 -variant,即接受一个可选参数来设置列对齐方式,并一次性设置“小”变量。
\documentclass{article}
\usepackage{amsmath,mathtools}
\MHInternalSyntaxOn
\makeatletter
\newcommand{\newmatrix}[3]{%
% #1 = prefix, #2/#3 = left/right delimiters
\newenvironment{#1matrix}
{\left#2\env@matrix}
{\endmatrix\right#3}%
\newenvironment{#1matrix*}[1][c]
{\left#2\MT_matrix_begin:N ##1}
{\MT_matrix_end:\right#3}
\MT_fenced_sm_generator:nnn{#1smallmatrix}{#2}{#3}
}
\makeatother
\MHInternalSyntaxOff
\newmatrix{cf}{\lceil}{\rfloor}
\newmatrix{fc}{\lfloor}{\rceil}
\begin{document}
\begin{gather*}
\begin{cfmatrix}
a_1 & a_2 & \dots & a_n \\
b_1 & b_2 & \dots & b_n
\end{cfmatrix}
\ne
\begin{fcmatrix}
a_1 & a_2 & \dots & a_n \\
b_1 & b_2 & \dots & b_n
\end{fcmatrix}
\\
\begin{cfmatrix}
a_1 & a_2 & \dots & a_n \\
b_1 & b_2 & \dots & b_n
\end{cfmatrix}
\ne
\begin{fcmatrix*}[r]
111 & 44 & \dots & -2 \\
2 & 333 & \dots & 5
\end{fcmatrix*}
\\
\begin{cfsmallmatrix}
a_1 & a_2 & \dots & a_n \\
b_1 & b_2 & \dots & b_n
\end{cfsmallmatrix}
\ne
\begin{fcsmallmatrix}
a_1 & a_2 & \dots & a_n \\
b_1 & b_2 & \dots & b_n
\end{fcsmallmatrix}
\end{gather*}
\end{document}