I need to write following matrix equation in LaTex.
The dotted lines shown need to be present in the structure but need not have colors (could as well be black). I have used it here only to show the alignment needed. I also need to have the dimensions specified for various blocks as shown. What's the best way to do it?
[Tex/LaTex] Block matrix equation with dimensioning
arraysmatrices
Related Solutions
With the code of this answer, and a bit of effort (manual tweaking). I got this (far from optimal, but if you have to fight with this kind of matrix only one time, it might work).
I used the \coolunder
, \coolover
, \coolrightbrace
and \coolleftbrace
from the answer I linked, but a bit tweaked to adapt the mtpro2
package. The reason to use the mtpro2
package is that it provides those curly long braces. If you don't have this font/package, just change the definitions of the commands to
\newcommand\coolover[2]{\mathrlap{\smash{\overbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2}
\newcommand\coolunder[2]{\mathrlap{\smash{\underbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2}
\newcommand\coolleftbrace[2]{%
#1\left\{\vphantom{\begin{matrix} #2 \end{matrix}}\right.}
\newcommand\coolrightbrace[2]{%
\left.\vphantom{\begin{matrix} #1 \end{matrix}}\right\}#2}
Code
Here it is the code. As I said, it is far from optimal (it has a lot of phantom
s):
\documentclass{scrartcl}
\usepackage{mathtools}
\usepackage{newtxtext}
\usepackage[lite]{mtpro2}
\usepackage{multirow}
\usepackage[hmargin=1.5cm]{geometry}% You have to find the way to deal with the margins.
% You can comment this (only used to get the appearence of the image).
\setkomafont{captionlabel}{\scshape}
\setcounter{equation}{4}
\setcounter{figure}{1}
% The commands used to get the desired braces.
\newcommand\coolover[2]{\mathrlap{\smash{\overcbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2}
\newcommand\coolunder[2]{\mathrlap{\smash{\undercbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2}
\newcommand\coolleftbrace[2]{%
#1\LEFTRIGHT\{.{\vphantom{\begin{matrix} #2 \end{matrix}}}}
\newcommand\coolrightbrace[2]{%
\LEFTRIGHT.\}{\vphantom{\begin{matrix} #1 \end{matrix}}}#2}
\newcommand\Vdots{\vdots}% You can change the size/appearence of the dots in
\newcommand\Cdots{\cdots}% the matrixes easily changing this definitions.
\begin{document}
\begin{center}
\bfseries PHILIP E. PFEIFER AND STUART JAY DEUTCH
\end{center}
\begin{figure}[h!]
\small
\centering
\begin{equation}
\begin{matrix}
\coolleftbrace{s = 1}{\\ \\ \vphantom{\Vdots} \\ \\} \\
\coolleftbrace{s = 2}{\\ \\ \vphantom{\Vdots} \\ \\} \\
\vphantom{\Vdots} \\
\coolleftbrace{s = k}{\\ \\ \vphantom{\Vdots} \\ \\}
\end{matrix}%
\begin{bmatrix}
\gamma_{00}(1) \\
\gamma_{01}(1) \\
\Vdots \\
\gamma_{\lambda0}(1) \\ \hline
\gamma_{00}(2) \\
\gamma_{01}(2) \\
\Vdots \\
\gamma_{\lambda0}(2) \\ \hline
\Vdots \\ \hline
\gamma_{00}(1) \\
\gamma_{01}(1) \\
\Vdots \\
\gamma_{\lambda0}(1)
\end{bmatrix}
=
\left[
\begin{array}{@{} cccc|cccc|c|c @{}}
\gamma_{00}(0) & \gamma_{01}(0) & \Cdots & \gamma_{0\lambda}(0) & \gamma_{00}(-1) & \gamma_{01}(-1) & \Cdots & \gamma_{0\lambda}(-1) & \multirow{4}{*}{$\Cdots$} & \multirow{4}{*}{$(1 - k)$} \\
\gamma_{10}(0) & \gamma_{11}(0) & \Cdots & \gamma_{1\lambda}(0) & \gamma_{10}(-1) & \gamma_{11}(-1) & \Cdots & \gamma_{1\lambda}(-1) & & \\
\multicolumn{4}{c|}{\Vdots} & \multicolumn{4}{c|}{\Vdots} & & \\
\gamma_{\lambda0}(0) & \gamma_{\lambda1}(0) & \Cdots & \gamma_{\lambda\lambda}(0) & \gamma_{\lambda0}(-1) & \gamma_{\lambda1}(-1) & \Cdots & \gamma_{\lambda\lambda}(-1) & & \\ \hline
\multicolumn{4}{c|}{\multirow{4}{*}{$(1)$}} & \multicolumn{4}{c|}{\multirow{4}{*}{$(0)$}} & & \multirow{4}{*}{$(2 - k)$} \\
& & & & & & & & & \\
& & & & & & & \vphantom{\Vdots} & & \\
& & & & & & & & & \\ \hline
\multicolumn{4}{c|}{\Vdots} & \multicolumn{4}{c|}{\Vdots} & & \Vdots \\ \hline
\multicolumn{4}{c|}{\multirow{4}{*}{$(k - 1)$}} & \multicolumn{4}{c|}{\multirow{4}{*}{$(k - 2)$}} & \multirow{4}{*}{$\Cdots$} & \multirow{4}{*}{$(0)$} \\
& & & & & & & & & \\
& & & & & & & \vphantom{\Vdots} & & \\
\coolunder{j = 1}{\hphantom{\gamma_{00}(0)} & \hphantom{\gamma_{01}(0)} & \hphantom{\Cdots} & \hphantom{\gamma_{0\lambda}(0)}} & \coolunder{j = 2}{\hphantom{\gamma_{00}(-1)} & \hphantom{\gamma_{01}(-1)} & \hphantom{\Cdots} & \hphantom{\gamma_{0\lambda}(1)}} & & \coolunder{j = k}{\hphantom{(1 - k)}}
\end{array}
\right]
\begin{bmatrix}
\phi_{10} \\
\phi_{11} \\
\Vdots \\
\phi_{1\lambda} \\ \hline
\phi_{20} \\
\phi_{21} \\
\Vdots \\
\phi_{2\lambda} \\ \hline
\Vdots \\ \hline
\phi_{k0} \\
\phi_{k1} \\
\Vdots \\
\phi_{k\lambda}
\end{bmatrix}
\end{equation}\bigskip
\caption{The space-time analogue of the Yule-Walker equations}
\end{figure}
\end{document}
And this is how it looks:
You can do it like this, provided your main matrix has no unusually big objects (otherwise you can play with the first argument to \dottedcolumn
that also accepts decimal numbers).
\documentclass{article}
\usepackage{amsmath}
\newcommand{\dottedcolumn}[3]{%
\settowidth{\dimen0}{$#1$}
\settowidth{\dimen2}{$#2$}
\ifdim\dimen2>\dimen0 \dimen0=\dimen2 \fi
\begin{pmatrix}\,
\vcenter{
\kern.6ex
\vbox to \dimexpr#1\normalbaselineskip-1.2ex{
\hbox{$#2$}
\kern3pt
\xleaders\vbox{\hbox to \dimen0{\hss.\hss}\vskip4pt}\vfill
\kern1pt
\hbox{$#3$}
}\kern.6ex}\,
\end{pmatrix}
}
\begin{document}
\begin{equation}
\begin{pmatrix}
a_1 & b_1 & & & &\\
c_2 & a_2 & b_2 & & &\\
& c_3 & a_3 & b_3 & &\\
& & c_4 & a_4 & b_4 &\\
& & & c_5 & a_5 & b_5\\
& & & & c_6 & a_6
\end{pmatrix}
\dottedcolumn{6}{T_1}{T_6}=\dottedcolumn{6}{d_1}{d_6}
\end{equation}
\end{document}
Best Answer
A possibility using TikZ and
matrix of math nodes
(from thematrix
library) to build the natrices; the braces for the dimensions were built using abrace
decoration from thedecorations.pathreplacing
library:Perhaps you should consider whether there's another way to display the information? Removing the braces with the dimensions and using a single dashed style improves the result: