3

I have a matrix with this form:

\usepackage{amsmath,amssymb,amsthm}
\newcommand{\dd}{{\rm d}}

\begin{equation}
    \left(
     \begin{array}{c c c c}
      1 & 0 & \ldots & 0 \\
      \dd_{1,1} & \dd_{1,2} & \ldots & \dd_{1,N} \\
      \mathcal{A} \\
      \dd_{N,1} & \dd_{N,2} & \ldots & \dd_{N,N} \\
      0 & 0 & \ldots & 1 
      \end{array}
    \right)
   \end{equation}

enter image description here

I want to center the letter A to be in this form:

enter image description here

2 Answers 2

1

\multicolumn also works in environment array:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\dd}{{\rm d}}

\begin{document}
\begin{equation}
    \left(
     \begin{array}{c c c c}
      1 & 0 & \ldots & 0 \\
      \dd_{1,1} & \dd_{1,2} & \ldots & \dd_{1,N} \\
      \multicolumn{4}{c}{\mathcal{A}} \\
      \dd_{N,1} & \dd_{N,2} & \ldots & \dd_{N,N} \\
      0 & 0 & \ldots & 1
      \end{array}
    \right)
   \end{equation}
\end{document}

Result

Package amsmath provides environments for matrices (with better spacing of the brackets). Additionally, a little vertical space is added on top of the line with "A", see Mico's comment.

\documentclass{article}
\usepackage{amsmath}

\newcommand{\dd}{{\rm d}}

\begin{document}
\begin{equation}
  \begin{pmatrix}
    1 & 0 & \ldots & 0 \\
    \dd_{1,1} & \dd_{1,2} & \ldots & \dd_{1,N} \\[.5ex]
    \multicolumn{4}{c}{\mathcal{A}} \\
    \dd_{N,1} & \dd_{N,2} & \ldots & \dd_{N,N} \\
    0 & 0 & \ldots & 1
  \end{pmatrix}
\end{equation}
\end{document}

Result with pmatrix

2
  • for visual symmetry, I'd be temped to add 1ex of vertical whitespace to the row terminator right before \multicolumn{}{}{}.
    – Mico
    Commented May 21, 2018 at 19:01
  • @Mico Thanks, I have added a little vertical space (.5ex) in the second example. I am afraid that too much space makes the matrix too asymmetrical, especially, if there is more than the matrix in the equation. Commented May 21, 2018 at 19:13
1

I did 2 things: moved the column containing the "A" to the right (with the use of &), and I \rlaped it with some added kern.

You might also consider using one of the amsmath environments, rather than array.

\documentclass{article}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}

\newcommand{\dd}{{\rm d}}
\begin{document}
\begin{equation}
    \left(
     \begin{array}{c c c c}
      1 & 0 & \ldots & 0 \\
      \dd_{1,1} & \dd_{1,2} & \ldots & \dd_{1,N} \\
      &\rlap{\kern10pt$\mathcal{A}$} \\
      \dd_{N,1} & \dd_{N,2} & \ldots & \dd_{N,N} \\
      0 & 0 & \ldots & 1 
      \end{array}
    \right)
   \end{equation}
\end{document}

enter image description here

You must log in to answer this question.

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