Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\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

share|improve this question
2  
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 at 17:52

2 Answers 2

up vote 7 down vote accepted

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

share|improve this answer

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.