我需要编写一个复杂的矩阵,其结构如附图所示。
答案1
这blkarray
该包允许使用相对简单的代码来执行复杂的边界矩阵:
\documentclass{article}
\usepackage{blkarray}
\usepackage{multirow}
\begin{document}
\[
\begin{blockarray}{cc|cccc|cccc}
& 1\dots 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 \\
\begin{block}{c(c|cccc|cccc@{\hspace*{5pt}})}
A'_1 & A_1 & \BAmulticolumn{4}{c|}{\multirow{4}{*}{$I$}}&\BAmulticolumn{4}{c}{\multirow{4}{*}{$I$}}\\
A'_2 & A_2 & &&&&&&&\\
A'_3 & A_3 & &&&&&&&\\
A'_4 & A_4 & &&&&&&&\\
\cline{1-10}% don't use \hline
B'_1 & B_1 & \BAmulticolumn{4}{c|}{\multirow{4}{*}{$J$}}&\BAmulticolumn{4}{c}{\multirow{4}{*}{$I$}}\\
B'_2 & B_2 & &&&&&&&\\
B'_3 & B_3 & &&&&&&&\\
B'_4 & B_4 & &&&&&&&\\
\end{block}
\end{blockarray}
\]
\end{document}
答案2
\documentclass{article}
\usepackage{blkarray}
\def\Big#1{\makebox(0,0){\huge#1}}
\begin{document}
\[
\begin{blockarray}{cc|c|c}
& 1\ldots18&19\,20\,21\,22&23\,24\,25\,26\\
\begin{block}{c(c|c|c)}
A_1^\prime & A_1 & & \\
A_2^\prime & A_2 & \Big{I}& \Big{I}\\
A_3^\prime & A_3 & & \\
A_4^\prime & A_4 & & \\\cline{1-4}
B_1^\prime & B_1 & & \\
B_2^\prime & B_2 &\Big{J} & \Big{I}\\
B_3^\prime & B_3 & & \\
B_4^\prime & B_4 & & \\
\end{block}
\end{blockarray}
\]
\end{document}
答案3
感谢大家。我自己也设法找到了解决方案。我使用了包kbordermatrix
。但是,数学期刊经常希望自己排版 tex 文件,而他们没有所有的包。我相信至少有一种变体可以工作。所以再次感谢:)我的解决方案如下:
\documentclass{article}
\usepackage{kbordermatrix}
\begin{document}
\begin{equation}
\kbordermatrix{
& 1 \ldots 18 & \vrule & 19 \text{ } 20 \text{ } 21 \text{ } 22 & \vrule & 23 \text{ } 24 \text{ } 25 \text{ } 26 \\
\begin{array}{c} \chi(A'_1) \\ \chi(A'_2) \\ \chi(A'_3) \\ \chi(A'_4) \end{array}
& \begin{array}{c} \chi(A_1) \\ \chi(A_2) \\ \chi(A_3) \\ \chi(A_4) \end{array}
& \vrule & I & \vrule& I \\ \hline
\begin{array}{c} \chi(B'_1) \\ \chi(B'_2) \\ \chi(B'_3) \\ \chi(B'_4) \end{array}
& \begin{array}{c} \chi(B_1) \\ \chi(B_2) \\ \chi(B_3) \\ \chi(B_4) \end{array}
& \vrule & J & \vrule& I } ,
\end{equation}
\end{document}
答案4
Plain-kru 代表:
\font\Large=cmr10 at 20pt
\newcount\rowcount\rowcount=3
\def\fudge#1{\smash{\hbox{\Large#1}}}
\def\doublyso{\kern-.5em\smash{\vrule height \rowcount em depth .2em}\hidewidth}
$\bordermatrix{
\global\everycr{\noalign{\global\advance\rowcount by 1}}
&1\ldots18&19\;20\;21\;22&23\;24\;25\;26 \cr
A_1'&A_1\cr
A_2'&A_2\cr
A_3'&A_3&\fudge I&\fudge I\cr
A_4'&A_4\cr
\noalign{\smallskip\hrule\smallskip}
B_1'&B_1\cr
B_2'&B_2\cr
B_3'&B_3&\fudge J&\fudge I\cr
B_4'&B_4&\doublyso&\doublyso\cr
}$
\everycr={}
\bye
在我的 ”模仿\atopwithdelims
思路“-spree,我也做了一个(它是仅以分隔符作为参数的\bordermatrix
平原):\bordermatrix
\catcode`@=11
\def\bordermatrixwithdelims#1#2#3{\begingroup \m@th
\setbox0=\vbox{\def\cr{\crcr\noalign{\kern2pt\global\let\cr=\endline}}
\ialign{$##$\hfil\kern2pt\kern\p@renwd&\thinspace\hfil$##$\hfil
&&\quad\hfil$##$\hfil\crcr
\omit\strut\hfil\crcr\noalign{\kern-\baselineskip}
#3\crcr\omit\strut\cr}}
\setbox2=\vbox{\unvcopy0 \global\setbox1=\lastbox}
\setbox2=\hbox{\unhbox1 \unskip \global\setbox1=\lastbox}
\setbox2=\hbox{$\kern\wd1\kern-\p@renwd \left#1 \kern-\wd1
\global\setbox1=\vbox{\box1\kern2pt}
\vcenter{\kern-\ht1 \unvbox0 \kern-\baselineskip} \,\right#2$}
\null\;\vbox{\kern\ht1\box2}\endgroup}
\catcode`@=12
%
\def\cbordermatrix#1{\bordermatrixwithdelims[]{#1}}
\def\bbordermatrix#1{\bordermatrixwithdelims\{\}{#1}}
\def\vbordermatrix#1{\bordermatrixwithdelims||{#1}}
%
$$
\bordermatrix{&[a]&[b]\cr &1&2\cr&3&4}
\cbordermatrix{&[a]&[b]\cr &1&2\cr&3&4}
\bbordermatrix{&[a]&[b]\cr &1&2\cr&3&4}
\vbordermatrix{&[a]&[b]\cr &1&2\cr&3&4}
$$
\bye
因此,为了实现 OP 所确定的外观,只需将\bordermatrix
我原来的答案中的调用替换为\cbordermatrix