6

I would like to create something like this:

       i
 (           )
 (           )
 (______     )
j(      |    )
 (      |    )

The matrix including its submatrix can be created by using multicolumn

\[
\left(
\begin{array}{p{3mm}p{3mm}p{3mm}p{3mm}p{3mm}}
    &&&&\\
    &&&&\\
    \cline{1-3}
    &&\multicolumn{1}{c|}{}&&\\
    &&\multicolumn{1}{c|}{}&&\\
    &&\multicolumn{1}{c|}{}&&\\
    &&\multicolumn{1}{c|}{}&&
\end{array}
\right)
\]

but this doesn't work with bordermatrix.

4 Answers 4

4

A flexible way of creating bordermatrix is the blkarray package. It allows to position delimiters in arbitrary positions only on some lines with a {block} environment. Here’s the same example as in Herbert’s answer:

alt text

\documentclass{article}

\usepackage{blkarray}

\begin{document}

\[
  \begin{blockarray}{cccccc}
     &   &   & i &   &   \\
  \begin{block}{c\Left{}{(\mkern1mu}ccccc<{\mkern1mu})}
     & 0 & a & b & c & d \\
     & 0 & A & B & C & D \\
  \cline{2-4}
  \begin{block*}{c(ccc|cc)}
   j & s & t & u & v & w \\
     & t &   & v &   &   \\
     & u &   & w &   &   \\
     & V & W & z & Y & Z \\
  \end{block*}
  \end{block}
  \end{blockarray}
\]

\end{document}

To avoid the \cline to go past the left parenthesis, I had to use \Left{}{(\mkern1mu} instead of ( as the left delimiter and, for symmetry, I added on the right a <{\mkern1mu}.

3
  • Looks nice in principle, but the manual correction of the \cline doesn't really make it hassle-free. Jan 15, 2011 at 10:13
  • @Hendrik: You are right, but compared to other solutions where you must put a multicolumn in each cell, I would consider this probably to be less of a hassle. Jan 15, 2011 at 14:16
  • That's why I said "looks nice". It would be even nicer to have the best of both worlds. Jan 15, 2011 at 14:18
4
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\def\mc#1{\multicolumn{1}{c|}{#1}}

\[
\begin{array}{cc}
     &  i \\
\put(0,-10){\makebox(0,0){j}} &
\left(
\begin{array}{p{3mm}p{3mm}p{3mm}p{3mm}p{3mm}}
    0&a&b&c&d\\
    0&A&B&C&D\\\cline{1-3}
    s&t&\mc{u}&v&w\\
    t&&\mc{v}&&\\
    u&&\mc{w}&&\\
    V&W&\mc{x}&Y&Z
\end{array}
\right)

\end{array}
\]

\end{document} 

alt text

2

Here is a solution with {NiceTabular} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\[
\begin{pNiceMatrix}[first-col,first-row,margin=1pt]
&   &   & i \\
\Block{6-1}{j}
& 0 & a & b & c & d \\
& 0 & A & B & C & D \\
& \Block[borders={top,right}]{4-3}{}
  s & t & u & v & w \\
& t &   & v \\
& u &   & w \\
& V & W & x & Y & Z  
\end{pNiceMatrix}
\]

\end{document} 

Output of the above code

If you don't want instructions within the main array, you can also draw the rules by using an TikZ instruction in the so-called \CodeAfter.

\documentclass{article}
\usepackage{nicematrix,tikz}

\begin{document}

\[
\begin{pNiceMatrix}[first-col,first-row,margin=1pt]
   &   &   & i \\
   \Block{6-1}{j}
   & 0 & a & b & c & d \\
   & 0 & A & B & C & D \\
   &   s & t & u & v & w \\
   & t &   & v \\
   & u &   & w \\
   & V & W & x & Y & Z  
\CodeAfter
   \tikz \draw (3-|1) -| (last-|4) ; 
\end{pNiceMatrix}
\]

\end{document} 

The output is the same.

0

Here's a skeleton of an idea without having to guess position for the put command...but I wasn't sure what you wanted to do with the lines.... I thought you can add them with addpath (an easymat command) but I was having trouble...anyhow, I'll put the answer here and see if it is helpful...

\documentclass{minimal}

\usepackage{easybmat}

\begin{document}
\begin{equation}
  \begin{BMAT}{cc}{cc}
&
\begin{BMAT}(b){ccccc}{c}
 1&2&3&4&5
\end{BMAT}
\\
\begin{BMAT}(b){c}{ccccc}
1\\2\\3\\4\\5\\  
\end{BMAT}
&
\left[\begin{BMAT}(b){ccccc}{ccccc}
  1&2&3&4&5\\  1&2&3&4&5\\  1&2&3&4&5\\  1&2&3&4&5\\  1&2&3&4&5
\end{BMAT}\right]
 \end{BMAT}
\end{equation}
\end{document}][1]

which gives: alt text

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .