3
\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:

enter image description here

I have this:

enter image description here

1

2 Answers 2

7

Here is what I made...

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 : My Solution

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...

11

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}

with tiny adjustments here and there thanks to Aditya's recommendation.

enter image description here

3
  • I appreciate the sound advice :)
    – bdeonovic
    Jun 18, 2014 at 2:14
  • In this notation, you can also get rid of the horizontal and vertical lines.
    – Aditya
    Jun 24, 2014 at 15:51
  • @Aditya Well said. I'll update
    – percusse
    Jun 24, 2014 at 17:26

You must log in to answer this question.

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