5

I would like to write the dimensions of a matrix below the matrix itself, but I managed only to either:

  1. write the dimensions below the matrix with underbrace (see matrix A in my code)
  2. write the dimensions as a subscript of the matrix (see matrix B in my code)

What I want is (1) but without any underbrace sign, and possibly the n*n written in a smaller font. I attach below a MWE

\documentclass{beamer}

\usepackage{amssymb}
\usepackage{mathpazo}
\usepackage{multimedia}
\usepackage{amsfonts}
\usepackage{amsmath}

\setcounter{MaxMatrixCols}{10}

\title{Title}
\subtitle{Subtitle}
\author{Author}
\date{}
\institute[Universities Here and There]{Your Institution}


\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section{Introduction}

\begin{frame}\frametitle{Write dimensions below matrix}
\begin{center}
$
\begin{bmatrix}
\underbrace{A}_{n\times n} & B_{n\times n} \\ 
C & D%
\end{bmatrix}%
$
\end{center}

\end{frame}
\end{document}

2 Answers 2

6

Use \underset, with \scriptscriptstyle in order to reduce the size.

Note that loading mathpazo does nothing unless you select suitable font themes.

\documentclass{beamer}

\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage{mathpazo}

\begin{document}

\begin{frame}\frametitle{Write dimensions below matrix}

\[
\begin{bmatrix}
\underset{\scriptscriptstyle n\times n}{A} &
\underset{\scriptscriptstyle n\times n}{B} \\[1.5ex]
C & D
\end{bmatrix}
\]

\end{frame}
\end{document}

Avoid awkward constructions such as \begin{center}$<formula>$\end{center}: displaymath is much better, with its shorthand \[...\].

enter image description here

4

with using of the package stackengine:

\documentclass{beamer}

\usepackage{amssymb}
\usepackage{mathpazo}
%\usepackage{multimedia} not relevant for your problem
%\usepackage{amsfonts}   loaded by amssymb
\usepackage{amsmath}
%\setcounter{MaxMatrixCols}{10}
\usepackage{stackengine}



\begin{document}

\begin{frame}
\frametitle{Write dimensions below matrix}
\[\stackMath
\begin{bmatrix}
\stackunder{A}{_{n\times n}}  & \stackunder{B}{_{n\times n}} \\[2ex]
         C              &          D
\end{bmatrix}%
\]
\end{frame}
\end{document}

enter image description here

or see, if writing matrix symbol in \mathbf{...} better emphasize matrices:

\begin{frame}
\frametitle{Write dimensions below matrix}
\[\stackMath
\begin{bmatrix}
\stackunder{\mathbf{A}}{_{n\times n}}  & \stackunder{\mathbf{B}}{_{n\times n}} \\[2ex]
         C              &          D
\end{bmatrix}%
\]
\end{frame}

which gives

enter image description here

You must log in to answer this question.

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