3

Allow me to elaborate: I have a square matrix that by padding zeros to the right columns, became non-square. I want to use one zero to represent the zero submatrix to ideally achieve this:

enter image description here

Instead what I got is this:

enter image description here

For the moment I faked it by replacing a \ddot with two dots in consecutive rows hence achieving odd number of rows:

enter image description here

Needless to say I don't like my hack.

Any advice?

\documentclass{article}
\usepackage{bm,delarray}
\begin{document}
    \[
    \bm{\Sigma} = 
      \left[
      \begin{array}{cccc|c}
        \bm{\sigma}_1 & & & & 0 \\ 
        & \bm{\sigma}_2 & & & 0\\ 
        & & \ddots & & 0 \\
        & & & \bm{\sigma}_m & 0
      \end{array}
      \right]
    \]
    \[
    \bm{\Sigma} =
      \left[
      \begin{array}{ccccc|c}
        \bm{\sigma}_1 & & & & &  \\ 
        & \bm{\sigma}_2 & & & & \\ 
        & & . & & & 0 \\
        & & & . & &  \\     
        & & & & \bm{\sigma}_m & 
      \end{array}
      \right]
    \]
\end{document}
2

Nest a matrix in the array

\documentclass{article}
\usepackage{amsmath}
\usepackage{bm}

\begin{document}

\[
\bm{\Sigma} = 
\left[\begin{array}{@{}c|c}
  \begin{matrix}
  \bm{\sigma}_1 \\ 
  & \bm{\sigma}_2 \\ 
  & & \ddots \\
  & & & \bm{\sigma}_m
  \end{matrix}
& 0
\end{array}\right]
\]

\end{document}

enter image description here

  • Thank you. I prefer this answer, mainly because I doesn't include a hard coded value. – Pouya Jan 26 '18 at 14:15
4

This way?

\documentclass{article}
\usepackage{bm, delarray, multirow

\begin{document}

    \[
    \bm{\Sigma} =
      \left[
      \begin{array}{cccc|c}
        \bm{\sigma}_1 & & & & \multirow{4}{*}[-0.5ex]{\Large$ 0 $} \\
        & \bm{\sigma}_2 & & & \\[-0.5ex]
        & & \ddots & & \\[-0.5ex]
        & & & \bm{\sigma}_m &
      \end{array}
      \right]
    \]

\end{document} 

enter image description here

  • From 0 to +1 :-). Hi and good work. – Sebastiano Jan 25 '18 at 21:34
3

A quick work-around: use \smash for \ddots because it has more height than other math symbols. There are other options, of course, if you don't like this hack; one can increase inter-row space via \renewcommand{\arraystretch}{1.5} for example, or adding \vphantom{\ddots} to all other rows without \ddots.

\documentclass{article}
\usepackage{bm,delarray}
\begin{document}
    \[
    \bm{\Sigma} = 
    \left[
    \begin{array}{cccc|c}
    \bm{\sigma}_1 & & & & 0 \\ 
    & \bm{\sigma}_2 & & & 0\\ 
    & & \smash{\vcenter{\hbox{$\ddots$}}} & & 0 \\
    & & & \bm{\sigma}_m & 0
    \end{array}
    \right]
    \]
\end{document}

enter image description here

  • Thank you very much. It is definitely better than my hack and I also learned about \smash. With that said, I would like to have a single 0 on the right hand side instead of four. Just like first image in my question. – Pouya Jan 25 '18 at 19:01
  • May be \vdots in the third row in the right hand side? – Manuel Jan 25 '18 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.