# Can someone Fix this monster

\begin{pmatrix}
m_{1+}\hat{p}_{1H}\hat{q}_{1H} & \multicolumn{2}{c}{\text{\kern0.5em\smash{\raisebox{-1ex}{\Large 0}}}} & \multicolumn{1}{|c}{m_{12}\hat{p}_{1H}\hat{q}_{1H}}  \\
& \ddots &  &\multicolumn{1}{|c}{\vdots}\\
\multicolumn{2}{c}{\text{\kern-0.5em\smash{\raisebox{0.75ex}{\Large 0}}}} & m_{I+}\hat{p}_{IH}\hat{q}_{IH} & \multicolumn{1}{|c}{m_{I2}\hat{p}_{IH}\hat{q}_{IH}} \\
\cline{1-5} \\ m_{12}\hat{p}_{1H}\hat{q}_{1H} & \hdots & m_{I2}\hat{p}_{IH}\hat{q}_{IH} & \multicolumn{1}{|c}{\sum_{i=1}^I m_{i2}\hat{p}_{iH}\hat{q}_{iH}}
\end{pmatrix}


I want this:

I have this:

-
Please post a minimal working example next time. You haven't done that in any of your questions so far. – Svend Tveskæg Jun 24 '14 at 17:52

I didn't use the pmatrix, but the arrayenvironment, and the multirow package to put the 0 in 2 rows... I think it's better...

Here's what I've got :

Here is a MWE :

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsthm, amssymb, amsfonts}

\usepackage{multirow}

\renewcommand\arraystretch{1.5} % To increase the spaces between rows...

\begin{document}

$\left( \begin{array}{ccc|c} m_{1+}\hat{p}_{1H}\hat{q}_{1H} & & \multirow{2}{*}{\Large 0} & m_{12}\hat{p}_{1H}\hat{q}_{1H} \\ \multirow{2}{*}{\Large 0} & \ddots & & \vdots\\ & & m_{I+}\hat{p}_{IH}\hat{q}_{IH} & m_{I2}\hat{p}_{IH}\hat{q}_{IH} \\ \hline m_{12}\hat{p}_{1H}\hat{q}_{1H} & \hdots & m_{I2}\hat{p}_{IH}\hat{q}_{IH} & \displaystyle{\sum_{i=1}^I m_{i2}\hat{p}_{iH}\hat{q}_{iH}} \end{array} \right)$

\end{document}


I hope it helps...

PS : the displaystyle option in the last cell is to force LaTeX to write the expression like in classical math mode...

-

I would stay away from that monster and instead go with

\documentclass[]{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\diagfences}{(}{)}
\newcommand{\diag}{\operatorname{diag}\diagfences}

\begin{document}\noindent
Let $a$ be the vector and m be the diagonal matrix given by
$a = \begin{pmatrix}\hat{p}_{1H}\hat{q}_{1H} & \ldots & \hat{p}_{IH}\hat{q}_{IH}\end{pmatrix}^T \!\!,\ \ m = \diag{m_{12},\ldots,m_{I2}},$
then the info matrix $A$ is given by
$A = \begin{pmatrix}m+\diag{a}&ma\\ (ma)^T &\;\ \|ma\|_1\end{pmatrix}$

\end{document}